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: 16/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/40167e469edde09969643b6808c57e25d1b9c203/src/PrelaunchPoints.sol#L179-L182 https://github.com/code-423n4/2024-05-loop/blob/40167e469edde09969643b6808c57e25d1b9c203/src/PrelaunchPoints.sol#L321-L322
The contract is designed to receive ETH so that users can use the function lockETH()
to get lpETH (1 to 1 conversion). User deposits are stored in the state variable totalSupply
. While converting all user deposited ETH to lpETH via a privileged function convertAllETH()
, the ETH balance of the current contract is used instead of the state variable totalSupply
. In case that some users mistakenly sent ETH directly to the contract the 1 to 1 conversion ratio of ETH to lpETH will be broken leading to users getting more lpETH than they were supposed to.
totalBalance
variable in the function convertAllETH()
will be 1010 resulting in minting of 1010 lpETH. totalLpETH
state variable will be also 1010.claimedAmount = userStake.mulDiv(totalLpETH, totalSupply);
In this situation, all users will get 1.01 more lpETH that the ETH they staked. It will be more if the amount of ETH that was mistakenly sent is higher.
Manual review.
Use state variable totalSupply
in the function convertAllETH
instead of "address(this).balance" to calculate the amount to be deposited to lpETH contract.
Invalid Validation
#0 - c4-judge
2024-05-15T12:30:04Z
koolexcrypto marked the issue as duplicate of #6
#1 - c4-judge
2024-05-15T12:30:18Z
koolexcrypto marked the issue as partial-50
#2 - c4-judge
2024-05-15T12:32:39Z
koolexcrypto marked the issue as not a duplicate
#3 - c4-judge
2024-05-15T12:33:01Z
koolexcrypto marked the issue as primary issue
#4 - c4-judge
2024-05-31T09:52:33Z
koolexcrypto marked the issue as satisfactory
#5 - c4-judge
2024-06-03T09:03:33Z
koolexcrypto changed the severity to 3 (High Risk)
#6 - c4-judge
2024-06-05T07:29:38Z
koolexcrypto changed the severity to 2 (Med Risk)
#7 - c4-judge
2024-06-05T09:41:02Z
koolexcrypto changed the severity to 3 (High Risk)
#8 - c4-judge
2024-06-05T09:41:30Z
koolexcrypto marked the issue as duplicate of #33