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

Findings: 1

Award: $33.58

🌟 Selected for report: 0

🚀 Solo Findings: 0

Summary

Low

[L01] A floating pragma is set. [L02] Outdated compiler version [L03] Missing checks for address(0x0) when assigning values to address state variables

Non Critical

[NC01] Constants should be defined rather than using magic numbers [NC02] Event is missing indexed fields [NC03] Duplicated require()/revert() checks should be refactored to a modifier or function

Low

[L01] A floating pragma is set.

Description

Some contracts have the pragma solidity directive ^0.8.4. It is recommended to specify a fixed compiler version to ensure that the bytecode produced does not vary between builds. This is especially important if you rely on bytecode-level verification of the code.

Mitigation

Lock the pragma.

Lines in the code

TribeRedeemer.sol#L2 SimpleFeiDaiPSM.sol#L2

[L02] Outdated compiler version

It's a best practice to use the latest compiler version. The specified minimum compiler version is quite old. Older compilers might be susceptible to some bugs. It's recommended changing the solidity version pragma to the latest version to enforce the use of an up-to-date compiler.

A list of known compiler bugs and their severity can be found here: https://etherscan.io/solcbuginfo

To check the bugfixed and improvements of latest versions see the following link

Mitigation

Update the pragma to 0.8.16

Lines in the code

RariMerkleRedeemer.sol#L2 MerkleRedeemerDripper.sol#L2 TribeRedeemer.sol#L2 SimpleFeiDaiPSM.sol#L2

[L03] Missing checks for address(0x0) when assigning values to address state variables

Lines in the code

TribeRedeemer.sol#L32-L33

Non Critical

[NC01] Constants should be defined rather than using magic numbers

Even assembly can benefit from using readable constants instead of hex/numeric literals

Lines in the code

RariMerkleRedeemer.sol#L125 RariMerkleRedeemer.sol#L138

[NC02] Event is missing indexed fields

Description

Index event fields make the field more quickly accessible to off-chain tools that parse events. However, note that each index field costs extra gas during emission, so it's not necessarily best to index the maximum allowed per event (three fields). Each event should use three indexed fields if there are three or more fields, and gas usage is not particularly of concern for the events in question. If there are fewer than three fields, all of the fields should be indexed.

Lines in the code

TribeRedeemer.sol#L14 SimpleFeiDaiPSM.sol#L27 SimpleFeiDaiPSM.sol#L29

[NC03] Duplicated require()/revert() checks should be refactored to a modifier or function

Description

The compiler will inline the function, which will avoid JUMP instructions usually associated with functions

Lines in the code

require(_cTokens.length == 27, "Must provide exactly 27 exchange rates.");

RariMerkleRedeemer.sol#L125 RariMerkleRedeemer.sol#L138

require(_cTokens.length == _exchangeRates.length, "Exchange rates must be provided for each cToken");

RariMerkleRedeemer.sol#L126 RariMerkleRedeemer.sol#L139

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