Flex
Flex exchange system
SuperRootOwner.hpp
Go to the documentation of this file.
1 
7 #pragma once
8 
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>
13 #include "FlexVersion.hpp"
14 #include "WICCloneEvers.hpp"
15 #include "PairCloneEvers.hpp"
16 #include "EversConfig.hpp"
17 #include "Tip3Config.hpp"
18 #include "bind_info.hpp"
19 
20 namespace tvm {
21 
24  bool initialized;
25  uint256 pubkey;
26  address_opt super_root;
27  optcell super_root_code;
28  optcell global_cfg_code;
29  optcell flex_client_stub;
31  optcell wic_code;
32  optcell flex_code;
33  optcell pair_code;
34  optcell price_code;
36  optcell flex_client_code;
37  optcell auth_index_code;
39 };
40 
42 enum class sroot_code_type {
43  super_root = 1,
44  global_cfg = 2,
45  flex_client_stub = 3,
46  wrappers_cfg = 4,
47  wic = 5,
48  flex = 6,
49  pair = 7,
50  price = 8,
51  user_data_cfg = 9,
52  flex_client = 10,
53  auth_index = 11,
54  user_id_index = 12
55 };
56 
62 __interface ISuperRootOwner {
63 
65  [[external]]
67  uint256 pubkey
68  );
69 
71  [[external]]
72  void setCode(
73  uint8 type,
74  cell code
75  );
76 
78  [[external]]
79  address deploySuperRoot(
80  uint128 evers,
81  address_opt prev_super_root
82  );
83 
87  [[external]]
88  void update(
89  uint128 main_evers,
90  uint128 cfg_deploy_evers,
91  uint128 cfg_keep_evers,
92  FlexVersion version,
93  address wrappers_cfg,
94  address flex,
95  address user_cfg,
96  string description
97  );
98 
100  [[external]]
101  void release(
102  uint128 main_evers
103  );
104 
106  [[external]]
108  uint128 main_evers,
109  uint128 wrappers_cfg_keep_evers,
110  address wrappers_cfg,
111  uint8 type,
112  address wrapper_deployer
113  );
114 
116  [[external]]
118  uint128 main_evers,
119  uint128 wrappers_cfg_keep_evers,
120  address wrappers_cfg,
121  WICCloneEvers evers,
122  string symbol,
123  uint8 type,
124  cell init_args
125  );
126 
128  [[external]]
130  uint128 main_evers,
131  address flex,
132  PairCloneEvers evers,
133  Tip3Config major_tip3cfg,
134  Tip3Config minor_tip3cfg,
135  uint128 min_amount,
136  uint128 minmove,
137  uint128 price_denum,
138  address notify_addr
139  );
140 
142  [[external]]
144  uint128 main_evers,
145  address wrappers_cfg,
146  address wic
147  );
148 
150  [[external]]
152  uint128 main_evers,
153  address flex,
154  address pair
155  );
156 
158  [[external]]
160  uint128 main_evers,
161  address wrapper
162  );
163 
165  [[external]]
166  resumable<address> deployWrappersConfig(
167  uint128 main_evers,
168  uint128 deploy_evers,
169  uint128 wrappers_cfg_keep_evers,
170  uint32 token_version
171  );
172 
174  [[external]]
175  resumable<address> deployFlex(
176  uint128 main_evers,
177  uint128 deploy_evers,
178  uint128 keep_evers,
179  PairCloneEvers evers,
180  address_opt old_flex,
181  uint32 exchange_version,
182  EversConfig ev_cfg,
183  uint8 deals_limit
184  );
185 
187  [[external]]
188  resumable<address> deployUserDataConfig(
189  uint128 main_evers,
190  uint128 deploy_evers,
191  FlexVersion triplet,
192  address flex
193  );
194 
196  [[external]]
197  resumable<address> cloneWrappersConfig(
198  uint128 main_evers,
199  address wrappers_cfg,
200  uint128 wrapper_cfg_keep_evers,
201  uint128 clone_deploy_evers,
202  WICCloneEvers wic_evers,
203  uint32 new_token_version,
204  dict_array<address> wrapper_deployers
205  );
206 
208  [[external]]
209  void setFlags(
210  uint128 main_evers,
211  opt<bool> stop_trade,
212  opt<bool> abandon_ship,
213  opt<bool> update_started
214  );
215 
217  [[external]]
218  void transfer(
219  uint128 main_evers,
220  address to,
221  uint128 evers
222  );
223 
225  [[external]]
227  uint128 main_evers,
228  address wrapper,
229  uint128 tokens,
230  address to
231  );
232 
234  [[external]]
235  void setOwner(
236  uint128 main_evers,
237  address owner
238  );
239 
241  [[external]]
243  uint128 main_evers,
244  address_opt team
245  );
246 
248  [[external]]
250  uint128 main_evers,
251  address next_super_root
252  );
253 
255  [[getter]]
257 };
258 using ISuperRootOwnerPtr = handle<ISuperRootOwner>;
259 
262  uint256 pubkey_;
263  address_opt super_root_;
268  optcell wic_code_;
269  optcell flex_code_;
270  optcell pair_code_;
271  optcell price_code_;
276 };
277 
280 __interface ESuperRootOwner {
281 };
282 
283 } // namespace tvm
Flex evers configuration (processing costs)
Flex version structure.
Pair clone evers configuration structure.
sroot_code_type
Sub-component code type for setCode.
Definition: SuperRootOwner.hpp:42
WIC clone evers configuration structure.
SuperRootOwner persistent data struct.
Definition: SuperRootOwner.hpp:261
optcell flex_code_
Code of Flex (unsalted)
Definition: SuperRootOwner.hpp:269
optcell super_root_code_
Code of SuperRoot (unsalted)
Definition: SuperRootOwner.hpp:264
optcell flex_client_code_
FlexClient code (unsalted)
Definition: SuperRootOwner.hpp:273
address_opt super_root_
SuperRoot address.
Definition: SuperRootOwner.hpp:263
optcell auth_index_code_
AuthIndex code (unsalted)
Definition: SuperRootOwner.hpp:274
optcell price_code_
Code of PriceXchg (unsalted)
Definition: SuperRootOwner.hpp:271
optcell user_data_cfg_code_
UserDataConfig code (unsalted)
Definition: SuperRootOwner.hpp:272
optcell pair_code_
Code of XchgPair (unsalted)
Definition: SuperRootOwner.hpp:270
optcell wic_code_
Code of WrapperIndexContract (WIC, unsalted)
Definition: SuperRootOwner.hpp:268
optcell user_id_index_code_
UserIdIndexCode (unsalted)
Definition: SuperRootOwner.hpp:275
optcell flex_client_stub_
FlexClientStub code (unsalted)
Definition: SuperRootOwner.hpp:266
uint256 pubkey_
Owner public key.
Definition: SuperRootOwner.hpp:262
optcell wrappers_cfg_code_
Code of WrappersConfig (unsalted)
Definition: SuperRootOwner.hpp:267
optcell global_cfg_code_
Code of GlobalConfig (unsalted)
Definition: SuperRootOwner.hpp:265
SuperRootOwner events interface.
Definition: SuperRootOwner.hpp:280
Processing native funds value ...
Definition: EversConfig.hpp:12
Flex version triplet.
Definition: FlexVersion.hpp:14
SuperRootOwner contract interface. SuperRootOwner is an owning contract for SuperRoot....
Definition: SuperRootOwner.hpp:62
void constructor(uint256 pubkey)
Constructor of SuperRootOwner.
SuperRootOwnerDetails getDetails()
Get contract details.
void release(uint128 main_evers)
Convert beta-version into release.
void unlistWrapper(uint128 main_evers, address wrappers_cfg, address wic)
Unlist Wrapper.
resumable< address > deployUserDataConfig(uint128 main_evers, uint128 deploy_evers, FlexVersion triplet, address flex)
Deploy UserDataConfig contract.
resumable< address > deployFlex(uint128 main_evers, uint128 deploy_evers, uint128 keep_evers, PairCloneEvers evers, address_opt old_flex, uint32 exchange_version, EversConfig ev_cfg, uint8 deals_limit)
Deploy Flex contract.
void setNextSuperRoot(uint128 main_evers, address next_super_root)
Set next (updated) super root.
void unlistXchgPair(uint128 main_evers, address flex, address pair)
Unlist XchgPair.
void upgradeBroxusWrapperWallet(uint128 main_evers, address wrapper)
Upgrade WrapperBroxus's wallet.
void setFlags(uint128 main_evers, opt< bool > stop_trade, opt< bool > abandon_ship, opt< bool > update_started)
Set flags. If optional is not set, flag will not be changed.
address deploySuperRoot(uint128 evers, address_opt prev_super_root)
Deploy SuperRoot.
void addWrapperType(uint128 main_evers, uint128 wrappers_cfg_keep_evers, address wrappers_cfg, uint8 type, address wrapper_deployer)
Add wrapper type. Will fail if the update procedure started.
void transferReserveTokens(uint128 main_evers, address wrapper, uint128 tokens, address to)
Transfer flex tip3 tokens from a reserve wallet. Not allowed for the update team.
resumable< address > cloneWrappersConfig(uint128 main_evers, 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.
void addXchgPair(uint128 main_evers, address flex, PairCloneEvers evers, Tip3Config major_tip3cfg, Tip3Config minor_tip3cfg, uint128 min_amount, uint128 minmove, uint128 price_denum, address notify_addr)
Add XchgPair to list a new trading pair. Will fail if the update procedure started.
void setUpdateTeam(uint128 main_evers, address_opt team)
Set update team address. Update team is allowed to deploy beta versions and related contracts.
void addWrapper(uint128 main_evers, uint128 wrappers_cfg_keep_evers, address wrappers_cfg, WICCloneEvers evers, string symbol, uint8 type, cell init_args)
Add wrapper to list a new token. Will fail if the update procedure started.
void update(uint128 main_evers, uint128 cfg_deploy_evers, uint128 cfg_keep_evers, FlexVersion version, address wrappers_cfg, address flex, address user_cfg, string description)
void setCode(uint8 type, cell code)
Set code of specific sub-component.
void setOwner(uint128 main_evers, address owner)
Set new owner contract. This owner contract will loose ownership access.
void transfer(uint128 main_evers, address to, uint128 evers)
Transfer native evers from super root. Not allowed for the update team.
resumable< address > deployWrappersConfig(uint128 main_evers, uint128 deploy_evers, uint128 wrappers_cfg_keep_evers, uint32 token_version)
Deploy WrappersConfig contract.
Evers configuration for pair clone procedure.
Definition: PairCloneEvers.hpp:12
SuperRootOwner details for getter.
Definition: SuperRootOwner.hpp:23
optcell pair_code
Code of XchgPair (unsalted)
Definition: SuperRootOwner.hpp:33
optcell auth_index_code
AuthIndex code (unsalted)
Definition: SuperRootOwner.hpp:37
optcell flex_code
Code of Flex (unsalted)
Definition: SuperRootOwner.hpp:32
optcell price_code
Code of PriceXchg (unsalted)
Definition: SuperRootOwner.hpp:34
optcell global_cfg_code
Code of GlobalConfig (unsalted)
Definition: SuperRootOwner.hpp:28
uint256 pubkey
Owner public key.
Definition: SuperRootOwner.hpp:25
optcell user_id_index_code
UserIdIndexCode (unsalted)
Definition: SuperRootOwner.hpp:38
optcell super_root_code
Code of SuperRoot (unsalted)
Definition: SuperRootOwner.hpp:27
optcell flex_client_stub
FlexClientStub code (unsalted)
Definition: SuperRootOwner.hpp:29
optcell user_data_cfg_code
UserDataConfig code (unsalted)
Definition: SuperRootOwner.hpp:35
optcell wrappers_cfg_code
Code of WrappersConfig (unsalted)
Definition: SuperRootOwner.hpp:30
optcell wic_code
Code of WrapperIndexContract (WIC, unsalted)
Definition: SuperRootOwner.hpp:31
address_opt super_root
SuperRoot address.
Definition: SuperRootOwner.hpp:26
bool initialized
All code cells initialized.
Definition: SuperRootOwner.hpp:24
optcell flex_client_code
FlexClient code (unsalted)
Definition: SuperRootOwner.hpp:36
Evers configuration for clone procedure.
Definition: WICCloneEvers.hpp:12