Skip to content

startup-dreamer/worm-deployer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

39 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Warning

This is a proof of concept developed for the Wormhole Hackathon. This is a project driven by personal interest and is currently in an experimental stage (Although people are using it). Mainnet deployment is still under active development.

Worm-Deployer

Worm-Deployer

Worm-Deployer: A Multi-Chain Smart Contract Deployment Tool with Single-Transaction Execution and Deterministic Addressing
Video Demo

Features

  • Single-transaction Multi-chain Deployment: Deploy to multiple chains from a single source transaction.
  • Deterministic Addressing via CREATE2: Same contract address across all target chains.
  • Source Chain Gas Payment: Pay gas only on the source chain.
  • Flexible Chain Selection: Support for various source and destination chain combinations. (supported chains)

Supported Frameworks

Supported Chains (Testnet only)

Getting Started

Important

Need to install node v21.1.0 on your system (steps here using nvm).

Remote usage (as npx command)

npx worm-deployer@latest

Then follow the prompts to deploy the contracts.

Local usage (as local command)

  1. Clone the repository:
git clone https://github.com/startup-dreamer/worm-deployer.git
  1. Install dependencies:
cd worm-deployer
npm install
  1. Link the package:
npm link
  1. Run the command:
worm-deployer
  1. Then follow the prompts to deploy the contracts.

Demo Deployment

Demo Deployment

Test deployment contract: https://wormholescan.io/#/tx/0xb94edd9a6358ae42357cb1752ce0fe3f93214c6b5618ed9cecca6b099211a6a8

Worm-Deployer Architecture

Contract Architecture

User Flow

Wormhole Tech Used

  • Standard Relaying for EVM chains message passing through Wormhole protocol.
  • Wormhole Solidity SDK to connect wormdeployer contract with relayer interface.
  • Wormhole Base SDK to get the wormhole specific chain parameters for configuring the deployment.

Worm-Deployer Development

  • Implemented as an NPX package compatible with both Hardhat and Foundry projects.

Workflow:

  • User runs the worm-deployer package in their project directory.
  • Selects the contract to deploy.
  • worm-deployer compiles the contract using appropriate build tools.
  • Extracts bytecode from contract artifacts.
  • User provides custom salt for deterministic address generation.
  • Calls deployAcrossChains function on source chain's WormholeDeployer contract.
  • Wormhole relayer sends transaction to destination chains.
  • receiveWormholeMessages function deploys the contract on destination chains using CREATE2 opcode.

Future Work

Pre-Mainnet Launch

  1. Mainnet readiness
  2. Multi-chain support expansion
  3. Batch deployments
    • Deploy multiple contracts in a single transaction
    • Optimize gas fees and simplify complex deployments
  4. Automatic contract verification
    • Integrate with block explorers across supported chains

Post-Mainnet Launch

  1. Cross-chain contract interaction

    • Allow initialization and configuration of newly deployed contracts
    • Support interaction with deployed contracts on other chains
  2. Upgrade Mechanism

    • Contract upgradeability across multiple chains, Using proxy patterns.
  3. Specialized relayer integration

Contact

Twitter - @Krieger
Mail - [email protected]

Contribution

Contributions are more than welcome! Please open an issue for any bugs or feature requests and maybe submit a PR as well.

Acknowledgment

Thanks to Encode Club for making the Wormhole Hackathon possible, and to the Wormhole Foundation for providing the innovative and user-friendly framework for cross-chain messaging that inspired me to create Worm-Deployer. I would greatly appreciate any feedback or guidance from the judges.

References