IO

Git Source

Configuration for a single input or output on an Order.

struct IO {
    address token;
    uint8 decimals;
    uint256 vaultId;
}

Properties

NameTypeDescription
tokenaddressThe token to either send from the owner as an output or receive from the counterparty to the owner as an input. The tokens are not moved during an order, only internal vault balances are updated, until a separate withdraw step.
decimalsuint8The decimals to use for internal scaling calculations for token. This is provided directly in IO to save gas on external lookups and to respect the ERC20 spec that mandates NOT assuming or using the decimals method for onchain calculations. Ostensibly the decimals exists so that all calculate order entrypoints can treat amounts and ratios as 18 decimal fixed point values. Order max amounts MUST be rounded down and IO ratios rounded up to compensate for any loss of precision during decimal rescaling.
vaultIduint256The vault ID that tokens will move into if this is an input or move out from if this is an output.