Skip to content

Deploy binary file#31

Merged
bbyalcinkaya merged 19 commits intomasterfrom
deploy-binary-file
Feb 6, 2026
Merged

Deploy binary file#31
bbyalcinkaya merged 19 commits intomasterfrom
deploy-binary-file

Conversation

@bbyalcinkaya
Copy link
Member

@bbyalcinkaya bbyalcinkaya commented Nov 24, 2025

This PR adds support for creating Stylus and Solidity contracts from raw bytecode directly inside test contracts.

  • Implemented the Pyk hooks mechanism for exposing external operations to the semantics, including file reads and WASM binary parsing. This enables deploying contracts from bytecode files.
    • When the semantics encounters a #pykHook, it stops execution with exit code 2. On the Python side, we detect this exit code and inspect the K cell to find the #pykHook item. We then extract the hooked operation’s name and arguments, execute the corresponding operation in Python, and embed the result back into the K cell as #pykHookResult. Execution can then resume from that updated state.
    • Pyk Hooks are only available in the setUp function.
  • Implemented the readFile and readFileBinary Foundry cheatcodes through Pyk hooks.
  • Added support for creating Stylus contracts directly from bytecode using the WASM parser hook.
  • Implemented the semantics for calling Foundry cheatcodes from Stylus.
  • Implemented the static_call_contract host function.
  • Implemented the create1 host function to support deploying bytecode from Stylus contracts.
  • Deprecated contract creation via skribe.json in favor of bytecode-based deployment.
  • Optimized WASM memory representation to reduce fragmentation in SparseBytes.

Testing:

  • Added test-stylus-from-foundry: fuzz-tests a Stylus counter contract deployed from its .wasm bytecode.
  • Added test-foundry-from-stylus: fuzz-tests a Solidity counter contract deployed from its .bin bytecode.
  • Updated existing Stylus test contracts to deploy from bytecode instead of skribe.json.

@bbyalcinkaya bbyalcinkaya marked this pull request as ready for review December 4, 2025 10:56
Copy link

@ACassimiro ACassimiro left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see no issues with the implementation. The PR looks good to me.

@bbyalcinkaya bbyalcinkaya merged commit 24c3fd2 into master Feb 6, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants