-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(example): add interchain-token-service (#149)
Co-authored-by: Milap Sheth <[email protected]>
- Loading branch information
1 parent
d753e51
commit b7784a7
Showing
16 changed files
with
430 additions
and
92 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,34 @@ | ||
use soroban_sdk::{Bytes, Env, String, Symbol}; | ||
use soroban_sdk::{Address, Bytes, BytesN, String}; | ||
use stellar_axelar_std::IntoEvent; | ||
|
||
pub fn executed( | ||
env: &Env, | ||
source_chain: String, | ||
message_id: String, | ||
source_address: String, | ||
payload: Bytes, | ||
) { | ||
let topics = ( | ||
Symbol::new(env, "executed"), | ||
source_chain, | ||
message_id, | ||
source_address, | ||
); | ||
env.events().publish(topics, (payload,)); | ||
#[derive(Debug, PartialEq, Eq, IntoEvent)] | ||
pub struct ExecutedEvent { | ||
pub source_chain: String, | ||
pub message_id: String, | ||
pub source_address: String, | ||
#[data] | ||
pub payload: Bytes, | ||
} | ||
|
||
#[derive(Debug, PartialEq, Eq, IntoEvent)] | ||
pub struct TokenReceivedEvent { | ||
pub source_chain: String, | ||
pub message_id: String, | ||
pub source_address: Bytes, | ||
pub token_id: BytesN<32>, | ||
pub token_address: Address, | ||
pub amount: i128, | ||
#[data] | ||
pub payload: Bytes, | ||
} | ||
|
||
#[derive(Debug, PartialEq, Eq, IntoEvent)] | ||
pub struct TokenSentEvent { | ||
pub sender: Address, | ||
pub token_id: BytesN<32>, | ||
pub destination_chain: String, | ||
pub destination_app_contract: Bytes, | ||
pub amount: i128, | ||
#[data] | ||
pub recipient: Option<Bytes>, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,10 @@ | ||
#![no_std] | ||
|
||
#[cfg(any(test, feature = "testutils"))] | ||
extern crate std; | ||
|
||
mod contract; | ||
mod event; | ||
pub mod event; | ||
mod storage_types; | ||
|
||
pub use contract::{Example, ExampleClient}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,4 +5,5 @@ use soroban_sdk::contracttype; | |
pub enum DataKey { | ||
Gateway, | ||
GasService, | ||
InterchainTokenService, | ||
} |
Oops, something went wrong.