<< All versions

Skill v1.0.0

currentAutomated scan100/100
tejas0111/pharos/mainnet-deployment
──Details
PublishedNovember 20, 2026 at 04:56 PM
Content Hashsha256:2f3017f2d4b179a4...
Git SHAd4ab76f42aa0
──Files
Files (1 file, 8.0 KB)
SKILL.md8.0 KBactive
SKILL.md · 190 lines · 8.0 KB

metadata: version: "1.0.0"


name: pharos-mainnet-deployment description: "Prepare, simulate, broadcast, and verify Pharos contract deployments on Pacific Mainnet (chain ID: 1672). Use when deploying to mainnet, running production release, verifying contracts on mainnet explorer, or configuring PHAROS_MAINNET_RPC_URL for Pharos go-live. Keywords: deploy to mainnet, mainnet release, verify on mainnet, PHAROS_MAINNET_RPC_URL, mainnet deploy, production release, go live, Pacific mainnet, 1672, Pharos, Foundry, Hardhat, forge script, broadcast, simulation, dry-run." metadata: audience: developer version: 1.2.0 category: deployment slash: true


Mainnet Deployment

Prepare, simulate, broadcast, and verify Pharos contract deployments on mainnet.

When to Use

deploy to mainnet, mainnet release, verify on mainnet, PHAROS_MAINNET_RPC_URL, mainnet deploy, production release, go live

When NOT to Use

testnet rehearsal (use testnet-deployment first), contract coding (use pharos-agent-dev-suite), or deployment prep (use deployment-and-verification in dev suite)

Workflow

  1. Requirement Gathering: Analyze the user's request to identify the specific task, target environment (Atlantic 688689 or Pacific 1672), and any missing context. Zero-assumption delivery.
  2. Mandatory Plan (`PLAN.md`): Create or update PLAN.md in the project root with the proposed strategy. Wait for explicit 'Approve' or 'Proceed' from the user before taking any action.
  3. Confirm the contract artifact, mainnet RPC, signer, verification target, and release assumptions.
  4. Run all pre-flight checks: RPC reachable, balance sufficient for gas, env vars set, simulation passes, chain ID confirmed. (See root SKILL.md → Deploy Protocol for full checklist.)
  5. Start from scripts/deploy-mainnet.sh for Foundry or scripts/deploy-mainnet-hardhat.sh for Hardhat, or use the repo's existing deploy flow.

Forge deployment command:

forge script script/Deploy.s.sol --rpc-url $PHAROS_MAINNET_RPC_URL --chain-id 1672 --broadcast --verify --verifier-url $PHAROSSCAN_MAINNET_API_URL

Hardhat deployment command:

npx hardhat run scripts/deploy.ts --network pharosMainnet
  1. Pre-deploy checklist:
  • Strict .env Check: Confirm .env exists with test -f .env and check variables via grep -q (without printing values). NEVER print .env contents. Do NOT proceed if missing or if the user suggests export.
  • Multi-sig approval obtained from all required signers
  • Simulation passed on testnet rehearsal (deploy to Atlantic Testnet 688689 first)
  • PROS gas funded with 20% buffer above estimated cost
  • Private Key: Ensure ${PRIVATE_KEY} is loaded from a .env file; never hardcode or expose.
  • Deployer wallet confirmed (address whitelisted if needed)
  • Emergency rollback plan ready (previous version artifacts, revert scripts)
  • Chain ID confirmed as 1672 (Pharos Pacific Mainnet)
  1. Present the plan and ask for explicit approval before broadcast.
  2. Simulate first (SIMULATE_ONLY=1), then broadcast only on explicit approval.
  3. Capture the address, tx hash, and run post-deploy verification.
  4. Post-deploy: verify contract on mainnet PharosScan at https://www.pharosscan.xyz/address/<DEPLOYED_ADDRESS> and announce deployment with the PharosScan link.
  5. Log explorer URL and prompt the user to tag the release commit.

Output

  • mainnet deployment plan (including pre-flight check results — see root SKILL.md → Deploy Protocol)
  • deploy command
  • verification command
  • explorer link
  • deployment record (address, tx hash, block)

Examples

  • "Deploy this contract to Pharos mainnet"
  • "Prepare the mainnet release"
  • "Verify the mainnet deployment on explorer"
  • "Run pre-flight checks before mainnet deploy (see root SKILL.md → Deploy Protocol)"

Verification

Post-deploy: query getCode on the address, check explorer for verification, confirm state matches constructor args. Prompt for git tag.

Related

