Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/modules/etherlink/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 },
Expand Down
2 changes: 1 addition & 1 deletion src/modules/etherlink/creator/EvmDaoBasics.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ export const EvmDaoBasics: React.FC<EvmDaoBasicsProps> = () => {
name="governanceToken.tokenDecimals"
type="text"
placeholder="0"
defaultValue={daoData?.governanceToken.tokenDecimals}
defaultValue={daoData?.governanceToken.tokenDecimals || 4}
InputProps={{
endAdornment: (
<InputAdornment position="start">
Expand Down
23 changes: 20 additions & 3 deletions src/modules/etherlink/creator/EvmDaoSummary.tsx
Original file line number Diff line number Diff line change
@@ -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,
Expand Down Expand Up @@ -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 },
{
Expand All @@ -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 (
<div className="evm-dao-summary">
<TitleBlock
Expand Down
2 changes: 1 addition & 1 deletion src/modules/etherlink/creator/EvmDaoVoting.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ export const EvmDaoVoting: React.FC<EvmDaoVotingProps> = ({ onSubmit, initialVal
return (
<div className="evm-dao-voting">
<TitleBlock
title="Proposals & Voting"
title="Durations"
description={
<DescriptionText variant="subtitle1">
These settings will define the voting configuration for your DAO.
Expand Down
19 changes: 10 additions & 9 deletions src/services/contracts/etherlinkDAO/hooks/useEvmDaoCreateStore.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ interface EvmDaoCreateStore {
}
}

const homebaseNetwork = localStorage.getItem("homebase:network")
const useEvmDaoCreateZustantStore = create<EvmDaoCreateStore>()(
persist(
(set, get) => ({
Expand All @@ -43,23 +44,23 @@ const useEvmDaoCreateZustantStore = create<EvmDaoCreateStore>()(
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: {}
},
Expand Down
Loading