Repository: OpenZeppelin/rust-contracts-stylus (rust)

Issue:
[Feature] Use a published version of koba
We are currently using `koba` via a git dependency, which is not ideal. For example, we wouldn't be able to publish crates depending on it.

Now that there's a published version of alloy on crates.io, we should start using it.

Pull request description:
feat: use v0.1.0 of koba from crates.io
Resolves #131 


Patch:
diff --git a/.github/workflows/check-wasm.yml b/.github/workflows/check-wasm.yml
index c0584af..9e667d8 100644
--- a/.github/workflows/check-wasm.yml
+++ b/.github/workflows/check-wasm.yml
@@ -33,6 +33,8 @@ jobs:
       - uses: Swatinem/rust-cache@v2
         with:
           cache-on-failure: true
+          cache-all-crates: true
+          cache-directories: "~/.cargo/bin/\n~/.cargo/.crates.toml"
 
       - name: install cargo-stylus
         run: cargo install --force cargo-stylus cargo-stylus-check
diff --git a/Cargo.lock b/Cargo.lock
index d9170a2..69335e3 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -77,48 +77,26 @@ version = "0.2.18"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 checksum = "5c6cb57a04249c6480766f7f7cef5467412af1490f8d1e243141daddada3264f"
 
-[[package]]
-name = "alloy"
-version = "0.1.0"
-source = "git+https://github.com/alloy-rs/alloy?rev=c6c91cc#c6c91cc197c79c456433c79d60f81c8c5aa13001"
-dependencies = [
- "alloy-consensus 0.1.0",
- "alloy-contract 0.1.0",
- "alloy-core",
- "alloy-eips 0.1.0",
- "alloy-genesis 0.1.0",
- "alloy-network 0.1.0",
- "alloy-provider 0.1.0",
- "alloy-rpc-client 0.1.0",
- "alloy-rpc-types 0.1.0",
- "alloy-serde 0.1.0",
- "alloy-signer 0.1.0",
- "alloy-signer-wallet",
- "alloy-transport 0.1.0",
- "alloy-transport-http 0.1.0",
- "reqwest",
-]
-
 [[package]]
 name = "alloy"
 version = "0.1.1"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 checksum = "5bcb4400a1939e5633939a58500c67123ef5f2e8920e5009d6949552f191be7f"
 dependencies = [
- "alloy-consensus 0.1.1",
- "alloy-contract 0.1.1",
+ "alloy-consensus",
+ "alloy-contract",
  "alloy-core",
- "alloy-eips 0.1.1",
- "alloy-genesis 0.1.1",
- "alloy-network 0.1.1",
- "alloy-provider 0.1.1",
- "alloy-rpc-client 0.1.1",
- "alloy-rpc-types 0.1.1",
- "alloy-serde 0.1.1",
- "alloy-signer 0.1.1",
+ "alloy-eips",
+ "alloy-genesis",
+ "alloy-network",
+ "alloy-provider",
+ "alloy-rpc-client",
+ "alloy-rpc-types",
+ "alloy-serde",
+ "alloy-signer",
  "alloy-signer-local",
- "alloy-transport 0.1.1",
- "alloy-transport-http 0.1.1",
+ "alloy-transport",
+ "alloy-transport-http",
  "reqwest",
 ]
 
@@ -132,51 +110,20 @@ dependencies = [
  "strum",
 ]
 
-[[package]]
-name = "alloy-consensus"
-version = "0.1.0"
-source = "git+https://github.com/alloy-rs/alloy?rev=c6c91cc#c6c91cc197c79c456433c79d60f81c8c5aa13001"
-dependencies = [
- "alloy-eips 0.1.0",
- "alloy-primitives 0.7.6",
- "alloy-rlp",
- "alloy-serde 0.1.0",
- "c-kzg",
- "serde",
-]
-
 [[package]]
 name = "alloy-consensus"
 version = "0.1.1"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 checksum = "3cc7579e4fb5558af44810f542c90d1145dba8b92c08211c215196160c48d2ea"
 dependencies = [
- "alloy-eips 0.1.1",
+ "alloy-eips",
  "alloy-primitives 0.7.6",
  "alloy-rlp",
- "alloy-serde 0.1.1",
+ "alloy-serde",
  "c-kzg",
  "serde",
 ]
 
