EthRouter
Inherits: ERC721TokenReceiver
Author: out.eth (@outdoteth)
This contract is used to route buy, sell, and change orders to multiple pools in one transaction. It will route the orders to either a private pool or a public pool. If the order goes to a public pool, then users can choose whether or not they would like to pay royalties. The only base token which is supported is native ETH.
State Variables
royaltyRegistry
Functions
receive
constructor
buy
Executes a series of buy operations against public or private pools.
Parameters
Name | Type | Description |
---|---|---|
|
| The buy operations to execute. |
|
| The deadline for the transaction to be mined. Will revert if timestamp is greater than deadline. If it's set to 0 then there is no deadline. |
|
| Whether to pay royalties or not. |
sell
Executes a series of sell operations against public or private pools.
Parameters
Name | Type | Description |
---|---|---|
|
| The sell operations to execute. |
|
| The minimum amount of output tokens that must be received for the transaction to succeed. |
|
| The deadline for the transaction to be mined. Will revert if timestamp is greater than deadline. Set to 0 for there to be no deadline. |
|
| Whether to pay royalties or not. |
deposit
Executes a deposit to a private pool (transfers NFTs and ETH to the pool).
Parameters
Name | Type | Description |
---|---|---|
|
| The private pool to deposit to. |
|
| The NFT contract address. |
|
| The token IDs of the NFTs to deposit. |
|
| The minimum price of the pool. Will revert if price is smaller than this. |
|
| The maximum price of the pool. Will revert if price is greater than this. |
|
| The deadline for the transaction to be mined. Will revert if timestamp is greater than deadline. Set to 0 for deadline to be ignored. |
change
Executes a series of change operations against a private pool.
Parameters
Name | Type | Description |
---|---|---|
|
| The change operations to execute. |
|
| The deadline for the transaction to be mined. Will revert if timestamp is greater than deadline. Set to 0 for deadline to be ignored. |
getRoyalty
Gets the royalty and recipient for a given NFT and sale price. Looks up the royalty info from the manifold registry.
Parameters
Name | Type | Description |
---|---|---|
|
| |
|
| The token ID of the NFT. |
|
| The sale price of the NFT. |
Returns
Name | Type | Description |
---|---|---|
|
| The royalty fee to pay. |
|
| The address to pay the royalty fee to. |
Errors
DeadlinePassed
OutputAmountTooSmall
PriceOutOfRange
InvalidRoyaltyFee
Structs
Buy
Sell
Change
Last updated