From 7d294529c862e187578baea02b27324400869bc8 Mon Sep 17 00:00:00 2001 From: Ladd Hoffman Date: Mon, 15 Apr 2024 15:40:19 -0500 Subject: [PATCH] More commentary --- ethereum/contracts/core/Forum.sol | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/ethereum/contracts/core/Forum.sol b/ethereum/contracts/core/Forum.sol index 7c1553a..0ea5b43 100644 --- a/ethereum/contracts/core/Forum.sol +++ b/ethereum/contracts/core/Forum.sol @@ -155,10 +155,14 @@ contract Forum is Reputation { if (balanceOf(post.author) < post.reputation) { // If author has already lost reputation that was gained from this post, // that means other DAO members gained it through policing. - // Here we preserve the sum of members REP but decrease the sum of posts REP. + // We have to increase the magnitude of the amount we're "refunding", which is expressed as a negative number. + // This has the effect of preserving the sum of all members' REP. + // However, we still set the post reputation all the way to zero. + // So we end up decreasing the sum of all posts' REP. refundToInbound -= int( post.reputation - balanceOf(post.author) ); + console.logInt(refundToInbound); _update(post.author, address(this), balanceOf(post.author)); } else { _update(post.author, address(this), post.reputation);