Skip to content

Commit

Permalink
feat: allowing votes from the L2
Browse files Browse the repository at this point in the history
  • Loading branch information
carlosgj94 committed Jul 4, 2024
1 parent 25f44fe commit e5232d4
Show file tree
Hide file tree
Showing 9 changed files with 1,084 additions and 346 deletions.
2 changes: 2 additions & 0 deletions constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ export const PUB_DELEGATION_CONTRACT_ADDRESS = (process.env.NEXT_PUBLIC_DELEGATI
// TOUCAN VOTING
export const PUB_TOUCAN_VOTING_PLUGIN_ADDRESS = (process.env.NEXT_PUBLIC_TOUCAN_VOTING_PLUGIN_ADDRESS ?? "") as Address;
export const PUB_OFT_ADAPTER_ADDRESSS = (process.env.NEXT_PUBLIC_OFT_ADAPTER_ADDRESS ?? "") as Address;
export const PUB_TOUCAN_RECEIVER_ADDRESS = (process.env.NEXT_PUBLIC_TOUCAN_RECEIVER_ADDRESS ?? "") as Address;
export const PUB_TOUCAN_VOTING_PLUGIN_L2_ADDRESS = (process.env.NEXT_PUBLIC_TOUCAN_VOTING_PLUGIN_L2_ADDRESS ??
"") as Address;
export const PUB_TOKEN_L1_ADDRESS = (process.env.NEXT_PUBLIC_TOKEN_L1_ADDRESS ?? "") as Address;
Expand All @@ -31,6 +32,7 @@ export const PUB_CHAIN = getChain(PUB_CHAIN_NAME);
export const PUB_ALCHEMY_API_KEY = process.env.NEXT_PUBLIC_ALCHEMY_API_KEY ?? "";

export const PUB_WEB3_ENDPOINT = (process.env.NEXT_PUBLIC_WEB3_URL_PREFIX ?? "") + PUB_ALCHEMY_API_KEY;
export const PUB_WEB3_ENDPOINT_L2 = (process.env.NEXT_PUBLIC_WEB3_URL_PREFIX_L2 ?? "") + PUB_ALCHEMY_API_KEY;

export const PUB_ETHERSCAN_API_KEY = process.env.NEXT_PUBLIC_ETHERSCAN_API_KEY ?? "";

Expand Down
6 changes: 4 additions & 2 deletions context/Web3Modal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,9 @@ import {
PUB_WALLET_CONNECT_PROJECT_ID,
PUB_WALLET_ICON,
PUB_WEB3_ENDPOINT,
PUB_WEB3_ENDPOINT_L2,
} from "@/constants";
import { mainnet } from "viem/chains";
import { mainnet, optimismSepolia } from "viem/chains";

// wagmi config
const metadata = {
Expand All @@ -21,11 +22,12 @@ const metadata = {
};

export const config = createConfig({
chains: [PUB_CHAIN, mainnet],
chains: [PUB_CHAIN, mainnet, optimismSepolia],
ssr: true,
transports: {
[PUB_CHAIN.id]: http(PUB_WEB3_ENDPOINT, { batch: true }),
[mainnet.id]: http(PUB_WEB3_ENDPOINT, { batch: true }),
[optimismSepolia.id]: http(PUB_WEB3_ENDPOINT_L2, { batch: true }),
},
connectors: [
walletConnect({
Expand Down
Loading

0 comments on commit e5232d4

Please sign in to comment.