diff --git a/packages/interface/package.json b/packages/interface/package.json index 9289ddb2..52cf117c 100644 --- a/packages/interface/package.json +++ b/packages/interface/package.json @@ -39,8 +39,8 @@ "graphql-request": "^6.1.0", "lowdb": "^1.0.0", "lucide-react": "^0.316.0", - "maci-cli": "^2.1.0", - "maci-domainobjs": "^2.0.0", + "maci-cli": "^2.2.0", + "maci-domainobjs": "^2.2.0", "next": "^14.1.0", "next-auth": "^4.24.5", "next-themes": "^0.2.1", diff --git a/packages/interface/src/contexts/Maci.tsx b/packages/interface/src/contexts/Maci.tsx index c3332160..f9b5cb3f 100644 --- a/packages/interface/src/contexts/Maci.tsx +++ b/packages/interface/src/contexts/Maci.tsx @@ -220,7 +220,7 @@ export const MaciProvider: React.FC = ({ children }: MaciProv setIsLoading(true); try { - const { stateIndex: index } = await signup({ + const { stateIndex: index, voiceCredits } = await signup({ maciPubKey, maciAddress: config.maciAddress!, sgDataArg: sgData, @@ -230,6 +230,7 @@ export const MaciProvider: React.FC = ({ children }: MaciProv if (index) { setIsRegistered(true); setStateIndex(index); + setInitialVoiceCredits(voiceCredits); } } catch (e) { onError(); @@ -238,7 +239,7 @@ export const MaciProvider: React.FC = ({ children }: MaciProv setIsLoading(false); } }, - [maciPubKey, signer, setIsRegistered, setStateIndex, setIsLoading, sgData], + [maciPubKey, signer, setIsRegistered, setStateIndex, setInitialVoiceCredits, setIsLoading, sgData], ); // function to be used to vote on a poll diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 8ff17f62..cc490dd3 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -353,11 +353,11 @@ importers: specifier: ^0.316.0 version: 0.316.0(react@18.2.0) maci-cli: - specifier: ^2.1.0 - version: 2.1.0(kp6mbe6ih3mck4yt24st7gzjpa) + specifier: ^2.2.0 + version: 2.2.1(kp6mbe6ih3mck4yt24st7gzjpa) maci-domainobjs: - specifier: ^2.0.0 - version: 2.0.0(bufferutil@4.0.8)(utf-8-validate@5.0.10) + specifier: ^2.2.0 + version: 2.2.0(bufferutil@4.0.8)(utf-8-validate@5.0.10) next: specifier: ^14.1.0 version: 14.2.5(@babel/core@7.25.2)(@playwright/test@1.46.0)(react-dom@18.2.0(react@18.2.0))(react@18.2.0) @@ -9191,6 +9191,10 @@ packages: resolution: {integrity: sha512-nrbzEqwtRAoGtW1L34blmyEtXMRJsrZ0ovV2GY++yEZFiaYLLdPGzbDcrxBHMoViIrIjo/nNQn9CxqwzSI5+tw==} hasBin: true + maci-cli@2.2.1: + resolution: {integrity: sha512-byWUEeoZ7Z/QvMhe+/321sMNsLWwDAYEfYxTgyW4BJX0X4yX2SldcRIcQWs5U5tEqszlcwz4FH3oBMuYrjBZqQ==} + hasBin: true + maci-contracts@2.1.0: resolution: {integrity: sha512-OwYSYPEmcyXlyrd9LauMsJwbXKftYcdWdcGvcl4o0W8EqlC1ujrav/nWLXDbl6EiHB7QL/mhhlNIP/RQSCstDQ==} hasBin: true @@ -16142,6 +16146,27 @@ snapshots: typechain: 8.3.2(typescript@5.5.4) typescript: 5.5.4 + '@nomicfoundation/hardhat-toolbox@5.0.0(fxus7563hykhnskeghds65zmge)': + dependencies: + '@nomicfoundation/hardhat-chai-matchers': 2.0.7(@nomicfoundation/hardhat-ethers@3.0.6(ethers@6.13.2(bufferutil@4.0.8)(utf-8-validate@5.0.10))(hardhat@2.22.7(bufferutil@4.0.8)(ts-node@10.9.2(@types/node@20.14.14)(typescript@5.5.4))(typescript@5.5.4)(utf-8-validate@5.0.10)))(chai@4.5.0)(ethers@6.13.2(bufferutil@4.0.8)(utf-8-validate@5.0.10))(hardhat@2.22.7(bufferutil@4.0.8)(ts-node@10.9.2(@types/node@20.14.14)(typescript@5.5.4))(typescript@5.5.4)(utf-8-validate@5.0.10)) + '@nomicfoundation/hardhat-ethers': 3.0.6(ethers@6.13.2(bufferutil@4.0.8)(utf-8-validate@5.0.10))(hardhat@2.22.7(bufferutil@4.0.8)(ts-node@10.9.2(@types/node@20.14.14)(typescript@5.5.4))(typescript@5.5.4)(utf-8-validate@5.0.10)) + '@nomicfoundation/hardhat-ignition-ethers': 0.15.5(@nomicfoundation/hardhat-ethers@3.0.6(ethers@6.13.2(bufferutil@4.0.8)(utf-8-validate@5.0.10))(hardhat@2.22.7(bufferutil@4.0.8)(ts-node@10.9.2(@types/node@20.14.14)(typescript@5.5.4))(typescript@5.5.4)(utf-8-validate@5.0.10)))(@nomicfoundation/hardhat-ignition@0.15.5(@nomicfoundation/hardhat-verify@2.0.9(hardhat@2.22.7(bufferutil@4.0.8)(ts-node@10.9.2(@types/node@20.14.14)(typescript@5.5.4))(typescript@5.5.4)(utf-8-validate@5.0.10)))(bufferutil@4.0.8)(hardhat@2.22.7(bufferutil@4.0.8)(ts-node@10.9.2(@types/node@20.14.14)(typescript@5.5.4))(typescript@5.5.4)(utf-8-validate@5.0.10))(utf-8-validate@5.0.10))(@nomicfoundation/ignition-core@0.15.5(bufferutil@4.0.8)(utf-8-validate@5.0.10))(ethers@6.13.2(bufferutil@4.0.8)(utf-8-validate@5.0.10))(hardhat@2.22.7(bufferutil@4.0.8)(ts-node@10.9.2(@types/node@20.14.14)(typescript@5.5.4))(typescript@5.5.4)(utf-8-validate@5.0.10)) + '@nomicfoundation/hardhat-network-helpers': 1.0.11(hardhat@2.22.7(bufferutil@4.0.8)(ts-node@10.9.2(@types/node@20.14.14)(typescript@5.5.4))(typescript@5.5.4)(utf-8-validate@5.0.10)) + '@nomicfoundation/hardhat-verify': 2.0.9(hardhat@2.22.7(bufferutil@4.0.8)(ts-node@10.9.2(@types/node@20.14.14)(typescript@5.5.4))(typescript@5.5.4)(utf-8-validate@5.0.10)) + '@typechain/ethers-v6': 0.5.1(ethers@6.13.2(bufferutil@4.0.8)(utf-8-validate@5.0.10))(typechain@8.3.2(typescript@5.5.4))(typescript@5.5.4) + '@typechain/hardhat': 9.1.0(@typechain/ethers-v6@0.5.1(ethers@6.13.2(bufferutil@4.0.8)(utf-8-validate@5.0.10))(typechain@8.3.2(typescript@5.5.4))(typescript@5.5.4))(ethers@6.13.2(bufferutil@4.0.8)(utf-8-validate@5.0.10))(hardhat@2.22.7(bufferutil@4.0.8)(ts-node@10.9.2(@types/node@20.14.14)(typescript@5.5.4))(typescript@5.5.4)(utf-8-validate@5.0.10))(typechain@8.3.2(typescript@5.5.4)) + '@types/chai': 4.3.17 + '@types/mocha': 10.0.7 + '@types/node': 20.14.14 + chai: 4.5.0 + ethers: 6.13.2(bufferutil@4.0.8)(utf-8-validate@5.0.10) + hardhat: 2.22.8(bufferutil@4.0.8)(ts-node@10.9.2(@types/node@20.14.14)(typescript@5.5.4))(typescript@5.5.4)(utf-8-validate@5.0.10) + hardhat-gas-reporter: 1.0.10(bufferutil@4.0.8)(hardhat@2.22.7(bufferutil@4.0.8)(ts-node@10.9.2(@types/node@20.14.14)(typescript@5.5.4))(typescript@5.5.4)(utf-8-validate@5.0.10))(utf-8-validate@5.0.10) + solidity-coverage: 0.8.12(hardhat@2.22.7(bufferutil@4.0.8)(ts-node@10.9.2(@types/node@20.14.14)(typescript@5.5.4))(typescript@5.5.4)(utf-8-validate@5.0.10)) + ts-node: 10.9.2(@types/node@20.14.14)(typescript@5.5.4) + typechain: 8.3.2(typescript@5.5.4) + typescript: 5.5.4 + '@nomicfoundation/hardhat-toolbox@5.0.0(qc2x6fg2hvcwib2hi3ibxymkay)': dependencies: '@nomicfoundation/hardhat-chai-matchers': 2.0.7(@nomicfoundation/hardhat-ethers@3.0.6(ethers@6.13.2(bufferutil@4.0.8)(utf-8-validate@5.0.10))(hardhat@2.22.7(bufferutil@4.0.8)(ts-node@10.9.2(@types/node@20.14.14)(typescript@5.5.4))(typescript@5.5.4)(utf-8-validate@5.0.10)))(chai@4.5.0)(ethers@6.13.2(bufferutil@4.0.8)(utf-8-validate@5.0.10))(hardhat@2.22.7(bufferutil@4.0.8)(ts-node@10.9.2(@types/node@20.14.14)(typescript@5.5.4))(typescript@5.5.4)(utf-8-validate@5.0.10)) @@ -20865,10 +20890,6 @@ snapshots: dependencies: ms: 2.0.0 - debug@3.2.7: - dependencies: - ms: 2.1.3 - debug@3.2.7(supports-color@8.1.1): dependencies: ms: 2.1.3 @@ -21106,7 +21127,7 @@ snapshots: docker-modem@1.0.9: dependencies: JSONStream: 1.3.2 - debug: 3.2.7 + debug: 3.2.7(supports-color@8.1.1) readable-stream: 1.0.34 split-ca: 1.0.1 transitivePeerDependencies: @@ -25325,6 +25346,43 @@ snapshots: - typescript - utf-8-validate + maci-cli@2.2.1(kp6mbe6ih3mck4yt24st7gzjpa): + dependencies: + '@commander-js/extra-typings': 12.1.0(commander@12.1.0) + '@nomicfoundation/hardhat-toolbox': 5.0.0(fxus7563hykhnskeghds65zmge) + commander: 12.1.0 + dotenv: 16.4.5 + ethers: 6.13.2(bufferutil@4.0.8)(utf-8-validate@5.0.10) + hardhat: 2.22.8(bufferutil@4.0.8)(ts-node@10.9.2(@types/node@20.14.14)(typescript@5.5.4))(typescript@5.5.4)(utf-8-validate@5.0.10) + maci-circuits: 2.2.0(@types/snarkjs@0.7.8)(bufferutil@4.0.8)(utf-8-validate@5.0.10) + maci-contracts: 2.2.1(7htv7pg2ka7ncyn53uwoaz3m6q) + maci-core: 2.2.0(bufferutil@4.0.8)(utf-8-validate@5.0.10) + maci-crypto: 2.2.0(bufferutil@4.0.8)(utf-8-validate@5.0.10) + maci-domainobjs: 2.2.0(bufferutil@4.0.8)(utf-8-validate@5.0.10) + prompt: 1.3.0 + transitivePeerDependencies: + - '@nomicfoundation/hardhat-chai-matchers' + - '@nomicfoundation/hardhat-ethers' + - '@nomicfoundation/hardhat-ignition-ethers' + - '@nomicfoundation/hardhat-network-helpers' + - '@nomicfoundation/hardhat-verify' + - '@typechain/ethers-v6' + - '@typechain/hardhat' + - '@types/chai' + - '@types/mocha' + - '@types/node' + - '@types/snarkjs' + - bufferutil + - c-kzg + - chai + - hardhat-gas-reporter + - solidity-coverage + - supports-color + - ts-node + - typechain + - typescript + - utf-8-validate + maci-contracts@2.1.0(7htv7pg2ka7ncyn53uwoaz3m6q): dependencies: '@nomicfoundation/hardhat-ethers': 3.0.6(ethers@6.13.2(bufferutil@4.0.8)(utf-8-validate@5.0.10))(hardhat@2.22.7(bufferutil@4.0.8)(ts-node@10.9.2(@types/node@20.14.14)(typescript@5.5.4))(typescript@5.5.4)(utf-8-validate@5.0.10))