{detail}
+Only addresses on the allowlist can sign up and vote in this round.
diff --git a/src/components/Main/index.module.sass b/src/components/Main/index.module.sass index 869730f..8310710 100644 --- a/src/components/Main/index.module.sass +++ b/src/components/Main/index.module.sass @@ -61,7 +61,7 @@ gap: 8px .notice color: var(--basic-ink-secondary) - transition: color .1s 1s + // transition: color .1s 1s &[c-error] color: var(--error-error-primary) From 42debc0bcbcc020832b02cb78760abcec9c52e89 Mon Sep 17 00:00:00 2001 From: 99Kies <1290017556@qq.com> Date: Tue, 17 Dec 2024 12:50:49 +0800 Subject: [PATCH 05/13] add new codeid --- src/lib/config.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib/config.ts b/src/lib/config.ts index 21fefe7..e4c4e93 100644 --- a/src/lib/config.ts +++ b/src/lib/config.ts @@ -149,7 +149,7 @@ export function getConfig() { ? 'https://vota-testnet-api.dorafactory.org/' : 'https://vota-api.dorafactory.org/', chainInfo: network === 'VOTA_TEST' ? votaTestChainInfo : votaChainInfo, - oracleCodeId: network === 'VOTA_TEST' ? ['97'] : [''], + oracleCodeId: network === 'VOTA_TEST' ? ['97', '99'] : [''], oracleApi: network === 'VOTA_TEST' ? 'https://vota-testnet-certificate-api.dorafactory.org' From 6dac9ee2978c75f4f9b91b3c0d79a1e7b77951e2 Mon Sep 17 00:00:00 2001 From: 99Kies <1290017556@qq.com> Date: Tue, 17 Dec 2024 18:38:18 +0800 Subject: [PATCH 06/13] add oracle maci codeid --- src/lib/config.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib/config.ts b/src/lib/config.ts index e4c4e93..00816d8 100644 --- a/src/lib/config.ts +++ b/src/lib/config.ts @@ -149,7 +149,7 @@ export function getConfig() { ? 'https://vota-testnet-api.dorafactory.org/' : 'https://vota-api.dorafactory.org/', chainInfo: network === 'VOTA_TEST' ? votaTestChainInfo : votaChainInfo, - oracleCodeId: network === 'VOTA_TEST' ? ['97', '99'] : [''], + oracleCodeId: network === 'VOTA_TEST' ? ['97', '99', '100'] : [''], oracleApi: network === 'VOTA_TEST' ? 'https://vota-testnet-certificate-api.dorafactory.org' From b15dc4ba84adf72b7a9d2d2265e6c01c7117351f Mon Sep 17 00:00:00 2001 From: 99Kies <1290017556@qq.com> Date: Tue, 17 Dec 2024 19:56:35 +0800 Subject: [PATCH 07/13] add oracle maci codeid --- src/lib/config.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib/config.ts b/src/lib/config.ts index 00816d8..c7295fd 100644 --- a/src/lib/config.ts +++ b/src/lib/config.ts @@ -149,7 +149,7 @@ export function getConfig() { ? 'https://vota-testnet-api.dorafactory.org/' : 'https://vota-api.dorafactory.org/', chainInfo: network === 'VOTA_TEST' ? votaTestChainInfo : votaChainInfo, - oracleCodeId: network === 'VOTA_TEST' ? ['97', '99', '100'] : [''], + oracleCodeId: network === 'VOTA_TEST' ? ['97', '99', '100', '101'] : [''], oracleApi: network === 'VOTA_TEST' ? 'https://vota-testnet-certificate-api.dorafactory.org' From 5a1fdff797e319262cd3993810ba996627a0aa77 Mon Sep 17 00:00:00 2001 From: 99Kies <1290017556@qq.com> Date: Tue, 17 Dec 2024 23:47:13 +0800 Subject: [PATCH 08/13] update fetch sign logic --- src/lib/maci.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib/maci.ts b/src/lib/maci.ts index d244e65..4a8b3c2 100644 --- a/src/lib/maci.ts +++ b/src/lib/maci.ts @@ -126,7 +126,7 @@ export async function fetchWhitelistCommitment( headers: { 'Content-Type': 'application/json', }, - body: JSON.stringify({ address, height: oracleConfig.snapshot_height }), + body: JSON.stringify({ address, height: oracleConfig.snapshot_height, contractAddress }), }) console.log(signResponse) const sign = await signResponse.json() From 1f650e724c7c1e8294b7b1253a2d86cddeb169f1 Mon Sep 17 00:00:00 2001 From: 99Kies <1290017556@qq.com> Date: Wed, 18 Dec 2024 00:04:55 +0800 Subject: [PATCH 09/13] update signup fee set --- src/lib/maci.ts | 42 ++++++++++++++++++++++-------------------- 1 file changed, 22 insertions(+), 20 deletions(-) diff --git a/src/lib/maci.ts b/src/lib/maci.ts index 4a8b3c2..906a637 100644 --- a/src/lib/maci.ts +++ b/src/lib/maci.ts @@ -360,26 +360,28 @@ export async function signupOracle( const gasPrice = GasPrice.fromString('100000000000' + chainInfo.currencies[0].coinMinimalDenom) const fee = calculateFee(60000000, gasPrice) - // if (gasStation.enable === true) { - // const grantFee: StdFee = { - // amount: fee.amount, - // gas: fee.gas, - // granter: contractAddress, - // } - // return client.execute( - // address, - // contractAddress, - // { - // sign_up: { - // pubkey: { - // x: pubKey[0].toString(), - // y: pubKey[1].toString(), - // }, - // }, - // }, - // grantFee, - // ) - // } + if (gasStation.enable === true) { + const grantFee: StdFee = { + amount: fee.amount, + gas: fee.gas, + granter: contractAddress, + } + return client.execute( + address, + contractAddress, + { + sign_up: { + pubkey: { + x: pubKey[0].toString(), + y: pubKey[1].toString(), + }, + amount: oracleCertificate.amount, + certificate: oracleCertificate.signature, + }, + }, + grantFee, + ) + } return client.execute( address, From 0ba16b06e13fe5fcbd6b35a5e75b9cae804027a4 Mon Sep 17 00:00:00 2001 From: 99Kies <1290017556@qq.com> Date: Fri, 20 Dec 2024 00:21:12 +0800 Subject: [PATCH 10/13] add oracle maci codeid --- src/lib/config.ts | 2 +- src/lib/maci.ts | 38 +++++++++++++++++++++----------------- 2 files changed, 22 insertions(+), 18 deletions(-) diff --git a/src/lib/config.ts b/src/lib/config.ts index c7295fd..ae7d903 100644 --- a/src/lib/config.ts +++ b/src/lib/config.ts @@ -149,7 +149,7 @@ export function getConfig() { ? 'https://vota-testnet-api.dorafactory.org/' : 'https://vota-api.dorafactory.org/', chainInfo: network === 'VOTA_TEST' ? votaTestChainInfo : votaChainInfo, - oracleCodeId: network === 'VOTA_TEST' ? ['97', '99', '100', '101'] : [''], + oracleCodeId: network === 'VOTA_TEST' ? ['97', '99', '100', '101', '102'] : [''], oracleApi: network === 'VOTA_TEST' ? 'https://vota-testnet-certificate-api.dorafactory.org' diff --git a/src/lib/maci.ts b/src/lib/maci.ts index 906a637..6f9327d 100644 --- a/src/lib/maci.ts +++ b/src/lib/maci.ts @@ -130,26 +130,30 @@ export async function fetchWhitelistCommitment( }) console.log(signResponse) const sign = await signResponse.json() - console.log(sign) - const { signature, amount, snapshotHeight } = sign - updateOracleCertificate({ - oracleCertificate: { - snapshotHeight, - signature, - amount, - }, - }) - // MACI - whitelistCommitment = await client - .queryContractSmart(contractAddress, { - white_balance_of: { - sender: address, + if (sign.code === 400) { + whitelistCommitment = 0 + } else { + console.log(sign) + const { signature, amount, snapshotHeight } = sign + updateOracleCertificate({ + oracleCertificate: { + snapshotHeight, + signature, amount, - certificate: signature, }, }) - .then((n: string) => Number(n)) - .catch(() => 0) + // MACI + whitelistCommitment = await client + .queryContractSmart(contractAddress, { + white_balance_of: { + sender: address, + amount, + certificate: signature, + }, + }) + .then((n: string) => Number(n)) + .catch(() => 0) + } } else { // MACI whitelistCommitment = await client From 36fac478eb041a312c1ec69a8dce1d12ec153106 Mon Sep 17 00:00:00 2001 From: 99Kies <1290017556@qq.com> Date: Fri, 20 Dec 2024 16:08:55 +0800 Subject: [PATCH 11/13] update oracle feegrant logic --- src/components/Main/Maci.tsx | 83 +++++++++++++++++++++++++++--------- src/lib/maci.ts | 31 +++++++++++--- src/types/index.ts | 2 + 3 files changed, 90 insertions(+), 26 deletions(-) diff --git a/src/components/Main/Maci.tsx b/src/components/Main/Maci.tsx index 5d65935..4658ee6 100644 --- a/src/components/Main/Maci.tsx +++ b/src/components/Main/Maci.tsx @@ -23,28 +23,68 @@ async function sleep(ts: number) { }) } -const NeedToSignUp = (props: { voiceCredits: number; signup: () => void; loading: boolean }) => ( +const NeedToSignUp = (props: { + voiceCredits: number + feegrantStatus: string | undefined + signup: () => void + loading: boolean +}) => (- After signing up, you will be assigned{' '} - {props.voiceCredits} voice credits.{' '} - - Learn more about MACI. - - -
-+ Setting up gas fee grant... Please wait a moment and refresh the page. This process + usually takes 12-24 seconds. +
+ ) : ( + <> ++ After signing up, you will be assigned{' '} + {props.voiceCredits} voice credits + .{' '} + + Learn more about MACI. + + +
++ After signing up, you will be assigned{' '} + {props.voiceCredits} voice credits.{' '} + + Learn more about MACI. + + +
+