diff --git a/messenger/src/main.rs b/messenger/src/main.rs index 32df5652d..87ddf6c69 100644 --- a/messenger/src/main.rs +++ b/messenger/src/main.rs @@ -47,9 +47,16 @@ use subxt::{ utils::{AccountId32, MultiAddress, MultiSignature, H256}, OnlineClient, }; -use types::runtime::api::runtime_types::ismp::consensus::StateMachineId; +use types::{ + runtime::api::runtime_types::ismp::consensus::StateMachineId, + token_faucet::TokenFaucet, + token_gateway::{AssetReceivedFilter, SendParams, TokenGateway}, +}; static CROSS_CHAIN_MESSENGER_ADDRESS: H160 = H160(hex!("7067AC432584D7a00A75804EaF010498c263819d")); +static GATEWAY_ADDRESS: H160 = H160(hex!("0e366Fa0506F2dfF080648a99083A6a2F7D175e0")); +static FAUCET_ADDRESS: H160 = H160(hex!("368F3d726C904C0113b6C8A8923D4Bfe8b0b19E7")); +static MULTICHAIN_TOKEN: H160 = H160(hex!("00155be25de526F458D1C303feEA6983Dbe007ad")); #[tokio::main] async fn main() -> Result<(), anyhow::Error> { @@ -59,7 +66,6 @@ async fn main() -> Result<(), anyhow::Error> { .init(); let args = Cli::parse(); let source: Ethereum = args.source.into(); - let destination: Ethereum = args.destination.into(); // initialize clients let bytes = hex::decode(args.signer.as_str())?; @@ -67,45 +73,105 @@ async fn main() -> Result<(), anyhow::Error> { let signer = LocalWallet::from(SecretKey::from_slice(signer.seed().as_slice())?) .with_chain_id(source.chain_id()); let provider = Provider::::connect_with_reconnects(source.execution_rpc(), 1000).await?; - let substrate = + let mut substrate = OnlineClient::::from_url("ws://34.22.152.185:9933").await?; - let rpc_client = WsClientBuilder::default().build(&destination.execution_rpc()).await?; let signer = Arc::new(provider.clone().with_signer(signer)); // initiate transaction let pb = progress_bar(format!("Sending transaction ..")); let now = Instant::now(); - let messenger = CrossChainMessenger::new(CROSS_CHAIN_MESSENGER_ADDRESS, signer.clone()); - let receipt = messenger - .teleport(CrossChainMessage { - dest: StateMachine::Ethereum(destination).to_string().as_bytes().to_vec().into(), - message: args.message.as_bytes().to_vec().into(), - timeout: 3 * 60 * 60, - }) - .gas(100_000) - .send() - .await? - .await? - .ok_or_else(|| anyhow!("transaction failed i guess"))?; + let (receipt, destination) = match args.action.clone() { + Action::Gateway { to, amount, destination } => { + let destination: Ethereum = destination.into(); + let gateway = TokenGateway::new(GATEWAY_ADDRESS, signer.clone()); + let receipt = gateway + .send(SendParams { + amount: (amount * 10u128.pow(18)).into(), + to: { + let to = to + .split("0x") + .last() + .ok_or_else(|| anyhow!("Invalid destination adress"))?; + let bytes = hex::decode(to)?; + if bytes.len() != 20 { + Err(anyhow!("Invalid destination adress"))? + } + H160::from_slice(&bytes) + }, + dest: StateMachine::Ethereum(destination) + .to_string() + .as_bytes() + .to_vec() + .into(), + token_contract: MULTICHAIN_TOKEN, + timeout: 3 * 60 * 60, + }) + .gas(100_000) + .send() + .await? + .await? + .ok_or_else(|| anyhow!("Transaction failed, please ensure you have some balance in your account, if not use the `drip` command first"))?; + (receipt, destination) + }, + Action::Drip => { + let faucet = TokenFaucet::new(FAUCET_ADDRESS, signer.clone()); + let receipt = faucet + .drip() + .gas(100_000) + .send() + .await? + .await? + .ok_or_else(|| anyhow!("Transaction submission failed"))?; + pb.finish_with_message(format!( + "Drip completed: {}, took: {}", + source.etherscan(receipt.transaction_hash), + HumanDuration(now.elapsed()) + )); + return Ok(()) + }, + Action::Ping { destination, message } => { + let destination: Ethereum = destination.into(); + let messenger = CrossChainMessenger::new(CROSS_CHAIN_MESSENGER_ADDRESS, signer.clone()); + let receipt = messenger + .teleport(CrossChainMessage { + dest: StateMachine::Ethereum(destination) + .to_string() + .as_bytes() + .to_vec() + .into(), + message: message.as_bytes().to_vec().into(), + timeout: 3 * 60 * 60, + }) + .gas(100_000) + .send() + .await? + .await? + .ok_or_else(|| anyhow!("transaction failed i guess"))?; + (receipt, destination) + }, + }; + + let mut rpc_client = WsClientBuilder::default().build(&destination.execution_rpc()).await?; + let block_number = receipt.block_number.unwrap().as_u64(); + pb.finish_with_message(format!( "Cross chain message sent: {}, took: {}", source.etherscan(receipt.transaction_hash), HumanDuration(now.elapsed()) )); - let request = parse_log::(receipt.logs[0].clone())?; + let request = receipt + .logs + .iter() + .filter_map(|log| parse_log::(log.clone()).ok()) + .collect::>() + .get(0) + .cloned() + .ok_or_else(|| anyhow!("Post Request was not sent, Ensure you have some balance by using the `drip` command before performing a token transfer"))?; // wait for Ethereum finality let now = Instant::now(); - let subscription = substrate - .rpc() - .subscribe::>( - "state_subscribeStorage", - rpc_params![vec![system_events_key()]], - "state_unsubscribeStorage", - ) - .await - .expect("Storage subscription failed"); + let subscription = subscribe_storage(&mut substrate).await; let mut debounced_sub = Debounced::new(subscription, Duration::from_secs(4)); let pb = progress_bar("Waiting for Ethereum to finalize your transaction".into()); 'outer: loop { @@ -244,7 +310,7 @@ async fn main() -> Result<(), anyhow::Error> { let mut stream = { let stream = - subscribe_logs(&rpc_client, destination.handler()) + subscribe_logs(&mut rpc_client, &destination.execution_rpc(), destination.handler()) .await .filter_map(|log| async move { log.ok().and_then(|log| { @@ -280,39 +346,82 @@ async fn main() -> Result<(), anyhow::Error> { // wait for hyperbridge delivery let now = Instant::now(); let pb = progress_bar("Waiting for Hyperbridge to deliver your transaction".into()); - let mut stream = { - let stream = subscribe_logs(&rpc_client, CROSS_CHAIN_MESSENGER_ADDRESS).await.filter_map( - |log| async move { - log.ok().and_then(|log| { - parse_log::(log.clone()) - .map(|ev| (log.transaction_hash, ev)) - .ok() - }) - }, - ); - Box::pin(stream) - }; - - loop { - let (hash, event) = match stream.next().await { - Some(message) => message, - None => { - panic!("Hyperbridge delivery stream terminated unexpectedly"); - }, - }; - - if args.message == event.message && - event.nonce == request.nonce && - request.source == event.source - { - pb.finish_with_message(format!( - "Hyperbridge has delivered your transaction: {}, took: {}", - destination.etherscan(hash.unwrap()), - HumanDuration(now.elapsed()) - )); - - break - } + match args.action { + Action::Gateway { .. } => { + let mut stream = { + let stream = + subscribe_logs(&mut rpc_client, &destination.execution_rpc(), GATEWAY_ADDRESS) + .await + .filter_map(|log| async move { + log.ok().and_then(|log| { + parse_log::(log.clone()) + .map(|ev| (log.transaction_hash, ev)) + .ok() + }) + }); + Box::pin(stream) + }; + + loop { + let (hash, event) = match stream.next().await { + Some(message) => message, + None => { + panic!("Hyperbridge delivery stream terminated unexpectedly"); + }, + }; + + if event.nonce == request.nonce && request.source == event.source { + pb.finish_with_message(format!( + "Hyperbridge has delivered your transaction, check your wallet balance: {}, took: {}", + destination.etherscan(hash.unwrap()), + HumanDuration(now.elapsed()) + )); + + break + } + } + }, + Action::Ping { message, .. } => { + let mut stream = { + let stream = subscribe_logs( + &mut rpc_client, + &destination.execution_rpc(), + CROSS_CHAIN_MESSENGER_ADDRESS, + ) + .await + .filter_map(|log| async move { + log.ok().and_then(|log| { + parse_log::(log.clone()) + .map(|ev| (log.transaction_hash, ev)) + .ok() + }) + }); + Box::pin(stream) + }; + + loop { + let (hash, event) = match stream.next().await { + Some(message) => message, + None => { + panic!("Hyperbridge delivery stream terminated unexpectedly"); + }, + }; + + if message == event.message && + event.nonce == request.nonce && + request.source == event.source + { + pb.finish_with_message(format!( + "Hyperbridge has delivered your transaction: {}, took: {}", + destination.etherscan(hash.unwrap()), + HumanDuration(now.elapsed()) + )); + + break + } + } + }, + _ => unreachable!(), } Ok(()) @@ -346,7 +455,8 @@ fn progress_bar(msg: String) -> ProgressBar { } async fn subscribe_logs( - rpc_client: &WsClient, + rpc_client: &mut WsClient, + rpc_addr: &str, address: H160, ) -> jsonrpsee::core::client::Subscription { let mut obj = ObjectParams::new(); @@ -354,14 +464,54 @@ async fn subscribe_logs( obj.insert("address", address.as_str()) .expect("handler address should be valid"); let param = obj.to_rpc_params().ok().flatten().expect("Failed to serialize rpc params"); - rpc_client - .subscribe::( - "eth_subscribe", - jsonrpsee::rpc_params!("logs", param), - "eth_unsubscribe", - ) - .await - .expect("Failed to susbcribe") + let reconnects = 10; + for _ in 0..reconnects { + let res = rpc_client + .subscribe::( + "eth_subscribe", + jsonrpsee::rpc_params!("logs", param.clone()), + "eth_unsubscribe", + ) + .await; + match res { + Ok(sub) => return sub, + Err(_) => { + tokio::time::sleep(Duration::from_secs(5)).await; + if let Ok(client) = WsClientBuilder::default().build(&rpc_addr).await { + *rpc_client = client + } + }, + } + } + panic!("Rpc provider is down, Your message will still be delivered by the relayer, check your wallet balance in about 30mins") +} + +async fn subscribe_storage( + substrate: &mut OnlineClient, +) -> subxt::rpc::Subscription> { + let reconnects = 10; + for _ in 0..reconnects { + let err = substrate + .rpc() + .subscribe::>( + "state_subscribeStorage", + rpc_params![vec![system_events_key()]], + "state_unsubscribeStorage", + ) + .await; + match err { + Ok(sub) => return sub, + Err(_) => { + tokio::time::sleep(Duration::from_secs(5)).await; + if let Ok(client) = + OnlineClient::::from_url("ws://34.22.152.185:9933").await + { + *substrate = client + } + }, + } + } + panic!("Rpc provider is down, Your message will still be delivered by the relayer") } /// Some metadata about each chain @@ -411,8 +561,9 @@ impl ChainInfo for Ethereum { match self { Ethereum::Base => format!("https://goerli.basescan.org/tx/{transaction:?}"), Ethereum::ExecutionLayer => format!("https://goerli.etherscan.io/tx/{transaction:?}"), - Ethereum::Optimism => - format!("https://goerli-optimism.etherscan.io/tx/{transaction:?}"), + Ethereum::Optimism => { + format!("https://goerli-optimism.etherscan.io/tx/{transaction:?}") + }, Ethereum::Arbitrum => format!("https://testnet.arbiscan.io/tx/{transaction:?}"), } } @@ -446,21 +597,46 @@ impl subxt::Config for KeccakSubstrateChain { /// A simple CLI application for sending arbitrary messages through Hyperbridge #[derive(Parser, Debug)] pub struct Cli { + /// Sub commands for the messenger + #[command(subcommand)] + action: Action, + /// Raw account secret key #[arg(short, long)] signer: String, - /// The source chain for the cross-chain message + /// The source chain for the transaction #[arg(value_enum, short, long)] source: Network, +} - /// The destination chain for the cross-chain message - #[arg(value_enum, short, long)] - destination: Network, - - /// Cross-chain message to be sent. - #[arg(short, long)] - message: String, +#[derive(Debug, clap::Subcommand, Clone)] +pub enum Action { + /// Transfer tokens through the token gateway, + /// Ensure you have some balance by running the `drip` command first + Gateway { + /// Account to receive this transfer on the destination chain + #[arg(short, long)] + to: String, + /// Amount to be transferred + #[arg(short, long)] + amount: u128, + /// The destination chain for the token transfer + #[arg(value_enum, short, long)] + destination: Network, + }, + /// Send an arbitrary cross chain message + Ping { + /// The destination chain for the cross-chain message + #[arg(value_enum, short, long)] + destination: Network, + + /// Cross-chain message to be sent. + #[arg(short, long)] + message: String, + }, + /// Get daily drip from the token faucet + Drip, } #[derive(clap::ValueEnum, Debug, Clone, Copy)] diff --git a/messenger/src/types.rs b/messenger/src/types.rs index 7328f342f..4f31cb4c6 100644 --- a/messenger/src/types.rs +++ b/messenger/src/types.rs @@ -3,3 +3,5 @@ pub mod handler; pub mod ismp_host; pub mod runtime; pub mod shared_types; +pub mod token_faucet; +pub mod token_gateway; diff --git a/messenger/src/types/token_faucet.rs b/messenger/src/types/token_faucet.rs new file mode 100644 index 000000000..10db8ce69 --- /dev/null +++ b/messenger/src/types/token_faucet.rs @@ -0,0 +1,151 @@ +pub use token_faucet::*; +/// This module was auto-generated with ethers-rs Abigen. +/// More information at: +#[allow( + clippy::enum_variant_names, + clippy::too_many_arguments, + clippy::upper_case_acronyms, + clippy::type_complexity, + dead_code, + non_camel_case_types +)] +pub mod token_faucet { + #[allow(deprecated)] + fn __abi() -> ::ethers::core::abi::Abi { + ::ethers::core::abi::ethabi::Contract { + constructor: ::core::option::Option::Some(::ethers::core::abi::ethabi::Constructor { + inputs: ::std::vec![::ethers::core::abi::ethabi::Param { + name: ::std::borrow::ToOwned::to_owned("_token"), + kind: ::ethers::core::abi::ethabi::ParamType::Address, + internal_type: ::core::option::Option::Some(::std::borrow::ToOwned::to_owned( + "address" + ),), + },], + }), + functions: ::core::convert::From::from([( + ::std::borrow::ToOwned::to_owned("drip"), + ::std::vec![::ethers::core::abi::ethabi::Function { + name: ::std::borrow::ToOwned::to_owned("drip"), + inputs: ::std::vec![], + outputs: ::std::vec![], + constant: ::core::option::Option::None, + state_mutability: ::ethers::core::abi::ethabi::StateMutability::NonPayable, + },], + )]), + events: ::std::collections::BTreeMap::new(), + errors: ::std::collections::BTreeMap::new(), + receive: false, + fallback: false, + } + } + ///The parsed JSON ABI of the contract. + pub static TOKENFAUCET_ABI: ::ethers::contract::Lazy<::ethers::core::abi::Abi> = + ::ethers::contract::Lazy::new(__abi); + #[rustfmt::skip] + const __BYTECODE: &[u8] = b"`\x80`@R4\x80\x15a\0\x10W`\0\x80\xFD[P`@Qa\x02:8\x03\x80a\x02:\x839\x81\x01`@\x81\x90Ra\0/\x91a\0TV[`\x01\x80T`\x01`\x01`\xA0\x1B\x03\x19\x16`\x01`\x01`\xA0\x1B\x03\x92\x90\x92\x16\x91\x90\x91\x17\x90Ua\0\x84V[`\0` \x82\x84\x03\x12\x15a\0fW`\0\x80\xFD[\x81Q`\x01`\x01`\xA0\x1B\x03\x81\x16\x81\x14a\0}W`\0\x80\xFD[\x93\x92PPPV[a\x01\xA7\x80a\0\x93`\09`\0\xF3\xFE`\x80`@R4\x80\x15a\0\x10W`\0\x80\xFD[P`\x046\x10a\0+W`\x005`\xE0\x1C\x80c\x9Fg\x8C\xCA\x14a\x000W[`\0\x80\xFD[a\08a\0:V[\0[3`\0\x90\x81R` \x81\x90R`@\x81 T\x90a\0U\x82Ba\x01JV[\x90Pb\x01Q\x80\x81\x10\x15a\0\xB9W`@QbF\x1B\xCD`\xE5\x1B\x81R` `\x04\x82\x01R`\"`$\x82\x01R\x7FCan only request tokens once dai`D\x82\x01Raly`\xF0\x1B`d\x82\x01R`\x84\x01`@Q\x80\x91\x03\x90\xFD[3`\0\x81\x81R` \x81\x90R`@\x80\x82 B\x90U`\x01T\x90Qc\x94\xD0\x08\xEF`\xE0\x1B\x81R`\x04\x81\x01\x93\x90\x93Rh65\xC9\xAD\xC5\xDE\xA0\0\0`$\x84\x01R```D\x84\x01R`d\x83\x01\x91\x90\x91R`\x01`\x01`\xA0\x1B\x03\x16\x90c\x94\xD0\x08\xEF\x90`\x84\x01`\0`@Q\x80\x83\x03\x81`\0\x87\x80;\x15\x80\x15a\x01.W`\0\x80\xFD[PZ\xF1\x15\x80\x15a\x01BW=`\0\x80>=`\0\xFD[PPPPPPV[\x81\x81\x03\x81\x81\x11\x15a\x01kWcNH{q`\xE0\x1B`\0R`\x11`\x04R`$`\0\xFD[\x92\x91PPV\xFE\xA2dipfsX\"\x12 `\xD3\xE6\xBA\xA0\xCF\xEC\x07I\xF4\xBE\x1A7\xD4U5\x10?U\xE1\x19\xC1\xBB\xDEvx\xD6-l\xEA._dsolcC\0\x08\x11\x003"; + /// The bytecode of the contract. + pub static TOKENFAUCET_BYTECODE: ::ethers::core::types::Bytes = + ::ethers::core::types::Bytes::from_static(__BYTECODE); + #[rustfmt::skip] + const __DEPLOYED_BYTECODE: &[u8] = b"`\x80`@R4\x80\x15a\0\x10W`\0\x80\xFD[P`\x046\x10a\0+W`\x005`\xE0\x1C\x80c\x9Fg\x8C\xCA\x14a\x000W[`\0\x80\xFD[a\08a\0:V[\0[3`\0\x90\x81R` \x81\x90R`@\x81 T\x90a\0U\x82Ba\x01JV[\x90Pb\x01Q\x80\x81\x10\x15a\0\xB9W`@QbF\x1B\xCD`\xE5\x1B\x81R` `\x04\x82\x01R`\"`$\x82\x01R\x7FCan only request tokens once dai`D\x82\x01Raly`\xF0\x1B`d\x82\x01R`\x84\x01`@Q\x80\x91\x03\x90\xFD[3`\0\x81\x81R` \x81\x90R`@\x80\x82 B\x90U`\x01T\x90Qc\x94\xD0\x08\xEF`\xE0\x1B\x81R`\x04\x81\x01\x93\x90\x93Rh65\xC9\xAD\xC5\xDE\xA0\0\0`$\x84\x01R```D\x84\x01R`d\x83\x01\x91\x90\x91R`\x01`\x01`\xA0\x1B\x03\x16\x90c\x94\xD0\x08\xEF\x90`\x84\x01`\0`@Q\x80\x83\x03\x81`\0\x87\x80;\x15\x80\x15a\x01.W`\0\x80\xFD[PZ\xF1\x15\x80\x15a\x01BW=`\0\x80>=`\0\xFD[PPPPPPV[\x81\x81\x03\x81\x81\x11\x15a\x01kWcNH{q`\xE0\x1B`\0R`\x11`\x04R`$`\0\xFD[\x92\x91PPV\xFE\xA2dipfsX\"\x12 `\xD3\xE6\xBA\xA0\xCF\xEC\x07I\xF4\xBE\x1A7\xD4U5\x10?U\xE1\x19\xC1\xBB\xDEvx\xD6-l\xEA._dsolcC\0\x08\x11\x003"; + /// The deployed bytecode of the contract. + pub static TOKENFAUCET_DEPLOYED_BYTECODE: ::ethers::core::types::Bytes = + ::ethers::core::types::Bytes::from_static(__DEPLOYED_BYTECODE); + pub struct TokenFaucet(::ethers::contract::Contract); + impl ::core::clone::Clone for TokenFaucet { + fn clone(&self) -> Self { + Self(::core::clone::Clone::clone(&self.0)) + } + } + impl ::core::ops::Deref for TokenFaucet { + type Target = ::ethers::contract::Contract; + fn deref(&self) -> &Self::Target { + &self.0 + } + } + impl ::core::ops::DerefMut for TokenFaucet { + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } + } + impl ::core::fmt::Debug for TokenFaucet { + fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { + f.debug_tuple(::core::stringify!(TokenFaucet)).field(&self.address()).finish() + } + } + impl TokenFaucet { + /// Creates a new contract instance with the specified `ethers` client at + /// `address`. The contract derefs to a `ethers::Contract` object. + pub fn new>( + address: T, + client: ::std::sync::Arc, + ) -> Self { + Self(::ethers::contract::Contract::new(address.into(), TOKENFAUCET_ABI.clone(), client)) + } + /// Constructs the general purpose `Deployer` instance based on the provided constructor + /// arguments and sends it. Returns a new instance of a deployer that returns an + /// instance of this contract after sending the transaction + /// + /// Notes: + /// - If there are no constructor arguments, you should pass `()` as the argument. + /// - The default poll duration is 7 seconds. + /// - The default number of confirmations is 1 block. + /// + /// + /// # Example + /// + /// Generate contract bindings with `abigen!` and deploy a new contract instance. + /// + /// *Note*: this requires a `bytecode` and `abi` object in the `greeter.json` artifact. + /// + /// ```ignore + /// # async fn deploy(client: ::std::sync::Arc) { + /// abigen!(Greeter, "../greeter.json"); + /// + /// let greeter_contract = Greeter::deploy(client, "Hello world!".to_string()).unwrap().send().await.unwrap(); + /// let msg = greeter_contract.greet().call().await.unwrap(); + /// # } + /// ``` + pub fn deploy( + client: ::std::sync::Arc, + constructor_args: T, + ) -> ::core::result::Result< + ::ethers::contract::builders::ContractDeployer, + ::ethers::contract::ContractError, + > { + let factory = ::ethers::contract::ContractFactory::new( + TOKENFAUCET_ABI.clone(), + TOKENFAUCET_BYTECODE.clone().into(), + client, + ); + let deployer = factory.deploy(constructor_args)?; + let deployer = ::ethers::contract::ContractDeployer::new(deployer); + Ok(deployer) + } + ///Calls the contract's `drip` (0x9f678cca) function + pub fn drip(&self) -> ::ethers::contract::builders::ContractCall { + self.0 + .method_hash([159, 103, 140, 202], ()) + .expect("method not found (this should never happen)") + } + } + impl From<::ethers::contract::Contract> for TokenFaucet { + fn from(contract: ::ethers::contract::Contract) -> Self { + Self::new(contract.address(), contract.client()) + } + } + ///Container type for all input parameters for the `drip` function with signature `drip()` and + /// selector `0x9f678cca` + #[derive( + Clone, + ::ethers::contract::EthCall, + ::ethers::contract::EthDisplay, + Default, + Debug, + PartialEq, + Eq, + Hash, + )] + #[ethcall(name = "drip", abi = "drip()")] + pub struct DripCall; +} diff --git a/messenger/src/types/token_gateway.rs b/messenger/src/types/token_gateway.rs new file mode 100644 index 000000000..612386ca1 --- /dev/null +++ b/messenger/src/types/token_gateway.rs @@ -0,0 +1,677 @@ +pub use token_gateway::*; +/// This module was auto-generated with ethers-rs Abigen. +/// More information at: +#[allow( + clippy::enum_variant_names, + clippy::too_many_arguments, + clippy::upper_case_acronyms, + clippy::type_complexity, + dead_code, + non_camel_case_types +)] +pub mod token_gateway { + pub use super::super::shared_types::*; + #[allow(deprecated)] + fn __abi() -> ::ethers::core::abi::Abi { + ::ethers::core::abi::ethabi::Contract { + constructor: ::core::option::Option::Some(::ethers::core::abi::ethabi::Constructor { + inputs: ::std::vec![::ethers::core::abi::ethabi::Param { + name: ::std::borrow::ToOwned::to_owned("_admin"), + kind: ::ethers::core::abi::ethabi::ParamType::Address, + internal_type: ::core::option::Option::Some(::std::borrow::ToOwned::to_owned( + "address" + ),), + },], + }), + functions: ::core::convert::From::from([ + ( + ::std::borrow::ToOwned::to_owned("onAccept"), + ::std::vec![::ethers::core::abi::ethabi::Function { + name: ::std::borrow::ToOwned::to_owned("onAccept"), + inputs: ::std::vec![::ethers::core::abi::ethabi::Param { + name: ::std::borrow::ToOwned::to_owned("request"), + kind: ::ethers::core::abi::ethabi::ParamType::Tuple(::std::vec![ + ::ethers::core::abi::ethabi::ParamType::Bytes, + ::ethers::core::abi::ethabi::ParamType::Bytes, + ::ethers::core::abi::ethabi::ParamType::Uint(64usize), + ::ethers::core::abi::ethabi::ParamType::Bytes, + ::ethers::core::abi::ethabi::ParamType::Bytes, + ::ethers::core::abi::ethabi::ParamType::Uint(64usize), + ::ethers::core::abi::ethabi::ParamType::Bytes, + ::ethers::core::abi::ethabi::ParamType::Uint(64usize), + ],), + internal_type: ::core::option::Option::Some( + ::std::borrow::ToOwned::to_owned("struct PostRequest"), + ), + },], + outputs: ::std::vec![], + constant: ::core::option::Option::None, + state_mutability: ::ethers::core::abi::ethabi::StateMutability::NonPayable, + },], + ), + ( + ::std::borrow::ToOwned::to_owned("onGetResponse"), + ::std::vec![::ethers::core::abi::ethabi::Function { + name: ::std::borrow::ToOwned::to_owned("onGetResponse"), + inputs: ::std::vec![::ethers::core::abi::ethabi::Param { + name: ::std::borrow::ToOwned::to_owned("response"), + kind: ::ethers::core::abi::ethabi::ParamType::Tuple(::std::vec![ + ::ethers::core::abi::ethabi::ParamType::Tuple(::std::vec![ + ::ethers::core::abi::ethabi::ParamType::Bytes, + ::ethers::core::abi::ethabi::ParamType::Bytes, + ::ethers::core::abi::ethabi::ParamType::Uint(64usize), + ::ethers::core::abi::ethabi::ParamType::Bytes, + ::ethers::core::abi::ethabi::ParamType::Uint(64usize), + ::ethers::core::abi::ethabi::ParamType::Array( + ::std::boxed::Box::new( + ::ethers::core::abi::ethabi::ParamType::Bytes, + ), + ), + ::ethers::core::abi::ethabi::ParamType::Uint(64usize), + ::ethers::core::abi::ethabi::ParamType::Uint(64usize), + ],), + ::ethers::core::abi::ethabi::ParamType::Array( + ::std::boxed::Box::new( + ::ethers::core::abi::ethabi::ParamType::Tuple(::std::vec![ + ::ethers::core::abi::ethabi::ParamType::Bytes, + ::ethers::core::abi::ethabi::ParamType::Bytes, + ],), + ), + ), + ],), + internal_type: ::core::option::Option::Some( + ::std::borrow::ToOwned::to_owned("struct GetResponse"), + ), + },], + outputs: ::std::vec![], + constant: ::core::option::Option::None, + state_mutability: ::ethers::core::abi::ethabi::StateMutability::View, + },], + ), + ( + ::std::borrow::ToOwned::to_owned("onGetTimeout"), + ::std::vec![::ethers::core::abi::ethabi::Function { + name: ::std::borrow::ToOwned::to_owned("onGetTimeout"), + inputs: ::std::vec![::ethers::core::abi::ethabi::Param { + name: ::std::borrow::ToOwned::to_owned("request"), + kind: ::ethers::core::abi::ethabi::ParamType::Tuple(::std::vec![ + ::ethers::core::abi::ethabi::ParamType::Bytes, + ::ethers::core::abi::ethabi::ParamType::Bytes, + ::ethers::core::abi::ethabi::ParamType::Uint(64usize), + ::ethers::core::abi::ethabi::ParamType::Bytes, + ::ethers::core::abi::ethabi::ParamType::Uint(64usize), + ::ethers::core::abi::ethabi::ParamType::Array( + ::std::boxed::Box::new( + ::ethers::core::abi::ethabi::ParamType::Bytes, + ), + ), + ::ethers::core::abi::ethabi::ParamType::Uint(64usize), + ::ethers::core::abi::ethabi::ParamType::Uint(64usize), + ],), + internal_type: ::core::option::Option::Some( + ::std::borrow::ToOwned::to_owned("struct GetRequest"), + ), + },], + outputs: ::std::vec![], + constant: ::core::option::Option::None, + state_mutability: ::ethers::core::abi::ethabi::StateMutability::View, + },], + ), + ( + ::std::borrow::ToOwned::to_owned("onPostResponse"), + ::std::vec![::ethers::core::abi::ethabi::Function { + name: ::std::borrow::ToOwned::to_owned("onPostResponse"), + inputs: ::std::vec![::ethers::core::abi::ethabi::Param { + name: ::std::borrow::ToOwned::to_owned("response"), + kind: ::ethers::core::abi::ethabi::ParamType::Tuple(::std::vec![ + ::ethers::core::abi::ethabi::ParamType::Tuple(::std::vec![ + ::ethers::core::abi::ethabi::ParamType::Bytes, + ::ethers::core::abi::ethabi::ParamType::Bytes, + ::ethers::core::abi::ethabi::ParamType::Uint(64usize), + ::ethers::core::abi::ethabi::ParamType::Bytes, + ::ethers::core::abi::ethabi::ParamType::Bytes, + ::ethers::core::abi::ethabi::ParamType::Uint(64usize), + ::ethers::core::abi::ethabi::ParamType::Bytes, + ::ethers::core::abi::ethabi::ParamType::Uint(64usize), + ],), + ::ethers::core::abi::ethabi::ParamType::Bytes, + ],), + internal_type: ::core::option::Option::Some( + ::std::borrow::ToOwned::to_owned("struct PostResponse"), + ), + },], + outputs: ::std::vec![], + constant: ::core::option::Option::None, + state_mutability: ::ethers::core::abi::ethabi::StateMutability::View, + },], + ), + ( + ::std::borrow::ToOwned::to_owned("onPostTimeout"), + ::std::vec![::ethers::core::abi::ethabi::Function { + name: ::std::borrow::ToOwned::to_owned("onPostTimeout"), + inputs: ::std::vec![::ethers::core::abi::ethabi::Param { + name: ::std::borrow::ToOwned::to_owned("request"), + kind: ::ethers::core::abi::ethabi::ParamType::Tuple(::std::vec![ + ::ethers::core::abi::ethabi::ParamType::Bytes, + ::ethers::core::abi::ethabi::ParamType::Bytes, + ::ethers::core::abi::ethabi::ParamType::Uint(64usize), + ::ethers::core::abi::ethabi::ParamType::Bytes, + ::ethers::core::abi::ethabi::ParamType::Bytes, + ::ethers::core::abi::ethabi::ParamType::Uint(64usize), + ::ethers::core::abi::ethabi::ParamType::Bytes, + ::ethers::core::abi::ethabi::ParamType::Uint(64usize), + ],), + internal_type: ::core::option::Option::Some( + ::std::borrow::ToOwned::to_owned("struct PostRequest"), + ), + },], + outputs: ::std::vec![], + constant: ::core::option::Option::None, + state_mutability: ::ethers::core::abi::ethabi::StateMutability::NonPayable, + },], + ), + ( + ::std::borrow::ToOwned::to_owned("send"), + ::std::vec![::ethers::core::abi::ethabi::Function { + name: ::std::borrow::ToOwned::to_owned("send"), + inputs: ::std::vec![::ethers::core::abi::ethabi::Param { + name: ::std::borrow::ToOwned::to_owned("params"), + kind: ::ethers::core::abi::ethabi::ParamType::Tuple(::std::vec![ + ::ethers::core::abi::ethabi::ParamType::Uint(256usize), + ::ethers::core::abi::ethabi::ParamType::Address, + ::ethers::core::abi::ethabi::ParamType::Bytes, + ::ethers::core::abi::ethabi::ParamType::Address, + ::ethers::core::abi::ethabi::ParamType::Uint(64usize), + ],), + internal_type: ::core::option::Option::Some( + ::std::borrow::ToOwned::to_owned("struct SendParams"), + ), + },], + outputs: ::std::vec![], + constant: ::core::option::Option::None, + state_mutability: ::ethers::core::abi::ethabi::StateMutability::NonPayable, + },], + ), + ( + ::std::borrow::ToOwned::to_owned("setIsmpHost"), + ::std::vec![::ethers::core::abi::ethabi::Function { + name: ::std::borrow::ToOwned::to_owned("setIsmpHost"), + inputs: ::std::vec![::ethers::core::abi::ethabi::Param { + name: ::std::borrow::ToOwned::to_owned("_host"), + kind: ::ethers::core::abi::ethabi::ParamType::Address, + internal_type: ::core::option::Option::Some( + ::std::borrow::ToOwned::to_owned("address"), + ), + },], + outputs: ::std::vec![], + constant: ::core::option::Option::None, + state_mutability: ::ethers::core::abi::ethabi::StateMutability::NonPayable, + },], + ), + ]), + events: ::core::convert::From::from([( + ::std::borrow::ToOwned::to_owned("AssetReceived"), + ::std::vec![::ethers::core::abi::ethabi::Event { + name: ::std::borrow::ToOwned::to_owned("AssetReceived"), + inputs: ::std::vec![ + ::ethers::core::abi::ethabi::EventParam { + name: ::std::borrow::ToOwned::to_owned("source"), + kind: ::ethers::core::abi::ethabi::ParamType::Bytes, + indexed: false, + }, + ::ethers::core::abi::ethabi::EventParam { + name: ::std::borrow::ToOwned::to_owned("nonce"), + kind: ::ethers::core::abi::ethabi::ParamType::Uint(256usize,), + indexed: false, + }, + ], + anonymous: false, + },], + )]), + errors: ::std::collections::BTreeMap::new(), + receive: false, + fallback: false, + } + } + ///The parsed JSON ABI of the contract. + pub static TOKENGATEWAY_ABI: ::ethers::contract::Lazy<::ethers::core::abi::Abi> = + ::ethers::contract::Lazy::new(__abi); + #[rustfmt::skip] + const __BYTECODE: &[u8] = b"`\x80`@R4\x80\x15a\0\x10W`\0\x80\xFD[P`@Qa\x0F@8\x03\x80a\x0F@\x839\x81\x01`@\x81\x90Ra\0/\x91a\0TV[`\x01\x80T`\x01`\x01`\xA0\x1B\x03\x19\x16`\x01`\x01`\xA0\x1B\x03\x92\x90\x92\x16\x91\x90\x91\x17\x90Ua\0\x84V[`\0` \x82\x84\x03\x12\x15a\0fW`\0\x80\xFD[\x81Q`\x01`\x01`\xA0\x1B\x03\x81\x16\x81\x14a\0}W`\0\x80\xFD[\x93\x92PPPV[a\x0E\xAD\x80a\0\x93`\09`\0\xF3\xFE`\x80`@R4\x80\x15a\0\x10W`\0\x80\xFD[P`\x046\x10a\0}W`\x005`\xE0\x1C\x80cn[j%\x11a\0[W\x80cn[j%\x14a\0\xBDW\x80c\xC5,(\xAF\x14a\0\xD0W\x80c\xC7\x15\xF5+\x14a\0\xE3W\x80c\xF3p\xFD\xBB\x14a\0\xF6W`\0\x80\xFD[\x80c\x0E\x83$\xA2\x14a\0\x82W\x80cLF\xC05\x14a\0\x97W\x80cN\x87\xBA\x19\x14a\0\xAAW[`\0\x80\xFD[a\0\x95a\0\x906`\x04a\x05\xB2V[a\x01\x04V[\0[a\0\x95a\0\xA56`\x04a\x08\xC3V[a\x01`V[a\0\x95a\0\xB86`\x04a\n\x05V[a\x01\xE2V[a\0\x95a\0\xCB6`\x04a\n9V[a\x02\xD6V[a\0\x95a\0\xDE6`\x04a\n\xE9V[a\x04eV[a\0\x95a\0\xF16`\x04a\n\x05V[a\x04\xE3V[a\0\x95a\0\xA56`\x04a\x0ByV[`\x01T`\x01`\x01`\xA0\x1B\x03\x163\x14a\x017W`@QbF\x1B\xCD`\xE5\x1B\x81R`\x04\x01a\x01.\x90a\x0C\xD6V[`@Q\x80\x91\x03\x90\xFD[`\0\x80T`\x01`\x01`\xA0\x1B\x03\x90\x92\x16`\x01`\x01`\xA0\x1B\x03\x19\x92\x83\x16\x17\x90U`\x01\x80T\x90\x91\x16\x90UV[`\0T`\x01`\x01`\xA0\x1B\x03\x163\x14a\x01\x8AW`@QbF\x1B\xCD`\xE5\x1B\x81R`\x04\x01a\x01.\x90a\x0C\xD6V[`@QbF\x1B\xCD`\xE5\x1B\x81R` `\x04\x82\x01R`'`$\x82\x01R\x7FToken gateway doesn't emit Get R`D\x82\x01Rfequests`\xC8\x1B`d\x82\x01R`\x84\x01a\x01.V[`\0T`\x01`\x01`\xA0\x1B\x03\x163\x14a\x02\x0CW`@QbF\x1B\xCD`\xE5\x1B\x81R`\x04\x01a\x01.\x90a\x0C\xD6V[`\0\x80`\0\x80\x84`\xC0\x01Q\x80` \x01\x90Q\x81\x01\x90a\x02*\x91\x90a\r\x01V[\x93P\x93P\x93P\x93P\x80`\x01`\x01`\xA0\x1B\x03\x16c\x94\xD0\x08\xEF\x84\x84`@Q\x83c\xFF\xFF\xFF\xFF\x16`\xE0\x1B\x81R`\x04\x01a\x02`\x92\x91\x90a\rVV[`\0`@Q\x80\x83\x03\x81`\0\x87\x80;\x15\x80\x15a\x02zW`\0\x80\xFD[PZ\xF1\x15\x80\x15a\x02\x8EW=`\0\x80>=`\0\xFD[PP\x86Q`@\x80\x89\x01Q\x90Q\x7F\xBF\x1D\x85n\xC8\x85\xD8\xE7}\x92`x\xE6cFe\x04s\xCF\x97-5\x81?{>\\_>\xDC\xB5\xD3\x94Pa\x02\xC7\x93Pa\r\xC4V[`@Q\x80\x91\x03\x90\xA1PPPPPV[``\x81\x01Q\x81Q`@QcD\xD1q\x87`\xE0\x1B\x81R3\x92`\x01`\x01`\xA0\x1B\x03\x16\x91cD\xD1q\x87\x91a\x03\n\x91\x85\x91`\x04\x01a\rVV[`\0`@Q\x80\x83\x03\x81`\0\x87\x80;\x15\x80\x15a\x03$W`\0\x80\xFD[PZ\xF1\x15\x80\x15a\x038W=`\0\x80>=`\0\xFD[PPP` \x80\x84\x01Q\x84Q``\x86\x01Q`@Q`\0\x95Pa\x03\x84\x94\x87\x94\x93\x92\x91\x01`\x01`\x01`\xA0\x1B\x03\x94\x85\x16\x81R\x92\x84\x16` \x84\x01R`@\x83\x01\x91\x90\x91R\x90\x91\x16``\x82\x01R`\x80\x01\x90V[`@\x80Q`\x1F\x19\x81\x84\x03\x01\x81R`\xA0\x83\x01\x82R\x85\x82\x01Q\x83R\x90Qk\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\x190``\x1B\x16` \x82\x81\x01\x91\x90\x91R\x91\x93P`\0\x92\x91\x82\x01\x90`4\x01`@\x80Q`\x1F\x19\x81\x84\x03\x01\x81R\x91\x81R\x90\x82R` \x82\x01\x85\x90R`\x80\x87\x01Q`\x01`\x01`@\x1B\x03\x16\x82\x82\x01R`\0``\x90\x92\x01\x82\x90R\x90T\x90Qc\xD2[\xCD=`\xE0\x1B\x81R\x91\x92P`\x01`\x01`\xA0\x1B\x03\x16\x90c\xD2[\xCD=\x90a\x04-\x90\x84\x90`\x04\x01a\r\xEFV[`\0`@Q\x80\x83\x03\x81`\0\x87\x80;\x15\x80\x15a\x04GW`\0\x80\xFD[PZ\xF1\x15\x80\x15a\x04[W=`\0\x80>=`\0\xFD[PPPPPPPPV[`\0T`\x01`\x01`\xA0\x1B\x03\x163\x14a\x04\x8FW`@QbF\x1B\xCD`\xE5\x1B\x81R`\x04\x01a\x01.\x90a\x0C\xD6V[`@QbF\x1B\xCD`\xE5\x1B\x81R` `\x04\x82\x01R`$\x80\x82\x01R\x7FToken gateway doesn't emit respo`D\x82\x01Rcnses`\xE0\x1B`d\x82\x01R`\x84\x01a\x01.V[`\0T`\x01`\x01`\xA0\x1B\x03\x163\x14a\x05\rW`@QbF\x1B\xCD`\xE5\x1B\x81R`\x04\x01a\x01.\x90a\x0C\xD6V[`\0\x80`\0\x80\x84`\xC0\x01Q\x80` \x01\x90Q\x81\x01\x90a\x05+\x91\x90a\r\x01V[\x93P\x93P\x93P\x93P\x80`\x01`\x01`\xA0\x1B\x03\x16c\x94\xD0\x08\xEF\x85\x84`@Q\x83c\xFF\xFF\xFF\xFF\x16`\xE0\x1B\x81R`\x04\x01a\x05a\x92\x91\x90a\rVV[`\0`@Q\x80\x83\x03\x81`\0\x87\x80;\x15\x80\x15a\x05{W`\0\x80\xFD[PZ\xF1\x15\x80\x15a\x05\x8FW=`\0\x80>=`\0\xFD[PPPPPPPPPV[`\x01`\x01`\xA0\x1B\x03\x81\x16\x81\x14a\x05\xAFW`\0\x80\xFD[PV[`\0` \x82\x84\x03\x12\x15a\x05\xC4W`\0\x80\xFD[\x815a\x05\xCF\x81a\x05\x9AV[\x93\x92PPPV[cNH{q`\xE0\x1B`\0R`A`\x04R`$`\0\xFD[`@Qa\x01\0\x81\x01`\x01`\x01`@\x1B\x03\x81\x11\x82\x82\x10\x17\x15a\x06\x0FWa\x06\x0Fa\x05\xD6V[`@R\x90V[`@Q`\xA0\x81\x01`\x01`\x01`@\x1B\x03\x81\x11\x82\x82\x10\x17\x15a\x06\x0FWa\x06\x0Fa\x05\xD6V[`@\x80Q\x90\x81\x01`\x01`\x01`@\x1B\x03\x81\x11\x82\x82\x10\x17\x15a\x06\x0FWa\x06\x0Fa\x05\xD6V[`@Q`\x1F\x82\x01`\x1F\x19\x16\x81\x01`\x01`\x01`@\x1B\x03\x81\x11\x82\x82\x10\x17\x15a\x06\x81Wa\x06\x81a\x05\xD6V[`@R\x91\x90PV[`\0\x82`\x1F\x83\x01\x12a\x06\x9AW`\0\x80\xFD[\x815`\x01`\x01`@\x1B\x03\x81\x11\x15a\x06\xB3Wa\x06\xB3a\x05\xD6V[a\x06\xC6`\x1F\x82\x01`\x1F\x19\x16` \x01a\x06YV[\x81\x81R\x84` \x83\x86\x01\x01\x11\x15a\x06\xDBW`\0\x80\xFD[\x81` \x85\x01` \x83\x017`\0\x91\x81\x01` \x01\x91\x90\x91R\x93\x92PPPV[\x805`\x01`\x01`@\x1B\x03\x81\x16\x81\x14a\x07\x0FW`\0\x80\xFD[\x91\x90PV[`\0`\x01`\x01`@\x1B\x03\x82\x11\x15a\x07-Wa\x07-a\x05\xD6V[P`\x05\x1B` \x01\x90V[`\0\x82`\x1F\x83\x01\x12a\x07HW`\0\x80\xFD[\x815` a\x07]a\x07X\x83a\x07\x14V[a\x06YV[\x82\x81R`\x05\x92\x90\x92\x1B\x84\x01\x81\x01\x91\x81\x81\x01\x90\x86\x84\x11\x15a\x07|W`\0\x80\xFD[\x82\x86\x01[\x84\x81\x10\x15a\x07\xBBW\x805`\x01`\x01`@\x1B\x03\x81\x11\x15a\x07\x9FW`\0\x80\x81\xFD[a\x07\xAD\x89\x86\x83\x8B\x01\x01a\x06\x89V[\x84RP\x91\x83\x01\x91\x83\x01a\x07\x80V[P\x96\x95PPPPPPV[`\0a\x01\0\x82\x84\x03\x12\x15a\x07\xD9W`\0\x80\xFD[a\x07\xE1a\x05\xECV[\x90P\x815`\x01`\x01`@\x1B\x03\x80\x82\x11\x15a\x07\xFAW`\0\x80\xFD[a\x08\x06\x85\x83\x86\x01a\x06\x89V[\x83R` \x84\x015\x91P\x80\x82\x11\x15a\x08\x1CW`\0\x80\xFD[a\x08(\x85\x83\x86\x01a\x06\x89V[` \x84\x01Ra\x089`@\x85\x01a\x06\xF8V[`@\x84\x01R``\x84\x015\x91P\x80\x82\x11\x15a\x08RW`\0\x80\xFD[a\x08^\x85\x83\x86\x01a\x06\x89V[``\x84\x01Ra\x08o`\x80\x85\x01a\x06\xF8V[`\x80\x84\x01R`\xA0\x84\x015\x91P\x80\x82\x11\x15a\x08\x88W`\0\x80\xFD[Pa\x08\x95\x84\x82\x85\x01a\x077V[`\xA0\x83\x01RPa\x08\xA7`\xC0\x83\x01a\x06\xF8V[`\xC0\x82\x01Ra\x08\xB8`\xE0\x83\x01a\x06\xF8V[`\xE0\x82\x01R\x92\x91PPV[`\0` \x82\x84\x03\x12\x15a\x08\xD5W`\0\x80\xFD[\x815`\x01`\x01`@\x1B\x03\x81\x11\x15a\x08\xEBW`\0\x80\xFD[a\x08\xF7\x84\x82\x85\x01a\x07\xC6V[\x94\x93PPPPV[`\0a\x01\0\x82\x84\x03\x12\x15a\t\x12W`\0\x80\xFD[a\t\x1Aa\x05\xECV[\x90P\x815`\x01`\x01`@\x1B\x03\x80\x82\x11\x15a\t3W`\0\x80\xFD[a\t?\x85\x83\x86\x01a\x06\x89V[\x83R` \x84\x015\x91P\x80\x82\x11\x15a\tUW`\0\x80\xFD[a\ta\x85\x83\x86\x01a\x06\x89V[` \x84\x01Ra\tr`@\x85\x01a\x06\xF8V[`@\x84\x01R``\x84\x015\x91P\x80\x82\x11\x15a\t\x8BW`\0\x80\xFD[a\t\x97\x85\x83\x86\x01a\x06\x89V[``\x84\x01R`\x80\x84\x015\x91P\x80\x82\x11\x15a\t\xB0W`\0\x80\xFD[a\t\xBC\x85\x83\x86\x01a\x06\x89V[`\x80\x84\x01Ra\t\xCD`\xA0\x85\x01a\x06\xF8V[`\xA0\x84\x01R`\xC0\x84\x015\x91P\x80\x82\x11\x15a\t\xE6W`\0\x80\xFD[Pa\t\xF3\x84\x82\x85\x01a\x06\x89V[`\xC0\x83\x01RPa\x08\xB8`\xE0\x83\x01a\x06\xF8V[`\0` \x82\x84\x03\x12\x15a\n\x17W`\0\x80\xFD[\x815`\x01`\x01`@\x1B\x03\x81\x11\x15a\n-W`\0\x80\xFD[a\x08\xF7\x84\x82\x85\x01a\x08\xFFV[`\0` \x82\x84\x03\x12\x15a\nKW`\0\x80\xFD[\x815`\x01`\x01`@\x1B\x03\x80\x82\x11\x15a\nbW`\0\x80\xFD[\x90\x83\x01\x90`\xA0\x82\x86\x03\x12\x15a\nvW`\0\x80\xFD[a\n~a\x06\x15V[\x825\x81R` \x83\x015a\n\x90\x81a\x05\x9AV[` \x82\x01R`@\x83\x015\x82\x81\x11\x15a\n\xA7W`\0\x80\xFD[a\n\xB3\x87\x82\x86\x01a\x06\x89V[`@\x83\x01RP``\x83\x015\x91Pa\n\xC9\x82a\x05\x9AV[\x81``\x82\x01Ra\n\xDB`\x80\x84\x01a\x06\xF8V[`\x80\x82\x01R\x95\x94PPPPPV[`\0` \x82\x84\x03\x12\x15a\n\xFBW`\0\x80\xFD[\x815`\x01`\x01`@\x1B\x03\x80\x82\x11\x15a\x0B\x12W`\0\x80\xFD[\x90\x83\x01\x90`@\x82\x86\x03\x12\x15a\x0B&W`\0\x80\xFD[a\x0B.a\x067V[\x825\x82\x81\x11\x15a\x0B=W`\0\x80\xFD[a\x0BI\x87\x82\x86\x01a\x08\xFFV[\x82RP` \x83\x015\x82\x81\x11\x15a\x0B^W`\0\x80\xFD[a\x0Bj\x87\x82\x86\x01a\x06\x89V[` \x83\x01RP\x95\x94PPPPPV[`\0` \x80\x83\x85\x03\x12\x15a\x0B\x8CW`\0\x80\xFD[\x825`\x01`\x01`@\x1B\x03\x80\x82\x11\x15a\x0B\xA3W`\0\x80\xFD[\x81\x85\x01\x91P`@\x80\x83\x88\x03\x12\x15a\x0B\xB9W`\0\x80\xFD[a\x0B\xC1a\x067V[\x835\x83\x81\x11\x15a\x0B\xD0W`\0\x80\xFD[a\x0B\xDC\x89\x82\x87\x01a\x07\xC6V[\x82RP\x84\x84\x015\x83\x81\x11\x15a\x0B\xF0W`\0\x80\xFD[\x80\x85\x01\x94PP\x87`\x1F\x85\x01\x12a\x0C\x05W`\0\x80\xFD[\x835a\x0C\x13a\x07X\x82a\x07\x14V[\x81\x81R`\x05\x91\x90\x91\x1B\x85\x01\x86\x01\x90\x86\x81\x01\x90\x8A\x83\x11\x15a\x0C2W`\0\x80\xFD[\x87\x87\x01[\x83\x81\x10\x15a\x0C\xC2W\x805\x87\x81\x11\x15a\x0CNW`\0\x80\x81\xFD[\x88\x01\x80\x8D\x03`\x1F\x19\x01\x87\x13\x15a\x0CdW`\0\x80\x81\xFD[a\x0Cla\x067V[\x8A\x82\x015\x89\x81\x11\x15a\x0C~W`\0\x80\x81\xFD[a\x0C\x8C\x8F\x8D\x83\x86\x01\x01a\x06\x89V[\x82RP\x87\x82\x015\x89\x81\x11\x15a\x0C\xA1W`\0\x80\x81\xFD[a\x0C\xAF\x8F\x8D\x83\x86\x01\x01a\x06\x89V[\x82\x8D\x01RP\x84RP\x91\x88\x01\x91\x88\x01a\x0C6V[P\x96\x83\x01\x96\x90\x96RP\x97\x96PPPPPPPV[` \x80\x82R`\x11\x90\x82\x01Rp\x15[\x98]]\x1A\x1B\xDC\x9A^\x99Y\x08\x18\xD8[\x1B`z\x1B`@\x82\x01R``\x01\x90V[`\0\x80`\0\x80`\x80\x85\x87\x03\x12\x15a\r\x17W`\0\x80\xFD[\x84Qa\r\"\x81a\x05\x9AV[` \x86\x01Q\x90\x94Pa\r3\x81a\x05\x9AV[`@\x86\x01Q``\x87\x01Q\x91\x94P\x92Pa\rK\x81a\x05\x9AV[\x93\x96\x92\x95P\x90\x93PPV[`\x01`\x01`\xA0\x1B\x03\x92\x90\x92\x16\x82R` \x82\x01R```@\x82\x01\x81\x90R`\0\x90\x82\x01R`\x80\x01\x90V[`\0\x81Q\x80\x84R`\0[\x81\x81\x10\x15a\r\xA4W` \x81\x85\x01\x81\x01Q\x86\x83\x01\x82\x01R\x01a\r\x88V[P`\0` \x82\x86\x01\x01R` `\x1F\x19`\x1F\x83\x01\x16\x85\x01\x01\x91PP\x92\x91PPV[`@\x81R`\0a\r\xD7`@\x83\x01\x85a\r~V[\x90P`\x01`\x01`@\x1B\x03\x83\x16` \x83\x01R\x93\x92PPPV[` \x81R`\0\x82Q`\xA0` \x84\x01Ra\x0E\x0B`\xC0\x84\x01\x82a\r~V[\x90P` \x84\x01Q`\x1F\x19\x80\x85\x84\x03\x01`@\x86\x01Ra\x0E)\x83\x83a\r~V[\x92P`@\x86\x01Q\x91P\x80\x85\x84\x03\x01``\x86\x01RPa\x0EG\x82\x82a\r~V[\x91PP``\x84\x01Q`\x01`\x01`@\x1B\x03\x80\x82\x16`\x80\x86\x01R\x80`\x80\x87\x01Q\x16`\xA0\x86\x01RPP\x80\x91PP\x92\x91PPV\xFE\xA2dipfsX\"\x12 l\xDC\xBE\xE8\x18\xE23Tg\"\xB5\x08\xB7db\xB9m\xA0C-T\x84\xD4y\xD24\x1B\x98A.\xE5\xCBdsolcC\0\x08\x11\x003"; + /// The bytecode of the contract. + pub static TOKENGATEWAY_BYTECODE: ::ethers::core::types::Bytes = + ::ethers::core::types::Bytes::from_static(__BYTECODE); + #[rustfmt::skip] + const __DEPLOYED_BYTECODE: &[u8] = b"`\x80`@R4\x80\x15a\0\x10W`\0\x80\xFD[P`\x046\x10a\0}W`\x005`\xE0\x1C\x80cn[j%\x11a\0[W\x80cn[j%\x14a\0\xBDW\x80c\xC5,(\xAF\x14a\0\xD0W\x80c\xC7\x15\xF5+\x14a\0\xE3W\x80c\xF3p\xFD\xBB\x14a\0\xF6W`\0\x80\xFD[\x80c\x0E\x83$\xA2\x14a\0\x82W\x80cLF\xC05\x14a\0\x97W\x80cN\x87\xBA\x19\x14a\0\xAAW[`\0\x80\xFD[a\0\x95a\0\x906`\x04a\x05\xB2V[a\x01\x04V[\0[a\0\x95a\0\xA56`\x04a\x08\xC3V[a\x01`V[a\0\x95a\0\xB86`\x04a\n\x05V[a\x01\xE2V[a\0\x95a\0\xCB6`\x04a\n9V[a\x02\xD6V[a\0\x95a\0\xDE6`\x04a\n\xE9V[a\x04eV[a\0\x95a\0\xF16`\x04a\n\x05V[a\x04\xE3V[a\0\x95a\0\xA56`\x04a\x0ByV[`\x01T`\x01`\x01`\xA0\x1B\x03\x163\x14a\x017W`@QbF\x1B\xCD`\xE5\x1B\x81R`\x04\x01a\x01.\x90a\x0C\xD6V[`@Q\x80\x91\x03\x90\xFD[`\0\x80T`\x01`\x01`\xA0\x1B\x03\x90\x92\x16`\x01`\x01`\xA0\x1B\x03\x19\x92\x83\x16\x17\x90U`\x01\x80T\x90\x91\x16\x90UV[`\0T`\x01`\x01`\xA0\x1B\x03\x163\x14a\x01\x8AW`@QbF\x1B\xCD`\xE5\x1B\x81R`\x04\x01a\x01.\x90a\x0C\xD6V[`@QbF\x1B\xCD`\xE5\x1B\x81R` `\x04\x82\x01R`'`$\x82\x01R\x7FToken gateway doesn't emit Get R`D\x82\x01Rfequests`\xC8\x1B`d\x82\x01R`\x84\x01a\x01.V[`\0T`\x01`\x01`\xA0\x1B\x03\x163\x14a\x02\x0CW`@QbF\x1B\xCD`\xE5\x1B\x81R`\x04\x01a\x01.\x90a\x0C\xD6V[`\0\x80`\0\x80\x84`\xC0\x01Q\x80` \x01\x90Q\x81\x01\x90a\x02*\x91\x90a\r\x01V[\x93P\x93P\x93P\x93P\x80`\x01`\x01`\xA0\x1B\x03\x16c\x94\xD0\x08\xEF\x84\x84`@Q\x83c\xFF\xFF\xFF\xFF\x16`\xE0\x1B\x81R`\x04\x01a\x02`\x92\x91\x90a\rVV[`\0`@Q\x80\x83\x03\x81`\0\x87\x80;\x15\x80\x15a\x02zW`\0\x80\xFD[PZ\xF1\x15\x80\x15a\x02\x8EW=`\0\x80>=`\0\xFD[PP\x86Q`@\x80\x89\x01Q\x90Q\x7F\xBF\x1D\x85n\xC8\x85\xD8\xE7}\x92`x\xE6cFe\x04s\xCF\x97-5\x81?{>\\_>\xDC\xB5\xD3\x94Pa\x02\xC7\x93Pa\r\xC4V[`@Q\x80\x91\x03\x90\xA1PPPPPV[``\x81\x01Q\x81Q`@QcD\xD1q\x87`\xE0\x1B\x81R3\x92`\x01`\x01`\xA0\x1B\x03\x16\x91cD\xD1q\x87\x91a\x03\n\x91\x85\x91`\x04\x01a\rVV[`\0`@Q\x80\x83\x03\x81`\0\x87\x80;\x15\x80\x15a\x03$W`\0\x80\xFD[PZ\xF1\x15\x80\x15a\x038W=`\0\x80>=`\0\xFD[PPP` \x80\x84\x01Q\x84Q``\x86\x01Q`@Q`\0\x95Pa\x03\x84\x94\x87\x94\x93\x92\x91\x01`\x01`\x01`\xA0\x1B\x03\x94\x85\x16\x81R\x92\x84\x16` \x84\x01R`@\x83\x01\x91\x90\x91R\x90\x91\x16``\x82\x01R`\x80\x01\x90V[`@\x80Q`\x1F\x19\x81\x84\x03\x01\x81R`\xA0\x83\x01\x82R\x85\x82\x01Q\x83R\x90Qk\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\x190``\x1B\x16` \x82\x81\x01\x91\x90\x91R\x91\x93P`\0\x92\x91\x82\x01\x90`4\x01`@\x80Q`\x1F\x19\x81\x84\x03\x01\x81R\x91\x81R\x90\x82R` \x82\x01\x85\x90R`\x80\x87\x01Q`\x01`\x01`@\x1B\x03\x16\x82\x82\x01R`\0``\x90\x92\x01\x82\x90R\x90T\x90Qc\xD2[\xCD=`\xE0\x1B\x81R\x91\x92P`\x01`\x01`\xA0\x1B\x03\x16\x90c\xD2[\xCD=\x90a\x04-\x90\x84\x90`\x04\x01a\r\xEFV[`\0`@Q\x80\x83\x03\x81`\0\x87\x80;\x15\x80\x15a\x04GW`\0\x80\xFD[PZ\xF1\x15\x80\x15a\x04[W=`\0\x80>=`\0\xFD[PPPPPPPPV[`\0T`\x01`\x01`\xA0\x1B\x03\x163\x14a\x04\x8FW`@QbF\x1B\xCD`\xE5\x1B\x81R`\x04\x01a\x01.\x90a\x0C\xD6V[`@QbF\x1B\xCD`\xE5\x1B\x81R` `\x04\x82\x01R`$\x80\x82\x01R\x7FToken gateway doesn't emit respo`D\x82\x01Rcnses`\xE0\x1B`d\x82\x01R`\x84\x01a\x01.V[`\0T`\x01`\x01`\xA0\x1B\x03\x163\x14a\x05\rW`@QbF\x1B\xCD`\xE5\x1B\x81R`\x04\x01a\x01.\x90a\x0C\xD6V[`\0\x80`\0\x80\x84`\xC0\x01Q\x80` \x01\x90Q\x81\x01\x90a\x05+\x91\x90a\r\x01V[\x93P\x93P\x93P\x93P\x80`\x01`\x01`\xA0\x1B\x03\x16c\x94\xD0\x08\xEF\x85\x84`@Q\x83c\xFF\xFF\xFF\xFF\x16`\xE0\x1B\x81R`\x04\x01a\x05a\x92\x91\x90a\rVV[`\0`@Q\x80\x83\x03\x81`\0\x87\x80;\x15\x80\x15a\x05{W`\0\x80\xFD[PZ\xF1\x15\x80\x15a\x05\x8FW=`\0\x80>=`\0\xFD[PPPPPPPPPV[`\x01`\x01`\xA0\x1B\x03\x81\x16\x81\x14a\x05\xAFW`\0\x80\xFD[PV[`\0` \x82\x84\x03\x12\x15a\x05\xC4W`\0\x80\xFD[\x815a\x05\xCF\x81a\x05\x9AV[\x93\x92PPPV[cNH{q`\xE0\x1B`\0R`A`\x04R`$`\0\xFD[`@Qa\x01\0\x81\x01`\x01`\x01`@\x1B\x03\x81\x11\x82\x82\x10\x17\x15a\x06\x0FWa\x06\x0Fa\x05\xD6V[`@R\x90V[`@Q`\xA0\x81\x01`\x01`\x01`@\x1B\x03\x81\x11\x82\x82\x10\x17\x15a\x06\x0FWa\x06\x0Fa\x05\xD6V[`@\x80Q\x90\x81\x01`\x01`\x01`@\x1B\x03\x81\x11\x82\x82\x10\x17\x15a\x06\x0FWa\x06\x0Fa\x05\xD6V[`@Q`\x1F\x82\x01`\x1F\x19\x16\x81\x01`\x01`\x01`@\x1B\x03\x81\x11\x82\x82\x10\x17\x15a\x06\x81Wa\x06\x81a\x05\xD6V[`@R\x91\x90PV[`\0\x82`\x1F\x83\x01\x12a\x06\x9AW`\0\x80\xFD[\x815`\x01`\x01`@\x1B\x03\x81\x11\x15a\x06\xB3Wa\x06\xB3a\x05\xD6V[a\x06\xC6`\x1F\x82\x01`\x1F\x19\x16` \x01a\x06YV[\x81\x81R\x84` \x83\x86\x01\x01\x11\x15a\x06\xDBW`\0\x80\xFD[\x81` \x85\x01` \x83\x017`\0\x91\x81\x01` \x01\x91\x90\x91R\x93\x92PPPV[\x805`\x01`\x01`@\x1B\x03\x81\x16\x81\x14a\x07\x0FW`\0\x80\xFD[\x91\x90PV[`\0`\x01`\x01`@\x1B\x03\x82\x11\x15a\x07-Wa\x07-a\x05\xD6V[P`\x05\x1B` \x01\x90V[`\0\x82`\x1F\x83\x01\x12a\x07HW`\0\x80\xFD[\x815` a\x07]a\x07X\x83a\x07\x14V[a\x06YV[\x82\x81R`\x05\x92\x90\x92\x1B\x84\x01\x81\x01\x91\x81\x81\x01\x90\x86\x84\x11\x15a\x07|W`\0\x80\xFD[\x82\x86\x01[\x84\x81\x10\x15a\x07\xBBW\x805`\x01`\x01`@\x1B\x03\x81\x11\x15a\x07\x9FW`\0\x80\x81\xFD[a\x07\xAD\x89\x86\x83\x8B\x01\x01a\x06\x89V[\x84RP\x91\x83\x01\x91\x83\x01a\x07\x80V[P\x96\x95PPPPPPV[`\0a\x01\0\x82\x84\x03\x12\x15a\x07\xD9W`\0\x80\xFD[a\x07\xE1a\x05\xECV[\x90P\x815`\x01`\x01`@\x1B\x03\x80\x82\x11\x15a\x07\xFAW`\0\x80\xFD[a\x08\x06\x85\x83\x86\x01a\x06\x89V[\x83R` \x84\x015\x91P\x80\x82\x11\x15a\x08\x1CW`\0\x80\xFD[a\x08(\x85\x83\x86\x01a\x06\x89V[` \x84\x01Ra\x089`@\x85\x01a\x06\xF8V[`@\x84\x01R``\x84\x015\x91P\x80\x82\x11\x15a\x08RW`\0\x80\xFD[a\x08^\x85\x83\x86\x01a\x06\x89V[``\x84\x01Ra\x08o`\x80\x85\x01a\x06\xF8V[`\x80\x84\x01R`\xA0\x84\x015\x91P\x80\x82\x11\x15a\x08\x88W`\0\x80\xFD[Pa\x08\x95\x84\x82\x85\x01a\x077V[`\xA0\x83\x01RPa\x08\xA7`\xC0\x83\x01a\x06\xF8V[`\xC0\x82\x01Ra\x08\xB8`\xE0\x83\x01a\x06\xF8V[`\xE0\x82\x01R\x92\x91PPV[`\0` \x82\x84\x03\x12\x15a\x08\xD5W`\0\x80\xFD[\x815`\x01`\x01`@\x1B\x03\x81\x11\x15a\x08\xEBW`\0\x80\xFD[a\x08\xF7\x84\x82\x85\x01a\x07\xC6V[\x94\x93PPPPV[`\0a\x01\0\x82\x84\x03\x12\x15a\t\x12W`\0\x80\xFD[a\t\x1Aa\x05\xECV[\x90P\x815`\x01`\x01`@\x1B\x03\x80\x82\x11\x15a\t3W`\0\x80\xFD[a\t?\x85\x83\x86\x01a\x06\x89V[\x83R` \x84\x015\x91P\x80\x82\x11\x15a\tUW`\0\x80\xFD[a\ta\x85\x83\x86\x01a\x06\x89V[` \x84\x01Ra\tr`@\x85\x01a\x06\xF8V[`@\x84\x01R``\x84\x015\x91P\x80\x82\x11\x15a\t\x8BW`\0\x80\xFD[a\t\x97\x85\x83\x86\x01a\x06\x89V[``\x84\x01R`\x80\x84\x015\x91P\x80\x82\x11\x15a\t\xB0W`\0\x80\xFD[a\t\xBC\x85\x83\x86\x01a\x06\x89V[`\x80\x84\x01Ra\t\xCD`\xA0\x85\x01a\x06\xF8V[`\xA0\x84\x01R`\xC0\x84\x015\x91P\x80\x82\x11\x15a\t\xE6W`\0\x80\xFD[Pa\t\xF3\x84\x82\x85\x01a\x06\x89V[`\xC0\x83\x01RPa\x08\xB8`\xE0\x83\x01a\x06\xF8V[`\0` \x82\x84\x03\x12\x15a\n\x17W`\0\x80\xFD[\x815`\x01`\x01`@\x1B\x03\x81\x11\x15a\n-W`\0\x80\xFD[a\x08\xF7\x84\x82\x85\x01a\x08\xFFV[`\0` \x82\x84\x03\x12\x15a\nKW`\0\x80\xFD[\x815`\x01`\x01`@\x1B\x03\x80\x82\x11\x15a\nbW`\0\x80\xFD[\x90\x83\x01\x90`\xA0\x82\x86\x03\x12\x15a\nvW`\0\x80\xFD[a\n~a\x06\x15V[\x825\x81R` \x83\x015a\n\x90\x81a\x05\x9AV[` \x82\x01R`@\x83\x015\x82\x81\x11\x15a\n\xA7W`\0\x80\xFD[a\n\xB3\x87\x82\x86\x01a\x06\x89V[`@\x83\x01RP``\x83\x015\x91Pa\n\xC9\x82a\x05\x9AV[\x81``\x82\x01Ra\n\xDB`\x80\x84\x01a\x06\xF8V[`\x80\x82\x01R\x95\x94PPPPPV[`\0` \x82\x84\x03\x12\x15a\n\xFBW`\0\x80\xFD[\x815`\x01`\x01`@\x1B\x03\x80\x82\x11\x15a\x0B\x12W`\0\x80\xFD[\x90\x83\x01\x90`@\x82\x86\x03\x12\x15a\x0B&W`\0\x80\xFD[a\x0B.a\x067V[\x825\x82\x81\x11\x15a\x0B=W`\0\x80\xFD[a\x0BI\x87\x82\x86\x01a\x08\xFFV[\x82RP` \x83\x015\x82\x81\x11\x15a\x0B^W`\0\x80\xFD[a\x0Bj\x87\x82\x86\x01a\x06\x89V[` \x83\x01RP\x95\x94PPPPPV[`\0` \x80\x83\x85\x03\x12\x15a\x0B\x8CW`\0\x80\xFD[\x825`\x01`\x01`@\x1B\x03\x80\x82\x11\x15a\x0B\xA3W`\0\x80\xFD[\x81\x85\x01\x91P`@\x80\x83\x88\x03\x12\x15a\x0B\xB9W`\0\x80\xFD[a\x0B\xC1a\x067V[\x835\x83\x81\x11\x15a\x0B\xD0W`\0\x80\xFD[a\x0B\xDC\x89\x82\x87\x01a\x07\xC6V[\x82RP\x84\x84\x015\x83\x81\x11\x15a\x0B\xF0W`\0\x80\xFD[\x80\x85\x01\x94PP\x87`\x1F\x85\x01\x12a\x0C\x05W`\0\x80\xFD[\x835a\x0C\x13a\x07X\x82a\x07\x14V[\x81\x81R`\x05\x91\x90\x91\x1B\x85\x01\x86\x01\x90\x86\x81\x01\x90\x8A\x83\x11\x15a\x0C2W`\0\x80\xFD[\x87\x87\x01[\x83\x81\x10\x15a\x0C\xC2W\x805\x87\x81\x11\x15a\x0CNW`\0\x80\x81\xFD[\x88\x01\x80\x8D\x03`\x1F\x19\x01\x87\x13\x15a\x0CdW`\0\x80\x81\xFD[a\x0Cla\x067V[\x8A\x82\x015\x89\x81\x11\x15a\x0C~W`\0\x80\x81\xFD[a\x0C\x8C\x8F\x8D\x83\x86\x01\x01a\x06\x89V[\x82RP\x87\x82\x015\x89\x81\x11\x15a\x0C\xA1W`\0\x80\x81\xFD[a\x0C\xAF\x8F\x8D\x83\x86\x01\x01a\x06\x89V[\x82\x8D\x01RP\x84RP\x91\x88\x01\x91\x88\x01a\x0C6V[P\x96\x83\x01\x96\x90\x96RP\x97\x96PPPPPPPV[` \x80\x82R`\x11\x90\x82\x01Rp\x15[\x98]]\x1A\x1B\xDC\x9A^\x99Y\x08\x18\xD8[\x1B`z\x1B`@\x82\x01R``\x01\x90V[`\0\x80`\0\x80`\x80\x85\x87\x03\x12\x15a\r\x17W`\0\x80\xFD[\x84Qa\r\"\x81a\x05\x9AV[` \x86\x01Q\x90\x94Pa\r3\x81a\x05\x9AV[`@\x86\x01Q``\x87\x01Q\x91\x94P\x92Pa\rK\x81a\x05\x9AV[\x93\x96\x92\x95P\x90\x93PPV[`\x01`\x01`\xA0\x1B\x03\x92\x90\x92\x16\x82R` \x82\x01R```@\x82\x01\x81\x90R`\0\x90\x82\x01R`\x80\x01\x90V[`\0\x81Q\x80\x84R`\0[\x81\x81\x10\x15a\r\xA4W` \x81\x85\x01\x81\x01Q\x86\x83\x01\x82\x01R\x01a\r\x88V[P`\0` \x82\x86\x01\x01R` `\x1F\x19`\x1F\x83\x01\x16\x85\x01\x01\x91PP\x92\x91PPV[`@\x81R`\0a\r\xD7`@\x83\x01\x85a\r~V[\x90P`\x01`\x01`@\x1B\x03\x83\x16` \x83\x01R\x93\x92PPPV[` \x81R`\0\x82Q`\xA0` \x84\x01Ra\x0E\x0B`\xC0\x84\x01\x82a\r~V[\x90P` \x84\x01Q`\x1F\x19\x80\x85\x84\x03\x01`@\x86\x01Ra\x0E)\x83\x83a\r~V[\x92P`@\x86\x01Q\x91P\x80\x85\x84\x03\x01``\x86\x01RPa\x0EG\x82\x82a\r~V[\x91PP``\x84\x01Q`\x01`\x01`@\x1B\x03\x80\x82\x16`\x80\x86\x01R\x80`\x80\x87\x01Q\x16`\xA0\x86\x01RPP\x80\x91PP\x92\x91PPV\xFE\xA2dipfsX\"\x12 l\xDC\xBE\xE8\x18\xE23Tg\"\xB5\x08\xB7db\xB9m\xA0C-T\x84\xD4y\xD24\x1B\x98A.\xE5\xCBdsolcC\0\x08\x11\x003"; + /// The deployed bytecode of the contract. + pub static TOKENGATEWAY_DEPLOYED_BYTECODE: ::ethers::core::types::Bytes = + ::ethers::core::types::Bytes::from_static(__DEPLOYED_BYTECODE); + pub struct TokenGateway(::ethers::contract::Contract); + impl ::core::clone::Clone for TokenGateway { + fn clone(&self) -> Self { + Self(::core::clone::Clone::clone(&self.0)) + } + } + impl ::core::ops::Deref for TokenGateway { + type Target = ::ethers::contract::Contract; + fn deref(&self) -> &Self::Target { + &self.0 + } + } + impl ::core::ops::DerefMut for TokenGateway { + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } + } + impl ::core::fmt::Debug for TokenGateway { + fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { + f.debug_tuple(::core::stringify!(TokenGateway)).field(&self.address()).finish() + } + } + impl TokenGateway { + /// Creates a new contract instance with the specified `ethers` client at + /// `address`. The contract derefs to a `ethers::Contract` object. + pub fn new>( + address: T, + client: ::std::sync::Arc, + ) -> Self { + Self(::ethers::contract::Contract::new( + address.into(), + TOKENGATEWAY_ABI.clone(), + client, + )) + } + /// Constructs the general purpose `Deployer` instance based on the provided constructor + /// arguments and sends it. Returns a new instance of a deployer that returns an + /// instance of this contract after sending the transaction + /// + /// Notes: + /// - If there are no constructor arguments, you should pass `()` as the argument. + /// - The default poll duration is 7 seconds. + /// - The default number of confirmations is 1 block. + /// + /// + /// # Example + /// + /// Generate contract bindings with `abigen!` and deploy a new contract instance. + /// + /// *Note*: this requires a `bytecode` and `abi` object in the `greeter.json` artifact. + /// + /// ```ignore + /// # async fn deploy(client: ::std::sync::Arc) { + /// abigen!(Greeter, "../greeter.json"); + /// + /// let greeter_contract = Greeter::deploy(client, "Hello world!".to_string()).unwrap().send().await.unwrap(); + /// let msg = greeter_contract.greet().call().await.unwrap(); + /// # } + /// ``` + pub fn deploy( + client: ::std::sync::Arc, + constructor_args: T, + ) -> ::core::result::Result< + ::ethers::contract::builders::ContractDeployer, + ::ethers::contract::ContractError, + > { + let factory = ::ethers::contract::ContractFactory::new( + TOKENGATEWAY_ABI.clone(), + TOKENGATEWAY_BYTECODE.clone().into(), + client, + ); + let deployer = factory.deploy(constructor_args)?; + let deployer = ::ethers::contract::ContractDeployer::new(deployer); + Ok(deployer) + } + ///Calls the contract's `onAccept` (0x4e87ba19) function + pub fn on_accept( + &self, + request: PostRequest, + ) -> ::ethers::contract::builders::ContractCall { + self.0 + .method_hash([78, 135, 186, 25], (request,)) + .expect("method not found (this should never happen)") + } + ///Calls the contract's `onGetResponse` (0xf370fdbb) function + pub fn on_get_response( + &self, + response: GetResponse, + ) -> ::ethers::contract::builders::ContractCall { + self.0 + .method_hash([243, 112, 253, 187], (response,)) + .expect("method not found (this should never happen)") + } + ///Calls the contract's `onGetTimeout` (0x4c46c035) function + pub fn on_get_timeout( + &self, + request: GetRequest, + ) -> ::ethers::contract::builders::ContractCall { + self.0 + .method_hash([76, 70, 192, 53], (request,)) + .expect("method not found (this should never happen)") + } + ///Calls the contract's `onPostResponse` (0xc52c28af) function + pub fn on_post_response( + &self, + response: PostResponse, + ) -> ::ethers::contract::builders::ContractCall { + self.0 + .method_hash([197, 44, 40, 175], (response,)) + .expect("method not found (this should never happen)") + } + ///Calls the contract's `onPostTimeout` (0xc715f52b) function + pub fn on_post_timeout( + &self, + request: PostRequest, + ) -> ::ethers::contract::builders::ContractCall { + self.0 + .method_hash([199, 21, 245, 43], (request,)) + .expect("method not found (this should never happen)") + } + ///Calls the contract's `send` (0x6e5b6a25) function + pub fn send( + &self, + params: SendParams, + ) -> ::ethers::contract::builders::ContractCall { + self.0 + .method_hash([110, 91, 106, 37], (params,)) + .expect("method not found (this should never happen)") + } + ///Calls the contract's `setIsmpHost` (0x0e8324a2) function + pub fn set_ismp_host( + &self, + host: ::ethers::core::types::Address, + ) -> ::ethers::contract::builders::ContractCall { + self.0 + .method_hash([14, 131, 36, 162], host) + .expect("method not found (this should never happen)") + } + ///Gets the contract's `AssetReceived` event + pub fn asset_received_filter( + &self, + ) -> ::ethers::contract::builders::Event<::std::sync::Arc, M, AssetReceivedFilter> + { + self.0.event() + } + /// Returns an `Event` builder for all the events of this contract. + pub fn events( + &self, + ) -> ::ethers::contract::builders::Event<::std::sync::Arc, M, AssetReceivedFilter> + { + self.0.event_with_filter(::core::default::Default::default()) + } + } + impl From<::ethers::contract::Contract> for TokenGateway { + fn from(contract: ::ethers::contract::Contract) -> Self { + Self::new(contract.address(), contract.client()) + } + } + #[derive( + Clone, + ::ethers::contract::EthEvent, + ::ethers::contract::EthDisplay, + Default, + Debug, + PartialEq, + Eq, + Hash, + )] + #[ethevent(name = "AssetReceived", abi = "AssetReceived(bytes,uint256)")] + pub struct AssetReceivedFilter { + pub source: ::ethers::core::types::Bytes, + pub nonce: ::ethers::core::types::U256, + } + ///Container type for all input parameters for the `onAccept` function with signature + /// `onAccept((bytes,bytes,uint64,bytes,bytes,uint64,bytes,uint64))` and selector `0x4e87ba19` + #[derive( + Clone, + ::ethers::contract::EthCall, + ::ethers::contract::EthDisplay, + Default, + Debug, + PartialEq, + Eq, + Hash, + )] + #[ethcall( + name = "onAccept", + abi = "onAccept((bytes,bytes,uint64,bytes,bytes,uint64,bytes,uint64))" + )] + pub struct OnAcceptCall { + pub request: PostRequest, + } + ///Container type for all input parameters for the `onGetResponse` function with signature + /// `onGetResponse(((bytes,bytes,uint64,bytes,uint64,bytes[],uint64,uint64),(bytes,bytes)[]))` + /// and selector `0xf370fdbb` + #[derive( + Clone, + ::ethers::contract::EthCall, + ::ethers::contract::EthDisplay, + Default, + Debug, + PartialEq, + Eq, + Hash, + )] + #[ethcall( + name = "onGetResponse", + abi = "onGetResponse(((bytes,bytes,uint64,bytes,uint64,bytes[],uint64,uint64),(bytes,bytes)[]))" + )] + pub struct OnGetResponseCall { + pub response: GetResponse, + } + ///Container type for all input parameters for the `onGetTimeout` function with signature + /// `onGetTimeout((bytes,bytes,uint64,bytes,uint64,bytes[],uint64,uint64))` and selector + /// `0x4c46c035` + #[derive( + Clone, + ::ethers::contract::EthCall, + ::ethers::contract::EthDisplay, + Default, + Debug, + PartialEq, + Eq, + Hash, + )] + #[ethcall( + name = "onGetTimeout", + abi = "onGetTimeout((bytes,bytes,uint64,bytes,uint64,bytes[],uint64,uint64))" + )] + pub struct OnGetTimeoutCall { + pub request: GetRequest, + } + ///Container type for all input parameters for the `onPostResponse` function with signature + /// `onPostResponse(((bytes,bytes,uint64,bytes,bytes,uint64,bytes,uint64),bytes))` and selector + /// `0xc52c28af` + #[derive( + Clone, + ::ethers::contract::EthCall, + ::ethers::contract::EthDisplay, + Default, + Debug, + PartialEq, + Eq, + Hash, + )] + #[ethcall( + name = "onPostResponse", + abi = "onPostResponse(((bytes,bytes,uint64,bytes,bytes,uint64,bytes,uint64),bytes))" + )] + pub struct OnPostResponseCall { + pub response: PostResponse, + } + ///Container type for all input parameters for the `onPostTimeout` function with signature + /// `onPostTimeout((bytes,bytes,uint64,bytes,bytes,uint64,bytes,uint64))` and selector + /// `0xc715f52b` + #[derive( + Clone, + ::ethers::contract::EthCall, + ::ethers::contract::EthDisplay, + Default, + Debug, + PartialEq, + Eq, + Hash, + )] + #[ethcall( + name = "onPostTimeout", + abi = "onPostTimeout((bytes,bytes,uint64,bytes,bytes,uint64,bytes,uint64))" + )] + pub struct OnPostTimeoutCall { + pub request: PostRequest, + } + ///Container type for all input parameters for the `send` function with signature + /// `send((uint256,address,bytes,address,uint64))` and selector `0x6e5b6a25` + #[derive( + Clone, + ::ethers::contract::EthCall, + ::ethers::contract::EthDisplay, + Default, + Debug, + PartialEq, + Eq, + Hash, + )] + #[ethcall(name = "send", abi = "send((uint256,address,bytes,address,uint64))")] + pub struct SendCall { + pub params: SendParams, + } + ///Container type for all input parameters for the `setIsmpHost` function with signature + /// `setIsmpHost(address)` and selector `0x0e8324a2` + #[derive( + Clone, + ::ethers::contract::EthCall, + ::ethers::contract::EthDisplay, + Default, + Debug, + PartialEq, + Eq, + Hash, + )] + #[ethcall(name = "setIsmpHost", abi = "setIsmpHost(address)")] + pub struct SetIsmpHostCall { + pub host: ::ethers::core::types::Address, + } + ///Container type for all of the contract's call + #[derive(Clone, ::ethers::contract::EthAbiType, Debug, PartialEq, Eq, Hash)] + pub enum TokenGatewayCalls { + OnAccept(OnAcceptCall), + OnGetResponse(OnGetResponseCall), + OnGetTimeout(OnGetTimeoutCall), + OnPostResponse(OnPostResponseCall), + OnPostTimeout(OnPostTimeoutCall), + Send(SendCall), + SetIsmpHost(SetIsmpHostCall), + } + impl ::ethers::core::abi::AbiDecode for TokenGatewayCalls { + fn decode( + data: impl AsRef<[u8]>, + ) -> ::core::result::Result { + let data = data.as_ref(); + if let Ok(decoded) = ::decode(data) { + return Ok(Self::OnAccept(decoded)) + } + if let Ok(decoded) = ::decode(data) + { + return Ok(Self::OnGetResponse(decoded)) + } + if let Ok(decoded) = ::decode(data) + { + return Ok(Self::OnGetTimeout(decoded)) + } + if let Ok(decoded) = + ::decode(data) + { + return Ok(Self::OnPostResponse(decoded)) + } + if let Ok(decoded) = ::decode(data) + { + return Ok(Self::OnPostTimeout(decoded)) + } + if let Ok(decoded) = ::decode(data) { + return Ok(Self::Send(decoded)) + } + if let Ok(decoded) = ::decode(data) { + return Ok(Self::SetIsmpHost(decoded)) + } + Err(::ethers::core::abi::Error::InvalidData.into()) + } + } + impl ::ethers::core::abi::AbiEncode for TokenGatewayCalls { + fn encode(self) -> Vec { + match self { + Self::OnAccept(element) => ::ethers::core::abi::AbiEncode::encode(element), + Self::OnGetResponse(element) => ::ethers::core::abi::AbiEncode::encode(element), + Self::OnGetTimeout(element) => ::ethers::core::abi::AbiEncode::encode(element), + Self::OnPostResponse(element) => ::ethers::core::abi::AbiEncode::encode(element), + Self::OnPostTimeout(element) => ::ethers::core::abi::AbiEncode::encode(element), + Self::Send(element) => ::ethers::core::abi::AbiEncode::encode(element), + Self::SetIsmpHost(element) => ::ethers::core::abi::AbiEncode::encode(element), + } + } + } + impl ::core::fmt::Display for TokenGatewayCalls { + fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { + match self { + Self::OnAccept(element) => ::core::fmt::Display::fmt(element, f), + Self::OnGetResponse(element) => ::core::fmt::Display::fmt(element, f), + Self::OnGetTimeout(element) => ::core::fmt::Display::fmt(element, f), + Self::OnPostResponse(element) => ::core::fmt::Display::fmt(element, f), + Self::OnPostTimeout(element) => ::core::fmt::Display::fmt(element, f), + Self::Send(element) => ::core::fmt::Display::fmt(element, f), + Self::SetIsmpHost(element) => ::core::fmt::Display::fmt(element, f), + } + } + } + impl ::core::convert::From for TokenGatewayCalls { + fn from(value: OnAcceptCall) -> Self { + Self::OnAccept(value) + } + } + impl ::core::convert::From for TokenGatewayCalls { + fn from(value: OnGetResponseCall) -> Self { + Self::OnGetResponse(value) + } + } + impl ::core::convert::From for TokenGatewayCalls { + fn from(value: OnGetTimeoutCall) -> Self { + Self::OnGetTimeout(value) + } + } + impl ::core::convert::From for TokenGatewayCalls { + fn from(value: OnPostResponseCall) -> Self { + Self::OnPostResponse(value) + } + } + impl ::core::convert::From for TokenGatewayCalls { + fn from(value: OnPostTimeoutCall) -> Self { + Self::OnPostTimeout(value) + } + } + impl ::core::convert::From for TokenGatewayCalls { + fn from(value: SendCall) -> Self { + Self::Send(value) + } + } + impl ::core::convert::From for TokenGatewayCalls { + fn from(value: SetIsmpHostCall) -> Self { + Self::SetIsmpHost(value) + } + } + ///`SendParams(uint256,address,bytes,address,uint64)` + #[derive( + Clone, + ::ethers::contract::EthAbiType, + ::ethers::contract::EthAbiCodec, + Default, + Debug, + PartialEq, + Eq, + Hash, + )] + pub struct SendParams { + pub amount: ::ethers::core::types::U256, + pub to: ::ethers::core::types::Address, + pub dest: ::ethers::core::types::Bytes, + pub token_contract: ::ethers::core::types::Address, + pub timeout: u64, + } +}