Skip to content

Commit

Permalink
Merge pull request #11 from 1Hive/dev
Browse files Browse the repository at this point in the history
[Dev to Main] Sepolia
  • Loading branch information
kamikazebr authored Jan 11, 2024
2 parents fc88883 + 797e5fb commit d14d973
Show file tree
Hide file tree
Showing 97 changed files with 4,145 additions and 23,004 deletions.
26 changes: 13 additions & 13 deletions apps/web/app/(app)/gardens/communities/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -118,13 +118,13 @@ const conmmunities: Community[] = [
name: "Pool 1",
strategy: "C.V",
proposals: 3,
href: "1",
href: `${contractsAddresses.poolID}`,
},
{
name: "Pool 2",
strategy: "C.V",
proposals: 3,
href: "2",
href: `${contractsAddresses.poolID + 1}`,
},
],
},
Expand All @@ -137,13 +137,13 @@ const conmmunities: Community[] = [
name: "Pool 1",
strategy: "C.V",
proposals: 3,
href: "1",
href: `${contractsAddresses.poolID}`,
},
{
name: "Pool 2",
strategy: "C.V",
proposals: 3,
href: "2",
href: `${contractsAddresses.poolID + 1}`,
},
],
},
Expand All @@ -156,20 +156,20 @@ const conmmunities: Community[] = [
name: "Pool 1",
strategy: "C.V",
proposals: 3,
href: "1",
href: `${contractsAddresses.poolID}`,
},
{
name: "Pool 2",
strategy: "C.V",
proposals: 3,
href: "2",
},
{
name: "Pool 3",
strategy: "C.V",
proposals: 3,
href: "3",
href: `${contractsAddresses.poolID + 1}`,
},
// {
// name: "Pool 3",
// strategy: "C.V",
// proposals: 3,
// href: "3",
// },
],
},
{
Expand All @@ -181,7 +181,7 @@ const conmmunities: Community[] = [
name: "Pool 1",
strategy: "C.V",
proposals: 3,
href: "1",
href: `${contractsAddresses.poolID}`,
},
],
},
Expand Down
7 changes: 4 additions & 3 deletions apps/web/app/(app)/gardens/communities/pool/[poolId]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import { useContractRead, useContractWrite } from "wagmi";
import { cvStrategyABI, alloABI } from "@/src/generated";
import { useProposalsRead } from "@/hooks/useProposalsRead";
import { formatEther } from "viem";
import { contractsAddresses } from "@/constants/contracts";

