From c7d4fac77a7e8085f62fc4052904456ff4c8c612 Mon Sep 17 00:00:00 2001 From: Donovan Tjemmes <37707055+Tjemmmic@users.noreply.github.com> Date: Fri, 31 Jan 2025 01:27:23 -0600 Subject: [PATCH] fix: remove git dependencies for release (#623) * fix(gadget-runners): removed eigensdk git dep * fix!: switch to tnt-bls and tnt-core-bytecode releases * fix: mbsm test deployment --- Cargo.lock | 204 ++- Cargo.toml | 13 +- README.md | 48 +- cli/Cargo.toml | 2 +- crates/clients/eigenlayer/src/client.rs | 2 +- crates/clients/tangle/src/services.rs | 16 - crates/crypto/bls/Cargo.toml | 6 +- crates/crypto/bls/src/lib.rs | 2 +- crates/crypto/bls/src/tests.rs | 4 +- crates/eigenlayer-bindings/src/lib.rs | 1 + .../src/pauser_registry.rs | 1264 +++++++++++++++++ crates/keystore/Cargo.toml | 6 +- crates/runners/eigenlayer/src/bls.rs | 3 +- crates/runners/eigenlayer/src/ecdsa.rs | 341 ----- crates/runners/eigenlayer/src/lib.rs | 1 - crates/testing-utils/eigenlayer/Cargo.toml | 1 + crates/testing-utils/eigenlayer/src/env.rs | 2 +- crates/testing-utils/tangle/Cargo.toml | 2 + crates/testing-utils/tangle/src/harness.rs | 6 +- .../tangle/src/node/transactions.rs | 20 +- crates/utils/eigenlayer/src/lib.rs | 2 +- 21 files changed, 1433 insertions(+), 513 deletions(-) create mode 100644 crates/eigenlayer-bindings/src/pauser_registry.rs delete mode 100644 crates/runners/eigenlayer/src/ecdsa.rs diff --git a/Cargo.lock b/Cargo.lock index d503b6bf1..be1c9fee8 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2547,43 +2547,6 @@ dependencies = [ "gadget-std", ] -[[package]] -name = "blueprint-examples" -version = "0.1.1" -dependencies = [ - "alloy-consensus", - "alloy-contract", - "alloy-json-abi", - "alloy-network", - "alloy-node-bindings", - "alloy-primitives 0.8.19", - "alloy-provider", - "alloy-pubsub", - "alloy-rpc-client", - "alloy-rpc-types", - "alloy-rpc-types-eth", - "alloy-signer", - "alloy-signer-local", - "alloy-sol-types 0.8.19", - "alloy-transport", - "alloy-transport-http", - "async-trait", - "blueprint-build-utils", - "blueprint-metadata", - "blueprint-sdk", - "color-eyre", - "eigensdk", - "gadget-testing-utils", - "reqwest 0.12.12", - "serde", - "serde_json", - "tempfile", - "tokio", - "tokio-util 0.7.13", - "tracing", - "uuid 1.12.1", -] - [[package]] name = "blueprint-manager" version = "0.2.2" @@ -3210,10 +3173,10 @@ dependencies = [ "tangle-subxt", "tempfile", "thiserror 2.0.11", + "tnt-bls", "tokio", "tracing", "tracing-subscriber 0.3.19", - "w3f-bls 0.1.8 (git+https://github.com/drewstone/bls.git?branch=drew%2Fbump-ark-versions)", ] [[package]] @@ -4866,8 +4829,9 @@ dependencies = [ [[package]] name = "eigen-client-avsregistry" -version = "0.1.2" -source = "git+https://github.com/Layr-Labs/eigensdk-rs.git?rev=6ab2674cf19e2f2c78218de706975af1244dad9c#6ab2674cf19e2f2c78218de706975af1244dad9c" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f67542c5c401ef27cc69e69fef5e9538ecdbfdbcbb735e6b58f323e1c38878e" dependencies = [ "alloy", "alloy-primitives 0.8.19", @@ -4888,8 +4852,9 @@ dependencies = [ [[package]] name = "eigen-client-elcontracts" -version = "0.1.2" -source = "git+https://github.com/Layr-Labs/eigensdk-rs.git?rev=6ab2674cf19e2f2c78218de706975af1244dad9c#6ab2674cf19e2f2c78218de706975af1244dad9c" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9903d81154190fcd38105543ad87601aa5626a7a3ebaac1e95a727ba555dd67c" dependencies = [ "alloy", "alloy-primitives 0.8.19", @@ -4903,8 +4868,9 @@ dependencies = [ [[package]] name = "eigen-client-eth" -version = "0.1.2" -source = "git+https://github.com/Layr-Labs/eigensdk-rs.git?rev=6ab2674cf19e2f2c78218de706975af1244dad9c#6ab2674cf19e2f2c78218de706975af1244dad9c" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7e4170be6d0de06ea9d32f560157f913d61ebcb1d6b82591232c836b5d367107" dependencies = [ "alloy", "alloy-json-rpc", @@ -4920,8 +4886,9 @@ dependencies = [ [[package]] name = "eigen-client-fireblocks" -version = "0.1.2" -source = "git+https://github.com/Layr-Labs/eigensdk-rs.git?rev=6ab2674cf19e2f2c78218de706975af1244dad9c#6ab2674cf19e2f2c78218de706975af1244dad9c" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "08c16fb523a85dd465d863e1d8246f99e1c81c3e787e3736118d0499aa5544b0" dependencies = [ "alloy", "alloy-primitives 0.8.19", @@ -4941,8 +4908,9 @@ dependencies = [ [[package]] name = "eigen-common" -version = "0.1.2" -source = "git+https://github.com/Layr-Labs/eigensdk-rs.git?rev=6ab2674cf19e2f2c78218de706975af1244dad9c#6ab2674cf19e2f2c78218de706975af1244dad9c" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ef203772753614e2c3815fcbba7c321c505107fbc21ce5209371dbc1747ee866" dependencies = [ "alloy-provider", "alloy-pubsub", @@ -4954,8 +4922,9 @@ dependencies = [ [[package]] name = "eigen-crypto-bls" -version = "0.1.2" -source = "git+https://github.com/Layr-Labs/eigensdk-rs.git?rev=6ab2674cf19e2f2c78218de706975af1244dad9c#6ab2674cf19e2f2c78218de706975af1244dad9c" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2011781d0aa1db7a3335f150cb35d24733f0261073484bc61dcb428eaec3ba84" dependencies = [ "alloy-primitives 0.8.19", "ark-bn254", @@ -4971,8 +4940,9 @@ dependencies = [ [[package]] name = "eigen-crypto-bn254" -version = "0.1.2" -source = "git+https://github.com/Layr-Labs/eigensdk-rs.git?rev=6ab2674cf19e2f2c78218de706975af1244dad9c#6ab2674cf19e2f2c78218de706975af1244dad9c" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c7b0517eba91bcd109062b271fa579ba9f8a159c445bab9a8df496d25ad1a7e" dependencies = [ "ark-bn254", "ark-ec 0.5.0", @@ -4982,8 +4952,9 @@ dependencies = [ [[package]] name = "eigen-logging" -version = "0.1.2" -source = "git+https://github.com/Layr-Labs/eigensdk-rs.git?rev=6ab2674cf19e2f2c78218de706975af1244dad9c#6ab2674cf19e2f2c78218de706975af1244dad9c" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "35fa2e89b477296b087b42a1e01ef03580c2c8d85943f23e7e5bc9c75eafdb0e" dependencies = [ "ctor", "once_cell", @@ -4993,8 +4964,9 @@ dependencies = [ [[package]] name = "eigen-metrics" -version = "0.1.2" -source = "git+https://github.com/Layr-Labs/eigensdk-rs.git?rev=6ab2674cf19e2f2c78218de706975af1244dad9c#6ab2674cf19e2f2c78218de706975af1244dad9c" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7ac64ca5d7299b6636feea59cbeca5aebad20737da6c9613e12c045ae61824cf" dependencies = [ "eigen-logging", "metrics", @@ -5004,8 +4976,9 @@ dependencies = [ [[package]] name = "eigen-metrics-collectors-rpc-calls" -version = "0.1.2" -source = "git+https://github.com/Layr-Labs/eigensdk-rs.git?rev=6ab2674cf19e2f2c78218de706975af1244dad9c#6ab2674cf19e2f2c78218de706975af1244dad9c" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f58bf7e4c734822b0f2440cd7faa17f1f8533ada3aa8d4d1925ea0eed6d9fd77" dependencies = [ "eigen-logging", "metrics", @@ -5013,8 +4986,9 @@ dependencies = [ [[package]] name = "eigen-nodeapi" -version = "0.1.2" -source = "git+https://github.com/Layr-Labs/eigensdk-rs.git?rev=6ab2674cf19e2f2c78218de706975af1244dad9c#6ab2674cf19e2f2c78218de706975af1244dad9c" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d50f93ff1aece39adacd955dc42f624431d21d3529c763f89a597ec124d986b0" dependencies = [ "ntex", "serde", @@ -5025,8 +4999,9 @@ dependencies = [ [[package]] name = "eigen-services-avsregistry" -version = "0.1.2" -source = "git+https://github.com/Layr-Labs/eigensdk-rs.git?rev=6ab2674cf19e2f2c78218de706975af1244dad9c#6ab2674cf19e2f2c78218de706975af1244dad9c" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5513ed6db2680c18359efb008a2bf53263165d2969367ec8cb10ec7626e27fb9" dependencies = [ "alloy-primitives 0.8.19", "ark-bn254", @@ -5041,8 +5016,9 @@ dependencies = [ [[package]] name = "eigen-services-blsaggregation" -version = "0.1.2" -source = "git+https://github.com/Layr-Labs/eigensdk-rs.git?rev=6ab2674cf19e2f2c78218de706975af1244dad9c#6ab2674cf19e2f2c78218de706975af1244dad9c" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9f5a7c5528bd573052795c23ee810b1f6915c5fb576f0bc535972a9d87e26445" dependencies = [ "alloy", "alloy-primitives 0.8.19", @@ -5064,8 +5040,9 @@ dependencies = [ [[package]] name = "eigen-services-operatorsinfo" -version = "0.1.2" -source = "git+https://github.com/Layr-Labs/eigensdk-rs.git?rev=6ab2674cf19e2f2c78218de706975af1244dad9c#6ab2674cf19e2f2c78218de706975af1244dad9c" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e551346d71e6c98981f36ce78d7cc9117b0bb3668412ca4a4702ad3ec8ad8e95" dependencies = [ "alloy", "alloy-primitives 0.8.19", @@ -5086,8 +5063,9 @@ dependencies = [ [[package]] name = "eigen-signer" -version = "0.1.2" -source = "git+https://github.com/Layr-Labs/eigensdk-rs.git?rev=6ab2674cf19e2f2c78218de706975af1244dad9c#6ab2674cf19e2f2c78218de706975af1244dad9c" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d48c56f0117eab8021be84fed0743ec1d782561a9527d4f7bbf22401931e44d4" dependencies = [ "alloy", "alloy-network", @@ -5106,8 +5084,9 @@ dependencies = [ [[package]] name = "eigen-testing-utils" -version = "0.1.2" -source = "git+https://github.com/Layr-Labs/eigensdk-rs.git?rev=6ab2674cf19e2f2c78218de706975af1244dad9c#6ab2674cf19e2f2c78218de706975af1244dad9c" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e33d76c2d3adbcec6747766b18e8651a56e43b4c8f65423e298a6d3986eace58" dependencies = [ "alloy-primitives 0.8.19", "alloy-provider", @@ -5123,8 +5102,9 @@ dependencies = [ [[package]] name = "eigen-types" -version = "0.1.2" -source = "git+https://github.com/Layr-Labs/eigensdk-rs.git?rev=6ab2674cf19e2f2c78218de706975af1244dad9c#6ab2674cf19e2f2c78218de706975af1244dad9c" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3df667930a14a41851503eb90837d606f436348b5a9bee7ce814f78c696dd56a" dependencies = [ "alloy-primitives 0.8.19", "eigen-crypto-bls", @@ -5136,8 +5116,9 @@ dependencies = [ [[package]] name = "eigen-utils" -version = "0.1.2" -source = "git+https://github.com/Layr-Labs/eigensdk-rs.git?rev=6ab2674cf19e2f2c78218de706975af1244dad9c#6ab2674cf19e2f2c78218de706975af1244dad9c" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "640db3098ff0d359ce9292e7a3a8ae7ef3d72817e0d5c4f0cc759ed0879661b3" dependencies = [ "alloy", "reqwest 0.12.12", @@ -5145,8 +5126,9 @@ dependencies = [ [[package]] name = "eigensdk" -version = "0.1.2" -source = "git+https://github.com/Layr-Labs/eigensdk-rs.git?rev=6ab2674cf19e2f2c78218de706975af1244dad9c#6ab2674cf19e2f2c78218de706975af1244dad9c" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "38a7f451f46558878115fb83198ccd1826378a8f4e1779a5fb45e3a8a178bc35" dependencies = [ "eigen-client-avsregistry", "eigen-client-elcontracts", @@ -6759,7 +6741,7 @@ dependencies = [ "serde_bytes", "serde_json", "thiserror 2.0.11", - "w3f-bls 0.1.8 (git+https://github.com/drewstone/bls.git?branch=drew%2Fbump-ark-versions)", + "tnt-bls", ] [[package]] @@ -6916,6 +6898,7 @@ dependencies = [ "gadget-anvil-testing-utils", "gadget-config", "gadget-core-testing-utils", + "gadget-eigenlayer-bindings", "gadget-event-listeners", "gadget-logging", "gadget-macros", @@ -7065,8 +7048,8 @@ dependencies = [ "tangle-subxt", "tempfile", "thiserror 2.0.11", + "tnt-bls", "tokio", - "w3f-bls 0.1.8 (git+https://github.com/drewstone/bls.git?branch=drew%2Fbump-ark-versions)", "zeroize", ] @@ -7250,9 +7233,11 @@ name = "gadget-tangle-testing-utils" version = "0.1.0" dependencies = [ "alloy-json-rpc", + "alloy-primitives 0.8.19", "alloy-provider", "alloy-rpc-types", "alloy-signer-local", + "alloy-sol-types 0.8.19", "alloy-transport", "async-trait", "cargo-tangle", @@ -8649,15 +8634,6 @@ dependencies = [ "uuid 1.12.1", ] -[[package]] -name = "incredible-squaring-blueprint-symbiotic" -version = "0.1.1" -dependencies = [ - "blueprint-build-utils", - "blueprint-metadata", - "blueprint-sdk", -] - [[package]] name = "indenter" version = "0.3.3" @@ -17107,7 +17083,7 @@ dependencies = [ "substrate-bip39", "thiserror 1.0.69", "tracing", - "w3f-bls 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)", + "w3f-bls", "zeroize", ] @@ -18537,10 +18513,35 @@ version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" +[[package]] +name = "tnt-bls" +version = "0.1.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6990a03a2e5c1c972663de4b29d9551aebe1808f46fdf4a46dda76cf6606e120" +dependencies = [ + "ark-bls12-377 0.5.0", + "ark-bls12-381 0.5.0", + "ark-ec 0.5.0", + "ark-ff 0.5.0", + "ark-serialize 0.5.0", + "ark-serialize-derive 0.5.0", + "arrayref", + "constcat", + "digest 0.10.7", + "rand", + "rand_chacha", + "rand_core", + "sha2 0.10.8", + "sha3", + "thiserror 1.0.69", + "zeroize", +] + [[package]] name = "tnt-core-bytecode" -version = "0.1.0" -source = "git+https://github.com/tangle-network/tnt-core.git?branch=donovan%2Fbytecode#b85cc4f149edf48de413184334dcea5514e064de" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1dfc919ded945564a2e23552904c6a529e7eb16d1ccd9a42518250db70eebe16" dependencies = [ "serde_json", ] @@ -19320,29 +19321,6 @@ dependencies = [ "zeroize", ] -[[package]] -name = "w3f-bls" -version = "0.1.8" -source = "git+https://github.com/drewstone/bls.git?branch=drew%2Fbump-ark-versions#204105643891109f9fbd1063f2e3044bf574249b" -dependencies = [ - "ark-bls12-377 0.5.0", - "ark-bls12-381 0.5.0", - "ark-ec 0.5.0", - "ark-ff 0.5.0", - "ark-serialize 0.5.0", - "ark-serialize-derive 0.5.0", - "arrayref", - "constcat", - "digest 0.10.7", - "rand", - "rand_chacha", - "rand_core", - "sha2 0.10.8", - "sha3", - "thiserror 1.0.69", - "zeroize", -] - [[package]] name = "wait-timeout" version = "0.2.0" diff --git a/Cargo.toml b/Cargo.toml index 37300f66e..be8e02185 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -5,6 +5,10 @@ members = [ "blueprints/*", "crates/*", ] +exclude = [ + "blueprints/incredible-squaring-symbiotic", + "blueprints/examples" +] [workspace.package] authors = ["Tangle Network"] @@ -44,6 +48,9 @@ blueprint-metadata = { version = "0.2.1", path = "./crates/blueprint/metadata", blueprint-build-utils = { version = "0.1.0", path = "./crates/blueprint/build-utils", default-features = false } gadget-blueprint-serde = { version = "0.3.1", path = "./crates/blueprint/serde", default-features = false } +# Bindings +gadget-eigenlayer-bindings = { version = "0.1.0", path = "./crates/eigenlayer-bindings", default-features = false } + # Crypto gadget-crypto-core = { version = "0.1.0", path = "./crates/crypto/core", default-features = false } gadget-crypto-k256 = { version = "0.1.0", path = "./crates/crypto/k256", default-features = false } @@ -119,7 +126,7 @@ gadget-rpc-calls = { version = "0.1.0", path = "./crates/metrics/rpc-calls", def cargo-tangle = { version = "0.1.0", path = "./cli", default-features = false } cargo_metadata = { version = "0.18.1" } -tnt-core-bytecode = { git = "https://github.com/tangle-network/tnt-core.git", default-features = false, branch = "donovan/bytecode" } +tnt-core-bytecode = { version = "0.2.0", default-features = false } # Tangle-related dependencies tangle-subxt = { version = "0.9.0", default-features = false } @@ -157,7 +164,7 @@ rand = { version = "0.8.5", default-features = false } schnorrkel = { version = "0.11.4", default-features = false } sha2 = { version = "0.10.8", default-features = false } sha3 = { version = "0.10.8", default-features = false } -w3f-bls = { git = "https://github.com/drewstone/bls.git", branch = "drew/bump-ark-versions", default-features = false } +tnt-bls = { version = "0.1.8", default-features = false } # Data Structures & Serialization bincode = { version = "1.3.3", default-features = false } @@ -252,7 +259,7 @@ rayon = { version = "1", default-features = false } zeroize = { version = "1.8.1", default-features = false } # Eigenlayer -eigensdk = { git = "https://github.com/Layr-Labs/eigensdk-rs.git", rev = "6ab2674cf19e2f2c78218de706975af1244dad9c", default-features = false } +eigensdk = { version = "0.1.3", default-features = false } rust-bls-bn254 = { version = "0.2.1", default-features = false } testcontainers = { version = "0.23.1", default-features = false } diff --git a/README.md b/README.md index 896cce673..ef7462bf0 100644 --- a/README.md +++ b/README.md @@ -66,28 +66,32 @@ Tangle Network's Gadget SDK is a modular framework designed to simplify the deve ## 🛠 Project Structure ``` -tangle-network-gadget-workspace/ -├── cli/ # Command-line interface tools -│ ├── src/ # CLI implementation -│ └── README.md # CLI documentation -├── crates/ # Core functionality crates -│ ├── benchmarking/ # Performance testing tools -│ ├── blueprint/ # Blueprint core system -│ │ ├── manager/ # Blueprint lifecycle management -│ │ ├── metadata/ # Blueprint metadata handling -│ │ └── serde/ # Serialization utilities -│ ├── clients/ # Network clients -│ │ ├── core/ # Shared client functionality -│ │ ├── eigenlayer/ # EigenLayer integration -│ │ ├── evm/ # Ethereum Virtual Machine client -│ │ └── tangle/ # Tangle Network client -│ ├── crypto/ # Cryptographic implementations -│ ├── event-listeners/ # Event handling system -│ ├── keystore/ # Key management -│ ├── networking/ # P2P networking -│ ├── runners/ # Execution environments -│ └── utils/ # Shared utilities -└── .config/ # Configuration files +tangle-network-gadget-workspace +├── blueprints # Blueprint examples and templates +├── cli # Cargo-tangle Command-line interface tool +├── crates # Core functionality crates +│ ├── benchmarking # Performance testing tools +│ ├── blueprint # Blueprint core system and utilities +│ ├── clients # Network clients (Tangle, EVM, EigenLayer) +│ ├── config # Configuration management +│ ├── contexts # Execution contexts +│ ├── crypto # Cryptographic implementations +│ ├── eigenlayer-bindings # EigenLayer smart contract bindings +│ ├── event-listeners # Event handling system +│ ├── executor # Task execution system +│ ├── keystore # Key management and storage +│ ├── logging # Logging infrastructure +│ ├── macros # Procedural and derive macros +│ ├── metrics # Performance and monitoring metrics +│ ├── networking # P2P networking and communication +│ ├── runners # Execution environments +│ ├── sdk # Software Development Kit +│ ├── std # Standard library extensions +│ ├── stores # Storage implementations +│ ├── testing-utils # Testing utilities and helpers +│ └── utils # Common utilities and helpers +├── .config # Configuration files +└── rust-toolchain.toml # Rust version and components ``` ## 📋 Prerequisites diff --git a/cli/Cargo.toml b/cli/Cargo.toml index 04ef7a4b1..333fd1a25 100644 --- a/cli/Cargo.toml +++ b/cli/Cargo.toml @@ -46,7 +46,7 @@ gadget-crypto-core = { workspace = true, features = ["clap"] } gadget-keystore = { workspace = true } # Optional crypto dependencies -w3f-bls = { workspace = true, optional = true } +tnt-bls = { workspace = true, optional = true } # Optional dependencies based on features tangle-subxt = { workspace = true, features = ["std"], optional = true } diff --git a/crates/clients/eigenlayer/src/client.rs b/crates/clients/eigenlayer/src/client.rs index 98fc1a4c7..dfcb2dbef 100644 --- a/crates/clients/eigenlayer/src/client.rs +++ b/crates/clients/eigenlayer/src/client.rs @@ -67,7 +67,7 @@ impl EigenlayerClient { pub async fn get_slasher_address(&self, delegation_manager_addr: Address) -> Result
{ let provider = self.get_provider_http(); let delegation_manager = - eigensdk::utils::middleware::delegationmanager::DelegationManager::DelegationManagerInstance::new( + eigensdk::utils::core::delegationmanager::DelegationManager::DelegationManagerInstance::new( delegation_manager_addr, provider, ); diff --git a/crates/clients/tangle/src/services.rs b/crates/clients/tangle/src/services.rs index 8a7d55dbf..4245df92c 100644 --- a/crates/clients/tangle/src/services.rs +++ b/crates/clients/tangle/src/services.rs @@ -45,7 +45,6 @@ where /// # Errors /// /// Returns an error if the Blueprint could not be fetched - // TODO: @donovan this method is equivalent to `current_blueprint`. Should we remove it? pub async fn get_blueprint_by_id( &self, at: [u8; 32], @@ -85,21 +84,6 @@ where Ok(ret) } - /// Get the current Blueprint information - pub async fn current_blueprint( - &self, - at: [u8; 32], - blueprint_id: u64, - ) -> Result { - let call = api::storage().services().blueprints(blueprint_id); - let at = BlockRef::from_hash(H256::from_slice(&at)); - let ret = self.rpc_client.storage().at(at).fetch(&call).await?; - match ret { - Some(blueprints) => Ok(blueprints.1), - None => Err(Error::Other("Blueprint not found".to_string())), - } - } - /// Query the current Blueprint owner pub async fn current_blueprint_owner( &self, diff --git a/crates/crypto/bls/Cargo.toml b/crates/crypto/bls/Cargo.toml index d77ef5210..7ae69d494 100644 --- a/crates/crypto/bls/Cargo.toml +++ b/crates/crypto/bls/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "gadget-crypto-bls" version = "0.1.0" -description = "w3f-bls crypto primitives for Tangle Blueprints" +description = "tnt-bls crypto primitives for Tangle Blueprints" authors.workspace = true edition.workspace = true license.workspace = true @@ -11,7 +11,7 @@ repository.workspace = true [dependencies] gadget-crypto-core = { workspace = true, features = ["bls"] } gadget-std = { workspace = true } -w3f-bls = { workspace = true } +tnt-bls = { workspace = true } serde = { workspace = true } serde_bytes = { workspace = true, features = ["alloc"] } ark-serialize = { workspace = true } @@ -32,5 +32,5 @@ std = [ "serde/std", "serde_json/std", "serde_bytes/std", - "w3f-bls/std", + "tnt-bls/std", ] \ No newline at end of file diff --git a/crates/crypto/bls/src/lib.rs b/crates/crypto/bls/src/lib.rs index 32e8979f1..89c5021e4 100644 --- a/crates/crypto/bls/src/lib.rs +++ b/crates/crypto/bls/src/lib.rs @@ -100,7 +100,7 @@ macro_rules! define_bls_key { use crate::from_bytes; use gadget_crypto_core::{KeyType, KeyTypeId, KeyEncoding}; use gadget_std::{UniformRand, string::{String, ToString}}; - use w3f_bls::{Message, PublicKey, SecretKey, SerializableToBytes, Signature, []}; + use tnt_bls::{Message, PublicKey, SecretKey, SerializableToBytes, Signature, []}; #[doc = $ty:upper] /// key type diff --git a/crates/crypto/bls/src/tests.rs b/crates/crypto/bls/src/tests.rs index 47726a821..599ac7f30 100644 --- a/crates/crypto/bls/src/tests.rs +++ b/crates/crypto/bls/src/tests.rs @@ -23,7 +23,7 @@ mod bls381_crypto_tests { mod bls377_tests { use super::*; - use ::w3f_bls::SerializableToBytes; + use ::tnt_bls::SerializableToBytes; use gadget_crypto_hashing::sha2_256; #[test] @@ -110,7 +110,7 @@ mod bls377_tests { mod bls381_tests { use super::*; - use ::w3f_bls::SerializableToBytes; + use ::tnt_bls::SerializableToBytes; use gadget_crypto_hashing::sha2_256; #[test] diff --git a/crates/eigenlayer-bindings/src/lib.rs b/crates/eigenlayer-bindings/src/lib.rs index 4244d1ff9..00e1f3ddc 100644 --- a/crates/eigenlayer-bindings/src/lib.rs +++ b/crates/eigenlayer-bindings/src/lib.rs @@ -1,4 +1,5 @@ pub mod ecdsa_stake_registry; pub mod incredible_squaring_task_manager; pub mod ipauser_registry; +pub mod pauser_registry; pub mod registry_coordinator; diff --git a/crates/eigenlayer-bindings/src/pauser_registry.rs b/crates/eigenlayer-bindings/src/pauser_registry.rs new file mode 100644 index 000000000..06c0bfce6 --- /dev/null +++ b/crates/eigenlayer-bindings/src/pauser_registry.rs @@ -0,0 +1,1264 @@ +#![allow(clippy::all, warnings)] + +#[allow( + non_camel_case_types, + non_snake_case, + clippy::pub_underscore_fields, + clippy::style +)] +pub mod PauserRegistry { + use super::*; + use alloy_sol_types; + /// The creation / init bytecode of the contract. + /// + /// ```text + ///0x608060405234801561000f575f5ffd5b5060405161073638038061073683398101604081905261002e91610253565b5f5b825181101561006b5761006383828151811061004e5761004e61032f565b6020026020010151600161007c60201b60201c565b600101610030565b506100758161014d565b5050610343565b6001600160a01b0382166100ed5760405162461bcd60e51b815260206004820152602d60248201527f50617573657252656769737472792e5f7365745061757365723a207a65726f2060448201526c1859191c995cdcc81a5b9c1d5d609a1b60648201526084015b60405180910390fd5b6001600160a01b0382165f8181526020818152604091829020805460ff19168515159081179091558251938452908301527f65d3a1fd4c13f05cba164f80d03ce90fb4b5e21946bfc3ab7dbd434c2d0b9152910160405180910390a15050565b6001600160a01b0381166101bb5760405162461bcd60e51b815260206004820152602f60248201527f50617573657252656769737472792e5f736574556e7061757365723a207a657260448201526e1bc81859191c995cdcc81a5b9c1d5d608a1b60648201526084016100e4565b600154604080516001600160a01b03928316815291831660208301527f06b4167a2528887a1e97a366eefe8549bfbf1ea3e6ac81cb2564a934d20e8892910160405180910390a1600180546001600160a01b0319166001600160a01b0392909216919091179055565b634e487b7160e01b5f52604160045260245ffd5b80516001600160a01b038116811461024e575f5ffd5b919050565b5f5f60408385031215610264575f5ffd5b82516001600160401b03811115610279575f5ffd5b8301601f81018513610289575f5ffd5b80516001600160401b038111156102a2576102a2610224565b604051600582901b90603f8201601f191681016001600160401b03811182821017156102d0576102d0610224565b6040529182526020818401810192908101888411156102ed575f5ffd5b6020850194505b838510156103135761030585610238565b8152602094850194016102f4565b5094506103269250505060208401610238565b90509250929050565b634e487b7160e01b5f52603260045260245ffd5b6103e6806103505f395ff3fe608060405234801561000f575f5ffd5b506004361061004a575f3560e01c806346fbf68e1461004e5780638568520614610085578063ce5484281461009a578063eab66d7a146100ad575b5f5ffd5b61007061005c36600461030d565b5f6020819052908152604090205460ff1681565b60405190151581526020015b60405180910390f35b61009861009336600461032d565b6100d8565b005b6100986100a836600461030d565b610119565b6001546100c0906001600160a01b031681565b6040516001600160a01b03909116815260200161007c565b6001546001600160a01b0316331461010b5760405162461bcd60e51b815260040161010290610366565b60405180910390fd5b610115828261014f565b5050565b6001546001600160a01b031633146101435760405162461bcd60e51b815260040161010290610366565b61014c8161021b565b50565b6001600160a01b0382166101bb5760405162461bcd60e51b815260206004820152602d60248201527f50617573657252656769737472792e5f7365745061757365723a207a65726f2060448201526c1859191c995cdcc81a5b9c1d5d609a1b6064820152608401610102565b6001600160a01b0382165f8181526020818152604091829020805460ff19168515159081179091558251938452908301527f65d3a1fd4c13f05cba164f80d03ce90fb4b5e21946bfc3ab7dbd434c2d0b9152910160405180910390a15050565b6001600160a01b0381166102895760405162461bcd60e51b815260206004820152602f60248201527f50617573657252656769737472792e5f736574556e7061757365723a207a657260448201526e1bc81859191c995cdcc81a5b9c1d5d608a1b6064820152608401610102565b600154604080516001600160a01b03928316815291831660208301527f06b4167a2528887a1e97a366eefe8549bfbf1ea3e6ac81cb2564a934d20e8892910160405180910390a1600180546001600160a01b0319166001600160a01b0392909216919091179055565b80356001600160a01b0381168114610308575f5ffd5b919050565b5f6020828403121561031d575f5ffd5b610326826102f2565b9392505050565b5f5f6040838503121561033e575f5ffd5b610347836102f2565b91506020830135801515811461035b575f5ffd5b809150509250929050565b6020808252602a908201527f6d73672e73656e646572206973206e6f74207065726d697373696f6e6564206160408201526939903ab73830bab9b2b960b11b60608201526080019056fea2646970667358221220bad9bc7e5840c034ce8eb3bf0529db3b114379ed30673ef2860d67336dc90c2e64736f6c634300081b0033 + /// ``` + #[rustfmt::skip] + #[allow(clippy::all)] + pub static BYTECODE: alloy_sol_types::private::Bytes = alloy_sol_types::private::Bytes::from_static( + b"`\x80`@R4\x80\x15a\0\x0FW__\xFD[P`@Qa\x0768\x03\x80a\x076\x839\x81\x01`@\x81\x90Ra\0.\x91a\x02SV[_[\x82Q\x81\x10\x15a\0kWa\0c\x83\x82\x81Q\x81\x10a\0NWa\0Na\x03/V[` \x02` \x01\x01Q`\x01a\0|` \x1B` \x1CV[`\x01\x01a\x000V[Pa\0u\x81a\x01MV[PPa\x03CV[`\x01`\x01`\xA0\x1B\x03\x82\x16a\0\xEDW`@QbF\x1B\xCD`\xE5\x1B\x81R` `\x04\x82\x01R`-`$\x82\x01R\x7FPauserRegistry._setPauser: zero `D\x82\x01Rl\x18Y\x19\x1C\x99\\\xDC\xC8\x1A[\x9C\x1D]`\x9A\x1B`d\x82\x01R`\x84\x01[`@Q\x80\x91\x03\x90\xFD[`\x01`\x01`\xA0\x1B\x03\x82\x16_\x81\x81R` \x81\x81R`@\x91\x82\x90 \x80T`\xFF\x19\x16\x85\x15\x15\x90\x81\x17\x90\x91U\x82Q\x93\x84R\x90\x83\x01R\x7Fe\xD3\xA1\xFDL\x13\xF0\\\xBA\x16O\x80\xD0<\xE9\x0F\xB4\xB5\xE2\x19F\xBF\xC3\xAB}\xBDCL-\x0B\x91R\x91\x01`@Q\x80\x91\x03\x90\xA1PPV[`\x01`\x01`\xA0\x1B\x03\x81\x16a\x01\xBBW`@QbF\x1B\xCD`\xE5\x1B\x81R` `\x04\x82\x01R`/`$\x82\x01R\x7FPauserRegistry._setUnpauser: zer`D\x82\x01Rn\x1B\xC8\x18Y\x19\x1C\x99\\\xDC\xC8\x1A[\x9C\x1D]`\x8A\x1B`d\x82\x01R`\x84\x01a\0\xE4V[`\x01T`@\x80Q`\x01`\x01`\xA0\x1B\x03\x92\x83\x16\x81R\x91\x83\x16` \x83\x01R\x7F\x06\xB4\x16z%(\x88z\x1E\x97\xA3f\xEE\xFE\x85I\xBF\xBF\x1E\xA3\xE6\xAC\x81\xCB%d\xA94\xD2\x0E\x88\x92\x91\x01`@Q\x80\x91\x03\x90\xA1`\x01\x80T`\x01`\x01`\xA0\x1B\x03\x19\x16`\x01`\x01`\xA0\x1B\x03\x92\x90\x92\x16\x91\x90\x91\x17\x90UV[cNH{q`\xE0\x1B_R`A`\x04R`$_\xFD[\x80Q`\x01`\x01`\xA0\x1B\x03\x81\x16\x81\x14a\x02NW__\xFD[\x91\x90PV[__`@\x83\x85\x03\x12\x15a\x02dW__\xFD[\x82Q`\x01`\x01`@\x1B\x03\x81\x11\x15a\x02yW__\xFD[\x83\x01`\x1F\x81\x01\x85\x13a\x02\x89W__\xFD[\x80Q`\x01`\x01`@\x1B\x03\x81\x11\x15a\x02\xA2Wa\x02\xA2a\x02$V[`@Q`\x05\x82\x90\x1B\x90`?\x82\x01`\x1F\x19\x16\x81\x01`\x01`\x01`@\x1B\x03\x81\x11\x82\x82\x10\x17\x15a\x02\xD0Wa\x02\xD0a\x02$V[`@R\x91\x82R` \x81\x84\x01\x81\x01\x92\x90\x81\x01\x88\x84\x11\x15a\x02\xEDW__\xFD[` \x85\x01\x94P[\x83\x85\x10\x15a\x03\x13Wa\x03\x05\x85a\x028V[\x81R` \x94\x85\x01\x94\x01a\x02\xF4V[P\x94Pa\x03&\x92PPP` \x84\x01a\x028V[\x90P\x92P\x92\x90PV[cNH{q`\xE0\x1B_R`2`\x04R`$_\xFD[a\x03\xE6\x80a\x03P_9_\xF3\xFE`\x80`@R4\x80\x15a\0\x0FW__\xFD[P`\x046\x10a\0JW_5`\xE0\x1C\x80cF\xFB\xF6\x8E\x14a\0NW\x80c\x85hR\x06\x14a\0\x85W\x80c\xCET\x84(\x14a\0\x9AW\x80c\xEA\xB6mz\x14a\0\xADW[__\xFD[a\0pa\0\\6`\x04a\x03\rV[_` \x81\x90R\x90\x81R`@\x90 T`\xFF\x16\x81V[`@Q\x90\x15\x15\x81R` \x01[`@Q\x80\x91\x03\x90\xF3[a\0\x98a\0\x936`\x04a\x03-V[a\0\xD8V[\0[a\0\x98a\0\xA86`\x04a\x03\rV[a\x01\x19V[`\x01Ta\0\xC0\x90`\x01`\x01`\xA0\x1B\x03\x16\x81V[`@Q`\x01`\x01`\xA0\x1B\x03\x90\x91\x16\x81R` \x01a\0|V[`\x01T`\x01`\x01`\xA0\x1B\x03\x163\x14a\x01\x0BW`@QbF\x1B\xCD`\xE5\x1B\x81R`\x04\x01a\x01\x02\x90a\x03fV[`@Q\x80\x91\x03\x90\xFD[a\x01\x15\x82\x82a\x01OV[PPV[`\x01T`\x01`\x01`\xA0\x1B\x03\x163\x14a\x01CW`@QbF\x1B\xCD`\xE5\x1B\x81R`\x04\x01a\x01\x02\x90a\x03fV[a\x01L\x81a\x02\x1BV[PV[`\x01`\x01`\xA0\x1B\x03\x82\x16a\x01\xBBW`@QbF\x1B\xCD`\xE5\x1B\x81R` `\x04\x82\x01R`-`$\x82\x01R\x7FPauserRegistry._setPauser: zero `D\x82\x01Rl\x18Y\x19\x1C\x99\\\xDC\xC8\x1A[\x9C\x1D]`\x9A\x1B`d\x82\x01R`\x84\x01a\x01\x02V[`\x01`\x01`\xA0\x1B\x03\x82\x16_\x81\x81R` \x81\x81R`@\x91\x82\x90 \x80T`\xFF\x19\x16\x85\x15\x15\x90\x81\x17\x90\x91U\x82Q\x93\x84R\x90\x83\x01R\x7Fe\xD3\xA1\xFDL\x13\xF0\\\xBA\x16O\x80\xD0<\xE9\x0F\xB4\xB5\xE2\x19F\xBF\xC3\xAB}\xBDCL-\x0B\x91R\x91\x01`@Q\x80\x91\x03\x90\xA1PPV[`\x01`\x01`\xA0\x1B\x03\x81\x16a\x02\x89W`@QbF\x1B\xCD`\xE5\x1B\x81R` `\x04\x82\x01R`/`$\x82\x01R\x7FPauserRegistry._setUnpauser: zer`D\x82\x01Rn\x1B\xC8\x18Y\x19\x1C\x99\\\xDC\xC8\x1A[\x9C\x1D]`\x8A\x1B`d\x82\x01R`\x84\x01a\x01\x02V[`\x01T`@\x80Q`\x01`\x01`\xA0\x1B\x03\x92\x83\x16\x81R\x91\x83\x16` \x83\x01R\x7F\x06\xB4\x16z%(\x88z\x1E\x97\xA3f\xEE\xFE\x85I\xBF\xBF\x1E\xA3\xE6\xAC\x81\xCB%d\xA94\xD2\x0E\x88\x92\x91\x01`@Q\x80\x91\x03\x90\xA1`\x01\x80T`\x01`\x01`\xA0\x1B\x03\x19\x16`\x01`\x01`\xA0\x1B\x03\x92\x90\x92\x16\x91\x90\x91\x17\x90UV[\x805`\x01`\x01`\xA0\x1B\x03\x81\x16\x81\x14a\x03\x08W__\xFD[\x91\x90PV[_` \x82\x84\x03\x12\x15a\x03\x1DW__\xFD[a\x03&\x82a\x02\xF2V[\x93\x92PPPV[__`@\x83\x85\x03\x12\x15a\x03>W__\xFD[a\x03G\x83a\x02\xF2V[\x91P` \x83\x015\x80\x15\x15\x81\x14a\x03[W__\xFD[\x80\x91PP\x92P\x92\x90PV[` \x80\x82R`*\x90\x82\x01R\x7Fmsg.sender is not permissioned a`@\x82\x01Ri9\x90:\xB780\xBA\xB9\xB2\xB9`\xB1\x1B``\x82\x01R`\x80\x01\x90V\xFE\xA2dipfsX\"\x12 \xBA\xD9\xBC~X@\xC04\xCE\x8E\xB3\xBF\x05)\xDB;\x11Cy\xED0g>\xF2\x86\rg3m\xC9\x0C.dsolcC\0\x08\x1B\x003", + ); + /// The runtime bytecode of the contract, as deployed on the network. + /// + /// ```text + ///0x608060405234801561000f575f5ffd5b506004361061004a575f3560e01c806346fbf68e1461004e5780638568520614610085578063ce5484281461009a578063eab66d7a146100ad575b5f5ffd5b61007061005c36600461030d565b5f6020819052908152604090205460ff1681565b60405190151581526020015b60405180910390f35b61009861009336600461032d565b6100d8565b005b6100986100a836600461030d565b610119565b6001546100c0906001600160a01b031681565b6040516001600160a01b03909116815260200161007c565b6001546001600160a01b0316331461010b5760405162461bcd60e51b815260040161010290610366565b60405180910390fd5b610115828261014f565b5050565b6001546001600160a01b031633146101435760405162461bcd60e51b815260040161010290610366565b61014c8161021b565b50565b6001600160a01b0382166101bb5760405162461bcd60e51b815260206004820152602d60248201527f50617573657252656769737472792e5f7365745061757365723a207a65726f2060448201526c1859191c995cdcc81a5b9c1d5d609a1b6064820152608401610102565b6001600160a01b0382165f8181526020818152604091829020805460ff19168515159081179091558251938452908301527f65d3a1fd4c13f05cba164f80d03ce90fb4b5e21946bfc3ab7dbd434c2d0b9152910160405180910390a15050565b6001600160a01b0381166102895760405162461bcd60e51b815260206004820152602f60248201527f50617573657252656769737472792e5f736574556e7061757365723a207a657260448201526e1bc81859191c995cdcc81a5b9c1d5d608a1b6064820152608401610102565b600154604080516001600160a01b03928316815291831660208301527f06b4167a2528887a1e97a366eefe8549bfbf1ea3e6ac81cb2564a934d20e8892910160405180910390a1600180546001600160a01b0319166001600160a01b0392909216919091179055565b80356001600160a01b0381168114610308575f5ffd5b919050565b5f6020828403121561031d575f5ffd5b610326826102f2565b9392505050565b5f5f6040838503121561033e575f5ffd5b610347836102f2565b91506020830135801515811461035b575f5ffd5b809150509250929050565b6020808252602a908201527f6d73672e73656e646572206973206e6f74207065726d697373696f6e6564206160408201526939903ab73830bab9b2b960b11b60608201526080019056fea2646970667358221220bad9bc7e5840c034ce8eb3bf0529db3b114379ed30673ef2860d67336dc90c2e64736f6c634300081b0033 + /// ``` + #[rustfmt::skip] + #[allow(clippy::all)] + pub static DEPLOYED_BYTECODE: alloy_sol_types::private::Bytes = alloy_sol_types::private::Bytes::from_static( + b"`\x80`@R4\x80\x15a\0\x0FW__\xFD[P`\x046\x10a\0JW_5`\xE0\x1C\x80cF\xFB\xF6\x8E\x14a\0NW\x80c\x85hR\x06\x14a\0\x85W\x80c\xCET\x84(\x14a\0\x9AW\x80c\xEA\xB6mz\x14a\0\xADW[__\xFD[a\0pa\0\\6`\x04a\x03\rV[_` \x81\x90R\x90\x81R`@\x90 T`\xFF\x16\x81V[`@Q\x90\x15\x15\x81R` \x01[`@Q\x80\x91\x03\x90\xF3[a\0\x98a\0\x936`\x04a\x03-V[a\0\xD8V[\0[a\0\x98a\0\xA86`\x04a\x03\rV[a\x01\x19V[`\x01Ta\0\xC0\x90`\x01`\x01`\xA0\x1B\x03\x16\x81V[`@Q`\x01`\x01`\xA0\x1B\x03\x90\x91\x16\x81R` \x01a\0|V[`\x01T`\x01`\x01`\xA0\x1B\x03\x163\x14a\x01\x0BW`@QbF\x1B\xCD`\xE5\x1B\x81R`\x04\x01a\x01\x02\x90a\x03fV[`@Q\x80\x91\x03\x90\xFD[a\x01\x15\x82\x82a\x01OV[PPV[`\x01T`\x01`\x01`\xA0\x1B\x03\x163\x14a\x01CW`@QbF\x1B\xCD`\xE5\x1B\x81R`\x04\x01a\x01\x02\x90a\x03fV[a\x01L\x81a\x02\x1BV[PV[`\x01`\x01`\xA0\x1B\x03\x82\x16a\x01\xBBW`@QbF\x1B\xCD`\xE5\x1B\x81R` `\x04\x82\x01R`-`$\x82\x01R\x7FPauserRegistry._setPauser: zero `D\x82\x01Rl\x18Y\x19\x1C\x99\\\xDC\xC8\x1A[\x9C\x1D]`\x9A\x1B`d\x82\x01R`\x84\x01a\x01\x02V[`\x01`\x01`\xA0\x1B\x03\x82\x16_\x81\x81R` \x81\x81R`@\x91\x82\x90 \x80T`\xFF\x19\x16\x85\x15\x15\x90\x81\x17\x90\x91U\x82Q\x93\x84R\x90\x83\x01R\x7Fe\xD3\xA1\xFDL\x13\xF0\\\xBA\x16O\x80\xD0<\xE9\x0F\xB4\xB5\xE2\x19F\xBF\xC3\xAB}\xBDCL-\x0B\x91R\x91\x01`@Q\x80\x91\x03\x90\xA1PPV[`\x01`\x01`\xA0\x1B\x03\x81\x16a\x02\x89W`@QbF\x1B\xCD`\xE5\x1B\x81R` `\x04\x82\x01R`/`$\x82\x01R\x7FPauserRegistry._setUnpauser: zer`D\x82\x01Rn\x1B\xC8\x18Y\x19\x1C\x99\\\xDC\xC8\x1A[\x9C\x1D]`\x8A\x1B`d\x82\x01R`\x84\x01a\x01\x02V[`\x01T`@\x80Q`\x01`\x01`\xA0\x1B\x03\x92\x83\x16\x81R\x91\x83\x16` \x83\x01R\x7F\x06\xB4\x16z%(\x88z\x1E\x97\xA3f\xEE\xFE\x85I\xBF\xBF\x1E\xA3\xE6\xAC\x81\xCB%d\xA94\xD2\x0E\x88\x92\x91\x01`@Q\x80\x91\x03\x90\xA1`\x01\x80T`\x01`\x01`\xA0\x1B\x03\x19\x16`\x01`\x01`\xA0\x1B\x03\x92\x90\x92\x16\x91\x90\x91\x17\x90UV[\x805`\x01`\x01`\xA0\x1B\x03\x81\x16\x81\x14a\x03\x08W__\xFD[\x91\x90PV[_` \x82\x84\x03\x12\x15a\x03\x1DW__\xFD[a\x03&\x82a\x02\xF2V[\x93\x92PPPV[__`@\x83\x85\x03\x12\x15a\x03>W__\xFD[a\x03G\x83a\x02\xF2V[\x91P` \x83\x015\x80\x15\x15\x81\x14a\x03[W__\xFD[\x80\x91PP\x92P\x92\x90PV[` \x80\x82R`*\x90\x82\x01R\x7Fmsg.sender is not permissioned a`@\x82\x01Ri9\x90:\xB780\xBA\xB9\xB2\xB9`\xB1\x1B``\x82\x01R`\x80\x01\x90V\xFE\xA2dipfsX\"\x12 \xBA\xD9\xBC~X@\xC04\xCE\x8E\xB3\xBF\x05)\xDB;\x11Cy\xED0g>\xF2\x86\rg3m\xC9\x0C.dsolcC\0\x08\x1B\x003", + ); + /**Event with signature `PauserStatusChanged(address,bool)` and selector `0x65d3a1fd4c13f05cba164f80d03ce90fb4b5e21946bfc3ab7dbd434c2d0b9152`. + ```solidity + event PauserStatusChanged(address pauser, bool canPause); + ```*/ + #[allow( + non_camel_case_types, + non_snake_case, + clippy::pub_underscore_fields, + clippy::style + )] + #[derive(Clone)] + pub struct PauserStatusChanged { + #[allow(missing_docs)] + pub pauser: alloy_sol_types::private::Address, + #[allow(missing_docs)] + pub canPause: bool, + } + #[allow( + non_camel_case_types, + non_snake_case, + clippy::pub_underscore_fields, + clippy::style + )] + const _: () = { + use alloy_sol_types; + #[automatically_derived] + impl alloy_sol_types::SolEvent for PauserStatusChanged { + type DataTuple<'a> = ( + alloy_sol_types::sol_data::Address, + alloy_sol_types::sol_data::Bool, + ); + type DataToken<'a> = as alloy_sol_types::SolType>::Token<'a>; + type TopicList = (alloy_sol_types::sol_data::FixedBytes<32>,); + const SIGNATURE: &'static str = "PauserStatusChanged(address,bool)"; + const SIGNATURE_HASH: alloy_sol_types::private::B256 = + alloy_sol_types::private::B256::new([ + 101u8, 211u8, 161u8, 253u8, 76u8, 19u8, 240u8, 92u8, 186u8, 22u8, 79u8, 128u8, + 208u8, 60u8, 233u8, 15u8, 180u8, 181u8, 226u8, 25u8, 70u8, 191u8, 195u8, 171u8, + 125u8, 189u8, 67u8, 76u8, 45u8, 11u8, 145u8, 82u8, + ]); + const ANONYMOUS: bool = false; + #[allow(unused_variables)] + #[inline] + fn new( + topics: ::RustType, + data: as alloy_sol_types::SolType>::RustType, + ) -> Self { + Self { + pauser: data.0, + canPause: data.1, + } + } + #[inline] + fn check_signature( + topics: &::RustType, + ) -> alloy_sol_types::Result<()> { + if topics.0 != Self::SIGNATURE_HASH { + return Err(alloy_sol_types::Error::invalid_event_signature_hash( + Self::SIGNATURE, + topics.0, + Self::SIGNATURE_HASH, + )); + } + Ok(()) + } + #[inline] + fn tokenize_body(&self) -> Self::DataToken<'_> { + ( + ::tokenize( + &self.pauser, + ), + ::tokenize( + &self.canPause, + ), + ) + } + #[inline] + fn topics(&self) -> ::RustType { + (Self::SIGNATURE_HASH.into(),) + } + #[inline] + fn encode_topics_raw( + &self, + out: &mut [alloy_sol_types::abi::token::WordToken], + ) -> alloy_sol_types::Result<()> { + if out.len() < ::COUNT { + return Err(alloy_sol_types::Error::Overrun); + } + out[0usize] = alloy_sol_types::abi::token::WordToken(Self::SIGNATURE_HASH); + Ok(()) + } + } + #[automatically_derived] + impl alloy_sol_types::private::IntoLogData for PauserStatusChanged { + fn to_log_data(&self) -> alloy_sol_types::private::LogData { + From::from(self) + } + fn into_log_data(self) -> alloy_sol_types::private::LogData { + From::from(&self) + } + } + #[automatically_derived] + impl From<&PauserStatusChanged> for alloy_sol_types::private::LogData { + #[inline] + fn from(this: &PauserStatusChanged) -> alloy_sol_types::private::LogData { + alloy_sol_types::SolEvent::encode_log_data(this) + } + } + }; + /**Event with signature `UnpauserChanged(address,address)` and selector `0x06b4167a2528887a1e97a366eefe8549bfbf1ea3e6ac81cb2564a934d20e8892`. + ```solidity + event UnpauserChanged(address previousUnpauser, address newUnpauser); + ```*/ + #[allow( + non_camel_case_types, + non_snake_case, + clippy::pub_underscore_fields, + clippy::style + )] + #[derive(Clone)] + pub struct UnpauserChanged { + #[allow(missing_docs)] + pub previousUnpauser: alloy_sol_types::private::Address, + #[allow(missing_docs)] + pub newUnpauser: alloy_sol_types::private::Address, + } + #[allow( + non_camel_case_types, + non_snake_case, + clippy::pub_underscore_fields, + clippy::style + )] + const _: () = { + use alloy_sol_types; + #[automatically_derived] + impl alloy_sol_types::SolEvent for UnpauserChanged { + type DataTuple<'a> = ( + alloy_sol_types::sol_data::Address, + alloy_sol_types::sol_data::Address, + ); + type DataToken<'a> = as alloy_sol_types::SolType>::Token<'a>; + type TopicList = (alloy_sol_types::sol_data::FixedBytes<32>,); + const SIGNATURE: &'static str = "UnpauserChanged(address,address)"; + const SIGNATURE_HASH: alloy_sol_types::private::B256 = + alloy_sol_types::private::B256::new([ + 6u8, 180u8, 22u8, 122u8, 37u8, 40u8, 136u8, 122u8, 30u8, 151u8, 163u8, 102u8, + 238u8, 254u8, 133u8, 73u8, 191u8, 191u8, 30u8, 163u8, 230u8, 172u8, 129u8, + 203u8, 37u8, 100u8, 169u8, 52u8, 210u8, 14u8, 136u8, 146u8, + ]); + const ANONYMOUS: bool = false; + #[allow(unused_variables)] + #[inline] + fn new( + topics: ::RustType, + data: as alloy_sol_types::SolType>::RustType, + ) -> Self { + Self { + previousUnpauser: data.0, + newUnpauser: data.1, + } + } + #[inline] + fn check_signature( + topics: &::RustType, + ) -> alloy_sol_types::Result<()> { + if topics.0 != Self::SIGNATURE_HASH { + return Err(alloy_sol_types::Error::invalid_event_signature_hash( + Self::SIGNATURE, + topics.0, + Self::SIGNATURE_HASH, + )); + } + Ok(()) + } + #[inline] + fn tokenize_body(&self) -> Self::DataToken<'_> { + ( + ::tokenize( + &self.previousUnpauser, + ), + ::tokenize( + &self.newUnpauser, + ), + ) + } + #[inline] + fn topics(&self) -> ::RustType { + (Self::SIGNATURE_HASH.into(),) + } + #[inline] + fn encode_topics_raw( + &self, + out: &mut [alloy_sol_types::abi::token::WordToken], + ) -> alloy_sol_types::Result<()> { + if out.len() < ::COUNT { + return Err(alloy_sol_types::Error::Overrun); + } + out[0usize] = alloy_sol_types::abi::token::WordToken(Self::SIGNATURE_HASH); + Ok(()) + } + } + #[automatically_derived] + impl alloy_sol_types::private::IntoLogData for UnpauserChanged { + fn to_log_data(&self) -> alloy_sol_types::private::LogData { + From::from(self) + } + fn into_log_data(self) -> alloy_sol_types::private::LogData { + From::from(&self) + } + } + #[automatically_derived] + impl From<&UnpauserChanged> for alloy_sol_types::private::LogData { + #[inline] + fn from(this: &UnpauserChanged) -> alloy_sol_types::private::LogData { + alloy_sol_types::SolEvent::encode_log_data(this) + } + } + }; + /**Constructor`. + ```solidity + constructor(address[] _pausers, address _unpauser); + ```*/ + #[allow(non_camel_case_types, non_snake_case, clippy::pub_underscore_fields)] + #[derive(Clone)] + pub struct constructorCall { + pub _pausers: alloy_sol_types::private::Vec, + pub _unpauser: alloy_sol_types::private::Address, + } + const _: () = { + use alloy_sol_types; + { + #[doc(hidden)] + type UnderlyingSolTuple<'a> = ( + alloy_sol_types::sol_data::Array, + alloy_sol_types::sol_data::Address, + ); + #[doc(hidden)] + type UnderlyingRustTuple<'a> = ( + alloy_sol_types::private::Vec, + alloy_sol_types::private::Address, + ); + #[cfg(test)] + #[allow(dead_code, unreachable_patterns)] + fn _type_assertion(_t: alloy_sol_types::private::AssertTypeEq) { + match _t { + alloy_sol_types::private::AssertTypeEq::< + ::RustType, + >(_) => {} + } + } + #[automatically_derived] + #[doc(hidden)] + impl ::core::convert::From for UnderlyingRustTuple<'_> { + fn from(value: constructorCall) -> Self { + (value._pausers, value._unpauser) + } + } + #[automatically_derived] + #[doc(hidden)] + impl ::core::convert::From> for constructorCall { + fn from(tuple: UnderlyingRustTuple<'_>) -> Self { + Self { + _pausers: tuple.0, + _unpauser: tuple.1, + } + } + } + } + #[automatically_derived] + impl alloy_sol_types::SolConstructor for constructorCall { + type Parameters<'a> = ( + alloy_sol_types::sol_data::Array, + alloy_sol_types::sol_data::Address, + ); + type Token<'a> = as alloy_sol_types::SolType>::Token<'a>; + #[inline] + fn new<'a>( + tuple: as alloy_sol_types::SolType>::RustType, + ) -> Self { + tuple.into() + } + #[inline] + fn tokenize(&self) -> Self::Token<'_> { + ( + as alloy_sol_types::SolType>::tokenize(&self._pausers), + ::tokenize( + &self._unpauser, + ), + ) + } + } + }; + /**Function with signature `isPauser(address)` and selector `0x46fbf68e`. + ```solidity + function isPauser(address) external view returns (bool); + ```*/ + #[allow(non_camel_case_types, non_snake_case, clippy::pub_underscore_fields)] + #[derive(Clone)] + pub struct isPauserCall { + pub _0: alloy_sol_types::private::Address, + } + ///Container type for the return parameters of the [`isPauser(address)`](isPauserCall) function. + #[allow(non_camel_case_types, non_snake_case, clippy::pub_underscore_fields)] + #[derive(Clone)] + pub struct isPauserReturn { + pub _0: bool, + } + #[allow( + non_camel_case_types, + non_snake_case, + clippy::pub_underscore_fields, + clippy::style + )] + const _: () = { + use alloy_sol_types; + { + #[doc(hidden)] + type UnderlyingSolTuple<'a> = (alloy_sol_types::sol_data::Address,); + #[doc(hidden)] + type UnderlyingRustTuple<'a> = (alloy_sol_types::private::Address,); + #[cfg(test)] + #[allow(dead_code, unreachable_patterns)] + fn _type_assertion(_t: alloy_sol_types::private::AssertTypeEq) { + match _t { + alloy_sol_types::private::AssertTypeEq::< + ::RustType, + >(_) => {} + } + } + #[automatically_derived] + #[doc(hidden)] + impl ::core::convert::From for UnderlyingRustTuple<'_> { + fn from(value: isPauserCall) -> Self { + (value._0,) + } + } + #[automatically_derived] + #[doc(hidden)] + impl ::core::convert::From> for isPauserCall { + fn from(tuple: UnderlyingRustTuple<'_>) -> Self { + Self { _0: tuple.0 } + } + } + } + { + #[doc(hidden)] + type UnderlyingSolTuple<'a> = (alloy_sol_types::sol_data::Bool,); + #[doc(hidden)] + type UnderlyingRustTuple<'a> = (bool,); + #[cfg(test)] + #[allow(dead_code, unreachable_patterns)] + fn _type_assertion(_t: alloy_sol_types::private::AssertTypeEq) { + match _t { + alloy_sol_types::private::AssertTypeEq::< + ::RustType, + >(_) => {} + } + } + #[automatically_derived] + #[doc(hidden)] + impl ::core::convert::From for UnderlyingRustTuple<'_> { + fn from(value: isPauserReturn) -> Self { + (value._0,) + } + } + #[automatically_derived] + #[doc(hidden)] + impl ::core::convert::From> for isPauserReturn { + fn from(tuple: UnderlyingRustTuple<'_>) -> Self { + Self { _0: tuple.0 } + } + } + } + #[automatically_derived] + impl alloy_sol_types::SolCall for isPauserCall { + type Parameters<'a> = (alloy_sol_types::sol_data::Address,); + type Token<'a> = as alloy_sol_types::SolType>::Token<'a>; + type Return = isPauserReturn; + type ReturnTuple<'a> = (alloy_sol_types::sol_data::Bool,); + type ReturnToken<'a> = as alloy_sol_types::SolType>::Token<'a>; + const SIGNATURE: &'static str = "isPauser(address)"; + const SELECTOR: [u8; 4] = [70u8, 251u8, 246u8, 142u8]; + #[inline] + fn new<'a>( + tuple: as alloy_sol_types::SolType>::RustType, + ) -> Self { + tuple.into() + } + #[inline] + fn tokenize(&self) -> Self::Token<'_> { + ( + ::tokenize( + &self._0, + ), + ) + } + #[inline] + fn abi_decode_returns( + data: &[u8], + validate: bool, + ) -> alloy_sol_types::Result { + as alloy_sol_types::SolType>::abi_decode_sequence( + data, validate, + ) + .map(Into::into) + } + } + }; + /**Function with signature `setIsPauser(address,bool)` and selector `0x85685206`. + ```solidity + function setIsPauser(address newPauser, bool canPause) external; + ```*/ + #[allow(non_camel_case_types, non_snake_case, clippy::pub_underscore_fields)] + #[derive(Clone)] + pub struct setIsPauserCall { + pub newPauser: alloy_sol_types::private::Address, + pub canPause: bool, + } + ///Container type for the return parameters of the [`setIsPauser(address,bool)`](setIsPauserCall) function. + #[allow(non_camel_case_types, non_snake_case, clippy::pub_underscore_fields)] + #[derive(Clone)] + pub struct setIsPauserReturn {} + #[allow( + non_camel_case_types, + non_snake_case, + clippy::pub_underscore_fields, + clippy::style + )] + const _: () = { + use alloy_sol_types; + { + #[doc(hidden)] + type UnderlyingSolTuple<'a> = ( + alloy_sol_types::sol_data::Address, + alloy_sol_types::sol_data::Bool, + ); + #[doc(hidden)] + type UnderlyingRustTuple<'a> = (alloy_sol_types::private::Address, bool); + #[cfg(test)] + #[allow(dead_code, unreachable_patterns)] + fn _type_assertion(_t: alloy_sol_types::private::AssertTypeEq) { + match _t { + alloy_sol_types::private::AssertTypeEq::< + ::RustType, + >(_) => {} + } + } + #[automatically_derived] + #[doc(hidden)] + impl ::core::convert::From for UnderlyingRustTuple<'_> { + fn from(value: setIsPauserCall) -> Self { + (value.newPauser, value.canPause) + } + } + #[automatically_derived] + #[doc(hidden)] + impl ::core::convert::From> for setIsPauserCall { + fn from(tuple: UnderlyingRustTuple<'_>) -> Self { + Self { + newPauser: tuple.0, + canPause: tuple.1, + } + } + } + } + { + #[doc(hidden)] + type UnderlyingSolTuple<'a> = (); + #[doc(hidden)] + type UnderlyingRustTuple<'a> = (); + #[cfg(test)] + #[allow(dead_code, unreachable_patterns)] + fn _type_assertion(_t: alloy_sol_types::private::AssertTypeEq) { + match _t { + alloy_sol_types::private::AssertTypeEq::< + ::RustType, + >(_) => {} + } + } + #[automatically_derived] + #[doc(hidden)] + impl ::core::convert::From for UnderlyingRustTuple<'_> { + fn from(value: setIsPauserReturn) -> Self { + () + } + } + #[automatically_derived] + #[doc(hidden)] + impl ::core::convert::From> for setIsPauserReturn { + fn from(tuple: UnderlyingRustTuple<'_>) -> Self { + Self {} + } + } + } + #[automatically_derived] + impl alloy_sol_types::SolCall for setIsPauserCall { + type Parameters<'a> = ( + alloy_sol_types::sol_data::Address, + alloy_sol_types::sol_data::Bool, + ); + type Token<'a> = as alloy_sol_types::SolType>::Token<'a>; + type Return = setIsPauserReturn; + type ReturnTuple<'a> = (); + type ReturnToken<'a> = as alloy_sol_types::SolType>::Token<'a>; + const SIGNATURE: &'static str = "setIsPauser(address,bool)"; + const SELECTOR: [u8; 4] = [133u8, 104u8, 82u8, 6u8]; + #[inline] + fn new<'a>( + tuple: as alloy_sol_types::SolType>::RustType, + ) -> Self { + tuple.into() + } + #[inline] + fn tokenize(&self) -> Self::Token<'_> { + ( + ::tokenize( + &self.newPauser, + ), + ::tokenize( + &self.canPause, + ), + ) + } + #[inline] + fn abi_decode_returns( + data: &[u8], + validate: bool, + ) -> alloy_sol_types::Result { + as alloy_sol_types::SolType>::abi_decode_sequence( + data, validate, + ) + .map(Into::into) + } + } + }; + /**Function with signature `setUnpauser(address)` and selector `0xce548428`. + ```solidity + function setUnpauser(address newUnpauser) external; + ```*/ + #[allow(non_camel_case_types, non_snake_case, clippy::pub_underscore_fields)] + #[derive(Clone)] + pub struct setUnpauserCall { + pub newUnpauser: alloy_sol_types::private::Address, + } + ///Container type for the return parameters of the [`setUnpauser(address)`](setUnpauserCall) function. + #[allow(non_camel_case_types, non_snake_case, clippy::pub_underscore_fields)] + #[derive(Clone)] + pub struct setUnpauserReturn {} + #[allow( + non_camel_case_types, + non_snake_case, + clippy::pub_underscore_fields, + clippy::style + )] + const _: () = { + use alloy_sol_types; + { + #[doc(hidden)] + type UnderlyingSolTuple<'a> = (alloy_sol_types::sol_data::Address,); + #[doc(hidden)] + type UnderlyingRustTuple<'a> = (alloy_sol_types::private::Address,); + #[cfg(test)] + #[allow(dead_code, unreachable_patterns)] + fn _type_assertion(_t: alloy_sol_types::private::AssertTypeEq) { + match _t { + alloy_sol_types::private::AssertTypeEq::< + ::RustType, + >(_) => {} + } + } + #[automatically_derived] + #[doc(hidden)] + impl ::core::convert::From for UnderlyingRustTuple<'_> { + fn from(value: setUnpauserCall) -> Self { + (value.newUnpauser,) + } + } + #[automatically_derived] + #[doc(hidden)] + impl ::core::convert::From> for setUnpauserCall { + fn from(tuple: UnderlyingRustTuple<'_>) -> Self { + Self { + newUnpauser: tuple.0, + } + } + } + } + { + #[doc(hidden)] + type UnderlyingSolTuple<'a> = (); + #[doc(hidden)] + type UnderlyingRustTuple<'a> = (); + #[cfg(test)] + #[allow(dead_code, unreachable_patterns)] + fn _type_assertion(_t: alloy_sol_types::private::AssertTypeEq) { + match _t { + alloy_sol_types::private::AssertTypeEq::< + ::RustType, + >(_) => {} + } + } + #[automatically_derived] + #[doc(hidden)] + impl ::core::convert::From for UnderlyingRustTuple<'_> { + fn from(value: setUnpauserReturn) -> Self { + () + } + } + #[automatically_derived] + #[doc(hidden)] + impl ::core::convert::From> for setUnpauserReturn { + fn from(tuple: UnderlyingRustTuple<'_>) -> Self { + Self {} + } + } + } + #[automatically_derived] + impl alloy_sol_types::SolCall for setUnpauserCall { + type Parameters<'a> = (alloy_sol_types::sol_data::Address,); + type Token<'a> = as alloy_sol_types::SolType>::Token<'a>; + type Return = setUnpauserReturn; + type ReturnTuple<'a> = (); + type ReturnToken<'a> = as alloy_sol_types::SolType>::Token<'a>; + const SIGNATURE: &'static str = "setUnpauser(address)"; + const SELECTOR: [u8; 4] = [206u8, 84u8, 132u8, 40u8]; + #[inline] + fn new<'a>( + tuple: as alloy_sol_types::SolType>::RustType, + ) -> Self { + tuple.into() + } + #[inline] + fn tokenize(&self) -> Self::Token<'_> { + ( + ::tokenize( + &self.newUnpauser, + ), + ) + } + #[inline] + fn abi_decode_returns( + data: &[u8], + validate: bool, + ) -> alloy_sol_types::Result { + as alloy_sol_types::SolType>::abi_decode_sequence( + data, validate, + ) + .map(Into::into) + } + } + }; + /**Function with signature `unpauser()` and selector `0xeab66d7a`. + ```solidity + function unpauser() external view returns (address); + ```*/ + #[allow(non_camel_case_types, non_snake_case, clippy::pub_underscore_fields)] + #[derive(Clone)] + pub struct unpauserCall {} + ///Container type for the return parameters of the [`unpauser()`](unpauserCall) function. + #[allow(non_camel_case_types, non_snake_case, clippy::pub_underscore_fields)] + #[derive(Clone)] + pub struct unpauserReturn { + pub _0: alloy_sol_types::private::Address, + } + #[allow( + non_camel_case_types, + non_snake_case, + clippy::pub_underscore_fields, + clippy::style + )] + const _: () = { + use alloy_sol_types; + { + #[doc(hidden)] + type UnderlyingSolTuple<'a> = (); + #[doc(hidden)] + type UnderlyingRustTuple<'a> = (); + #[cfg(test)] + #[allow(dead_code, unreachable_patterns)] + fn _type_assertion(_t: alloy_sol_types::private::AssertTypeEq) { + match _t { + alloy_sol_types::private::AssertTypeEq::< + ::RustType, + >(_) => {} + } + } + #[automatically_derived] + #[doc(hidden)] + impl ::core::convert::From for UnderlyingRustTuple<'_> { + fn from(value: unpauserCall) -> Self { + () + } + } + #[automatically_derived] + #[doc(hidden)] + impl ::core::convert::From> for unpauserCall { + fn from(tuple: UnderlyingRustTuple<'_>) -> Self { + Self {} + } + } + } + { + #[doc(hidden)] + type UnderlyingSolTuple<'a> = (alloy_sol_types::sol_data::Address,); + #[doc(hidden)] + type UnderlyingRustTuple<'a> = (alloy_sol_types::private::Address,); + #[cfg(test)] + #[allow(dead_code, unreachable_patterns)] + fn _type_assertion(_t: alloy_sol_types::private::AssertTypeEq) { + match _t { + alloy_sol_types::private::AssertTypeEq::< + ::RustType, + >(_) => {} + } + } + #[automatically_derived] + #[doc(hidden)] + impl ::core::convert::From for UnderlyingRustTuple<'_> { + fn from(value: unpauserReturn) -> Self { + (value._0,) + } + } + #[automatically_derived] + #[doc(hidden)] + impl ::core::convert::From> for unpauserReturn { + fn from(tuple: UnderlyingRustTuple<'_>) -> Self { + Self { _0: tuple.0 } + } + } + } + #[automatically_derived] + impl alloy_sol_types::SolCall for unpauserCall { + type Parameters<'a> = (); + type Token<'a> = as alloy_sol_types::SolType>::Token<'a>; + type Return = unpauserReturn; + type ReturnTuple<'a> = (alloy_sol_types::sol_data::Address,); + type ReturnToken<'a> = as alloy_sol_types::SolType>::Token<'a>; + const SIGNATURE: &'static str = "unpauser()"; + const SELECTOR: [u8; 4] = [234u8, 182u8, 109u8, 122u8]; + #[inline] + fn new<'a>( + tuple: as alloy_sol_types::SolType>::RustType, + ) -> Self { + tuple.into() + } + #[inline] + fn tokenize(&self) -> Self::Token<'_> { + () + } + #[inline] + fn abi_decode_returns( + data: &[u8], + validate: bool, + ) -> alloy_sol_types::Result { + as alloy_sol_types::SolType>::abi_decode_sequence( + data, validate, + ) + .map(Into::into) + } + } + }; + ///Container for all the [`PauserRegistry`](self) function calls. + pub enum PauserRegistryCalls { + isPauser(isPauserCall), + setIsPauser(setIsPauserCall), + setUnpauser(setUnpauserCall), + unpauser(unpauserCall), + } + #[automatically_derived] + impl PauserRegistryCalls { + /// All the selectors of this enum. + /// + /// Note that the selectors might not be in the same order as the variants. + /// No guarantees are made about the order of the selectors. + /// + /// Prefer using `SolInterface` methods instead. + pub const SELECTORS: &'static [[u8; 4usize]] = &[ + [70u8, 251u8, 246u8, 142u8], + [133u8, 104u8, 82u8, 6u8], + [206u8, 84u8, 132u8, 40u8], + [234u8, 182u8, 109u8, 122u8], + ]; + } + #[automatically_derived] + impl alloy_sol_types::SolInterface for PauserRegistryCalls { + const NAME: &'static str = "PauserRegistryCalls"; + const MIN_DATA_LENGTH: usize = 0usize; + const COUNT: usize = 4usize; + #[inline] + fn selector(&self) -> [u8; 4] { + match self { + Self::isPauser(_) => ::SELECTOR, + Self::setIsPauser(_) => ::SELECTOR, + Self::setUnpauser(_) => ::SELECTOR, + Self::unpauser(_) => ::SELECTOR, + } + } + #[inline] + fn selector_at(i: usize) -> ::core::option::Option<[u8; 4]> { + Self::SELECTORS.get(i).copied() + } + #[inline] + fn valid_selector(selector: [u8; 4]) -> bool { + Self::SELECTORS.binary_search(&selector).is_ok() + } + #[inline] + #[allow(unsafe_code, non_snake_case)] + fn abi_decode_raw( + selector: [u8; 4], + data: &[u8], + validate: bool, + ) -> alloy_sol_types::Result { + static DECODE_SHIMS: &[fn( + &[u8], + bool, + ) + -> alloy_sol_types::Result] = &[ + { + fn isPauser( + data: &[u8], + validate: bool, + ) -> alloy_sol_types::Result { + ::abi_decode_raw(data, validate) + .map(PauserRegistryCalls::isPauser) + } + isPauser + }, + { + fn setIsPauser( + data: &[u8], + validate: bool, + ) -> alloy_sol_types::Result { + ::abi_decode_raw( + data, validate, + ) + .map(PauserRegistryCalls::setIsPauser) + } + setIsPauser + }, + { + fn setUnpauser( + data: &[u8], + validate: bool, + ) -> alloy_sol_types::Result { + ::abi_decode_raw( + data, validate, + ) + .map(PauserRegistryCalls::setUnpauser) + } + setUnpauser + }, + { + fn unpauser( + data: &[u8], + validate: bool, + ) -> alloy_sol_types::Result { + ::abi_decode_raw(data, validate) + .map(PauserRegistryCalls::unpauser) + } + unpauser + }, + ]; + let Ok(idx) = Self::SELECTORS.binary_search(&selector) else { + return Err(alloy_sol_types::Error::unknown_selector( + ::NAME, + selector, + )); + }; + (unsafe { DECODE_SHIMS.get_unchecked(idx) })(data, validate) + } + #[inline] + fn abi_encoded_size(&self) -> usize { + match self { + Self::isPauser(inner) => { + ::abi_encoded_size(inner) + } + Self::setIsPauser(inner) => { + ::abi_encoded_size(inner) + } + Self::setUnpauser(inner) => { + ::abi_encoded_size(inner) + } + Self::unpauser(inner) => { + ::abi_encoded_size(inner) + } + } + } + #[inline] + fn abi_encode_raw(&self, out: &mut alloy_sol_types::private::Vec) { + match self { + Self::isPauser(inner) => { + ::abi_encode_raw(inner, out) + } + Self::setIsPauser(inner) => { + ::abi_encode_raw(inner, out) + } + Self::setUnpauser(inner) => { + ::abi_encode_raw(inner, out) + } + Self::unpauser(inner) => { + ::abi_encode_raw(inner, out) + } + } + } + } + ///Container for all the [`PauserRegistry`](self) events. + pub enum PauserRegistryEvents { + PauserStatusChanged(PauserStatusChanged), + UnpauserChanged(UnpauserChanged), + } + #[automatically_derived] + impl PauserRegistryEvents { + /// All the selectors of this enum. + /// + /// Note that the selectors might not be in the same order as the variants. + /// No guarantees are made about the order of the selectors. + /// + /// Prefer using `SolInterface` methods instead. + pub const SELECTORS: &'static [[u8; 32usize]] = &[ + [ + 6u8, 180u8, 22u8, 122u8, 37u8, 40u8, 136u8, 122u8, 30u8, 151u8, 163u8, 102u8, + 238u8, 254u8, 133u8, 73u8, 191u8, 191u8, 30u8, 163u8, 230u8, 172u8, 129u8, 203u8, + 37u8, 100u8, 169u8, 52u8, 210u8, 14u8, 136u8, 146u8, + ], + [ + 101u8, 211u8, 161u8, 253u8, 76u8, 19u8, 240u8, 92u8, 186u8, 22u8, 79u8, 128u8, + 208u8, 60u8, 233u8, 15u8, 180u8, 181u8, 226u8, 25u8, 70u8, 191u8, 195u8, 171u8, + 125u8, 189u8, 67u8, 76u8, 45u8, 11u8, 145u8, 82u8, + ], + ]; + } + #[automatically_derived] + impl alloy_sol_types::SolEventInterface for PauserRegistryEvents { + const NAME: &'static str = "PauserRegistryEvents"; + const COUNT: usize = 2usize; + fn decode_raw_log( + topics: &[alloy_sol_types::Word], + data: &[u8], + validate: bool, + ) -> alloy_sol_types::Result { + match topics.first().copied() { + Some(::SIGNATURE_HASH) => { + ::decode_raw_log( + topics, data, validate, + ) + .map(Self::PauserStatusChanged) + } + Some(::SIGNATURE_HASH) => { + ::decode_raw_log( + topics, data, validate, + ) + .map(Self::UnpauserChanged) + } + _ => alloy_sol_types::private::Err(alloy_sol_types::Error::InvalidLog { + name: ::NAME, + log: alloy_sol_types::private::Box::new( + alloy_sol_types::private::LogData::new_unchecked( + topics.to_vec(), + data.to_vec().into(), + ), + ), + }), + } + } + } + #[automatically_derived] + impl alloy_sol_types::private::IntoLogData for PauserRegistryEvents { + fn to_log_data(&self) -> alloy_sol_types::private::LogData { + match self { + Self::PauserStatusChanged(inner) => { + alloy_sol_types::private::IntoLogData::to_log_data(inner) + } + Self::UnpauserChanged(inner) => { + alloy_sol_types::private::IntoLogData::to_log_data(inner) + } + } + } + fn into_log_data(self) -> alloy_sol_types::private::LogData { + match self { + Self::PauserStatusChanged(inner) => { + alloy_sol_types::private::IntoLogData::into_log_data(inner) + } + Self::UnpauserChanged(inner) => { + alloy_sol_types::private::IntoLogData::into_log_data(inner) + } + } + } + } + use alloy_contract; + /**Creates a new wrapper around an on-chain [`PauserRegistry`](self) contract instance. + + See the [wrapper's documentation](`PauserRegistryInstance`) for more details.*/ + #[inline] + pub const fn new< + T: alloy_contract::private::Transport + ::core::clone::Clone, + P: alloy_contract::private::Provider, + N: alloy_contract::private::Network, + >( + address: alloy_sol_types::private::Address, + provider: P, + ) -> PauserRegistryInstance { + PauserRegistryInstance::::new(address, provider) + } + /**Deploys this contract using the given `provider` and constructor arguments, if any. + + Returns a new instance of the contract, if the deployment was successful. + + For more fine-grained control over the deployment process, use [`deploy_builder`] instead.*/ + #[inline] + pub fn deploy< + T: alloy_contract::private::Transport + ::core::clone::Clone, + P: alloy_contract::private::Provider, + N: alloy_contract::private::Network, + >( + provider: P, + _pausers: alloy_sol_types::private::Vec, + _unpauser: alloy_sol_types::private::Address, + ) -> impl ::core::future::Future>> + { + PauserRegistryInstance::::deploy(provider, _pausers, _unpauser) + } + /**Creates a `RawCallBuilder` for deploying this contract using the given `provider` + and constructor arguments, if any. + + This is a simple wrapper around creating a `RawCallBuilder` with the data set to + the bytecode concatenated with the constructor's ABI-encoded arguments.*/ + #[inline] + pub fn deploy_builder< + T: alloy_contract::private::Transport + ::core::clone::Clone, + P: alloy_contract::private::Provider, + N: alloy_contract::private::Network, + >( + provider: P, + _pausers: alloy_sol_types::private::Vec, + _unpauser: alloy_sol_types::private::Address, + ) -> alloy_contract::RawCallBuilder { + PauserRegistryInstance::::deploy_builder(provider, _pausers, _unpauser) + } + /**A [`PauserRegistry`](self) instance. + + Contains type-safe methods for interacting with an on-chain instance of the + [`PauserRegistry`](self) contract located at a given `address`, using a given + provider `P`. + + If the contract bytecode is available (see the [`sol!`](alloy_sol_types::sol!) + documentation on how to provide it), the `deploy` and `deploy_builder` methods can + be used to deploy a new instance of the contract. + + See the [module-level documentation](self) for all the available methods.*/ + #[derive(Clone)] + pub struct PauserRegistryInstance { + address: alloy_sol_types::private::Address, + provider: P, + _network_transport: ::core::marker::PhantomData<(N, T)>, + } + #[automatically_derived] + impl ::core::fmt::Debug for PauserRegistryInstance { + #[inline] + fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { + f.debug_tuple("PauserRegistryInstance") + .field(&self.address) + .finish() + } + } + /// Instantiation and getters/setters. + #[automatically_derived] + impl< + T: alloy_contract::private::Transport + ::core::clone::Clone, + P: alloy_contract::private::Provider, + N: alloy_contract::private::Network, + > PauserRegistryInstance + { + /**Creates a new wrapper around an on-chain [`PauserRegistry`](self) contract instance. + + See the [wrapper's documentation](`PauserRegistryInstance`) for more details.*/ + #[inline] + pub const fn new(address: alloy_sol_types::private::Address, provider: P) -> Self { + Self { + address, + provider, + _network_transport: ::core::marker::PhantomData, + } + } + /**Deploys this contract using the given `provider` and constructor arguments, if any. + + Returns a new instance of the contract, if the deployment was successful. + + For more fine-grained control over the deployment process, use [`deploy_builder`] instead.*/ + #[inline] + pub async fn deploy( + provider: P, + _pausers: alloy_sol_types::private::Vec, + _unpauser: alloy_sol_types::private::Address, + ) -> alloy_contract::Result> { + let call_builder = Self::deploy_builder(provider, _pausers, _unpauser); + let contract_address = call_builder.deploy().await?; + Ok(Self::new(contract_address, call_builder.provider)) + } + /**Creates a `RawCallBuilder` for deploying this contract using the given `provider` + and constructor arguments, if any. + + This is a simple wrapper around creating a `RawCallBuilder` with the data set to + the bytecode concatenated with the constructor's ABI-encoded arguments.*/ + #[inline] + pub fn deploy_builder( + provider: P, + _pausers: alloy_sol_types::private::Vec, + _unpauser: alloy_sol_types::private::Address, + ) -> alloy_contract::RawCallBuilder { + alloy_contract::RawCallBuilder::new_raw_deploy( + provider, + [ + &BYTECODE[..], + &alloy_sol_types::SolConstructor::abi_encode(&constructorCall { + _pausers, + _unpauser, + })[..], + ] + .concat() + .into(), + ) + } + /// Returns a reference to the address. + #[inline] + pub const fn address(&self) -> &alloy_sol_types::private::Address { + &self.address + } + /// Sets the address. + #[inline] + pub fn set_address(&mut self, address: alloy_sol_types::private::Address) { + self.address = address; + } + /// Sets the address and returns `self`. + pub fn at(mut self, address: alloy_sol_types::private::Address) -> Self { + self.set_address(address); + self + } + /// Returns a reference to the provider. + #[inline] + pub const fn provider(&self) -> &P { + &self.provider + } + } + impl PauserRegistryInstance { + /// Clones the provider and returns a new instance with the cloned provider. + #[inline] + pub fn with_cloned_provider(self) -> PauserRegistryInstance { + PauserRegistryInstance { + address: self.address, + provider: ::core::clone::Clone::clone(&self.provider), + _network_transport: ::core::marker::PhantomData, + } + } + } + /// Function calls. + #[automatically_derived] + impl< + T: alloy_contract::private::Transport + ::core::clone::Clone, + P: alloy_contract::private::Provider, + N: alloy_contract::private::Network, + > PauserRegistryInstance + { + /// Creates a new call builder using this contract instance's provider and address. + /// + /// Note that the call can be any function call, not just those defined in this + /// contract. Prefer using the other methods for building type-safe contract calls. + pub fn call_builder( + &self, + call: &C, + ) -> alloy_contract::SolCallBuilder { + alloy_contract::SolCallBuilder::new_sol(&self.provider, &self.address, call) + } + ///Creates a new call builder for the [`isPauser`] function. + pub fn isPauser( + &self, + _0: alloy_sol_types::private::Address, + ) -> alloy_contract::SolCallBuilder { + self.call_builder(&isPauserCall { _0 }) + } + ///Creates a new call builder for the [`setIsPauser`] function. + pub fn setIsPauser( + &self, + newPauser: alloy_sol_types::private::Address, + canPause: bool, + ) -> alloy_contract::SolCallBuilder { + self.call_builder(&setIsPauserCall { + newPauser, + canPause, + }) + } + ///Creates a new call builder for the [`setUnpauser`] function. + pub fn setUnpauser( + &self, + newUnpauser: alloy_sol_types::private::Address, + ) -> alloy_contract::SolCallBuilder { + self.call_builder(&setUnpauserCall { newUnpauser }) + } + ///Creates a new call builder for the [`unpauser`] function. + pub fn unpauser(&self) -> alloy_contract::SolCallBuilder { + self.call_builder(&unpauserCall {}) + } + } + /// Event filters. + #[automatically_derived] + impl< + T: alloy_contract::private::Transport + ::core::clone::Clone, + P: alloy_contract::private::Provider, + N: alloy_contract::private::Network, + > PauserRegistryInstance + { + /// Creates a new event filter using this contract instance's provider and address. + /// + /// Note that the type can be any event, not just those defined in this contract. + /// Prefer using the other methods for building type-safe event filters. + pub fn event_filter( + &self, + ) -> alloy_contract::Event { + alloy_contract::Event::new_sol(&self.provider, &self.address) + } + ///Creates a new event filter for the [`PauserStatusChanged`] event. + pub fn PauserStatusChanged_filter( + &self, + ) -> alloy_contract::Event { + self.event_filter::() + } + ///Creates a new event filter for the [`UnpauserChanged`] event. + pub fn UnpauserChanged_filter(&self) -> alloy_contract::Event { + self.event_filter::() + } + } +} diff --git a/crates/keystore/Cargo.toml b/crates/keystore/Cargo.toml index e568b5518..7bd494886 100644 --- a/crates/keystore/Cargo.toml +++ b/crates/keystore/Cargo.toml @@ -26,7 +26,7 @@ serde_bytes.workspace = true k256 = { workspace = true, optional = true } schnorrkel = { workspace = true, optional = true } ed25519-zebra = { workspace = true, optional = true } -w3f-bls = { workspace = true, optional = true } +tnt-bls = { workspace = true, optional = true } rust-bls-bn254 = { workspace = true, optional = true } # EVM dependencies (optional) @@ -89,7 +89,7 @@ std = [ "k256?/std", "schnorrkel?/std", "ed25519-zebra?/std", - "w3f-bls?/std", + "tnt-bls?/std", "rust-bls-bn254?/std", # Conditional std enables for protocols "alloy-primitives?/std", @@ -104,7 +104,7 @@ std = [ ecdsa = ["k256", "ripemd", "hex", "gadget-crypto/k256"] sr25519-schnorrkel = ["schnorrkel", "hex", "gadget-crypto/sr25519-schnorrkel"] zebra = ["ed25519-zebra", "hex", "gadget-crypto/ed25519"] -bls = ["w3f-bls", "hex", "gadget-crypto/bls"] +bls = ["tnt-bls", "hex", "gadget-crypto/bls"] bn254 = ["ark-bn254", "ark-ec", "ark-ff", "ark-serialize", "gadget-crypto/bn254"] sp-core = ["dep:sp-core", "gadget-crypto/sp-core"] diff --git a/crates/runners/eigenlayer/src/bls.rs b/crates/runners/eigenlayer/src/bls.rs index 87d17b6d0..0ab826e4b 100644 --- a/crates/runners/eigenlayer/src/bls.rs +++ b/crates/runners/eigenlayer/src/bls.rs @@ -128,7 +128,7 @@ async fn register_bls_impl( let provider = get_provider_http(&env.http_rpc_endpoint); let delegation_manager = - eigensdk::utils::middleware::delegationmanager::DelegationManager::DelegationManagerInstance::new( + eigensdk::utils::core::delegationmanager::DelegationManager::DelegationManagerInstance::new( delegation_manager_address, provider.clone(), ); @@ -183,7 +183,6 @@ async fn register_bls_impl( ); let el_writer = ELChainWriter::new( - delegation_manager_address, strategy_manager_address, rewards_coordinator_address, el_chain_reader, diff --git a/crates/runners/eigenlayer/src/ecdsa.rs b/crates/runners/eigenlayer/src/ecdsa.rs deleted file mode 100644 index ec5b6f2a2..000000000 --- a/crates/runners/eigenlayer/src/ecdsa.rs +++ /dev/null @@ -1,341 +0,0 @@ -use gadget_std::str::FromStr; - -use alloy_network::primitives::BlockTransactionsKind; -use alloy_network::{EthereumWallet, TransactionBuilder}; -use alloy_primitives::{hex, Address, FixedBytes, U256}; -use alloy_provider::Provider; -use alloy_rpc_types::BlockNumberOrTag; -use alloy_signer::Signer; -use alloy_signer_local::PrivateKeySigner; - -use eigensdk::client_elcontracts::{reader::ELChainReader, writer::ELChainWriter}; -use eigensdk::logging::get_test_logger; -use eigensdk::types::operator::Operator; -use eigensdk::utils::middleware::ecdsastakeregistry::{ECDSAStakeRegistry, ISignatureUtils}; - -use crate::error::EigenlayerError; -use gadget_config::{GadgetConfiguration, ProtocolSettings}; -use gadget_contexts::keystore::KeystoreContext; -use gadget_keystore::backends::eigenlayer::EigenlayerBackend; -use gadget_keystore::backends::Backend; -use gadget_keystore::crypto::k256::K256Ecdsa; -use gadget_runner_core::config::BlueprintConfig; -use gadget_runner_core::error::RunnerError as Error; -use gadget_utils::evm::get_provider_http; - -#[derive(Clone, Copy)] -pub struct EigenlayerECDSAConfig { - earnings_receiver_address: Address, - delegation_approver_address: Address, -} - -impl EigenlayerECDSAConfig { - pub fn new(earnings_receiver_address: Address, delegation_approver_address: Address) -> Self { - Self { - earnings_receiver_address, - delegation_approver_address, - } - } -} - -#[async_trait::async_trait] -impl BlueprintConfig for EigenlayerECDSAConfig { - async fn register(&self, env: &GadgetConfiguration) -> Result<(), Error> { - register_ecdsa_impl( - env, - self.earnings_receiver_address, - self.delegation_approver_address, - ) - .await - } - - async fn requires_registration(&self, env: &GadgetConfiguration) -> Result { - requires_registration_ecdsa_impl(env).await - } -} - -async fn requires_registration_ecdsa_impl(env: &GadgetConfiguration) -> Result { - let contract_addresses = match env.protocol_settings { - ProtocolSettings::Eigenlayer(addresses) => addresses, - _ => { - return Err(gadget_runner_core::error::RunnerError::InvalidProtocol( - "Expected Eigenlayer protocol".into(), - )); - } - }; - let registry_coordinator_address = contract_addresses.registry_coordinator_address; - let operator_state_retriever_address = contract_addresses.operator_state_retriever_address; - - let ecdsa_public = env - .keystore() - .first_local::() - .map_err(|e| Error::Keystore(e.to_string()))?; - let ecdsa_secret = env - .keystore() - .expose_ecdsa_secret(&ecdsa_public) - .map_err(|e| Error::Keystore(format!("Failed to expose ECDSA secret: {}", e)))? - .ok_or_else(|| Error::Keystore("No ECDSA secret found".into()))?; - let operator_address = ecdsa_secret - .alloy_address() - .map_err(|e| Error::Eigenlayer(e.to_string()))?; - - let avs_registry_reader = eigensdk::client_avsregistry::reader::AvsRegistryChainReader::new( - get_test_logger(), - registry_coordinator_address, - operator_state_retriever_address, - env.http_rpc_endpoint.clone(), - ) - .await - .map_err(EigenlayerError::AvsRegistry)?; - - // Check if the operator has already registered for the service - match avs_registry_reader - .is_operator_registered(operator_address) - .await - { - Ok(is_registered) => Ok(!is_registered), - Err(e) => Err(EigenlayerError::AvsRegistry(e).into()), - } -} - -async fn register_ecdsa_impl( - env: &GadgetConfiguration, - earnings_receiver_address: Address, - delegation_approver_address: Address, -) -> Result<(), Error> { - let contract_addresses = match env.protocol_settings { - ProtocolSettings::Eigenlayer(addresses) => addresses, - _ => { - return Err(gadget_runner_core::error::RunnerError::InvalidProtocol( - "Expected Eigenlayer protocol".into(), - )); - } - }; - let delegation_manager_address = contract_addresses.delegation_manager_address; - let strategy_manager_address = contract_addresses.strategy_manager_address; - let avs_directory_address = contract_addresses.avs_directory_address; - let service_manager_address = contract_addresses.service_manager_address; - let stake_registry_address = contract_addresses.stake_registry_address; - let rewards_coordinator_address = contract_addresses.rewards_coordinator_address; - - let ecdsa_public = env - .keystore() - .first_local::() - .map_err(|e| Error::Keystore(e.to_string()))?; - let ecdsa_secret = env - .keystore() - .expose_ecdsa_secret(&ecdsa_public) - .map_err(|e| Error::Keystore(format!("Failed to expose ECDSA secret: {}", e)))? - .ok_or_else(|| Error::Keystore("No ECDSA secret found".into()))?; - let operator_address = ecdsa_secret - .alloy_address() - .map_err(|e| Error::Eigenlayer(e.to_string()))?; - - let operator_private_key = hex::encode(ecdsa_secret.0.to_bytes()); - let wallet = PrivateKeySigner::from_str(&operator_private_key) - .map_err(|_| EigenlayerError::Keystore("Invalid private key".into()))?; - - let provider = get_provider_http(&env.http_rpc_endpoint); - - let delegation_manager = eigensdk::utils::middleware::delegationmanager::DelegationManager::new( - delegation_manager_address, - provider.clone(), - ); - - let slasher_address = delegation_manager - .slasher() - .call() - .await - .map(|a| a._0) - .map_err(EigenlayerError::Contract)?; - - let logger = get_test_logger(); - let el_chain_reader = ELChainReader::new( - logger, - slasher_address, - delegation_manager_address, - avs_directory_address, - env.http_rpc_endpoint.clone(), - ); - - let el_writer = ELChainWriter::new( - delegation_manager_address, - strategy_manager_address, - rewards_coordinator_address, - el_chain_reader.clone(), - env.http_rpc_endpoint.clone(), - operator_private_key.clone(), - ); - - let staker_opt_out_window_blocks = 50400u32; - let operator_details = Operator { - address: operator_address, - earnings_receiver_address, - delegation_approver_address, - metadata_url: Some("https://github.com/tangle-network/gadget".to_string()), - staker_opt_out_window_blocks, - }; - - let tx_hash = el_writer - .register_as_operator(operator_details) - .await - .map_err(EigenlayerError::ElContracts)?; - - gadget_logging::info!("Registered as operator for Eigenlayer {:?}", tx_hash); - - let digest_hash_salt: FixedBytes<32> = FixedBytes::from([0x02; 32]); - let now = std::time::SystemTime::now(); - let sig_expiry = now - .duration_since(std::time::UNIX_EPOCH) - .map(|duration| U256::from(duration.as_secs()) + U256::from(86400)) - .unwrap_or_else(|_| { - gadget_logging::info!("System time seems to be before the UNIX epoch."); - U256::from(0) - }); - - let msg_to_sign = el_chain_reader - .calculate_operator_avs_registration_digest_hash( - operator_address, - service_manager_address, - digest_hash_salt, - sig_expiry, - ) - .await - .map_err(|e| EigenlayerError::Other(e.to_string()))?; - - let operator_signature = wallet - .sign_hash(&msg_to_sign) - .await - .map_err(|e| Error::SignatureError(e.to_string()))?; - - let operator_signature_with_salt_and_expiry = ISignatureUtils::SignatureWithSaltAndExpiry { - signature: operator_signature.as_bytes().into(), - salt: digest_hash_salt, - expiry: sig_expiry, - }; - - let signer = alloy_signer_local::PrivateKeySigner::from_str(&operator_private_key) - .map_err(|e| Error::SignatureError(e.to_string()))?; - let wallet = EthereumWallet::from(signer); - - // --- Register the operator to AVS --- - - gadget_logging::info!("Building Transaction"); - - let latest_block_number = provider - .get_block_number() - .await - .map_err(|e| Error::TransactionError(e.to_string()))?; - - // Get the latest block to estimate gas price - let latest_block = provider - .get_block_by_number( - BlockNumberOrTag::Number(latest_block_number), - BlockTransactionsKind::Full, - ) - .await - .map_err(|e| Error::TransactionError(e.to_string()))? - .ok_or(Error::TransactionError("Failed to get latest block".into()))?; - - // Get the base fee per gas from the latest block - let base_fee_per_gas: u128 = latest_block - .header - .base_fee_per_gas - .ok_or(Error::TransactionError( - "Failed to get base fee per gas from latest block".into(), - ))? - .into(); - - // Get the max priority fee per gas - let max_priority_fee_per_gas = provider - .get_max_priority_fee_per_gas() - .await - .map_err(|e| Error::TransactionError(e.to_string()))?; - - // Calculate max fee per gas - let max_fee_per_gas = base_fee_per_gas + max_priority_fee_per_gas; - - // Build the transaction request - let tx = alloy_rpc_types::TransactionRequest::default() - .with_call(&ECDSAStakeRegistry::registerOperatorWithSignatureCall { - _operator: operator_address, - _operatorSignature: operator_signature_with_salt_and_expiry, - }) - .with_from(operator_address) - .with_to(stake_registry_address) - .with_nonce( - provider - .get_transaction_count(operator_address) - .await - .map_err(|e| Error::TransactionError(e.to_string()))?, - ) - .with_chain_id( - provider - .get_chain_id() - .await - .map_err(|e| Error::TransactionError(e.to_string()))?, - ) - .with_max_priority_fee_per_gas(max_priority_fee_per_gas) - .with_max_fee_per_gas(max_fee_per_gas); - - // Estimate gas limit - let gas_estimate = provider - .estimate_gas(&tx) - .await - .map_err(|e| Error::TransactionError(e.to_string()))?; - gadget_logging::info!("Gas Estimate: {}", gas_estimate); - - // Set gas limit - let tx = tx.with_gas_limit(gas_estimate); - - gadget_logging::info!("Building Transaction Envelope"); - - let tx_envelope = tx - .build(&wallet) - .await - .map_err(|e| Error::TransactionError(e.to_string()))?; - - gadget_logging::info!("Sending Transaction Envelope"); - - let result = provider - .send_tx_envelope(tx_envelope) - .await - .map_err(|e| Error::TransactionError(e.to_string()))? - .register() - .await - .map_err(|e| Error::TransactionError(e.to_string()))?; - - gadget_logging::info!("Operator Registration to AVS Sent. Awaiting Receipt..."); - - gadget_logging::info!("Operator Address: {}", operator_address); - gadget_logging::info!("Stake Registry Address: {}", stake_registry_address); - gadget_logging::info!("RPC Endpoint: {}", env.http_rpc_endpoint); - - let tx_hash = result - .await - .map_err(|e| Error::TransactionError(e.to_string()))?; - - gadget_logging::info!( - "Command for testing: cast code {} --rpc-url {}", - stake_registry_address, - env.http_rpc_endpoint - ); - - let receipt = provider - .get_transaction_receipt(tx_hash) - .await - .map_err(|e| Error::TransactionError(e.to_string()))? - .ok_or(Error::TransactionError("Failed to get receipt".into()))?; - - gadget_logging::info!("Got Transaction Receipt: {:?}", receipt); - - if !receipt.status() { - return Err(EigenlayerError::Registration( - "Failed to register operator to AVS".to_string(), - ) - .into()); - } - - gadget_logging::info!("Operator Registration to AVS Succeeded"); - Ok(()) -} diff --git a/crates/runners/eigenlayer/src/lib.rs b/crates/runners/eigenlayer/src/lib.rs index 4a6350ddb..0c9b18fc6 100644 --- a/crates/runners/eigenlayer/src/lib.rs +++ b/crates/runners/eigenlayer/src/lib.rs @@ -1,3 +1,2 @@ pub mod bls; -pub mod ecdsa; mod error; diff --git a/crates/testing-utils/eigenlayer/Cargo.toml b/crates/testing-utils/eigenlayer/Cargo.toml index 6a781e529..5ba27a73f 100644 --- a/crates/testing-utils/eigenlayer/Cargo.toml +++ b/crates/testing-utils/eigenlayer/Cargo.toml @@ -17,6 +17,7 @@ gadget-logging = { workspace = true } gadget-utils = { workspace = true, features = ["eigenlayer", "evm"] } gadget-macros = { workspace = true, features = ["evm"] } gadget-runners = { workspace = true, features = ["eigenlayer"] } +gadget-eigenlayer-bindings = { workspace = true } gadget-event-listeners = { workspace = true, features = ["evm"] } tempfile = { workspace = true } async-trait = { workspace = true } diff --git a/crates/testing-utils/eigenlayer/src/env.rs b/crates/testing-utils/eigenlayer/src/env.rs index 154aa087f..4d1bcb0c0 100644 --- a/crates/testing-utils/eigenlayer/src/env.rs +++ b/crates/testing-utils/eigenlayer/src/env.rs @@ -1,12 +1,12 @@ use alloy_primitives::Uint; use alloy_primitives::{address, Address}; use alloy_provider::Provider; -use eigensdk::utils::middleware::pauserregistry::PauserRegistry; use eigensdk::utils::middleware::registrycoordinator::IRegistryCoordinator::OperatorSetParam; use eigensdk::utils::middleware::registrycoordinator::IStakeRegistry::StrategyParams; use eigensdk::utils::middleware::registrycoordinator::RegistryCoordinator; use gadget_anvil_testing_utils::get_receipt; use gadget_config::protocol::EigenlayerContractAddresses; +use gadget_eigenlayer_bindings::pauser_registry::PauserRegistry; use gadget_logging::info; use gadget_utils::evm::get_provider_http; diff --git a/crates/testing-utils/tangle/Cargo.toml b/crates/testing-utils/tangle/Cargo.toml index c99e0f0ad..d67341703 100644 --- a/crates/testing-utils/tangle/Cargo.toml +++ b/crates/testing-utils/tangle/Cargo.toml @@ -29,6 +29,8 @@ alloy-signer-local = { workspace = true } alloy-rpc-types = { workspace = true, features = ["eth"] } alloy-json-rpc = { workspace = true } alloy-transport = { workspace = true } +alloy-sol-types = { workspace = true } +alloy-primitives = { workspace = true } sp-core = { workspace = true } subxt = { workspace = true } tangle-subxt = { workspace = true } diff --git a/crates/testing-utils/tangle/src/harness.rs b/crates/testing-utils/tangle/src/harness.rs index ad1a1310f..3ce9e6048 100644 --- a/crates/testing-utils/tangle/src/harness.rs +++ b/crates/testing-utils/tangle/src/harness.rs @@ -19,6 +19,7 @@ use gadget_core_testing_utils::{ use gadget_crypto_tangle_pair_signer::TanglePairSigner; use gadget_keystore::backends::Backend; use gadget_keystore::crypto::sp_core::{SpEcdsa, SpSr25519}; +use gadget_logging::debug; use gadget_runners::tangle::tangle::{PriceTargets, TangleConfig}; use sp_core::Pair; use tangle_subxt::tangle_testnet_runtime::api::services::{ @@ -148,8 +149,10 @@ impl TangleTestHarness { .map_err(|e| Error::Setup(e.to_string()))?; if let Some((rev, addr)) = latest_revision { - tracing::debug!("MBSM is deployed at revision #{rev} at address {addr}"); + debug!("MBSM is deployed at revision #{rev} at address {addr}"); return Ok(()); + } else { + debug!("MBSM is not deployed"); } let bytecode = tnt_core_bytecode::bytecode::MASTER_BLUEPRINT_SERVICE_MANAGER; @@ -159,6 +162,7 @@ impl TangleTestHarness { &self.sr25519_signer, self.alloy_key.clone(), bytecode, + alloy_primitives::address!("0xdeadbeefdeadbeefdeadbeefdeadbeefdeadbeef"), // TODO: User-defined address? ) .await .map_err(|e| Error::Setup(e.to_string()))?; diff --git a/crates/testing-utils/tangle/src/node/transactions.rs b/crates/testing-utils/tangle/src/node/transactions.rs index ba4811818..2ac726d9a 100644 --- a/crates/testing-utils/tangle/src/node/transactions.rs +++ b/crates/testing-utils/tangle/src/node/transactions.rs @@ -1,4 +1,5 @@ use crate::{InputValue, OutputValue}; +use alloy_primitives::Address; use alloy_provider::network::AnyNetwork; use alloy_provider::{ network::{ReceiptResponse, TransactionBuilder}, @@ -6,6 +7,7 @@ use alloy_provider::{ }; use alloy_rpc_types::serde_helpers::WithOtherFields; use alloy_signer_local::PrivateKeySigner; +use alloy_sol_types::{sol, SolConstructor}; use gadget_clients::tangle::client::{TangleClient as TestClient, TangleConfig}; use gadget_logging::{error, info}; use sp_core::H160; @@ -53,6 +55,10 @@ pub enum TransactionError { Other(String), } +sol! { + constructor(address payable _protocolFeesReceiver); +} + /// Deploy a new MBSM revision and returns the result. pub async fn deploy_new_mbsm_revision>( evm_rpc_endpoint: &str, @@ -60,6 +66,7 @@ pub async fn deploy_new_mbsm_revision>( account_id: &T, signer_evm: PrivateKeySigner, bytecode: &[u8], + protocol_fees_receiver: Address, ) -> Result { info!("Deploying new MBSM revision ..."); @@ -71,7 +78,18 @@ pub async fn deploy_new_mbsm_revision>( .on_ws(WsConnect::new(evm_rpc_endpoint)) .await?; - let tx = alloy_rpc_types::TransactionRequest::default().with_deploy_code(bytecode.to_vec()); + let constructor_call = constructorCall { + _protocolFeesReceiver: protocol_fees_receiver, + }; + let encoded_constructor = constructor_call.abi_encode(); + info!("Encoded constructor: {encoded_constructor:?}"); + + let deploy_code = [bytecode, encoded_constructor.as_ref()].concat(); + info!("Deploy code length: {:?}", deploy_code.len()); + + let tx = alloy_rpc_types::TransactionRequest::default() + .with_deploy_code(deploy_code) + .with_gas_limit(5_000_000); let send_result = provider.send_transaction(WithOtherFields::new(tx)).await; let tx = match send_result { Ok(tx) => tx, diff --git a/crates/utils/eigenlayer/src/lib.rs b/crates/utils/eigenlayer/src/lib.rs index 851996c71..2abac7221 100644 --- a/crates/utils/eigenlayer/src/lib.rs +++ b/crates/utils/eigenlayer/src/lib.rs @@ -21,7 +21,7 @@ pub async fn get_slasher_address( ) -> Result { let provider = get_provider_http(http_endpoint); let delegation_manager = - eigensdk::utils::middleware::delegationmanager::DelegationManager::DelegationManagerInstance::new( + eigensdk::utils::core::delegationmanager::DelegationManager::DelegationManagerInstance::new( delegation_manager_addr, provider, );