[G-05] Getters with ownership modifier and marked as external
These functions could be marked as view functions and the ifAdminOrPendingImpl modifier removed
File: /contracts/upgrades/GraphProxy.sol
69 function admin() external ifAdminOrPendingImpl returns (address) {
82 function implementation() external ifAdminOrPendingImpl returns (address) {
95 function pendingImplementation() external ifAdminOrPendingImpl returns (address) {
[G-06] Overcheck _pendingImplementation and pendingGovernor
If the msg.sender it's the _pendingImplementation => the _pendingImplementation it's not the address(0)
The msg.sender == _pendingImplementation check it's enough
Gas report
MLOAD
SLOAD
andaddress(0)
_pendingImplementation
andpendingGovernor
[G-01] Use function parameter to avoid
MLOAD
[G-02] Unused SafeMath.sol
[G-03] Use function saved var instead of
SLOAD
andaddress(0)
[G-04] Overcheck slots
Can check this slots in a test or you can calculate directly in the slot definition
[G-05] Getters with ownership modifier and marked as external
These functions could be marked as view functions and the
ifAdminOrPendingImpl
modifier removed[G-06] Overcheck
_pendingImplementation
andpendingGovernor
If the
msg.sender
it's the_pendingImplementation
=> the_pendingImplementation
it's not theaddress(0)
Themsg.sender == _pendingImplementation
check it's enoughThe same case to
pendingGovernor