Omniscia Steer Protocol Audit
InternalGovernance Static Analysis Findings
InternalGovernance Static Analysis Findings
IGE-01S: Data Location Optimizations
Type | Severity | Location |
---|---|---|
Gas Optimization | InternalGovernance.sol:L258, L283 |
Description:
The linked input arguments are set as memory
in external
function(s).
Example:
contracts/InternalGovernance.sol
255/// @dev Use this function to give the ability to vote in the proposals made in this contract.256/// @dev Only Steer Governance Timelock can call this function.257/// @param _recipients is the array of addresses that should be given the ability to vote.258function giveVotingPower(address[] memory _recipients) external {259 require(msg.sender == steerTimelock);260
261 uint256 recipientCount = _recipients.length;262 for (uint256 i; i != recipientCount; ++i) {263 hasVotingPower[_recipients[i]] = true;264 }265
266 emit VotingPowerGiven(_recipients);267}
Recommendation:
We advise them to be set as calldata
optimizing their read-access gas cost.
Alleviation (200f275c40cbd4798f4a416c044ea726755d4741):
All referenced memory
locations were properly adjusted to calldata
optimizing the codebase in the process.
IGE-02S: Literal Equality of bool
Variables
Type | Severity | Location |
---|---|---|
Gas Optimization | InternalGovernance.sol:L143, L169, L191, L227 |
Description:
The linked bool
comparisons are performed between variables and bool
literals.
Example:
contracts/InternalGovernance.sol
143hasVotingPower[msg.sender] == true,
Recommendation:
We advise each bool
variable to be utilized directly either in its negated (!
) or original form.
Alleviation (200f275c40cbd4798f4a416c044ea726755d4741):
All direct boolean comparisons with true
were replaced with direct utilization of the bool
variable as advised.