Smart contracts and frontend for the JCDAO community.
contracts/: Solidity smart contracts (JCDToken, JCDMembership).scripts/: Deployment and utility scripts.test/: Hardhat tests.frontend/: Next.js web application.
- Node.js v18+
- npm or yarn
- A wallet with Polygon Amoy testnet tokens (POL).
-
Install Dependencies
npm install cd frontend && npm install
-
Environment Configuration
- Copy
.env.exampleto.envin the root directory and fill in yourPRIVATE_KEYandPOLYGON_AMOY_RPC_URL. - Copy
frontend/.env.exampletofrontend/.env.local(if not already created).
- Copy
npx hardhat compilenpx hardhat testnpm run deploy:amoyThis command will:
- Deploy contracts to Amoy.
- Verify contracts on PolygonScan (if API key provided).
- Print the deployed addresses.
After deployment, run the ABI extraction script to update the frontend with the new ABIs:
node scripts/extract-abi.jsThen update frontend/.env.local with the new contract addresses.
cd frontend
npm run devThe frontend is ready for deployment on Vercel.
- Push this repository to GitHub.
- Import the project in Vercel.
- Set the
Root Directorytofrontend. - Add the Environment Variables from
frontend/.env.localto Vercel Project Settings.