diff --git a/src/evm/onchain/endpoints.rs b/src/evm/onchain/endpoints.rs index 27608d3c..0478d5af 100644 --- a/src/evm/onchain/endpoints.rs +++ b/src/evm/onchain/endpoints.rs @@ -52,6 +52,7 @@ pub enum Chain { LINEA, LOCAL, IOTEX, + SCROLL, } pub trait PriceOracle: Debug { @@ -85,6 +86,7 @@ impl FromStr for Chain { "linea" => Ok(Self::LINEA), "local" => Ok(Self::LOCAL), "iotex" => Ok(Self::IOTEX), + "scroll" => Ok(Self::SCROLL), _ => Err(()), } } @@ -201,6 +203,7 @@ impl Chain { Chain::LINEA => "linea", Chain::LOCAL => "local", Chain::IOTEX => "iotex", + Chain::SCROLL => "scroll", } .to_string() } @@ -229,6 +232,7 @@ impl Chain { Chain::BLAST => "https://rpc.ankr.com/blast", Chain::LINEA => "https://rpc.ankr.com/linea", Chain::IOTEX => "https://rpc.ankr.com/iotex", + Chain::SCROLL => "https://rpc.ankr.com/scroll", Chain::LOCAL => "http://localhost:8545", } .to_string() @@ -256,6 +260,7 @@ impl Chain { Chain::LINEA => "https://api.lineascan.build/api", Chain::LOCAL => "http://localhost:8080/abi/", Chain::IOTEX => "https://babel-api.mainnet.IoTeX.io", + Chain::SCROLL => "https://api.scrollscan.com/api", } .to_string() } @@ -383,10 +388,9 @@ impl ChainConfig for OnChainConfig { let pegged_token = self.get_pegged_token(); match self.chain_name.as_str() { - "eth" => return pegged_token.get("WETH").unwrap().to_string(), + "eth" | "arbitrum" | "scroll" => return pegged_token.get("WETH").unwrap().to_string(), "bsc" => return pegged_token.get("WBNB").unwrap().to_string(), "polygon" => return pegged_token.get("WMATIC").unwrap().to_string(), - "arbitrum" => return pegged_token.get("WETH").unwrap().to_string(), "local" => return pegged_token.get("ZERO").unwrap().to_string(), // "mumbai" => panic!("Not supported"), _ => { @@ -445,6 +449,16 @@ impl ChainConfig for OnChainConfig { .iter() .map(|(k, v)| (k.to_string(), v.to_string())) .collect(), + "scroll" => [ + ("WETH", "0x5300000000000000000000000000000000000004"), + ("WBTC", "0x3C1BCa5a656e69edCD0D4E36BEbb3FcDAcA60Cf1"), + ("USDT", "0xf55BEC9cafDbE8730f096Aa55dad6D22d44099Df"), + ("USDC", "0x06eFdBFf2a14a7c8E15944D1F4A48F9F95F663A4"), + ("DAI", "0xcA77eB3fEFe3725Dc33bccB54eDEFc3D9f764f97"), + ] + .iter() + .map(|(k, v)| (k.to_string(), v.to_string())) + .collect(), "local" => [("ZERO", "0x0000000000000000000000000000000000000000")] .iter() .map(|(k, v)| (k.to_string(), v.to_string()))