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: 24/47
Findings: 1
Award: $142.22
🌟 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
142.2222 USDC - $142.22
When users claim lpETH and the specified _token is not ETH, if there is ETH in the PrelaunchPoints
contract transferred by mistake by others, the contract will also convert this part of ETH into lpETH for the user. This is because the amount of lpETH calculated for the user's claim in the _claim
function is address(this).balance
, rather than the actual amount of ETH obtained through exchangeProxy with the _token in the _fillQuote
function.
_fillQuote(IERC20(_token), userClaim, _data); // Convert swapped ETH to lpETH (1 to 1 conversion) claimedAmount = address(this).balance; lpETH.deposit{value: claimedAmount}(_receiver);
Although the comment states, "At this point there should not be any ETH in the contract," this is an ideal situation. In reality, it is highly possible that someone could mistakenly transfer ETH to the PrelaunchPoints
contract.
lock
function, locking an amount of _token
into the PrelaunchPoints
contract.convertAllETH
function to convert the ETH in the PrelaunchPoints
contract into lpETH and updates the startClaimDate
variable, allowing users who have locked assets in the contract to start claiming lpETH.PrelaunchPoints
contract.claim
function to claim lpETH. The claim
function calls the _claim
function for the actual operation. In the _claim
function, _fillQuote
is invoked, which converts User A's _token into ETH held within the PrelaunchPoints
contract.claimedAmount
into lpETH for User A’s specified _receiver
. Note that the claimedAmount
here is address(this).balance
, which includes User B's 10 ETH, not just the boughtETHAmount
calculated in the final _fillQuote
function.None
_fillQuote
function return the final calculated boughtETHAmount
to the _claim
function. In the _claim
function, convert the amount of ETH denoted as boughtETHAmount
into lpETH for the _receiver
.receive
function to prevent users from mistakenly transferring ETH into the contract.Other
#0 - c4-judge
2024-05-15T14:38:47Z
koolexcrypto marked the issue as duplicate of #18
#1 - c4-judge
2024-06-05T07:29:36Z
koolexcrypto changed the severity to 2 (Med Risk)
#2 - c4-judge
2024-06-05T09:21:42Z
koolexcrypto marked the issue as partial-50
#3 - c4-judge
2024-06-05T09:41:00Z
koolexcrypto changed the severity to 3 (High Risk)
#4 - c4-judge
2024-06-05T09:41:17Z
koolexcrypto marked the issue as duplicate of #33