Deployment & Migration Guide
This guide outlines the deployment process, network configuration, and governance-based upgrade paths for OmniSocial.
It also supports contributors or projects wishing to deploy their own instance of OmniSocial.
🔧 Deployment Process Overview
OmniSocial’s core is composed of smart contracts, a subgraph, and a front-end dApp. Deployment occurs in three coordinated phases:
Smart Contracts (Hardhat)
Subgraph Indexing (The Graph)
Front-End Configuration (Next.js)
All deployments are managed via
Hardhat
scripts in the/packages/contracts
folder.
🛠 Smart Contract Deployment (Using Hardhat)
Pre-requisites
Node.js ≥ v18
Hardhat + ethers
.env
file with deployer key & RPC endpoint
Run Deploy Script
npx hardhat run scripts/deploy.ts --network polygonZkEvm
This deploys core contracts:
OmniWalletFactory
PersonaNFT
RepModule
DAOFactory
EditionDropFactory
(optional)
Addresses are auto-logged and stored in /deployments/[network].json
.
🌍 Network Configuration
polygonZkEvm
1101
Main zkEVM network
✅ Active
polygonZkTestnet
1442
Test zkEVM network
🧪 Testing
Update hardhat.config.ts
and subgraph.yaml
with correct addresses per deployment.
🧬 Subgraph Deployment
Update /packages/subgraph/subgraph.yaml
with deployed contract addresses.
Deploy to Hosted Service
graph deploy \
--product hosted-service \
--access-token $GRAPH_ACCESS_TOKEN \
omnisocial/zk-mainnet
Replace with
zk-testnet
or your own namespace as needed.
🌐 Front-End Environment
Update .env.local
in the frontend/
package with:
NEXT_PUBLIC_CONTRACTS_JSON=/deployments/polygonZkEvm.json
NEXT_PUBLIC_GRAPHQL_ENDPOINT=https://api.thegraph.com/subgraphs/name/omnisocial/zk-mainnet
🧱 Upgrade Flow via DAO
OmniSocial contracts use UUPS (Universal Upgradeable Proxy Standard) where applicable. Contract upgrades must be:
Proposed via
createProposal()
in a DAO.Voted on by token holders or reputation holders.
Queued and executed via the
TimelockController
.
Example upgrade proposal:
const proposal = daoContract.createProposal(
"Upgrade RepModule to v2",
[repModuleProxy.address],
[0],
[repModuleImpl.interface.encodeFunctionData("upgradeTo", [newImplAddress])],
"Upgrade RepModule contract for new domain logic."
);
DAO votes + timelock are required for execution unless deploying your own fork without governance gating.
🪜 Forking & Migrating
To fork OmniSocial:
Clone the repo and update the namespaces (
omnisocial
→ your project).Deploy fresh contracts using the same steps.
Optionally, fork the subgraph and point to your contract addresses.
Replace
omnisocial.dev
links and branding in the front-end config.
Migration tools (e.g., to import users or personas from another deployment) will be available soon.
Last updated
Was this helpful?