Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
leeduckgo committed Nov 30, 2023
1 parent 2274aa4 commit 90c4266
Show file tree
Hide file tree
Showing 4 changed files with 125 additions and 177 deletions.
241 changes: 87 additions & 154 deletions packages/nextjs/generated/deployedContracts.ts
Original file line number Diff line number Diff line change
@@ -1,197 +1,130 @@
const contracts = {
// modifile here.
534351: [
84531: [
{
chainId: "534351",
name: "scrollSepolia",
chainId: "84531",
name: "baseGoerli",
contracts: {
VectorDBProposalGovernancer: {
address: "0xEd6a0A29A962B4296bCeEC4e1E55F5Ec0474EAC7",
address: "0x604dcaEC4E9ad55737F00D87B47ae497d2d78608",
abi: [
{
inputs: [],
stateMutability: "nonpayable",
type: "constructor",
},
{
inputs: [],
name: "chairperson",
outputs: [
"inputs": [
{
internalType: "address",
name: "",
type: "address",
},
"internalType": "string",
"name": "_vectorName",
"type": "string"
}
],
stateMutability: "view",
type: "function",
"stateMutability": "nonpayable",
"type": "constructor"
},
{
inputs: [
{
internalType: "string",
name: "_title",
type: "string",
},
"anonymous": false,
"inputs": [
{
internalType: "string",
name: "_content",
type: "string",
"indexed": false,
"internalType": "string",
"name": "uuid",
"type": "string"
},
],
name: "createProposal",
outputs: [],
stateMutability: "nonpayable",
type: "function",
},
{
inputs: [
{
internalType: "address",
name: "to",
type: "address",
},
"indexed": false,
"internalType": "bool",
"name": "decide",
"type": "bool"
}
],
name: "delegate",
outputs: [],
stateMutability: "nonpayable",
type: "function",
"name": "JudgeSet",
"type": "event"
},
{
inputs: [
"inputs": [
{
internalType: "uint32",
name: "id",
type: "uint32",
"internalType": "string",
"name": "_uuid",
"type": "string"
},
],
name: "getProposal",
outputs: [
{
components: [
{
internalType: "string",
name: "title",
type: "string",
},
{
internalType: "string",
name: "content",
type: "string",
},
{
internalType: "address",
name: "proposaler",
type: "address",
},
{
internalType: "uint256",
name: "voteCount",
type: "uint256",
},
],
internalType: "struct YourContract.Proposal",
name: "",
type: "tuple",
},
"internalType": "bool",
"name": "_decide",
"type": "bool"
}
],
stateMutability: "view",
type: "function",
"name": "judgeTag",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
inputs: [
"inputs": [
{
internalType: "address",
name: "voter",
type: "address",
"internalType": "string",
"name": "_uuid",
"type": "string"
},
{
"internalType": "string",
"name": "_meta_data",
"type": "string"
}
],
name: "giveRightToVote",
outputs: [],
stateMutability: "nonpayable",
type: "function",
"name": "tagItem",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
inputs: [
{
internalType: "uint256",
name: "",
type: "uint256",
},
],
name: "proposals",
outputs: [
{
internalType: "string",
name: "title",
type: "string",
},
"anonymous": false,
"inputs": [
{
internalType: "string",
name: "content",
type: "string",
"indexed": true,
"internalType": "address",
"name": "tagger",
"type": "address"
},
{
internalType: "address",
name: "proposaler",
type: "address",
"indexed": false,
"internalType": "string",
"name": "uuid",
"type": "string"
},
{
internalType: "uint256",
name: "voteCount",
type: "uint256",
},
"indexed": false,
"internalType": "string",
"name": "metadata",
"type": "string"
}
],
stateMutability: "view",
type: "function",
"name": "TagSet",
"type": "event"
},
{
inputs: [
{
internalType: "uint256",
name: "proposal",
type: "uint256",
},
"inputs": [],
"name": "chairperson",
"outputs": [
{
"internalType": "address",
"name": "",
"type": "address"
}
],
name: "vote",
outputs: [],
stateMutability: "nonpayable",
type: "function",
"stateMutability": "view",
"type": "function"
},
{
inputs: [
{
internalType: "address",
name: "",
type: "address",
},
],
name: "voters",
outputs: [
{
internalType: "uint256",
name: "weight",
type: "uint256",
},
{
internalType: "bool",
name: "voted",
type: "bool",
},
{
internalType: "address",
name: "delegate",
type: "address",
},
{
internalType: "uint256",
name: "vote",
type: "uint256",
},
"inputs": [],
"name": "vectorName",
"outputs": [
{
"internalType": "string",
"name": "",
"type": "string"
}
],
stateMutability: "view",
type: "function",
},
"stateMutability": "view",
"type": "function"
}
],
},
},
Expand Down
10 changes: 9 additions & 1 deletion packages/nextjs/pages/debug.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { useEffect } from "react";
import { useEffect, useState } from "react";
import type { NextPage } from "next";
import { useLocalStorage } from "usehooks-ts";
import { MetaHeader } from "~~/components/MetaHeader";
Expand All @@ -10,11 +10,18 @@ const selectedContractStorageKey = "scaffoldEth2.selectedContract";
const contractNames = getContractNames();

const Debug: NextPage = () => {
const [uuid, setUuid] = useState<string | null>("");

const [selectedContract, setSelectedContract] = useLocalStorage<ContractName>(
selectedContractStorageKey,
contractNames[0],
);

useEffect(() => {
const queryParameters = new URLSearchParams(window.location.search);
const uuid = queryParameters.get("uuid");
setUuid(uuid);
});
useEffect(() => {
if (!contractNames.includes(selectedContract)) {
setSelectedContract(contractNames[0]);
Expand Down Expand Up @@ -47,6 +54,7 @@ const Debug: NextPage = () => {
))}
</div>
)}
<p><b>uuid: {uuid}</b></p>
{contractNames.map(contractName => (
<ContractUI
key={contractName}
Expand Down
Loading

0 comments on commit 90c4266

Please sign in to comment.