Omniscia Keyko Audit

TreasuryImplementation Code Style Findings

TreasuryImplementation Code Style Findings

TIN-01C: Inefficient Event Storage Read

TypeSeverityLocation
Gas OptimizationInformationalTreasuryImplementation.sol:L80, L82

Description:

The linked event emits the values of variables in storage that were written to by the function itself with in-memory values.

Example:

contracts/token/TreasuryImplementation.sol
73/**
74 * @notice Updates the CommunityAdmin contract address
75 *
76 * @param communityAdmin_ address of the new CommunityAdmin contract
77 */
78function updateCommunityAdmin(ICommunityAdmin communityAdmin_) external override onlyOwner {
79 address oldCommunityAdminAddress = address(_communityAdmin);
80 _communityAdmin = communityAdmin_;
81
82 emit CommunityAdminUpdated(oldCommunityAdminAddress, address(_communityAdmin));
83}

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.