Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,6 @@ node_modules

# Tilt
.wormhole

evm/artifacts
evm/metadata
43 changes: 43 additions & 0 deletions evm/.env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# Quai NTT Deployment Configuration

# Network Configuration
SEPOLIA_RPC_URL=https://eth-sepolia.g.alchemy.com/public
QUAI_RPC_URL=https://rpc.orchard.quai.network
PASSWORD=your_wallet_password_here
SEPOLIA_PRIVATE_KEY=

# Wormhole Core Contract (deploy this first using your existing script)
WORMHOLE_CORE_ADDRESS=0x004Accf29dD34f88E885e2BdFB1B0105059b3D08

# Token Configuration
# Use WQUAI address for bridging wrapped QUAI tokens
# WQUAI contract address on Quai testnet
TOKEN_ADDRESS=0x005c46f661Baef20671943f2b4c087Df3E7CEb13

# NTT Configuration
# Mode: 0 = LOCKING (use for native token), 1 = BURNING (use for wrapped tokens)
MODE=0

# Wormhole chain ID for Quai Network (you'll need to register this)
CHAIN_ID=15000

# Rate Limiting (24 hours = 86400 seconds)
RATE_LIMIT_DURATION=0
SKIP_RATE_LIMIT=false
OUTBOUND_LIMIT=1000

# Wormhole Integration
# Use zero addresses for manual relaying
WORMHOLE_RELAYER_ADDRESS=0x0000000000000000000000000000000000000000
SPECIAL_RELAYER_ADDRESS=0x0000000000000000000000000000000000000000

# Message Configuration
CONSISTENCY_LEVEL=202
GAS_LIMIT=500000

# Contract addresses - Replace with your actual deployed contract addresses
QUAI_NTT_MANAGER=0x0061B2b01F87f5bAE782F1C4C923363d79073139
QUAI_WORMHOLE_TRANSCEIVER=0x00436ECf23D73dD00B9dF85267cf64F7d6667460

SEPOLIA_NTT_MANAGER=0x1234567890123456789012345678901234567890
SEPOLIA_WORMHOLE_TRANSCEIVER=0x1234567890123456789012345678901234567890
24 changes: 24 additions & 0 deletions evm/.env.sepolia
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Sepolia NTT Deployment Configuration

# Network Configuration
PRIVATE_KEY=
RPC_URL=https://ethereum-sepolia-rpc.publicnode.com

# Wormhole Core Contract (already deployed)
RELEASE_CORE_BRIDGE_ADDRESS=0x9b4C71FcE35aC14aeA71179aba932046f713a8DE

# NTT Configuration for Sepolia (destination chain)
# Note: Token will be deployed by the script, no need to set RELEASE_TOKEN_ADDRESS
RELEASE_MODE=1 # BURNING mode for destination chain
RELEASE_WORMHOLE_CHAIN_ID=10002 # Sepolia Wormhole chain ID
RELEASE_RATE_LIMIT_DURATION=0 # 0 = no rate limiting
RELEASE_SKIP_RATE_LIMIT=true # Skip rate limiting for testing
RELEASE_OUTBOUND_LIMIT=1000000000000000000000 # 1000 WQUAI with 18 decimals

# Wormhole Integration - Use zero addresses for manual relaying
RELEASE_WORMHOLE_RELAYER_ADDRESS=0x0000000000000000000000000000000000000000
RELEASE_SPECIAL_RELAYER_ADDRESS=0x0000000000000000000000000000000000000000

# Message Configuration
RELEASE_CONSISTENCY_LEVEL=202 # Finalized
RELEASE_GAS_LIMIT=500000
12 changes: 12 additions & 0 deletions evm/deploy-sepolia.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/bin/bash

# Load environment variables from .env.sepolia
set -a
source .env.sepolia
set +a

# Deploy using forge
forge script script/DeploySepoliaNtt.s.sol \
--rpc-url $RPC_URL \
--private-key $PRIVATE_KEY \
--broadcast
6 changes: 5 additions & 1 deletion evm/foundry.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,11 @@
solc_version = "0.8.19"
optimizer = true
optimizer_runs = 200
via_ir = false
via_ir = true
# Set bytecode hash to IPFS
bytecode_hash = "ipfs"
cbor_metadata = true

evm_version = "london"
src = "src"
out = "out"
Expand Down
46 changes: 46 additions & 0 deletions evm/hardhat.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
require("@nomicfoundation/hardhat-toolbox");
require("dotenv").config();
require("@quai/hardhat-deploy-metadata");

/** @type import('hardhat/config').HardhatUserConfig */
module.exports = {
solidity: {
version: "0.8.19",
settings: {
optimizer: {
enabled: true,
runs: 200,
},
viaIR: true, // Enable IR compilation for smaller bytecode
metadata: {
bytecodeHash: 'ipfs',
useLiteralContent: true,
},
evmVersion: 'london',
},
},
networks: {
hardhat: {
// For local testing
},
quai: {
url: process.env.RPC_URL || "https://rpc.orchard.quai.network",
// No accounts needed for compilation - handled by encrypted wallet in deploy scripts
chainId: 9000,
},
sepolia: {
url: process.env.SEPOLIA_RPC_URL || "https://sepolia.infura.io/v3/your-infura-project-id",
// No accounts needed for compilation - handled by encrypted wallet in deploy scripts
chainId: 11155111,
},
},
paths: {
sources: "./src",
tests: "./test",
cache: "./cache",
artifacts: "./artifacts",
},
mocha: {
timeout: 40000,
},
};
Loading