Skip to content

Commit

Permalink
fixed some bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
yashgo0018 committed Mar 23, 2024
1 parent 955bf53 commit e3d5932
Show file tree
Hide file tree
Showing 3 changed files with 108 additions and 91 deletions.
2 changes: 1 addition & 1 deletion packages/nextjs/app/admin/_components/CreatePollModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ export default function Example({ show, setOpen }: { show: boolean; setOpen: (va
const { writeAsync, data, isLoading } = useScaffoldContractWrite({
contractName: "PollManager",
functionName: "createPoll",
args: [pollData?.title, pollData?.options || [], "", BigInt(pollData?.options?.length || 0)],
args: [pollData?.title, pollData?.options || [], "", 300n],
});

console.log(data);
Expand Down
4 changes: 2 additions & 2 deletions packages/nextjs/app/admin/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ export default function AdminPage() {

const { data: polls } = useScaffoldContractRead({
contractName: "PollManager",
functionName: "paginatePolls",
args: [1n, 10n],
functionName: "fetchPolls",
args: [1n, 10n, true],
});

console.log(totalPolls);
Expand Down
193 changes: 105 additions & 88 deletions packages/nextjs/contracts/deployedContracts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { GenericContractsDeclaration } from "~~/utils/scaffold-eth/contract";
const deployedContracts = {
31337: {
ConstantInitialVoiceCreditProxy: {
address: "0x5FbDB2315678afecb367f032d93F642f64180aa3",
address: "0x8f86403A4DE0BB5791fa46B8e795C547942fE4Cf",
abi: [
{
inputs: [
Expand Down Expand Up @@ -50,7 +50,7 @@ const deployedContracts = {
},
},
FreeForAllGatekeeper: {
address: "0xe7f1725E7734CE288F8367e1Bb143E90bb3F0512",
address: "0x9d4454B023096f34B160D6B654540c56A1F81688",
abi: [
{
inputs: [],
Expand Down Expand Up @@ -92,7 +92,7 @@ const deployedContracts = {
inheritedFunctions: {},
},
MACI: {
address: "0xA51c1fc2f0D1a1b8494Ed1FE312d7C3a78Ed91C0",
address: "0x7969c5eD335650692Bc04293B07F5BF2e7A673C0",
abi: [
{
inputs: [
Expand Down Expand Up @@ -1055,7 +1055,7 @@ const deployedContracts = {
},
},
MessageProcessorFactory: {
address: "0x8A791620dd6260079BF849Dc5567aDC3F2FdC318",
address: "0xCD8a1C3ba11CF5ECfa6267617243239504a98d90",
abi: [
{
inputs: [],
Expand Down Expand Up @@ -1110,7 +1110,7 @@ const deployedContracts = {
},
},
PollFactory: {
address: "0x2279B7A0a67DB372996a5FaB50D91eAA73d2eBe6",
address: "0xb7278A61aa25c888815aFC32Ad3cC52fF24fE575",
abi: [
{
inputs: [],
Expand Down Expand Up @@ -1237,7 +1237,7 @@ const deployedContracts = {
},
},
PollManager: {
address: "0x959922bE3CAee4b8Cd9a407cc3ac1C251C2007B1",
address: "0xcbEAF3BDe82155F56486Fb5a1072cb8baAf547cc",
abi: [
{
inputs: [
Expand Down Expand Up @@ -1310,26 +1310,83 @@ const deployedContracts = {
type: "function",
},
{
inputs: [],
name: "maci",
outputs: [
inputs: [
{
internalType: "contract MACI",
name: "",
type: "address",
internalType: "uint256",
name: "_pollId",
type: "uint256",
},
],
stateMutability: "view",
type: "function",
},
{
inputs: [],
name: "owner",
name: "fetchPoll",
outputs: [
{
internalType: "address",
name: "",
type: "address",
components: [
{
internalType: "string",
name: "name",
type: "string",
},
{
internalType: "bytes",
name: "encodedOptions",
type: "bytes",
},
{
internalType: "string",
name: "ipfsHash",
type: "string",
},
{
internalType: "address",
name: "creator",
type: "address",
},
{
components: [
{
internalType: "address",
name: "poll",
type: "address",
},
{
internalType: "address",
name: "messageProcessor",
type: "address",
},
{
internalType: "address",
name: "tally",
type: "address",
},
{
internalType: "address",
name: "subsidy",
type: "address",
},
],
internalType: "struct PollManager.PollContracts",
name: "pollContracts",
type: "tuple",
},
{
internalType: "uint256",
name: "endTime",
type: "uint256",
},
{
internalType: "uint256",
name: "numOfOptions",
type: "uint256",
},
{
internalType: "string[]",
name: "options",
type: "string[]",
},
],
internalType: "struct PollManager.PollData",
name: "poll_",
type: "tuple",
},
],
stateMutability: "view",
Expand All @@ -1347,8 +1404,13 @@ const deployedContracts = {
name: "_perPage",
type: "uint256",
},
{
internalType: "bool",
name: "_ascending",
type: "bool",
},
],
name: "paginatePolls",
name: "fetchPolls",
outputs: [
{
components: [
Expand Down Expand Up @@ -1424,72 +1486,27 @@ const deployedContracts = {
type: "function",
},
{
inputs: [
inputs: [],
name: "maci",
outputs: [
{
internalType: "uint256",
internalType: "contract MACI",
name: "",
type: "uint256",
type: "address",
},
],
name: "polls",
stateMutability: "view",
type: "function",
},
{
inputs: [],
name: "owner",
outputs: [
{
internalType: "string",
name: "name",
type: "string",
},
{
internalType: "bytes",
name: "encodedOptions",
type: "bytes",
},
{
internalType: "string",
name: "ipfsHash",
type: "string",
},
{
internalType: "address",
name: "creator",
name: "",
type: "address",
},
{
components: [
{
internalType: "address",
name: "poll",
type: "address",
},
{
internalType: "address",
name: "messageProcessor",
type: "address",
},
{
internalType: "address",
name: "tally",
type: "address",
},
{
internalType: "address",
name: "subsidy",
type: "address",
},
],
internalType: "struct PollManager.PollContracts",
name: "pollContracts",
type: "tuple",
},
{
internalType: "uint256",
name: "endTime",
type: "uint256",
},
{
internalType: "uint256",
name: "numOfOptions",
type: "uint256",
},
],
stateMutability: "view",
type: "function",
Expand Down Expand Up @@ -1647,7 +1664,7 @@ const deployedContracts = {
},
},
PoseidonT3: {
address: "0xDc64a140Aa3E981100a9becA4E685f962f0cF6C9",
address: "0x809d550fca64d94Bd9F66E60752A544199cfAC3D",
abi: [
{
inputs: [
Expand All @@ -1672,7 +1689,7 @@ const deployedContracts = {
inheritedFunctions: {},
},
PoseidonT4: {
address: "0x5FC8d32690cc91D4c39d9d3abcBD16989F875707",
address: "0x4c5859f0F772848b2D91F1D83E2Fe57935348029",
abi: [
{
inputs: [
Expand All @@ -1697,7 +1714,7 @@ const deployedContracts = {
inheritedFunctions: {},
},
PoseidonT5: {
address: "0x0165878A594ca255338adfa4d48449f69242Eb8F",
address: "0x1291Be112d480055DaFd8a610b7d1e203891C274",
abi: [
{
inputs: [
Expand All @@ -1722,7 +1739,7 @@ const deployedContracts = {
inheritedFunctions: {},
},
PoseidonT6: {
address: "0xa513E6E4b8f2a923D98304ec87F64353C4D5C853",
address: "0x5f3f1dBD7B74C6B46e8c44f98792A1dAf8d69154",
abi: [
{
inputs: [
Expand All @@ -1747,7 +1764,7 @@ const deployedContracts = {
inheritedFunctions: {},
},
SubsidyFactory: {
address: "0xB7f8BC63BbcaD18155201308C8f3540b07f84F5e",
address: "0x2bdCC0de6bE1f7D2ee689a0342D76F52E8EFABa3",
abi: [
{
inputs: [
Expand Down Expand Up @@ -1794,7 +1811,7 @@ const deployedContracts = {
},
},
TallyFactory: {
address: "0x610178dA211FEF7D417bC0e6FeD39F05609AD788",
address: "0x82e01223d51Eb87e16A03E24687EDF0F294da6f1",
abi: [
{
inputs: [
Expand Down Expand Up @@ -1841,7 +1858,7 @@ const deployedContracts = {
},
},
TopupCredit: {
address: "0xCf7Ed3AccA5a467e9e704C703E8D87F634fB0Fc9",
address: "0x36C02dA8a0983159322a80FFE9F24b1acfF8B570",
abi: [
{
inputs: [],
Expand Down Expand Up @@ -2251,7 +2268,7 @@ const deployedContracts = {
},
},
Verifier: {
address: "0x9fE46736679d2D9a65F0992F2272dE9f3c7fa6e0",
address: "0x5eb3Bc0a489C5A8288765d2336659EbCA68FCd00",
abi: [
{
inputs: [],
Expand Down Expand Up @@ -2413,7 +2430,7 @@ const deployedContracts = {
},
},
VkRegistry: {
address: "0x9A676e781A523b5d0C0e43731313A708CB607508",
address: "0xc351628EB244ec633d5f21fBD6621e1a683B1181",
abi: [
{
inputs: [],
Expand Down

0 comments on commit e3d5932

Please sign in to comment.