I am adding approximately 3 ~ 5 new entries into the mapping, while the old one will be obsolete after a week.

If the mapping grow larger, is it going to consume more gasses?

Is there a need for me to remove them since they are no longer needed.

1 Answer 1


You pass gas to store the value in the first place. There are no future charges for keeping the data there.

That said, you can get a gas refund for deleting the existing data. That can only offset gas used for a new transaction. So if you can manage to delete the old ones while adding the new ones in the same transaction, you'll save gas (and thus ether) by doing so.

  • smarx, thanks for the answer. So adding an entry into a mapping (regardless if it has 0 or 1000000 entries) will always consume the same amount of gas right?
    – s k
    Commented Aug 19, 2018 at 14:05
  • That's correct.
    – user19510
    Commented Aug 19, 2018 at 15:18

Your Answer

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

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