OrderbookReserveLister

circle-exclamation

contract PermissionlessOrderbookReserveLister

imports OrderbookReservearrow-up-right, FeeBurnerInterfacearrow-up-right

Source: PermissionlessOrderbookReserveLister.solarrow-up-right

The Permissionless Orderbook Reserve Lister is used for creating, initialising and listing new Permissionless Orderbook Reserves.


<AUTOGENERATED_TABLE_OF_CONTENTS>

TokenOrderbookListingStagearrow-up-right

Event for logging of the listing stage of an orderbook reserve for a particular ERC20 token.


event TokenOrderbookListingStage(ERC20 token, ListingStage stage) | Parameter | Type | Description | | --------- |:-----:|:----------------------------:| | token | ERC20 | ERC20 token contract address | | stage | enum ListingStage | Takes 1 of the following values: {NO_RESERVE, RESERVE_ADDED, RESERVE_INIT, RESERVE_LISTED} |\

PermissionlessOrderbookReserveListerarrow-up-right

Contract constructor. Note that constructor methods are called exactly once during contract instantiation and cannot be called again.


function PermissionlessOrderbookReserveLister(InternalNetworkInterface kyber, OrderListFactoryInterface factory, MedianizerInterface medianizer, ERC20 knc, uint maxOrders, uint minOrderValueUsd) public | Parameter | Type | Description | | -----------------|:------------------------:|:--------------------------------:| | kyber | InternalNetworkInterface | KyberNetwork contract address | | factory | OrderListFactoryInterface | OrderListFactory contract address | | medianizer | MedianizerInterface | Medianizer contract address | | knc | ERC20 | KNC token contract address | | maxOrders | uint | Maximum number of orders to traverse for 1 trade | | minOrderValueUsd | uint | Minimum USD amount needed to create a new order on a permissionless orderbook reserve |


\

addOrderbookContractarrow-up-right

The first step for creating an orderbook reserve for a specified ERC20 token.


function addOrderbookContract(ERC20 token) public returns (bool) | Parameter | Type | Description | | ----------|:-----:|:------------------------------------------:| | token | ERC20 | ERC20 token contract address | Returns:\ True if the function was executed successfully.


Web3 Example:

\

getOrderbookListingStagearrow-up-right

Get the current listing stage for a specified ERC20 token.


function getOrderbookListingStage(ERC20 token) public view returns (address, ListingStage) | Parameter | Type | Description | | ----------|:-----:|:------------------------------------------:| | token | ERC20 | ERC20 token contract address |

Returns:\ | Parameter | Type | Description | | ----------|:-----:|:------------------------------------------:| | address | address | Orderbook reserve contract address for specified ERC20 token | | ListingStage | ListingStage | Latest successful stage |


Web3 Example:

\

initOrderbookContractarrow-up-right

The second step for creating an orderbook reserve for a specified ERC20 token.


function initOrderbookContract(ERC20 token) public returns (bool) | Parameter | Type | Description | | ----------|:-----:|:------------------------------------------:| | token | ERC20 | ERC20 token contract address | Returns:\ True if the function was executed successfully.


Web3 Example:

\

listOrderbookContractarrow-up-right

The third and final step for creating an orderbook reserve for a specified ERC20 token.


function listOrderbookContract(ERC20 token) public returns (bool) | Parameter | Type | Description | | ----------|:-----:|:------------------------------------------:| | token | ERC20 | ERC20 token contract address | Returns:\ True if the function was executed successfully.


Web3 Example:

\

unlistOrderbookContractarrow-up-right

Unlist an orderbook reserve for a specified ERC20 token.


function unlistOrderbookContract(ERC20 token, uint hintReserveIndex) public returns (bool) | Parameter | Type | Description | | ----------|:-----:|:------------------------------------------:| | token | ERC20 | ERC20 token contract address | | hintReserveIndex | uint | index in Kyber Network reserve array | Returns:\ True if the reserve was successfully removed.


Web3 Example:

Last updated

Was this helpful?