Fraxlend (Frax Finance) contest - cryptphi's results

Fraxlend: A permissionless lending platform and the final piece of the Frax Finance Defi Trinity.

General Information

Platform: Code4rena

Start Date: 12/08/2022

Pot Size: $50,000 USDC

Total HM: 15

Participants: 120

Period: 5 days

Judge: Justin Goro

Total Solo HM: 6

Id: 153

League: ETH

Frax Finance

Findings Distribution

Researcher Performance

Rank: 14/120

Findings: 2

Award: $507.96

🌟 Selected for report: 0

🚀 Solo Findings: 0

Findings Information

🌟 Selected for report: 0x52

Also found by: Lambda, berndartmueller, cryptphi

Labels

bug
duplicate
2 (Med Risk)

Awards

462.1238 USDC - $462.12

External Links

Lines of code

https://github.com/code-423n4/2022-08-frax/blob/main/src/contracts/FraxlendPairCore.sol#L717 https://github.com/code-423n4/2022-08-frax/blob/main/src/contracts/FraxlendPair.sol#L120-L150

Vulnerability details

Impact

_totalBorrow.toShares() in FraxlendPairCore.withdraw() rounds Up instead of round down.

previewDeposit() in FraxlendPair.sol

maxDeposit() in FraxlendPair.sol is meant to have a view stateMutability and not pure. - https://eips.ethereum.org/EIPS/eip-4626#maxDeposit

maxMint() in FraxlendPair.sol is meant to have a view stateMutability and not pure. - https://eips.ethereum.org/EIPS/eip-4626#maxMint

previewMint() in FraxlendPair.sol

previewWithdraw() in FraxlendPair.sol

Tools Used

Manual review

Functions should align as documented in EIP 4626 , for example maxMint() should be a view function instead.

#0 - amirnader-ghazvini

2022-08-29T18:43:42Z

Duplicate of #79

  1. FraxlendPairCore should inherit IFraxlendPair FraxlendPairCore contract does not import and inherit functions that it makes use of which are defined in IFraxlendPair contract

  2. Missing zero address check FraxlendPairDeployer.constructor() has no zero address check for the following params - _circuitBreaker, _comptroller, _timelock , _fraxlendWhitelist

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