OrderMixin
Regular Limit Order mixin
Derives
Permitable
Functions
remaining
Returns unfilled amount for order. Throws if order does not exist
Parameters:
Name | Type | Description |
---|---|---|
| bytes32 |
remainingRaw
Returns unfilled amount for order
Parameters:
Name | Type | Description |
---|---|---|
| bytes32 |
Return Values:
Name | Type | Description |
---|---|---|
| uint256 | Unfilled amount of order plus one if order exists. Otherwise 0 |
remainingsRaw
Same as remainingRaw
but for multiple orders
Parameters:
Name | Type | Description |
---|---|---|
| bytes32[] |
simulateCalls
Calls every target with corresponding data. Then reverts with CALL_RESULTS_0101011 where zeroes and ones denote failure or success of the corresponding call
Parameters:
Name | Type | Description |
---|---|---|
| address[] | Array of addresses that will be called |
| bytes[] | Array of data that will be passed to each call |
cancelOrder
Cancels order by setting remaining amount to zero
Parameters:
Name | Type | Description |
---|---|---|
| struct OrderLib.Order |
fillOrder
Fills an order. If one doesn't exist (first fill) it will be created using order.makerAssetData
Parameters:
Name | Type | Description |
---|---|---|
| struct OrderLib.Order | Order quote to fill |
| bytes | Signature to confirm quote ownership |
| bytes | Making amount |
| uint256 | Taking amount |
| uint256 | Specifies maximum allowed takingAmount when takingAmount is zero, otherwise specifies minimum allowed makingAmount |
| uint256 |
fillOrderToWithPermit
Same as fillOrder
but calls permit first, allowing to approve token spending and make a swap in one transaction. Also allows to specify funds destination instead of msg.sender
See tests for examples
Parameters:
Name | Type | Description |
---|---|---|
| struct OrderLib.Order | Order quote to fill |
| bytes | Signature to confirm quote ownership |
| bytes | Making amount |
| uint256 | Taking amount |
| uint256 | Specifies maximum allowed takingAmount when takingAmount is zero, otherwise specifies minimum allowed makingAmount |
| uint256 | Address that will receive swap funds |
| address | Should consist of abiencoded token address and encoded |
| bytes |
fillOrderTo
Same as fillOrder
but allows to specify funds destination instead of msg.sender
Parameters:
Name | Type | Description |
---|---|---|
| struct OrderLib.Order | Order quote to fill |
| bytes | Signature to confirm quote ownership |
| bytes | Making amount |
| uint256 | Taking amount |
| uint256 | Specifies maximum allowed takingAmount when takingAmount is zero, otherwise specifies minimum allowed makingAmount |
| uint256 | Address that will receive swap funds |
| address |
checkPredicate
Checks order predicate
Parameters:
Name | Type | Description |
---|---|---|
| struct OrderLib.Order |
hashOrder
Parameters:
Name | Type | Description |
---|---|---|
| struct OrderLib.Order |
Events
OrderFilled
Emitted every time order gets filled, including partial fills
Parameters:
Name | Type | Description |
---|---|---|
| address | |
| bytes32 | |
| uint256 |
OrderCanceled
Emitted when order gets cancelled
Parameters:
Name | Type | Description |
---|---|---|
| address | |
| bytes32 | |
| uint256 |
Last updated