feat: Support Pancakeswap v3 on ethereum

- Needed to take pool code init hash as input param for executors
- Added tests for ethereum. Will test base on-chain.
- Important note: Pancakeswap uses their deployer instead of their factory (this is a different address) for target verification.
This commit is contained in:
TAMARA LIPOWSKI
2025-03-19 15:30:58 -04:00
parent 0a8a34be03
commit 2a4ee88cad
7 changed files with 78 additions and 28 deletions

View File

@@ -14,18 +14,18 @@ contract UniswapV2Executor is IExecutor {
using SafeERC20 for IERC20;
address public immutable factory;
bytes32 public immutable init_code;
bytes32 public immutable initCode;
address private immutable self;
constructor(address _factory, bytes32 _init_code) {
constructor(address _factory, bytes32 _initCode) {
if (_factory == address(0)) {
revert UniswapV2Executor__InvalidFactory();
}
if (_init_code == bytes32(0)) {
if (_initCode == bytes32(0)) {
revert UniswapV2Executor__InvalidInitCode();
}
factory = _factory;
init_code = _init_code;
initCode = _initCode;
self = address(this);
}
@@ -105,7 +105,7 @@ contract UniswapV2Executor is IExecutor {
uint160(
uint256(
keccak256(
abi.encodePacked(hex"ff", factory, salt, init_code)
abi.encodePacked(hex"ff", factory, salt, initCode)
)
)
)