Skip to content

Commit

Permalink
Add support for TangleEVMTestnet(4006) (#22)
Browse files Browse the repository at this point in the history
  • Loading branch information
shekohex authored Aug 8, 2023
1 parent 8c028ac commit 16acaf6
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 18 deletions.
33 changes: 17 additions & 16 deletions chainIdFaucetToken.json
Original file line number Diff line number Diff line change
@@ -1,18 +1,19 @@
{
"1": "",
"3": "",
"5": "",
"10": "",
"42": "",
"137": "",
"420": "",
"42161": "",
"43113": "",
"43114": "",
"80001": "",
"421613": "",
"11155111": "",
"3884533461": "0x631f0dAfEC5ECd9391FAA65830Cb19fD7e156EE8",
"3884533462": "0x631f0dAfEC5ECd9391FAA65830Cb19fD7e156EE8",
"3884533463": "0x631f0dAfEC5ECd9391FAA65830Cb19fD7e156EE8"
"1": "",
"3": "",
"5": "",
"10": "",
"42": "",
"137": "",
"420": "",
"42161": "",
"43113": "",
"43114": "",
"80001": "",
"421613": "",
"11155111": "",
"3884533461": "0x7F07E8FF927DA7a900f1876Be7FE87Eb61cCeF6F",
"3884533462": "0x7F07E8FF927DA7a900f1876Be7FE87Eb61cCeF6F",
"3884533463": "0x7F07E8FF927DA7a900f1876Be7FE87Eb61cCeF6F",
"4006": "0x7F07E8FF927DA7a900f1876Be7FE87Eb61cCeF6F"
}
3 changes: 3 additions & 0 deletions chainIdRpcs.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,5 +55,8 @@
],
"3884533463": [
"https://demeter-testnet.webb.tools"
],
"4006": [
"https://tangle-standalone-archive.webb.tools"
]
}
15 changes: 13 additions & 2 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -77,12 +77,18 @@ const fn default_verify_following_webb() -> bool {

#[derive(Deserialize)]
pub struct AppConfig {
/// The database to use for the auth and claims
db: PathBuf,
/// The mnemonic to use for the faucet
mnemonic: String,
/// The amount of time to wait between claims
/// This is to prevent users from spamming the faucet
#[serde(default = "default_time_to_wait_between_claims")]
pub time_to_wait_between_claims: std::time::Duration,
/// The amount of ERC20 tokens to send to the user
#[serde(default = "default_token_amount")]
pub token_amount: u64,
/// The amount of native tokens to send to the user
#[serde(default = "default_native_token_amount")]
pub native_token_amount: f64,
/// Whether to verify that the user is following the webb twitter account
Expand Down Expand Up @@ -147,8 +153,13 @@ fn ethers_providers_firing() -> impl Fairing {
.state::<AppConfig>()
{
Some(config) => {
let networks =
vec![Network::Athena, Network::Hermes, Network::Demeter];
// Supported networks
let networks = vec![
Network::Athena,
Network::Hermes,
Network::Demeter,
Network::TangleEVMTestnet,
];

let mnemonic: String = config.mnemonic.parse().unwrap();
let wallet = match MnemonicBuilder::<English>::default()
Expand Down
5 changes: 5 additions & 0 deletions src/txes/networks.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ pub enum Network {
Hermes,
Athena,
Demeter,
TangleEVMTestnet,

// Substrate
Tangle,
Expand All @@ -31,6 +32,7 @@ impl Network {
"hermes" => Some(Self::Hermes),
"athena" => Some(Self::Athena),
"demeter" => Some(Self::Demeter),
"tangle-evm-testnet" => Some(Self::TangleEVMTestnet),
_ => None,
}
}
Expand All @@ -48,6 +50,7 @@ impl Network {
3884533461 => Some(Self::Athena),
3884533462 => Some(Self::Hermes),
3884533463 => Some(Self::Demeter),
4006 => Some(Self::TangleEVMTestnet),
_ => None,
}
}
Expand All @@ -65,6 +68,7 @@ impl Network {
Self::Athena => Some(3884533461),
Self::Hermes => Some(3884533462),
Self::Demeter => Some(3884533463),
Self::TangleEVMTestnet => Some(4006),
_ => None,
}
}
Expand Down Expand Up @@ -101,6 +105,7 @@ impl Network {
Self::ArbitrumGoerli => Some(TypedChainId::Evm(421613)),
Self::Athena => Some(TypedChainId::Evm(3884533461)),
Self::Demeter => Some(TypedChainId::Evm(3884533463)),
Self::TangleEVMTestnet => Some(TypedChainId::Evm(4006)),
Self::Goerli => Some(TypedChainId::Evm(5)),
Self::Hermes => Some(TypedChainId::Evm(3884533462)),
Self::MoonbaseAlpha => Some(TypedChainId::Evm(1287)),
Expand Down

0 comments on commit 16acaf6

Please sign in to comment.