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.

Property
Type
Description

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

Name
Type
Description

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

Name
Type
Description

orderbook

address

The address of the created orderbook contract.

getBook

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

Parameters

Name
Type
Description

bookId_

uint256

The ID of the orderbook.

Returns

Name
Type
Description

orderbook

address

The address of the orderbook contract.

getBookByPair

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

Parameters

Name
Type
Description

base

address

The address of the base asset.

quote

address

The address of the quote asset.

Returns

Name
Type
Description

book

address

The address of the orderbook contract.

getBaseQuote

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

Parameters

Name
Type
Description

orderbook

address

The address of the orderbook contract.

Returns

Name
Type
Description

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

Name
Type
Description

engine

address

The address of the engine contract.

getPairs

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

Parameters

Name
Type
Description

start

uint

The start index of the range.

end

uint

The end index of the range.

Returns

Name
Type
Description

pairs

Pair[] memory

An array of pairs (base and quote assets).

Last updated