Skip to content

Commit

Permalink
Handle webb tokens (#415)
Browse files Browse the repository at this point in the history
* support webbAlpha

* use VAnchor contract

* handle webbtTNT-standalone

* trigger actions

* Add webbStandalone
  • Loading branch information
salman01zp authored Apr 6, 2023
1 parent d044474 commit 37a82a9
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions crates/tx-relay/src/evm/fees.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ use std::collections::HashMap;
use std::ops::Add;
use std::sync::{Arc, Mutex};
use webb::evm::contract::protocol_solidity::{
FungibleTokenWrapperContract, OpenVAnchorContract,
FungibleTokenWrapperContract, VAnchorContract,
};
use webb::evm::ethers::middleware::gas_oracle::GasOracle;
use webb::evm::ethers::prelude::U256;
Expand Down Expand Up @@ -224,14 +224,17 @@ async fn get_wrapped_token_name_and_decimals(
let provider = ctx.evm_provider(&chain_name).await?;
let client = Arc::new(provider);

let anchor_contract = OpenVAnchorContract::new(vanchor, client.clone());
let anchor_contract = VAnchorContract::new(vanchor, client.clone());
let token_address = anchor_contract.token().call().await?;
let token_contract =
FungibleTokenWrapperContract::new(token_address, client.clone());
let token_symbol = token_contract.symbol().call().await?;
// TODO: add all supported tokens
let name = match token_symbol.replace("webb", "").as_str() {
"WETH" => "ethereum",
"Alpha" => "ethereum",
"Standalone" => "ethereum",
"tTNT-standalone" => "tTNT",
// only used in tests
"WEBB" if cfg!(debug_assertions) => "ethereum",
x => x,
Expand Down

0 comments on commit 37a82a9

Please sign in to comment.