Caviar Private Pools - p0wd3r's results

A fully on-chain NFT AMM that allows you to trade every NFT in a collection.

General Information

Platform: Code4rena

Start Date: 07/04/2023

Pot Size: $47,000 USDC

Total HM: 20

Participants: 120

Period: 6 days

Judge: GalloDaSballo

Total Solo HM: 4

Id: 230

League: ETH

Caviar

Findings Distribution

Researcher Performance

Rank: 71/120

Findings: 1

Award: $31.00

QA:
grade-b

🌟 Selected for report: 0

🚀 Solo Findings: 0

Awards

30.9954 USDC - $31.00

Labels

bug
grade-b
QA (Quality Assurance)
edited-by-warden
Q-12

External Links

Check if tokenIds is empty at the beginning of the buy/sell/change function.

PrivatePool.sol L211

function buy(uint256[] calldata tokenIds, uint256[] calldata tokenWeights, MerkleMultiProof calldata proof) { ... emit Buy(tokenIds, tokenWeights, netInputAmount, feeAmount, protocolFeeAmount, royaltyFeeAmount); }

The buy function does not check if tokenIds is empty. If it is empty, the function will continue to execute and eventually emit an event that has no effect and should not be emitted.

The sell and change functions have the same issue.

The parameters of flashFee were not used.

PrivatePool.sol L750

function flashFee(address, uint256) public view returns (uint256) { return changeFee; }

import IERC3156FlashBorrower.sol indead of IERC3156FlashLender.sol

PrivatePool.sol L34

import {IERC3156FlashBorrower} from "openzeppelin/interfaces/IERC3156FlashLender.sol";

It only use IERC3156FlashBorrower, other functions in IERC3156FlashLender.sol are not used.

#0 - c4-judge

2023-05-01T08:50:31Z

GalloDaSballo marked the issue as grade-c

#1 - GalloDaSballo

2023-05-05T09:09:59Z

3R

#2 - GalloDaSballo

2023-05-05T09:10:30Z

Barely made it, 4L 3R

#3 - c4-judge

2023-05-05T09:10:36Z

GalloDaSballo marked the issue as grade-b

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