diff --git a/abi/KaliAccessManagerV2.json b/abi/ACCESS.ts similarity index 99% rename from abi/KaliAccessManagerV2.json rename to abi/ACCESS.ts index edf886b5..59865197 100644 --- a/abi/KaliAccessManagerV2.json +++ b/abi/ACCESS.ts @@ -1,4 +1,4 @@ -[ +export const ACCESS_ABI = [ { "inputs": [], "stateMutability": "nonpayable", @@ -504,4 +504,4 @@ "stateMutability": "view", "type": "function" } -] +] as const; diff --git a/abi/KaliDAO.json b/abi/DAO.ts similarity index 99% rename from abi/KaliDAO.json rename to abi/DAO.ts index 47670f0d..5418755f 100644 --- a/abi/KaliDAO.json +++ b/abi/DAO.ts @@ -1,4 +1,4 @@ -[ +export const DAO_ABI = [ { "inputs": [], "name": "AlreadyVoted", @@ -1523,4 +1523,4 @@ "stateMutability": "view", "type": "function" } -] +] as const; diff --git a/abi/KaliDAOcrowdsaleV2.json b/abi/SWAP.ts similarity index 99% rename from abi/KaliDAOcrowdsaleV2.json rename to abi/SWAP.ts index 0409628d..4d5384f1 100644 --- a/abi/KaliDAOcrowdsaleV2.json +++ b/abi/SWAP.ts @@ -1,4 +1,4 @@ -[ +export const SWAP_ABI = [ { "inputs": [ { @@ -521,4 +521,4 @@ "stateMutability": "view", "type": "function" } -] \ No newline at end of file +] as const; \ No newline at end of file diff --git a/abi/index.ts b/abi/index.ts new file mode 100644 index 00000000..b26a8222 --- /dev/null +++ b/abi/index.ts @@ -0,0 +1,5 @@ +import { SWAP_ABI } from "./SWAP"; +import { DAO_ABI } from './DAO'; +import { ACCESS_ABI } from "./ACCESS"; + +export { SWAP_ABI, ACCESS_ABI, DAO_ABI } \ No newline at end of file diff --git a/components/dao-dashboard/layout/Nav.tsx b/components/dao-dashboard/layout/Nav.tsx index 2ad72ab5..a3f0c67b 100644 --- a/components/dao-dashboard/layout/Nav.tsx +++ b/components/dao-dashboard/layout/Nav.tsx @@ -4,7 +4,7 @@ import { useContractRead } from 'wagmi' import { DashboardElementProps } from './types' import Link from 'next/link' import { addresses } from '@constants/addresses' -import SWAP_ABI from '@abi/KaliDAOcrowdsaleV2.json' +import { SWAP_ABI } from '@abi/index' import { AddressZero } from '@ethersproject/constants' import { navItem, navMenu } from './layout.css' import Wrappr from './Wrappr' @@ -17,8 +17,8 @@ const Nav = ({ address, chainId }: DashboardElementProps) => { error: swapError, isError: isSwapError, } = useContractRead({ - addressOrName: chainId ? addresses?.[chainId]?.['extensions']['crowdsale2'] : AddressZero, - contractInterface: SWAP_ABI, + address: chainId ? addresses?.[chainId]?.['extensions']['crowdsale2'] : AddressZero, + abi: SWAP_ABI, chainId: chainId, functionName: 'crowdsales', args: [address], @@ -43,7 +43,7 @@ const Nav = ({ address, chainId }: DashboardElementProps) => { }, ] - if (swap && swap?.saleEnds * 1000 > Date.now()) { + if (swap && swap.saleEnds * 1000 > Date.now()) { items.push({ id: 2, title: 'Swap', diff --git a/components/dao-dashboard/layout/Profile.tsx b/components/dao-dashboard/layout/Profile.tsx index d3e7fd47..c2392cec 100644 --- a/components/dao-dashboard/layout/Profile.tsx +++ b/components/dao-dashboard/layout/Profile.tsx @@ -16,7 +16,7 @@ import { IconGitHub, } from '@kalidao/reality' import { useRouter } from 'next/router' -import { chain, useQuery } from 'wagmi' +import { useQuery } from 'wagmi' import { getDaoInfo } from '@graph/queries' import { DashboardElementProps } from './types' import Link from 'next/link' diff --git a/components/dao-dashboard/layout/index.tsx b/components/dao-dashboard/layout/index.tsx index 894e9778..38e37584 100644 --- a/components/dao-dashboard/layout/index.tsx +++ b/components/dao-dashboard/layout/index.tsx @@ -37,9 +37,9 @@ const DashboardLayout = ({ title, content, children }: Props) => { }} justify="space-between" > - -