Deploy — Mainnet (Polygon 137)
This is the production deployment guide for Sylan on Polygon Mainnet. It assumes you completed Deploy → Testnet (Amoy) with the exact same commit and have sign‑offs from engineering and security. All contracts are UUPS proxies — always interact with proxy addresses.
Chain: Polygon Mainnet (137) · Explorer: https://polygonscan.com · Gas token: POL
0) Go/No‑Go gates (must pass before mainnet)
- ✅ Code freeze: tag the repo (e.g.,
v1.0.0-mainnet) — same bytecode as Amoy dry‑run - ✅ Tests: unit + integration green; storage‑layout diff reviewed
- ✅ Dry‑run: full deploy + wiring on Amoy; smoke test PPC + subscription
- ✅ Ownership: all proxies owned by a Gnosis Safe (≥2‑of‑3); EOA ownership is not allowed
- ✅ Runbooks: pause/upgrade/rollback procedures written and linked
- ✅ Monitoring: indexers + dashboards subscribed to Events (see Architecture → Events)
- ✅ Keys: provider signer held in HSM/HW wallet; signer rotation plan prepared
1) Production parameters (decide before deploy)
Set these constants up front and record them in your change doc:
- Treasury & Payouts
PLATFORM_TREASURY = 0x...(multisig)NODE_POOL = 0x...(pool distributor or multisig)TREASURY = 0x...(NodeRegistry slashing destination)
- Escrow Fee BPS (must sum to 10,000)
providerBps,nodeBps,platformBps
- Consensus
quorum(e.g.,3or5depending on node count)requestExpiryGraceMs(e.g.,120_000)
- Registry
maxRequestExpiryMs(e.g.,60_000)enforceSignerTimelock = true|false
- NodeRegistry
minStake(e.g.,10_000 SYL)unbondingPeriod(e.g.,7 days)- Slash distribution BPS (treasury/nodePool/burn) → sums to 10,000
- Staking (optional)
- Reward mode: mint (grant
MINTER_ROLE) or pull fromrewardSource
- Reward mode: mint (grant
Record final values in the deployment ticket and keep them immutable without governance approval.
2) Deploy order (same as testnet)
- SylanToken (ERC‑20, UUPS)
- EventLogger (UUPS)
- NodeRegistry (UUPS)
- APIEscrow (UUPS)
- APIConsensus (UUPS)
- AccessRegistry (UUPS)
- SylanStaking (optional, UUPS)
- SylanVesting (optional, non‑upgradeable)
- PresaleContract (optional, UUPS)
Keep a live address log (proxy + implementation) as you go.
3) Wiring & role assignments (production)
Run owner‑signed transactions from the multisig only.
// Escrow → addresses & fees
escrow.setPlatformTreasury(PLATFORM_TREASURY)
escrow.setNodePool(NODE_POOL)
escrow.setDefaultFeeBps(providerBps, nodeBps, platformBps)
escrow.setAccessRegistry(accessRegistry.address)
escrow.setApiConsensus(consensus.address)
escrow.setNodeRegistry(nodeRegistry.address)
// Consensus → parameters
consensus.setQuorum(quorum)
consensus.setRequestExpiryGraceMs(requestExpiryGraceMs)
// Registry → wiring & caps
accessRegistry.setApiEscrow(escrow.address)
accessRegistry.setApiConsensus(consensus.address)
accessRegistry.setNodeRegistry(nodeRegistry.address)
accessRegistry.setMaxRequestExpiryMs(maxRequestExpiryMs)
accessRegistry.setSignerTimelock(true) // if using rotation windows
// NodeRegistry → economics
nodeRegistry.setTreasury(TREASURY)
nodeRegistry.setNodePool(NODE_POOL)
nodeRegistry.setSlashDistribution(treasuryBps, nodePoolBps, burnBps)
// Staking (optional)
// If minting rewards:
// token.grantRole(MINTER_ROLE, staking.address)
// Else pre‑fund rewardSource and set allowanceSecurity roles:
- Token:
MINTER_ROLEonly to staking (if used),PAUSER_ROLEto governance; verifyDEFAULT_ADMIN_ROLEis the multisig - Proxies: owner = multisig; keep EOA keys out of admin paths
4) Verification on Polygonscan
Verify implementations and mark proxies as EIP‑1967.
pnpm hardhat verify --network polygon <impl_or_proxy_addr> <args_if_any>Check the Implementation tab shows the same bytecode hash as your tag. Record links in the deployment ticket.
5) Genesis data (minimal, then iterate)
Start with a narrow canary set, then expand.
5.1 Register initial APIs
- Choose
apiIds that are stable (e.g.,provider:feed:v1) - Set plan: PPC first (
priceconservative), then add Subscription when ready - Configure
seqMonotonic,maxSkewMs,maxTtlMsper data domain setDescriptor(apiId, uri, contentHash)with versioned docs
5.2 Provider signer
- Set
providerSigner; ifenforceSignerTimelock=true, rotation window must elapse before nodes accept snapshots
5.3 Nodes
- Onboard a small active set; each stakes ≥
minStake - Confirm
NodeRegistry.isActiveNode(node) == true
6) Canary & cutover plan
- Pause contracts initially if you prefer a dark launch; unpause after wiring
- Run a single PPC request with a tiny price (e.g.,
0.01 SYL) end‑to‑end - Observe
RequestCreated → Locked → RequestRegistered → ResponseSubmitted → RequestFinalized → Settled - Increase traffic gradually; monitor refund rate and quorum timing
Rollback options:
- Pause Escrow/Consensus/Registry
- Deactivate affected APIs (
setApiActive=false) - Upgrade a proxy with
upgradeTo(hotfix) — follow your runbook
7) Monitoring & alerts (must‑have)
- Event streams:
Locked/Settled/Refunded,Request*,ProviderEquivocation, NodeRegistry slashing - KPIs: quorum latency (p50/p95), refund rate, escrow balances, withdraw volumes, node reputation changes
- Alerting: spikes in
RequestFailed(NoQuorum), suddenInactiveAPI, slashing bursts
8) Post‑deploy tasks
- Update Architecture → Addresses & ABIs (Polygon Mainnet section) with proxy addresses
- Publish a short changelog: impl addresses, storage diffs, params, tx hashes, and links to explorer verifications
- Archive the multisig transaction bundle (JSON) in the repo’s
/ops/releases/v1.0.0/
9) Incident response (summary)
- Consumer‑impacting issues →
pause()Escrow/Consensus, refund PPC by allowing failures - Data integrity issue → set API inactive, rotate
providerSigner(respect timelock), investigate - Key compromise → rotate multisig owners; revoke roles; redeploy if necessary; publish post‑mortem
Keep this page aligned with your internal runbooks.
10) Checklists
Pre‑deploy
- Repo tagged; bytecode matches Amoy build
- Multisig funded with MATIC
- Final params decided (BPS, quorum, caps, minStake)
- Indexers live; dashboards ready
- Provider signer in HSM/HW wallet
Day‑of deploy
- Deploy proxies in order and record addresses
- Wire modules and set parameters via multisig
- Verify implementations + proxies on Polygonscan
- Register 1–2 canary APIs and 2–3 nodes
- Run canary PPC and confirm settlement
Post‑deploy
- Update Addresses & ABIs (Mainnet)
- Publish changelog + announce
- Enable subscription plans (optional)
- Schedule upgrade rehearsal on Amoy for the next release
Out of scope for this page
- Contract surfaces → see Contracts pages
- Testnet steps → Deploy → Testnet
- Frontend integration → Quickstart / Integrations