You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
> 0 IS LESS EFFICIENT THAN != 0 FOR UINT IN require STATEMENT
!=0 costs less gas than >0 for uint in require statement.
Proof: While it may seem that >0 is cheaper than !=, this is only true if the optimizer is enabled and declared outside the require statement. If you enable the optimizer at 10k and declare it in require statement, this will save gas. you can see this tweet for more proof: https://twitter.com/gzeon/status/1485428085885640706
I suggest to changing >0 with !=0 here (and also enable the optimizer):
> 0 IS LESS EFFICIENT THAN != 0 FOR UINT IN
require
STATEMENT!=0
costs less gas than>0
for uint inrequire
statement.Proof: While it may seem that
>0
is cheaper than!=
, this is only true if the optimizer is enabled and declared outside therequire
statement. If you enable the optimizer at 10k and declare it inrequire
statement, this will save gas. you can see this tweet for more proof:https://twitter.com/gzeon/status/1485428085885640706
I suggest to changing
>0
with!=0
here (and also enable the optimizer):https://github.com/code-423n4/2022-05-aura/blob/main/contracts/AuraLocker.sol#L210
https://github.com/code-423n4/2022-05-aura/blob/main/contracts/AuraLocker.sol#L259
https://github.com/code-423n4/2022-05-aura/blob/main/contracts/AuraLocker.sol#L359
https://github.com/code-423n4/2022-05-aura/blob/main/contracts/AuraLocker.sol#L385
https://github.com/code-423n4/2022-05-aura/blob/main/contracts/AuraLocker.sol#L431
https://github.com/code-423n4/2022-05-aura/blob/main/contracts/AuraLocker.sol#L471
https://github.com/code-423n4/2022-05-aura/blob/main/contracts/AuraLocker.sol#L851
https://github.com/code-423n4/2022-05-aura/blob/main/contracts/AuraBalRewardPool.sol#L139
https://github.com/code-423n4/2022-05-aura/blob/main/contracts/AuraBalRewardPool.sol#L210
https://github.com/code-423n4/2022-05-aura/blob/main/contracts/Aura.sol#L68
https://github.com/code-423n4/2022-05-aura/blob/main/contracts/AuraVestedEscrow.sol#L118
The text was updated successfully, but these errors were encountered: