Yieldy contest - mics's results

A protocol for gaining single side yields on various tokens.

General Information

Platform: Code4rena

Start Date: 21/06/2022

Pot Size: $50,000 USDC

Total HM: 31

Participants: 99

Period: 5 days

Judges: moose-code, JasoonS, denhampreen

Total Solo HM: 17

Id: 139

League: ETH

Yieldy

Findings Distribution

Researcher Performance

Rank: 68/99

Findings: 2

Award: $79.71

🌟 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.

https://github.com/code-423n4/2022-06-yieldy/tree/main/src/contracts/Staking.sol#L157 https://github.com/code-423n4/2022-06-yieldy/tree/main/src/contracts/Staking.sol#L167 https://github.com/code-423n4/2022-06-yieldy/tree/main/src/contracts/Staking.sol#L217 https://github.com/code-423n4/2022-06-yieldy/tree/main/src/contracts/Staking.sol#L226 https://github.com/code-423n4/2022-06-yieldy/tree/main/src/contracts/Staking.sol#L235

Gas Optimizations Report

Table of contents

Gas Findings

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

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

https://github.com/code-423n4/2022-06-yieldy/tree/main/src/contracts/Staking.sol#L535 https://github.com/code-423n4/2022-06-yieldy/tree/main/src/contracts/Staking.sol#L572 https://github.com/code-423n4/2022-06-yieldy/tree/main/src/contracts/Staking.sol#L604

[Gas-2] Rearrange state variables

You can change the order of the storage variables to decrease memory uses. This is because the new suggested new orders will use less storage slots.

https://github.com/code-423n4/2022-06-yieldy/tree/main/src/contracts/LiquidityReserveStorage.sol:

old number of slots: 7 new number of slots: 6 the new order of types is 1. uint256 2. uint256 3. uint256 4. address 5. bool 6. address 7. address https://github.com/code-423n4/2022-06-yieldy/tree/main/src/contracts/YieldyStorage.sol: old number of slots: 12 new number of slots: 11 the new order of types is 1. ArrayTypeName - Rebase 2. uint256 3. bytes32 4. bytes32 5. bytes32 6. uint256 7. uint256 8. uint256 9. uint256 10. uint256 11. address 12. uint8

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