Review: Check merkeproof is set in claimTokens()
gpersoon opened this issue · 2 comments
Impact
The merkeproof is set at a later moment in time via setMerkleRoot()
If claimTokens() would be used before the merkeproof is set, it wouldn't work
(although this is very unlikely in practice)
Proof of Concept
contracts/contracts/ArenaToken.sol
Lines 74 to 81 in 4a86c18
contracts/contracts/ArenaToken.sol
Lines 134 to 138 in 4a86c18
Tools Used
Recommended Mitigation Steps
Check merkeproof != 0 claimTokens()
hmmm IMO this isn't necessary since claim attempts will already revert as it is. The only benefit is that it will cause the revert to happen earlier, with the downside being a bit more gas for successful claim attempts. Optimizing for the latter would be of greater benefit
No problem to leave it as is, however we are on a chain with low gas fees (polygon) so saving gas isn't that important.