Fraxlend (Frax Finance) contest - Yiko'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: 63/120

Findings: 2

Award: $67.00

🌟 Selected for report: 0

🚀 Solo Findings: 0

https://github.com/FraxFinance/fraxlend/blob/0f9bc5ddd6872fba04f4d8fb67c92a88416d19b2/src/contracts/FraxlendPair.sol#L206 In FraxlendPair.sol at line 206 When assigning an address value _newAddress is not checked if it is address(0).

https://github.com/FraxFinance/fraxlend/blob/0f9bc5ddd6872fba04f4d8fb67c92a88416d19b2/src/contracts/FraxlendPair.sol#L286 In FraxlendPair.sol at line 286 Instead of "...addresses whos status..." it should be "...addresses whose status...". So "whose" instead of "whos".

https://github.com/FraxFinance/fraxlend/blob/0f9bc5ddd6872fba04f4d8fb67c92a88416d19b2/src/contracts/FraxlendPair.sol#L287 In FraxlendPair.sol at line 287 Instead of "The approcal status" it should be "The approval status". So "approval" instead of "approcal".

https://github.com/FraxFinance/fraxlend/blob/0f9bc5ddd6872fba04f4d8fb67c92a88416d19b2/src/contracts/FraxlendPair.sol#L304 In FraxlendPair.sol at line 304 Instead of "Cannot black list self" it should be "Cannot blacklist self". So "blacklist" instead of "black list".

https://github.com/FraxFinance/fraxlend/blob/0f9bc5ddd6872fba04f4d8fb67c92a88416d19b2/src/contracts/FraxlendPair.sol#L305 In FraxlendPair.sol at line 305 Instead of "...addresses whos status..." it should be "...addresses whose status...". So "whose" instead of "whos".

https://github.com/FraxFinance/fraxlend/blob/0f9bc5ddd6872fba04f4d8fb67c92a88416d19b2/src/contracts/FraxlendPair.sol#L289 In FraxlendPair.sol at line 289 Instead of "i++" using "++i" might reduce gas consumption.

https://github.com/FraxFinance/fraxlend/blob/0f9bc5ddd6872fba04f4d8fb67c92a88416d19b2/src/contracts/FraxlendPair.sol#L308 In FraxlendPair.sol at line 308 Instead of "i++" using "++i" might reduce gas consumption.

https://github.com/FraxFinance/fraxlend/blob/0f9bc5ddd6872fba04f4d8fb67c92a88416d19b2/src/contracts/FraxlendPairCore.sol#L754 In FraxlendPairCore.sol at line 754 Because "_collateralAmount" is uint type it cannot be lower than 0. Thus, using "_collateralAmount != 0" instead of "_collateralAmount > 0" will be the same and might reduce gas consumption.

https://github.com/FraxFinance/fraxlend/blob/0f9bc5ddd6872fba04f4d8fb67c92a88416d19b2/src/contracts/FraxlendPairCore.sol#L835 In FraxlendPairCore.sol at line 835 Because "userBorrowShares[msg.sender]" is uint type it cannot be lower than 0. Thus, using "userBorrowShares[msg.sender] != 0" instead of "userBorrowShares[msg.sender] > 0" will be the same and might reduce gas consumption.

https://github.com/FraxFinance/fraxlend/blob/0f9bc5ddd6872fba04f4d8fb67c92a88416d19b2/src/contracts/FraxlendPairCore.sol#L1002 In FraxlendPairCore.sol at line 1002 Because "_leftoverBorrowShares" is uint type it cannot be lower than 0. Thus, using "_leftoverBorrowShares != 0" instead of "_leftoverBorrowShares > 0" will be the same and might reduce gas consumption.

https://github.com/FraxFinance/fraxlend/blob/0f9bc5ddd6872fba04f4d8fb67c92a88416d19b2/src/contracts/FraxlendPairCore.sol#L1094 In FraxlendPairCore.sol at line 1094 Because "_initialCollateralAmount" is uint type it cannot be lower than 0. Thus, using "_initialCollateralAmount != 0" instead of "_initialCollateralAmount > 0" will be the same and might reduce gas consumption.

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