From 34215de7e06fb4385ef5ae5398684c01015603d4 Mon Sep 17 00:00:00 2001 From: Ladd Hoffman Date: Fri, 29 Mar 2024 18:23:28 -0500 Subject: [PATCH] testnet deploy --- client/src/components/Proposals.jsx | 11 +++++++++-- client/src/contract-addresses.json | 7 ++++--- ethereum/contract-addresses.json | 7 ++++--- 3 files changed, 17 insertions(+), 8 deletions(-) diff --git a/client/src/components/Proposals.jsx b/client/src/components/Proposals.jsx index 8380474..b6e1092 100644 --- a/client/src/components/Proposals.jsx +++ b/client/src/components/Proposals.jsx @@ -66,15 +66,22 @@ function Proposals() { fetchProposals(); const onNewProposal = (event) => { - console.log('event: new proposal', event); + console.log('event: new proposal', event.returnValues); + fetchProposal(event.returnValues.proposalIndex); + }; + + const onAttestation = (event) => { + console.log('event: attestation', event.returnValues); fetchProposal(event.returnValues.proposalIndex); }; contract.events.NewProposal({ fromBlock: 'latest' }).on('data', onNewProposal); + contract.events.Attestation({ fromBlock: 'latest' }).on('data', onAttestation); // unsubscribe on unmount return () => { contract.events.NewProposal().off(onNewProposal); + contract.events.Attestation().off(onAttestation); }; }, [provider, chainId, proposalsContract, fetchProposals, fetchProposal]); @@ -82,7 +89,7 @@ function Proposals() { const onSubmitProposal = useCallback(async (post) => { // TODO: Make referenda durations configurable - await proposalsContract.current.methods.propose(post.hash, 20, 20, 20).send({ + await proposalsContract.current.methods.propose(post.hash, 20, 40, 60).send({ from: account, gas: 1000000, value: 10000, diff --git a/client/src/contract-addresses.json b/client/src/contract-addresses.json index b49533f..a1b06b2 100644 --- a/client/src/contract-addresses.json +++ b/client/src/contract-addresses.json @@ -6,8 +6,9 @@ "Proposals": "0xBD616B6331e0953Fc20281a54A684E614D8C4026" }, "sepolia": { - "DAO": "0x8Cb4ab513A863ac29e855c85064ea53dec7dA24C", - "Work1": "0xa9d632F689e5bB49A23c055ffFb520702E102C72", - "Onboarding": "0xc79C51c18194228C90ee3a68041d8Eb5cc4730F7" + "DAO": "0x58c8ea0ba031431423cD84787d7d57F0Bf7c6E63", + "Work1": "0x67F6944504bF1b99fC6878AE7234A4dB6AB6dd1E", + "Onboarding": "0xA44D0CAba4CB76e32966ea41dcECBc8A98347E68", + "Proposals": "0x5A13A264214CDBfc949522dcCc48E5A0B11B3EdD" } } \ No newline at end of file diff --git a/ethereum/contract-addresses.json b/ethereum/contract-addresses.json index b49533f..a1b06b2 100644 --- a/ethereum/contract-addresses.json +++ b/ethereum/contract-addresses.json @@ -6,8 +6,9 @@ "Proposals": "0xBD616B6331e0953Fc20281a54A684E614D8C4026" }, "sepolia": { - "DAO": "0x8Cb4ab513A863ac29e855c85064ea53dec7dA24C", - "Work1": "0xa9d632F689e5bB49A23c055ffFb520702E102C72", - "Onboarding": "0xc79C51c18194228C90ee3a68041d8Eb5cc4730F7" + "DAO": "0x58c8ea0ba031431423cD84787d7d57F0Bf7c6E63", + "Work1": "0x67F6944504bF1b99fC6878AE7234A4dB6AB6dd1E", + "Onboarding": "0xA44D0CAba4CB76e32966ea41dcECBc8A98347E68", + "Proposals": "0x5A13A264214CDBfc949522dcCc48E5A0B11B3EdD" } } \ No newline at end of file