Skip to main content Link Search Menu Expand Document (external link) Copy Copied

Abstract Class Inheritance: SmartContract, IOpdexMarket

An abstract smart contract class that is inherited by standard market and staking market. Provides a base class sharing similar properties and methods between the two different market types.

Constructor

protected OpdexMarket(ISmartContractState state, uint transactionFee) : base(state)

Parameters

Type Property Description
ISmartContractState state Dependency injected smart contract state. Omitted from parameters during deployment.
uint transactionFee The market transaction fee, 0-10 equal to 0-1%.

Properties

Type Property Description
uint TransactionFee The staking market transaction fee set at 3 equal to 0.3%.

Methods

Get Pool

Retrieve a pool’s contract address by the SRC20 token associated.

public Address GetPool(Address token);

Parameters

Type Property Description
Address token The address of the SRC token.

Returns

Type Property Description
Address pool The address of the requested pool.

Create Pool

Creates a new liquidity pool for the provided token with 0 liquidity if it doesn’t already exist.

Some standard markets may have authorization implemented on this method requiring address whitelisting.

public Address CreatePool(Address token);

Parameters

Type Property Description
Address token The address of the SRC token.

Returns

Type Property Description
Address pool The address of the created pool.

Logs

Create Liquidity Pool Log

Emitted when a new liquidity pool is created.

Properties

Index Type Property Description
Address Token The address of the SRC token in the liquidity pool.
Address Pool The address of the new liquidity pool smart contract.

References

OpdexMarket Smart Contract - Github

IOpdexMarket Interface - Github

Stratis SmartContract Documentation - Stratis Academy