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
ye0lde
Using existing local variables instead of reading state variables will save gas by converting SLOADs to MLOADs.
_keyPrice and _tokenAddress can be used here: https://github.com/code-423n4/2021-11-unlock/blob/ec41eada1dd116bcccc5603ce342257584bec783/smart-contracts/contracts/mixins/MixinLockCore.sol#L185
sender can be used here: https://github.com/code-423n4/2021-11-unlock/blob/ec41eada1dd116bcccc5603ce342257584bec783/smart-contracts/contracts/utils/UnlockOwnable.sol#L32
Visual Studio Code, Remix
Use the local variable instead of the state variable.
The text was updated successfully, but these errors were encountered:
ye0lde issue #121
d06b748
No branches or pull requests
Handle
ye0lde
Vulnerability details
Impact
Using existing local variables instead of reading state variables will save gas by converting SLOADs to MLOADs.
Proof of Concept
_keyPrice and _tokenAddress can be used here:
https://github.com/code-423n4/2021-11-unlock/blob/ec41eada1dd116bcccc5603ce342257584bec783/smart-contracts/contracts/mixins/MixinLockCore.sol#L185
sender can be used here:
https://github.com/code-423n4/2021-11-unlock/blob/ec41eada1dd116bcccc5603ce342257584bec783/smart-contracts/contracts/utils/UnlockOwnable.sol#L32
Tools Used
Visual Studio Code, Remix
Recommended Mitigation Steps
Use the local variable instead of the state variable.
The text was updated successfully, but these errors were encountered: