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
State variable COW_SETTLEMENT and COW_RELAYER declared in StakingStorage could be declared as constant
COW_SETTLEMENT and COW_RELAYER are initialized in Staking.solinitialize function with a constant address.
The initialization of those variable could be moved directly in their definition and transform those variables in constants, optimizing the gas usage for portion of code that use them.
Staking_sendAffiliateFee should avoid sending fee when the amount is zero
feeAmount in _sendAffiliateFee could be zero because of rounding if (_amount * affiliateFee) < BASIS_POINTS.
The function could check feeAmount > 0 and perform IERC20Upgradeable(TOKE_TOKEN).safeTransfer(FEE_ADDRESS, feeAmount) only in that case
StakingtransferToke should avoid sending Toke when the amount is zero
If totalTokeAmount is equal to zero, avoid to call safeTransfer and waste gas sending 0 transferring zero tokens.
The text was updated successfully, but these errors were encountered:
State variable
COW_SETTLEMENT
andCOW_RELAYER
declared inStakingStorage
could be declared asconstant
COW_SETTLEMENT
andCOW_RELAYER
are initialized inStaking.sol
initialize
function with a constant address.The initialization of those variable could be moved directly in their definition and transform those variables in constants, optimizing the gas usage for portion of code that use them.
Staking
_sendAffiliateFee
should avoid sending fee when the amount is zerofeeAmount
in_sendAffiliateFee
could be zero because of rounding if(_amount * affiliateFee) < BASIS_POINTS
.The function could check
feeAmount > 0
and performIERC20Upgradeable(TOKE_TOKEN).safeTransfer(FEE_ADDRESS, feeAmount)
only in that caseStaking
transferToke
should avoid sending Toke when the amount is zeroIf
totalTokeAmount
is equal to zero, avoid to callsafeTransfer
and waste gas sending 0 transferring zero tokens.The text was updated successfully, but these errors were encountered: