Cally contest - djxploit'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: 45/100

Findings: 2

Award: $86.43

🌟 Selected for report: 0

🚀 Solo Findings: 0

1st issue : Wrong revert comment

In L169, the revert comment should be "Reserve strike too large"

2nd issue : Error in calculation of fee

While calculating fee, in the block L282-L286, the calculation doesn't take into account for smaller feeRate and vault.currentStrike. Because , when the vault.currentStrike < 1e17 and feeRate == 1 , in that case calculated fee becomes 0. So no fee is required for while exercising options bought at that price, and feerate.

3rd issue : No max limit on fee

There is no max limit set on the fee rate, as seen in the setFee function L119-L121 Due to this a malicious owner can set a high feerate and cause griefing to it's users.

4th issue : Use of block.timestamp

block.timestamp can be manipulated by miners. https://github.com/code-423n4/2022-05-cally/blob/main/contracts/src/Cally.sol#L228

#0 - outdoteth

2022-05-16T18:58:22Z

this can be bumped to medium severity: 3rd issue : No max limit on fee: https://github.com/code-423n4/2022-05-cally-findings/issues/48

  1. Using unchecked keyword to prevent overflow/underflow checks, saves gas https://github.com/code-423n4/2022-05-cally/blob/main/contracts/src/Cally.sol#L265 https://github.com/code-423n4/2022-05-cally/blob/main/contracts/src/Cally.sol#L417 https://github.com/code-423n4/2022-05-cally/blob/main/contracts/src/Cally.sol#L459

  2. Use !=0 instead of > 0 inside require statements, to save gas. https://github.com/code-423n4/2022-05-cally/blob/main/contracts/src/Cally.sol#L170

  3. In https://github.com/code-423n4/2022-05-cally/blob/main/contracts/src/Cally.sol#L283, the if (feeRate > 0) { can be changed to if (feeRate) { to save gas

  4. Function setFee and vaults of Cally.sol contract are single line functions, that can be inlined to save gas.

  5. In https://github.com/code-423n4/2022-05-cally/blob/main/contracts/src/Cally.sol#L94-L95, initialization of the two variables are not required, as they are set as 0, by default

  6. The parameters of createVault function in Cally.sol contract, can be marked as calldata to save gas.

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