-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
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
Gas Optimizations #274
Comments
raymondfam marked the issue as sufficient quality report |
G10 in bot findings G4 is false // SPDX-License-Identifier: MIT
pragma solidity 0.8.20;
contract TestConstant{
uint constant MAX_UINT256 = type(uint256).max;
// gas cost: 149
function control() public returns (uint256) {
return type(uint256).max;
}
// gas cost: 171
function test() public returns (uint256) {
return MAX_UINT256;
}
} G12 is false // SPDX-License-Identifier: MIT
pragma solidity 0.8.20;
contract TestIndexed{
event Unindexed(address a, uint b, bool c);
event Indexed(address indexed a, uint b, bool c);
function control() public returns (uint256) {
address a = address(0);
emit Unindexed(a,0, false);
return 0;
}
function test() public returns (uint256) {
address a = address(0);
emit Indexed(a,0, false);
return 0;
}
}
As for G6 - the savings seem to actually be ~450 per instance (when optimization is turned on), and I'm not sure it'd work for every case there |
0xA5DF marked the issue as selected for report |
G-01: Invalid the compiler is set to use 0.8.20 The judge has already identified other invalid so not going to repeat them |
Bot reported only on division, this is about subtraction. |
Just a note that C4 is excluding the invalid entries from the official report. |
See the markdown file with the details of this report here.
The text was updated successfully, but these errors were encountered: