Flex
Flex exchange system
|
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. | |
SuperRoot contract interface. SuperRoot is an immutable flex super root contract, persistent through updates.
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.
wrappers_cfg | WrappersConfig address |
wrapper_cfg_keep_evers | Evers to keep in WrappersConfig before returning the rest back |
clone_deploy_evers | Evers to send in WrappersConfig clone deploy |
wic_evers | Evers configuration (for each WIC clone) |
new_token_version | New token update group version |
wrapper_deployers | Wrapper deployers for different types of Wrappers |
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.
deploy_evers | Evers for deploy Flex contract |
keep_evers | Evers to keep in Flex contract |
evers | Evers configuration for each pair cloning procedure |
old_flex | Old Flex to clone pairs from |
exchange_version | Exchange update group version |
flex_code | Code of Flex contract (unsalted) |
xchg_pair_code | Code of XchgPair contract (unsalted) |
xchg_price_code | Code of PriceXchg contract (unsalted) |
ev_cfg | Processing costs configuration of Flex in native funds (evers) |
deals_limit | Limit for processed deals in one request |
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.
deploy_evers | Evers for deploy contract |
triplet | Flex version |
binding | Exchange binding info (Flex address and PriceXchg code hash (unsalted)) |
user_data_cfg_code | UserDataConfig code |
flex_client_code | FlexClient code |
auth_index_code | AuthIndex code |
user_id_index_code | UserIdIndexCode |
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.
deploy_evers | Evers for deploy contract |
wrappers_cfg_keep_evers | Evers to keep in WrappersConfig contract |
token_version | Token update group version |
wrappers_cfg_code | WrappersConfig contract code |
wic_code | Wrapper Index Contract code |
void onDeploy | ( | cell | global_config_code, |
cell | flex_client_stub, | ||
address_opt | prev_super_root | ||
) |
Deploy processing.
global_config_code | GlobalConfig code |
flex_client_stub | FlexClientStub code |
prev_super_root | Previous super root |
void proxy | ( | cell | msg, |
bool | cant_work_during_update, | ||
bool | starting_update | ||
) |
Perform proxy call from SuperRoot to an owned subpart (WrappersConfig, Flex, UserDataConfig)
msg | Message to send from SuperRoot |
cant_work_during_update | Operation must fail if update procedure is already started |
starting_update | This operation starting update |
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.
stop_trade | Recommendation to stop trading (in case if problem found in trading algorithms) |
abandon_ship | Recommendation to cancel all orders and withdraw funds (in case if critical problem found) |
update_started | Update procedures started (Wrappers/Flex/UI cloning started) |
void setNextSuperRoot | ( | address | next_super_root | ) |
Set next (updated) super root. Not allowed for the update team.
next_super_root | Next super root |
void setOwner | ( | address | owner | ) |
Set owner contract. Pubkey access will be unavailable after this. Not allowed for the update team.
owner | New owner contract |
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.
team | Update team address. Empty means revoke access. |
void transfer | ( | address | to, |
uint128 | evers | ||
) |
Transfer native evers from super root. Not allowed for the update team.
to | Destination address |
evers | Evers to transfer |
void transferReserveTokens | ( | address | wrapper, |
uint128 | tokens, | ||
address | to | ||
) |
Transfer flex tip3 tokens from a reserve wallet. Not allowed for the update team.
wrapper | Wrapper address |
tokens | Tokens to transfer |
to | Destination address (must be flex tip3 wallet) |
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.
cfg_deploy_evers | Evers to send in GlobalConfig deploy message |
cfg_keep_evers | Evers to keep in GlobalConfig contract |
version | New Flex version |
wrappers_cfg | WrappersConfig |
flex | New Flex root address |
user_cfg | New user contracts configuration |
description | Update description |
void updateConfirmed | ( | FlexVersion | version | ) |
Callback from GlobalConfig contract about successfull deploy. SuperRoot will update version_ field when receive this notification.
version | Confirmed new Flex version |