9 #include <tvm/schema/message.hpp>
10 #include <tvm/smart_switcher.hpp>
11 #include <tvm/contract_handle.hpp>
12 #include <tvm/replay_attack_protection/timestamp.hpp>
17 #include "Tip3Config.hpp"
18 #include "bind_info.hpp"
52 cell global_config_code,
53 cell flex_client_stub,
54 address_opt prev_super_root
63 uint128 cfg_deploy_evers,
64 uint128 cfg_keep_evers,
87 bool cant_work_during_update,
92 [[
internal, answer_id]]
95 uint128 wrappers_cfg_keep_evers,
97 cell wrappers_cfg_code,
102 [[
internal, answer_id]]
104 uint128 deploy_evers,
107 address_opt old_flex,
108 uint32 exchange_version,
111 cell xchg_price_code,
117 [[
internal, answer_id]]
119 uint128 deploy_evers,
122 cell user_data_cfg_code,
123 cell flex_client_code,
124 cell auth_index_code,
125 cell user_id_index_code
129 [[
internal, answer_id]]
131 address wrappers_cfg,
132 uint128 wrapper_cfg_keep_evers,
133 uint128 clone_deploy_evers,
135 uint32 new_token_version,
136 dict_array<address> wrapper_deployers
157 opt<bool> stop_trade,
158 opt<bool> abandon_ship,
159 opt<bool> update_started
177 address next_super_root
192 using ISuperRootPtr = handle<ISuperRoot>;
222 static std::pair<StateInit, uint256> execute(
DSuperRoot data, cell code) {
223 cell data_cl = prepare_persistent_data<ISuperRoot, void>({}, data);
224 StateInit init { {}, {}, code, data_cl, {} };
225 cell init_cl = build(init).make_cell();
226 return { init, uint256(tvm_hash(init_cl)) };
Flex evers configuration (processing costs)
Pair clone evers configuration structure.
WIC clone evers configuration structure.
SuperRoot persistent data struct.
Definition: SuperRoot.hpp:195
opt< FlexVersion > beta_version_
Beta Flex version.
Definition: SuperRoot.hpp:206
uint32 revision_
SuperRoot revision.
Definition: SuperRoot.hpp:210
address_opt deploying_cfg_
Deploying GlobalConfig contract.
Definition: SuperRoot.hpp:207
opt< FlexVersion > version_
Latest Flex version.
Definition: SuperRoot.hpp:205
bool_t stop_trade_
Recommendation to stop trading (in case if problem found in trading algorithms)
Definition: SuperRoot.hpp:197
address_opt next_super_root_
Will be set up if new super root is deployed and should be used instead.
Definition: SuperRoot.hpp:209
address_opt prev_super_root_
Will point to the previous super root.
Definition: SuperRoot.hpp:208
bool_t update_started_
Update procedures started (Wrappers/Flex/UI cloning started).
Definition: SuperRoot.hpp:199
optcell flex_client_stub_
Code of FlexClientStub (salted)
Definition: SuperRoot.hpp:203
uint256 pubkey_
Deployer public key.
Definition: SuperRoot.hpp:196
address_opt update_team_
Update team address. Update team is allowed to deploy beta versions and related contracts.
Definition: SuperRoot.hpp:201
int8 workchain_id_
Workchain id.
Definition: SuperRoot.hpp:204
optcell global_config_code_
Code of GlobalConfig (salted)
Definition: SuperRoot.hpp:202
bool_t abandon_ship_
Recommendation to cancel all orders and withdraw funds (in case if critical problem found)
Definition: SuperRoot.hpp:198
address owner_
Owner contract address.
Definition: SuperRoot.hpp:200
SuperRoot events interface.
Definition: SuperRoot.hpp:215
Processing native funds value ...
Definition: EversConfig.hpp:12
Flex version triplet.
Definition: FlexVersion.hpp:14
SuperRoot contract interface. SuperRoot is an immutable flex super root contract, persistent through ...
Definition: SuperRoot.hpp:47
void update(uint128 cfg_deploy_evers, uint128 cfg_keep_evers, FlexVersion version, address wrappers_cfg, address flex, address user_cfg, string description)
void onDeploy(cell global_config_code, cell flex_client_stub, address_opt prev_super_root)
Deploy processing.
void release()
Convert beta-version into release. Not allowed for the update team.
address getCurrentGlobalConfig()
Get current GlobalConfig address.
void setUpdateTeam(address_opt team)
Set update team address. Update team is allowed to deploy beta versions and related contracts....
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.
address getGlobalConfig(FlexVersion version)
Get GlobalConfig address for specified version.
SuperRootDetails getDetails()
Get contract details.
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.
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.
void transfer(address to, uint128 evers)
Transfer native evers from super root. Not allowed for the update team.
void setOwner(address owner)
Set owner contract. Pubkey access will be unavailable after this. Not allowed for the update team.
void setNextSuperRoot(address next_super_root)
Set next (updated) super root. Not allowed for the update team.
void updateConfirmed(FlexVersion version)
void transferReserveTokens(address wrapper, uint128 tokens, address to)
Transfer flex tip3 tokens from a reserve wallet. Not allowed for the update team.
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.
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.
void proxy(cell msg, bool cant_work_during_update, bool starting_update)
Perform proxy call from SuperRoot to an owned subpart (WrappersConfig, Flex, UserDataConfig)
Evers configuration for pair clone procedure.
Definition: PairCloneEvers.hpp:12
SuperRoot details for getter.
Definition: SuperRoot.hpp:23
address_opt prev_super_root
Will point to the previous super root.
Definition: SuperRoot.hpp:38
address_opt deploying_cfg
Deploying GlobalConfig contract.
Definition: SuperRoot.hpp:35
bool abandon_ship_
Recommendation to cancel all orders and withdraw funds (in case if critical problem found)
Definition: SuperRoot.hpp:26
uint256 global_config_hash
Code hash of GlobalConfig (of salted code)
Definition: SuperRoot.hpp:31
bool stop_trade_
Recommendation to stop trading (in case if problem found in trading algorithms)
Definition: SuperRoot.hpp:25
address_opt next_super_root
Will be set up if new super root is deployed and should be used instead.
Definition: SuperRoot.hpp:39
address_opt beta_cfg
Address of the beta GlobalConfig (for beta version, if not null)
Definition: SuperRoot.hpp:37
address_opt update_team
Update team address. Update team is allowed to deploy beta versions and related contracts.
Definition: SuperRoot.hpp:29
bool update_started_
Update procedures started (Wrappers/Flex/UI cloning started)
Definition: SuperRoot.hpp:27
uint256 pubkey
Deployer public key.
Definition: SuperRoot.hpp:24
opt< FlexVersion > beta_version
Beta Flex version.
Definition: SuperRoot.hpp:34
uint32 revision
SuperRoot revision.
Definition: SuperRoot.hpp:40
cell global_config_code
Code of GlobalConfig (salted)
Definition: SuperRoot.hpp:30
address owner
Owner contract address.
Definition: SuperRoot.hpp:28
int8 workchain_id
Workchain id.
Definition: SuperRoot.hpp:32
address_opt cur_cfg
Address of the current GlobalConfig (for current version, if not null)
Definition: SuperRoot.hpp:36
opt< FlexVersion > version
Latest Flex version.
Definition: SuperRoot.hpp:33
Evers configuration for clone procedure.
Definition: WICCloneEvers.hpp:12
Binding to allow orders only to specific flex root and with specific unsalted PriceXchg code hash.
Definition: bind_info.hpp:8