Cally contest - z3s's results

Earn yield on your NFTs or tokens via covered call vaults.

General Information

Platform: Code4rena

Start Date: 10/05/2022

Pot Size: $50,000 USDC

Total HM: 13

Participants: 100

Period: 5 days

Judge: HardlyDifficult

Total Solo HM: 1

Id: 122

League: ETH

Cally

Findings Distribution

Researcher Performance

Rank: 51/100

Findings: 2

Award: $85.06

🌟 Selected for report: 0

🚀 Solo Findings: 0

Low Critical

[L01] Define MAX_FEE:

Use MAX_FEE to ensure users that protocol won't use 100% exercise fee.

Define preferable MAX_FEE in contract:

uint256 public constant MAX_FEE = (10 / 100) * 1e18; // 10%

and use it in setFee():

function setFee(uint256 feeRate_) external onlyOwner {
    require(feeRate_ <= MAX_FEE, "Fee too big");
    feeRate = feeRate_;
}

Non Critical

[N01] durationDays is uint8 so it supports days up to 255:

If a user wants more duration than 255 days, she can't set it.

Use bigger uint for durationDays.

[N02] Typos in comments:

Change OVVERIDES to OVERRIDES:

Cally.sol 426,9: OVVERIDES FUNCTIONS

#0 - outdoteth

2022-05-16T18:54:18Z

this can be bumped to medium severity: [L01] Define MAX_FEE: https://github.com/code-423n4/2022-05-cally-findings/issues/48

#1 - HardlyDifficult

2022-05-30T19:16:22Z

Per the C4 guidance "part of auditing is demonstrating proper theory of how an issue could be exploited" and that does not seem to be explored here as it was in the primary report.

Gas Optimizations

[G01] uint256 default value is 0 so we can remove = 0:

Cally.sol 94,28: uint256 public feeRate = 0; 95,42: uint256 public protocolUnclaimedFees = 0; 282,21: uint256 fee = 0;

[G02] Use Custom Errors to save Gas:

Custom errors from Solidity 0.8.4 are cheaper than require messages. https://blog.soliditylang.org/2021/04/21/custom-errors/

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