From 783712be5d8dae626c735193416ba03701d3a616 Mon Sep 17 00:00:00 2001 From: TAMARA LIPOWSKI Date: Thu, 20 Mar 2025 11:26:18 -0400 Subject: [PATCH] feat: Set v2/v3 executor addresses on ethereum - Also fix router address env name in readme --- config/executor_addresses.json | 3 +++ foundry/scripts/README.md | 2 +- foundry/scripts/deploy-executors.js | 2 +- src/encoding/evm/swap_encoder/builder.rs | 3 +++ 4 files changed, 8 insertions(+), 2 deletions(-) diff --git a/config/executor_addresses.json b/config/executor_addresses.json index d7c9d89..941ce27 100644 --- a/config/executor_addresses.json +++ b/config/executor_addresses.json @@ -1,7 +1,10 @@ { "ethereum": { "uniswap_v2": "0xf6c5be66FFf9DC69962d73da0A617a827c382329", + "sushiswap_v2": "0x8ABd4075cF54E0A9C52D18e6951b969AF3249cF9", + "pancakeswap_v2": "0x9fC9e63cCf5F773A8bC79DcfA38c581B0DEa1d11", "uniswap_v3": "0xdD8559c917393FC8DD2b4dD289c52Ff445fDE1B0", + "pancakeswap_v3": "0x455b57440465139482E9E0ED9DC308d7BA6A8515", "uniswap_v4": "0x042C0ebBEAb9d9987c2f64Ee05f2B3aeB86eAf70", "vm:balancer_v2": "0x00BE8EfAE40219Ff76287b0F9b9e497942f5BC91" }, diff --git a/foundry/scripts/README.md b/foundry/scripts/README.md index aba7fcb..15fb38d 100644 --- a/foundry/scripts/README.md +++ b/foundry/scripts/README.md @@ -38,7 +38,7 @@ For each of the following, you must select one of `tenderly_ethereum`, `tenderly 1. Deploy router: `npx hardhat run scripts/deploy-router.js --network NETWORK` 2. Define the accounts to grant roles to in `scripts/roles.json` -3. Export the router address to the environment variable `export ROUTER=` +3. Export the router address to the environment variable `export ROUTER_ADDRESS=` 4. Grant roles: `npx hardhat run scripts/set-roles.js --network NETWORK` 5. Set executors: `npx hardhat run scripts/set-executors.js --network NETWORK`. Make sure you change the DEPLOY_WALLET to the executor deployer wallet. If you need to deploy executors, follow the instructions below. diff --git a/foundry/scripts/deploy-executors.js b/foundry/scripts/deploy-executors.js index 8459123..83ec42e 100644 --- a/foundry/scripts/deploy-executors.js +++ b/foundry/scripts/deploy-executors.js @@ -27,7 +27,7 @@ const executors_to_deploy = { ]}, // PANCAKESWAP V3 - Args: Deployer, Pool Init Code Hash {exchange: "UniswapV3Executor", args: [ - "0x41ff9AA7e16B8B1a8a8dc4f0eFacd93D02d071c9 ", + "0x41ff9AA7e16B8B1a8a8dc4f0eFacd93D02d071c9", "0x6ce8eb472fa82df5469c6ab6d485f17c3ad13c8cd7af59b3d4a8026c5ce0f7e2" ]}, // Args: Pool manager diff --git a/src/encoding/evm/swap_encoder/builder.rs b/src/encoding/evm/swap_encoder/builder.rs index 075dad0..f00d1e8 100644 --- a/src/encoding/evm/swap_encoder/builder.rs +++ b/src/encoding/evm/swap_encoder/builder.rs @@ -23,8 +23,11 @@ impl SwapEncoderBuilder { pub fn build(self) -> Result, EncodingError> { match self.protocol_system.as_str() { "uniswap_v2" => Ok(Box::new(UniswapV2SwapEncoder::new(self.executor_address))), + "sushiswap_v2" => Ok(Box::new(UniswapV2SwapEncoder::new(self.executor_address))), + "pancakeswap_v2" => Ok(Box::new(UniswapV2SwapEncoder::new(self.executor_address))), "vm:balancer_v2" => Ok(Box::new(BalancerV2SwapEncoder::new(self.executor_address))), "uniswap_v3" => Ok(Box::new(UniswapV3SwapEncoder::new(self.executor_address))), + "pancakeswap_v3" => Ok(Box::new(UniswapV2SwapEncoder::new(self.executor_address))), "uniswap_v4" => Ok(Box::new(UniswapV4SwapEncoder::new(self.executor_address))), _ => Err(EncodingError::FatalError(format!( "Unknown protocol system: {}",