Asymmetry contest - cryptothemex's results

A protocol to help diversify and decentralize liquid staking derivatives.

General Information

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

Asymmetry Finance

Findings Distribution

Researcher Performance

Rank: 92/246

Findings: 1

Award: $48.63

🌟 Selected for report: 0

🚀 Solo Findings: 0

Findings Information

🌟 Selected for report: ladboy233

Also found by: 0xkazim, 0xnev, Bauer, J4de, Matin, UniversalCrypto, cryptothemex, jasonxiale, juancito, koxuan, latt1ce, neumo

Labels

bug
2 (Med Risk)
low quality report
satisfactory
duplicate-1078

Awards

48.6252 USDC - $48.63

External Links

Lines of code

https://github.com/code-423n4/2023-03-asymmetry/blob/main/contracts/SafEth/SafEth.sol#L71-L81

Vulnerability details

Impact

Loss of precision in calculating preDepositPrice value allows users to mint/ receive more safeEth.

Proof of Concept

underlyingValue is being computed by dividing the derivate balance by 10**18 [L71-L75] (https://github.com/code-423n4/2023-03-asymmetry/blob/main/contracts/SafEth/SafEth.sol#L71-L75). Later, preDepositPrice is computed as preDepositPrice = (10 ** 18 * underlyingValue) / totalSupply;

First dividing and then multiplying cause loss of precision in preDepositPrice (setting it to lesser than the actual value). Thus, increasing the mintAmount as it is computed by mintAmount = (totalStakeValueEth * 10 ** 18) / preDepositPrice; [L98] (https://github.com/code-423n4/2023-03-asymmetry/blob/main/contracts/SafEth/SafEth.sol#L98)

Tools Used

Code Review

Do not divide underlyingValue by 1018 and do not multiply preDepositPrice by 1018 to compute actual mintAmount.

#0 - c4-pre-sort

2023-04-03T15:42:54Z

0xSorryNotSorry marked the issue as low quality report

#1 - c4-pre-sort

2023-04-04T16:41:25Z

0xSorryNotSorry marked the issue as duplicate of #1044

#2 - c4-judge

2023-04-22T10:33:40Z

Picodes marked the issue as satisfactory

AuditHub

A portfolio for auditors, a security profile for protocols, a hub for web3 security.

Built bymalatrax © 2024

Auditors

Browse

Contests

Browse

Get in touch

ContactTwitter