IOrderbookFactory

This Solidity smart contract defines an interface for the Orderbook Factory contract. Let's break down the variables, events, and functions present in this contract:

Variables

PriceLinkedList (struct)

A struct containing the addresses of the base and quote assets.

PropertyTypeDescription

base

address

The address of the base asset in the trading pair.

quote

address

The address of the quote asset in the trading pair.

Functions

createBook

Creates a new orderbook contract with the specified bid asset, ask asset, and engine.

Parameters

NameTypeDescription

bid_

address

The address of the bid asset.

ask_

address

The address of the ask asset.

engine_

address

The address of the engine contract.

Returns

NameTypeDescription

orderbook

address

The address of the created orderbook contract.

getBook

Retrieves the orderbook contract address associated with the specified book ID.

Parameters

NameTypeDescription

bookId_

uint256

The ID of the orderbook.

Returns

NameTypeDescription

orderbook

address

The address of the orderbook contract.

getBookByPair

Retrieves the orderbook contract address associated with the specified base and quote assets.

Parameters

NameTypeDescription

base

address

The address of the base asset.

quote

address

The address of the quote asset.

Returns

NameTypeDescription

book

address

The address of the orderbook contract.

getBaseQuote

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

Parameters

NameTypeDescription

orderbook

address

The address of the orderbook contract.

Returns

NameTypeDescription

base

address

The address of the base asset.

quote

address

The address of the quote asset.

engine()

Retrieves the address of the engine contract.

Returns

NameTypeDescription

engine

address

The address of the engine contract.

getPairs

Retrieves an array of pairs (base and quote assets) within the specified range.

Parameters

NameTypeDescription

start

uint

The start index of the range.

end

uint

The end index of the range.

Returns

NameTypeDescription

pairs

Pair[] memory

An array of pairs (base and quote assets).

Last updated