fix: revert hooks rename
- Instead, add a new attribute to the builder, constants, and executor addresses json - This was a miscommunication. Regular pools will still have the same name - only those with hooks will have hook appended to it
This commit is contained in:
@@ -5,7 +5,7 @@
|
||||
"pancakeswap_v2": "0xC9db3FEB380E4fd9af239e2595ECdEcE3b5c34A4",
|
||||
"uniswap_v3": "0xbab7124C9662B15C6b9AF0b1f329907dD55a24FC",
|
||||
"pancakeswap_v3": "0x9D32e9F569B22Ae8d8C6f788037C1CD53632A059",
|
||||
"uniswap_v4_hooks": "0x2C2EaB81Cf983602153E67b1890164BC4CABC6ed",
|
||||
"uniswap_v4": "0x2C2EaB81Cf983602153E67b1890164BC4CABC6ed",
|
||||
"vm:balancer_v2": "0xB5b8dc3F0a1Be99685a0DEd015Af93bFBB55C411",
|
||||
"ekubo_v2": "0x263DD7AD20983b5E0392bf1F09C4493500EDb333",
|
||||
"vm:curve": "0x879F3008D96EBea0fc584aD684c7Df31777F3165",
|
||||
@@ -17,12 +17,12 @@
|
||||
"base": {
|
||||
"uniswap_v2": "0xF744EBfaA580cF3fFc25aD046E92BD8B770a0700",
|
||||
"uniswap_v3": "0x647bffbf8bd72bf6341ecba8b0279e090313a40d",
|
||||
"uniswap_v4_hooks": "0x7Dfa502736C7bd84DA1402F7524214215BC9534d",
|
||||
"uniswap_v4": "0x7Dfa502736C7bd84DA1402F7524214215BC9534d",
|
||||
"rfq:bebop": "0x489A3f531dA3873D6585BF3f8E0dEE48CAC6F7BC"
|
||||
},
|
||||
"unichain": {
|
||||
"uniswap_v2": "0x00C1b81e3C8f6347E69e2DDb90454798A6Be975E",
|
||||
"uniswap_v3": "0xD26A838A41af3d4815DfD745a080B2062c4124d1",
|
||||
"uniswap_v4_hooks": "0x647bfFbF8Bd72bF6341ECBa8B0279e090313A40D"
|
||||
"uniswap_v4": "0x647bfFbF8Bd72bF6341ECBa8B0279e090313A40D"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
"pancakeswap_v2": "0x5615dEB798BB3E4dFa0139dFa1b3D433Cc23b72f",
|
||||
"uniswap_v3": "0x2e234DAe75C793f67A35089C9d99245E1C58470b",
|
||||
"pancakeswap_v3": "0x5991A2dF15A8F6A256D3Ec51E99254Cd3fb576A9",
|
||||
"uniswap_v4": "0xF62849F9A0B5Bf2913b396098F7c7019b51A820a",
|
||||
"uniswap_v4_hooks": "0xF62849F9A0B5Bf2913b396098F7c7019b51A820a",
|
||||
"vm:balancer_v2": "0xc7183455a4C133Ae270771860664b6B7ec320bB1",
|
||||
"ekubo_v2": "0xa0Cb889707d426A7A386870A03bc70d1b0697598",
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -12,6 +12,7 @@ pub const PROTOCOL_SPECIFIC_CONFIG: &str =
|
||||
/// transfers.
|
||||
pub static GROUPABLE_PROTOCOLS: LazyLock<HashSet<&'static str>> = LazyLock::new(|| {
|
||||
let mut set = HashSet::new();
|
||||
set.insert("uniswap_v4");
|
||||
set.insert("uniswap_v4_hooks");
|
||||
set.insert("vm:balancer_v3");
|
||||
set.insert("ekubo_v2");
|
||||
@@ -28,6 +29,7 @@ pub static IN_TRANSFER_REQUIRED_PROTOCOLS: LazyLock<HashSet<&'static str>> = Laz
|
||||
set.insert("pancakeswap_v2");
|
||||
set.insert("uniswap_v3");
|
||||
set.insert("pancakeswap_v3");
|
||||
set.insert("uniswap_v4");
|
||||
set.insert("uniswap_v4_hooks");
|
||||
set.insert("ekubo_v2");
|
||||
set.insert("vm:maverick_v2");
|
||||
@@ -45,7 +47,7 @@ pub static CALLBACK_CONSTRAINED_PROTOCOLS: LazyLock<HashSet<&'static str>> = Laz
|
||||
let mut set = HashSet::new();
|
||||
set.insert("uniswap_v3");
|
||||
set.insert("pancakeswap_v3");
|
||||
set.insert("uniswap_v4_hooks");
|
||||
set.insert("uniswap_v4");
|
||||
set.insert("ekubo_v2");
|
||||
set.insert("vm:balancer_v3");
|
||||
set
|
||||
|
||||
@@ -106,14 +106,20 @@ mod tests {
|
||||
let dai = Bytes::from_str("0x6b175474e89094c44da98b954eedeac495271d0f").unwrap();
|
||||
|
||||
let swap_weth_wbtc = SwapBuilder::new(
|
||||
ProtocolComponent { protocol_system: "uniswap_v4_hooks".to_string(), ..Default::default() },
|
||||
ProtocolComponent {
|
||||
protocol_system: "uniswap_v4".to_string(),
|
||||
..Default::default()
|
||||
},
|
||||
weth.clone(),
|
||||
wbtc.clone(),
|
||||
)
|
||||
.build();
|
||||
|
||||
let swap_wbtc_usdc = SwapBuilder::new(
|
||||
ProtocolComponent { protocol_system: "uniswap_v4_hooks".to_string(), ..Default::default() },
|
||||
ProtocolComponent {
|
||||
protocol_system: "uniswap_v4".to_string(),
|
||||
..Default::default()
|
||||
},
|
||||
wbtc.clone(),
|
||||
usdc.clone(),
|
||||
)
|
||||
@@ -135,7 +141,7 @@ mod tests {
|
||||
swaps: vec![swap_weth_wbtc, swap_wbtc_usdc],
|
||||
token_in: weth,
|
||||
token_out: usdc.clone(),
|
||||
protocol_system: "uniswap_v4_hooks".to_string(),
|
||||
protocol_system: "uniswap_v4".to_string(),
|
||||
split: 0f64,
|
||||
},
|
||||
SwapGroup {
|
||||
@@ -165,20 +171,29 @@ mod tests {
|
||||
let dai = Bytes::from_str("0x6b175474e89094c44da98b954eedeac495271d0f").unwrap();
|
||||
|
||||
let swap_wbtc_weth = SwapBuilder::new(
|
||||
ProtocolComponent { protocol_system: "uniswap_v4_hooks".to_string(), ..Default::default() },
|
||||
ProtocolComponent {
|
||||
protocol_system: "uniswap_v4".to_string(),
|
||||
..Default::default()
|
||||
},
|
||||
wbtc.clone(),
|
||||
weth.clone(),
|
||||
)
|
||||
.build();
|
||||
let swap_weth_usdc = SwapBuilder::new(
|
||||
ProtocolComponent { protocol_system: "uniswap_v4_hooks".to_string(), ..Default::default() },
|
||||
ProtocolComponent {
|
||||
protocol_system: "uniswap_v4".to_string(),
|
||||
..Default::default()
|
||||
},
|
||||
weth.clone(),
|
||||
usdc.clone(),
|
||||
)
|
||||
.split(0.5f64)
|
||||
.build();
|
||||
let swap_weth_dai = SwapBuilder::new(
|
||||
ProtocolComponent { protocol_system: "uniswap_v4_hooks".to_string(), ..Default::default() },
|
||||
ProtocolComponent {
|
||||
protocol_system: "uniswap_v4".to_string(),
|
||||
..Default::default()
|
||||
},
|
||||
weth.clone(),
|
||||
dai.clone(),
|
||||
)
|
||||
@@ -187,7 +202,10 @@ mod tests {
|
||||
// 0 to signify "the remainder of the WETH value". It should still be very close to 50%
|
||||
|
||||
let swap_dai_usdc = SwapBuilder::new(
|
||||
ProtocolComponent { protocol_system: "uniswap_v4_hooks".to_string(), ..Default::default() },
|
||||
ProtocolComponent {
|
||||
protocol_system: "uniswap_v4".to_string(),
|
||||
..Default::default()
|
||||
},
|
||||
dai.clone(),
|
||||
usdc.clone(),
|
||||
)
|
||||
@@ -207,21 +225,21 @@ mod tests {
|
||||
swaps: vec![swap_wbtc_weth],
|
||||
token_in: wbtc.clone(),
|
||||
token_out: weth.clone(),
|
||||
protocol_system: "uniswap_v4_hooks".to_string(),
|
||||
protocol_system: "uniswap_v4".to_string(),
|
||||
split: 0f64,
|
||||
},
|
||||
SwapGroup {
|
||||
swaps: vec![swap_weth_usdc],
|
||||
token_in: weth.clone(),
|
||||
token_out: usdc.clone(),
|
||||
protocol_system: "uniswap_v4_hooks".to_string(),
|
||||
protocol_system: "uniswap_v4".to_string(),
|
||||
split: 0.5f64,
|
||||
},
|
||||
SwapGroup {
|
||||
swaps: vec![swap_weth_dai, swap_dai_usdc],
|
||||
token_in: weth,
|
||||
token_out: usdc,
|
||||
protocol_system: "uniswap_v4_hooks".to_string(),
|
||||
protocol_system: "uniswap_v4".to_string(),
|
||||
split: 0f64,
|
||||
}
|
||||
]
|
||||
@@ -263,13 +281,19 @@ mod tests {
|
||||
)
|
||||
.build();
|
||||
let swap_weth_dai = SwapBuilder::new(
|
||||
ProtocolComponent { protocol_system: "uniswap_v4_hooks".to_string(), ..Default::default() },
|
||||
ProtocolComponent {
|
||||
protocol_system: "uniswap_v4".to_string(),
|
||||
..Default::default()
|
||||
},
|
||||
weth.clone(),
|
||||
dai.clone(),
|
||||
)
|
||||
.build();
|
||||
let swap_dai_usdc = SwapBuilder::new(
|
||||
ProtocolComponent { protocol_system: "uniswap_v4_hooks".to_string(), ..Default::default() },
|
||||
ProtocolComponent {
|
||||
protocol_system: "uniswap_v4".to_string(),
|
||||
..Default::default()
|
||||
},
|
||||
dai.clone(),
|
||||
usdc.clone(),
|
||||
)
|
||||
@@ -297,7 +321,7 @@ mod tests {
|
||||
swaps: vec![swap_weth_dai, swap_dai_usdc],
|
||||
token_in: weth,
|
||||
token_out: usdc,
|
||||
protocol_system: "uniswap_v4_hooks".to_string(),
|
||||
protocol_system: "uniswap_v4".to_string(),
|
||||
split: 0f64,
|
||||
}
|
||||
]
|
||||
|
||||
@@ -67,6 +67,11 @@ impl SwapEncoderBuilder {
|
||||
self.chain,
|
||||
self.config,
|
||||
)?)),
|
||||
"uniswap_v4" => Ok(Box::new(UniswapV4SwapEncoder::new(
|
||||
self.executor_address,
|
||||
self.chain,
|
||||
self.config,
|
||||
)?)),
|
||||
"uniswap_v4_hooks" => Ok(Box::new(UniswapV4SwapEncoder::new(
|
||||
self.executor_address,
|
||||
self.chain,
|
||||
|
||||
@@ -445,7 +445,7 @@ mod tests {
|
||||
ProtocolComponent {
|
||||
id: "0xdce6394339af00981949f5f3baf27e3610c76326a700af57e4b3e3ae4977f78d"
|
||||
.to_string(),
|
||||
protocol_system: "uniswap_v4_hooks".to_string(),
|
||||
protocol_system: "uniswap_v4".to_string(),
|
||||
static_attributes: static_attributes_usdc_eth,
|
||||
..Default::default()
|
||||
},
|
||||
@@ -465,7 +465,7 @@ mod tests {
|
||||
ProtocolComponent {
|
||||
id: "0xecd73ecbf77219f21f129c8836d5d686bbc27d264742ddad620500e3e548e2c9"
|
||||
.to_string(),
|
||||
protocol_system: "uniswap_v4_hooks".to_string(),
|
||||
protocol_system: "uniswap_v4".to_string(),
|
||||
static_attributes: static_attributes_eth_pepe,
|
||||
..Default::default()
|
||||
},
|
||||
|
||||
@@ -481,7 +481,7 @@ fn test_multi_protocol() {
|
||||
let usv4_swap_usdc_eth = Swap {
|
||||
component: ProtocolComponent {
|
||||
id: "0xdce6394339af00981949f5f3baf27e3610c76326a700af57e4b3e3ae4977f78d".to_string(),
|
||||
protocol_system: "uniswap_v4_hooks".to_string(),
|
||||
protocol_system: "uniswap_v4".to_string(),
|
||||
static_attributes: static_attributes_usdc_eth,
|
||||
..Default::default()
|
||||
},
|
||||
|
||||
@@ -156,7 +156,7 @@ fn test_single_encoding_strategy_usv4_eth_in() {
|
||||
let swap_eth_pepe = Swap {
|
||||
component: ProtocolComponent {
|
||||
id: "0xecd73ecbf77219f21f129c8836d5d686bbc27d264742ddad620500e3e548e2c9".to_string(),
|
||||
protocol_system: "uniswap_v4_hooks".to_string(),
|
||||
protocol_system: "uniswap_v4".to_string(),
|
||||
static_attributes: static_attributes_eth_pepe,
|
||||
..Default::default()
|
||||
},
|
||||
@@ -224,7 +224,7 @@ fn test_single_encoding_strategy_usv4_eth_out() {
|
||||
let swap_usdc_eth = Swap {
|
||||
component: ProtocolComponent {
|
||||
id: "0xdce6394339af00981949f5f3baf27e3610c76326a700af57e4b3e3ae4977f78d".to_string(),
|
||||
protocol_system: "uniswap_v4_hooks".to_string(),
|
||||
protocol_system: "uniswap_v4".to_string(),
|
||||
static_attributes: static_attributes_usdc_eth,
|
||||
..Default::default()
|
||||
},
|
||||
@@ -300,7 +300,7 @@ fn test_single_encoding_strategy_usv4_grouped_swap() {
|
||||
let swap_usdc_eth = Swap {
|
||||
component: ProtocolComponent {
|
||||
id: "0xdce6394339af00981949f5f3baf27e3610c76326a700af57e4b3e3ae4977f78d".to_string(),
|
||||
protocol_system: "uniswap_v4_hooks".to_string(),
|
||||
protocol_system: "uniswap_v4".to_string(),
|
||||
static_attributes: static_attributes_usdc_eth,
|
||||
..Default::default()
|
||||
},
|
||||
@@ -315,7 +315,7 @@ fn test_single_encoding_strategy_usv4_grouped_swap() {
|
||||
let swap_eth_pepe = Swap {
|
||||
component: ProtocolComponent {
|
||||
id: "0xecd73ecbf77219f21f129c8836d5d686bbc27d264742ddad620500e3e548e2c9".to_string(),
|
||||
protocol_system: "uniswap_v4_hooks".to_string(),
|
||||
protocol_system: "uniswap_v4".to_string(),
|
||||
static_attributes: static_attributes_eth_pepe,
|
||||
..Default::default()
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user