OrderbookFactory

State Variables

Note: The IOrderbookFactory.Pair represents a struct that contains the base and quote assets of an orderbook.

Functions

setImpl

Sets the implementation address to be used for orderbook creation. This function can only be called by the contract owner with the DEFAULT_ADMIN_ROLE role.

Parameters

createBook

Creates a new orderbook contract for the specified base and quote assets. This function can only be called by the engine contract.

Parameters

Returns

isClone

Checks if a given address is a clone of the orderbook implementation contract.

Parameters

Returns

getBook

Retrieves the address of an orderbook contract based on its index in the allOrderbooks array.

Parameters

Returns

getBookByPair

Retrieves the address of an orderbook contract based on the base and quote assets.

Parameters

Returns

getPairs

Retrieves an array of pairs of base and quote assets for a range of orderbook contracts.

Parameters

Returns

getBaseQuote

Retrieves the base and quote assets associated with an orderbook contract.

Parameters

Returns

initialize

Initializes the orderbook factory contract with the engine contract address. This function is called when deploying the contract.

Parameters

allOrderbooksLength()

Retrieves the total number of created orderbooks.

Returns

Error Types

  1. InvalidRole(bytes32 role, address sender): This error is raised when an invalid role is provided for an operation.

  2. InvalidAccess(address sender, address allowed): This error is raised when a caller does not have access to perform a specific operation.

  3. PairAlreadyExists(address base, address quote): This error is raised when an orderbook already exists for the provided base and quote assets.

Last updated