Omniscia Keyko Audit
IPCTDelegate Code Style Findings
IPCTDelegate Code Style Findings
IPT-01C: Inefficient Event Storage Reads
Type | Severity | Location |
---|---|---|
Gas Optimization | Informational | IPCTDelegate.sol:L474, L476, L502, L504, L519, L521 |
Description:
All linked events emit
the values of variables in storage that were written to by the function itself with in-memory values.
Example:
contracts/governor/IPCTDelegate.sol
507/**508 * @notice Admin function for setting the proposal threshold509 * @dev newProposalThreshold must be greater than the hardcoded min510 * @param newProposalThreshold new proposal threshold511 */512function _setProposalThreshold(uint256 newProposalThreshold) external adminOnly {513 require(514 newProposalThreshold >= MIN_PROPOSAL_THRESHOLD &&515 newProposalThreshold <= MAX_PROPOSAL_THRESHOLD,516 "IPCT::_setProposalThreshold: invalid proposal threshold"517 );518 uint256 oldProposalThreshold = proposalThreshold;519 proposalThreshold = newProposalThreshold;520
521 emit ProposalThresholdSet(oldProposalThreshold, proposalThreshold);522}
Recommendation:
We advise the in-memory values from the function arguments to be utilized directly significantly reducing the gas cost of those functions.
Alleviation:
The event
emission statements have been optimised accordingly.