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: 33/47
Findings: 1
Award: $71.11
🌟 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
71.1111 USDC - $71.11
https://github.com/code-423n4/2024-05-loop/blob/main/src/PrelaunchPoints.sol#L262
Any user can claim the eth accidently sent to the PrelaunchPoints contract.
The protocol operates under the assumption that ETH sent to the contract is permanently locked:
/** * Enable receive ETH * @dev ETH sent to this contract directly will be locked forever. */ receive() external payable {}
The problem arises in the _claim function, which uses address(this).balance instead of the user's balance when depositing in lpETH, resulting in a first-come, first-served scenario:
claimedAmount = address(this).balance; lpETH.deposit{value: claimedAmount}(_receiver);
Consequently, after all ETH has been converted, any remaining or subsequently sent ETH to the contract will be claimed by the first user.
Manual review
Consider updating the _claim function as follows:
claimedAmount = userClaim > address(this).balance ? address(this).balance : userClaim; lpETH.deposit{value: claimedAmount}(_receiver);
dditionally, implement a similar function to recoverERC20 to withdraw ETH, accessible only after convertAllETH has been called.
Other
#0 - c4-judge
2024-05-15T14:35:42Z
koolexcrypto marked the issue as duplicate of #18
#1 - c4-judge
2024-06-03T09:03:32Z
koolexcrypto changed the severity to 3 (High Risk)
#2 - c4-judge
2024-06-05T07:29:36Z
koolexcrypto changed the severity to 2 (Med Risk)
#3 - c4-judge
2024-06-05T09:20:33Z
koolexcrypto marked the issue as partial-50
#4 - c4-judge
2024-06-05T09:41:00Z
koolexcrypto changed the severity to 3 (High Risk)
#5 - c4-judge
2024-06-05T09:41:16Z
koolexcrypto marked the issue as duplicate of #33
#6 - c4-judge
2024-06-11T08:14:10Z
koolexcrypto marked the issue as partial-25