Files
proxmox/docs/03-deployment/OPTIONAL_FUTURE_DEPLOYMENTS_RUNBOOK.md
defiQUG bea1903ac9
Some checks failed
Deploy to Phoenix / deploy (push) Has been cancelled
Sync all local changes: docs, config, scripts, submodule refs, verification evidence
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-02-21 15:46:06 -08:00

8.0 KiB

Deployments — Master Runbook

Note: Nothing here is optional nor future — these are planned deployments.

Last Updated: 2026-02-16
Status: Reference — run when PRIVATE_KEY, funded wallet, and RPC access are available


Overview

This runbook covers all deployments (Chain 138 and multichain). Run from smom-dbis-138/ with .env loaded. Chain 138 default gas: 2 gwei (GAS_PRICE_138).

Deployment Script Chain(s) Depends
Trustless Bridge script/bridge/trustless/DeployTrustlessBridge.s.sol 138 + Mainnet None
DeployAll (multichain) script/DeployAll.s.sol Mainnet, Cronos, BSC, Polygon, Gnosis, Avalanche, Base, Arbitrum, Optimism Per-chain RPC
CREATE2 / Deterministic Core script/deploy/DeployDeterministicCore.s.sol 138 None
Vault System script/deploy/vault/DeployVaultSystem.s.sol 138 None
Reserve System script/reserve/DeployReserveSystem.s.sol 138 TOKEN_FACTORY
Reserve Keeper script/reserve/DeployKeeper.s.sol 138 Reserve system
DODO / Swap script/dex/DeployDODOPMMIntegration.s.sol 138 cUSDT, cUSDC
eMoney script/emoney/DeployChain138.s.sol 138 None
Smart Accounts + Paymaster script/smart-accounts/DeploySmartAccountsKit.s.sol 138 EntryPoint/Factory from ERC-4337
PaymentChannelManager script/DeployPaymentChannelManager.s.sol 138 None
GenericStateChannelManager script/DeployGenericStateChannelManager.s.sol 138 None

1. Trustless Bridge (Chain 138 + Mainnet)

Purpose: Lockbox138 on Chain 138; BondManager, ChallengeManager, LiquidityPoolETH, InboxETH, SwapRouter, BridgeSwapCoordinator on Mainnet.

cd smom-dbis-138
source .env

# Chain 138: Lockbox138 only
forge script script/bridge/trustless/DeployTrustlessBridge.s.sol:DeployTrustlessBridge \
  --rpc-url $RPC_URL_138 --broadcast --private-key $PRIVATE_KEY --with-gas-price 1000000000

# Mainnet: Full bridge (requires MAINNET_RPC in .env)
forge script script/bridge/trustless/DeployTrustlessBridge.s.sol:DeployTrustlessBridge \
  --rpc-url $ETHEREUM_MAINNET_RPC --broadcast --via-ir --verify

Full system (Mainnet): DeployEnhancedSwapRouter, DeployIntegrationContracts, InitializeBridgeSystem — see script/bridge/trustless/DeployCompleteSystem.s.sol for steps.

Ref: bridge/trustless/DEPLOYMENT_GUIDE.md


2. DeployAll (Mainnet / Multichain)

Purpose: WETH9, WETH10, CCIP Bridges, CCIPLogger to Cronos, BSC, Polygon, Gnosis, Avalanche, Base, Arbitrum, Optimism. Mainnet: CCIPLogger only.

cd smom-dbis-138
source .env

# Per chain — set RPC for target chain
# Cronos
forge script script/DeployAll.s.sol --rpc-url $CRONOS_RPC --broadcast --private-key $PRIVATE_KEY

# Polygon
forge script script/DeployAll.s.sol --rpc-url $POLYGON_RPC --broadcast --private-key $PRIVATE_KEY

# Arbitrum
forge script script/DeployAll.s.sol --rpc-url $ARBITRUM_RPC --broadcast --private-key $PRIVATE_KEY

# ... repeat for BSC, Gnosis, Avalanche, Base, Optimism

Chain 138 is NOT in DeployAll — use deploy-and-configure-weth9-bridge-chain138.sh for Chain 138.


3. CREATE2 / Deterministic Core (Chain 138)

Purpose: CREATE2Factory, UniversalAssetRegistry, UniversalCCIPBridge (proxy), MirrorRegistry, AlltraAdapter — deterministic addresses.

cd smom-dbis-138
source .env

forge script script/deploy/DeployDeterministicCore.s.sol \
  --rpc-url $RPC_URL_138 --broadcast --private-key $PRIVATE_KEY --with-gas-price 1000000000

# After deploy: call UniversalCCIPBridge.setCCIPRouter(router) on each chain

4. Vault / Reserve / Keeper

Vault System

forge script script/deploy/vault/DeployVaultSystem.s.sol:DeployVaultSystem \
  --rpc-url $RPC_URL_138 --broadcast --private-key $PRIVATE_KEY --with-gas-price 1000000000

