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
WatchPug
https://github.com/code-423n4/2021-12-amun/blob/98f6e2ff91f5fcebc0489f5871183566feaec307/contracts/basket/contracts/factories/PieFactoryContract.sol#L91
for (uint256 i = 0; i < _tokens.length; i++) { IERC20 token = IERC20(_tokens[i]); token.safeTransferFrom(msg.sender, address(pie), _amounts[i]); pie.addToken(_tokens[i]); }
tokens[i] at L91 is already cached in the local variable token at L89, reusing the result instead of doing the subscript operation again can save gas.
tokens[i]
token
The text was updated successfully, but these errors were encountered:
WatchPug issue #213
2d9edea
No branches or pull requests
Handle
WatchPug
Vulnerability details
https://github.com/code-423n4/2021-12-amun/blob/98f6e2ff91f5fcebc0489f5871183566feaec307/contracts/basket/contracts/factories/PieFactoryContract.sol#L91
tokens[i]
at L91 is already cached in the local variabletoken
at L89, reusing the result instead of doing the subscript operation again can save gas.The text was updated successfully, but these errors were encountered: