Platform: Code4rena
Start Date: 24/03/2023
Pot Size: $49,200 USDC
Total HM: 20
Participants: 246
Period: 6 days
Judge: Picodes
Total Solo HM: 1
Id: 226
League: ETH
Rank: 123/246
Findings: 2
Award: $24.26
🌟 Selected for report: 0
🚀 Solo Findings: 0
11.1318 USDC - $11.13
https://github.com/code-423n4/2023-03-asymmetry/blob/main/contracts/SafEth/SafEth.sol#L63#L101
User will lost stake fund
Try to stake some eth before derivatives are ready,deposit 1 ETH and received 0 safETH
it("Should lost stake fund when Derivatives is not ready", async function () { const strategy = await getLatestContract(strategyContractAddress, "SafEth"); const userAccounts = await getUserAccounts(); const testLostFundAddress = userAccounts[0]; // new interface const iface = new ethers.utils.Interface(SafEthABI.abi); const userStrategySigner = strategy.connect(testLostFundAddress); //stake 1eth const ethAmount = "1"; const depositAmount = ethers.utils.parseEther(ethAmount); const stakeResult = await userStrategySigner.stake({ value: depositAmount, }); const mined = await stakeResult.wait(); console.log(mined); const eventLog = iface.decodeEventLog( "Staked", mined.logs[1].data, mined.logs[1].topics ); //deposit 1 ETH and receive 0 safETH expect(eventLog.ethIn).eq(depositAmount); expect(eventLog.safEthOut).eq(0); });
manual
The "stake" method requires checking if the current derivative quantity is greater than zero first
#0 - c4-pre-sort
2023-04-01T07:53:05Z
0xSorryNotSorry marked the issue as low quality report
#1 - c4-pre-sort
2023-04-04T19:34:06Z
0xSorryNotSorry marked the issue as duplicate of #363
#2 - c4-judge
2023-04-21T16:29:01Z
Picodes changed the severity to 2 (Med Risk)
#3 - c4-judge
2023-04-21T16:31:55Z
Picodes marked the issue as satisfactory
🌟 Selected for report: brgltd
Also found by: 0x3b, 0xAgro, 0xGusMcCrae, 0xNorman, 0xRajkumar, 0xSmartContract, 0xTraub, 0xWagmi, 0xWaitress, 0xffchain, 0xhacksmithh, 0xkazim, 0xnev, 3dgeville, ArbitraryExecution, Aymen0909, BRONZEDISC, Bason, Bloqarl, BlueAlder, Brenzee, CodeFoxInc, CodingNameKiki, Cryptor, DadeKuma, DevABDee, Diana, Dug, Englave, Gde, Haipls, HollaDieWaldfee, Ignite, Infect3d, Jerry0x, Josiah, Kaysoft, Koko1912, KrisApostolov, Lavishq, LeoGold, Madalad, PNS, Rappie, RaymondFam, RedTiger, Rickard, Rolezn, Sathish9098, SunSec, T1MOH, UdarTeam, Udsen, Viktor_Cortess, Wander, adriro, ak1, alejandrocovrr, alexzoid, arialblack14, ayden, bin2chen, brevis, btk, c3phas, carlitox477, catellatech, ch0bu, chaduke, ck, climber2002, codeslide, descharre, dingo2077, ernestognw, fatherOfBlocks, favelanky, georgits, helios, hl_, inmarelibero, juancito, ks__xxxxx, lopotras, lukris02, m_Rassska, mahdirostami, maxper, nadin, navinavu, nemveer, p_crypt0, peanuts, pipoca, pixpi, qpzm, rbserver, reassor, roelio, rotcivegaf, scokaf, siddhpurakaran, slvDev, smaul, tnevler, tsvetanovv, turvy_fuzz, vagrant, wen, yac, zzzitron
13.1298 USDC - $13.13
1.When there is no limit to the range when setting the maxSlippage, if the slippage set exceeds a reasonable range, it may cause losses to the investor's funds Recommended setting range:maxSlippage %0.5 ~ %2
2.When the weights are set improperly, it may cause losses to investors. Improper weightings can cause the value of the derivative to deviate from the underlying asset, which may result in a lack of liquidity or inaccurate pricing for investors seeking to enter or exit positions. This may lead to losses for investors who have not properly assessed the risks and have invested in the derivative. It is important to properly set the weights and perform rigorous risk management to avoid such negative consequences.
3.When unstaking, it is necessary to check whether the user has a sufficient safEth balance. https://github.com/code-423n4/2023-03-asymmetry/blob/main/contracts/SafEth/SafEth.sol#L108#L129
+ require(balanceOf(msg.sender)>=_safEthAmount, "insufficient balance");
#0 - c4-sponsor
2023-04-10T20:43:31Z
toshiSat requested judge review
#1 - c4-sponsor
2023-04-10T20:43:36Z
toshiSat marked the issue as sponsor acknowledged
#2 - toshiSat
2023-04-10T20:43:41Z
I think only 3 is really valid
#3 - c4-judge
2023-04-24T18:33:14Z
Picodes marked the issue as grade-b