# Zocr: On-Chain Relay
Author: GuildCrypt


[abi](data:,%5B%0A%20%20%7B%0A%20%20%20%20%22constant%22:%20true,%0A%20%20%20%20%22inputs%22:%20%5B%0A%20%20%20%20%20%20%7B%0A%20%20%20%20%20%20%20%20%22name%22:%20%22pairId%22,%0A%20%20%20%20%20%20%20%20%22type%22:%20%22bytes4%22%0A%20%20%20%20%20%20%7D,%0A%20%20%20%20%20%20%7B%0A%20%20%20%20%20%20%20%20%22name%22:%20%22_orderIndex%22,%0A%20%20%20%20%20%20%20%20%22type%22:%20%22uint32%22%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%5D,%0A%20%20%20%20%22name%22:%20%22orderSplitEncodings%22,%0A%20%20%20%20%22outputs%22:%20%5B%0A%20%20%20%20%20%20%7B%0A%20%20%20%20%20%20%20%20%22name%22:%20%22%22,%0A%20%20%20%20%20%20%20%20%22type%22:%20%22bytes32%5B5%5D%22%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%5D,%0A%20%20%20%20%22payable%22:%20false,%0A%20%20%20%20%22stateMutability%22:%20%22view%22,%0A%20%20%20%20%22type%22:%20%22function%22%0A%20%20%7D,%0A%20%20%7B%0A%20%20%20%20%22constant%22:%20true,%0A%20%20%20%20%22inputs%22:%20%5B%0A%20%20%20%20%20%20%7B%0A%20%20%20%20%20%20%20%20%22name%22:%20%22base%22,%0A%20%20%20%20%20%20%20%20%22type%22:%20%22bytes20%22%0A%20%20%20%20%20%20%7D,%0A%20%20%20%20%20%20%7B%0A%20%20%20%20%20%20%20%20%22name%22:%20%22quote%22,%0A%20%20%20%20%20%20%20%20%22type%22:%20%22bytes20%22%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%5D,%0A%20%20%20%20%22name%22:%20%22computePairId%22,%0A%20%20%20%20%22outputs%22:%20%5B%0A%20%20%20%20%20%20%7B%0A%20%20%20%20%20%20%20%20%22name%22:%20%22%22,%0A%20%20%20%20%20%20%20%20%22type%22:%20%22bytes4%22%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%5D,%0A%20%20%20%20%22payable%22:%20false,%0A%20%20%20%20%22stateMutability%22:%20%22pure%22,%0A%20%20%20%20%22type%22:%20%22function%22%0A%20%20%7D,%0A%20%20%7B%0A%20%20%20%20%22constant%22:%20false,%0A%20%20%20%20%22inputs%22:%20%5B%0A%20%20%20%20%20%20%7B%0A%20%20%20%20%20%20%20%20%22name%22:%20%22pairId%22,%0A%20%20%20%20%20%20%20%20%22type%22:%20%22bytes4%22%0A%20%20%20%20%20%20%7D,%0A%20%20%20%20%20%20%7B%0A%20%20%20%20%20%20%20%20%22name%22:%20%22orderSplitEncodings%22,%0A%20%20%20%20%20%20%20%20%22type%22:%20%22bytes32%5B5%5D%22%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%5D,%0A%20%20%20%20%22name%22:%20%22add%22,%0A%20%20%20%20%22outputs%22:%20%5B%5D,%0A%20%20%20%20%22payable%22:%20false,%0A%20%20%20%20%22stateMutability%22:%20%22nonpayable%22,%0A%20%20%20%20%22type%22:%20%22function%22%0A%20%20%7D,%0A%20%20%7B%0A%20%20%20%20%22constant%22:%20true,%0A%20%20%20%20%22inputs%22:%20%5B%0A%20%20%20%20%20%20%7B%0A%20%20%20%20%20%20%20%20%22name%22:%20%22%22,%0A%20%20%20%20%20%20%20%20%22type%22:%20%22bytes4%22%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%5D,%0A%20%20%20%20%22name%22:%20%22ordersCount%22,%0A%20%20%20%20%22outputs%22:%20%5B%0A%20%20%20%20%20%20%7B%0A%20%20%20%20%20%20%20%20%22name%22:%20%22%22,%0A%20%20%20%20%20%20%20%20%22type%22:%20%22uint32%22%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%5D,%0A%20%20%20%20%22payable%22:%20false,%0A%20%20%20%20%22stateMutability%22:%20%22view%22,%0A%20%20%20%20%22type%22:%20%22function%22%0A%20%20%7D,%0A%20%20%7B%0A%20%20%20%20%22constant%22:%20true,%0A%20%20%20%20%22inputs%22:%20%5B%0A%20%20%20%20%20%20%7B%0A%20%20%20%20%20%20%20%20%22name%22:%20%22%22,%0A%20%20%20%20%20%20%20%20%22type%22:%20%22bytes4%22%0A%20%20%20%20%20%20%7D,%0A%20%20%20%20%20%20%7B%0A%20%20%20%20%20%20%20%20%22name%22:%20%22%22,%0A%20%20%20%20%20%20%20%20%22type%22:%20%22uint32%22%0A%20%20%20%20%20%20%7D,%0A%20%20%20%20%20%20%7B%0A%20%20%20%20%20%20%20%20%22name%22:%20%22%22,%0A%20%20%20%20%20%20%20%20%22type%22:%20%22uint256%22%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%5D,%0A%20%20%20%20%22name%22:%20%22orders%22,%0A%20%20%20%20%22outputs%22:%20%5B%0A%20%20%20%20%20%20%7B%0A%20%20%20%20%20%20%20%20%22name%22:%20%22%22,%0A%20%20%20%20%20%20%20%20%22type%22:%20%22bytes32%22%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%5D,%0A%20%20%20%20%22payable%22:%20false,%0A%20%20%20%20%22stateMutability%22:%20%22view%22,%0A%20%20%20%20%22type%22:%20%22function%22%0A%20%20%7D,%0A%20%20%7B%0A%20%20%20%20%22anonymous%22:%20false,%0A%20%20%20%20%22inputs%22:%20%5B%0A%20%20%20%20%20%20%7B%0A%20%20%20%20%20%20%20%20%22indexed%22:%20true,%0A%20%20%20%20%20%20%20%20%22name%22:%20%22pairId%22,%0A%20%20%20%20%20%20%20%20%22type%22:%20%22bytes4%22%0A%20%20%20%20%20%20%7D,%0A%20%20%20%20%20%20%7B%0A%20%20%20%20%20%20%20%20%22indexed%22:%20false,%0A%20%20%20%20%20%20%20%20%22name%22:%20%22orderSplitEncodings%22,%0A%20%20%20%20%20%20%20%20%22type%22:%20%22bytes32%5B5%5D%22%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%5D,%0A%20%20%20%20%22name%22:%20%22Order%22,%0A%20%20%20%20%22type%22:%20%22event%22%0A%20%20%7D%0A%5D) | [bytecode](data:,608060405234801561001057600080fd5b50610437806100206000396000f30060806040526004361061006c5763ffffffff7c0100000000000000000000000000000000000000000000000000000000600035041663201f4bfc811461007157806322dba1ce146100d45780634df8fe571461011e578063c5b8804d14610170578063fa410476146101ab575b600080fd5b34801561007d57600080fd5b5061009c600160e060020a03196004351663ffffffff602435166101eb565b604051808260a080838360005b838110156100c15781810151838201526020016100a9565b5050505090500191505060405180910390f35b3480156100e057600080fd5b506101016bffffffffffffffffffffffff1960043581169060243516610251565b60408051600160e060020a03199092168252519081900360200190f35b34801561012a57600080fd5b506040805160a080820190925261016e9160048035600160e060020a03191692369260c491906024906005908390839080828437509396506102d495505050505050565b005b34801561017c57600080fd5b50610192600160e060020a031960043516610346565b6040805163ffffffff9092168252519081900360200190f35b3480156101b757600080fd5b506101d9600160e060020a03196004351663ffffffff6024351660443561035e565b60408051918252519081900360200190f35b6101f361038f565b600160e060020a03198316600090815260016020908152604080832063ffffffff8616845290915290819020815160a08101928390529160059082845b81548152600190910190602001808311610230575050505050905092915050565b18600081901a7f01000000000000000000000000000000000000000000000000000000000000009081027fff00000000000000000000000000000000000000000000000000000000000000908116610100600185901a84028316041862010000600285901a840283160418630100000060039490941a9290920216919091041890565b600160e060020a0319821660009081526001602090815260408083208383528184205463ffffffff1684529091529020610310908260056103ae565b5050600160e060020a0319166000908152602081905260409020805463ffffffff8082166001011663ffffffff19909116179055565b60006020819052908152604090205463ffffffff1681565b60016020528260005260406000206020528160005260406000208160058110151561038557fe5b0154925083915050565b60a0604051908101604052806005906020820280388339509192915050565b82600581019282156103de579160200282015b828111156103de57825182556020909201916001909101906103c1565b506103ea9291506103ee565b5090565b61040891905b808211156103ea57600081556001016103f4565b905600a165627a7a7230582049bca7e87791fbc343642f5e6b1e21c4d3e3b95f493a688a3b93d7d865c84fe10029) | [runtime bytecode](data:,60806040526004361061006c5763ffffffff7c0100000000000000000000000000000000000000000000000000000000600035041663201f4bfc811461007157806322dba1ce146100d45780634df8fe571461011e578063c5b8804d14610170578063fa410476146101ab575b600080fd5b34801561007d57600080fd5b5061009c600160e060020a03196004351663ffffffff602435166101eb565b604051808260a080838360005b838110156100c15781810151838201526020016100a9565b5050505090500191505060405180910390f35b3480156100e057600080fd5b506101016bffffffffffffffffffffffff1960043581169060243516610251565b60408051600160e060020a03199092168252519081900360200190f35b34801561012a57600080fd5b506040805160a080820190925261016e9160048035600160e060020a03191692369260c491906024906005908390839080828437509396506102d495505050505050565b005b34801561017c57600080fd5b50610192600160e060020a031960043516610346565b6040805163ffffffff9092168252519081900360200190f35b3480156101b757600080fd5b506101d9600160e060020a03196004351663ffffffff6024351660443561035e565b60408051918252519081900360200190f35b6101f361038f565b600160e060020a03198316600090815260016020908152604080832063ffffffff8616845290915290819020815160a08101928390529160059082845b81548152600190910190602001808311610230575050505050905092915050565b18600081901a7f01000000000000000000000000000000000000000000000000000000000000009081027fff00000000000000000000000000000000000000000000000000000000000000908116610100600185901a84028316041862010000600285901a840283160418630100000060039490941a9290920216919091041890565b600160e060020a0319821660009081526001602090815260408083208383528184205463ffffffff1684529091529020610310908260056103ae565b5050600160e060020a0319166000908152602081905260409020805463ffffffff8082166001011663ffffffff19909116179055565b60006020819052908152604090205463ffffffff1681565b60016020528260005260406000206020528160005260406000208160058110151561038557fe5b0154925083915050565b60a0604051908101604052806005906020820280388339509192915050565b82600581019282156103de579160200282015b828111156103de57825182556020909201916001909101906103c1565b506103ea9291506103ee565b5090565b61040891905b808211156103ea57600081556001016103f4565b905600a165627a7a7230582049bca7e87791fbc343642f5e6b1e21c4d3e3b95f493a688a3b93d7d865c84fe10029)




