Skip to content

Commit

Permalink
feat(e2e): transfer erc20 token from starknet to cosmos and back (#176)
Browse files Browse the repository at this point in the history
* create erc20 token on starknet

* topup starknet wallet b with native erc20

* approve ics20 contract to spend on behalf of starknet relayer

* ibc transfer packet data for starknet

* ibc transfer send message for starknet

* submit ibc transfer message on starknet

* build starknet packet for cosmos

* relay packet to cosmos

* query and assert balances

* send the ibc token from cosmos to starknet

* query and assert balances

* refactor

* fix packet conversion

* consistent PrefixedCoin conversion

* use genesis erc20 token

* query starknet chain timestamp

* rm redundant todo comment
  • Loading branch information
rnbguy authored Jan 10, 2025
1 parent c13b888 commit e64a8ec
Show file tree
Hide file tree
Showing 2 changed files with 281 additions and 27 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -267,6 +267,18 @@ where

let trace_path: Vec<DummyTracePath> = serde_json::from_str(&trace_path_json).unwrap();

let denom_string = ibc_ics20_packet_data
.token
.denom
.base_denom
.as_str()
.to_string();

let base_denom = denom_string
.parse()
.map(Denom::Native)
.unwrap_or_else(|_| Denom::Hosted(denom_string));

let denom = PrefixedDenom {
trace_path: trace_path
.into_iter()
Expand All @@ -280,14 +292,7 @@ where
},
)
.collect(),
base: Denom::Hosted(
ibc_ics20_packet_data
.token
.denom
.base_denom
.as_str()
.to_string(),
),
base: base_denom,
};

let amount = {
Expand Down
Loading

0 comments on commit e64a8ec

Please sign in to comment.