Skip to content

Commit 650e4f0

Browse files
rplusqclaude
andcommitted
feat(wallets): add Turnkey signer support
Add Turnkey as a remote signer option alongside AWS KMS and GCP KMS. Key changes: - Added alloy-signer-turnkey dependency to foundry-wallets - Implemented Turnkey wallet CLI args and initialization logic - Added turnkey feature flags to cast and forge - Updated Dockerfile and Makefile to include turnkey in release builds Fixed forge wallet feature flags: - Moved foundry-wallets from dev-dependencies to dependencies in forge/Cargo.toml - This fixes an issue where aws-kms, gcp-kms, and turnkey features were defined but non-functional when using cargo run with --features flags - The features worked in release builds (via Makefile) but not in local dev - This aligns forge with cast, which already had foundry-wallets as a regular dependency 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
1 parent d029725 commit 650e4f0

File tree

11 files changed

+298
-7
lines changed

11 files changed

+298
-7
lines changed

Cargo.lock

Lines changed: 192 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -238,6 +238,7 @@ alloy-serde = { version = "1.0.36", default-features = false }
238238
alloy-signer = { version = "1.0.36", default-features = false }
239239
alloy-signer-aws = { version = "1.0.36", default-features = false }
240240
alloy-signer-gcp = { version = "1.0.36", default-features = false }
241+
alloy-signer-turnkey = { path = "../alloy/crates/signer-turnkey", default-features = false }
241242
alloy-signer-ledger = { version = "1.0.36", default-features = false }
242243
alloy-signer-local = { version = "1.0.36", default-features = false }
243244
alloy-signer-trezor = { version = "1.0.36", default-features = false }

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ COPY . .
1919
RUN git update-index --force-write-index
2020

2121
RUN --mount=type=cache,target=/root/.cargo/registry --mount=type=cache,target=/root/.cargo/git --mount=type=cache,target=/opt/foundry/target \
22-
source $HOME/.profile && cargo build --release --features anvil/js-tracer,cast/aws-kms,cast/gcp-kms,forge/aws-kms,forge/gcp-kms \
22+
source $HOME/.profile && cargo build --release --features anvil/js-tracer,cast/aws-kms,cast/gcp-kms,cast/turnkey,forge/aws-kms,forge/gcp-kms,forge/turnkey \
2323
&& mkdir out \
2424
&& mv target/release/forge out/forge \
2525
&& mv target/release/cast out/cast \

Makefile

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@ CARGO_TARGET_DIR ?= target
1515
# List of features to use when building. Can be overridden via the environment.
1616
# No jemalloc on Windows
1717
ifeq ($(OS),Windows_NT)
18-
FEATURES ?= aws-kms gcp-kms cli asm-keccak
18+
FEATURES ?= aws-kms gcp-kms turnkey cli asm-keccak
1919
else
20-
FEATURES ?= jemalloc aws-kms gcp-kms cli asm-keccak
20+
FEATURES ?= jemalloc aws-kms gcp-kms turnkey cli asm-keccak
2121
endif
2222

2323
##@ Help
@@ -47,15 +47,15 @@ build-%:
4747
.PHONY: docker-build-push
4848
docker-build-push: docker-build-prepare ## Build and push a cross-arch Docker image tagged with DOCKER_IMAGE_NAME.
4949
# Build x86_64-unknown-linux-gnu.
50-
cargo build --target x86_64-unknown-linux-gnu --features "jemalloc aws-kms gcp-kms cli asm-keccak js-tracer" --profile "$(PROFILE)"
50+
cargo build --target x86_64-unknown-linux-gnu --features "jemalloc aws-kms gcp-kms turnkey cli asm-keccak js-tracer" --profile "$(PROFILE)"
5151
mkdir -p $(BIN_DIR)/amd64
5252
for bin in anvil cast chisel forge; do \
5353
cp $(CARGO_TARGET_DIR)/x86_64-unknown-linux-gnu/$(PROFILE)/$$bin $(BIN_DIR)/amd64/; \
5454
done
5555

5656
# Build aarch64-unknown-linux-gnu.
5757
rustup target add aarch64-unknown-linux-gnu
58-
RUSTFLAGS="-C linker=aarch64-linux-gnu-gcc" cargo build --target aarch64-unknown-linux-gnu --features "aws-kms gcp-kms cli asm-keccak js-tracer" --profile "$(PROFILE)"
58+
RUSTFLAGS="-C linker=aarch64-linux-gnu-gcc" cargo build --target aarch64-unknown-linux-gnu --features "aws-kms gcp-kms turnkey cli asm-keccak js-tracer" --profile "$(PROFILE)"
5959
mkdir -p $(BIN_DIR)/arm64
6060
for bin in anvil cast chisel forge; do \
6161
cp $(CARGO_TARGET_DIR)/aarch64-unknown-linux-gnu/$(PROFILE)/$$bin $(BIN_DIR)/arm64/; \

crates/cast/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,4 +101,5 @@ mimalloc = ["foundry-cli/mimalloc"]
101101
tracy-allocator = ["foundry-cli/tracy-allocator"]
102102
aws-kms = ["foundry-wallets/aws-kms"]
103103
gcp-kms = ["foundry-wallets/gcp-kms"]
104+
turnkey = ["foundry-wallets/turnkey"]
104105
isolate-by-default = ["foundry-config/isolate-by-default"]

crates/forge/Cargo.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ forge-script.workspace = true
5050
forge-sol-macro-gen.workspace = true
5151
foundry-cli.workspace = true
5252
foundry-debugger.workspace = true
53+
foundry-wallets.workspace = true
5354

5455
alloy-chains.workspace = true
5556
alloy-dyn-abi.workspace = true
@@ -101,7 +102,6 @@ alloy-hardforks.workspace = true
101102
anvil.workspace = true
102103
forge-script-sequence.workspace = true
103104
foundry-test-utils.workspace = true
104-
foundry-wallets.workspace = true
105105
futures.workspace = true
106106
reqwest = { workspace = true, features = ["json"] }
107107

@@ -122,4 +122,5 @@ mimalloc = ["foundry-cli/mimalloc"]
122122
tracy-allocator = ["foundry-cli/tracy-allocator"]
123123
aws-kms = ["foundry-wallets/aws-kms"]
124124
gcp-kms = ["foundry-wallets/gcp-kms"]
125+
turnkey = ["foundry-wallets/turnkey"]
125126
isolate-by-default = ["foundry-config/isolate-by-default"]

crates/wallets/Cargo.toml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,9 @@ aws-config = { version = "1", default-features = true, optional = true }
3232
# gcp-kms
3333
alloy-signer-gcp = { workspace = true, features = ["eip712"], optional = true }
3434

35+
# turnkey
36+
alloy-signer-turnkey = { workspace = true, features = ["eip712"], optional = true }
37+
3538
async-trait.workspace = true
3639
clap = { version = "4", features = ["derive", "env", "unicode", "wrap_help"] }
3740
derive_builder = "0.20"
@@ -48,3 +51,4 @@ tokio = { workspace = true, features = ["macros"] }
4851
[features]
4952
aws-kms = ["dep:alloy-signer-aws", "dep:aws-config"]
5053
gcp-kms = ["dep:alloy-signer-gcp"]
54+
turnkey = ["dep:alloy-signer-turnkey"]

0 commit comments

Comments
 (0)