Documentation generated by [@GuildCrypt/solspecdown](https://github.com/GuildCrypt/solspecdown)


| Name | Type |
|---|---|
| [`add(bytes4,bytes32[5])`](#add(bytes4,bytes32[5])) | function (non-constant) |
| [`computePairId(bytes20,bytes20)`](#computePairId(bytes20,bytes20)) | function (constant) |
| [`Order(bytes4,bytes32[5])`](#Order(bytes4,bytes32[5])) | event |
| [`orders(bytes4,uint32,uint256)`](#orders(bytes4,uint32,uint256)) | function (constant) |
| [`ordersCount(bytes4)`](#ordersCount(bytes4)) | function (constant) |
| [`orderSplitEncodings(bytes4,uint32)`](#orderSplitEncodings(bytes4,uint32)) | function (constant) |
#### <a name="add(bytes4,bytes32[5])"></a> `add(bytes4,bytes32[5])`
Add an order. Only the owner may add an order.
##### Inputs
|  | Type | Name | Description |
|---|---|---|---|
| `0` | `bytes4` | `pairId` | A unique pair id. SHA256(baseAssetAddress XOR quoteAssetAddress)[252, 256] |
| `1` | `bytes32[5]` | `orderSplitEncodings` | The split encodings |
---
#### <a name="computePairId(bytes20,bytes20)"></a> `computePairId(bytes20,bytes20)`
##### Inputs
|  | Type | Name | Description |
|---|---|---|---|
| `0` | `bytes20` | `base` |  |
| `1` | `bytes20` | `quote` |  |
##### Outputs
|  | Type | Name | Description |
|---|---|---|---|
| `0` | `bytes4` |  |  |
---
#### <a name="Order(bytes4,bytes32[5])"></a> `Order(bytes4,bytes32[5])`
##### Inputs
|  | Type | Name | Description | Indexed? |
|---|---|---|---|---|
| `0` | `bytes4` | `pairId` |  | `true` |
| `1` | `bytes32[5]` | `orderSplitEncodings` |  | `false` |
---
#### <a name="orders(bytes4,uint32,uint256)"></a> `orders(bytes4,uint32,uint256)`
##### Inputs
|  | Type | Name | Description |
|---|---|---|---|
| `0` | `bytes4` |  |  |
| `1` | `uint32` |  |  |
| `2` | `uint256` |  |  |
##### Outputs
|  | Type | Name | Description |
|---|---|---|---|
| `0` | `bytes32` |  |  |
---
#### <a name="ordersCount(bytes4)"></a> `ordersCount(bytes4)`
##### Inputs
|  | Type | Name | Description |
|---|---|---|---|
| `0` | `bytes4` |  |  |
##### Outputs
|  | Type | Name | Description |
|---|---|---|---|
| `0` | `uint32` |  |  |
---
#### <a name="orderSplitEncodings(bytes4,uint32)"></a> `orderSplitEncodings(bytes4,uint32)`
##### Inputs
|  | Type | Name | Description |
|---|---|---|---|
| `0` | `bytes4` | `pairId` |  |
| `1` | `uint32` | `_orderIndex` |  |
##### Outputs
|  | Type | Name | Description |
|---|---|---|---|
| `0` | `bytes32[5]` |  |  |
---