sherlock-audit / 2024-10-gamma-rewarder-judging

7 stars 3 forks source link

Joyous Pistachio Lark - [GAS-1] Using bools for storage incurs overhead #241

Closed sherlock-admin2 closed 2 weeks ago

sherlock-admin2 commented 2 weeks ago

Joyous Pistachio Lark

Low/Info

[GAS-1] Using bools for storage incurs overhead

Use uint256(1) and uint256(2) for true/false to avoid a Gwarmaccess (100 gas), and to avoid Gsset (20000 gas) when changing from ‘false’ to ‘true’, after having been ‘true’ in the past. See source.

Instances (1):

File: GammaRewarder.sol

66:     mapping(bytes32 => bool) public vkHashes;