I have a contract here: contract source code

It's a simple one that allows users to create new key:value mappings with bytes32 variables, as well as update the value of a key given that:

  1. the key is owned (was initially set by) the msg.sender
  2. the mapping is not empty (which I express by doing require(items[key] != 0)

However I get a transaction reverted when trying to update even with the user being the one who initially set the key:value and it being not empty. Could anyone tell me why? Thanks.

1 Answer 1


In the reverted tx above you are calling setItem again which is failing due to probably trying to override a value that's already set. Check the transaction using the tenderly dashboard for more in-depth logs and easier debugging.

Apart from that, your contract works as intended (set value tx, change value tx)

  • Wow, how embarrassing... I need to do better to double check what's in front of me. Thank you for that and introducing me to Tenderly. Cheers.
    – oi_geeza
    Jan 11, 2022 at 19:55

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.