Omniscia Olympus DAO Audit

Guardable Code Style Findings

Guardable Code Style Findings

GUA-01C: Inexistent Deletion of Pending Guardian

TypeSeverityLocation
Gas OptimizationInformationalGuardable.sol:L42-L46

Description:

The _newGuardian entry should be deleted when it is consumed by the pullGuardian function.

Example:

contracts/types/Guardable.sol
42function pullGuardian() public virtual override {
43 require( msg.sender == _newGuardian, "Guardable: must be new guardian to pull");
44 emit GuardianPulled( _guardian, _newGuardian );
45 _guardian = _newGuardian;
46}

Recommendation:

We advise it to be deleted so to ensure a consistent contract state.

Alleviation:

The new guardian is now properly deleted when the pullGuardian function concludes.