# LimitOrderProtocol

## Derives[​](https://docs.1inch.io/docs/aggregation-protocol/smart-contract/LimitOrderProtocolRFQ#derives) <a href="#derives" id="derives"></a>

* [Permitable](broken://pages/DOO2eTZDAe5crCpeY8uu)
* [EIP712](https://docs.openzeppelin.com/contracts/3.x/api/drafts#EIP712)
* [EthReceiver](broken://pages/iW8VH14sl4YfZUdHor2O)

## Functions[​](https://docs.1inch.io/docs/aggregation-protocol/smart-contract/LimitOrderProtocolRFQ#functions) <a href="#functions" id="functions"></a>

### constructor[​](https://docs.1inch.io/docs/aggregation-protocol/smart-contract/LimitOrderProtocolRFQ#constructor) <a href="#constructor" id="constructor"></a>

```javascript
function constructor(
  address weth
) public
```

**Parameters:**[**​**](https://docs.1inch.io/docs/aggregation-protocol/smart-contract/LimitOrderProtocolRFQ#parameters)

| Name   | Type    | Description |
| ------ | ------- | ----------- |
| `weth` | address |             |

### DOMAIN\_SEPARATOR[​](https://docs.1inch.io/docs/aggregation-protocol/smart-contract/LimitOrderProtocolRFQ#domain_separator) <a href="#domain_separator" id="domain_separator"></a>

```
function DOMAIN_SEPARATOR(
) external returns (bytes32)
```

### invalidatorForOrderRFQ[​](https://docs.1inch.io/docs/aggregation-protocol/smart-contract/LimitOrderProtocolRFQ#invalidatorfororderrfq) <a href="#invalidatorfororderrfq" id="invalidatorfororderrfq"></a>

```javascript
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:**[**​**](https://docs.1inch.io/docs/aggregation-protocol/smart-contract/LimitOrderProtocolRFQ#parameters-1)

| Name    | Type    | Description |
| ------- | ------- | ----------- |
| `maker` | address |             |
| `slot`  | uint256 |             |

**Return Values:**[**​**](https://docs.1inch.io/docs/aggregation-protocol/smart-contract/LimitOrderProtocolRFQ#return-values)

| Name     | Type    | Description                                                 |
| -------- | ------- | ----------------------------------------------------------- |
| `Result` | uint256 | Each bit represents whenever corresponding quote was filled |

### cancelOrderRFQ[​](https://docs.1inch.io/docs/aggregation-protocol/smart-contract/LimitOrderProtocolRFQ#cancelorderrfq) <a href="#cancelorderrfq" id="cancelorderrfq"></a>

```javascript
function cancelOrderRFQ(
  uint256 orderInfo
) external
```

Cancels order's quote

**Parameters:**[**​**](https://docs.1inch.io/docs/aggregation-protocol/smart-contract/LimitOrderProtocolRFQ#parameters-2)

| Name        | Type    | Description |
| ----------- | ------- | ----------- |
| `orderInfo` | uint256 |             |

### fillOrderRFQ[​](https://docs.1inch.io/docs/aggregation-protocol/smart-contract/LimitOrderProtocolRFQ#fillorderrfq) <a href="#fillorderrfq" id="fillorderrfq"></a>

```javascript
function fillOrderRFQ(
  struct LimitOrderProtocolRFQ.OrderRFQ order,
  bytes signature,
  uint256 makingAmount,
  uint256 takingAmount
) external returns (uint256, uint256)
```

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

**Parameters:**[**​**](https://docs.1inch.io/docs/aggregation-protocol/smart-contract/LimitOrderProtocolRFQ#parameters-3)

| Name           | Type                                  | Description                          |
| -------------- | ------------------------------------- | ------------------------------------ |
| `order`        | struct LimitOrderProtocolRFQ.OrderRFQ | Order quote to fill                  |
| `signature`    | bytes                                 | Signature to confirm quote ownership |
| `makingAmount` | uint256                               | Making amount                        |
| `takingAmount` | uint256                               | Taking amount                        |

### fillOrderRFQToWithPermit[​](https://docs.1inch.io/docs/aggregation-protocol/smart-contract/LimitOrderProtocolRFQ#fillorderrfqtowithpermit) <a href="#fillorderrfqtowithpermit" id="fillorderrfqtowithpermit"></a>

```javascript
function fillOrderRFQToWithPermit(
  struct LimitOrderProtocolRFQ.OrderRFQ order,
  bytes signature,
  uint256 makingAmount,
  uint256 takingAmount,
  address payable 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`

**Parameters:**[**​**](https://docs.1inch.io/docs/aggregation-protocol/smart-contract/LimitOrderProtocolRFQ#parameters-4)

| Name           | Type                                  | Description                                                                                               |
| -------------- | ------------------------------------- | --------------------------------------------------------------------------------------------------------- |
| `order`        | struct LimitOrderProtocolRFQ.OrderRFQ | Order quote to fill                                                                                       |
| `signature`    | bytes                                 | Signature to confirm quote ownership                                                                      |
| `makingAmount` | uint256                               | Making amount                                                                                             |
| `takingAmount` | uint256                               | Taking amount                                                                                             |
| `target`       | address payable                       | Address that will receive swap funds                                                                      |
| `permit`       | bytes                                 | Should consist of abiencoded token address and encoded `IERC20Permit.permit` call. See tests for examples |

### fillOrderRFQTo[​](https://docs.1inch.io/docs/aggregation-protocol/smart-contract/LimitOrderProtocolRFQ#fillorderrfqto) <a href="#fillorderrfqto" id="fillorderrfqto"></a>

```javascript
function fillOrderRFQTo(
  struct LimitOrderProtocolRFQ.OrderRFQ order,
  bytes signature,
  uint256 makingAmount,
  uint256 takingAmount,
  address payable target
) public returns (uint256, uint256)
```

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

**Parameters:**[**​**](https://docs.1inch.io/docs/aggregation-protocol/smart-contract/LimitOrderProtocolRFQ#parameters-5)

| Name           | Type                                  | Description                          |
| -------------- | ------------------------------------- | ------------------------------------ |
| `order`        | struct LimitOrderProtocolRFQ.OrderRFQ | Order quote to fill                  |
| `signature`    | bytes                                 | Signature to confirm quote ownership |
| `makingAmount` | uint256                               | Making amount                        |
| `takingAmount` | uint256                               | Taking amount                        |
| `target`       | address payable                       | Address that will receive swap funds |

## Events[​](https://docs.1inch.io/docs/aggregation-protocol/smart-contract/LimitOrderProtocolRFQ#events) <a href="#events" id="events"></a>

### OrderFilledRFQ[​](https://docs.1inch.io/docs/aggregation-protocol/smart-contract/LimitOrderProtocolRFQ#orderfilledrfq) <a href="#orderfilledrfq" id="orderfilledrfq"></a>

```javascript
event OrderFilledRFQ(
  bytes32 orderHash,
  uint256 makingAmount
)
```

**Parameters:**[**​**](https://docs.1inch.io/docs/aggregation-protocol/smart-contract/LimitOrderProtocolRFQ#parameters-6)

| Name           | Type    | Description |
| -------------- | ------- | ----------- |
| `orderHash`    | bytes32 |             |
| `makingAmount` | uint256 |             |


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.vulpefi.com/aggregation-protocol/smart-contracts/limitorderprotocol.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
