Skip to main content

OrderRFQMixin

RFQ Limit Order mixin

Derives#

Functions#

invalidatorForOrderRFQ#

function invalidatorForOrderRFQ(  address maker,  uint256 slot) external returns (uint256)

Returns bitmask for double-spend invalidators based on lowest byte of order.info and filled quotes

Parameters:#

NameTypeDescription
makeraddress
slotuint256

Return Values:#

NameTypeDescription
Resultuint256Each bit represents whether corresponding was already invalidated

cancelOrderRFQ#

function cancelOrderRFQ(  uint256 orderInfo) external

Cancels order's quote

Parameters:#

NameTypeDescription
orderInfouint256

fillOrderRFQ#

function fillOrderRFQ(  struct OrderRFQMixin.Order order,  bytes signature,  uint256 makingAmount,  uint256 takingAmount) external returns (uint256, uint256)

Fills order's quote, fully or partially (whichever is possible)

Parameters:#

NameTypeDescription
orderstruct OrderRFQMixin.OrderOrder quote to fill
signaturebytesSignature to confirm quote ownership
makingAmountuint256Making amount
takingAmountuint256Taking amount

fillOrderRFQToWithPermit#

function fillOrderRFQToWithPermit(  struct OrderRFQMixin.Order order,  bytes signature,  uint256 makingAmount,  uint256 takingAmount,  address target,  bytes permit) external returns (uint256, uint256)

Fills Same as fillOrderRFQ 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:#

NameTypeDescription
orderstruct OrderRFQMixin.OrderOrder quote to fill
signaturebytesSignature to confirm quote ownership
makingAmountuint256Making amount
takingAmountuint256Taking amount
targetaddressAddress that will receive swap funds
permitbytesShould consist of abiencoded token address and encoded IERC20Permit.permit call.

fillOrderRFQTo#

function fillOrderRFQTo(  struct OrderRFQMixin.Order order,  bytes signature,  uint256 makingAmount,  uint256 takingAmount,  address target) public returns (uint256, uint256)

Same as fillOrderRFQ but allows to specify funds destination instead of msg.sender

Parameters:#

NameTypeDescription
orderstruct OrderRFQMixin.OrderOrder quote to fill
signaturebytesSignature to confirm quote ownership
makingAmountuint256Making amount
takingAmountuint256Taking amount
targetaddressAddress that will receive swap funds

Events#

OrderFilledRFQ#

event OrderFilledRFQ(  bytes32 orderHash,  uint256 makingAmount)

Emitted when RFQ gets filled

Parameters:#

NameTypeDescription
orderHashbytes32
makingAmountuint256