Alchemix contest - mics'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: 19/62

Findings: 2

Award: $379.89

🌟 Selected for report: 0

🚀 Solo Findings: 0

Low Risk Findings

[QA-1] Use timelock modifier for setter functions

Timelock modifier is commonly used for storage variable setters that effects the contract logic. Consider adding timelocks on such setters.

AlchemicTokenV1.solL#101 AlchemicTokenV1.solL#131 AlchemicTokenV2.solL#119 AlchemicTokenV2.solL#164 AlchemicTokenV2Base.solL#132

[QA-2] Two steps verification

Consider changing to two steps verification process of transferring privileges. Human mistakes can happen.

gALCX.sol

[QA-3] 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.

SelfPermit.sol SelfPermit.sol

Gas Optimizations Report

Table of contents

Gas Findings

[Gas-1] Do not cache msg.sender

We recommend not to cache msg.sender since calling it is 2 gas while reading a variable is more.

gALCX.solL#26 gALCX.solL#26

[Gas-2] Use != 0 instead of > 0

Using != 0 is slightly cheaper than > 0. We recommend to replace > with != in the following places:

AlchemicTokenV2.solL#211 AlchemicTokenV2Base.solL#243 AlchemistV2.solL#466 AlchemistV2.solL#678 AlchemistV2.solL#692

[Gas-3] Unnecessary index init

In for loops you initialize the index to start from 0, but it already initialized to 0 in default and this assignment cost gas. It is more clear and gas efficient to declare without assigning 0 and will have the same meaning:

AlchemistV2.solL#990 AlchemistV2.solL#1282 AlchemistV2.solL#1461 AlchemistV2.solL#1524 Multicall.solL#14

[Gas-4] Unnecessary reentrancy guard

Reentracy guard is not be necessary in the following cases since the functuin is protected by another modifier (e.g is initializer function, or only owner). Removing the reentracy guard can save gas.

TransmuterV2.solL#250 TransmuterV2.solL#250

[Gas-5] Unused state variables can be removed to save gas

Unused state variables are gas consuming at deployment (since they are located in storage) and are a bad code practice. Removing those variables will decrease deployment gas cost and improve code quality.

FuseTokenAdapterV1.sol: FIXED_POINT_SCALAR
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