Skip to content

feat: rework deployStylusCode to use StylusDeployer contract#3

Open
bernard-wagner wants to merge 3 commits intomasterfrom
stylus-deployer
Open

feat: rework deployStylusCode to use StylusDeployer contract#3
bernard-wagner wants to merge 3 commits intomasterfrom
stylus-deployer

Conversation

@bernard-wagner
Copy link
Copy Markdown
Contributor

Replace the 3-step internal approach (exec_create + activate_program + exec_call constructor) with a single exec_call to the StylusDeployer contract, which atomically deploys, activates via ARB_WASM, and calls the constructor. This produces a single CALL transaction when broadcasting, ensuring on-chain replay deploys a fully activated contract.

Key changes:

  • Add StylusDeployer address and runtime code constants
  • Add deploy_stylus_deployer() to executor setup (test + script)
  • Add call_from_code flag on Broadcast struct for capturing cheatcode-internal exec_call as broadcastable CALL
  • Simulate with 1 ETH activation budget, temporarily clear caller code for refund, compute actual fee from balance diff, adjust broadcast tx value with 20% buffer

@bernard-wagner bernard-wagner force-pushed the stylus-deployer branch 2 times, most recently from 99bf8c6 to a8f8a66 Compare February 10, 2026 07:25
bernard-wagner and others added 3 commits February 10, 2026 08:13
)

Returns EVM init code wrapping compressed Stylus bytecode, suitable for
direct CREATE/CREATE2 deployment or use with the StylusDeployer contract.
Also corrects getStylusCode description to clarify it returns raw runtime
bytecode for use with vm.etch.
Replace the 3-step internal approach (exec_create + activate_program +
exec_call constructor) with a single exec_call to the StylusDeployer
contract, which atomically deploys, activates via ARB_WASM, and calls
the constructor. This produces a single CALL transaction when
broadcasting, ensuring on-chain replay deploys a fully activated
contract.

Key changes:
- Add StylusDeployer address and runtime code constants
- Add deploy_stylus_deployer() to executor setup (test + script)
- Add call_from_code flag on Broadcast struct for capturing
  cheatcode-internal exec_call as broadcastable CALL
- Simulate with 1 ETH activation budget, temporarily clear caller code
  for refund, compute actual fee from balance diff, adjust broadcast tx
  value with 20% buffer
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.

2 participants