-[[package]]
-name = "alloy-contract"
-version = "0.1.0"
-source = "git+https://github.com/alloy-rs/alloy?rev=c6c91cc#c6c91cc197c79c456433c79d60f81c8c5aa13001"
-dependencies = [
- "alloy-dyn-abi",
- "alloy-json-abi",
- "alloy-network 0.1.0",
- "alloy-primitives 0.7.6",
- "alloy-provider 0.1.0",
- "alloy-rpc-types 0.1.0",
- "alloy-sol-types 0.7.6",
- "alloy-transport 0.1.0",
- "futures",
- "futures-util",
- "thiserror",
-]
-
 [[package]]
 name = "alloy-contract"
 version = "0.1.1"
@@ -185,12 +132,12 @@ checksum = "860887f0f7e1e17db33ada75c3c516164a5e11aa89f0311f4d23b82abcf2d807"
 dependencies = [
  "alloy-dyn-abi",
  "alloy-json-abi",
- "alloy-network 0.1.1",
+ "alloy-network",
  "alloy-primitives 0.7.6",
- "alloy-provider 0.1.1",
+ "alloy-provider",
  "alloy-rpc-types-eth",
  "alloy-sol-types 0.7.6",
- "alloy-transport 0.1.1",
+ "alloy-transport",
  "futures",
  "futures-util",
  "thiserror",
@@ -225,20 +172,6 @@ dependencies = [
  "winnow 0.6.13",
 ]
 
-[[package]]
-name = "alloy-eips"
-version = "0.1.0"
-source = "git+https://github.com/alloy-rs/alloy?rev=c6c91cc#c6c91cc197c79c456433c79d60f81c8c5aa13001"
-dependencies = [
- "alloy-primitives 0.7.6",
- "alloy-rlp",
- "alloy-serde 0.1.0",
- "c-kzg",
- "once_cell",
- "serde",
- "sha2",
-]
-
 [[package]]
 name = "alloy-eips"
 version = "0.1.1"
@@ -247,24 +180,13 @@ checksum = "3bdbc8d98cc36ebe17bb5b42d0873137bc76628a4ee0f7e7acad5b8fc59d3597"
 dependencies = [
  "alloy-primitives 0.7.6",
  "alloy-rlp",
- "alloy-serde 0.1.1",
+ "alloy-serde",
  "c-kzg",
  "once_cell",
  "serde",
  "sha2",
 ]
 
-[[package]]
-name = "alloy-genesis"
-version = "0.1.0"
-source = "git+https://github.com/alloy-rs/alloy?rev=c6c91cc#c6c91cc197c79c456433c79d60f81c8c5aa13001"
-dependencies = [
- "alloy-primitives 0.7.6",
- "alloy-serde 0.1.0",
- "serde",
- "serde_json",
-]
-
 [[package]]
 name = "alloy-genesis"
 version = "0.1.1"
@@ -272,7 +194,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
 checksum = "5e10a047066076b32d52b3228e95a4f7793db7a204f648aa1a1ea675085bffd8"
 dependencies = [
  "alloy-primitives 0.7.6",
- "alloy-serde 0.1.1",
+ "alloy-serde",
  "serde",
  "serde_json",
 ]
@@ -289,18 +211,6 @@ dependencies = [
  "serde_json",
 ]
 
-[[package]]
-name = "alloy-json-rpc"
-version = "0.1.0"
-source = "git+https://github.com/alloy-rs/alloy?rev=c6c91cc#c6c91cc197c79c456433c79d60f81c8c5aa13001"
-dependencies = [
- "alloy-primitives 0.7.6",
- "serde",
- "serde_json",
- "thiserror",
- "tracing",
-]
-
 [[package]]
 name = "alloy-json-rpc"
 version = "0.1.1"
@@ -314,36 +224,19 @@ dependencies = [
  "tracing",
 ]
 
-[[package]]
-name = "alloy-network"
-version = "0.1.0"
-source = "git+https://github.com/alloy-rs/alloy?rev=c6c91cc#c6c91cc197c79c456433c79d60f81c8c5aa13001"
-dependencies = [
- "alloy-consensus 0.1.0",
- "alloy-eips 0.1.0",
- "alloy-json-rpc 0.1.0",
- "alloy-primitives 0.7.6",
- "alloy-rpc-types 0.1.0",
- "alloy-signer 0.1.0",
- "alloy-sol-types 0.7.6",
- "async-trait",
- "futures-utils-wasm",
- "thiserror",
-]
-
 [[package]]
 name = "alloy-network"
 version = "0.1.1"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 checksum = "ef742b478a2db5c27063cde82128dfbecffcd38237d7f682a91d3ecf6aa1836c"
 dependencies = [
- "alloy-consensus 0.1.1",
- "alloy-eips 0.1.1",
- "alloy-json-rpc 0.1.1",
+ "alloy-consensus",
+ "alloy-eips",
+ "alloy-json-rpc",
  "alloy-primitives 0.7.6",
  "alloy-rpc-types-eth",
- "alloy-serde 0.1.1",
- "alloy-signer 0.1.1",
+ "alloy-serde",
+ "alloy-signer",
  "alloy-sol-types 0.7.6",
  "async-trait",
  "auto_impl",
@@ -396,35 +289,6 @@ dependencies = [
  "tiny-keccak",
 ]
 
-[[package]]
-name = "alloy-provider"
-version = "0.1.0"
-source = "git+https://github.com/alloy-rs/alloy?rev=c6c91cc#c6c91cc197c79c456433c79d60f81c8c5aa13001"
-dependencies = [
- "alloy-eips 0.1.0",
- "alloy-json-rpc 0.1.0",
- "alloy-network 0.1.0",
- "alloy-primitives 0.7.6",
- "alloy-rpc-client 0.1.0",
- "alloy-rpc-types 0.1.0",
- "alloy-rpc-types-trace",
- "alloy-transport 0.1.0",
- "alloy-transport-http 0.1.0",
- "async-stream",
- "async-trait",
- "auto_impl",
- "dashmap",
- "futures",
- "futures-utils-wasm",
- "lru",
- "pin-project",
- "reqwest",
- "serde_json",
- "tokio",
- "tracing",
- "url",
-]
-
 [[package]]
 name = "alloy-provider"
 version = "0.1.1"
@@ -432,15 +296,15 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
 checksum = "200b786259a17acf318b9c423afe9669bec24ce9cdf59de153ff9a4009914bb6"
 dependencies = [
  "alloy-chains",
- "alloy-consensus 0.1.1",
- "alloy-eips 0.1.1",
- "alloy-json-rpc 0.1.1",
- "alloy-network 0.1.1",
+ "alloy-consensus",
+ "alloy-eips",
+ "alloy-json-rpc",
+ "alloy-network",
  "alloy-primitives 0.7.6",
- "alloy-rpc-client 0.1.1",
+ "alloy-rpc-client",
  "alloy-rpc-types-eth",
- "alloy-transport 0.1.1",
- "alloy-transport-http 0.1.1",
+ "alloy-transport",
+ "alloy-transport-http",
  "async-stream",
  "async-trait",
  "auto_impl",
@@ -479,35 +343,15 @@ dependencies = [
  "syn 2.0.66",
 ]
 
-[[package]]
-name = "alloy-rpc-client"
-version = "0.1.0"
-source = "git+https://github.com/alloy-rs/alloy?rev=c6c91cc#c6c91cc197c79c456433c79d60f81c8c5aa13001"
-dependencies = [
- "alloy-json-rpc 0.1.0",
- "alloy-transport 0.1.0",
- "alloy-transport-http 0.1.0",
- "futures",
- "pin-project",
- "reqwest",
- "serde",
- "serde_json",
- "tokio",
- "tokio-stream",
- "tower",
- "tracing",
- "url",
-]
-
 [[package]]
 name = "alloy-rpc-client"
 version = "0.1.1"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 checksum = "328a6a14aba6152ddf6d01bac5e17a70dbe9d6f343bf402b995c30bac63a1fbf"
 dependencies = [
- "alloy-json-rpc 0.1.1",
- "alloy-transport 0.1.1",
- "alloy-transport-http 0.1.1",
+ "alloy-json-rpc",
+ "alloy-transport",
+ "alloy-transport-http",
  "futures",
  "pin-project",
  "reqwest",
@@ -520,24 +364,6 @@ dependencies = [
  "url",
 ]
 
-[[package]]
-name = "alloy-rpc-types"
-version = "0.1.0"
-source = "git+https://github.com/alloy-rs/alloy?rev=c6c91cc#c6c91cc197c79c456433c79d60f81c8c5aa13001"
-dependencies = [
- "alloy-consensus 0.1.0",
- "alloy-eips 0.1.0",
- "alloy-genesis 0.1.0",
- "alloy-primitives 0.7.6",
- "alloy-rlp",
- "alloy-serde 0.1.0",
- "alloy-sol-types 0.7.6",
- "itertools 0.12.1",
- "serde",
- "serde_json",
- "thiserror",
-]
-
 [[package]]
 name = "alloy-rpc-types"
 version = "0.1.1"
@@ -545,7 +371,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
 checksum = "3164e7d8a718a22ede70b2c1d2bb554a8b4bd8e56c07ab630b75c74c06c53752"
 dependencies = [
  "alloy-rpc-types-eth",
- "alloy-serde 0.1.1",
+ "alloy-serde",
 ]
 
 [[package]]
@@ -554,11 +380,11 @@ version = "0.1.1"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 checksum = "bce0676f144be1eae71122d1d417885a3b063add0353b35e46cdf1440d6b33b1"
 dependencies = [
- "alloy-consensus 0.1.1",
- "alloy-eips 0.1.1",
+ "alloy-consensus",
+ "alloy-eips",
  "alloy-primitives 0.7.6",
  "alloy-rlp",
- "alloy-serde 0.1.1",
+ "alloy-serde",
  "alloy-sol-types 0.7.6",
  "itertools 0.13.0",
  "serde",
@@ -566,28 +392,6 @@ dependencies = [
  "thiserror",
 ]
 
-[[package]]
-name = "alloy-rpc-types-trace"
-version = "0.1.0"
-source = "git+https://github.com/alloy-rs/alloy?rev=c6c91cc#c6c91cc197c79c456433c79d60f81c8c5aa13001"
-dependencies = [
- "alloy-primitives 0.7.6",
- "alloy-rpc-types 0.1.0",
- "alloy-serde 0.1.0",
- "serde",
- "serde_json",
-]
-
-[[package]]
-name = "alloy-serde"
-version = "0.1.0"
-source = "git+https://github.com/alloy-rs/alloy?rev=c6c91cc#c6c91cc197c79c456433c79d60f81c8c5aa13001"
-dependencies = [
- "alloy-primitives 0.7.6",
- "serde",
- "serde_json",
-]
-
 [[package]]
 name = "alloy-serde"
 version = "0.1.1"
@@ -599,19 +403,6 @@ dependencies = [
  "serde_json",
 ]
 
-[[package]]
-name = "alloy-signer"
-version = "0.1.0"
-source = "git+https://github.com/alloy-rs/alloy?rev=c6c91cc#c6c91cc197c79c456433c79d60f81c8c5aa13001"
-dependencies = [
- "alloy-primitives 0.7.6",
- "async-trait",
- "auto_impl",
- "elliptic-curve",
- "k256",
- "thiserror",
-]
-
 [[package]]
 name = "alloy-signer"
 version = "0.1.1"
@@ -632,25 +423,10 @@ version = "0.1.1"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 checksum = "66c44057ac1e8707f8c6a983db9f83ac1265c9e05be81d432acf2aad2880e1c0"
 dependencies = [
- "alloy-consensus 0.1.1",
- "alloy-network 0.1.1",
- "alloy-primitives 0.7.6",
- "alloy-signer 0.1.1",
- "async-trait",
- "k256",
- "rand",
- "thiserror",
-]
-
-[[package]]
-name = "alloy-signer-wallet"
-version = "0.1.0"
-source = "git+https://github.com/alloy-rs/alloy?rev=c6c91cc#c6c91cc197c79c456433c79d60f81c8c5aa13001"
-dependencies = [
- "alloy-consensus 0.1.0",
- "alloy-network 0.1.0",
+ "alloy-consensus",
+ "alloy-network",
  "alloy-primitives 0.7.6",
- "alloy-signer 0.1.0",
+ "alloy-signer",
  "async-trait",
  "elliptic-curve",
  "eth-keystore",
@@ -757,31 +533,13 @@ dependencies = [
  "serde",
 ]
 
-[[package]]
-name = "alloy-transport"
-version = "0.1.0"
-source = "git+https://github.com/alloy-rs/alloy?rev=c6c91cc#c6c91cc197c79c456433c79d60f81c8c5aa13001"
-dependencies = [
- "alloy-json-rpc 0.1.0",
- "base64",
- "futures-util",
- "futures-utils-wasm",
- "serde",
- "serde_json",
- "thiserror",
- "tokio",
- "tower",
- "url",
- "wasm-bindgen-futures",
-]
-
 [[package]]
 name = "alloy-transport"
 version = "0.1.1"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 checksum = "b3628d81530263fe837a09cd527022f5728202a669973f04270942f4d390b5f5"
 dependencies = [
- "alloy-json-rpc 0.1.1",
+ "alloy-json-rpc",
  "base64",
  "futures-util",
  "futures-utils-wasm",
@@ -793,28 +551,14 @@ dependencies = [
  "url",
 ]
 
-[[package]]
-name = "alloy-transport-http"
-version = "0.1.0"
-source = "git+https://github.com/alloy-rs/alloy?rev=c6c91cc#c6c91cc197c79c456433c79d60f81c8c5aa13001"
-dependencies = [
- "alloy-json-rpc 0.1.0",
- "alloy-transport 0.1.0",
- "reqwest",
- "serde_json",
- "tower",
- "tracing",
- "url",
-]
-
 [[package]]
 name = "alloy-transport-http"
 version = "0.1.1"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 checksum = "2f35d34e7a51503c9ff267404a5850bd58f991b7ab524b892f364901e3576376"
 dependencies = [
- "alloy-json-rpc 0.1.1",
- "alloy-transport 0.1.1",
+ "alloy-json-rpc",
+ "alloy-transport",
  "reqwest",
  "serde_json",
  "tower",
@@ -1674,7 +1418,7 @@ checksum = "56ce8c6da7551ec6c462cbaf3bfbc75131ebbfa1c944aeaa9dab51ca1c5f0c3b"
 name = "e2e"
 version = "0.1.0"
 dependencies = [
- "alloy 0.1.1",
+ "alloy",
  "e2e-proc",
  "eyre",
  "koba",
@@ -1783,7 +1527,7 @@ checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5"
 name = "erc20-example"
 version = "0.0.0"
 dependencies = [
- "alloy 0.1.1",
+ "alloy",
  "alloy-primitives 0.3.3",
  "e2e",
  "eyre",
@@ -1798,7 +1542,7 @@ dependencies = [
 name = "erc721-example"
 version = "0.0.0"
 dependencies = [
- "alloy 0.1.1",
+ "alloy",
  "alloy-primitives 0.3.3",
  "e2e",
  "eyre",
@@ -2461,15 +2205,6 @@ dependencies = [
  "either",
 ]
 
-[[package]]
-name = "itertools"
-version = "0.12.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ba291022dbbd398a455acf126c1e341954079855bc60dfdda641363bd6922569"
-dependencies = [
- "either",
-]
-
 [[package]]
 name = "itertools"
 version = "0.13.0"
@@ -2535,9 +2270,10 @@ checksum = "57d8d8ce877200136358e0bbff3a77965875db3af755a11e1fa6b1b3e2df13ea"
 [[package]]
 name = "koba"
 version = "0.1.0"
-source = "git+https://github.com/OpenZeppelin/koba#1b364b9090d14b107c48aa991773b5973a9e0197"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "bb251e0817a500aa5ef72e7e4e25c063a33b7e849d14ad1d7221ebe48893d7a7"
 dependencies = [
- "alloy 0.1.0",
+ "alloy",
  "brotli2",
  "bytesize",
  "clap",


Test patch:
diff --git a/.github/workflows/e2e-tests.yml b/.github/workflows/e2e-tests.yml
index b3f26c3..f921748 100644
--- a/.github/workflows/e2e-tests.yml
+++ b/.github/workflows/e2e-tests.yml
@@ -37,6 +37,8 @@ jobs:
       - uses: Swatinem/rust-cache@v2
         with:
           cache-on-failure: true
+          cache-all-crates: true
+          cache-directories: "~/.cargo/bin/\n~/.cargo/.crates.toml"
 
       - name: install cargo-stylus
         run: cargo install --force cargo-stylus cargo-stylus-check
diff --git a/lib/e2e/Cargo.toml b/lib/e2e/Cargo.toml
index d63187a..b151766 100644
--- a/lib/e2e/Cargo.toml
+++ b/lib/e2e/Cargo.toml
@@ -14,6 +14,6 @@ tokio = { version = "1.12.0", features = ["full", "process"] }
 eyre = "0.6.8"
 regex = "1.10.4"
 once_cell = "1.19.0"
-koba = { git = "https://github.com/OpenZeppelin/koba" }
+koba = "0.1.0"
 e2e-proc = { path = "../e2e-proc" }
 toml = "0.8.13"