Alchemix contest - Cityscape'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: 37/62

Findings: 2

Award: $267.84

🌟 Selected for report: 0

🚀 Solo Findings: 0

Low-Risk

Use _grantRole instead of _setupRole

according to openzeppelin documentation: https://docs.openzeppelin.com/contracts/4.x/api/access, _setupRole() is only to be called from the constructor while _grantRole() is to be called anywhere else, doing otherwise is circumventing the admin system.

This vulnerability is present on the following lines.

https://github.com/code-423n4/2022-05-alchemix/blob/71abbe683dfd5c0686b7e594fb4f78a14b668d8b/contracts-full/AlchemicTokenV1.sol#L102

https://github.com/code-423n4/2022-05-alchemix/blob/71abbe683dfd5c0686b7e594fb4f78a14b668d8b/contracts-full/AlchemicTokenV2.sol#L129

https://github.com/code-423n4/2022-05-alchemix/blob/71abbe683dfd5c0686b7e594fb4f78a14b668d8b/contracts-full/AlchemicTokenV2Base.sol#L142

Non-Critical

Function _getExchangedBalance lacks NatSpec

https://github.com/code-423n4/2022-05-alchemix/blob/71abbe683dfd5c0686b7e594fb4f78a14b668d8b/contracts-full/TransmuterV2.sol#L554

Variable normaizedAmount is mispelled

considering the variable normaizedAmount is a return from the function _normalizeUnderlyingTokensToDebt() I believe it is appropriate to change the name of the variable to normalizedAmount, for consistency and clarity.

https://github.com/code-423n4/2022-05-alchemix/blob/71abbe683dfd5c0686b7e594fb4f78a14b668d8b/contracts-full/TransmuterV2.sol#L251

#0 - 0xfoobar

2022-05-30T07:56:19Z

Useful comment on _setupRole vs _grantRole

Gas Optimizations

Named Returns

function _getExchangedBalance(address owner) internal view returns (uint256 exchangedBalance) {

proposed change:

function _getExchangedBalance(address owner) internal view returns (uint256) {

https://github.com/code-423n4/2022-05-alchemix/blob/71abbe683dfd5c0686b7e594fb4f78a14b668d8b/contracts-full/TransmuterV2.sol#L554

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