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

SuperRoot contract interface. SuperRoot is an immutable flex super root contract, persistent through updates. More...

#include <SuperRoot.hpp>

Public Member Functions

void onDeploy (cell global_config_code, cell flex_client_stub, address_opt prev_super_root)
 Deploy processing. More...
 
void update (uint128 cfg_deploy_evers, uint128 cfg_keep_evers, FlexVersion version, address wrappers_cfg, address flex, address user_cfg, string description)
 
void updateConfirmed (FlexVersion version)
 
void release ()
 Convert beta-version into release. Not allowed for the update team.
 
void proxy (cell msg, bool cant_work_during_update, bool starting_update)
 Perform proxy call from SuperRoot to an owned subpart (WrappersConfig, Flex, UserDataConfig) More...
 
address deployWrappersConfig (uint128 deploy_evers, uint128 wrappers_cfg_keep_evers, uint32 token_version, cell wrappers_cfg_code, cell wic_code)
 Deploy WrappersConfig contract. Allowed also for the update team if set. More...
 
address deployFlex (uint128 deploy_evers, uint128 keep_evers, PairCloneEvers evers, address_opt old_flex, uint32 exchange_version, cell flex_code, cell xchg_pair_code, cell xchg_price_code, EversConfig ev_cfg, uint8 deals_limit)
 Deploy Flex contract. Allowed also for the update team if set. More...
 
address deployUserDataConfig (uint128 deploy_evers, FlexVersion triplet, bind_info binding, cell user_data_cfg_code, cell flex_client_code, cell auth_index_code, cell user_id_index_code)
 Deploy UserDataConfig contract. Allowed also for the update team if set. More...
 
void cloneWrappersConfig (address wrappers_cfg, uint128 wrapper_cfg_keep_evers, uint128 clone_deploy_evers, WICCloneEvers wic_evers, uint32 new_token_version, dict_array< address > wrapper_deployers)
 Clone WrappersConfig to the new version. Allowed also for the update team if set. More...
 
void transfer (address to, uint128 evers)
 Transfer native evers from super root. Not allowed for the update team. More...
 
void transferReserveTokens (address wrapper, uint128 tokens, address to)
 Transfer flex tip3 tokens from a reserve wallet. Not allowed for the update team. More...
 
void setFlags (opt< bool > stop_trade, opt< bool > abandon_ship, opt< bool > update_started)
 Set flags. If optional is not set, flag will not be changed. Not allowed for the update team. More...
 
void setOwner (address owner)
 Set owner contract. Pubkey access will be unavailable after this. Not allowed for the update team. More...
 
void setUpdateTeam (address_opt team)
 Set update team address. Update team is allowed to deploy beta versions and related contracts. Not allowed for the update team. More...
 
void setNextSuperRoot (address next_super_root)
 Set next (updated) super root. Not allowed for the update team. More...
 
SuperRootDetails getDetails ()
 Get contract details.
 
address getGlobalConfig (FlexVersion version)
 Get GlobalConfig address for specified version.
 
address getCurrentGlobalConfig ()
 Get current GlobalConfig address.
 

Detailed Description

SuperRoot contract interface. SuperRoot is an immutable flex super root contract, persistent through updates.

Member Function Documentation

◆ cloneWrappersConfig()

void cloneWrappersConfig ( address  wrappers_cfg,
uint128  wrapper_cfg_keep_evers,
uint128  clone_deploy_evers,
WICCloneEvers  wic_evers,
uint32  new_token_version,
dict_array< address >  wrapper_deployers 
)

Clone WrappersConfig to the new version. Allowed also for the update team if set.

Parameters
wrappers_cfgWrappersConfig address
wrapper_cfg_keep_eversEvers to keep in WrappersConfig before returning the rest back
clone_deploy_eversEvers to send in WrappersConfig clone deploy
wic_eversEvers configuration (for each WIC clone)
new_token_versionNew token update group version
wrapper_deployersWrapper deployers for different types of Wrappers

◆ deployFlex()

address deployFlex ( uint128  deploy_evers,
uint128  keep_evers,
PairCloneEvers  evers,
address_opt  old_flex,
uint32  exchange_version,
cell  flex_code,
cell  xchg_pair_code,
cell  xchg_price_code,
EversConfig  ev_cfg,
uint8  deals_limit 
)

Deploy Flex contract. Allowed also for the update team if set.

Parameters
deploy_eversEvers for deploy Flex contract
keep_eversEvers to keep in Flex contract
eversEvers configuration for each pair cloning procedure
old_flexOld Flex to clone pairs from
exchange_versionExchange update group version
flex_codeCode of Flex contract (unsalted)
xchg_pair_codeCode of XchgPair contract (unsalted)
xchg_price_codeCode of PriceXchg contract (unsalted)
ev_cfgProcessing costs configuration of Flex in native funds (evers)
deals_limitLimit for processed deals in one request

