You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Public/external setter functions that emit events to indicate the newly set values can use the function parameters (from memory/calldata) or their cached versions as emit arguments instead of the state variables that were just written to because SLOADs cost 2100/100 gas depending on cold/warm reads from Berlin upgrade onwards.
Handle
0xRajeev
Vulnerability details
Impact
Public/external setter functions that emit events to indicate the newly set values can use the function parameters (from memory/calldata) or their cached versions as emit arguments instead of the state variables that were just written to because SLOADs cost 2100/100 gas depending on cold/warm reads from Berlin upgrade onwards.
Proof of Concept
https://github.com/sushiswap/miso/blob/2cdb1486a55ded55c81898b7be8811cb68cfda9e/contracts/Liquidity/PostAuctionLauncher.sol#L160
Tools Used
Manual Analysis
Recommended Mitigation Steps
Use function parameters or cached local variables in emits to save gas.
The text was updated successfully, but these errors were encountered: