Platform: Code4rena
Start Date: 01/05/2024
Pot Size: $12,100 USDC
Total HM: 1
Participants: 47
Period: 7 days
Judge: Koolex
Id: 371
League: ETH
Rank: 12/47
Findings: 1
Award: $386.08
🌟 Selected for report: 0
🚀 Solo Findings: 0
🌟 Selected for report: 0xnev
Also found by: 0x04bytes, 0xBugSlayer, 0xJoyBoy03, 0xSecuri, 0xrex, Bigsam, DMoore, Evo, Greed, Kirkeelee, Krace, Pechenite, Rhaydden, SBSecurity, Sajjad, TheFabled, Topmark, XDZIBECX, ZanyBonzy, _karanel, bbl4de, btk, d3e4, gumgumzum, nfmelendez, novamanbg, petarP1998, samuraii77, sandy, shaflow2, sldtyenj12, web3er, y4y, yovchev_yoan
284.4444 USDC - $284.44
https://github.com/code-423n4/2024-05-loop/blob/main/src/PrelaunchPoints.sol#L240-L266 https://github.com/code-423n4/2024-05-loop/blob/main/src/PrelaunchPoints.sol#L492-L505
User can lock low amount worth of any token different than WETH
and get as much lpETH
as he wants.
The user will lock via lock()
function, then after some time when the owner calls the convertAllETH()
function and everybody is able to claim or stake their lpETH
, the user will send ether to the contract and immediately call claim()
or claimAndStake()
functions. No matter which function he will call, because they are both leading to the following block of code in the _claim()
function:
} else { uint256 userClaim = userStake * _percentage / 100; _validateData(_token, userClaim, _exchange, _data); balances[msg.sender][_token] = userStake - userClaim; // At this point there should not be any ETH in the contract // Swap token to ETH _fillQuote(IERC20(_token), userClaim, _data); // Convert swapped ETH to lpETH (1 to 1 conversion) claimedAmount = address(this).balance; lpETH.deposit{value: claimedAmount}(_receiver); } emit Claimed(msg.sender, _token, claimedAmount);
It deposits the ETH balance of the contract to the receiver, assuming that there is no ETH left in the contract after the convertAllETH()
function is called. This sabotages the whole idea of the locking mechanism, making it easy for users to trick the system
Manual review
return the boughtETHAmount
from _fillQuote
function and deposit it, instead of depositing the ETH balance of the contract
Other
#0 - c4-judge
2024-05-15T14:38:19Z
koolexcrypto marked the issue as duplicate of #6
#1 - c4-judge
2024-05-31T09:58:24Z
koolexcrypto marked the issue as duplicate of #33
#2 - c4-judge
2024-06-05T09:54:32Z
koolexcrypto marked the issue as satisfactory