OrderbookFactory
State Variables
Note: The IOrderbookFactory.Pair
represents a struct that contains the base and quote assets of an orderbook.
Functions
setImpl
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
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
isClone
Checks if a given address is a clone of the orderbook implementation contract.
Parameters
Returns
getBook
getBook
Retrieves the address of an orderbook contract based on its index in the allOrderbooks
array.
Parameters
Returns
getBookByPair
getBookByPair
Retrieves the address of an orderbook contract based on the base and quote assets.
Parameters
Returns
getPairs
getPairs
Retrieves an array of pairs of base and quote assets for a range of orderbook contracts.
Parameters
Returns
getBaseQuote
getBaseQuote
Retrieves the base and quote assets associated with an orderbook contract.
Parameters
Returns
initialize
initialize
Initializes the orderbook factory contract with the engine contract address. This function is called when deploying the contract.
Parameters
allOrderbooksLength()
allOrderbooksLength()
Retrieves the total number of created orderbooks.
Returns
Error Types
InvalidRole(bytes32 role, address sender)
: This error is raised when an invalid role is provided for an operation.InvalidAccess(address sender, address allowed)
: This error is raised when a caller does not have access to perform a specific operation.PairAlreadyExists(address base, address quote)
: This error is raised when an orderbook already exists for the provided base and quote assets.
Last updated