//some metadata for each pool
const poolInfo = [
Expand Down Expand Up @@ -56,19 +57,19 @@ export default function Pool({
<header className="flex flex-col items-center justify-center">
<h2 className="text-center font-press">Pool {poolId} </h2>
<h4 className="text-2xl ">
{poolInfo[(poolId as unknown as number) - 1].title}
{/* {poolInfo[(poolId as unknown as number) - 1].title} */}
</h4>
</header>
<main className="flex flex-col gap-10">
{/* header: description - data - bottom land image */}
<section className="relative flex w-full flex-col items-center overflow-hidden rounded-lg border-2 border-black bg-white">
<div className="mt-4 flex flex-col gap-12 p-8">
<p className="max-w-4xl text-center text-lg font-semibold">
{poolInfo[(poolId as unknown as number) - 1].description}
{/* {poolInfo[(poolId as unknown as number) - 1].description} */}
</p>
<div className="flex w-full p-4">
<div className="flex flex-1 flex-col space-y-4 text-xl font-semibold">
{poolId === "1" && (
{poolId === contractsAddresses.poolID && (
<>
{status === "idle" ? (
<>
Expand Down
2 changes: 1 addition & 1 deletion apps/web/components/Proposals.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ export function Proposals({ poolId }: { poolId: string }) {

const submit = () => {
const encodedData = getEncodedProposals(inputs, proposals);
const poolId = 1;
const poolId = Number(contractsAddresses.poolID);

writeContract({
args: [BigInt(poolId), encodedData as `0x${string}`],
Expand Down
57 changes: 52 additions & 5 deletions apps/web/constants/contracts/index.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,54 @@
export const contractsAddresses = {
allo: "0x9fE46736679d2D9a65F0992F2272dE9f3c7fa6e0" as `0x${string}`,
strategy: "0xB7f8BC63BbcaD18155201308C8f3540b07f84F5e" as `0x${string}`,
// read env variables
// const envPoolIdSignaling = process.env.POOL_ID_SIGNALING || "";
// const envStrat2Address = process.env.STRAT2_ADDR_ARB_SEPOLIA || "";
// const envTokenAddressArbSepolia = process.env.TOKEN_ADDR_ARB_SEPOLIA || "";
// const envTokenNativeAddressArbSepolia =
// process.env.TOKEN_NATIVE_ADDR_ARB_SEPOLIA || "";
const ENV = process.env.NEXT_PUBLIC_ENV_GARDENS || "";

const envAlloAddress = process.env.NEXT_PUBLIC_ALLO_ADDRESS_ARB_SEPOLIA || "";

const envPoolId = process.env.NEXT_PUBLIC_POOL_ID || 1;

const envStrat1Address = process.env.NEXT_PUBLIC_STRAT1_ADDR_ARB_SEPOLIA || "";

const envRegistryGardensAddArbSep =
process.env.NEXT_PUBLIC_REGISTRY_GARDENS_ADDR_ARB_SEPOLIA || "";

const envAlloRegistryAddArbSep =
process.env.NEXT_PUBLIC_ALLO_REGISTRY_ADDR_ARB_SEPOLIA || "";

const envPoolAdminAddressArbSepolia =
process.env.NEXT_PUBLIC_POOL_ADMIN_ADDR_ARB_SEPOLIA || "";

const envCouncilSafeAddressArbSepolia =
process.env.NEXT_PUBLIC_COUNCIL_SAFE_ADDR_ARB_SEPOLIA || "";

const envRpcUrlArbTestnet = process.env.NEXT_PUBLIC_RPC_URL_ARB_TESTNET || "";

let __contractsAddresses = {
allo: `0x9fE46736679d2D9a65F0992F2272dE9f3c7fa6e0` as `0x${string}`,
strategy: `0xB7f8BC63BbcaD18155201308C8f3540b07f84F5e` as `0x${string}`,
registryGardens:
"0x61c36a8d610163660E21a8b7359e1Cac0C9133e1" as `0x${string}`,
registry: "0x5FbDB2315678afecb367f032d93F642f64180aa3" as `0x${string}`,
`0x61c36a8d610163660E21a8b7359e1Cac0C9133e1` as `0x${string}`,
registry: `0x5FbDB2315678afecb367f032d93F642f64180aa3` as `0x${string}`,
poolID: `1`,
rpcUrl: `http://127.0.0.1:8545`,
};

if (ENV === "prod") {
__contractsAddresses = {
allo: `${envAlloAddress}` as `0x${string}`,
strategy: `${envStrat1Address}` as `0x${string}`,
registryGardens: `${envRegistryGardensAddArbSep}` as `0x${string}`,
registry: `${envAlloRegistryAddArbSep}` as `0x${string}`,
poolID: `${envPoolId}`,
rpcUrl: `${envRpcUrlArbTestnet}`,
};
}
console.log("env", ENV);
console.log("envs", __contractsAddresses);

export const contractsAddresses = __contractsAddresses;

export const isProd = ENV === "prod";
4 changes: 3 additions & 1 deletion apps/web/hooks/useConviction.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@ export const useConviction = () => {
const [data, setData] = useState([]);

const proposalId = 1;
const { proposals } = useProposalsRead({ poolId: Number(1) });
const { proposals } = useProposalsRead({
poolId: Number(contractsAddresses.poolID),
});

const proposalsReadsContract = proposals?.filter(
(proposal) => proposal.id === Number(proposalId),
Expand Down
4 changes: 3 additions & 1 deletion apps/web/hooks/useProposalsRead.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,9 @@ export const useProposalsRead = ({ poolId }: { poolId: number }) => {

// Choose between proposalsMock and proposalsMock2 based on poolId
const selectedProposalsMock =
poolId === 1 ? fundingProposals : signalingProposals;
poolId === Number(contractsAddresses.poolID)
? fundingProposals
: signalingProposals;

// Merge the additional data from proposalsMock based on the index

Expand Down
12 changes: 10 additions & 2 deletions apps/web/providers/WagmiProvider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,20 @@ import { walletConnectProvider, EIP6963Connector } from "@web3modal/wagmi";

import { WagmiConfig, configureChains, createConfig } from "wagmi";
import { publicProvider } from "wagmi/providers/public";
import { sepolia, optimism, gnosis, mainnet, arbitrum } from "viem/chains";
import {
sepolia,
optimism,
gnosis,
mainnet,
arbitrum,
arbitrumSepolia,
} from "viem/chains";
import { CoinbaseWalletConnector } from "wagmi/connectors/coinbaseWallet";
import { InjectedConnector } from "wagmi/connectors/injected";
import { WalletConnectConnector } from "wagmi/connectors/walletConnect";
import { jsonRpcProvider } from "wagmi/providers/jsonRpc";

import { contractsAddresses, isProd } from "@/constants/contracts";
type WagmiProviderType = {
children: React.ReactNode;
};
Expand All @@ -37,7 +45,7 @@ const localChain = {
};

const { chains, publicClient } = configureChains(
[localChain, arbitrum],
isProd ? [arbitrumSepolia] : [localChain, arbitrumSepolia],
[
jsonRpcProvider({ rpc: (chain: any) => chain.rpcUrls.default }),
walletConnectProvider({ projectId }),
Expand Down
1,549 changes: 1,549 additions & 0 deletions broadcast/DeployCVArbSepolia.s.sol/421614/run-1704957191.json

Large diffs are not rendered by default.

1,549 changes: 1,549 additions & 0 deletions broadcast/DeployCVArbSepolia.s.sol/421614/run-1704967022.json

Large diffs are not rendered by default.

1,718 changes: 845 additions & 873 deletions broadcast/DeployCVArbSepolia.s.sol/421614/run-latest.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion pkg/contracts/out/Accounts.sol/Accounts.json

Large diffs are not rendered by default.

Loading

0 comments on commit d14d973

Please sign in to comment.