Hunt prep
Before you test Caviar Private Pools
What 28 disclosed reports say about Caviar Private Pools: what was found and paid, what was fixed, and where it may be worth looking next.
- with a public bounty
- 0
- median public bounty
- –
- highest public bounty
- –
Gaps worth testing
Not written yet for this program. The numbers below are up to date.
What was found and what it paid
Public bounties only; many reports disclose without the amount.
| Class | Reports | Paid | Median | Highest | In all |
|---|---|---|---|---|---|
| Business logic lesson | 13 | 0 | – | – | $0 |
| Smart contracts lesson | 8 | 0 | – | – | $0 |
| Access control lesson | 2 | 0 | – | – | $0 |
| DoS lesson | 2 | 0 | – | – | $0 |
What was fixed
All reportsThe newest fixes, in our words. A fixed bug is not worth re-reporting, but a sibling feature, an older API version or a regression may be.
-
Factory.create : Predictability of pool address creates multiple issues.
The fix was to include the sender's address in the salt used for deterministic deployment, and it was confirmed mitigated.
Disclosed
-
Flash loan fee is incorrect in Private Pool contract
The flashFee function should scale the changeFee value similarly to changeFeeQuote, by exponentiating it based on the base token's decimals.
Disclosed
-
Loss of funds for traders due to accounting error in royalty calculations
The fix was to only add the royalty fee to the total collected amount when the recipient address is non-zero, as confirmed by the project.
Disclosed
-
Royalty recipients will not get fair share of royalties
The weight of each NFT relative to others in the purchase should be taken into account when calculating royalties.
Disclosed
-
EthRouter can’t perform multiple changes
The fix was to add a baseTokenAmount field to the Change struct and use that amount instead of msg.value when calling the pool.
Disclosed
-
The royaltyRecipient could not be prepare to receive ether, making the sell to fail
The code should handle royalty payments in a way that does not revert the whole sale, for example by sending WETH instead of ether when the recipient rejects ether.
Disclosed
-
Risk of silent overflow in reserves update
The issue was fixed by adding checks that each value being cast does not exceed the maximum uint128 value before updating the reserves.
Disclosed
-
EthRouter.sell , EthRouter.deposit , and EthRouter.change functions can be DOS’ed for some ERC721 tokens
The router should check if the pool is already approved for the NFT and skip the setApprovalForAll call if so; this was fixed by the Caviar team.
Disclosed
-
Royalty receiver can drain a private pool
The buy function should be simplified to use only one loop and call _getRoyalty once, ensuring the amount sent to royalty receivers matches the calculated amount.
Disclosed
-
The buy function’s mechanism enables users to acquire flash loans at a cheaper fee rate.
The NFTs should be sent only after the payment has been received by the contract.
Disclosed
-
changeFeeQuote will fail for low decimal ERC20 tokens
The changeFeeQuote function should check if token decimals are less than 4 and scale the fee by dividing instead of multiplying.
Disclosed
-
Flashloan fee is not distributed to the factory
The flashloan function was fixed to calculate and transfer the protocol fee to the factory in addition to the pool fee.
Disclosed
-
Transaction revert if the baseToken does not support 0 value transfer when charging changeFee
The protocol should check that the fee amount is greater than zero before performing the transfer.
Disclosed
-
Pool tokens can be stolen via PrivatePool.flashLoan function from previous owner
The execute function was fixed to revert if the target contract is the baseToken or nft, preventing malicious approvals.
Disclosed
-
Incorrect protocol fee is taken when changing NFTs
The fix was to add a separate protocolChangeFeeRate and calculate the protocol fee as a percentage of the fee amount using that rate.
Disclosed