Platform: Code4rena
Start Date: 25/01/2022
Pot Size: $50,000 USDT
Total HM: 17
Participants: 39
Period: 3 days
Judge: LSDan
Total Solo HM: 9
Id: 79
League: ETH
Rank: 35/39
Findings: 1
Award: $40.64
🌟 Selected for report: 1
🚀 Solo Findings: 0
🌟 Selected for report: 0x0x0x
39.7792 USDT - $39.78
0x0x0x
require( user.amount >= _amount, "RocketJoeStaking: withdraw amount exceeds balance" );
is not needed since
user.amount = user.amount - _amount;
checks it.
0x0x0x
!= 0
is a cheaper operation compared to > 0
, when dealing with uint
.
./LaunchEvent.sol:314: msg.value > 0, ./LaunchEvent.sol:338: if (rJoeNeeded > 0) { ./LaunchEvent.sol:355: require(_amount > 0, "LaunchEvent: invalid withdraw amount"); ./LaunchEvent.sol:370: if (feeAmount > 0) { ./LaunchEvent.sol:390: require(wavaxReserve > 0, "LaunchEvent: no wavax balance"); ./LaunchEvent.sol:455: if (tokenReserve > 0) { ./LaunchEvent.sol:486: require(amount > 0, "LaunchEvent: caller has no incentive to claim"); ./LaunchEvent.sol:498: user.balance > 0, ./LaunchEvent.sol:537: if (excessToken > 0) { ./LaunchEvent.sol:542: if (excessWavax > 0) { ./LaunchEvent.sol:547: if (excessAvax > 0) _safeTransferAVAX(penaltyCollector, excessAvax); ./RocketJoeFactory.sol:119: _tokenAmount > 0, ./RocketJoeStaking.sol:101: if (user.amount > 0) {
#0 - cryptofish7
2022-02-11T01:05:28Z
Duplicate of #240