Platform: Code4rena
Start Date: 05/07/2023
Pot Size: $390,000 USDC
Total HM: 136
Participants: 132
Period: about 1 month
Judge: LSDan
Total Solo HM: 56
Id: 261
League: ETH
Rank: 80/132
Findings: 2
Award: $117.50
🌟 Selected for report: 0
🚀 Solo Findings: 0
76.3356 USDC - $76.34
Incorrect eligibleAmount
is minted to the user.
An eligible user can call the _participatePhase3 function and mint the aToken to them.
function _participatePhase3( bytes calldata _data ) internal returns (uint256 oTAPTokenID) { uint256 _tokenID = abi.decode(_data, (uint256)); require(PCNFT.ownerOf(_tokenID) == msg.sender, "adb: Not eligible"); address tokenIDToAddress = address(uint160(_tokenID)); require( userParticipation[tokenIDToAddress][3] == false, "adb: Already participated" ); // Close eligibility // To avoid a potential attack vector, we cast token ID to an address instead of using _to, // no conflict possible, tokenID goes from 0 ... 714. userParticipation[tokenIDToAddress][3] = true; uint128 expiry = uint128(lastEpochUpdate + EPOCH_DURATION); // Set expiry to the end of the epoch uint256 eligibleAmount = PHASE_3_AMOUNT_PER_USER; -------------->>>> audit find. should be multiplied by 1e18 uint128 discount = uint128(PHASE_3_DISCOUNT); oTAPTokenID = aoTAP.mint(msg.sender, expiry, discount, eligibleAmount); }
As shown above, the eligibleAmount is incorrectly set.
Note aoTAP has decimal value of 1e18.
Update the Line as shown below
uint256 eligibleAmount = PHASE_3_AMOUNT_PER_USER * 1e18;
Decimal
#0 - c4-pre-sort
2023-08-05T15:10:35Z
minhquanym marked the issue as duplicate of #173
#1 - c4-judge
2023-09-18T13:29:17Z
dmvt marked the issue as satisfactory