diff --git a/src/modules/etherlink/config.ts b/src/modules/etherlink/config.ts index cb4c8241..7b098dfa 100644 --- a/src/modules/etherlink/config.ts +++ b/src/modules/etherlink/config.ts @@ -9,7 +9,7 @@ import { EvmDaoTemplate } from "./creator/EvmDaoTemplate" export const STEPS = [ { title: "DAO Template", index: 0, path: "template", component: EvmDaoTemplate }, { title: "DAO Basics", index: 1, path: "dao", component: EvmDaoBasics }, - { title: "Proposals & Voting", index: 2, path: "voting", component: EvmDaoVoting }, + { title: "Durations", index: 2, path: "voting", component: EvmDaoVoting }, { title: "Quorum", index: 3, path: "quorum", component: EvmDaoQuorum }, { title: "Membership", index: 4, path: "membership", component: EvmDaoMembership }, { title: "Registry", index: 5, path: "registry", component: EvmDaoRegistry }, diff --git a/src/modules/etherlink/creator/EvmDaoBasics.tsx b/src/modules/etherlink/creator/EvmDaoBasics.tsx index 507b3b42..bbcd0149 100644 --- a/src/modules/etherlink/creator/EvmDaoBasics.tsx +++ b/src/modules/etherlink/creator/EvmDaoBasics.tsx @@ -198,7 +198,7 @@ export const EvmDaoBasics: React.FC = () => { name="governanceToken.tokenDecimals" type="text" placeholder="0" - defaultValue={daoData?.governanceToken.tokenDecimals} + defaultValue={daoData?.governanceToken.tokenDecimals || 4} InputProps={{ endAdornment: ( diff --git a/src/modules/etherlink/creator/EvmDaoSummary.tsx b/src/modules/etherlink/creator/EvmDaoSummary.tsx index c33cd8bc..a381fc1d 100644 --- a/src/modules/etherlink/creator/EvmDaoSummary.tsx +++ b/src/modules/etherlink/creator/EvmDaoSummary.tsx @@ -1,6 +1,6 @@ import { DescriptionText } from "components/ui/DaoCreator" import { TitleBlock } from "modules/common/TitleBlock" -import React from "react" +import React, { useEffect, useState } from "react" import { Grid, styled, @@ -52,7 +52,7 @@ export const EvmDaoSummary = () => { const theme = useTheme() const isMobileSmall = useMediaQuery(theme.breakpoints.down("sm")) const { data } = useEvmDaoCreateStore() - const tableData = [ + const [tableData, setTableData] = useState<{ key: string; value: string }[]>([ { key: "Name", value: data?.name }, { key: "Symbol", value: data?.governanceToken?.symbol }, { @@ -70,7 +70,24 @@ export const EvmDaoSummary = () => { key: "Quorum", value: `${data?.quorum?.returnedTokenPercentage}%` } - ] + ]) + + useEffect(() => { + const rEntries = Object.entries(data.registry) + if (rEntries.length > 0) { + setTableData(prev => { + rEntries.forEach(([key, value]) => { + prev.push({ + key: key as string, + value: value as string + }) + }) + console.log("[TableData]", prev) + return prev + }) + } + }, [data, tableData]) + return (
= ({ onSubmit, initialVal return (
These settings will define the voting configuration for your DAO. diff --git a/src/services/contracts/etherlinkDAO/hooks/useEvmDaoCreateStore.tsx b/src/services/contracts/etherlinkDAO/hooks/useEvmDaoCreateStore.tsx index b498128a..d0ff9370 100644 --- a/src/services/contracts/etherlinkDAO/hooks/useEvmDaoCreateStore.tsx +++ b/src/services/contracts/etherlinkDAO/hooks/useEvmDaoCreateStore.tsx @@ -30,6 +30,7 @@ interface EvmDaoCreateStore { } } +const homebaseNetwork = localStorage.getItem("homebase:network") const useEvmDaoCreateZustantStore = create()( persist( (set, get) => ({ @@ -43,23 +44,23 @@ const useEvmDaoCreateZustantStore = create()( governanceToken: { address: "", symbol: "", - tokenDecimals: 0 + tokenDecimals: 4 }, quorum: { - returnedTokenPercentage: 0, - proposalThresholdPercentage: 0 + returnedTokenPercentage: 12, + proposalThresholdPercentage: 1 }, members: [{ address: "", amountOfTokens: 0 }], voting: { votingBlocksDay: 0, - votingBlocksHours: 0, - votingBlocksMinutes: 0, - proposalFlushBlocksDay: 0, + votingBlocksHours: homebaseNetwork?.includes("mainnet") ? 12 : 0, + votingBlocksMinutes: homebaseNetwork?.includes("testnet") ? 3 : 0, + proposalFlushBlocksDay: homebaseNetwork?.includes("mainnet") ? 4 : 0, proposalFlushBlocksHours: 0, - proposalFlushBlocksMinutes: 0, + proposalFlushBlocksMinutes: homebaseNetwork?.includes("testnet") ? 10 : 0, proposalExpiryBlocksDay: 0, - proposalExpiryBlocksHours: 0, - proposalExpiryBlocksMinutes: 0 + proposalExpiryBlocksHours: homebaseNetwork?.includes("mainnet") ? 6 : 0, + proposalExpiryBlocksMinutes: homebaseNetwork?.includes("testnet") ? 1 : 0 }, registry: {} },