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

Findings: 1

Award: $33.58

🌟 Selected for report: 0

🚀 Solo Findings: 0

QA REPORT

Loss of precision: multiplications should be before divisions

Consider changing the order of the following instances math operators such that multiplications comes before divisions to improve calculation precision with no cost.

Code Instances:

Use safeTransfer() instead transfer()

Use openzeppelin safeTransfer() method instead of transfer() in the following locations.

Code Instances:

Missing zero address check for initializers functions

Missing checks for zero-addresses may lead to infunctional protocol. In this case the function is an initializer then the value can be passed only once and is important to be validated. If the variable addresses are updated incorrectly.

For instance, TribalChief.sol#L140

Array access is out of bounds

There is no check for the access to be in the array bounds.

Code Instances:

Unused success return value

The following calls ignores the return value of the called function that might indicate the the call failed.

Code Instances:

Use timelock modifier for setter functions

It is good to have a timelock for functions that set key/critical variables.

Code Instances:

Should approve(0) first

Some tokens (like USDT L199) do not work when changing the allowance from an existing non-zero allowance value. They must first be approved by zero and then the actual allowance must be approved.

Code Instances:

Use safe math for solidity version <8

You should use safe math for solidity version <8 since there is no default over/under flow check it those versions.'

For instance, DSTest.sol

Conditions that are based on block number

The following condition statements are based on block number that can be manipulated by a malicious miner.

Code Instances:

Missing 0 address check at transfer

Some contracts does not support 0 transfer, then the transaction will revert with no explanation. We recommend to add a require statement that the amount is not 0.

Code Instances:

Missing two steps verification process

The process of transferring ownership is dangerous since typing the wrong address can lead to severe implications. It is better to have to steps verification process with set and claim functions to decrease the chances of human error. Consider changing to two steps verification process of transferring privileges. Human mistakes can happen.

Code Instances:

Approve return value is ignored

According to the ERC20 specs, the approve function is allowed to return a success value, that may be negative. Same as transfer return value, approve return value should be handled.

Code Instances:

Missing zero address check in a state variable setter function

A state variable of type 'address' is set without a non-zero verification. This can lead to undesired behavior.

Code Instances:

Make sure the following functions has to be payable

I didn't see a use of using payable in the following functions, consider changing it.

Code Instances:

Several functions are declaring named returns but then are using return statements. I suggest choosing only one for readability reasons.

Using both named returns and a return statement isn't necessary. Removing one of those can improve code clarity.

Code Instances:

Add event to the following functions

Code Instances:

Missing an event after critical initialize() functions

To record the initialize parameters for off-chain monitoring and transparency reasons, you might find it useful to emit an event after the initialize() functions

Code Instances:

Consider adding constant variables instead of hardcoded strings

A good practice is to use constant variables instead of hardcoded strings in the code.

Code Instances:

Events not emitted for important state changes

When changing state variables events are not emitted. Emitting events allows monitoring activities with off-chain monitoring tools.

Code Instances:

--

#0 - HickupHH3

2022-10-08T08:14:51Z

most of the issues mentioned had files that were OOS. spray and pray something sticks report style is frankly a waste of the sponsor and judge's time.

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