Alchemix contest - jayjonah8'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: 46/62

Findings: 1

Award: $188.90

🌟 Selected for report: 0

🚀 Solo Findings: 0

Use of deprecated safeApprove() function

Lines of code

https://github.com/code-423n4/2022-05-alchemix/blob/main/contracts-full/AlchemistV2.sol#L382 https://github.com/code-423n4/2022-05-alchemix/blob/main/contracts-full/AlchemistV2.sol#L383

Vulnerability details

Impact

In AlchemistV2.sol the addYieldToken() function makes use of safeApprove from Open Zeppelin. The safeApprove implementation is deprecated. Using this deprecated function can lead to unintended reverts and potentially the locking of user funds.

Proof of Concept

https://github.com/code-423n4/2022-05-alchemix/blob/main/contracts-full/AlchemistV2.sol#L382

https://github.com/code-423n4/2022-05-alchemix/blob/main/contracts-full/AlchemistV2.sol#L383

https://github.com/OpenZeppelin/openzeppelin-contracts/blob/566a774222707e424896c0c390a84dc3c13bdcb2/contracts/token/ERC20/utils/SafeERC20.sol#L38

https://github.com/OpenZeppelin/openzeppelin-contracts/issues/2219

Tools Used

Manual code review

Consider replacing safeApprove() with safeIncreaseAllowance() or safeDecreaseAllowance() instead.

#0 - 0xfoobar

2022-05-30T06:31:28Z

Sponsor acknowledged

Not a practical concern, just a better design

#1 - 0xleastwood

2022-06-02T19:12:30Z

Agree with sponsor, putting this in the warden's QA report instead.

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