diff --git a/Cargo.lock b/Cargo.lock index 715fbbb567..133e4f89dd 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1824,9 +1824,9 @@ dependencies = [ [[package]] name = "ethcontract" -version = "0.25.5" +version = "0.25.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "762a89cc55c19c68066d5510a51df2d03857c99ccccd8a1c72916db669e1d8e2" +checksum = "bdea297be3b8157af960773a0df81c239a3c542022191b3fd909001ada670a0c" dependencies = [ "arrayvec", "aws-config 0.55.3", @@ -1851,9 +1851,9 @@ dependencies = [ [[package]] name = "ethcontract-common" -version = "0.25.5" +version = "0.25.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4f1a4ffc732f4496733866edb14201e48ac5b4f5c5360aa02f1966e0a3343ced" +checksum = "f43c48f35e613bb9955e31851226066e74bedac9c0ed237294293821eb9a7cce" dependencies = [ "ethabi", "hex", @@ -1867,9 +1867,9 @@ dependencies = [ [[package]] name = "ethcontract-derive" -version = "0.25.5" +version = "0.25.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "53e1ad278c8fcbb25cb9a59fc9f9ef5d613f9f15bb9c87a0b12ee081116a230d" +checksum = "6c1794a999ce5865be36caa407c3b5213cfa048420074b8053222be1b22ad2fb" dependencies = [ "anyhow", "ethcontract-common", @@ -1881,9 +1881,9 @@ dependencies = [ [[package]] name = "ethcontract-generate" -version = "0.25.5" +version = "0.25.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6d6c427efdae115a35cb1111671b2db9a71e4ca22336019facb5d93d97f9b5b2" +checksum = "b2da9ad91f85983c5352264d4a7b17510f89bed227b04ab641ae64f759d633b4" dependencies = [ "Inflector", "anyhow", @@ -1897,9 +1897,9 @@ dependencies = [ [[package]] name = "ethcontract-mock" -version = "0.25.1" +version = "0.25.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "27d532a73852d2b44dd1a7bcd6f3d43f2cb70526f0514821f9f7ff37e9454b40" +checksum = "d4ef690f92015152e4bea45f140cf08a157031008d92e6c54ecfc9b7dac3e048" dependencies = [ "ethcontract", "hex", diff --git a/Cargo.toml b/Cargo.toml index 6ab62c6755..08ce00b771 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -10,9 +10,9 @@ cached = { version = "0.44", default-features = false } chrono = { version = "0.4", default-features = false } clap = { version = "4", features = ["derive", "env"] } derivative = "2" -ethcontract = { version = "0.25.4", default-features = false, features = ["aws-kms"] } -ethcontract-generate = { version = "0.25", default-features = false } -ethcontract-mock = { version = "0.25", default-features = false } +ethcontract = { version = "0.25.6", default-features = false, features = ["aws-kms"] } +ethcontract-generate = { version = "0.25.6", default-features = false } +ethcontract-mock = { version = "0.25.6", default-features = false } ethereum-types = "0.14" futures = "0.3" gas-estimation = { git = "https://github.com/cowprotocol/gas-estimation", tag = "v0.7.3", features = ["web3_", "tokio_"] } diff --git a/crates/autopilot/src/decoded_settlement.rs b/crates/autopilot/src/decoded_settlement.rs index dcf0d098ec..56e5b4b5c4 100644 --- a/crates/autopilot/src/decoded_settlement.rs +++ b/crates/autopilot/src/decoded_settlement.rs @@ -179,6 +179,7 @@ impl DecodedSettlement { pub fn new(input: &[u8]) -> Result { let function = GPv2Settlement::raw_contract() + .interface .abi .function("settle") .unwrap(); diff --git a/crates/autopilot/src/domain/settlement/mod.rs b/crates/autopilot/src/domain/settlement/mod.rs index 8f40f56458..53ee14570c 100644 --- a/crates/autopilot/src/domain/settlement/mod.rs +++ b/crates/autopilot/src/domain/settlement/mod.rs @@ -44,6 +44,7 @@ impl Settlement { domain_separator: ð::DomainSeparator, ) -> Result { let function = contracts::GPv2Settlement::raw_contract() + .interface .abi .function("settle") .unwrap(); diff --git a/crates/contracts/src/vault.rs b/crates/contracts/src/vault.rs index eff13412bb..b6ec9c278b 100644 --- a/crates/contracts/src/vault.rs +++ b/crates/contracts/src/vault.rs @@ -7,7 +7,11 @@ use { }; fn role_id(target: H160, function_name: &str) -> Bytes<[u8; 32]> { - let function = match BalancerV2Vault::raw_contract().abi.function(function_name) { + let function = match BalancerV2Vault::raw_contract() + .interface + .abi + .function(function_name) + { Ok(function) => function, Err(_) => return Bytes([0u8; 32]), }; diff --git a/crates/shared/src/price_estimation/trade_verifier.rs b/crates/shared/src/price_estimation/trade_verifier.rs index 0a6fc98c4c..5382509e9c 100644 --- a/crates/shared/src/price_estimation/trade_verifier.rs +++ b/crates/shared/src/price_estimation/trade_verifier.rs @@ -358,7 +358,11 @@ struct SettleOutput { impl SettleOutput { fn decode(output: &[u8], kind: OrderKind) -> Result { - let function = Solver::raw_contract().abi.function("swap").unwrap(); + let function = Solver::raw_contract() + .interface + .abi + .function("swap") + .unwrap(); let tokens = function.decode_output(output).context("decode")?; let (gas_used, balances): (U256, Vec) = Tokenize::from_token(Token::Tuple(tokens))?; diff --git a/crates/shared/src/sources/balancer_v2/pools/common.rs b/crates/shared/src/sources/balancer_v2/pools/common.rs index e2c4718b1b..64786404aa 100644 --- a/crates/shared/src/sources/balancer_v2/pools/common.rs +++ b/crates/shared/src/sources/balancer_v2/pools/common.rs @@ -360,11 +360,11 @@ mod tests { let mock = Mock::new(42); let web3 = mock.web3(); - let pool = mock.deploy(BalancerV2BasePool::raw_contract().abi.clone()); + let pool = mock.deploy(BalancerV2BasePool::raw_contract().interface.abi.clone()); pool.expect_call(BalancerV2BasePool::signatures().get_pool_id()) .returns(Bytes(pool_id.0)); - let vault = mock.deploy(BalancerV2Vault::raw_contract().abi.clone()); + let vault = mock.deploy(BalancerV2Vault::raw_contract().interface.abi.clone()); vault .expect_call(BalancerV2Vault::signatures().get_pool_tokens()) .predicate((predicate::eq(Bytes(pool_id.0)),)) @@ -414,13 +414,13 @@ mod tests { let mock = Mock::new(42); let web3 = mock.web3(); - let pool = mock.deploy(BalancerV2BasePool::raw_contract().abi.clone()); + let pool = mock.deploy(BalancerV2BasePool::raw_contract().interface.abi.clone()); pool.expect_call(BalancerV2BasePool::signatures().get_paused_state()) .returns((false, 0.into(), 0.into())); pool.expect_call(BalancerV2BasePool::signatures().get_swap_fee_percentage()) .returns(bfp!("0.003").as_uint256()); - let vault = mock.deploy(BalancerV2Vault::raw_contract().abi.clone()); + let vault = mock.deploy(BalancerV2Vault::raw_contract().interface.abi.clone()); vault .expect_call(BalancerV2Vault::signatures().get_pool_tokens()) .predicate((predicate::eq(Bytes(pool_id.0)),)) @@ -483,13 +483,13 @@ mod tests { let mock = Mock::new(42); let web3 = mock.web3(); - let pool = mock.deploy(BalancerV2BasePool::raw_contract().abi.clone()); + let pool = mock.deploy(BalancerV2BasePool::raw_contract().interface.abi.clone()); pool.expect_call(BalancerV2BasePool::signatures().get_paused_state()) .returns((false, 0.into(), 0.into())); pool.expect_call(BalancerV2BasePool::signatures().get_swap_fee_percentage()) .returns(0.into()); - let vault = mock.deploy(BalancerV2Vault::raw_contract().abi.clone()); + let vault = mock.deploy(BalancerV2Vault::raw_contract().interface.abi.clone()); vault .expect_call(BalancerV2Vault::signatures().get_pool_tokens()) .predicate((predicate::eq(Bytes(Default::default())),)) @@ -532,7 +532,7 @@ mod tests { let mock = Mock::new(42); let web3 = mock.web3(); - let pool = mock.deploy(BalancerV2WeightedPool::raw_contract().abi.clone()); + let pool = mock.deploy(BalancerV2WeightedPool::raw_contract().interface.abi.clone()); pool.expect_call(BalancerV2WeightedPool::signatures().get_paused_state()) .returns((false, 0.into(), 0.into())); pool.expect_call(BalancerV2WeightedPool::signatures().get_swap_fee_percentage()) @@ -576,7 +576,7 @@ mod tests { version: Default::default(), }; - let vault = mock.deploy(BalancerV2Vault::raw_contract().abi.clone()); + let vault = mock.deploy(BalancerV2Vault::raw_contract().interface.abi.clone()); vault .expect_call(BalancerV2Vault::signatures().get_pool_tokens()) .predicate((predicate::eq(Bytes(pool_info.common.id.0)),)) @@ -630,13 +630,13 @@ mod tests { let mock = Mock::new(42); let web3 = mock.web3(); - let pool = mock.deploy(BalancerV2WeightedPool::raw_contract().abi.clone()); + let pool = mock.deploy(BalancerV2WeightedPool::raw_contract().interface.abi.clone()); pool.expect_call(BalancerV2WeightedPool::signatures().get_paused_state()) .returns((true, 0.into(), 0.into())); pool.expect_call(BalancerV2WeightedPool::signatures().get_swap_fee_percentage()) .returns(Default::default()); - let vault = mock.deploy(BalancerV2Vault::raw_contract().abi.clone()); + let vault = mock.deploy(BalancerV2Vault::raw_contract().interface.abi.clone()); vault .expect_call(BalancerV2Vault::signatures().get_pool_tokens()) .returns(Default::default()); @@ -690,13 +690,13 @@ mod tests { let mock = Mock::new(42); let web3 = mock.web3(); - let pool = mock.deploy(BalancerV2WeightedPool::raw_contract().abi.clone()); + let pool = mock.deploy(BalancerV2WeightedPool::raw_contract().interface.abi.clone()); pool.expect_call(BalancerV2WeightedPool::signatures().get_paused_state()) .returns((false, 0.into(), 0.into())); pool.expect_call(BalancerV2WeightedPool::signatures().get_swap_fee_percentage()) .returns(Default::default()); - let vault = mock.deploy(BalancerV2Vault::raw_contract().abi.clone()); + let vault = mock.deploy(BalancerV2Vault::raw_contract().interface.abi.clone()); vault .expect_call(BalancerV2Vault::signatures().get_pool_tokens()) .returns(Default::default()); diff --git a/crates/shared/src/sources/balancer_v2/pools/weighted.rs b/crates/shared/src/sources/balancer_v2/pools/weighted.rs index 1cc821f65f..6f49572745 100644 --- a/crates/shared/src/sources/balancer_v2/pools/weighted.rs +++ b/crates/shared/src/sources/balancer_v2/pools/weighted.rs @@ -224,7 +224,7 @@ mod tests { let mock = Mock::new(42); let web3 = mock.web3(); - let pool = mock.deploy(BalancerV2WeightedPool::raw_contract().abi.clone()); + let pool = mock.deploy(BalancerV2WeightedPool::raw_contract().interface.abi.clone()); pool.expect_call(BalancerV2WeightedPool::signatures().get_normalized_weights()) .returns(weights.iter().copied().map(Bfp::as_uint256).collect()); diff --git a/crates/shared/src/sources/uniswap_v3/event_fetching.rs b/crates/shared/src/sources/uniswap_v3/event_fetching.rs index 4abd9242ba..9a314f251a 100644 --- a/crates/shared/src/sources/uniswap_v3/event_fetching.rs +++ b/crates/shared/src/sources/uniswap_v3/event_fetching.rs @@ -41,6 +41,7 @@ impl ParseLog for UniswapV3Event { H256(BURN_TOPIC) => Ok(UniswapV3Event::Burn( log.clone().decode( UniswapV3Pool::raw_contract() + .interface .abi .event("Burn") .expect("generated event decode"), @@ -49,6 +50,7 @@ impl ParseLog for UniswapV3Event { H256(MINT_TOPIC) => Ok(UniswapV3Event::Mint( log.clone().decode( UniswapV3Pool::raw_contract() + .interface .abi .event("Mint") .expect("generated event decode"), @@ -57,6 +59,7 @@ impl ParseLog for UniswapV3Event { H256(SWAP_TOPIC) => Ok(UniswapV3Event::Swap( log.clone().decode( UniswapV3Pool::raw_contract() + .interface .abi .event("Swap") .expect("generated event decode"),