Skip to content
This repository was archived by the owner on Aug 17, 2026. It is now read-only.

Support delegatecall host binding - #339

Open
william08190 wants to merge 2 commits into
clearloop:mainfrom
william08190:codex/delegatecall-host
Open

Support delegatecall host binding#339
william08190 wants to merge 2 commits into
clearloop:mainfrom
william08190:codex/delegatecall-host

Conversation

@william08190

Copy link
Copy Markdown

Summary

  • add the zink::asm::evm::delegatecall host binding for the EVM DELEGATECALL opcode
  • add a small wasm example that calls the new binding
  • add a compiler WAT filetest that imports evm.delegatecall and compiles it through zinkc

Fixes #254.

Verification

  • cargo fmt --check
  • cargo build -p zink --example delegatecall --target wasm32-unknown-unknown
  • cargo test -p zink --example delegatecall -- --nocapture
  • cargo test -p zinkc-filetests system::delegatecall -- --nocapture
  • git diff --check

@william08190

Copy link
Copy Markdown
Author

CI follow-up: I checked the failing run. The delegatecall coverage added by this PR passed in CI:

  • zinkc-filetests examples::delegatecall
  • zinkc-filetests system::delegatecall

The red checks are from workspace-wide failures in pre-existing paths: clippy -D warnings errors in codegen/src/visitor/mod.rs / codegen/src/jump/table.rs, plus existing example filetests panicking at codegen/src/visitor/local.rs:36 (approval, bound_checks, br_balance, contract, erc20, event_test, log, revert).

Local validation for this PR also passed: cargo fmt --check, the delegatecall example wasm build/test, zinkc-filetests system::delegatecall, and git diff --check. I kept this PR scoped to the delegatecall host binding unless you want the broader CI cleanup included here.

@william08190

Copy link
Copy Markdown
Author

Pushed a CI follow-up in 7fb6e57. Locally verified:\n\n- cargo fmt --check\n- cargo clippy --all -- -D warnings\n- cargo build --examples --target wasm32-unknown-unknown --release\n- cargo test -p zinkc-filetests examples --release -- --nocapture\n- cargo test -p zinkc-filetests system::delegatecall --release -- --nocapture\n- cargo test --workspace --release --no-fail-fast\n- cargo test --workspace --release --examples --no-fail-fast\n\nThe delegatecall changes are unchanged; this follow-up addresses the workspace CI blockers that were preventing the PR checks from reaching the delegatecall coverage cleanly.

@clearloop

Copy link
Copy Markdown
Owner

thanks for the contribution! will take a look!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support contract calls

2 participants