delete a assigns the initial value for the type to a. i.e.
for integers it is equivalent to a = 0, but it can also be used on arrays,
where it assigns a dynamic array of length zero or a static array of the same
length with all elements reset. For structs, it assigns a struct with all members reset.
Similarly, it can also be used to set an address to zero address.
It has no effect on whole mappings though (as the keys of mappings may be arbitrary
and are generally unknown). However, individual keys and what they map to can be deleted:
If a is a mapping, then delete a[x] will delete the value stored at x.
The delete key better conveys the intention and is also more idiomatic.
Consider replacing assignments of zero with delete statements.
There is 1
instance of this issue:
Should use delete
statement instead of claimable[msg.sender] = 0
Replacing assignments of zero with delete statements.
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.