diff --git a/frontend/src/contract-addresses.json b/frontend/contract-addresses.json similarity index 53% rename from frontend/src/contract-addresses.json rename to frontend/contract-addresses.json index 75766ab..77cb51a 100644 --- a/frontend/src/contract-addresses.json +++ b/frontend/contract-addresses.json @@ -1,9 +1,9 @@ { "localhost": { - "DAO": "0x8d914D38dD301FC4606f5aa9fEcF8A76389020d3", - "Work1": "0xfe58B9EB03F75A603de1B286584f5E9532ab8fB5", - "Onboarding": "0x1d63FDe5B461106729fE1e5e38A02fc68C518Af5", - "Proposals": "0x050C420Cc4995B41217Eba1B54B82Fd5687e9139" + "DAO": "0xD60A1c64B96a133587A75C2771690072F238a549", + "Work1": "0xCF3f16D151052FA7b99a71E79EC3b0e6C793aa0b", + "Onboarding": "0xE148e864A646B8bFc95dcc9acd3dBcB52704EE60", + "Proposals": "0x981234BBBC1ec93200F5BB3a65e2F9711A6109aa" }, "sepolia": { "DAO": "0x241514DC94568e98222fBE66662b054b545A61AE", diff --git a/frontend/src/App.jsx b/frontend/src/App.jsx index e1f2289..a06b2d3 100644 --- a/frontend/src/App.jsx +++ b/frontend/src/App.jsx @@ -82,9 +82,10 @@ function App() { }, [DAORef, account]); const fetchPost = useCallback(async (postId) => { - const p = await DAORef.current.methods.posts(postId).call(); - dispatchPost({ type: 'updateById', item: p }); - return p; + const post = await DAORef.current.methods.posts(postId).call(); + post.authors = await DAORef.current.methods.getPostAuthors(postId).call(); + dispatchPost({ type: 'updateById', item: post }); + return post; }, [DAORef, dispatchPost]); const fetchPostId = useCallback(async (postIndex) => { @@ -186,14 +187,14 @@ function App() { setWork1(Work1Contract); setOnboarding(OnboardingContract); - const fetchReputationInterval = setInterval(() => { - console.log('reputation', reputation); - if (reputation !== undefined) { - clearInterval(fetchReputationInterval); - return; - } - fetchReputation(); - }, 1000); + // const fetchReputationInterval = setInterval(() => { + // // console.log('reputation', reputation); + // if (reputation !== undefined) { + // clearInterval(fetchReputationInterval); + // return; + // } + // fetchReputation(); + // }, 1000); /* -------------------------------------------------------------------------------- */ /* --------------------------- BEGIN EVENT HANDLERS ------------------------------- */ @@ -414,7 +415,7 @@ function App() { ID - Author + Authors Sender Actions @@ -423,7 +424,18 @@ function App() { {posts.filter((x) => !!x).map((post) => ( {post.id.toString()} - {getAddressName(chainId, post.author)} + + + {post.authors.map(({ authorAddress, weightPercent }) => ( +
+ {getAddressName(chainId, authorAddress)} + {' '} + {weightPercent.toString()} + % +
+ ))} +
+ {getAddressName(chainId, post.sender)}