I would have liked cleaning the storage without destructing the contract not to mutate the code. However, to delete a mapping you need to delete each value independently, which is only possible if you stored all the keys before. So we would need to store the addresses that withdrawn in an array address[] which would make every withdraw more expensive by 20k gas.
I don't believe it is worth it, so I use selfdestruct() instead.
closes https://github.com/trustlines-protocol/merkle-drop/issues/24
I would have liked cleaning the storage without destructing the contract not to mutate the code. However, to delete a mapping you need to delete each value independently, which is only possible if you stored all the keys before. So we would need to store the addresses that withdrawn in an array
address[]
which would make every withdraw more expensive by 20k gas.I don't believe it is worth it, so I use
selfdestruct()
instead.