We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
PierrickGT
We can avoid one sload by storing card[_card].longestOwner in a private variable.
card[_card].longestOwner
https://github.com/code-423n4/2021-08-realitycards/blob/514a6157fb7bd0df1d27a4affece131ba5056818/contracts/RCMarket.sol#L550-L551
Manual analysis
Store card[_card].longestOwner in a private variable to avoid one sload.
address _cardLongestOwner = card[_card].longestOwner; if (_user == _cardLongestOwner) { _transferCard(ownerOf(_card), _cardLongestOwner, _card); } else { leaderboard.claimNFT(_user, _card); factory.mintCopyOfNFT(_user, _card); }
The text was updated successfully, but these errors were encountered:
PierrickGT issue #5
9606cea
Duplicate of #6
Sorry, something went wrong.
Not a duplicate, same optimization, different location in the code.
No branches or pull requests
Handle
PierrickGT
Vulnerability details
Impact
We can avoid one sload by storing
card[_card].longestOwner
in a private variable.Proof of Concept
https://github.com/code-423n4/2021-08-realitycards/blob/514a6157fb7bd0df1d27a4affece131ba5056818/contracts/RCMarket.sol#L550-L551
Tools Used
Manual analysis
Recommended Mitigation Steps
Store
card[_card].longestOwner
in a private variable to avoid one sload.The text was updated successfully, but these errors were encountered: