Skill v1.0.0
currentAutomated scan100/100metadata: 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
- 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.
- Mandatory Plan (`PLAN.md`): Create or update
PLAN.mdin the project root with the proposed strategy. Wait for explicit 'Approve' or 'Proceed' from the user before taking any action. - Confirm the contract artifact, mainnet RPC, signer, verification target, and release assumptions.
- 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.) - 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
- Pre-deploy checklist:
- Strict .env Check: Confirm
.envexists withtest -f .envand check variables viagrep -q(without printing values). NEVER print.envcontents. Do NOT proceed if missing or if the user suggestsexport. - 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.envfile; 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)
- Present the plan and ask for explicit approval before broadcast.
- Simulate first (
SIMULATE_ONLY=1), then broadcast only on explicit approval. - Capture the address, tx hash, and run post-deploy verification.
- Post-deploy: verify contract on mainnet PharosScan at
https://www.pharosscan.xyz/address/<DEPLOYED_ADDRESS>and announce deployment with the PharosScan link. - 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.
# RPCPHAROS_MAINNET_RPC_URL=https://rpc.pharos.xyz# Forge deployment with gas price controlforge 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:
forge verify-contract <ADDRESS> <CONTRACT> \--chain 1672 \--verifier blockscout \--verifier-url https://pharosscan.xyz/api \--api-key $PHAROSSCAN_API_KEY
Key Differences from Testnet
| Aspect | Atlantic Testnet (688689) | Pacific Mainnet (1672) | |
|---|---|---|---|
| Currency | PHRS (testnet, no value) | PROS (real value) | |
| Verification | Blockscout, no API key | Blockscout, API key required | |
| Gas price | Use default | Use --with-gas-price 1 gwei | |
| Multi-sig | Optional | Strongly recommended | |
| Rehearsal | First deployment | Deploy 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.mdwith 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):
| Contract | Script | Purpose | |
|---|---|---|---|
| PharosSPNPaymaster | DeploySPNPaymaster.s.sol | Sponsored transactions via ERC-4337 | |
| PharosZkLogin | DeployZkLogin.s.sol | Identity abstraction | |
| PharosLendingPool | DeployLendingPool.s.sol | Collateralized lending | |
| DEXPool | DeployDEXPool.s.sol | Constant-product AMM | |
| StakingPool | DeployStakingPool.s.sol | Time-weighted staking | |
| PharosPharosRWAToken | DeployPharosRWAToken.s.sol | Regulated RWA token | |
| CrossChainMessage | DeployCrossChain.s.sol | SPN Mailbox | |
| PharosTimelockController | — | Governance timelock |
Deploy Command Examples
# 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 budgetscast send <PAYMASTER_ADDR> "setGlobalBudget(uint256)" 1000000000000000000000 \--rpc-url https://rpc.pharos.xyz
Post-Deployment Checklist
- [ ] Verify on PharosScan (auto-verify via script)
- [ ] Update
DEPLOYMENTS.mdwith 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 herescript/— All deploy scriptsconfig/pharos.json— Network configuration- PharosScan: https://www.pharosscan.xyz