@@ -20,7 +20,6 @@ use std::{
2020 time:: Duration ,
2121} ;
2222use t3rn_primitives:: {
23- abi:: Type ,
2423 bridges:: {
2524 header_chain:: InitializationData ,
2625 runtime:: {
@@ -145,145 +144,7 @@ fn seed_xdns_registry() -> Result<Vec<XdnsRecord<AccountId>>, Error> {
145144}
146145
147146fn standard_side_effects ( ) -> Vec < SideEffectInterface > {
148- let transfer_side_effect = SideEffectInterface {
149- id : * b"tran" ,
150- name : b"transfer" . to_vec ( ) ,
151- argument_abi : vec ! [
152- Type :: DynamicAddress , // argument_0: from
153- Type :: DynamicAddress , // argument_1: to
154- Type :: Value , // argument_2: value
155- Type :: OptionalInsurance , // argument_3: insurance
156- ] ,
157- argument_to_state_mapper : vec ! [
158- b"from" . to_vec( ) ,
159- b"to" . to_vec( ) ,
160- b"value" . to_vec( ) ,
161- b"insurance" . to_vec( ) ,
162- ] ,
163- confirm_events : vec ! [ b"Transfer(_from,to,value)" . to_vec( ) ] ,
164- escrowed_events : vec ! [ b"EscrowTransfer(from,to,value)" . to_vec( ) ] ,
165- commit_events : vec ! [ b"Transfer(executor,to,value)" . to_vec( ) ] ,
166- revert_events : vec ! [ b"Transfer(executor,from,value)" . to_vec( ) ] ,
167- } ;
168-
169- let swap_side_effect = SideEffectInterface {
170- id : * b"swap" ,
171- name : b"swap" . to_vec ( ) ,
172- argument_abi : vec ! [
173- Type :: DynamicAddress , // argument_0: caller
174- Type :: DynamicAddress , // argument_1: to
175- Type :: Value , // argument_2: amount_from
176- Type :: Value , // argument_3: amount_to
177- Type :: DynamicBytes , // argument_4: asset_from
178- Type :: DynamicBytes , // argument_5: asset_to
179- Type :: OptionalInsurance , // argument_6: insurance
180- ] ,
181- argument_to_state_mapper : vec ! [
182- b"caller" . to_vec( ) ,
183- b"to" . to_vec( ) ,
184- b"amount_from" . to_vec( ) ,
185- b"amount_to" . to_vec( ) ,
186- b"asset_from" . to_vec( ) ,
187- b"asset_to" . to_vec( ) ,
188- b"insurance" . to_vec( ) ,
189- ] ,
190- confirm_events : vec ! [ b"ExecuteToken(_executor,to,asset_to,amount_to)" . to_vec( ) ] ,
191- escrowed_events : vec ! [ b"ExecuteToken(_executor,to,asset_to,amount_to)" . to_vec( ) ] ,
192- commit_events : vec ! [ b"MultiTransfer(executor,to,asset_to,amount_to)" . to_vec( ) ] ,
193- revert_events : vec ! [ b"MultiTransfer(executor,caller,asset_from,amount_from)" . to_vec( ) ] ,
194- } ;
195-
196- let add_liquidity_side_effect = SideEffectInterface {
197- id : * b"aliq" ,
198- name : b"add_liquidity" . to_vec ( ) ,
199- argument_abi : vec ! [
200- Type :: DynamicAddress , // argument_0: caller
201- Type :: DynamicAddress , // argument_1: to
202- Type :: DynamicBytes , // argument_2: asset_left
203- Type :: DynamicBytes , // argument_3: asset_right
204- Type :: DynamicBytes , // argument_4: liquidity_token
205- Type :: Value , // argument_5: amount_left
206- Type :: Value , // argument_6: amount_right
207- Type :: Value , // argument_7: amount_liquidity_token
208- Type :: OptionalInsurance , // argument_8: insurance
209- ] ,
210- argument_to_state_mapper : vec ! [
211- b"caller" . to_vec( ) ,
212- b"to" . to_vec( ) ,
213- b"asset_left" . to_vec( ) ,
214- b"assert_right" . to_vec( ) ,
215- b"liquidity_token" . to_vec( ) ,
216- b"amount_left" . to_vec( ) ,
217- b"amount_right" . to_vec( ) ,
218- b"amount_liquidity_token" . to_vec( ) ,
219- b"insurance" . to_vec( ) ,
220- ] ,
221- confirm_events : vec ! [
222- b"ExecuteToken(executor,to,liquidity_token,amount_liquidity_token)" . to_vec( ) ,
223- ] ,
224- escrowed_events : vec ! [
225- b"ExecuteToken(xtx_id,to,liquidity_token,amount_liquidity_token)" . to_vec( ) ,
226- ] ,
227- commit_events : vec ! [
228- b"MultiTransfer(executor,to,liquidity_token,amount_liquidity_token)" . to_vec( ) ,
229- ] ,
230- revert_events : vec ! [
231- b"MultiTransfer(executor,caller,asset_left,amount_left)" . to_vec( ) ,
232- b"MultiTransfer(executor,caller,asset_right,amount_right)" . to_vec( ) ,
233- ] ,
234- } ;
235-
236- let call_evm_side_effect = SideEffectInterface {
237- id : * b"call" ,
238- name : b"call:generic" . to_vec ( ) ,
239- argument_abi : vec ! [
240- Type :: DynamicAddress , // argument_0: source
241- Type :: DynamicAddress , // argument_1: target
242- Type :: DynamicBytes , // argument_2: target
243- Type :: Value , // argument_3: value
244- Type :: Uint ( 64 ) , // argument_4: gas_limit
245- Type :: Value , // argument_5: max_fee_per_gas
246- Type :: Value , // argument_6: max_priority_fee_per_gas
247- Type :: Value , // argument_7: nonce
248- Type :: DynamicBytes , // argument_8: access_list (since HF Berlin?)
249- ] ,
250- argument_to_state_mapper : vec ! [
251- b"source" . to_vec( ) ,
252- b"target" . to_vec( ) ,
253- b"input" . to_vec( ) ,
254- b"value" . to_vec( ) ,
255- b"gas_limit" . to_vec( ) ,
256- b"max_fee_per_gas" . to_vec( ) ,
257- b"max_priority_fee_per_gas" . to_vec( ) ,
258- b"nonce" . to_vec( ) ,
259- b"access_list" . to_vec( ) ,
260- ] ,
261- confirm_events : vec ! [ b"TransactCall(Append<caller>,source,value,input,gas_limit)" . to_vec( ) ] ,
262- escrowed_events : vec ! [ ] ,
263- commit_events : vec ! [ ] ,
264- revert_events : vec ! [ ] ,
265- } ;
266-
267- let get_data_side_effect = SideEffectInterface {
268- id : * b"data" ,
269- name : b"data:get" . to_vec ( ) ,
270- argument_abi : vec ! [
271- Type :: DynamicBytes , // argument_0: key
272- ] ,
273- argument_to_state_mapper : vec ! [ b"key" . to_vec( ) ] ,
274- confirm_events : vec ! [ b"<InclusionOnly>" . to_vec( ) ] ,
275- escrowed_events : vec ! [ ] ,
276- commit_events : vec ! [ ] ,
277- revert_events : vec ! [ ] ,
278- } ;
279-
280- vec ! [
281- transfer_side_effect,
282- swap_side_effect,
283- add_liquidity_side_effect,
284- call_evm_side_effect,
285- get_data_side_effect,
286- ]
147+ t3rn_protocol:: side_effects:: standards:: standard_side_effects ( )
287148}
288149
289150/// Fetches gateway initialization data by chain id.
0 commit comments