Module 4: Size cap
Split a block into slices without signing several orders. Each fill is clamped to the cap, so one taker cannot take the whole order in one call. A minimum fill can sit beside it.
Status
Ready
Signed
Largest fill
Code · OrbuSettlementDesk.sol
function _soldFor(Order calldata o, uint256 remaining, uint256 wanted) private pure returns (uint256 sold) {
sold = _min(wanted, remaining);
if (o.policy.maxFill != 0) sold = _min(sold, o.policy.maxFill);
}Tests that cover it
test_sizeCapClampsOneFill test_minFillAllowsLastRemainder test_allOrNothing
What it does
One fill cannot take more of the sell token than the signed cap.
On chain
- Desk
- Not deployed yet
- Enforced
- —
- Roster
- Opens after the token launches
- Reads
- the fill amount
