code-423n4 / 2022-05-aura-findings

0 stars 1 forks source link

Gas Optimizations #333

Open code423n4 opened 2 years ago

code423n4 commented 2 years ago

gas1:

prefer prefix ++i instead of suffix, no need to init i, better if used unchecked https://github.com/code-423n4/2022-05-aura/blob/4989a2077546a5394e3650bf3c224669a0f7e690/contracts/AuraClaimZap.sol#L143-L153

https://github.com/code-423n4/2022-05-aura/blob/4989a2077546a5394e3650bf3c224669a0f7e690/contracts/AuraLocker.sol#L174-L175 https://github.com/code-423n4/2022-05-aura/blob/4989a2077546a5394e3650bf3c224669a0f7e690/contracts/AuraVestedEscrow.sol#L100-L101

gas2:

pragma >0.8 don't need safemath

gas3:

mark functions payable with onlyOwner modifier

gas4:

lack of zero address checks https://github.com/code-423n4/2022-05-aura/blob/4989a2077546a5394e3650bf3c224669a0f7e690/contracts/AuraStakingProxy.sol#L88-L94