Omniscia Sovryn Audit
ThresholdProxyAdmin Code Style Findings
ThresholdProxyAdmin Code Style Findings
TPA-01C: Redundant Storage Write
Type | Severity | Location |
---|---|---|
Gas Optimization | Informational | ThresholdProxyAdmin.sol:L114, L115 |
Description:
The propose
function overwrites any previously set proposal by the msg.sender
. When the previously set proposal's action is not None
it temporarily changes it to such and emits an event with its data prior to overwriting it redundantly.
Example:
contracts/upgradability/ThresholdProxyAdmin.sol
112if (proposals[msg.sender].action != Action.None) {113 require(!_proposalsIdentical(newProp, proposals[msg.sender]), "proposal already exists");114 proposals[msg.sender].action = Action.None;115 emit Retracted(msg.sender, proposals[msg.sender].action, proposals[msg.sender].target, proposals[msg.sender].data);116}117
118proposals[msg.sender] = newProp;
Recommendation:
We advise the action
assignment to simply be omitted and the value to be included in the Retracted
event emittance.
Alleviation:
The contract no longer exists in the codebase and this exhibit can be considered null.