Open stalker474 opened 3 weeks ago
The referenced event emissions are inefficient as they will read from storage variables when they have been recently assigned with in-memory data.
function setTraderRequest(ITrader _trader) external onlyOwner { require(address(_trader) != address(0), "ElasticVault: invalid trader"); pending_trader = _trader; trader_change_request_time = block.timestamp; emit TraderChangeRequest(address(trader), address(pending_trader)); }
We advise the in-memory variables to be utilized in those event emissions instead, greatly optimizing their gas cost.
EVT-01C: Inefficient Event Emissions
Description:
The referenced event emissions are inefficient as they will read from storage variables when they have been recently assigned with in-memory data.
Example:
Recommendation:
We advise the in-memory variables to be utilized in those event emissions instead, greatly optimizing their gas cost.