◆ deployUserDataConfig()

address deployUserDataConfig ( uint128  deploy_evers,
FlexVersion  triplet,
bind_info  binding,
cell  user_data_cfg_code,
cell  flex_client_code,
cell  auth_index_code,
cell  user_id_index_code 
)

Deploy UserDataConfig contract. Allowed also for the update team if set.

Parameters
deploy_eversEvers for deploy contract
tripletFlex version
bindingExchange binding info (Flex address and PriceXchg code hash (unsalted))
user_data_cfg_codeUserDataConfig code
flex_client_codeFlexClient code
auth_index_codeAuthIndex code
user_id_index_codeUserIdIndexCode

◆ deployWrappersConfig()

address deployWrappersConfig ( uint128  deploy_evers,
uint128  wrappers_cfg_keep_evers,
uint32  token_version,
cell  wrappers_cfg_code,
cell  wic_code 
)

Deploy WrappersConfig contract. Allowed also for the update team if set.

Parameters
deploy_eversEvers for deploy contract
wrappers_cfg_keep_eversEvers to keep in WrappersConfig contract
token_versionToken update group version
wrappers_cfg_codeWrappersConfig contract code
wic_codeWrapper Index Contract code

◆ onDeploy()

void onDeploy ( cell  global_config_code,
cell  flex_client_stub,
address_opt  prev_super_root 
)

Deploy processing.

Parameters
global_config_codeGlobalConfig code
flex_client_stubFlexClientStub code
prev_super_rootPrevious super root

◆ proxy()

void proxy ( cell  msg,
bool  cant_work_during_update,
bool  starting_update 
)

Perform proxy call from SuperRoot to an owned subpart (WrappersConfig, Flex, UserDataConfig)

Parameters
msgMessage to send from SuperRoot
cant_work_during_updateOperation must fail if update procedure is already started
starting_updateThis operation starting update

◆ setFlags()

void setFlags ( opt< bool >  stop_trade,
opt< bool >  abandon_ship,
opt< bool >  update_started 
)

Set flags. If optional is not set, flag will not be changed. Not allowed for the update team.

Parameters
stop_tradeRecommendation to stop trading (in case if problem found in trading algorithms)
abandon_shipRecommendation to cancel all orders and withdraw funds (in case if critical problem found)
update_startedUpdate procedures started (Wrappers/Flex/UI cloning started)

◆ setNextSuperRoot()

void setNextSuperRoot ( address  next_super_root)

Set next (updated) super root. Not allowed for the update team.

Parameters
next_super_rootNext super root

◆ setOwner()

void setOwner ( address  owner)

Set owner contract. Pubkey access will be unavailable after this. Not allowed for the update team.

Parameters
ownerNew owner contract

◆ setUpdateTeam()

void setUpdateTeam ( address_opt  team)

Set update team address. Update team is allowed to deploy beta versions and related contracts. Not allowed for the update team.

Parameters
teamUpdate team address. Empty means revoke access.

◆ transfer()

void transfer ( address  to,
uint128  evers 
)

Transfer native evers from super root. Not allowed for the update team.

Parameters
toDestination address
eversEvers to transfer

◆ transferReserveTokens()

void transferReserveTokens ( address  wrapper,
uint128  tokens,
address  to 
)

Transfer flex tip3 tokens from a reserve wallet. Not allowed for the update team.

Parameters
wrapperWrapper address
tokensTokens to transfer
toDestination address (must be flex tip3 wallet)

◆ update()

void update ( uint128  cfg_deploy_evers,
uint128  cfg_keep_evers,
FlexVersion  version,
address  wrappers_cfg,
address  flex,
address  user_cfg,
string  description 
)

Update Flex to the new beta version. Flex will send deploy message with new GlobalConfig. The current release version will remain working. release method should be called also to convert beta into current release. Allowed also for the update team if set.

Parameters
cfg_deploy_eversEvers to send in GlobalConfig deploy message
cfg_keep_eversEvers to keep in GlobalConfig contract
versionNew Flex version
wrappers_cfgWrappersConfig
flexNew Flex root address
user_cfgNew user contracts configuration
descriptionUpdate description

◆ updateConfirmed()

void updateConfirmed ( FlexVersion  version)

Callback from GlobalConfig contract about successfull deploy. SuperRoot will update version_ field when receive this notification.

Parameters
versionConfirmed new Flex version

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