FEI and TRIBE Redemption contest - Rohan16'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: 77/101

Findings: 1

Award: $33.58

🌟 Selected for report: 0

🚀 Solo Findings: 0

1. Improper Input Validation/ Lack of Input validation of an ARRAY

if the array length of and amountsToClaim, amountsToRedeem is not equal it can lead to an error.

Impact

//Links to github file RariMerkleRedeemer.sol

//actual codes used function signAndClaimAndRedeem( bytes calldata signature, address[] calldata cTokens, uint256[] calldata amountsToClaim, uint256[] calldata amountsToRedeem, bytes32[][] calldata merkleProofs ) external override hasNotSigned nonReentrant { _sign(signature); _multiClaim(cTokens, amountsToClaim, merkleProofs); _multiRedeem(cTokens, amountsToRedeem); }

Tools Used

manual review

check the input array length


2.EVENT IS MISSING INDEXED FIELDS

Each event should use three indexed fields if there are three or more fields

Instances

TribeRedeemer SimpleFeiDaiPSM.sol SimpleFeiDaiPSM.sol

//actual codes used contracts/shutdown/redeem/TribeRedeemer.sol:14: event Redeemed(address indexed owner, address indexed receiver, uint256 amount, uint256 base); contracts/peg/SimpleFeiDaiPSM.sol:27: event Redeem(address to, uint256 amountFeiIn, uint256 amountAssetOut); contracts/peg/SimpleFeiDaiPSM.sol:29: event Mint(address to, uint256 amountIn, uint256 amountFeiOut);

3. Use Of floating Pragma

In the contracts, floating pragmas should not be used. Contracts should be deployed with the same compiler version and flags that they have been tested with thoroughly. Locking the pragma helps to ensure that contracts do not accidentally get deployed using, for example, an outdated compiler version that might introduce bugs that affect the contract system negatively.

Instances

TribeReedemer.sol SimpleFeiDaiPSM.sol MerkleRedeemerDripper.sol RariMerkleRedeemer.sol

//actual codes used ontracts/shutdown/fuse/RariMerkleRedeemer.sol:2:pragma solidity =0.8.10; contracts/shutdown/fuse/MerkleRedeemerDripper.sol:2:pragma solidity =0.8.10; contracts/shutdown/redeem/TribeRedeemer.sol:2:pragma solidity ^0.8.4; contracts/peg/SimpleFeiDaiPSM.sol:2:pragma solidity ^0.8.4;

Mitigation step

Avoid Using Floating Pragma instead lock the solidity version


4.Variable names that consist of all capital letters should be reserved for const/immutable variables

If the variable needs to be different based on which class it comes from, a view/pure function should be used instead (e.g. like this).

Instances

TribeReedemer.sol SimpleFeiDaiPSM.solL75 SimpleFeiDaiPSM.solL92-L98

// actual code used contracts/shutdown/redeem/TribeRedeemer.sol:17: address public immutable redeemedToken; contracts/peg/SimpleFeiDaiPSM.sol:75: address public constant balanceReportedIn = address(DAI); contracts/peg/SimpleFeiDaiPSM.sol:92: uint256 public constant mintFeeBasisPoints = 0; contracts/peg/SimpleFeiDaiPSM.sol:93: uint256 public constant redeemFeeBasisPoints = 0; contracts/peg/SimpleFeiDaiPSM.sol:94: address public constant underlyingToken = address(DAI); contracts/peg/SimpleFeiDaiPSM.sol:95: uint256 public constant getMaxMintAmountOut = type(uint256).max; contracts/peg/SimpleFeiDaiPSM.sol:96: bool public constant paused = false; contracts/peg/SimpleFeiDaiPSM.sol:97: bool public constant redeemPaused = false; contracts/peg/SimpleFeiDaiPSM.sol:98: bool public constant mintPaused = false;

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