Compare commits

..

No commits in common. "93136716b8d1052eb379811f49634425a12c1936" and "3eee2576694d005478d50e8fafbb52ffda16f781" have entirely different histories.

16 changed files with 56 additions and 59 deletions

View File

@ -1,14 +1,14 @@
{
"localhost": {
"DAO": "0xE799A82AEB525D35c671eAEb6AE6858E02a1EB24",
"Work1": "0x358A07B26F4c556140872ecdB69c58e8807E7178",
"Onboarding": "0x63472674239ffb70618Fae043610917f2d9B781C",
"Proposals": "0x38AE4ABD47B10f6660CD70Cc8FF3401341E13d9e"
"DAO": "0xD60A1c64B96a133587A75C2771690072F238a549",
"Work1": "0xCF3f16D151052FA7b99a71E79EC3b0e6C793aa0b",
"Onboarding": "0xE148e864A646B8bFc95dcc9acd3dBcB52704EE60",
"Proposals": "0x981234BBBC1ec93200F5BB3a65e2F9711A6109aa"
},
"sepolia": {
"DAO": "0x8e9D6cb0097CE2E283Cdd5762F288d2D394eB713",
"Work1": "0xFC95d5d09e71f0C83F59765107eAa79125b01624",
"Onboarding": "0x32f5A03687406A5c66878349A7de667d0b5C2922",
"Proposals": "0x8273062d41a828ac67ae5837547d2Dd19f8CDc27"
"DAO": "0x98F7A2ce8C9b7F739b2bdBc174F59D0e5fDc4Af8",
"Work1": "0x514e65208d43865F84Ab6aE67dAAd06078613417",
"Onboarding": "0x0f2998E49aeA7081BF86561b9fe51604a962F9FC",
"Proposals": "0x9BaEdea14145c5368867b1f0cDd7CE298768737e"
}
}

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -19,12 +19,12 @@ module.exports = async (req, res) => {
data.embeddedData = data.embeddedData || undefined;
console.log(data);
const {
authors, content, signature, embeddedData,
} = data;
console.log({ content, embeddedData });
// Verify hash
const derivedHash = objectHash({
authors, content, signature, embeddedData,

View File

@ -1,14 +1,14 @@
{
"localhost": {
"DAO": "0xE799A82AEB525D35c671eAEb6AE6858E02a1EB24",
"Work1": "0x358A07B26F4c556140872ecdB69c58e8807E7178",
"Onboarding": "0x63472674239ffb70618Fae043610917f2d9B781C",
"Proposals": "0x38AE4ABD47B10f6660CD70Cc8FF3401341E13d9e"
"DAO": "0xD60A1c64B96a133587A75C2771690072F238a549",
"Work1": "0xCF3f16D151052FA7b99a71E79EC3b0e6C793aa0b",
"Onboarding": "0xE148e864A646B8bFc95dcc9acd3dBcB52704EE60",
"Proposals": "0x981234BBBC1ec93200F5BB3a65e2F9711A6109aa"
},
"sepolia": {
"DAO": "0x8e9D6cb0097CE2E283Cdd5762F288d2D394eB713",
"Work1": "0xFC95d5d09e71f0C83F59765107eAa79125b01624",
"Onboarding": "0x32f5A03687406A5c66878349A7de667d0b5C2922",
"Proposals": "0x8273062d41a828ac67ae5837547d2Dd19f8CDc27"
"DAO": "0x98F7A2ce8C9b7F739b2bdBc174F59D0e5fDc4Af8",
"Work1": "0x514e65208d43865F84Ab6aE67dAAd06078613417",
"Onboarding": "0x0f2998E49aeA7081BF86561b9fe51604a962F9FC",
"Proposals": "0x9BaEdea14145c5368867b1f0cDd7CE298768737e"
}
}

View File

@ -137,14 +137,6 @@ contract Forum is Reputation {
int amount
) internal returns (int refund) {
int allocated;
for (uint i = 0; i < post.authors.length; i++) {
address authorAddress = post.authors[i].authorAddress;
if (!isMember[authorAddress]) {
members[memberCount++] = authorAddress;
isMember[authorAddress] = true;
}
}
for (uint i = 0; i < post.authors.length; i++) {
Author memory author = post.authors[i];
int share;
@ -157,10 +149,6 @@ contract Forum is Reputation {
}
if (share > 0) {
_update(address(this), author.authorAddress, uint(share));
if (!isMember[author.authorAddress]) {
members[memberCount++] = author.authorAddress;
isMember[author.authorAddress] = true;
}
} else if (balanceOf(author.authorAddress) < uint(-share)) {
// Author has already lost some REP gained from this post.
// That means other DAO members have earned it for policing.

View File

@ -4,10 +4,6 @@ pragma solidity ^0.8.24;
import {ERC20} from "@openzeppelin/contracts/token/ERC20/ERC20.sol";
contract Reputation is ERC20("Reputation", "REP") {
mapping(uint => address) public members;
uint public memberCount;
mapping(address => bool) public isMember;
function decimals() public pure override returns (uint8) {
return 9;
}

View File

@ -41,6 +41,10 @@ contract ValidationPools is Reputation, Forum {
mapping(uint => ValidationPool) public validationPools;
uint public validationPoolCount;
mapping(uint => address) public members;
uint public memberCount;
mapping(address => bool) public isMember;
uint constant minDuration = 1; // 1 second
uint constant maxDuration = 365_000_000 days; // 1 million years
uint[2] minQuorum = [1, 10];
@ -139,6 +143,7 @@ contract ValidationPools is Reputation, Forum {
/// Evaluate outcome of a validation pool
function evaluateOutcome(uint poolIndex) public returns (bool votePasses) {
ValidationPool storage pool = validationPools[poolIndex];
Post storage post = posts[pool.postId];
require(pool.resolved == false, "Pool is already resolved");
uint stakedFor;
uint stakedAgainst;
@ -191,6 +196,15 @@ contract ValidationPools is Reputation, Forum {
votePasses =
stakedFor * pool.params.winRatio[1] >=
(stakedFor + stakedAgainst) * pool.params.winRatio[0];
if (votePasses) {
for (uint i = 0; i < post.authors.length; i++) {
address authorAddress = post.authors[i].authorAddress;
if (!isMember[authorAddress]) {
members[memberCount++] = authorAddress;
isMember[authorAddress] = true;
}
}
}
pool.resolved = true;
pool.outcome = votePasses;
emit ValidationPoolResolved(poolIndex, votePasses, true);

View File

@ -1,14 +1,14 @@
{
"localhost": {
"DAO": "0xE799A82AEB525D35c671eAEb6AE6858E02a1EB24",
"Work1": "0x358A07B26F4c556140872ecdB69c58e8807E7178",
"Onboarding": "0x63472674239ffb70618Fae043610917f2d9B781C",
"Proposals": "0x38AE4ABD47B10f6660CD70Cc8FF3401341E13d9e"
"DAO": "0xD60A1c64B96a133587A75C2771690072F238a549",
"Work1": "0xCF3f16D151052FA7b99a71E79EC3b0e6C793aa0b",
"Onboarding": "0xE148e864A646B8bFc95dcc9acd3dBcB52704EE60",
"Proposals": "0x981234BBBC1ec93200F5BB3a65e2F9711A6109aa"
},
"sepolia": {
"DAO": "0x8e9D6cb0097CE2E283Cdd5762F288d2D394eB713",
"Work1": "0xFC95d5d09e71f0C83F59765107eAa79125b01624",
"Onboarding": "0x32f5A03687406A5c66878349A7de667d0b5C2922",
"Proposals": "0x8273062d41a828ac67ae5837547d2Dd19f8CDc27"
"DAO": "0x98F7A2ce8C9b7F739b2bdBc174F59D0e5fDc4Af8",
"Work1": "0x514e65208d43865F84Ab6aE67dAAd06078613417",
"Onboarding": "0x0f2998E49aeA7081BF86561b9fe51604a962F9FC",
"Proposals": "0x9BaEdea14145c5368867b1f0cDd7CE298768737e"
}
}

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -214,7 +214,6 @@ function App() {
console.log('event: validation pool resolved');
fetchReputation();
fetchValidationPool(event.returnValues.poolIndex);
fetchMembers();
});
Work1Contract.events.AvailabilityStaked({ fromBlock: 'latest' }).on('data', () => {