Pieces Protocol

First Flight #32
Beginner FriendlyFoundrySolidityNFT
100 EXP
View results
Submission Details
Severity: low
Invalid

Local variable `tokenInfo` in `TokenDivider::claimNft` unnecessarily declared as `storage`

Description:
If a local variable is declared inside a function, and it's only used within a single function call, it is recommended to declare it as memory, and not as storage, since the latter option will modify the contract's storage, therefore increasing gas costs.

Tools Used:
Manual review

Recommended Mitigation:
It is recommended to change the variable declaration to memory.

- ERC20Info storage tokenInfo = nftToErc20Info[nftAddress];
+ ERC20Info memory tokenInfo = nftToErc20Info[nftAddress];
Updates

Lead Judging Commences

fishy Lead Judge 5 months ago
Submission Judgement Published
Invalidated
Reason: Non-acceptable severity

Support

FAQs

Can't find an answer? Chat with us on Discord, Twitter or Linkedin.