Skip to content

Commit 0425445

Browse files
chore: add polygon network
1 parent 71e9595 commit 0425445

File tree

7 files changed

+22
-13
lines changed

7 files changed

+22
-13
lines changed

app/blockchain/.env.example

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
POLYGON_AMOY_RPC_URL=https://rpc-amoy.polygon.technology/
2-
POLYGON_RPC_URL=https://polygon-mainnet.infura.io/
31
PRIVATE_KEY=
4-
ETHERSCAN_API_KEY=
2+
ETHERSCAN_API_KEY=
3+
POLYGON_AMOY_RPC_URL=https://rpc-amoy.polygon.technology/
4+
POLYGON_RPC_URL=https://polygon-mainnet.infura.io
5+
MILKOMEDA_CARDANO_DEVNET=https://rpc-devnet-cardano-evm.c1.milkomeda.com
6+
MILKOMEDA_CARDANO_MAINNET=https://rpc-mainnet-algorand-rollup.a1.milkomeda.com

app/blockchain/Makefile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,10 @@ dme: deploy-mock-erc20
1919
deploy-polygon-testnet:
2020
$(FORGE_SCRIPT) script/DeployFairFund.s.sol:DeployFairFund --rpc-url ${POLYGON_AMOY_RPC_URL} --private-key ${PRIVATE_KEY} ${BROADCAST} --verify --etherscan-api-key ${ETHERSCAN_API_KEY} $(LEGACY) -vvvv
2121

22+
deploy-polygon-mainnet:
23+
$(FORGE_SCRIPT) script/DeployFairFund.s.sol:DeployFairFund --rpc-url ${POLYGON_RPC_URL} --private-key ${PRIVATE_KEY} ${BROADCAST} --verify --etherscan-api-key ${ETHERSCAN_API_KEY} $(LEGACY) -vvvv
24+
25+
2226
mock-all: deploy-mock-fair-fund deploy-mock-erc20
2327

2428

app/web-app/.env.example

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,21 @@
1+
# Get it from https://cloud.reown.com/
12
NEXT_PUBLIC_WALLET_CONNECT_PROJECT_ID=
23

34
# Website URL (Use http://localhost:3000 for local development)
45
NEXT_PUBLIC_WEBSITE_URL=http://localhost:3000
56

67
# NextAuth Secret (Generate a secure random string, e.g., via `openssl rand -base64 32`)
78
NEXTAUTH_SECRET=
9+
10+
# NextAuth URL (Use http://localhost:3000 for local development)
11+
NEXTAUTH_URL=http://localhost:3000
812
NEXTAUTH_URL=http://localhost:3000/
913
NEXTAUTH_URL_INTERNAL=http://localhost:3000/
14+
1015
NEXT_PUBLIC_WEBSITE_DESCRIPTION="FairFund is a blockchain based platform for community-driven funding. Users can deploy funding vaults, deposit funds, and submit proposals for funding. The platform uses a voting mechanism to decide which proposals receive funding."
1116
NEXT_PUBLIC_NETWORK=foundry
1217
NEXT_PUBLIC_SIGN_IN_STATEMENT="SignIn to FairFund."
1318

14-
# NextAuth URL (Use http://localhost:3000 for local development)
15-
NEXTAUTH_URL=http://localhost:3000
16-
1719
# PostgreSQL URLs (Default Docker-based setup uses 'development' password. Use your local PostgreSQL password if running locally)
1820
POSTGRES_PRISMA_URL="postgres://postgres:development@localhost:5432/dev-db"
1921
POSTGRES_URL_NON_POOLING="postgres://postgres:development@localhost:5432/dev-db"
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{"fairFund":"0x5FbDB2315678afecb367f032d93F642f64180aa3"}
1+
{"fairFund":"0xAE8Ae2345D9A3254fD90f117d84D947570553FF2"}

app/web-app/src/wagmi/config/index.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { WagmiAdapter } from '@reown/appkit-adapter-wagmi';
22
import { cookieStorage, createStorage, http } from '@wagmi/core';
3-
import { foundry, polygonAmoy } from '@reown/appkit/networks';
3+
import { foundry, polygonAmoy, polygon } from '@reown/appkit/networks';
44

55
export const projectId = process.env.NEXT_PUBLIC_WALLET_CONNECT_PROJECT_ID;
66

@@ -18,6 +18,7 @@ export const wagmiAdapter = new WagmiAdapter({
1818
networks,
1919
transports: {
2020
[polygonAmoy.id]: http('https://rpc-amoy.polygon.technology/'),
21+
[polygon.id]: http('https://polygon.llamarpc.com'),
2122
[foundry.id]: http('http://localhost:8545'),
2223
},
2324
});

app/web-app/src/wagmi/provider/web3-modal.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { QueryClient, QueryClientProvider } from '@tanstack/react-query';
55
import { createAppKit } from '@reown/appkit/react';
66
import { cookieToInitialState, WagmiProvider, type Config } from 'wagmi';
77
import { siweConfig } from '@/wagmi/siwe';
8-
import { foundry, polygonAmoy } from '@reown/appkit/networks';
8+
import { foundry, polygonAmoy, polygon } from '@reown/appkit/networks';
99

1010
const queryClient = new QueryClient();
1111

@@ -24,9 +24,9 @@ const modal = createAppKit({
2424
networks:
2525
process.env.NEXT_PUBLIC_NETWORK === 'foundry'
2626
? [foundry]
27-
: [polygonAmoy],
27+
: [polygonAmoy, polygon],
2828
defaultNetwork:
29-
process.env.NEXT_PUBLIC_NETWORK === 'foundry' ? foundry : polygonAmoy,
29+
process.env.NEXT_PUBLIC_NETWORK === 'foundry' ? foundry : polygon,
3030
metadata,
3131
features: {
3232
analytics: false,

app/web-app/src/wagmi/siwe/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
'use client';
22
import { createSIWEConfig, formatMessage } from '@reown/appkit-siwe';
33
import { getCsrfToken, getSession, signIn, signOut } from 'next-auth/react';
4-
import { foundry, polygonAmoy } from 'viem/chains';
4+
import { foundry, polygonAmoy, polygon } from 'viem/chains';
55

66
export const siweConfig = createSIWEConfig({
77
getMessageParams: async () => ({
@@ -10,7 +10,7 @@ export const siweConfig = createSIWEConfig({
1010
chains:
1111
process.env.NEXT_PUBLIC_NETWORK === 'foundry'
1212
? [foundry.id]
13-
: [polygonAmoy.id],
13+
: [polygonAmoy.id, polygon.id],
1414
statement: 'Sign In With Ethereum to prove you control this wallet.',
1515
}),
1616
createMessage: ({ address, ...args }) => formatMessage(args, address),

0 commit comments

Comments
 (0)