Delete parent mapping with child mapping #583
steventhornton
started this conversation in
Level idea
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
The idea for this level to have a contract with a mapping that contains a mapping. Somewhere within the contract, an entry of the parent mapping would be deleted but the child mapping would remain in storage.
For example,
where somewhere
delete balances[msg.sender]
is used (say they withdraw their entire balance) but this doesn't delete values inbalances[msg.sender].pendingBalances
. Some logic could be included to check ifbalances[msg.sender].balance == 0
and assume that the users balance is uninitialized in this case.I don't know exactly where the vulnerability would be introduced yet to make it an interesting level but could probably add some accounting error somewhere when assuming a users position is uninitialized that would allow the user to withdraw more tokens than they should be able to.
Beta Was this translation helpful? Give feedback.
All reactions