Cally contest - 242'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: 70/100

Findings: 1

Award: $54.89

🌟 Selected for report: 0

🚀 Solo Findings: 0

Low+: Passing zero address does not revert when creating new vault for ERC20 token.

in cally.sol:function createVault, if you pass address token as address(0) along with TokenType.ERC20, a new zero'd useless vault gets created:

[71840] Cally::createVault(0, 0x0000000000000000000000000000000000000000, 0, 7, 0, 0, 1) │ ├─ emit Transfer(from: 0x0000000000000000000000000000000000000000, to: TestCreateVault: [0xb4c79dab8f259c7aee6e5b2aa729821864227e84], id: 3) │ ├─ emit NewVault(vaultId: 3, from: TestCreateVault: [0xb4c79dab8f259c7aee6e5b2aa729821864227e84], token: 0x0000000000000000000000000000000000000000) │ ├─ [0] 0x0000…0000::transferFrom(TestCreateVault: [0xb4c79dab8f259c7aee6e5b2aa729821864227e84], Cally: [0xf5a2fe45f4f1308502b1c136b9ef8af136141382], 0) │ │ └─ ← () │ └─ ← 3

This is because SafeTransferLib.sol:safeTransferFrom return true as both assembly logic operations result in 1 when applying a call to zero address.

(in case of ERC721 it correctly reverts)

add a require(token != address(0), "zero address") check to prevent zero asset vaults from being created.

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