From 33a964ff84a2ba577bd9d7650b52ee14688e8dee Mon Sep 17 00:00:00 2001 From: ericli Date: Tue, 22 Aug 2023 18:48:15 +0800 Subject: [PATCH 1/6] feat: add create proposal use wagmi --- apps/web/package.json | 11 +- apps/web/src/app/vote/page.tsx | 57 +- .../components/Contract/CreateProposal.tsx | 74 +++ apps/web/src/components/ZK/VerifyProof.tsx | 6 +- .../web/src/service}/kamui/ABI.json | 0 apps/web/src/service/kamui/contract.ts | 18 + apps/web/src/service/kamui/kamuiField.ts | 350 ++++++++++ apps/web/src/service/kamui/verify.ts | 58 ++ packages/evm-contracts-api/package.json | 26 - packages/evm-contracts-api/src/index.ts | 0 packages/evm-contracts-api/tsconfig.json | 8 - pnpm-lock.yaml | 611 +++++++++++++++--- turbo.json | 3 + 13 files changed, 1068 insertions(+), 154 deletions(-) create mode 100644 apps/web/src/components/Contract/CreateProposal.tsx rename {packages/evm-contracts-api/src => apps/web/src/service}/kamui/ABI.json (100%) create mode 100644 apps/web/src/service/kamui/contract.ts create mode 100644 apps/web/src/service/kamui/kamuiField.ts create mode 100644 apps/web/src/service/kamui/verify.ts delete mode 100644 packages/evm-contracts-api/package.json delete mode 100644 packages/evm-contracts-api/src/index.ts delete mode 100644 packages/evm-contracts-api/tsconfig.json diff --git a/apps/web/package.json b/apps/web/package.json index b3fc532..182c6cc 100644 --- a/apps/web/package.json +++ b/apps/web/package.json @@ -9,13 +9,22 @@ "lint": "next lint" }, "dependencies": { + "@emotion/react": "^11.11.1", + "@emotion/styled": "^11.11.0", + "@mui/material": "^5.14.5", + "@mui/x-date-pickers": "^6.11.2", "connectkit": "^1.5.1", + "dayjs": "^1.11.9", + "helper": "workspace:*", "next": "^13.4.1", "react": "^18.2.0", "react-dom": "^18.2.0", "react-webcam": "^7.1.1", "ui": "workspace:*", - "helper": "workspace:*", + "snarkjs": "^0.7.0", + "readline": "^1.3.0", + "circomlibjs": "^0.1.7", + "ethers": "^5.7.2", "viem": "^1.6.0", "wagmi": "^1.3.10" }, diff --git a/apps/web/src/app/vote/page.tsx b/apps/web/src/app/vote/page.tsx index ffcf0a4..0db71e8 100644 --- a/apps/web/src/app/vote/page.tsx +++ b/apps/web/src/app/vote/page.tsx @@ -4,8 +4,11 @@ import WebcamCapture from '../../components/Webcam/WebcamCapture' import ProcessDialog from '../../components/Dialog/ProcessDialog' import GenerateProof from '../../components/ZK/GenerateProof' import VerifyProof from '../../components/ZK/VerifyProof' +import CreateProposal from '../../components/Contract/CreateProposal' import ProcessLoading from '../../components/Loading/ProcessLoading' import KamuiLoading from '../../components/Loading/KamuiLoading' +import { LocalizationProvider } from '@mui/x-date-pickers' +import { AdapterDayjs } from '@mui/x-date-pickers/AdapterDayjs' import { useEffect, useState } from 'react' import { useAccount } from 'wagmi' @@ -17,20 +20,26 @@ export default function Vote() { const [isCaptureDialogOpen, setIsCaptureDialogOpen] = useState(false) const [isVerifyDialogOpen, setIsVerifyDialogOpen] = useState(false) const [isGenProofDialogOpen, setIsGenProofDialogOpen] = useState(false) + const [isCreateProposalDialogOpen, setIsCreateProposalDialogOpen] = useState(false) const [isVerified, setVerified] = useState(false) const [imgSrc, setImgSrc] = useState(null) const [copied, setCopied] = useState(false) - async function openCaptureDialog() { - setIsCaptureDialogOpen(!isCaptureDialogOpen) - } - - async function openGenProofDialog() { - setIsGenProofDialogOpen(!isGenProofDialogOpen) - } + const openCaptureDialog = async () => { + setIsCaptureDialogOpen(!isCaptureDialogOpen); + }; + + const openGenProofDialog = async () => { + setIsGenProofDialogOpen(!isGenProofDialogOpen); + }; + + const openVerifyDialog = async () => { + setIsVerifyDialogOpen(!isVerifyDialogOpen); + }; + - async function openVerifyDialog() { - setIsVerifyDialogOpen(!isVerifyDialogOpen) + const openCreateProposalDialog = async () => { + setIsCreateProposalDialogOpen(!isCreateProposalDialogOpen) } const handleCopyClick = () => { @@ -49,6 +58,8 @@ export default function Vote() { }, [address, isConnected]) return ( + +
@@ -86,10 +97,22 @@ export default function Vote() {
- -

- Proposal -

+
+
+

+ KAMUI FIELD +

+
+
+
+ + + + + New Proposal +
+
+
setIsVerifyDialogOpen(false)} /> + setIsCreateProposalDialogOpen(false)} + title={'New Proposal'} + > + setIsCreateProposalDialogOpen(false)} /> + {isLoading && } {isKamuiLoading && } { @@ -125,6 +155,7 @@ export default function Vote() { +
) } diff --git a/apps/web/src/components/Contract/CreateProposal.tsx b/apps/web/src/components/Contract/CreateProposal.tsx new file mode 100644 index 0000000..038d3b1 --- /dev/null +++ b/apps/web/src/components/Contract/CreateProposal.tsx @@ -0,0 +1,74 @@ +import {createProposal} from '../../service/kamui/contract' +import { useState } from 'react'; +import { DateTimePicker } from "@mui/x-date-pickers"; +import { sleep } from 'helper' + +export interface CreateProposalProps { + setIsLoading: any + onClose: any +} + +const CreateProposal = ({ setIsLoading, onClose } : CreateProposalProps) => { + const [open, setOpen] = useState(false); + const [endTime, setEndTime] = useState(0); + const [content, setContent] = useState(''); + const [isFinished, setFinished] = useState(false) + + const handleEndTimeChange = (event: any) => { + const datetime = new Date(event) + const currentTime = new Date(); + const timestamp = Math.floor((datetime.getTime() - currentTime.getTime()) / 1000); + setEndTime(timestamp); + }; + + const handleCreate = async () => { + setIsLoading(true) + await createProposal(content, endTime) + // await sleep(2000) + setIsLoading(false) + setFinished(true) + } + + return( +
+ {isFinished + ? <> + + + +
OK
+ + : <> + + setContent(e.target.value)}/> +
Create
+ + } +
+ ) + +} + +export default CreateProposal \ No newline at end of file diff --git a/apps/web/src/components/ZK/VerifyProof.tsx b/apps/web/src/components/ZK/VerifyProof.tsx index f3c11a9..302ef35 100644 --- a/apps/web/src/components/ZK/VerifyProof.tsx +++ b/apps/web/src/components/ZK/VerifyProof.tsx @@ -16,8 +16,6 @@ const VerifyProof = ({ setVerified, setIsLoading, onClose }: VerifyProofProps) = const [isPassed, setIsPassed] = useState(false) const { address, isConnected } = useAccount() - - const handleVerify = async () => { try { setIsLoading(true) @@ -56,11 +54,11 @@ const VerifyProof = ({ setVerified, setIsLoading, onClose }: VerifyProofProps) =
OK
: <> -
+
- +
Verify
diff --git a/packages/evm-contracts-api/src/kamui/ABI.json b/apps/web/src/service/kamui/ABI.json similarity index 100% rename from packages/evm-contracts-api/src/kamui/ABI.json rename to apps/web/src/service/kamui/ABI.json diff --git a/apps/web/src/service/kamui/contract.ts b/apps/web/src/service/kamui/contract.ts new file mode 100644 index 0000000..dabfbd5 --- /dev/null +++ b/apps/web/src/service/kamui/contract.ts @@ -0,0 +1,18 @@ +'use client' + +import { writeContract } from 'wagmi/actions' +import { kamuiContractConfig } from './kamuiField' +import ABI from "./ABI.json" +import { BytesLike, ethers } from "ethers"; +import { zkproof } from "./verify"; +const { buildPoseidon } = require("circomlibjs"); + + +export const createProposal = async (name: string, endTime: number) => { + const result = await writeContract({ + address: kamuiContractConfig.address, + abi: kamuiContractConfig.abi, + functionName: 'createProposals', + args: [name, endTime], + }) +} \ No newline at end of file diff --git a/apps/web/src/service/kamui/kamuiField.ts b/apps/web/src/service/kamui/kamuiField.ts new file mode 100644 index 0000000..6bfdadd --- /dev/null +++ b/apps/web/src/service/kamui/kamuiField.ts @@ -0,0 +1,350 @@ +export const kamuiContractConfig = { + address: '0x6385Bcd08b7478992f7f0146A114f171701a8de2', + abi: [ + { + "inputs": [ + { + "internalType": "address", + "name": "_verifierAddress", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "previousOwner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "OwnershipTransferred", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "proposal", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "bool", + "name": "accept", + "type": "bool" + } + ], + "name": "Voted", + "type": "event" + }, + { + "inputs": [ + { + "internalType": "string", + "name": "name", + "type": "string" + }, + { + "internalType": "uint256", + "name": "continueSec", + "type": "uint256" + } + ], + "name": "createProposals", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "getBlockTime", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "proposal", + "type": "uint256" + } + ], + "name": "getResult", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "owner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "proposals", + "outputs": [ + { + "internalType": "string", + "name": "name", + "type": "string" + }, + { + "internalType": "address", + "name": "creater", + "type": "address" + }, + { + "internalType": "uint256", + "name": "acceptCount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "denyCount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "endTime", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "user", + "type": "address" + }, + { + "internalType": "uint256", + "name": "proof", + "type": "uint256" + } + ], + "name": "registerUser", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "renounceOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "totalProposals", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "transferOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + }, + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "users", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "verifier", + "outputs": [ + { + "internalType": "contract ICircuitsVerifier", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "internalType": "uint256[2]", + "name": "a", + "type": "uint256[2]" + }, + { + "internalType": "uint256[2][2]", + "name": "b", + "type": "uint256[2][2]" + }, + { + "internalType": "uint256[2]", + "name": "c", + "type": "uint256[2]" + } + ], + "internalType": "struct KamuiField.ProofData", + "name": "proofData", + "type": "tuple" + } + ], + "name": "verifyProof", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "proposal", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "accept", + "type": "bool" + }, + { + "components": [ + { + "internalType": "uint256[2]", + "name": "a", + "type": "uint256[2]" + }, + { + "internalType": "uint256[2][2]", + "name": "b", + "type": "uint256[2][2]" + }, + { + "internalType": "uint256[2]", + "name": "c", + "type": "uint256[2]" + } + ], + "internalType": "struct KamuiField.ProofData", + "name": "proofData", + "type": "tuple" + } + ], + "name": "vote", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + }, + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "voters", + "outputs": [ + { + "internalType": "bool", + "name": "voted", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + } + ] +} \ No newline at end of file diff --git a/apps/web/src/service/kamui/verify.ts b/apps/web/src/service/kamui/verify.ts new file mode 100644 index 0000000..e246ed2 --- /dev/null +++ b/apps/web/src/service/kamui/verify.ts @@ -0,0 +1,58 @@ +import { BigNumber } from 'ethers' +const { buildPoseidon } = require('circomlibjs') +const { groth16 } = require('snarkjs') + +export async function exportSolidity({ proof, publicSignals }: any) { + const rawCallData: string = await groth16.exportSolidityCallData(proof, publicSignals); + const tokens = rawCallData + .replace(/["[\]\s]/g, "") + .split(",") + .map(BigNumber.from); + const [a1, a2, b1, b2, b3, b4, c1, c2, ...inputs] = tokens; + const a: [BigNumber, BigNumber] = [a1, a2] ; + const b: [[BigNumber, BigNumber], [BigNumber, BigNumber]] = [ + [b1, b2], + [b3, b4], + ] + const c: [BigNumber, BigNumber] = [c1, c2] + return { + a, b, c, inputs + } +} + +export async function generateProof(circuitInputs: any, filePathWASM: any, filePathZKEY: any) { + const { proof, publicSignals } = await groth16.fullProve( + circuitInputs, + filePathWASM, + filePathZKEY + ) + const solidityProof = await exportSolidity({ proof, publicSignals }) + return solidityProof +} +const hexToDecimal = (hex: string) => BigInt('0x' + hex).toString() + +export async function zkproof(credentialHash: string) { + // generate VC hash + const filePathWASM: string = '/circuits.wasm' + const filePathZKEY: string = '/circuits.zkey' + + // issuer send this hash + const poseidon = await buildPoseidon() + const inputs = credentialHash + const poseidonHash = poseidon.F.toString(poseidon([hexToDecimal(inputs)])) + // console.log('poseidon hash:', poseidonHash) + + const circuitInputs = { + value: `0x${inputs}`, + hash: poseidonHash, + } + console.log(circuitInputs) + + const proofData = await generateProof( + circuitInputs, + filePathWASM, + filePathZKEY + ) + console.log(proofData) + return proofData +} \ No newline at end of file diff --git a/packages/evm-contracts-api/package.json b/packages/evm-contracts-api/package.json deleted file mode 100644 index 6157fce..0000000 --- a/packages/evm-contracts-api/package.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "name": "evm-contracts-api", - "version": "0.0.0", - "main": "./dist/index.js", - "types": "./dist/index.d.ts", - "export": { - ".": "./dist" - }, - "scripts": { - "build": "tsup src/index.ts --format cjs --dts", - "dev": "npm run build -- --watch" - }, - "dependencies": { - "tsconfig": "workspace:*" - }, - "devDependencies": { - "tsconfig": "workspace:*", - "ethers": "^5.7.0", - "typescript": "^5.0.4", - "tsup": "^6.1.3" - }, - "publishConfig": { - "access": "public" - } - } - \ No newline at end of file diff --git a/packages/evm-contracts-api/src/index.ts b/packages/evm-contracts-api/src/index.ts deleted file mode 100644 index e69de29..0000000 diff --git a/packages/evm-contracts-api/tsconfig.json b/packages/evm-contracts-api/tsconfig.json deleted file mode 100644 index 82bec99..0000000 --- a/packages/evm-contracts-api/tsconfig.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "extends": "tsconfig/base.json", - "compilerOptions": { - "target": "ESNext", - }, - "include": [ "**/*.ts"], - "exclude": ["node_modules"] -} diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index a1f1812..cb604a4 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -72,9 +72,30 @@ importers: apps/web: dependencies: + '@emotion/react': + specifier: ^11.11.1 + version: 11.11.1(@types/react@18.2.5)(react@18.2.0) + '@emotion/styled': + specifier: ^11.11.0 + version: 11.11.0(@emotion/react@11.11.1)(@types/react@18.2.5)(react@18.2.0) + '@mui/material': + specifier: ^5.14.5 + version: 5.14.5(@emotion/react@11.11.1)(@emotion/styled@11.11.0)(@types/react@18.2.5)(react-dom@18.2.0)(react@18.2.0) + '@mui/x-date-pickers': + specifier: ^6.11.2 + version: 6.11.2(@emotion/react@11.11.1)(@emotion/styled@11.11.0)(@mui/base@5.0.0-beta.11)(@mui/material@5.14.5)(@mui/system@5.14.5)(dayjs@1.11.9)(react-dom@18.2.0)(react@18.2.0) + circomlibjs: + specifier: ^0.1.7 + version: 0.1.7 connectkit: specifier: ^1.5.1 - version: 1.5.1(@babel/core@7.22.10)(react-dom@18.2.0)(react-is@16.13.1)(react@18.2.0)(viem@1.6.0)(wagmi@1.3.10) + version: 1.5.1(@babel/core@7.22.10)(react-dom@18.2.0)(react-is@18.2.0)(react@18.2.0)(viem@1.6.0)(wagmi@1.3.10) + dayjs: + specifier: ^1.11.9 + version: 1.11.9 + ethers: + specifier: ^5.7.2 + version: 5.7.2 helper: specifier: workspace:* version: link:../../packages/helper @@ -90,6 +111,12 @@ importers: react-webcam: specifier: ^7.1.1 version: 7.1.1(react-dom@18.2.0)(react@18.2.0) + readline: + specifier: ^1.3.0 + version: 1.3.0 + snarkjs: + specifier: ^0.7.0 + version: 0.7.0 ui: specifier: workspace:* version: link:../../packages/ui @@ -149,22 +176,6 @@ importers: specifier: 7.28.0 version: 7.28.0(eslint@7.32.0) - packages/evm-contracts-api: - dependencies: - tsconfig: - specifier: workspace:* - version: link:../tsconfig - devDependencies: - ethers: - specifier: ^5.7.0 - version: 5.7.2 - tsup: - specifier: ^6.1.3 - version: 6.5.0(postcss@8.4.20)(typescript@5.0.4) - typescript: - specifier: ^5.0.4 - version: 5.0.4 - packages/helper: dependencies: tsconfig: @@ -502,13 +513,6 @@ packages: regenerator-runtime: 0.13.11 dev: false - /@babel/runtime@7.20.1: - resolution: {integrity: sha512-mrzLkl6U9YLF8qpqI7TB82PESyEGjm/0Ly91jG575eVxMMlb8fYfOXFZIJ8XfLrJZQbm7dlKry2bJmXBUEkdFg==} - engines: {node: '>=6.9.0'} - dependencies: - regenerator-runtime: 0.13.11 - dev: false - /@babel/runtime@7.22.10: resolution: {integrity: sha512-21t/fkKLMZI4pqP2wlmsQAWnYW1PDyKyyUV4vCi+B25ydmdaYTKXPwCj0BzSUnZf4seIiYvSA3jcZ3gdsMFkLQ==} engines: {node: '>=6.9.0'} @@ -635,6 +639,66 @@ packages: dependencies: '@jridgewell/trace-mapping': 0.3.9 + /@emotion/babel-plugin@11.11.0: + resolution: {integrity: sha512-m4HEDZleaaCH+XgDDsPF15Ht6wTLsgDTeR3WYj9Q/k76JtWhrJjcP4+/XlG8LGT/Rol9qUfOIztXeA84ATpqPQ==} + dependencies: + '@babel/helper-module-imports': 7.22.5 + '@babel/runtime': 7.22.10 + '@emotion/hash': 0.9.1 + '@emotion/memoize': 0.8.1 + '@emotion/serialize': 1.1.2 + babel-plugin-macros: 3.1.0 + convert-source-map: 1.9.0 + escape-string-regexp: 4.0.0 + find-root: 1.1.0 + source-map: 0.5.7 + stylis: 4.2.0 + dev: false + + /@emotion/cache@11.11.0: + resolution: {integrity: sha512-P34z9ssTCBi3e9EI1ZsWpNHcfY1r09ZO0rZbRO2ob3ZQMnFI35jB536qoXbkdesr5EUhYi22anuEJuyxifaqAQ==} + dependencies: + '@emotion/memoize': 0.8.1 + '@emotion/sheet': 1.2.2 + '@emotion/utils': 1.2.1 + '@emotion/weak-memoize': 0.3.1 + stylis: 4.2.0 + dev: false + + /@emotion/hash@0.9.1: + resolution: {integrity: sha512-gJB6HLm5rYwSLI6PQa+X1t5CFGrv1J1TWG+sOyMCeKz2ojaj6Fnl/rZEspogG+cvqbt4AE/2eIyD2QfLKTBNlQ==} + dev: false + + /@emotion/babel-plugin@11.11.0: + resolution: {integrity: sha512-m4HEDZleaaCH+XgDDsPF15Ht6wTLsgDTeR3WYj9Q/k76JtWhrJjcP4+/XlG8LGT/Rol9qUfOIztXeA84ATpqPQ==} + dependencies: + '@babel/helper-module-imports': 7.22.5 + '@babel/runtime': 7.22.10 + '@emotion/hash': 0.9.1 + '@emotion/memoize': 0.8.1 + '@emotion/serialize': 1.1.2 + babel-plugin-macros: 3.1.0 + convert-source-map: 1.9.0 + escape-string-regexp: 4.0.0 + find-root: 1.1.0 + source-map: 0.5.7 + stylis: 4.2.0 + dev: false + + /@emotion/cache@11.11.0: + resolution: {integrity: sha512-P34z9ssTCBi3e9EI1ZsWpNHcfY1r09ZO0rZbRO2ob3ZQMnFI35jB536qoXbkdesr5EUhYi22anuEJuyxifaqAQ==} + dependencies: + '@emotion/memoize': 0.8.1 + '@emotion/sheet': 1.2.2 + '@emotion/utils': 1.2.1 + '@emotion/weak-memoize': 0.3.1 + stylis: 4.2.0 + dev: false + + /@emotion/hash@0.9.1: + resolution: {integrity: sha512-gJB6HLm5rYwSLI6PQa+X1t5CFGrv1J1TWG+sOyMCeKz2ojaj6Fnl/rZEspogG+cvqbt4AE/2eIyD2QfLKTBNlQ==} + dev: false + /@emotion/is-prop-valid@0.8.8: resolution: {integrity: sha512-u5WtneEAr5IDG2Wv65yhunPSMLIpuKsbuOktRojfrEiEvRyC85LgPMZI63cr7NUqT8ZIGdSVg8ZKGxIug4lXcA==} requiresBuild: true @@ -659,6 +723,62 @@ packages: resolution: {integrity: sha512-W2P2c/VRW1/1tLox0mVUalvnWXxavmv/Oum2aPsRcoDJuob75FC3Y8FbpfLwUegRcxINtGUMPq0tFCvYNTBXNA==} dev: false + /@emotion/react@11.11.1(@types/react@18.2.5)(react@18.2.0): + resolution: {integrity: sha512-5mlW1DquU5HaxjLkfkGN1GA/fvVGdyHURRiX/0FHl2cfIfRxSOfmxEH5YS43edp0OldZrZ+dkBKbngxcNCdZvA==} + peerDependencies: + '@types/react': '*' + react: '>=16.8.0' + peerDependenciesMeta: + '@types/react': + optional: true + dependencies: + '@babel/runtime': 7.22.10 + '@emotion/babel-plugin': 11.11.0 + '@emotion/cache': 11.11.0 + '@emotion/serialize': 1.1.2 + '@emotion/use-insertion-effect-with-fallbacks': 1.0.1(react@18.2.0) + '@emotion/utils': 1.2.1 + '@emotion/weak-memoize': 0.3.1 + '@types/react': 18.2.5 + hoist-non-react-statics: 3.3.2 + react: 18.2.0 + dev: false + + /@emotion/serialize@1.1.2: + resolution: {integrity: sha512-zR6a/fkFP4EAcCMQtLOhIgpprZOwNmCldtpaISpvz348+DP4Mz8ZoKaGGCQpbzepNIUWbq4w6hNZkwDyKoS+HA==} + dependencies: + '@emotion/hash': 0.9.1 + '@emotion/memoize': 0.8.1 + '@emotion/unitless': 0.8.1 + '@emotion/utils': 1.2.1 + csstype: 3.1.2 + dev: false + + /@emotion/sheet@1.2.2: + resolution: {integrity: sha512-0QBtGvaqtWi+nx6doRwDdBIzhNdZrXUppvTM4dtZZWEGTXL/XE/yJxLMGlDT1Gt+UHH5IX1n+jkXyytE/av7OA==} + dev: false + + /@emotion/styled@11.11.0(@emotion/react@11.11.1)(@types/react@18.2.5)(react@18.2.0): + resolution: {integrity: sha512-hM5Nnvu9P3midq5aaXj4I+lnSfNi7Pmd4EWk1fOZ3pxookaQTNew6bp4JaCBYM4HVFZF9g7UjJmsUmC2JlxOng==} + peerDependencies: + '@emotion/react': ^11.0.0-rc.0 + '@types/react': '*' + react: '>=16.8.0' + peerDependenciesMeta: + '@types/react': + optional: true + dependencies: + '@babel/runtime': 7.22.10 + '@emotion/babel-plugin': 11.11.0 + '@emotion/is-prop-valid': 1.2.1 + '@emotion/react': 11.11.1(@types/react@18.2.5)(react@18.2.0) + '@emotion/serialize': 1.1.2 + '@emotion/use-insertion-effect-with-fallbacks': 1.0.1(react@18.2.0) + '@emotion/utils': 1.2.1 + '@types/react': 18.2.5 + react: 18.2.0 + dev: false + /@emotion/stylis@0.8.5: resolution: {integrity: sha512-h6KtPihKFn3T9fuIrwvXXUOwlx3rfUvfZIcP5a6rh8Y7zjE3O06hT5Ss4S/YI1AYhuZ1kjaE/5EaOOI2NqSylQ==} dev: false @@ -667,6 +787,26 @@ packages: resolution: {integrity: sha512-OWORNpfjMsSSUBVrRBVGECkhWcULOAJz9ZW8uK9qgxD+87M7jHRcvh/A96XXNhXTLmKcoYSQtBEX7lHMO7YRwg==} dev: false + /@emotion/unitless@0.8.1: + resolution: {integrity: sha512-KOEGMu6dmJZtpadb476IsZBclKvILjopjUii3V+7MnXIQCYh8W3NgNcgwo21n9LXZX6EDIKvqfjYxXebDwxKmQ==} + dev: false + + /@emotion/use-insertion-effect-with-fallbacks@1.0.1(react@18.2.0): + resolution: {integrity: sha512-jT/qyKZ9rzLErtrjGgdkMBn2OP8wl0G3sQlBb3YPryvKHsjvINUhVaPFfP+fpBcOkmrVOVEEHQFJ7nbj2TH2gw==} + peerDependencies: + react: '>=16.8.0' + dependencies: + react: 18.2.0 + dev: false + + /@emotion/utils@1.2.1: + resolution: {integrity: sha512-Y2tGf3I+XVnajdItskUCn6LX+VUDmP6lTL4fcqsXAv43dnlbZiuW4MWQW38rW/BVWSE7Q/7+XQocmpnRYILUmg==} + dev: false + + /@emotion/weak-memoize@0.3.1: + resolution: {integrity: sha512-EsBwpc7hBUJWAsNPBmJy4hxWx12v6bshQsldrVmjxJoc3isbxhOrF2IcCpaXxfvq03NwkI7sbsOLXbYuqF/8Ww==} + dev: false + /@esbuild/android-arm@0.15.15: resolution: {integrity: sha512-JJjZjJi2eBL01QJuWjfCdZxcIgot+VoK6Fq7eKF9w4YHm9hwl7nhBR1o2Wnt/WcANk5l9SkpvrldW1PLuXxcbw==} engines: {node: '>=12'} @@ -711,7 +851,6 @@ packages: '@ethersproject/logger': 5.7.0 '@ethersproject/properties': 5.7.0 '@ethersproject/strings': 5.7.0 - dev: true /@ethersproject/abstract-provider@5.7.0: resolution: {integrity: sha512-R41c9UkchKCpAqStMYUpdunjo3pkEvZC3FAwZn5S5MGbXoMQOHIdHItezTETxAO5bevtMApSyEhn9+CHcDsWBw==} @@ -723,7 +862,6 @@ packages: '@ethersproject/properties': 5.7.0 '@ethersproject/transactions': 5.7.0 '@ethersproject/web': 5.7.1 - dev: true /@ethersproject/abstract-signer@5.7.0: resolution: {integrity: sha512-a16V8bq1/Cz+TGCkE2OPMTOUDLS3grCpdjoJCYNnVBbdYEMSgKrU0+B90s8b6H+ByYTBZN7a3g76jdIJi7UfKQ==} @@ -733,7 +871,6 @@ packages: '@ethersproject/bytes': 5.7.0 '@ethersproject/logger': 5.7.0 '@ethersproject/properties': 5.7.0 - dev: true /@ethersproject/address@5.7.0: resolution: {integrity: sha512-9wYhYt7aghVGo758POM5nqcOMaE168Q6aRLJZwUmiqSrAungkG74gSSeKEIR7ukixesdRZGPgVqme6vmxs1fkA==} @@ -743,20 +880,17 @@ packages: '@ethersproject/keccak256': 5.7.0 '@ethersproject/logger': 5.7.0 '@ethersproject/rlp': 5.7.0 - dev: true /@ethersproject/base64@5.7.0: resolution: {integrity: sha512-Dr8tcHt2mEbsZr/mwTPIQAf3Ai0Bks/7gTw9dSqk1mQvhW3XvRlmDJr/4n+wg1JmCl16NZue17CDh8xb/vZ0sQ==} dependencies: '@ethersproject/bytes': 5.7.0 - dev: true /@ethersproject/basex@5.7.0: resolution: {integrity: sha512-ywlh43GwZLv2Voc2gQVTKBoVQ1mti3d8HK5aMxsfu/nRDnMmNqaSJ3r3n85HBByT8OpoY96SXM1FogC533T4zw==} dependencies: '@ethersproject/bytes': 5.7.0 '@ethersproject/properties': 5.7.0 - dev: true /@ethersproject/bignumber@5.7.0: resolution: {integrity: sha512-n1CAdIHRWjSucQO3MC1zPSVgV/6dy/fjL9pMrPP9peL+QxEg9wOsVqwD4+818B6LUEtaXzVHQiuivzRoxPxUGw==} @@ -764,19 +898,16 @@ packages: '@ethersproject/bytes': 5.7.0 '@ethersproject/logger': 5.7.0 bn.js: 5.2.1 - dev: true /@ethersproject/bytes@5.7.0: resolution: {integrity: sha512-nsbxwgFXWh9NyYWo+U8atvmMsSdKJprTcICAkvbBffT75qDocbuggBU0SJiVK2MuTrp0q+xvLkTnGMPK1+uA9A==} dependencies: '@ethersproject/logger': 5.7.0 - dev: true /@ethersproject/constants@5.7.0: resolution: {integrity: sha512-DHI+y5dBNvkpYUMiRQyxRBYBefZkJfo70VUkUAsRjcPs47muV9evftfZ0PJVCXYbAiCgght0DtcF9srFQmIgWA==} dependencies: '@ethersproject/bignumber': 5.7.0 - dev: true /@ethersproject/contracts@5.7.0: resolution: {integrity: sha512-5GJbzEU3X+d33CdfPhcyS+z8MzsTrBGk/sc+G+59+tPa9yFkl6HQ9D6L0QMgNTA9q8dT0XKxxkyp883XsQvbbg==} @@ -791,7 +922,6 @@ packages: '@ethersproject/logger': 5.7.0 '@ethersproject/properties': 5.7.0 '@ethersproject/transactions': 5.7.0 - dev: true /@ethersproject/hash@5.7.0: resolution: {integrity: sha512-qX5WrQfnah1EFnO5zJv1v46a8HW0+E5xuBBDTwMFZLuVTx0tbU2kkx15NqdjxecrLGatQN9FGQKpb1FKdHCt+g==} @@ -805,7 +935,6 @@ packages: '@ethersproject/logger': 5.7.0 '@ethersproject/properties': 5.7.0 '@ethersproject/strings': 5.7.0 - dev: true /@ethersproject/hdnode@5.7.0: resolution: {integrity: sha512-OmyYo9EENBPPf4ERhR7oj6uAtUAhYGqOnIS+jE5pTXvdKBS99ikzq1E7Iv0ZQZ5V36Lqx1qZLeak0Ra16qpeOg==} @@ -822,7 +951,6 @@ packages: '@ethersproject/strings': 5.7.0 '@ethersproject/transactions': 5.7.0 '@ethersproject/wordlists': 5.7.0 - dev: true /@ethersproject/json-wallets@5.7.0: resolution: {integrity: sha512-8oee5Xgu6+RKgJTkvEMl2wDgSPSAQ9MB/3JYjFV9jlKvcYHUXZC+cQp0njgmxdHkYWn8s6/IqIZYm0YWCjO/0g==} @@ -840,37 +968,31 @@ packages: '@ethersproject/transactions': 5.7.0 aes-js: 3.0.0 scrypt-js: 3.0.1 - dev: true /@ethersproject/keccak256@5.7.0: resolution: {integrity: sha512-2UcPboeL/iW+pSg6vZ6ydF8tCnv3Iu/8tUmLLzWWGzxWKFFqOBQFLo6uLUv6BDrLgCDfN28RJ/wtByx+jZ4KBg==} dependencies: '@ethersproject/bytes': 5.7.0 js-sha3: 0.8.0 - dev: true /@ethersproject/logger@5.7.0: resolution: {integrity: sha512-0odtFdXu/XHtjQXJYA3u9G0G8btm0ND5Cu8M7i5vhEcE8/HmF4Lbdqanwyv4uQTr2tx6b7fQRmgLrsnpQlmnig==} - dev: true /@ethersproject/networks@5.7.1: resolution: {integrity: sha512-n/MufjFYv3yFcUyfhnXotyDlNdFb7onmkSy8aQERi2PjNcnWQ66xXxa3XlS8nCcA8aJKJjIIMNJTC7tu80GwpQ==} dependencies: '@ethersproject/logger': 5.7.0 - dev: true /@ethersproject/pbkdf2@5.7.0: resolution: {integrity: sha512-oR/dBRZR6GTyaofd86DehG72hY6NpAjhabkhxgr3X2FpJtJuodEl2auADWBZfhDHgVCbu3/H/Ocq2uC6dpNjjw==} dependencies: '@ethersproject/bytes': 5.7.0 '@ethersproject/sha2': 5.7.0 - dev: true /@ethersproject/properties@5.7.0: resolution: {integrity: sha512-J87jy8suntrAkIZtecpxEPxY//szqr1mlBaYlQ0r4RCaiD2hjheqF9s1LVE8vVuJCXisjIP+JgtK/Do54ej4Sw==} dependencies: '@ethersproject/logger': 5.7.0 - dev: true /@ethersproject/providers@5.7.2: resolution: {integrity: sha512-g34EWZ1WWAVgr4aptGlVBF8mhl3VWjv+8hoAnzStu8Ah22VHBsuGzP17eb6xDVRzw895G4W7vvx60lFFur/1Rg==} @@ -898,21 +1020,18 @@ packages: transitivePeerDependencies: - bufferutil - utf-8-validate - dev: true /@ethersproject/random@5.7.0: resolution: {integrity: sha512-19WjScqRA8IIeWclFme75VMXSBvi4e6InrUNuaR4s5pTF2qNhcGdCUwdxUVGtDDqC00sDLCO93jPQoDUH4HVmQ==} dependencies: '@ethersproject/bytes': 5.7.0 '@ethersproject/logger': 5.7.0 - dev: true /@ethersproject/rlp@5.7.0: resolution: {integrity: sha512-rBxzX2vK8mVF7b0Tol44t5Tb8gomOHkj5guL+HhzQ1yBh/ydjGnpw6at+X6Iw0Kp3OzzzkcKp8N9r0W4kYSs9w==} dependencies: '@ethersproject/bytes': 5.7.0 '@ethersproject/logger': 5.7.0 - dev: true /@ethersproject/sha2@5.7.0: resolution: {integrity: sha512-gKlH42riwb3KYp0reLsFTokByAKoJdgFCwI+CCiX/k+Jm2mbNs6oOaCjYQSlI1+XBVejwH2KrmCbMAT/GnRDQw==} @@ -920,7 +1039,6 @@ packages: '@ethersproject/bytes': 5.7.0 '@ethersproject/logger': 5.7.0 hash.js: 1.1.7 - dev: true /@ethersproject/signing-key@5.7.0: resolution: {integrity: sha512-MZdy2nL3wO0u7gkB4nA/pEf8lu1TlFswPNmy8AiYkfKTdO6eXBJyUdmHO/ehm/htHw9K/qF8ujnTyUAD+Ry54Q==} @@ -931,7 +1049,6 @@ packages: bn.js: 5.2.1 elliptic: 6.5.4 hash.js: 1.1.7 - dev: true /@ethersproject/solidity@5.7.0: resolution: {integrity: sha512-HmabMd2Dt/raavyaGukF4XxizWKhKQ24DoLtdNbBmNKUOPqwjsKQSdV9GQtj9CBEea9DlzETlVER1gYeXXBGaA==} @@ -942,7 +1059,6 @@ packages: '@ethersproject/logger': 5.7.0 '@ethersproject/sha2': 5.7.0 '@ethersproject/strings': 5.7.0 - dev: true /@ethersproject/strings@5.7.0: resolution: {integrity: sha512-/9nu+lj0YswRNSH0NXYqrh8775XNyEdUQAuf3f+SmOrnVewcJ5SBNAjF7lpgehKi4abvNNXyf+HX86czCdJ8Mg==} @@ -950,7 +1066,6 @@ packages: '@ethersproject/bytes': 5.7.0 '@ethersproject/constants': 5.7.0 '@ethersproject/logger': 5.7.0 - dev: true /@ethersproject/transactions@5.7.0: resolution: {integrity: sha512-kmcNicCp1lp8qanMTC3RIikGgoJ80ztTyvtsFvCYpSCfkjhD0jZ2LOrnbcuxuToLIUYYf+4XwD1rP+B/erDIhQ==} @@ -964,7 +1079,6 @@ packages: '@ethersproject/properties': 5.7.0 '@ethersproject/rlp': 5.7.0 '@ethersproject/signing-key': 5.7.0 - dev: true /@ethersproject/units@5.7.0: resolution: {integrity: sha512-pD3xLMy3SJu9kG5xDGI7+xhTEmGXlEqXU4OfNapmfnxLVY4EMSSRp7j1k7eezutBPH7RBN/7QPnwR7hzNlEFeg==} @@ -972,7 +1086,6 @@ packages: '@ethersproject/bignumber': 5.7.0 '@ethersproject/constants': 5.7.0 '@ethersproject/logger': 5.7.0 - dev: true /@ethersproject/wallet@5.7.0: resolution: {integrity: sha512-MhmXlJXEJFBFVKrDLB4ZdDzxcBxQ3rLyCkhNqVu3CDYvR97E+8r01UgrI+TI99Le+aYm/in/0vp86guJuM7FCA==} @@ -992,7 +1105,6 @@ packages: '@ethersproject/signing-key': 5.7.0 '@ethersproject/transactions': 5.7.0 '@ethersproject/wordlists': 5.7.0 - dev: true /@ethersproject/web@5.7.1: resolution: {integrity: sha512-Gueu8lSvyjBWL4cYsWsjh6MtMwM0+H4HvqFPZfB6dV8ctbP9zFAO73VG1cMWae0FLPCtz0peKPpZY8/ugJJX2w==} @@ -1002,7 +1114,6 @@ packages: '@ethersproject/logger': 5.7.0 '@ethersproject/properties': 5.7.0 '@ethersproject/strings': 5.7.0 - dev: true /@ethersproject/wordlists@5.7.0: resolution: {integrity: sha512-S2TFNJNfHWVHNE6cNDjbVlZ6MgE17MIxMbMg2zv3wn+3XSJGosL1m9ZVv3GXCf/2ymSsQ+hRI5IzoMJTG6aoVA==} @@ -1012,7 +1123,6 @@ packages: '@ethersproject/logger': 5.7.0 '@ethersproject/properties': 5.7.0 '@ethersproject/strings': 5.7.0 - dev: true /@humanwhocodes/config-array@0.5.0: resolution: {integrity: sha512-FagtKFz74XrTl7y6HCzQpwDfXP0yhxe9lHLD1UZxjvZIcbyRz8zTFF/yYNfSfzU414eDwZ1SrO0Qvtyf+wFMQg==} @@ -1029,14 +1139,12 @@ packages: /@iden3/bigarray@0.0.2: resolution: {integrity: sha512-Xzdyxqm1bOFF6pdIsiHLLl3HkSLjbhqJHVyqaTxXt3RqXBEnmsUmEW47H7VOi/ak7TdkRpNkxjyK5Zbkm+y52g==} - dev: true /@iden3/binfileutils@0.0.11: resolution: {integrity: sha512-LylnJoZ0CTdgErnKY8OxohvW4K+p6UHD3sxt+3P9AmMyBQjYR4IpoqoYZZ+9aMj89cmCQ21UvdhndAx04er3NA==} dependencies: fastfile: 0.0.20 ffjavascript: 0.2.60 - dev: true /@jridgewell/gen-mapping@0.3.3: resolution: {integrity: sha512-HLhSWOLRi875zjjMG/r+Nv0oCW8umGb0BgEhyX3dDX3egwZtB8PqLnjz3yedt8R5StBrzcg4aBpnh8UA9D1BoQ==} @@ -1185,6 +1293,218 @@ packages: tslib: 2.4.1 dev: false + /@mui/base@5.0.0-beta.11(@types/react@18.2.5)(react-dom@18.2.0)(react@18.2.0): + resolution: {integrity: sha512-FdKZGPd8qmC3ZNke7CNhzcEgToc02M6WYZc9hcBsNQ17bgAd3s9F//1bDDYgMVBYxDM71V0sv/hBHlOY4I1ZVA==} + engines: {node: '>=12.0.0'} + peerDependencies: + '@types/react': ^17.0.0 || ^18.0.0 + react: ^17.0.0 || ^18.0.0 + react-dom: ^17.0.0 || ^18.0.0 + peerDependenciesMeta: + '@types/react': + optional: true + dependencies: + '@babel/runtime': 7.22.10 + '@emotion/is-prop-valid': 1.2.1 + '@mui/types': 7.2.4(@types/react@18.2.5) + '@mui/utils': 5.14.5(react@18.2.0) + '@popperjs/core': 2.11.8 + '@types/react': 18.2.5 + clsx: 2.0.0 + prop-types: 15.8.1 + react: 18.2.0 + react-dom: 18.2.0(react@18.2.0) + react-is: 18.2.0 + dev: false + + /@mui/core-downloads-tracker@5.14.5: + resolution: {integrity: sha512-+wpGH1USwPcKMFPMvXqYPC6fEvhxM3FzxC8lyDiNK/imLyyJ6y2DPb1Oue7OGIKJWBmYBqrWWtfovrxd1aJHTA==} + dev: false + + /@mui/material@5.14.5(@emotion/react@11.11.1)(@emotion/styled@11.11.0)(@types/react@18.2.5)(react-dom@18.2.0)(react@18.2.0): + resolution: {integrity: sha512-4qa4GMfuZH0Ai3mttk5ccXP8a3sf7aPlAJwyMrUSz6h9hPri6BPou94zeu3rENhhmKLby9S/W1y+pmficy8JKA==} + engines: {node: '>=12.0.0'} + peerDependencies: + '@emotion/react': ^11.5.0 + '@emotion/styled': ^11.3.0 + '@types/react': ^17.0.0 || ^18.0.0 + react: ^17.0.0 || ^18.0.0 + react-dom: ^17.0.0 || ^18.0.0 + peerDependenciesMeta: + '@emotion/react': + optional: true + '@emotion/styled': + optional: true + '@types/react': + optional: true + dependencies: + '@babel/runtime': 7.22.10 + '@emotion/react': 11.11.1(@types/react@18.2.5)(react@18.2.0) + '@emotion/styled': 11.11.0(@emotion/react@11.11.1)(@types/react@18.2.5)(react@18.2.0) + '@mui/base': 5.0.0-beta.11(@types/react@18.2.5)(react-dom@18.2.0)(react@18.2.0) + '@mui/core-downloads-tracker': 5.14.5 + '@mui/system': 5.14.5(@emotion/react@11.11.1)(@emotion/styled@11.11.0)(@types/react@18.2.5)(react@18.2.0) + '@mui/types': 7.2.4(@types/react@18.2.5) + '@mui/utils': 5.14.5(react@18.2.0) + '@types/react': 18.2.5 + '@types/react-transition-group': 4.4.6 + clsx: 2.0.0 + csstype: 3.1.2 + prop-types: 15.8.1 + react: 18.2.0 + react-dom: 18.2.0(react@18.2.0) + react-is: 18.2.0 + react-transition-group: 4.4.5(react-dom@18.2.0)(react@18.2.0) + dev: false + + /@mui/private-theming@5.14.5(@types/react@18.2.5)(react@18.2.0): + resolution: {integrity: sha512-cC4C5RrpXpDaaZyH9QwmPhRLgz+f2SYbOty3cPkk4qPSOSfif2ZEcDD9HTENKDDd9deB+xkPKzzZhi8cxIx8Ig==} + engines: {node: '>=12.0.0'} + peerDependencies: + '@types/react': ^17.0.0 || ^18.0.0 + react: ^17.0.0 || ^18.0.0 + peerDependenciesMeta: + '@types/react': + optional: true + dependencies: + '@babel/runtime': 7.22.10 + '@mui/utils': 5.14.5(react@18.2.0) + '@types/react': 18.2.5 + prop-types: 15.8.1 + react: 18.2.0 + dev: false + + /@mui/styled-engine@5.13.2(@emotion/react@11.11.1)(@emotion/styled@11.11.0)(react@18.2.0): + resolution: {integrity: sha512-VCYCU6xVtXOrIN8lcbuPmoG+u7FYuOERG++fpY74hPpEWkyFQG97F+/XfTQVYzlR2m7nPjnwVUgATcTCMEaMvw==} + engines: {node: '>=12.0.0'} + peerDependencies: + '@emotion/react': ^11.4.1 + '@emotion/styled': ^11.3.0 + react: ^17.0.0 || ^18.0.0 + peerDependenciesMeta: + '@emotion/react': + optional: true + '@emotion/styled': + optional: true + dependencies: + '@babel/runtime': 7.22.10 + '@emotion/cache': 11.11.0 + '@emotion/react': 11.11.1(@types/react@18.2.5)(react@18.2.0) + '@emotion/styled': 11.11.0(@emotion/react@11.11.1)(@types/react@18.2.5)(react@18.2.0) + csstype: 3.1.2 + prop-types: 15.8.1 + react: 18.2.0 + dev: false + + /@mui/system@5.14.5(@emotion/react@11.11.1)(@emotion/styled@11.11.0)(@types/react@18.2.5)(react@18.2.0): + resolution: {integrity: sha512-mextXZHDeGcR7E1kx43TRARrVXy+gI4wzpUgNv7MqZs1dvTVXQGVeAT6ydj9d6FUqHBPMNLGV/21vJOrpqsL+w==} + engines: {node: '>=12.0.0'} + peerDependencies: + '@emotion/react': ^11.5.0 + '@emotion/styled': ^11.3.0 + '@types/react': ^17.0.0 || ^18.0.0 + react: ^17.0.0 || ^18.0.0 + peerDependenciesMeta: + '@emotion/react': + optional: true + '@emotion/styled': + optional: true + '@types/react': + optional: true + dependencies: + '@babel/runtime': 7.22.10 + '@emotion/react': 11.11.1(@types/react@18.2.5)(react@18.2.0) + '@emotion/styled': 11.11.0(@emotion/react@11.11.1)(@types/react@18.2.5)(react@18.2.0) + '@mui/private-theming': 5.14.5(@types/react@18.2.5)(react@18.2.0) + '@mui/styled-engine': 5.13.2(@emotion/react@11.11.1)(@emotion/styled@11.11.0)(react@18.2.0) + '@mui/types': 7.2.4(@types/react@18.2.5) + '@mui/utils': 5.14.5(react@18.2.0) + '@types/react': 18.2.5 + clsx: 2.0.0 + csstype: 3.1.2 + prop-types: 15.8.1 + react: 18.2.0 + dev: false + + /@mui/types@7.2.4(@types/react@18.2.5): + resolution: {integrity: sha512-LBcwa8rN84bKF+f5sDyku42w1NTxaPgPyYKODsh01U1fVstTClbUoSA96oyRBnSNyEiAVjKm6Gwx9vjR+xyqHA==} + peerDependencies: + '@types/react': '*' + peerDependenciesMeta: + '@types/react': + optional: true + dependencies: + '@types/react': 18.2.5 + dev: false + + /@mui/utils@5.14.5(react@18.2.0): + resolution: {integrity: sha512-6Hzw63VR9C5xYv+CbjndoRLU6Gntal8rJ5W+GUzkyHrGWIyYPWZPa6AevnyGioySNETATe1H9oXS8f/7qgIHJA==} + engines: {node: '>=12.0.0'} + peerDependencies: + react: ^17.0.0 || ^18.0.0 + dependencies: + '@babel/runtime': 7.22.10 + '@types/prop-types': 15.7.5 + '@types/react-is': 18.2.1 + prop-types: 15.8.1 + react: 18.2.0 + react-is: 18.2.0 + dev: false + + /@mui/x-date-pickers@6.11.2(@emotion/react@11.11.1)(@emotion/styled@11.11.0)(@mui/base@5.0.0-beta.11)(@mui/material@5.14.5)(@mui/system@5.14.5)(dayjs@1.11.9)(react-dom@18.2.0)(react@18.2.0): + resolution: {integrity: sha512-AOmXtnnAhjlku03oqRMOG1oJkxazBTz06A6a0iRz+1sUyBWbqz5kKH9eYUYQC4Tv3j2EciRpwyns5xwX3wpc1A==} + engines: {node: '>=14.0.0'} + peerDependencies: + '@emotion/react': ^11.9.0 + '@emotion/styled': ^11.8.1 + '@mui/base': ^5.0.0-alpha.87 + '@mui/material': ^5.8.6 + '@mui/system': ^5.8.0 + date-fns: ^2.25.0 + date-fns-jalali: ^2.13.0-0 + dayjs: ^1.10.7 + luxon: ^3.0.2 + moment: ^2.29.4 + moment-hijri: ^2.1.2 + moment-jalaali: ^0.7.4 || ^0.8.0 || ^0.9.0 || ^0.10.0 + react: ^17.0.0 || ^18.0.0 + react-dom: ^17.0.0 || ^18.0.0 + peerDependenciesMeta: + '@emotion/react': + optional: true + '@emotion/styled': + optional: true + date-fns: + optional: true + date-fns-jalali: + optional: true + dayjs: + optional: true + luxon: + optional: true + moment: + optional: true + moment-hijri: + optional: true + moment-jalaali: + optional: true + dependencies: + '@babel/runtime': 7.22.10 + '@emotion/react': 11.11.1(@types/react@18.2.5)(react@18.2.0) + '@emotion/styled': 11.11.0(@emotion/react@11.11.1)(@types/react@18.2.5)(react@18.2.0) + '@mui/base': 5.0.0-beta.11(@types/react@18.2.5)(react-dom@18.2.0)(react@18.2.0) + '@mui/material': 5.14.5(@emotion/react@11.11.1)(@emotion/styled@11.11.0)(@types/react@18.2.5)(react-dom@18.2.0)(react@18.2.0) + '@mui/system': 5.14.5(@emotion/react@11.11.1)(@emotion/styled@11.11.0)(@types/react@18.2.5)(react@18.2.0) + '@mui/utils': 5.14.5(react@18.2.0) + '@types/react-transition-group': 4.4.6 + clsx: 2.0.0 + dayjs: 1.11.9 + prop-types: 15.8.1 + react: 18.2.0 + react-dom: 18.2.0(react@18.2.0) + react-transition-group: 4.4.5(react-dom@18.2.0)(react@18.2.0) + dev: false + /@next/env@13.4.1: resolution: {integrity: sha512-eD6WCBMFjLFooLM19SIhSkWBHtaFrZFfg2Cxnyl3vS3DAdFRfnx5TY2RxlkuKXdIRCC0ySbtK9JXXt8qLCqzZg==} dev: false @@ -1711,6 +2031,10 @@ packages: tslib: 2.4.1 dev: false + /@popperjs/core@2.11.8: + resolution: {integrity: sha512-P1st0aksCrn9sGZhp8GMYwBnQsbvAWsZAX44oXNNvLHGqAOcoVxmjZiohstwQ7SqKnbR47akdNi+uleWD8+g6A==} + dev: false + /@rushstack/eslint-patch@1.2.0: resolution: {integrity: sha512-sXo/qW2/pAcmT43VoRKOJbDOfV3cYpq3szSVfIThQXNt+E4DfKj361vaAt3c88U5tPUxzEswam7GW48PJqtKAg==} dev: false @@ -1777,7 +2101,7 @@ packages: resolution: {integrity: sha512-bcKpo1oj54hGholplGLpqPHRbIsnbixFtc06nwuNM5/dwSXOq/AAYoIBRsBmnZJSdfeNW5rnff7NTAz3ZCqR9Q==} dependencies: '@noble/curves': 1.0.0 - '@noble/hashes': 1.3.0 + '@noble/hashes': 1.3.1 '@scure/base': 1.1.1 dev: false @@ -1791,7 +2115,7 @@ packages: /@scure/bip39@1.2.0: resolution: {integrity: sha512-SX/uKq52cuxm4YFXWFaVByaSHJh2w3BnokVSeUJVCv6K7WulT9u2BuNRBhuFl8vAuYnzx9bEu9WgpcNYTrYieg==} dependencies: - '@noble/hashes': 1.3.0 + '@noble/hashes': 1.3.1 '@scure/base': 1.1.1 dev: false @@ -2376,6 +2700,10 @@ packages: resolution: {integrity: sha512-tktOkFUA4kXx2hhhrB8bIFb5TbwzS4uOhKEmwiD+NoiL0qtP2OQ9mFldbgD4dV1djrlBYP6eBuQZiWjuHUpqFw==} dev: true + /@types/parse-json@4.0.0: + resolution: {integrity: sha512-//oorEZjL6sbPcKUaCdIGlIUeH26mgzimjBB77G6XRgnDl/L5wOnpyBGRe/Mmf5CVW3PwEBE1NjiMZ/ssFh4wA==} + dev: false + /@types/pbkdf2@3.1.0: resolution: {integrity: sha512-Cf63Rv7jCQ0LaL8tNXmEyqTHuIJxRdlS5vMh1mj5voN4+QFhVZnlZruezqpWYDiJ8UTzhP0VmeLXCmBk66YrMQ==} dependencies: @@ -2399,6 +2727,18 @@ packages: '@types/react': 18.2.5 dev: true + /@types/react-is@18.2.1: + resolution: {integrity: sha512-wyUkmaaSZEzFZivD8F2ftSyAfk6L+DfFliVj/mYdOXbVjRcS87fQJLTnhk6dRZPuJjI+9g6RZJO4PNCngUrmyw==} + dependencies: + '@types/react': 18.2.5 + dev: false + + /@types/react-transition-group@4.4.6: + resolution: {integrity: sha512-VnCdSxfcm08KjsJVQcfBmhEQAPnLB8G08hAxn39azX1qYBQ/5RVQuoHuKIcfKOdncuaUvEpFKFzEvbtIMsfVew==} + dependencies: + '@types/react': 18.2.5 + dev: false + /@types/react@18.2.5: resolution: {integrity: sha512-RuoMedzJ5AOh23Dvws13LU9jpZHIc/k90AgmK7CecAYeWmSr3553L4u5rk4sWAPBuQosfT7HmTfG4Rg5o4nGEA==} dependencies: @@ -3076,7 +3416,6 @@ packages: /aes-js@3.0.0: resolution: {integrity: sha512-H7wUZRn8WpTq9jocdxQ2c8x2sKo9ZVmzfRE13GiNJXfp7NcKYEdvl3vspKjXox6RIG2VtaRe4JFvxG4rqp2Zuw==} - dev: true /aes-js@3.1.2: resolution: {integrity: sha512-e5pEa2kBnBOgR4Y/p20pskXI74UEz7de8ZGVo58asOtvSVG5YAbJeELPZxOmt+Bnz3rX753YKhfIn4X4l1PPRQ==} @@ -3210,7 +3549,7 @@ packages: resolution: {integrity: sha512-o/HelwhuKpTj/frsOsbNLNgnNGVIFsVP/SW2BSF14gVl7kAfMOJ6/8wUAUvG1R1NHKrfG+2sHZTu0yauT1qBrA==} engines: {node: '>=6.0'} dependencies: - '@babel/runtime': 7.20.1 + '@babel/runtime': 7.22.10 '@babel/runtime-corejs3': 7.20.1 dev: false @@ -3343,7 +3682,6 @@ packages: /async@3.2.4: resolution: {integrity: sha512-iAB+JbDEGXhyIUavoDl9WP/Jj106Kz9DEn1DPgYw5ruDn0e3Wgi3sKFm55sASdGBNOQB8F59d9qQ7deqrHA8wQ==} - dev: true /asynckit@0.4.0: resolution: {integrity: sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==} @@ -3406,7 +3744,15 @@ packages: /b4a@1.6.4: resolution: {integrity: sha512-fpWrvyVHEKyeEvbKZTVOeZF3VSKKWtJxFIxX/jaVPf+cLbGUSitjb49pHLqPV2BUNNZ0LcoeEGfE/YCpyDYHIw==} - dev: true + + /babel-plugin-macros@3.1.0: + resolution: {integrity: sha512-Cg7TFGpIr01vOQNODXOOaGz2NpCU5gl8x1qJFbb6hbZxR7XrcE2vtbAsTAbJ7/xwJtUuJEw8K8Zr/AE0LHlesg==} + engines: {node: '>=10', npm: '>=6'} + dependencies: + '@babel/runtime': 7.22.10 + cosmiconfig: 7.1.0 + resolve: 1.22.1 + dev: false /babel-plugin-styled-components@2.1.4(@babel/core@7.22.10)(styled-components@5.3.11): resolution: {integrity: sha512-Xgp9g+A/cG47sUyRwwYxGM4bR/jDRg5N6it/8+HxCnbT5XNKSKDT9xm4oag/osgqjC2It/vH0yXsomOG6k558g==} @@ -3418,7 +3764,7 @@ packages: '@babel/plugin-syntax-jsx': 7.22.5(@babel/core@7.22.10) lodash: 4.17.21 picomatch: 2.3.1 - styled-components: 5.3.11(@babel/core@7.22.10)(react-dom@18.2.0)(react-is@16.13.1)(react@18.2.0) + styled-components: 5.3.11(@babel/core@7.22.10)(react-dom@18.2.0)(react-is@18.2.0)(react@18.2.0) transitivePeerDependencies: - '@babel/core' dev: false @@ -3442,7 +3788,6 @@ packages: /bech32@1.1.4: resolution: {integrity: sha512-s0IrSOzLlbvX7yp4WBfPITzpAU8sqQcpsmwXDiKwrG4r491vwCO/XpejasRNl0piBMe/DvP4Tz0mIS/X1DPJBQ==} - dev: true /bfj@7.0.2: resolution: {integrity: sha512-+e/UqUzwmzJamNF50tBV6tZPTORow7gQ96iFow+8b562OdMpEK0BcJEq2OSPEDmAbSMBQ7PKZ87ubFkgxpYWgw==} @@ -3452,7 +3797,6 @@ packages: check-types: 11.2.2 hoopy: 0.1.4 tryer: 1.0.1 - dev: true /big-integer@1.6.51: resolution: {integrity: sha512-GPEid2Y9QU1Exl1rpO9B2IPJGHPSupF5GnVIP0blYvNOMer2bTvSWs1jGOUg04hTmu67nmLsQ9TBo1puaotBHg==} @@ -3515,28 +3859,24 @@ packages: node-addon-api: 3.2.1 node-gyp-build: 4.6.0 readable-stream: 3.6.2 - dev: true /blake2b-wasm@2.4.0: resolution: {integrity: sha512-S1kwmW2ZhZFFFOghcx73+ZajEfKBqhP82JMssxtLVMxlaPea1p9uoLiUZ5WYyHn0KddwbLc+0vh4wR0KBNoT5w==} dependencies: b4a: 1.6.4 nanoassert: 2.0.0 - dev: true /blake2b@2.1.4: resolution: {integrity: sha512-AyBuuJNI64gIvwx13qiICz6H6hpmjvYS5DGkG6jbXMOT8Z3WUJ3V1X0FlhIoT1b/5JtHE3ki+xjtMvu1nn+t9A==} dependencies: blake2b-wasm: 2.4.0 nanoassert: 2.0.0 - dev: true /blakejs@1.2.1: resolution: {integrity: sha512-QXUSXI3QVc/gJME0dBpXrag1kbzOqCjCX8/b54ntNyW6sjtoqxqRk3LTmXzaJoh71zMsDCjM+47jS7XiwN/+fQ==} /bluebird@3.7.2: resolution: {integrity: sha512-XpNj6GDQzdfW+r2Wnn7xiSAd7TM3jzkxGXBGTtWKuSXv1xUV+azxAm8jdWZN06QTQk+2N2XB9jRDkvbmQmcRtg==} - dev: true /bn.js@4.11.6: resolution: {integrity: sha512-XWwnNNFCuuSQ0m3r3C4LE3EiORltHd9M05pq6FOlVeiophzRbMo50Sbz1ehl8K3Z+jw9+vmgnXefY1hz8X+2wA==} @@ -3566,7 +3906,6 @@ packages: resolution: {integrity: sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==} dependencies: balanced-match: 1.0.2 - dev: true /braces@3.0.2: resolution: {integrity: sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==} @@ -3791,7 +4130,6 @@ packages: /check-types@11.2.2: resolution: {integrity: sha512-HBiYvXvn9Z70Z88XKjz3AEKd4HJhBXsa3j7xFnITAzoS8+q6eIGi8qDB8FKPBAjtuxjI/zFpwuiCb8oDtKOYrA==} - dev: true /chokidar@3.3.0: resolution: {integrity: sha512-dGmKLDdT3Gdl7fBUe8XK+gAtGmzy5Fn0XkkWQuYxGIgWVPPse2CxFA5mtrlD0TOHaHjEUqkWNyP1XdHoJES/4A==} @@ -3894,7 +4232,6 @@ packages: hasBin: true dependencies: ffjavascript: 0.2.57 - dev: true /circomlib-ml@1.4.4: resolution: {integrity: sha512-7EHHgtC7mR4jB0pzGulaEkZskfvbI9zWGanMsi9/b4OrBu4gNlC0A96t4B/DMCBLZWjlZkAhK4ucwrJ7NB0kjw==} @@ -3914,7 +4251,6 @@ packages: transitivePeerDependencies: - bufferutil - utf-8-validate - dev: true /classic-level@1.3.0: resolution: {integrity: sha512-iwFAJQYtqRTRM0F6L8h4JCt00ZSGdOyqh7yVrhhjrOpFhmBjNlRUey64MCiyo6UmQHMJ+No3c81nujPv+n9yrg==} @@ -3975,6 +4311,11 @@ packages: engines: {node: '>=6'} dev: false + /clsx@2.0.0: + resolution: {integrity: sha512-rQ1+kcj+ttHG0MKVGBUXwayCCF1oh39BF5COIpRzuCEv8Mwjv0XucrI2ExNTOn9IlLifGClWQcU9BrZORvtw6Q==} + engines: {node: '>=6'} + dev: false + /color-convert@1.9.3: resolution: {integrity: sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==} dependencies: @@ -4057,7 +4398,7 @@ packages: typedarray: 0.0.6 dev: true - /connectkit@1.5.1(@babel/core@7.22.10)(react-dom@18.2.0)(react-is@16.13.1)(react@18.2.0)(viem@1.6.0)(wagmi@1.3.10): + /connectkit@1.5.1(@babel/core@7.22.10)(react-dom@18.2.0)(react-is@18.2.0)(react@18.2.0)(viem@1.6.0)(wagmi@1.3.10): resolution: {integrity: sha512-5w3Ljr7VNPwH3AQLxk94gtvjopcSsbCjABiPHvi3YLMQq9WCu5jycfLD5kUCx2kZJDahF9oFIV267XEqLLYjxA==} engines: {node: '>=12.4'} peerDependencies: @@ -4075,7 +4416,7 @@ packages: react-transition-state: 1.1.5(react-dom@18.2.0)(react@18.2.0) react-use-measure: 2.1.1(react-dom@18.2.0)(react@18.2.0) resize-observer-polyfill: 1.5.1 - styled-components: 5.3.11(@babel/core@7.22.10)(react-dom@18.2.0)(react-is@16.13.1)(react@18.2.0) + styled-components: 5.3.11(@babel/core@7.22.10)(react-dom@18.2.0)(react-is@18.2.0)(react@18.2.0) viem: 1.6.0(typescript@5.0.4) wagmi: 1.3.10(@types/react@18.2.5)(react-dom@18.2.0)(react@18.2.0)(typescript@5.0.4)(viem@1.6.0) transitivePeerDependencies: @@ -4111,6 +4452,17 @@ packages: resolution: {integrity: sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ==} dev: true + /cosmiconfig@7.1.0: + resolution: {integrity: sha512-AdmX6xUzdNASswsFtmwSt7Vj8po9IuqXm0UXz7QKPuEUmPB4XyjGfaAr2PSuELMwkRMVH1EpIkX5bTZGRB3eCA==} + engines: {node: '>=10'} + dependencies: + '@types/parse-json': 4.0.0 + import-fresh: 3.3.0 + parse-json: 5.2.0 + path-type: 4.0.0 + yaml: 1.10.2 + dev: false + /crc-32@1.2.2: resolution: {integrity: sha512-ROmzCKrTnOwybPcJApAA6WBWij23HVfGVNKqqrZpuyZOHqK2CwHSvpGuyt/UNNvaIjEd8X5IFGp4Mh+Ie1IHJQ==} engines: {node: '>=0.8'} @@ -4187,6 +4539,10 @@ packages: /csstype@3.1.1: resolution: {integrity: sha512-DJR/VvkAvSZW9bTouZue2sSxDwdTN92uHjqeKVm+0dAqdfNykRzQ95tay8aXMBAAPpUiq4Qcug2L7neoRh2Egw==} + /csstype@3.1.2: + resolution: {integrity: sha512-I7K1Uu0MBPzaFKg4nI5Q7Vs2t+3gWWW648spaF+Rg7pI9ds18Ugn+lvg4SHczUdKlHI5LWBXyqfS8+DufyBsgQ==} + dev: false + /daisyui@3.5.1: resolution: {integrity: sha512-7GG+9QXnr2qQMCqnyFU8TxpaOYJigXiEtmzoivmiiZZHvxqIwYdaMAkgivqTVxEgy3Hot3m1suzZjmt1zUrvmA==} engines: {node: '>=16.9.0'} @@ -4211,6 +4567,10 @@ packages: assert-plus: 1.0.0 dev: true + /dayjs@1.11.9: + resolution: {integrity: sha512-QvzAURSbQ0pKdIye2txOzNaHmxtUBXerpY0FJsFXUMKbIZeFm5ht1LS/jFsrncjnmtv8HsG0W2g6c0zUjZWmpA==} + dev: false + /death@1.1.0: resolution: {integrity: sha512-vsV6S4KVHvTGxbEcij7hkWRv0It+sGGWVOM67dQde/o5Xjnr+KmLjxWJii2uEObIrt1CcM9w0Yaovx+iOlIL+w==} dev: true @@ -4434,6 +4794,13 @@ packages: dependencies: esutils: 2.0.3 + /dom-helpers@5.2.1: + resolution: {integrity: sha512-nRCa7CK3VTrM2NmGkIy4cbK7IZlgBE/PYMn55rrXefr5xXDP0LdtfPnblFDoVdcAfslJ7or6iqAUnx0CCGIWQA==} + dependencies: + '@babel/runtime': 7.22.10 + csstype: 3.1.2 + dev: false + /dotenv@16.3.1: resolution: {integrity: sha512-IPzF4w4/Rd94bA9imS68tZBaYyBWSCE47V1RGuMrB94iyTOIEwRmVL2x/4An+6mETpLrKJ5hQkB8W4kFAadeIQ==} engines: {node: '>=12'} @@ -4461,7 +4828,6 @@ packages: hasBin: true dependencies: jake: 10.8.7 - dev: true /electron-to-chromium@1.4.284: resolution: {integrity: sha512-M8WEXFuKXMYMVr45fo8mq0wUrrJHheiKZf6BArTKk9ZBYCKJEOU5H8cdWgDT+qCVZf7Na4lVUaZsA+h6uA9+PA==} @@ -4522,6 +4888,12 @@ packages: engines: {node: '>=6'} dev: true + /error-ex@1.3.2: + resolution: {integrity: sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g==} + dependencies: + is-arrayish: 0.2.1 + dev: false + /es-abstract@1.20.4: resolution: {integrity: sha512-0UtvRN79eMe2L+UNEF1BwRe364sj/DXhQ/k5FmivgoSdpM90b8Jc0mDzKMGo7QS0BVbOP/bTwBKNnDc9rNzaPA==} engines: {node: '>= 0.4'} @@ -4986,7 +5358,7 @@ packages: peerDependencies: eslint: ^3 || ^4 || ^5 || ^6 || ^7 || ^8 dependencies: - '@babel/runtime': 7.20.1 + '@babel/runtime': 7.22.10 aria-query: 4.2.2 array-includes: 3.1.6 ast-types-flow: 0.0.7 @@ -5362,7 +5734,6 @@ packages: transitivePeerDependencies: - bufferutil - utf-8-validate - dev: true /ethjs-unit@0.1.6: resolution: {integrity: sha512-/Sn9Y0oKl0uqQuvgFk/zQgR7aw1g36qX/jzSQ5lSwlO0GigPymk4eGQfeNTD03w1dPOqfz8V77Cy43jH56pagw==} @@ -5466,7 +5837,6 @@ packages: /fastfile@0.0.20: resolution: {integrity: sha512-r5ZDbgImvVWCP0lA/cGNgQcZqR+aYdFx3u+CtJqUE510pBUVGMn4ulL/iRTI4tACTYsNJ736uzFxEBXesPAktA==} - dev: true /fastparse@1.1.2: resolution: {integrity: sha512-483XLLxTVIwWK3QTrMGRqUfUpoOs/0hbQrl2oz4J0pAcm3A3bu84wxTFqGqkJzewCLdME38xJLJAxBABfQT8sQ==} @@ -5517,7 +5887,6 @@ packages: wasmbuilder: 0.0.16 wasmcurves: 0.2.0 web-worker: 1.2.0 - dev: true /ffjavascript@0.2.59: resolution: {integrity: sha512-QssOEUv+wilz9Sg7Zaj6KWAm7QceOAEsFuEBTltUsDo1cjn11rA/LGYvzFBPbzNfxRlZxwgJ7uxpCQcdDlrNfw==} @@ -5525,7 +5894,6 @@ packages: wasmbuilder: 0.0.16 wasmcurves: 0.2.1 web-worker: 1.2.0 - dev: true /ffjavascript@0.2.60: resolution: {integrity: sha512-T/9bnEL5xAZRDbQoEMf+pM9nrhK+C3JyZNmqiWub26EQorW7Jt+jR54gpqDhceA4Nj0YctPQwYnl8xa52/A26A==} @@ -5533,7 +5901,6 @@ packages: wasmbuilder: 0.0.16 wasmcurves: 0.2.2 web-worker: 1.2.0 - dev: true /ffwasm@0.0.7: resolution: {integrity: sha512-17cTLzv7HHAKqZbX8MvHxjSrR0yDdn1sh4TVsTbAvO9e6klhFicnyoVXc/sCuViV/M8g65sCmVrAmoPCZp1YkQ==} @@ -5556,7 +5923,6 @@ packages: resolution: {integrity: sha512-w1cEuf3S+DrLCQL7ET6kz+gmlJdbq9J7yXCSjK/OZCPA+qEN1WyF4ZAf0YYJa4/shHJra2t/d/r8SV4Ji+x+8Q==} dependencies: minimatch: 5.1.6 - dev: true /fill-range@7.0.1: resolution: {integrity: sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==} @@ -5576,6 +5942,10 @@ packages: array-back: 3.1.0 dev: true + /find-root@1.1.0: + resolution: {integrity: sha512-NKfW6bec6GfKc0SGx1e07QZY9PE99u0Bft/0rzSD5k3sO/vwkVUpDUKVm5Gpp5Ue3YfShPFTX2070tDs5kB9Ng==} + dev: false + /find-up@2.1.0: resolution: {integrity: sha512-NWzkk0jSJtTt08+FBFMvXoeZnOJD+jTtsRmBYbAIzJdX6l7dLgR7CTubCM5/eDdPUBvLCeVasP1brfVR/9/EZQ==} engines: {node: '>=4'} @@ -6237,7 +6607,6 @@ packages: /hoopy@0.1.4: resolution: {integrity: sha512-HRcs+2mr52W0K+x8RzcLzuPPmVIKMSv97RGHy0Ea9y/mpcaK+xTrjICA04KAHi4GRzxliNqNJEFYWHghy3rSfQ==} engines: {node: '>= 6.0.0'} - dev: true /http-basic@8.1.3: resolution: {integrity: sha512-/EcDMwJZh3mABI2NhGfHOGOeOZITqfkEO4p/xK+l3NpyncIHUQBoMvCSF/b5GqvKtySC2srL/GGG3+EtlqlmCw==} @@ -6390,6 +6759,10 @@ packages: is-typed-array: 1.1.12 dev: true + /is-arrayish@0.2.1: + resolution: {integrity: sha512-zz06S8t0ozoDXMG+ube26zeCTNXcKIPJZJi8hBrF4idCLms4CG9QtK7qBl1boi5ODzFpjswb5JPmHCbMpjaYzg==} + dev: false + /is-bigint@1.0.4: resolution: {integrity: sha512-zB9CruMamjym81i2JZ3UMn54PKGsQzsJeo6xvN3HJJ4CAsQNB6iRutp2To77OfCNuoxspsIhzaPoO1zyCEhFOg==} dependencies: @@ -6577,7 +6950,6 @@ packages: chalk: 4.1.2 filelist: 1.0.4 minimatch: 3.1.2 - dev: true /jayson@4.1.0: resolution: {integrity: sha512-R6JlbyLN53Mjku329XoRT2zJAE6ZgOQ8f91ucYdMCD4nkGCF9kZSrcGXpHIU4jeKj58zUZke2p+cdQchU7Ly7A==} @@ -6615,7 +6987,6 @@ packages: /js-sha3@0.8.0: resolution: {integrity: sha512-gF1cRrHhIzNfToc802P800N8PpXS+evLLXfsVpowqmAFR9uwbi89WvXg2QspOmXL8QL86J4T1EpFu+yUkwJY3Q==} - dev: true /js-tokens@4.0.0: resolution: {integrity: sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==} @@ -6658,6 +7029,10 @@ packages: hasBin: true dev: false + /json-parse-even-better-errors@2.3.1: + resolution: {integrity: sha512-xyFwyhro/JEof6Ghe2iz2NcXoj2sloNsWr/XsERDK/oiPCfaNhl5ONfp+jQdAZRQQ0IJWNzH9zIZF7li91kh2w==} + dev: false + /json-rpc-engine@6.1.0: resolution: {integrity: sha512-NEdLrtrq1jUZyfjkr9OCz9EzCNhnRyWtt1PAnvnhwy6e8XETS0Dtc+ZNCO2gvuAoKsIn2+vCSowXTYE4CkgnAQ==} engines: {node: '>=10.0.0'} @@ -6921,10 +7296,10 @@ packages: /logplease@1.2.15: resolution: {integrity: sha512-jLlHnlsPSJjpwUfcNyUxXCl33AYg2cHhIf9QhGL2T4iPT0XPB+xP1LRKFPgIg1M/sg9kAJvy94w9CzBNrfnstA==} - dev: true /loose-envify@1.4.0: resolution: {integrity: sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q==} + hasBin: true dependencies: js-tokens: 4.0.0 @@ -7048,7 +7423,6 @@ packages: engines: {node: '>=10'} dependencies: brace-expansion: 2.0.1 - dev: true /minimist@1.2.7: resolution: {integrity: sha512-bzfL1YUZsP41gmu/qjrEk0Q6i2ix/cVeAhbCbqH9u3zYutS1cLg00qhrD0M2MVdCcx4Sc0UpP2eBWo9rotpq6g==} @@ -7244,7 +7618,6 @@ packages: /nanoassert@2.0.0: resolution: {integrity: sha512-7vO7n28+aYO4J+8w96AzhmU8G+Y/xpPDJz/se19ICsqj/momRbb9mh9ZUtkoJ5X3nTnPdhEJyc0qnM6yAsHBaA==} - dev: true /nanoid@3.1.20: resolution: {integrity: sha512-a1cQNyczgKbLX9jwbS/+d7W8fX/RfgYR7lVWwWOGIPNgK2m0MWvrGF6/m4kk6U3QcFMnZf3RIhL0v2Jgh/0Uxw==} @@ -7323,7 +7696,6 @@ packages: /node-addon-api@3.2.1: resolution: {integrity: sha512-mmcei9JghVNDYydghQmeDX8KoAm0FAiYyIcUt/N4nhyAipB17pllZQDOJD2fotxABnt4Mdz+dKTO7eftLg4d0A==} - dev: true /node-emoji@1.11.0: resolution: {integrity: sha512-wo2DpQkQp7Sjm2A0cq+sN7EHKO6Sl0ctXeBdFZrL9T9+UywORbufTcTZxom8YqpLQt/FqNMUkOpkZrJVYSKD3A==} @@ -7618,6 +7990,16 @@ packages: resolution: {integrity: sha512-60zvsJReQPX5/QP0Kzfd/VrpjScIQ7SHBW6bFCYfEP+fp0Eppr1SHhIO5nd1PjZtvclzSzES9D/p5nFJurwfWg==} dev: true + /parse-json@5.2.0: + resolution: {integrity: sha512-ayCKvm/phCGxOkYRSCM82iDwct8/EonSEgCSxWxD7ve6jHggsFl4fZVQBPRNgQoKiuV/odhFrGzQXZwbifC8Rg==} + engines: {node: '>=8'} + dependencies: + '@babel/code-frame': 7.22.10 + error-ex: 1.3.2 + json-parse-even-better-errors: 2.3.1 + lines-and-columns: 1.2.4 + dev: false + /path-browserify@1.0.1: resolution: {integrity: sha512-b7uo2UCUOYZcnF/3ID0lulOJi/bafxa1xPe7ZPsammBSpjSWQkjNxlt635YGS2MiR9GjvuXCtz2emr3jbsz98g==} dev: true @@ -7980,7 +8362,6 @@ packages: '@iden3/binfileutils': 0.0.11 fastfile: 0.0.20 ffjavascript: 0.2.57 - dev: true /randombytes@2.1.0: resolution: {integrity: sha512-vYl3iOX+4CKUWuxGi9Ukhie6fsqXqS9FE2Zaic4tNFD2N2QQaXOMFbuKK4QmDHC0JO6B1Zp41J0LpT0oR68amQ==} @@ -8018,6 +8399,24 @@ packages: resolution: {integrity: sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ==} dev: false + /react-is@18.2.0: + resolution: {integrity: sha512-xWGDIW6x921xtzPkhiULtthJHoJvBbF3q26fzloPCK0hsvxtPVelvftw3zjbHWSkR2km9Z+4uxbDDK/6Zw9B8w==} + dev: false + + /react-transition-group@4.4.5(react-dom@18.2.0)(react@18.2.0): + resolution: {integrity: sha512-pZcd1MCJoiKiBR2NRxeCRg13uCXbydPnmB4EOeRrY7480qNWO8IIgQG6zlDkm6uRMsURXPuKq0GWtiM59a5Q6g==} + peerDependencies: + react: '>=16.6.0' + react-dom: '>=16.6.0' + dependencies: + '@babel/runtime': 7.22.10 + dom-helpers: 5.2.1 + loose-envify: 1.4.0 + prop-types: 15.8.1 + react: 18.2.0 + react-dom: 18.2.0(react@18.2.0) + dev: false + /react-transition-state@1.1.5(react-dom@18.2.0)(react@18.2.0): resolution: {integrity: sha512-ITY2mZqc2dWG2eitJkYNdcSFW8aKeOlkL2A/vowRrLL8GH3J6Re/SpD/BLvQzrVOTqjsP0b5S9N10vgNNzwMUQ==} peerDependencies: @@ -8112,6 +8511,14 @@ packages: dependencies: picomatch: 2.3.1 + /readline@1.3.0: + resolution: {integrity: sha512-k2d6ACCkiNYz222Fs/iNze30rRJ1iIicW7JuX/7/cozvih6YCkFZH+J6mAFDVgv0dRBaAyr4jDqC95R2y4IADg==} + dev: false + + /readline@1.3.0: + resolution: {integrity: sha512-k2d6ACCkiNYz222Fs/iNze30rRJ1iIicW7JuX/7/cozvih6YCkFZH+J6mAFDVgv0dRBaAyr4jDqC95R2y4IADg==} + dev: false + /real-require@0.1.0: resolution: {integrity: sha512-r/H9MzAWtrv8aSVjPCMFpDMl5q66GqtmmRkRjpHTsp4zBAa+snZyiQNlMONiUmEJcsnaw0wCauJ2GWODr/aFkg==} engines: {node: '>= 12.13.0'} @@ -8427,7 +8834,6 @@ packages: /scrypt-js@3.0.1: resolution: {integrity: sha512-cdwTTnqPu0Hyvf5in5asVdZocVDTNRmR7XEcJuIzMjJeSHybHl7vpB66AzwTaIg6CLSbtjcxc8fqcySfnTkccA==} - dev: true /secp256k1@4.0.3: resolution: {integrity: sha512-NLZVf+ROMxwtEj3Xa562qgv2BK5e2WNmXPiOdVIPLgs6lyTzMvBq0aWTYMI5XCP9jZMVKOcqZLw/Wc4vDkuxhA==} @@ -8585,7 +8991,6 @@ packages: js-sha3: 0.8.0 logplease: 1.2.15 r1csfile: 0.0.45 - dev: true /solc@0.7.3(debug@4.3.4): resolution: {integrity: sha512-GAsWNAjGzIDg7VxzP6mPjdurby3IkGCjQcM8GFYZT6RyaoUZKmMU6Y7YwG+tFGhv7dwZ8rmR4iwFDrrD99JwqA==} @@ -8662,6 +9067,11 @@ packages: dev: true optional: true + /source-map@0.5.7: + resolution: {integrity: sha512-LbrmJOMUSdEVxIKvdcJzQC+nQhe8FUZQTXQy6+I75skNgn3OoQ0DZA8YnFa7gp8tqtL3KPf1kmo0R5DoApeSGQ==} + engines: {node: '>=0.10.0'} + dev: false + /source-map@0.6.1: resolution: {integrity: sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==} engines: {node: '>=0.10.0'} @@ -8867,7 +9277,7 @@ packages: tslib: 2.4.1 dev: false - /styled-components@5.3.11(@babel/core@7.22.10)(react-dom@18.2.0)(react-is@16.13.1)(react@18.2.0): + /styled-components@5.3.11(@babel/core@7.22.10)(react-dom@18.2.0)(react-is@18.2.0)(react@18.2.0): resolution: {integrity: sha512-uuzIIfnVkagcVHv9nE0VPlHPSCmXIUGKfJ42LNjxCCTDTL5sgnJ8Z7GZBq0EnLYGln77tPpEpExt2+qa+cZqSw==} engines: {node: '>=10'} peerDependencies: @@ -8885,7 +9295,7 @@ packages: hoist-non-react-statics: 3.3.2 react: 18.2.0 react-dom: 18.2.0(react@18.2.0) - react-is: 16.13.1 + react-is: 18.2.0 shallowequal: 1.1.0 supports-color: 5.5.0 transitivePeerDependencies: @@ -8910,6 +9320,10 @@ packages: react: 18.2.0 dev: false + /stylis@4.2.0: + resolution: {integrity: sha512-Orov6g6BB1sDfYgzWfTHDOxamtX1bE/zo104Dh9e6fqJ3PooipYyfJ0pUmrZO2wAvO8YbEyeFrkV91XTsGMSrw==} + dev: false + /sucrase@3.29.0: resolution: {integrity: sha512-bZPAuGA5SdFHuzqIhTAqt9fvNEo9rESqXIG3oiKdF8K4UmkQxC4KlNL3lVyAErXp+mPvUqZ5l13qx6TrDIGf3A==} engines: {node: '>=8'} @@ -9164,7 +9578,6 @@ packages: /tryer@1.0.1: resolution: {integrity: sha512-c3zayb8/kWWpycWYg87P71E1S1ZL6b6IJxfb5fvsUgsf0S2MVGaDhDXXjDMpdCpfWXqptc+4mXwmiy1ypXqRAA==} - dev: true /ts-command-line-args@2.5.1: resolution: {integrity: sha512-H69ZwTw3rFHb5WYpQya40YAX2/w7Ut75uUECbgBIsLmM+BNuYnxsltfyyLMxy6sEeKxgijLTnQtLd0nKd6+IYw==} @@ -9776,7 +10189,6 @@ packages: /wasmbuilder@0.0.16: resolution: {integrity: sha512-Qx3lEFqaVvp1cEYW7Bfi+ebRJrOiwz2Ieu7ZG2l7YyeSJIok/reEQCQCuicj/Y32ITIJuGIM9xZQppGx5LrQdA==} - dev: true /wasmcurves@0.0.12: resolution: {integrity: sha512-1Jl9mkatyHSNj80ILjf85SZUNuZQBCkTjJlhzqHnZQXUmIimCIWkugaVaYNjozLs1Gun4h/keZe1MBeBN0sRpg==} @@ -9796,23 +10208,19 @@ packages: resolution: {integrity: sha512-3e2rbxdujOwaod657gxgmdhZNn+i1qKdHO3Y/bK+8E7bV8ttV/fu5FO4/WLBACF375cK0QDLOP+65Na63qYuWA==} dependencies: wasmbuilder: 0.0.16 - dev: true /wasmcurves@0.2.1: resolution: {integrity: sha512-9ciO7bUE5bgpbOcdK7IO3enrSVIKHwrQmPibok4GLJWaCA7Wyqc9PRYnu5HbiFv9NDFNqVKPtU5R6Is5KujBLg==} dependencies: wasmbuilder: 0.0.16 - dev: true /wasmcurves@0.2.2: resolution: {integrity: sha512-JRY908NkmKjFl4ytnTu5ED6AwPD+8VJ9oc94kdq7h5bIwbj0L4TDJ69mG+2aLs2SoCmGfqIesMWTEJjtYsoQXQ==} dependencies: wasmbuilder: 0.0.16 - dev: true /web-worker@1.2.0: resolution: {integrity: sha512-PgF341avzqyx60neE9DD+XS26MMNMoUQRz9NOZwW32nPQrF6p77f1htcnjBSEV8BGMKZ16choqUG4hyI0Hx7mA==} - dev: true /web3-utils@1.10.0: resolution: {integrity: sha512-kSaCM0uMcZTNUSmn5vMEhlo02RObGNRRCkdX0V9UTAU0+lrvn0HSaudyCo6CQzuXUsnuY2ERJGCGPfeWmv19Rg==} @@ -9958,7 +10366,6 @@ packages: optional: true utf-8-validate: optional: true - dev: true /ws@7.5.9: resolution: {integrity: sha512-F+P9Jil7UiSKSkppIiD94dN07AwvFixvLIj1Og1Rl9GGMuNipJnV9JzjD6XuqmAeiswGvUmNLjr5cFuXwNS77Q==} diff --git a/turbo.json b/turbo.json index f601147..41ead53 100644 --- a/turbo.json +++ b/turbo.json @@ -1,14 +1,17 @@ { "$schema": "https://turbo.build/schema.json", "globalDependencies": ["**/.env.*local"], + "globalDotEnv": [".env"], "pipeline": { "build": { + "dotEnv": [".env.production.local", ".env.local", ".env.production", ".env"], "dependsOn": ["^build"], "outputs": ["dist/**", ".next/**", "!.next/cache/**"] }, "lint": {}, "check-types": {}, "dev": { + "dotEnv": [".env.development.local", ".env.local", ".env.development", ".env"], "cache": false, "persistent": true }, From b07beb1b08277b434c7a760662855e252480aacf Mon Sep 17 00:00:00 2001 From: yeeetai Date: Wed, 23 Aug 2023 01:15:32 +0800 Subject: [PATCH 2/6] feat: add contract method --- .../src/service/kamui/{ABI.json => abi.ts} | 4 +- apps/web/src/service/kamui/client.ts | 17 + apps/web/src/service/kamui/contract.ts | 110 +++++- apps/web/src/service/kamui/kamuiField.ts | 350 ------------------ apps/web/src/service/kamui/verify.ts | 13 +- 5 files changed, 125 insertions(+), 369 deletions(-) rename apps/web/src/service/kamui/{ABI.json => abi.ts} (99%) create mode 100644 apps/web/src/service/kamui/client.ts delete mode 100644 apps/web/src/service/kamui/kamuiField.ts diff --git a/apps/web/src/service/kamui/ABI.json b/apps/web/src/service/kamui/abi.ts similarity index 99% rename from apps/web/src/service/kamui/ABI.json rename to apps/web/src/service/kamui/abi.ts index 4bc2325..e5bc3f9 100644 --- a/apps/web/src/service/kamui/ABI.json +++ b/apps/web/src/service/kamui/abi.ts @@ -1,4 +1,4 @@ -[ +export const wagmiAbi = [ { "inputs": [ { @@ -344,4 +344,4 @@ "stateMutability": "view", "type": "function" } -] \ No newline at end of file +] as const \ No newline at end of file diff --git a/apps/web/src/service/kamui/client.ts b/apps/web/src/service/kamui/client.ts new file mode 100644 index 0000000..3414de5 --- /dev/null +++ b/apps/web/src/service/kamui/client.ts @@ -0,0 +1,17 @@ +import { createWalletClient, createPublicClient, http } from 'viem' +import { privateKeyToAccount } from 'viem/accounts' +import { goerli, sepolia } from 'viem/chains' + +// This is example +export const account = privateKeyToAccount('0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80') + +export const publicClient: any = createPublicClient({ + chain: sepolia, + transport: http("https://sepolia.infura.io/v3/") +}) + +export const walletClient: any = createWalletClient({ + account, + chain: sepolia, + transport: http("https://sepolia.infura.io/v3/") +}) \ No newline at end of file diff --git a/apps/web/src/service/kamui/contract.ts b/apps/web/src/service/kamui/contract.ts index dabfbd5..0eb8b96 100644 --- a/apps/web/src/service/kamui/contract.ts +++ b/apps/web/src/service/kamui/contract.ts @@ -1,18 +1,108 @@ 'use client' -import { writeContract } from 'wagmi/actions' -import { kamuiContractConfig } from './kamuiField' -import ABI from "./ABI.json" -import { BytesLike, ethers } from "ethers"; -import { zkproof } from "./verify"; -const { buildPoseidon } = require("circomlibjs"); +import { writeContract, prepareWriteContract, getNetwork } from 'wagmi/actions' +import { wagmiAbi } from './abi' +import { zkproof } from './verify' +import { publicClient, walletClient, account } from './client' +const { buildPoseidon } = require('circomlibjs') + +const contractAddress: any = { + 'Goerli': '0xCEFbaE8c6afEdC5C5e312B34fd8993EfD076d130', + 'Sepolia': '0x6385Bcd08b7478992f7f0146A114f171701a8de2' +} + +export const registerUser = async (userAddress: string, poseidonHash: string,) => { + const { chain } = getNetwork() + + const { request } = await publicClient.simulateContract({ + account, + address: contractAddress[chain!.name], + abi: wagmiAbi, + functionName: 'registerUser', + args: [userAddress, poseidonHash] + }) + await walletClient.writeContract(request) +} export const createProposal = async (name: string, endTime: number) => { - const result = await writeContract({ - address: kamuiContractConfig.address, - abi: kamuiContractConfig.abi, + const { chain } = getNetwork() + const config = await prepareWriteContract({ + address: contractAddress[chain!.name], + abi: wagmiAbi, functionName: 'createProposals', args: [name, endTime], }) -} \ No newline at end of file + await writeContract(config) +} + +export const vote = async (credentialHash: string, proposalId: number, accept: boolean) => { + const proof = await zkproof(credentialHash) + const { chain } = getNetwork() + + const config = await prepareWriteContract({ + address: contractAddress[chain!.name], + abi: wagmiAbi, + functionName: 'vote', + args: [proposalId, accept, proof], + }) + await writeContract(config) +} + +export const getResult = async (proposal: number) => { + const { chain } = getNetwork() + + const data = await readContract({ + address: contractAddress[chain!.name], + abi: wagmiAbi, + functionName: 'getResult(uint256)', + args: [proposal], + }) + return data +} + +export const getBlockTime = async () => { + const { chain } = getNetwork() + + const data = await readContract({ + address: contractAddress[chain!.name], + abi: wagmiAbi, + functionName: 'getBlockTime()', + args: [], + }) + return data +} + +export const getProposal = async (proposalId: number) => { + const { chain } = getNetwork() + const data = await readContract({ + // @ts-ignore + address: contractAddress[chain!.name], + abi: wagmiAbi, + functionName: 'proposals(uint256)', + args: [proposalId], + }) + return data +} + +export const getProposalCount = async () => { + const { chain } = getNetwork() + + const data = await readContract({ + address: contractAddress[chain!.name], + abi: abi, + functionName: 'totalProposals()', + args: [], + }) + return data +} + +export const getProposals = async () => { + let proposals = [] + const count = (await getProposalCount()) as number + for (let i = 0 ; i < count ; i++) { + const proposal = await getProposal(i) + proposals.push(proposal) + } + return proposals +} diff --git a/apps/web/src/service/kamui/kamuiField.ts b/apps/web/src/service/kamui/kamuiField.ts deleted file mode 100644 index 6bfdadd..0000000 --- a/apps/web/src/service/kamui/kamuiField.ts +++ /dev/null @@ -1,350 +0,0 @@ -export const kamuiContractConfig = { - address: '0x6385Bcd08b7478992f7f0146A114f171701a8de2', - abi: [ - { - "inputs": [ - { - "internalType": "address", - "name": "_verifierAddress", - "type": "address" - } - ], - "stateMutability": "nonpayable", - "type": "constructor" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "previousOwner", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "newOwner", - "type": "address" - } - ], - "name": "OwnershipTransferred", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "from", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "proposal", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "bool", - "name": "accept", - "type": "bool" - } - ], - "name": "Voted", - "type": "event" - }, - { - "inputs": [ - { - "internalType": "string", - "name": "name", - "type": "string" - }, - { - "internalType": "uint256", - "name": "continueSec", - "type": "uint256" - } - ], - "name": "createProposals", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "getBlockTime", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "proposal", - "type": "uint256" - } - ], - "name": "getResult", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "owner", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "name": "proposals", - "outputs": [ - { - "internalType": "string", - "name": "name", - "type": "string" - }, - { - "internalType": "address", - "name": "creater", - "type": "address" - }, - { - "internalType": "uint256", - "name": "acceptCount", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "denyCount", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "endTime", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "user", - "type": "address" - }, - { - "internalType": "uint256", - "name": "proof", - "type": "uint256" - } - ], - "name": "registerUser", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "renounceOwnership", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "totalProposals", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "newOwner", - "type": "address" - } - ], - "name": "transferOwnership", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - }, - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "name": "users", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "verifier", - "outputs": [ - { - "internalType": "contract ICircuitsVerifier", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "components": [ - { - "internalType": "uint256[2]", - "name": "a", - "type": "uint256[2]" - }, - { - "internalType": "uint256[2][2]", - "name": "b", - "type": "uint256[2][2]" - }, - { - "internalType": "uint256[2]", - "name": "c", - "type": "uint256[2]" - } - ], - "internalType": "struct KamuiField.ProofData", - "name": "proofData", - "type": "tuple" - } - ], - "name": "verifyProof", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "proposal", - "type": "uint256" - }, - { - "internalType": "bool", - "name": "accept", - "type": "bool" - }, - { - "components": [ - { - "internalType": "uint256[2]", - "name": "a", - "type": "uint256[2]" - }, - { - "internalType": "uint256[2][2]", - "name": "b", - "type": "uint256[2][2]" - }, - { - "internalType": "uint256[2]", - "name": "c", - "type": "uint256[2]" - } - ], - "internalType": "struct KamuiField.ProofData", - "name": "proofData", - "type": "tuple" - } - ], - "name": "vote", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - }, - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "name": "voters", - "outputs": [ - { - "internalType": "bool", - "name": "voted", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - } - ] -} \ No newline at end of file diff --git a/apps/web/src/service/kamui/verify.ts b/apps/web/src/service/kamui/verify.ts index e246ed2..50abefe 100644 --- a/apps/web/src/service/kamui/verify.ts +++ b/apps/web/src/service/kamui/verify.ts @@ -1,4 +1,3 @@ -import { BigNumber } from 'ethers' const { buildPoseidon } = require('circomlibjs') const { groth16 } = require('snarkjs') @@ -7,14 +6,14 @@ export async function exportSolidity({ proof, publicSignals }: any) { const tokens = rawCallData .replace(/["[\]\s]/g, "") .split(",") - .map(BigNumber.from); + .map(BigInt.from); const [a1, a2, b1, b2, b3, b4, c1, c2, ...inputs] = tokens; - const a: [BigNumber, BigNumber] = [a1, a2] ; - const b: [[BigNumber, BigNumber], [BigNumber, BigNumber]] = [ + const a: [BigInt, BigInt] = [a1, a2]; + const b: [[BigInt, BigInt], [BigInt, BigInt]] = [ [b1, b2], [b3, b4], ] - const c: [BigNumber, BigNumber] = [c1, c2] + const c: [BigInt, BigInt] = [c1, c2] return { a, b, c, inputs } @@ -35,13 +34,13 @@ export async function zkproof(credentialHash: string) { // generate VC hash const filePathWASM: string = '/circuits.wasm' const filePathZKEY: string = '/circuits.zkey' - + // issuer send this hash const poseidon = await buildPoseidon() const inputs = credentialHash const poseidonHash = poseidon.F.toString(poseidon([hexToDecimal(inputs)])) // console.log('poseidon hash:', poseidonHash) - + const circuitInputs = { value: `0x${inputs}`, hash: poseidonHash, From d0baae55d41db15cd0cc8bba519cc8292b8b4b7b Mon Sep 17 00:00:00 2001 From: yeeetai Date: Wed, 23 Aug 2023 01:52:16 +0800 Subject: [PATCH 3/6] feat: add proposal card --- apps/web/src/app/vote/page.tsx | 186 +++++++++++------- apps/web/src/components/Card/ProposalCard.tsx | 135 +++++++++++++ .../src/components/Countdown/Countdown.tsx | 63 ++++++ .../components/Countdown/SmallCountdown.tsx | 46 +++++ apps/web/src/service/kamui/contract.ts | 31 ++- apps/web/src/service/kamui/verify.ts | 9 +- 6 files changed, 374 insertions(+), 96 deletions(-) create mode 100644 apps/web/src/components/Card/ProposalCard.tsx create mode 100644 apps/web/src/components/Countdown/Countdown.tsx create mode 100644 apps/web/src/components/Countdown/SmallCountdown.tsx diff --git a/apps/web/src/app/vote/page.tsx b/apps/web/src/app/vote/page.tsx index 0db71e8..1cd985b 100644 --- a/apps/web/src/app/vote/page.tsx +++ b/apps/web/src/app/vote/page.tsx @@ -7,10 +7,13 @@ import VerifyProof from '../../components/ZK/VerifyProof' import CreateProposal from '../../components/Contract/CreateProposal' import ProcessLoading from '../../components/Loading/ProcessLoading' import KamuiLoading from '../../components/Loading/KamuiLoading' +import { getProposals } from '../../service/kamui/contract' import { LocalizationProvider } from '@mui/x-date-pickers' import { AdapterDayjs } from '@mui/x-date-pickers/AdapterDayjs' import { useEffect, useState } from 'react' import { useAccount } from 'wagmi' +import dayjs from "dayjs"; +import ProposalCard from "../../components/Card/ProposalCard"; export default function Vote() { const [isLoading, setIsLoading] = useState(false); @@ -24,19 +27,21 @@ export default function Vote() { const [isVerified, setVerified] = useState(false) const [imgSrc, setImgSrc] = useState(null) const [copied, setCopied] = useState(false) + const [proposals, setProposals] = useState([]); + const [proposalStatus, setProposalStatus] = useState("init") + const [credentialHash, setCredentialHash] = useState(""); const openCaptureDialog = async () => { setIsCaptureDialogOpen(!isCaptureDialogOpen); - }; - + }; + const openGenProofDialog = async () => { setIsGenProofDialogOpen(!isGenProofDialogOpen); }; - + const openVerifyDialog = async () => { setIsVerifyDialogOpen(!isVerifyDialogOpen); }; - const openCreateProposalDialog = async () => { setIsCreateProposalDialogOpen(!isCreateProposalDialogOpen) @@ -57,46 +62,52 @@ export default function Vote() { } }, [address, isConnected]) + useEffect(() => { + getProposals().then((res) => { + setProposals(res); + }); + }, []); + return ( -
-
-
-
-

- Account Status -

- {isVerified - ?
Verified
- :
Unverified
- } -
-
-
- 1. Capture your face for KYC -
-
Capture face
-
+
+
+
+
+

+ Account Status +

+ {isVerified + ?
Verified
+ :
Unverified
+ }
-
- 2. Check your face to generate proof -
- { - imgSrc - ?
Generate Proof
- :
Need to capture face first
- } +
+
+ 1. Capture your face for KYC +
+
Capture face
+
-
-
- 3. Input Proof to KYC -
-
Verify Proof
+
+ 2. Check your face to generate proof +
+ { + imgSrc + ?
Generate Proof
+ :
Need to capture face first
+ } +
+
+
+ 3. Input Proof to KYC +
+
Verify Proof
+
-
-
+

@@ -113,48 +124,71 @@ export default function Vote() {

-
- setIsCaptureDialogOpen(false)} - title={'Capture Face'} - > - setIsCaptureDialogOpen(false)} /> - - setIsGenProofDialogOpen(false)} - title={'Generate proof'} - > - setIsGenProofDialogOpen(false)} /> - - setIsVerifyDialogOpen(false)} - title={'Verify proof'} - > - setIsVerifyDialogOpen(false)} /> - - setIsCreateProposalDialogOpen(false)} - title={'New Proposal'} - > - setIsCreateProposalDialogOpen(false)} /> - - {isLoading && } - {isKamuiLoading && } - { - copied && -
-
- Copied to clipboard +
+ {proposals.map((proposal: any, index: number) => { + let status = "Open" + if (Date.now().valueOf() > new Date(dayjs.unix(proposal.endTime).format("MM/DD/YYYY HH:mm:ss")).valueOf()) { + status = "Closed" + } + if (proposalStatus === status || proposalStatus === "All" || proposalStatus === "init") { + return ( + + ); + } + })}
- } -
+ setIsCaptureDialogOpen(false)} + title={'Capture Face'} + > + setIsCaptureDialogOpen(false)} /> + + setIsGenProofDialogOpen(false)} + title={'Generate proof'} + > + setIsGenProofDialogOpen(false)} /> + + setIsVerifyDialogOpen(false)} + title={'Verify proof'} + > + setIsVerifyDialogOpen(false)} /> + + setIsCreateProposalDialogOpen(false)} + title={'New Proposal'} + > + setIsCreateProposalDialogOpen(false)} /> + + {isLoading && } + {isKamuiLoading && } + { + copied && +
+
+ Copied to clipboard +
+
+ } +
-
+
) diff --git a/apps/web/src/components/Card/ProposalCard.tsx b/apps/web/src/components/Card/ProposalCard.tsx new file mode 100644 index 0000000..fd275a6 --- /dev/null +++ b/apps/web/src/components/Card/ProposalCard.tsx @@ -0,0 +1,135 @@ +import { useRouter } from "next/router"; +import { vote } from "../../service/kamui/contract"; +import SmallCountdown from "../Countdown/SmallCountdown"; +import { useEffect } from "react"; +import dayjs from "dayjs"; + +export interface ProposalCard { + proposalId: number, + proposalBody: string, + acceptCount: any, + denyCount: any, + creater: string, + endTime: any, + credentialHash: string + status: string +} + +const ProposalCard = (props: ProposalCard) => { + const router = useRouter(); + function handleClick() { + router.push({ + pathname: "/card", + query: { + proposalId: props.proposalId, + proposalBody: props.proposalBody, + acceptCount: props.acceptCount.toString(), + denyCount: props.denyCount.toString(), + creater: props.creater, + endTime: props.endTime.toString(), + credentialHash: props.credentialHash, + status: props.status, + }, + }); + } + + function calPercentage(): number | string { + if (props.denyCount._hex === "0x00" && props.acceptCount._hex === "0x00") + return "no vote"; + if (props.acceptCount._hex === "0x00" || undefined) return 100; + if (props.denyCount._hex === "0x00" || undefined) return 0; + const result = roundToTwoDecimalPlaces( + (Number(props.denyCount.toString()) / + (Number(props.acceptCount.toString()) + + Number(props.denyCount.toString()))) * + 100 + ); + return result; + } + + function roundToTwoDecimalPlaces(num: number): number { + return Number(Number(num.toFixed(3)).toFixed(2)); + } + + function handleAccept(e: any) { + vote(props.credentialHash, props.proposalId, true); + e.stopPropagation(); + } + + function handleDeny(e: any) { + vote(props.credentialHash, props.proposalId, false); + e.stopPropagation(); + } + + return ( +
+
+
+

{`VOTE # ${props.proposalId + 1}`}

+ {props.status === "Closed" ? ( + Proposal Ended + ) : ( + + )} +
+

{props.proposalBody}

+
+

Yes

+

{`${calPercentage() === "no vote" ? 0 : 100 - Number(calPercentage())}%`}

+
+ +
+

No

+

{`${calPercentage() === "no vote" ? 0 : calPercentage()}%`}

+
+ +
+ {props.status === "Closed" ? ( + <> + + + + ) : ( + <> + + + + )} +
+
+
+ ); +} + +export default ProposalCard \ No newline at end of file diff --git a/apps/web/src/components/Countdown/Countdown.tsx b/apps/web/src/components/Countdown/Countdown.tsx new file mode 100644 index 0000000..4ea2806 --- /dev/null +++ b/apps/web/src/components/Countdown/Countdown.tsx @@ -0,0 +1,63 @@ +import { useState, useEffect } from "react"; +import dayjs from "dayjs"; + +export default function Countdown(props: any) { + + const [days, setDays] = useState(0); + const [hours, setHours] = useState(0); + const [mins, setMins] = useState(0); + const [secs, setSecs] = useState(0); + + useEffect(() => { + const target = new Date(dayjs.unix(props.endTime).format("MM/DD/YYYY HH:mm:ss")); + const interval = setInterval(() => { + const now = new Date() + const difference = target.getTime() - now.getTime() + + const day = Math.floor(difference / (1000 * 60 * 60 * 24)) + setDays(day) + + const hour = Math.floor((difference % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60)) + setHours(hour) + + const min = Math.floor((difference % (1000 * 60 * 60)) / (1000 * 60)) + setMins(min) + + const sec = Math.floor((difference % (1000 * 60)) / 1000) + setSecs(sec) + }, 1000); + + return () => { clearInterval(interval) } + }, []) + + + return ( +
+
+ + {/* */} + + + days +
+
+ + + + hours +
+
+ + + + min +
+
+ + + + sec +
+
+ ); +} diff --git a/apps/web/src/components/Countdown/SmallCountdown.tsx b/apps/web/src/components/Countdown/SmallCountdown.tsx new file mode 100644 index 0000000..5fbc94b --- /dev/null +++ b/apps/web/src/components/Countdown/SmallCountdown.tsx @@ -0,0 +1,46 @@ +import { useState, useEffect } from "react"; +import dayjs from "dayjs"; + +export default function SmallCountdown(props: any) { + const [days, setDays] = useState(0); + const [hours, setHours] = useState(0); + const [mins, setMins] = useState(0); + const [secs, setSecs] = useState(0); + + useEffect(() => { + // const target = new Date("8/10/2023 20:00:00"); + + const target = new Date(dayjs.unix(props.endTime).format("MM/DD/YYYY HH:mm:ss")); + const interval = setInterval(() => { + const now = new Date(); + const difference = target.getTime() - now.getTime(); + + const day = Math.floor(difference / (1000 * 60 * 60 * 24)); + setDays(day); + + const hour = Math.floor( + (difference % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60) + ); + setHours(hour); + + const min = Math.floor((difference % (1000 * 60 * 60)) / (1000 * 60)); + setMins(min); + + const sec = Math.floor((difference % (1000 * 60)) / 1000); + setSecs(sec); + }, 1000); + + return () => { + clearInterval(interval); + }; + }, []); + + return ( + + d + h + m + s + + ); +} diff --git a/apps/web/src/service/kamui/contract.ts b/apps/web/src/service/kamui/contract.ts index 0eb8b96..e85e091 100644 --- a/apps/web/src/service/kamui/contract.ts +++ b/apps/web/src/service/kamui/contract.ts @@ -1,6 +1,6 @@ 'use client' -import { writeContract, prepareWriteContract, getNetwork } from 'wagmi/actions' +import { writeContract, prepareWriteContract, getNetwork, readContract } from 'wagmi/actions' import { wagmiAbi } from './abi' import { zkproof } from './verify' import { publicClient, walletClient, account } from './client' @@ -27,35 +27,35 @@ export const registerUser = async (userAddress: string, poseidonHash: string,) = export const createProposal = async (name: string, endTime: number) => { const { chain } = getNetwork() - const config = await prepareWriteContract({ + const { request } = await prepareWriteContract({ address: contractAddress[chain!.name], abi: wagmiAbi, functionName: 'createProposals', args: [name, endTime], }) - await writeContract(config) + await writeContract(request) } export const vote = async (credentialHash: string, proposalId: number, accept: boolean) => { const proof = await zkproof(credentialHash) const { chain } = getNetwork() - const config = await prepareWriteContract({ + const { request } = await prepareWriteContract({ address: contractAddress[chain!.name], abi: wagmiAbi, functionName: 'vote', args: [proposalId, accept, proof], }) - await writeContract(config) + await writeContract(request) } -export const getResult = async (proposal: number) => { +export const getResult = async (proposal: bigint) => { const { chain } = getNetwork() const data = await readContract({ address: contractAddress[chain!.name], abi: wagmiAbi, - functionName: 'getResult(uint256)', + functionName: 'getResult', args: [proposal], }) return data @@ -67,20 +67,20 @@ export const getBlockTime = async () => { const data = await readContract({ address: contractAddress[chain!.name], abi: wagmiAbi, - functionName: 'getBlockTime()', - args: [], + functionName: 'getBlockTime', }) return data } export const getProposal = async (proposalId: number) => { const { chain } = getNetwork() + console.log(proposalId) const data = await readContract({ // @ts-ignore address: contractAddress[chain!.name], abi: wagmiAbi, - functionName: 'proposals(uint256)', - args: [proposalId], + functionName: 'proposals', + args: [BigInt(proposalId)], }) return data } @@ -90,17 +90,16 @@ export const getProposalCount = async () => { const data = await readContract({ address: contractAddress[chain!.name], - abi: abi, - functionName: 'totalProposals()', - args: [], + abi: wagmiAbi, + functionName: 'totalProposals', }) return data } export const getProposals = async () => { let proposals = [] - const count = (await getProposalCount()) as number - for (let i = 0 ; i < count ; i++) { + const count = Number(await getProposalCount()) + for (let i = 0; i < count; i++) { const proposal = await getProposal(i) proposals.push(proposal) } diff --git a/apps/web/src/service/kamui/verify.ts b/apps/web/src/service/kamui/verify.ts index 50abefe..1c1528e 100644 --- a/apps/web/src/service/kamui/verify.ts +++ b/apps/web/src/service/kamui/verify.ts @@ -1,3 +1,4 @@ +import { BigNumber } from 'ethers' const { buildPoseidon } = require('circomlibjs') const { groth16 } = require('snarkjs') @@ -6,14 +7,14 @@ export async function exportSolidity({ proof, publicSignals }: any) { const tokens = rawCallData .replace(/["[\]\s]/g, "") .split(",") - .map(BigInt.from); + .map(BigNumber.from); const [a1, a2, b1, b2, b3, b4, c1, c2, ...inputs] = tokens; - const a: [BigInt, BigInt] = [a1, a2]; - const b: [[BigInt, BigInt], [BigInt, BigInt]] = [ + const a: [BigNumber, BigNumber] = [a1, a2]; + const b: [[BigNumber, BigNumber], [BigNumber, BigNumber]] = [ [b1, b2], [b3, b4], ] - const c: [BigInt, BigInt] = [c1, c2] + const c: [BigNumber, BigNumber] = [c1, c2] return { a, b, c, inputs } From e67c95a705c6856b5f2a853eb3e84d5dcbcf9448 Mon Sep 17 00:00:00 2001 From: yeeetai Date: Wed, 23 Aug 2023 02:22:53 +0800 Subject: [PATCH 4/6] feat: add content to proposal card from evm --- apps/web/src/app/vote/page.tsx | 13 +++--- apps/web/src/components/Card/ProposalCard.tsx | 35 +++++++-------- apps/web/src/service/kamui/abi.ts | 2 +- apps/web/src/service/kamui/contract.ts | 4 +- packages/zk-circuits/contracts/KamuiField.sol | 45 ++++++++++--------- 5 files changed, 51 insertions(+), 48 deletions(-) diff --git a/apps/web/src/app/vote/page.tsx b/apps/web/src/app/vote/page.tsx index 1cd985b..dba1abe 100644 --- a/apps/web/src/app/vote/page.tsx +++ b/apps/web/src/app/vote/page.tsx @@ -126,19 +126,20 @@ export default function Vote() {
{proposals.map((proposal: any, index: number) => { + const [name, creator, acceptCount, denyCount, endTime] = proposal let status = "Open" - if (Date.now().valueOf() > new Date(dayjs.unix(proposal.endTime).format("MM/DD/YYYY HH:mm:ss")).valueOf()) { + if (Date.now().valueOf() > new Date(dayjs.unix(Number(proposal.endTime)).format("MM/DD/YYYY HH:mm:ss")).valueOf()) { status = "Closed" } if (proposalStatus === status || proposalStatus === "All" || proposalStatus === "init") { return ( { - const router = useRouter(); - function handleClick() { - router.push({ - pathname: "/card", - query: { - proposalId: props.proposalId, - proposalBody: props.proposalBody, - acceptCount: props.acceptCount.toString(), - denyCount: props.denyCount.toString(), - creater: props.creater, - endTime: props.endTime.toString(), - credentialHash: props.credentialHash, - status: props.status, - }, - }); - } + // const router = useRouter(); + // function handleClick() { + // router.push({ + // pathname: "/card", + // query: { + // proposalId: props.proposalId, + // proposalBody: props.proposalBody, + // acceptCount: props.acceptCount.toString(), + // denyCount: props.denyCount.toString(), + // creator: props.creator, + // endTime: props.endTime.toString(), + // credentialHash: props.credentialHash, + // status: props.status, + // }, + // }); + // } function calPercentage(): number | string { if (props.denyCount._hex === "0x00" && props.acceptCount._hex === "0x00") @@ -64,7 +64,6 @@ const ProposalCard = (props: ProposalCard) => { return (
diff --git a/apps/web/src/service/kamui/abi.ts b/apps/web/src/service/kamui/abi.ts index e5bc3f9..bc5f618 100644 --- a/apps/web/src/service/kamui/abi.ts +++ b/apps/web/src/service/kamui/abi.ts @@ -134,7 +134,7 @@ export const wagmiAbi = [ }, { "internalType": "address", - "name": "creater", + "name": "creator", "type": "address" }, { diff --git a/apps/web/src/service/kamui/contract.ts b/apps/web/src/service/kamui/contract.ts index e85e091..ad5ca74 100644 --- a/apps/web/src/service/kamui/contract.ts +++ b/apps/web/src/service/kamui/contract.ts @@ -4,6 +4,7 @@ import { writeContract, prepareWriteContract, getNetwork, readContract } from 'w import { wagmiAbi } from './abi' import { zkproof } from './verify' import { publicClient, walletClient, account } from './client' +import { copyFileSync } from 'fs' const { buildPoseidon } = require('circomlibjs') @@ -74,14 +75,13 @@ export const getBlockTime = async () => { export const getProposal = async (proposalId: number) => { const { chain } = getNetwork() - console.log(proposalId) const data = await readContract({ - // @ts-ignore address: contractAddress[chain!.name], abi: wagmiAbi, functionName: 'proposals', args: [BigInt(proposalId)], }) + console.log() return data } diff --git a/packages/zk-circuits/contracts/KamuiField.sol b/packages/zk-circuits/contracts/KamuiField.sol index c68612d..a8049fc 100644 --- a/packages/zk-circuits/contracts/KamuiField.sol +++ b/packages/zk-circuits/contracts/KamuiField.sol @@ -12,7 +12,7 @@ contract KamuiField is Ownable { struct Proposal { string name; - address creater; + address creator; uint acceptCount; uint denyCount; uint256 endTime; @@ -36,19 +36,23 @@ contract KamuiField is Ownable { mapping(uint256 => Proposal) public proposals; - mapping(address => uint[1]) public users; + mapping(address => uint[1]) public users; uint public totalProposals = 0; - - function createProposals (string calldata name, uint256 continueSec) public{ + + function createProposals(string calldata name, uint256 continueSec) public { Proposal storage poll = proposals[totalProposals]; - poll.creater = msg.sender; + poll.creator = msg.sender; poll.name = name; poll.endTime = block.timestamp + continueSec; totalProposals += 1; } - function vote(uint256 proposal, bool accept, ProofData memory proofData) public { + function vote( + uint256 proposal, + bool accept, + ProofData memory proofData + ) public { require(verifyProof(proofData), "Verification Failed"); Voter storage sender = voters[msg.sender][proposal]; require(block.timestamp < proposals[proposal].endTime, "Vote End"); @@ -59,25 +63,24 @@ contract KamuiField is Ownable { emit Voted(msg.sender, proposal, accept); } - function getResult (uint256 proposal) public view returns (bool) { + function getResult(uint256 proposal) public view returns (bool) { require(block.timestamp > proposals[proposal].endTime, "Vote Not End"); - if(proposals[proposal].acceptCount > proposals[proposal].denyCount) return true; + if (proposals[proposal].acceptCount > proposals[proposal].denyCount) + return true; else return false; - } + } - function getBlockTime () public view returns(uint256) { + function getBlockTime() public view returns (uint256) { return block.timestamp; - } + } - function verifyProof(ProofData memory proofData) public view returns (bool) { - return verifier.verifyProof( - proofData.a, - proofData.b, - proofData.c - ); - } + function verifyProof( + ProofData memory proofData + ) public view returns (bool) { + return verifier.verifyProof(proofData.a, proofData.b, proofData.c); + } - function registerUser (address user, uint proof) public onlyOwner { + function registerUser(address user, uint proof) public onlyOwner { users[user] = [proof]; - } -} \ No newline at end of file + } +} From 7adc5cc9575c017185cf3a0d254d73aab64d4615 Mon Sep 17 00:00:00 2001 From: ericli Date: Wed, 23 Aug 2023 15:56:04 +0800 Subject: [PATCH 5/6] fix: proposal card format --- apps/web/package.json | 8 +++---- apps/web/src/app/vote/page.tsx | 12 +++++----- apps/web/src/components/Card/ProposalCard.tsx | 13 +++++------ apps/web/src/components/ZK/GenerateProof.tsx | 16 +++++++++++++- apps/web/src/service/kamui/client.ts | 6 ++--- apps/web/src/service/kamui/contract.ts | 16 +++++++------- .../cache/solidity-files-cache.json | 4 ++-- .../scripts/address/sepolia/KamuiField.json | 2 +- pnpm-lock.yaml | 22 +++++++++++++------ turbo.json | 5 +++++ 10 files changed, 65 insertions(+), 39 deletions(-) diff --git a/apps/web/package.json b/apps/web/package.json index 182c6cc..af14e50 100644 --- a/apps/web/package.json +++ b/apps/web/package.json @@ -13,18 +13,18 @@ "@emotion/styled": "^11.11.0", "@mui/material": "^5.14.5", "@mui/x-date-pickers": "^6.11.2", + "circomlibjs": "^0.1.7", "connectkit": "^1.5.1", "dayjs": "^1.11.9", + "ethers": "^5.7.2", "helper": "workspace:*", "next": "^13.4.1", "react": "^18.2.0", "react-dom": "^18.2.0", "react-webcam": "^7.1.1", - "ui": "workspace:*", - "snarkjs": "^0.7.0", "readline": "^1.3.0", - "circomlibjs": "^0.1.7", - "ethers": "^5.7.2", + "snarkjs": "^0.7.0", + "ui": "workspace:*", "viem": "^1.6.0", "wagmi": "^1.3.10" }, diff --git a/apps/web/src/app/vote/page.tsx b/apps/web/src/app/vote/page.tsx index dba1abe..457191b 100644 --- a/apps/web/src/app/vote/page.tsx +++ b/apps/web/src/app/vote/page.tsx @@ -12,8 +12,8 @@ import { LocalizationProvider } from '@mui/x-date-pickers' import { AdapterDayjs } from '@mui/x-date-pickers/AdapterDayjs' import { useEffect, useState } from 'react' import { useAccount } from 'wagmi' -import dayjs from "dayjs"; import ProposalCard from "../../components/Card/ProposalCard"; +import dayjs from "dayjs"; export default function Vote() { const [isLoading, setIsLoading] = useState(false); @@ -61,7 +61,7 @@ export default function Vote() { setMounted(false) } }, [address, isConnected]) - + useEffect(() => { getProposals().then((res) => { setProposals(res); @@ -128,7 +128,7 @@ export default function Vote() { {proposals.map((proposal: any, index: number) => { const [name, creator, acceptCount, denyCount, endTime] = proposal let status = "Open" - if (Date.now().valueOf() > new Date(dayjs.unix(Number(proposal.endTime)).format("MM/DD/YYYY HH:mm:ss")).valueOf()) { + if (Date.now().valueOf() > new Date(dayjs.unix(Number(endTime)).format("MM/DD/YYYY HH:mm:ss")).valueOf()) { status = "Closed" } if (proposalStatus === status || proposalStatus === "All" || proposalStatus === "init") { @@ -137,9 +137,9 @@ export default function Vote() { proposalId={index} creator={creator} proposalBody={name} - acceptCount={acceptCount} - denyCount={denyCount} - endTime={Number(proposal.endTime)} + acceptCount={Number(acceptCount)} + denyCount={Number(denyCount)} + endTime={Number(endTime)} credentialHash={credentialHash} status={status} key={index} diff --git a/apps/web/src/components/Card/ProposalCard.tsx b/apps/web/src/components/Card/ProposalCard.tsx index 215f859..f674968 100644 --- a/apps/web/src/components/Card/ProposalCard.tsx +++ b/apps/web/src/components/Card/ProposalCard.tsx @@ -34,10 +34,10 @@ const ProposalCard = (props: ProposalCard) => { // } function calPercentage(): number | string { - if (props.denyCount._hex === "0x00" && props.acceptCount._hex === "0x00") + if (props.denyCount === 0 && props.acceptCount === 0) return "no vote"; - if (props.acceptCount._hex === "0x00" || undefined) return 100; - if (props.denyCount._hex === "0x00" || undefined) return 0; + if (props.acceptCount === 0 || undefined) return 100; + if (props.denyCount === 0 || undefined) return 0; const result = roundToTwoDecimalPlaces( (Number(props.denyCount.toString()) / (Number(props.acceptCount.toString()) + @@ -60,10 +60,9 @@ const ProposalCard = (props: ProposalCard) => { vote(props.credentialHash, props.proposalId, false); e.stopPropagation(); } - return (
@@ -80,7 +79,7 @@ const ProposalCard = (props: ProposalCard) => {

{`${calPercentage() === "no vote" ? 0 : 100 - Number(calPercentage())}%`}

@@ -89,7 +88,7 @@ const ProposalCard = (props: ProposalCard) => {

{`${calPercentage() === "no vote" ? 0 : calPercentage()}%`}

diff --git a/apps/web/src/components/ZK/GenerateProof.tsx b/apps/web/src/components/ZK/GenerateProof.tsx index bc654d3..f1f2f4b 100644 --- a/apps/web/src/components/ZK/GenerateProof.tsx +++ b/apps/web/src/components/ZK/GenerateProof.tsx @@ -11,14 +11,28 @@ export interface GenerateProofProps { onClose: any } +const handleProcess2GrayScale = async (imgSrc : any): Promise => { + const base64WithoutHeader = imgSrc.replace(/^data:image\/\w+;base64,/, '') + const binaryString = atob(base64WithoutHeader); + const bytes = new Uint8Array(binaryString.length); + for (let i = 0; i < binaryString.length; i++) { + bytes[i] = binaryString.charCodeAt(i); + } + + return bytes.buffer +} + + const GenerateProof = ({ imgSrc, handleCopyClick, setIsLoading, onClose }: GenerateProofProps) => { const [isCopied, setCopied] = useState(false); const [proof, setProof] = useState(null) const { address, isConnected } = useAccount() - + const [grayScaleBase64, setGrayScaleBase64] = useState(''); const genProof = async () => { setIsLoading(true) + const result = await handleProcess2GrayScale(imgSrc) + console.log(result) await sleep(2000) setIsLoading(false) setProof(address) diff --git a/apps/web/src/service/kamui/client.ts b/apps/web/src/service/kamui/client.ts index 3414de5..5cde890 100644 --- a/apps/web/src/service/kamui/client.ts +++ b/apps/web/src/service/kamui/client.ts @@ -3,15 +3,15 @@ import { privateKeyToAccount } from 'viem/accounts' import { goerli, sepolia } from 'viem/chains' // This is example -export const account = privateKeyToAccount('0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80') +export const account = privateKeyToAccount(`0x${process.env.NEXT_PUBLIC_PRIVATE_KEY}`) export const publicClient: any = createPublicClient({ chain: sepolia, - transport: http("https://sepolia.infura.io/v3/") + transport: http(`https://sepolia.infura.io/v3/${process.env.NEXT_PUBLIC_INFURA_API_KEY}`) }) export const walletClient: any = createWalletClient({ account, chain: sepolia, - transport: http("https://sepolia.infura.io/v3/") + transport: http(`https://sepolia.infura.io/v3/${process.env.NEXT_PUBLIC_INFURA_API_KEY}`) }) \ No newline at end of file diff --git a/apps/web/src/service/kamui/contract.ts b/apps/web/src/service/kamui/contract.ts index ad5ca74..0e7d96f 100644 --- a/apps/web/src/service/kamui/contract.ts +++ b/apps/web/src/service/kamui/contract.ts @@ -1,6 +1,6 @@ 'use client' -import { writeContract, prepareWriteContract, getNetwork, readContract } from 'wagmi/actions' +import { writeContract, prepareWriteContract, getNetwork } from 'wagmi/actions' import { wagmiAbi } from './abi' import { zkproof } from './verify' import { publicClient, walletClient, account } from './client' @@ -9,8 +9,8 @@ import { copyFileSync } from 'fs' const { buildPoseidon } = require('circomlibjs') const contractAddress: any = { - 'Goerli': '0xCEFbaE8c6afEdC5C5e312B34fd8993EfD076d130', - 'Sepolia': '0x6385Bcd08b7478992f7f0146A114f171701a8de2' + 'Goerli': '0x6385Bcd08b7478992f7f0146A114f171701a8de2', + 'Sepolia': process.env.NEXT_PUBLIC_SEPOLIA_CONTRACT } export const registerUser = async (userAddress: string, poseidonHash: string,) => { @@ -28,6 +28,7 @@ export const registerUser = async (userAddress: string, poseidonHash: string,) = export const createProposal = async (name: string, endTime: number) => { const { chain } = getNetwork() + console.log(name, endTime) const { request } = await prepareWriteContract({ address: contractAddress[chain!.name], abi: wagmiAbi, @@ -53,7 +54,7 @@ export const vote = async (credentialHash: string, proposalId: number, accept: b export const getResult = async (proposal: bigint) => { const { chain } = getNetwork() - const data = await readContract({ + const data = await publicClient.readContract({ address: contractAddress[chain!.name], abi: wagmiAbi, functionName: 'getResult', @@ -65,7 +66,7 @@ export const getResult = async (proposal: bigint) => { export const getBlockTime = async () => { const { chain } = getNetwork() - const data = await readContract({ + const data = await publicClient.readContract({ address: contractAddress[chain!.name], abi: wagmiAbi, functionName: 'getBlockTime', @@ -75,20 +76,19 @@ export const getBlockTime = async () => { export const getProposal = async (proposalId: number) => { const { chain } = getNetwork() - const data = await readContract({ + const data = await publicClient.readContract({ address: contractAddress[chain!.name], abi: wagmiAbi, functionName: 'proposals', args: [BigInt(proposalId)], }) - console.log() return data } export const getProposalCount = async () => { const { chain } = getNetwork() - const data = await readContract({ + const data = await publicClient.readContract({ address: contractAddress[chain!.name], abi: wagmiAbi, functionName: 'totalProposals', diff --git a/packages/zk-circuits/cache/solidity-files-cache.json b/packages/zk-circuits/cache/solidity-files-cache.json index 2dfaad1..7be3cfd 100644 --- a/packages/zk-circuits/cache/solidity-files-cache.json +++ b/packages/zk-circuits/cache/solidity-files-cache.json @@ -38,8 +38,8 @@ ] }, "/Users/cfh00890942/Workspace/hackathon/tobi/tobi/packages/zk-circuits/contracts/KamuiField.sol": { - "lastModificationDate": 1692683300525, - "contentHash": "b49d12f052507f42b5d15edf027903c3", + "lastModificationDate": 1692752824894, + "contentHash": "12e0626f9056032498d5f49396604050", "sourceName": "contracts/KamuiField.sol", "solcConfig": { "version": "0.8.18", diff --git a/packages/zk-circuits/scripts/address/sepolia/KamuiField.json b/packages/zk-circuits/scripts/address/sepolia/KamuiField.json index 2d40b35..0cf0f19 100644 --- a/packages/zk-circuits/scripts/address/sepolia/KamuiField.json +++ b/packages/zk-circuits/scripts/address/sepolia/KamuiField.json @@ -1 +1 @@ -{"main":"0x6385Bcd08b7478992f7f0146A114f171701a8de2"} \ No newline at end of file +{"main":"0xfC0A4C89D8B94ea81654DaEd99E3C40Ae51fb5d6"} \ No newline at end of file diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index cb604a4..b417866 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -1215,7 +1215,7 @@ packages: dependencies: '@types/debug': 4.1.8 debug: 4.3.4(supports-color@8.1.1) - semver: 7.3.8 + semver: 7.5.4 superstruct: 1.0.3 transitivePeerDependencies: - supports-color @@ -2825,9 +2825,9 @@ packages: debug: 4.3.4(supports-color@8.1.1) globby: 11.1.0 is-glob: 4.0.3 - semver: 7.3.8 - tsutils: 3.21.0(typescript@5.1.6) - typescript: 5.1.6 + semver: 7.5.4 + tsutils: 3.21.0(typescript@5.0.4) + typescript: 5.0.4 transitivePeerDependencies: - supports-color dev: false @@ -5371,7 +5371,7 @@ packages: jsx-ast-utils: 3.3.3 language-tags: 1.0.5 minimatch: 3.1.2 - semver: 6.3.0 + semver: 6.3.1 dev: false /eslint-plugin-react-hooks@4.6.0(eslint@7.32.0): @@ -5426,7 +5426,7 @@ packages: object.values: 1.1.6 prop-types: 15.8.1 resolve: 2.0.0-next.4 - semver: 6.3.0 + semver: 6.3.1 string.prototype.matchall: 4.0.8 dev: false @@ -8702,6 +8702,7 @@ packages: /rimraf@3.0.2: resolution: {integrity: sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==} + hasBin: true dependencies: glob: 7.2.3 @@ -8865,6 +8866,13 @@ packages: dependencies: lru-cache: 6.0.0 + /semver@7.5.4: + resolution: {integrity: sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==} + engines: {node: '>=10'} + hasBin: true + dependencies: + lru-cache: 6.0.0 + /serialize-javascript@5.0.1: resolution: {integrity: sha512-SaaNal9imEO737H2c05Og0/8LUXG7EnsZyMa8MzkmuHoELfT6txuj0cMqRj6zfPKnmQ1yasR4PCJc8x+M4JSPA==} dependencies: @@ -9034,7 +9042,7 @@ packages: pify: 4.0.1 recursive-readdir: 2.2.3 sc-istanbul: 0.4.6 - semver: 7.3.8 + semver: 7.5.4 shelljs: 0.8.5 web3-utils: 1.10.0 transitivePeerDependencies: diff --git a/turbo.json b/turbo.json index 41ead53..69e72fc 100644 --- a/turbo.json +++ b/turbo.json @@ -2,6 +2,11 @@ "$schema": "https://turbo.build/schema.json", "globalDependencies": ["**/.env.*local"], "globalDotEnv": [".env"], + "globalEnv": [ + "NEXT_PUBLIC_PRIVATE_KEY", + "NEXT_PUBLIC_INFURA_API_KEY", + "NEXT_PUBLIC_SEPOLIA_CONTRACT" + ], "pipeline": { "build": { "dotEnv": [".env.production.local", ".env.local", ".env.production", ".env"], From b8c003acf0af3d8c70d0c70d727abbd10781ed56 Mon Sep 17 00:00:00 2001 From: ericli Date: Wed, 23 Aug 2023 16:14:04 +0800 Subject: [PATCH 6/6] fix: pnpm lock file --- pnpm-lock.yaml | 79 +++++++++++++++++++++++++------------------------- 1 file changed, 39 insertions(+), 40 deletions(-) diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index b417866..1805047 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -184,7 +184,7 @@ importers: devDependencies: tsup: specifier: ^6.1.3 - version: 6.5.0(postcss@8.4.20)(typescript@5.0.4) + version: 6.5.0(typescript@5.0.4) typescript: specifier: ^5.0.4 version: 5.0.4 @@ -669,36 +669,6 @@ packages: resolution: {integrity: sha512-gJB6HLm5rYwSLI6PQa+X1t5CFGrv1J1TWG+sOyMCeKz2ojaj6Fnl/rZEspogG+cvqbt4AE/2eIyD2QfLKTBNlQ==} dev: false - /@emotion/babel-plugin@11.11.0: - resolution: {integrity: sha512-m4HEDZleaaCH+XgDDsPF15Ht6wTLsgDTeR3WYj9Q/k76JtWhrJjcP4+/XlG8LGT/Rol9qUfOIztXeA84ATpqPQ==} - dependencies: - '@babel/helper-module-imports': 7.22.5 - '@babel/runtime': 7.22.10 - '@emotion/hash': 0.9.1 - '@emotion/memoize': 0.8.1 - '@emotion/serialize': 1.1.2 - babel-plugin-macros: 3.1.0 - convert-source-map: 1.9.0 - escape-string-regexp: 4.0.0 - find-root: 1.1.0 - source-map: 0.5.7 - stylis: 4.2.0 - dev: false - - /@emotion/cache@11.11.0: - resolution: {integrity: sha512-P34z9ssTCBi3e9EI1ZsWpNHcfY1r09ZO0rZbRO2ob3ZQMnFI35jB536qoXbkdesr5EUhYi22anuEJuyxifaqAQ==} - dependencies: - '@emotion/memoize': 0.8.1 - '@emotion/sheet': 1.2.2 - '@emotion/utils': 1.2.1 - '@emotion/weak-memoize': 0.3.1 - stylis: 4.2.0 - dev: false - - /@emotion/hash@0.9.1: - resolution: {integrity: sha512-gJB6HLm5rYwSLI6PQa+X1t5CFGrv1J1TWG+sOyMCeKz2ojaj6Fnl/rZEspogG+cvqbt4AE/2eIyD2QfLKTBNlQ==} - dev: false - /@emotion/is-prop-valid@0.8.8: resolution: {integrity: sha512-u5WtneEAr5IDG2Wv65yhunPSMLIpuKsbuOktRojfrEiEvRyC85LgPMZI63cr7NUqT8ZIGdSVg8ZKGxIug4lXcA==} requiresBuild: true @@ -2826,8 +2796,8 @@ packages: globby: 11.1.0 is-glob: 4.0.3 semver: 7.5.4 - tsutils: 3.21.0(typescript@5.0.4) - typescript: 5.0.4 + tsutils: 3.21.0(typescript@5.1.6) + typescript: 5.1.6 transitivePeerDependencies: - supports-color dev: false @@ -8173,7 +8143,6 @@ packages: lilconfig: 2.0.6 ts-node: 10.9.1(@types/node@18.15.13)(typescript@5.1.6) yaml: 1.10.2 - dev: false /postcss-nested@6.0.0(postcss@8.4.20): resolution: {integrity: sha512-0DkamqrPcmkBDsLn+vQDIrtkSbNkv5AD/M322ySo9kqFkCIYklym2xEmWkwo+Y3/qZo34tzEPNUw4y7yMCdv5w==} @@ -8515,10 +8484,6 @@ packages: resolution: {integrity: sha512-k2d6ACCkiNYz222Fs/iNze30rRJ1iIicW7JuX/7/cozvih6YCkFZH+J6mAFDVgv0dRBaAyr4jDqC95R2y4IADg==} dev: false - /readline@1.3.0: - resolution: {integrity: sha512-k2d6ACCkiNYz222Fs/iNze30rRJ1iIicW7JuX/7/cozvih6YCkFZH+J6mAFDVgv0dRBaAyr4jDqC95R2y4IADg==} - dev: false - /real-require@0.1.0: resolution: {integrity: sha512-r/H9MzAWtrv8aSVjPCMFpDMl5q66GqtmmRkRjpHTsp4zBAa+snZyiQNlMONiUmEJcsnaw0wCauJ2GWODr/aFkg==} engines: {node: '>= 12.13.0'} @@ -9668,7 +9633,6 @@ packages: typescript: 5.1.6 v8-compile-cache-lib: 3.0.1 yn: 3.1.1 - dev: false /tsconfig-paths@3.14.1: resolution: {integrity: sha512-fxDhWnFSLt3VuTwtvJt5fpwxBHg5AdKWMsgcPOOIilyjymcYVZoCQF8fvFRezCNfblEXmi+PcM1eYHeOAgXCOQ==} @@ -9763,6 +9727,42 @@ packages: - ts-node dev: false + /tsup@6.5.0(typescript@5.0.4): + resolution: {integrity: sha512-36u82r7rYqRHFkD15R20Cd4ercPkbYmuvRkz3Q1LCm5BsiFNUgpo36zbjVhCOgvjyxNBWNKHsaD5Rl8SykfzNA==} + engines: {node: '>=14'} + hasBin: true + peerDependencies: + '@swc/core': ^1 + postcss: ^8.4.12 + typescript: ^4.1.0 + peerDependenciesMeta: + '@swc/core': + optional: true + postcss: + optional: true + typescript: + optional: true + dependencies: + bundle-require: 3.1.2(esbuild@0.15.15) + cac: 6.7.14 + chokidar: 3.5.3 + debug: 4.3.4(supports-color@8.1.1) + esbuild: 0.15.15 + execa: 5.1.1 + globby: 11.1.0 + joycon: 3.1.1 + postcss-load-config: 3.1.4(ts-node@10.9.1) + resolve-from: 5.0.0 + rollup: 3.4.0 + source-map: 0.8.0-beta.0 + sucrase: 3.29.0 + tree-kill: 1.2.2 + typescript: 5.0.4 + transitivePeerDependencies: + - supports-color + - ts-node + dev: true + /tsutils@3.21.0(typescript@5.1.6): resolution: {integrity: sha512-mHKK3iUXL+3UF6xL5k0PEhKRUBKPBCv/+RkEOpjRWxxx27KKRBmmA60A9pgOUvMi8GKhRMPEmjBRPzs2W7O1OA==} engines: {node: '>= 6'} @@ -10296,7 +10296,6 @@ packages: /which@2.0.2: resolution: {integrity: sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==} engines: {node: '>= 8'} - hasBin: true dependencies: isexe: 2.0.0