Skip to content

Commit

Permalink
Update helper contract
Browse files Browse the repository at this point in the history
  • Loading branch information
MartinquaXD committed Jul 18, 2024
1 parent 9473850 commit 79b4082
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 18 deletions.
2 changes: 1 addition & 1 deletion crates/contracts/artifacts/CowAmmLegacyHelper.json

Large diffs are not rendered by default.

20 changes: 6 additions & 14 deletions crates/contracts/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -844,25 +844,17 @@ fn main() {
.add_network(
MAINNET,
Network {
address: addr("0x86f3df416979136cb4fdea2c0886301b911c163b"),
// <https://etherscan.io/tx/0xbeb99ef580b7e91783fe90c5575d107b6c27213a597e3a9393c0b6ddf85ac7e7>
deployment_information: Some(DeploymentInformation::BlockNumber(20188650)),
address: addr("0x3705ceee5eaa561e3157cf92641ce28c45a3999c"),
// <https://etherscan.io/tx/0x07f0ce50fb9cd30e69799a63ae9100869a3c653d62ea3ba49d2e5e1282f42b63>
deployment_information: Some(DeploymentInformation::BlockNumber(20332745)),
},
)
.add_network(
GNOSIS,
Network {
address: addr("0xe8f409a31c605e081022e2a5e3f2c9d72a0776ed"),
// <https://gnosisscan.io/tx/0x9f3a0545d0f3b5ede9c3667bfcc471f8b7c16c5a4bff5b895193f8a420d67974>
deployment_information: Some(DeploymentInformation::BlockNumber(34690662)),
},
)
.add_network(
SEPOLIA,
Network {
address: addr("0x2f1d4e553eb48322fd1644d57fa4e506d618d68d"),
// <https://sepolia.etherscan.io/tx/0x6ccaba0f9b603f809cd485dc6e4d1eed93a34da048a48626cc9bb75441281330>
deployment_information: Some(DeploymentInformation::BlockNumber(6203488)),
address: addr("0xd9ec06b001957498ab1bc716145515d1d0e30ffb"),
// <https://gnosisscan.io/tx/0x09e56c7173ab1e1c5d02bc2832799422ebca6d9a40e5bae77f6ca908696bfebf>
deployment_information: Some(DeploymentInformation::BlockNumber(35026999)),
},
)
});
Expand Down
7 changes: 6 additions & 1 deletion crates/cow-amm/src/amm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,12 @@ impl Amm {
let pre_interactions = convert_interactions(pre_interactions);
let post_interactions = convert_interactions(post_interactions);

let signature = Signature::Eip1271(signature.0);
// The settlement contract expects a signature composed of 2 parts: the
// signer address and the actual signature bytes.
// The helper contract returns exactly that format but in our code base we
// expect the signature to not already include the signer address (the parts
// will be concatenated in the encoding logic) so we discard the first 20 bytes.
let signature = Signature::Eip1271(signature.0[20..].to_vec());

Ok(TemplateOrder {
order,
Expand Down
4 changes: 2 additions & 2 deletions crates/e2e/tests/e2e/cow_amm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -357,7 +357,7 @@ async fn forked_node_mainnet_cow_amm_driver_support() {
cow_amm_driver_support,
std::env::var("FORK_URL_MAINNET")
.expect("FORK_URL_MAINNET must be set to run forked tests"),
20188650, // block at which helper was deployed
20332745, // block at which helper was deployed
)
.await;
}
Expand Down Expand Up @@ -449,7 +449,7 @@ async fn cow_amm_driver_support(web3: Web3) {
"--drivers=test_solver|http://localhost:11088/test_solver,mock_solver|http://localhost:11088/mock_solver".to_string(),
"--price-estimation-drivers=test_solver|http://localhost:11088/test_solver"
.to_string(),
"--cow-amm-configs=0x86f3df416979136cb4fdea2c0886301b911c163b|0x86f3df416979136cb4fdea2c0886301b911c163b|20188649".to_string()
"--cow-amm-configs=0x3705ceee5eaa561e3157cf92641ce28c45a3999c|0x3705ceee5eaa561e3157cf92641ce28c45a3999c|20332744".to_string()
],
)
.await;
Expand Down

0 comments on commit 79b4082

Please sign in to comment.