Reserve System (requires TOKEN_FACTORY in .env)

forge script script/reserve/DeployReserveSystem.s.sol \
  --rpc-url $RPC_URL_138 --broadcast --private-key $PRIVATE_KEY --with-gas-price 1000000000

Reserve Keeper

forge script script/reserve/DeployKeeper.s.sol \
  --rpc-url $RPC_URL_138 --broadcast --private-key $PRIVATE_KEY --with-gas-price 1000000000

5. DODO / Swap

Purpose: DODOPMMIntegration for cUSDT/cUSDC pools. Requires DODO Vending Machine and Approve addresses on Chain 138.

Required env: DODO_VENDING_MACHINE_ADDRESS, COMPLIANT_USDT_ADDRESS, COMPLIANT_USDC_ADDRESS. Optional: DODO_APPROVE_ADDRESS, OFFICIAL_USDT_ADDRESS, OFFICIAL_USDC_ADDRESS.

cd smom-dbis-138
source .env

# Env: DODO_VENDING_MACHINE_ADDRESS (required), COMPLIANT_USDT_ADDRESS (required), COMPLIANT_USDC_ADDRESS (required)
forge script script/dex/DeployDODOPMMIntegration.s.sol \
  --rpc-url $RPC_URL_138 --broadcast --private-key $PRIVATE_KEY --with-gas-price 1000000000

Pool creation: Use script/dex/DeployPrivatePoolRegistryAndPools.s.sol or DODOPMMIntegration.createPool after deploy.


6. eMoney (Chain 138)

Purpose: ComplianceRegistry, DebtRegistry, PolicyManager, eMoneyToken, TokenFactory138, BridgeVault138.

cd smom-dbis-138
source .env

forge script script/emoney/DeployChain138.s.sol:DeployChain138 \
  --rpc-url $RPC_URL_138 --broadcast --private-key $PRIVATE_KEY --with-gas-price 1000000000

Optional env: GOVERNANCE_MULTISIG, TOKEN_DEPLOYER_MULTISIG, POLICY_OPERATOR_MULTISIG, etc.


7. Smart Accounts + Paymaster (ERC-4337)

Purpose: EntryPoint, AccountFactory, Paymaster. Script is informational — deploy from MetaMask Smart Accounts Kit or standard ERC-4337.

cd smom-dbis-138
source .env

# Script logs addresses; does not deploy contracts
forge script script/smart-accounts/DeploySmartAccountsKit.s.sol \
  --rpc-url $RPC_URL_138 --broadcast --private-key $PRIVATE_KEY --with-gas-price 1000000000

Steps:

  1. Obtain EntryPoint, AccountFactory, Paymaster from MetaMask kit or ERC-4337 impl
  2. Deploy to Chain 138
  3. Set ENTRY_POINT, SMART_ACCOUNT_FACTORY, PAYMASTER in .env
  4. Deploy AccountWalletRegistryExtended: forge script script/smart-accounts/DeployAccountWalletRegistryExtended.s.sol ...

8. PaymentChannelManager / GenericStateChannelManager

cd smom-dbis-138
source .env

forge script script/DeployPaymentChannelManager.s.sol \
  --rpc-url $RPC_URL_138 --broadcast --private-key $PRIVATE_KEY --with-gas-price 1000000000

forge script script/DeployGenericStateChannelManager.s.sol \
  --rpc-url $RPC_URL_138 --broadcast --private-key $PRIVATE_KEY --with-gas-price 1000000000

Ref: PAYMENT_CHANNELS_DEPLOYMENT.md


0. AddressMapper on other chains (Cronos, BSC, etc.)

Purpose: Deploy an empty AddressMapper (no Chain-138-specific mappings) so config/smart-contracts-master.json can set mapper to a contract address instead of "canonical".

cd smom-dbis-138
source .env
# Set RPC for target chain (e.g. Cronos)
export RPC_URL="${CRONOS_RPC:-https://evm.cronos.org}"
forge script script/DeployAddressMapperOtherChain.s.sol:DeployAddressMapperOtherChain \
  --rpc-url "$RPC_URL" --broadcast --private-key "$PRIVATE_KEY" --legacy

After deploy: Update config/smart-contracts-master.json: set chains["25"].mapper (Cronos) to the deployed address. See OPTIONAL_DEPLOYMENTS_START_HERE §A.


Orchestration Script

Run all optional/future deployments in order:

cd smom-dbis-138
./scripts/deployment/deploy-optional-future-all.sh [--dry-run] [--phases 1,2,3,...]

See scripts/deployment/deploy-optional-future-all.sh for phase list and skip logic.


Post-Deployment

  1. Update .env with all new addresses
  2. Update config/smart-contracts-master.json when available
  3. Run on-chain check: ./scripts/verify/check-contracts-on-chain-138.sh
  4. Blockscout verification: ./scripts/verify/run-contract-verification-with-proxy.sh (from LAN)