Alchemix contest - sikorico's results

A protocol for self-repaying loans with no liquidation risk.

General Information

Platform: Code4rena

Start Date: 05/05/2022

Pot Size: $125,000 DAI

Total HM: 17

Participants: 62

Period: 14 days

Judge: leastwood

Total Solo HM: 15

Id: 120

League: ETH

Alchemix

Findings Distribution

Researcher Performance

Rank: 29/62

Findings: 2

Award: $272.59

🌟 Selected for report: 0

🚀 Solo Findings: 0

Code Quality Report

[Low-01] Add a timelock

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

[Low-02] Init function exposed to a front-run attack

This is a small frontrun issue but still worth mentioning. One can frontrun your init function and then stuck the system since you will not be able to use the function again:

[Low-03] Change owner with two steps verification process

Consider having two steps verification to change owner to avoid human errors. The following contracts use direct transfer.

[Low-04] Fee parameter should be in a certain range

Some fee parameters of functions are not checked for invalid values. The fee parameter should not exceed 100%.

Gas Report

[Gas-01] Use bytes32 instead of string to save gas whenever possible

Use bytes32 instead of string to save gas whenever possible. String is a dynamic data structure and therefore is more gas consuming then bytes32.

[Gas-02] Caching array length can save gas

Caching the array length is more gas efficient. This is because access to a local variable in solidity is more efficient than query storage / calldata / memory. We recommend to cache the array length as a local variable and use it instead of array.length.

[Gas-03] Prefix increments are cheaper than postfix increments

Prefix increments are cheaper than postfix increments. Further more, using unchecked {++x} is even more gas efficient, and the gas saving accumulates every iteration and can make a real change

[Gas-04] Unnecessary default assignment

Unnecessary default assignments, you can just declare and it will save gas and have the same meaning.

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