testnet-deployment (testnet rehearsal), pharos-agent-dev-suite/deployment-and-verification (prep work)

Pharos-Specific

Network Configuration

Pacific Mainnet runs on chain ID 1672 with currency PROS (not PHRS). PROS has real value — always simulate first and double-check gas budgets.

bash
# RPC
PHAROS_MAINNET_RPC_URL=https://rpc.pharos.xyz
# Forge deployment with gas price control
forge script script/Deploy.s.sol \
--rpc-url $PHAROS_MAINNET_RPC_URL \
--chain-id 1672 \
--broadcast \
--with-gas-price 1000000000 \
--delay 2000

Verification (Requires API Key)

Unlike testnet, mainnet verification on PharosScan requires PHAROSSCAN_API_KEY:

bash
forge verify-contract <ADDRESS> <CONTRACT> \
--chain 1672 \
--verifier blockscout \
--verifier-url https://pharosscan.xyz/api \
--api-key $PHAROSSCAN_API_KEY

Key Differences from Testnet

AspectAtlantic Testnet (688689)Pacific Mainnet (1672)
CurrencyPHRS (testnet, no value)PROS (real value)
VerificationBlockscout, no API keyBlockscout, API key required
Gas priceUse defaultUse --with-gas-price 1 gwei
Multi-sigOptionalStrongly recommended
RehearsalFirst deploymentDeploy to testnet first

Production Checklist

  • [ ] Testnet rehearsal completed and verified on Atlantic
  • [ ] Deployer has sufficient PROS balance (check with pharos_check_balance)
  • [ ] Multi-sig approval obtained (Pharos Safe: 0x41675C099F32341bf84BFc5382aF534df5C7461a)
  • [ ] Emergency rollback plan ready (previous version's deploy artifacts)
  • [ ] Integration tests pass against testnet deployment before mainnet broadcast

Gate

High risk — two-phase execution required:

Phase 1 — Plan (present freely):

  • Draft the PLAN.md with the full implementation strategy, environment-aware safeguards, and verification steps.
  • Do NOT wait for approval to draft — show everything in your response before asking for confirmation
  • Wait for explicit 'Approve' or 'Proceed' from the user.

Phase 2 — Execute (wait for approval):

  • Execute the approved plan from PLAN.md.
  • Do NOT send any onchain transactions or modify critical files until approved.
  • Perform a final "Ready to Broadcast?" check for any high-risk on-chain actions.
  • Wait for explicit user confirmation ("I approve", "proceed", "looks good") before taking any of the Phase 2 actions.

Deployable Contracts on Mainnet

All 13 contracts in contracts/ are mainnet-ready (167 tests passing):

ContractScriptPurpose
PharosSPNPaymasterDeploySPNPaymaster.s.solSponsored transactions via ERC-4337
PharosZkLoginDeployZkLogin.s.solIdentity abstraction
PharosLendingPoolDeployLendingPool.s.solCollateralized lending
DEXPoolDeployDEXPool.s.solConstant-product AMM
StakingPoolDeployStakingPool.s.solTime-weighted staking
PharosPharosRWATokenDeployPharosRWAToken.s.solRegulated RWA token
CrossChainMessageDeployCrossChain.s.solSPN Mailbox
PharosTimelockController—Governance timelock

Deploy Command Examples

bash
# 1. Deploy SPN Paymaster (gas sponsorship for dApp users)
forge script script/DeploySPNPaymaster.s.sol \
--rpc-url https://rpc.pharos.xyz \
--broadcast --slow -vvvv
# 2. Whitelist users (post-deploy)
cast send <PAYMASTER_ADDR> "addSponsor(address)" <USER_ADDR> \
--rpc-url https://rpc.pharos.xyz \
--private-key $PRIVATE_KEY
# 3. Set budgets
cast send <PAYMASTER_ADDR> "setGlobalBudget(uint256)" 1000000000000000000000 \
--rpc-url https://rpc.pharos.xyz

Post-Deployment Checklist

  • [ ] Verify on PharosScan (auto-verify via script)
  • [ ] Update DEPLOYMENTS.md with address
  • [ ] Fund contract with PROS (if paymaster)
  • [ ] Transfer ownership to Safe multi-sig
  • [ ] Set up monitoring (balance alerts, gas tracking)
  • [ ] Update web demo with live contract address

References

  • DEPLOYMENTS.md — Record deployments here
  • script/ — All deploy scripts
  • config/pharos.json — Network configuration
  • PharosScan: https://www.pharosscan.xyz
All versions