Flex
Flex exchange system
Public Member Functions | List of all members
IFlex Interface Reference

Flex root contract interface. Flex is a root contract for exchange system. More...

#include <Flex.hpp>

Public Member Functions

resumable< void > onDeploy (uint128 flex_keep_evers, PairCloneEvers evers, address_opt old_flex)
 Constructor of Flex. More...
 
address addXchgPair (PairCloneEvers evers, Tip3Config major_tip3cfg, Tip3Config minor_tip3cfg, uint128 min_amount, uint128 minmove, uint128 price_denum, address notify_addr)
 Register tip3/tip3 xchg pair (returns pre-calculated address of future xchg pair) More...
 
void unlistXchgPair (address pair)
 Unlist tip3/tip3 xchg pair. More...
 
PairsRange requestPairs ()
 Request first/last pair in list.
 
FlexSalt getConfig ()
 Get Flex configuration from code salt.
 
FlexDetails getDetails ()
 Get contract state details.
 
address getXchgTradingPair (address tip3_major_root, address tip3_minor_root)
 Get address of tip3/tip3 exchange pair.
 
uint128 calcLendTokensForOrder (bool sell, uint128 major_tokens, price_t price)
 Calculate necessary lend tokens for order.
 

Detailed Description

Flex root contract interface. Flex is a root contract for exchange system.

Member Function Documentation

◆ addXchgPair()

address addXchgPair ( PairCloneEvers  evers,
Tip3Config  major_tip3cfg,
Tip3Config  minor_tip3cfg,
uint128  min_amount,
uint128  minmove,
uint128  price_denum,
address  notify_addr 
)

Register tip3/tip3 xchg pair (returns pre-calculated address of future xchg pair)

Parameters
eversEvers configuration for cloning procedure
major_tip3cfgMajor tip3 configuration
minor_tip3cfgMinor tip3 configuration
min_amountMinimum amount of major tokens for a deal or an order
minmoveMinimum move for price
price_denumPrice denominator for the pair
notify_addrNotification address (AMM)

◆ onDeploy()

resumable<void> onDeploy ( uint128  flex_keep_evers,
PairCloneEvers  evers,
address_opt  old_flex 
)

Constructor of Flex.

Parameters
flex_keep_eversEvers to keep in Flex
eversEvers configuration for each pair cloning procedure
old_flexOld Flex to clone pairs from

◆ unlistXchgPair()

void unlistXchgPair ( address  pair)

Unlist tip3/tip3 xchg pair.

Parameters
pairXchgPair address

The documentation for this interface was generated from the following file: