From fa024a4a6702c7809af31a6ba392338d9368c6d2 Mon Sep 17 00:00:00 2001 From: TAMARA LIPOWSKI Date: Tue, 25 Mar 2025 17:49:33 +0100 Subject: [PATCH] feat: Add PancakeSwapV3 support to encoding - Add deployed executor address to json - Build proper encoder for pancake v3 - Increase gas limit when setting executors (costs more since we set one more) - Fix json filename in scripts/README.md --- config/executor_addresses.json | 1 + foundry/scripts/README.md | 2 +- foundry/scripts/set-executors.js | 2 +- src/encoding/evm/swap_encoder/builder.rs | 1 + 4 files changed, 4 insertions(+), 2 deletions(-) diff --git a/config/executor_addresses.json b/config/executor_addresses.json index 1ec0465..2079fcf 100644 --- a/config/executor_addresses.json +++ b/config/executor_addresses.json @@ -4,6 +4,7 @@ "sushiswap_v2": "0x8ABd4075cF54E0A9C52D18e6951b969AF3249cF9", "pancakeswap_v2": "0x9fC9e63cCf5F773A8bC79DcfA38c581B0DEa1d11", "uniswap_v3": "0xdD8559c917393FC8DD2b4dD289c52Ff445fDE1B0", + "pancakeswap_v3": "0x4929B619A8F0D9c06ed0FfD497636580D823F65d", "uniswap_v4": "0x042C0ebBEAb9d9987c2f64Ee05f2B3aeB86eAf70", "vm:balancer_v2": "0x00BE8EfAE40219Ff76287b0F9b9e497942f5BC91" }, diff --git a/foundry/scripts/README.md b/foundry/scripts/README.md index 15fb38d..aa93ee2 100644 --- a/foundry/scripts/README.md +++ b/foundry/scripts/README.md @@ -47,4 +47,4 @@ For each of the following, you must select one of `tenderly_ethereum`, `tenderly 1. In `scripts/deploy-executors.js` define the executors to be deployed 2. Deploy executors: `npx hardhat run scripts/deploy-executors.js --network NETWORK` -3. Fill in the executor addresses in `config/executors.json` +3. Fill in the executor addresses in `config/executor_addresses.json` diff --git a/foundry/scripts/set-executors.js b/foundry/scripts/set-executors.js index a1b0d3c..9455af6 100644 --- a/foundry/scripts/set-executors.js +++ b/foundry/scripts/set-executors.js @@ -51,7 +51,7 @@ async function main() { // Set executors const executorAddresses = executorsToSet.map(executor => executor.executor); const tx = await router.setExecutors(executorAddresses, { - gasLimit: 200000 // should be around 50k per executor + gasLimit: 300000 // should be around 50k per executor }); await tx.wait(); // Wait for the transaction to be mined console.log(`Executors set at transaction: ${tx.hash}`); diff --git a/src/encoding/evm/swap_encoder/builder.rs b/src/encoding/evm/swap_encoder/builder.rs index 40ede0f..6918b0a 100644 --- a/src/encoding/evm/swap_encoder/builder.rs +++ b/src/encoding/evm/swap_encoder/builder.rs @@ -27,6 +27,7 @@ impl SwapEncoderBuilder { "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(UniswapV3SwapEncoder::new(self.executor_address))), "uniswap_v4" => Ok(Box::new(UniswapV4SwapEncoder::new(self.executor_address))), _ => Err(EncodingError::FatalError(format!( "Unknown protocol system: {}",