Skip to content

Commit 8b92ba2

Browse files
authored
Merge pull request astraly-labs#2 from baitcode/ekubo-swapper-contract
Ekubo swapper + router lite contract binding and tests for swaps.
2 parents 65f489e + 9c84312 commit 8b92ba2

19 files changed

+36799
-366
lines changed

Cargo.lock

Lines changed: 2 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,9 @@ starknet-signers = "=0.12.0"
6161
# arbiter-engine = "0.4.0"
6262
# arbiter-macros = "0.1.4"
6363

64-
serde = { version = "1.0.200", features = ["derive"] }
65-
serde_json = { version = "1.0.116" }
64+
serde = { version = "1.0.140", features = ["derive"] }
65+
serde_json = { version = "1.0.140" }
66+
6667
toml = "0.8.12"
6768

6869
ethers = "=2.0.11"
@@ -82,6 +83,8 @@ tracing = "0.1.40"
8283
thiserror = { version = "1.0.59" }
8384
anyhow = "1.0.83"
8485

86+
url = "2.5.4"
87+
8588
# Dependencies for the release build of Arbiter bin
8689
[dependencies]
8790

@@ -112,6 +115,7 @@ tempfile = { version = "3.10.1" }
112115

113116
# Errors
114117
thiserror.workspace = true
118+
115119
# Dependencies for the test build and development
116120
[dev-dependencies]
117121
starkbiter-bindings.workspace = true

bin/bind/mod.rs

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,15 @@ pub(crate) fn cainome_bind(src: &str, dest: &str, use_debug: &bool) -> std::io::
9393
let contract_file_name = format!("{}.rs", contract_name.to_snake_case());
9494
// What if empty?
9595

96+
let dest_file = out_path.join(contract_file_name);
97+
98+
if fs::exists(&dest_file)? {
99+
println!(
100+
"File at {} already exists, skipping generation.",
101+
dest_file.display()
102+
);
103+
continue;
104+
}
96105
println!("Generating bindings for contract: {}", contract_name);
97106

98107
// let mut aliases = HashMap::new();
@@ -108,7 +117,7 @@ pub(crate) fn cainome_bind(src: &str, dest: &str, use_debug: &bool) -> std::io::
108117
abigen
109118
.generate()
110119
.expect("Fail to generate bindings")
111-
.write_to_file(out_path.join(contract_file_name).to_str().unwrap())
120+
.write_to_file(dest_file.to_str().unwrap())
112121
.unwrap();
113122
}
114123
}

bindings/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,3 +16,4 @@ starknet_api.workspace = true
1616

1717
cainome.workspace = true
1818
serde.workspace = true
19+
serde_json.workspace = true

0 commit comments

Comments
 (0)