From project root:
cargo build --releaseOutput: target/wasm32-gear/release/one_of_us.opt.wasm
If you need to interact with your program from Solidity contracts or use Ethereum ABI tooling:
cargo sails sol --idl-path ./target/wasm32-gear/release/one_of_us.idlOutput: OneOfUs.sol — contains interface, ABI contract, and callback definitions.
cd deploy
npm install
cp .env.example .envIf you plan to deploy with Solidity ABI interface, install Foundry:
curl -L https://foundry.paradigm.xyz | bash
foundryupThen install dependencies from project root:
forge installVariables appear in order as you complete each step:
# Initial setup (required)
PRIVATE_KEY=0x... # Your Ethereum private key
ETH_RPC=https://... # Ethereum HTTP RPC (Hoodi)
ETH_RPC_WS=wss://... # Ethereum WebSocket RPC (for subscriptions)
ROUTER_ADDRESS=0x... # Router contract
WVARA_ADDRESS=0x... # wVARA token contract
VARA_ETH_WS=wss://... # Vara.eth WebSocket (for injected tx)
# For Etherscan verification (optional but recommended)
ETHERSCAN_API_KEY=... # Get from hoodi.etherscan.io
# After upload (step 1)
CODE_ID=0x... # Validated code hash
# After create (step 2)
PROGRAM_ID=0x... # Program Mirror address
ABI_ADDRESS=0x... # ABI contract address (if using Option B)
⚠️ Important: Wait for Ethereum finalization after each step before proceeding to the next.
npm run upload→ Get CODE_ID, add to .env
Option A: Standard creation
npm run create→ Get PROGRAM_ID, add to .env
Option B: With Solidity ABI interface (using Foundry)
This option deploys an ABI contract and links it to your program, enabling interaction via standard Ethereum ABI tooling.
# 1. Generate Solidity interface from IDL (if not done already)
cargo sails sol --idl-path ../target/wasm32-gear/release/one_of_us.idl
# 2. Deploy ABI contract and create program in one step
npm run create:abiThis script:
- Deploys
OneOfUsAbicontract using Foundry (forge script) - Automatically verifies on Etherscan (if
ETHERSCAN_API_KEYis set) - Creates program with ABI interface via Router
→ Get PROGRAM_ID and ABI_ADDRESS, add to .env
After deployment, link your Mirror contract to the ABI contract on Etherscan:
- Go to your
PROGRAM_ID(Mirror) address on Hoodi Etherscan - Click the "Code" tab
- Click "More Options" → "Is this a proxy?"
- Click "Verify" — Etherscan will detect the ABI contract
- Confirm the linking
Once linked, the Mirror contract page will show all ABI methods (Read/Write Contract tabs), making interaction much easier.
npm run fund→ Program receives wVARA balance
npm run init→ Program is ready to use
Classic transaction (via Ethereum):
npm run classicInjected transaction (instant pre-confirmation):
npm run injectedRead state:
npm run state| Script | Command | Description |
|---|---|---|
upload-code.ts |
npm run upload |
Upload WASM to Ethereum |
create-program.ts |
npm run create |
Create program instance (standard) |
create-program-abi.ts |
npm run create:abi |
Deploy ABI + create program (Foundry) |
fund-program.ts |
npm run fund |
Top up wVARA balance |
init-program.ts |
npm run init |
Initialize program |
classic-tx.ts |
npm run classic |
Send classic L1 transaction |
test-injected.ts |
npm run injected |
Send injected transaction |
read-state.ts |
npm run state |
Query program state |
Located in project root, used by create:abi:
| Script | Description |
|---|---|
deploy/DeployOneOfUsAbi.s.sol |
Deploys and verifies ABI contract |
Run manually if needed:
forge script deploy/DeployOneOfUsAbi.s.sol:DeployOneOfUsAbi \
--rpc-url $ETH_RPC \
--broadcast \
--verify \
--etherscan-api-key $ETHERSCAN_API_KEY \
-vvv