In normal behavior, the seller creates an order with a token and price in USDC. The buyer then purchases the order by paying the exact priceInUSDC
.
However, the contract currently allows the seller to set an extremely large priceInUSDC
, and this unbounded value can cause an arithmetic overflow when computing protocol fees. This causes the buyOrder()
function to revert, making it impossible for buyers to fulfill such orders, effectively locking the token in an “active but unpurchasable” state.
Likelihood:
Sellers can deliberately submit orders with extremely large priceInUSDC
, since no cap is enforced.
The function will revert every time a buyer attempts to purchase such an order.
Impact:
Tokens in such orders gets stuck, unless the seller cancels.
This breaks user expectations and damages the reliability of the platform for buyers.
This test simulates a real-world scenario where a seller sets an extremely large price for their order (e.g., 1.15e77
USDC), which still passes basic validations and can be set/amended into the order. However, when a buyer attempts to fulfill this order, the buyOrder
function tries to calculate the protocol fee.
Because order.priceInUSDC
is so large, the multiplication results in an arithmetic overflow, even though Solidity 0.8+ reverts on overflow. This completely reverts the buy transaction, meaning:
The buyer cannot buy the order.
Their approval and intent are wasted.
The protocol appears broken or unresponsive.
To prevent this, cap the priceInUSDC
when creating or amending orders. This avoids ever reaching a state where overflow is possible in buyOrder
. We can set the MAX_PRICE
to type(uint256).max / 3
as here the protocol fees is 3% or set an amount like 1e18 i.e 1 Trillion USDC.
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
View preliminary resultsAppeals are being carefully reviewed by our judges.
The contest is complete and the rewards are being distributed.