FEI and TRIBE Redemption contest - RaymondFam's results

A new DeFi primitive that allows any token to become productive and provide FEI liquidity at no cost to the markets that need it most.

General Information

Platform: Code4rena

Start Date: 09/09/2022

Pot Size: $42,000 USDC

Total HM: 2

Participants: 101

Period: 3 days

Judge: hickuphh3

Total Solo HM: 2

Id: 161

League: ETH

Tribe

Findings Distribution

Researcher Performance

Rank: 22/101

Findings: 1

Award: $34.50

🌟 Selected for report: 0

🚀 Solo Findings: 0

Typo Mistakes

https://github.com/code-423n4/2022-09-tribe/blob/main/contracts/shutdown/fuse/RariMerkleRedeemer.sol#L164

The comment should be rewritten as:

/// Should set the user's claim amount in the claims mapping for the provided cToken

https://github.com/code-423n4/2022-09-tribe/blob/main/contracts/shutdown/fuse/RariMerkleRedeemer.sol#L246

The comment should be rewritten as:

// We give the interactions (the safeTransferFroms) their own for loop, just to be safe

Zero Address Check

https://github.com/code-423n4/2022-09-tribe/blob/main/contracts/shutdown/fuse/RariMerkleRedeemer.sol#L170 https://github.com/code-423n4/2022-09-tribe/blob/main/contracts/shutdown/fuse/RariMerkleRedeemer.sol#L202

Just as it has been done for _multiRedeem(), the following zero address check for _cToken should be inserted as the first require statement for _claim() before line 170 and _redeem() before line 202 just in case of user's input error when writing directly at etherscan instead of interacting from the UI:

require(_cToken != address(0), "Invalid cToken address");

Zero and Low Amounts Checks When Redeeming

https://github.com/code-423n4/2022-09-tribe/blob/main/contracts/shutdown/fuse/RariMerkleRedeemer.sol#L217-L218 https://github.com/code-423n4/2022-09-tribe/blob/main/contracts/shutdown/fuse/RariMerkleRedeemer.sol#L249-L250

A cToken exchange rate could be as small as 1e10 +1 according to line 130 inside _configureExchangeRates(). When dealing with very small amount of cToken at very low exchange rate, this could possibly render a zero returned value from `previewRedeem()' since the numerator would be smaller than 1e18. Similarly, contract balance of baseToken could run lower than baseTokenAmountReceived. As such, the following require statement should be inserted prior to doing the token transfers:

require(baseTokenAmountReceived != 0 && baseTokenAmountReceived < IERC20(baseToken).balanceOf(address(this)), "Zero and/or insufficient base token payout!");

Instead of inheriting ERC20Dripper and overriding drip(), consider implementing Chainlink keeper that would auto-fund RariMerkleRedeemer when the FEI balance dropped below a preset level.

DAI Balance Check for SimpleFeiDaiPSM.sol

https://github.com/code-423n4/2022-09-tribe/blob/main/contracts/peg/SimpleFeiDaiPSM.sol#L56

A DAi balance should be checked before line 56 such that:

require(amountOut < balance(), "Insufficient DAI");

Events in SimpleFeiDaiPSM.sol

Addresses in events Redeem and Mint should be indexed for ease of filtered access. Where possible, consider maximizing the use of three indices in an event.

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