Compare commits

...

2 Commits

Author SHA1 Message Date
Ladd Hoffman 93136716b8 sepolia deploy
Gitea Actions Demo / Explore-Gitea-Actions (push) Failing after 38s Details
2024-04-20 22:12:12 -05:00
Ladd Hoffman a18da7dac1 let forum, rather than VP, update members list 2024-04-20 22:09:12 -05:00
16 changed files with 59 additions and 56 deletions

View File

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

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": "0xD60A1c64B96a133587A75C2771690072F238a549",
"Work1": "0xCF3f16D151052FA7b99a71E79EC3b0e6C793aa0b",
"Onboarding": "0xE148e864A646B8bFc95dcc9acd3dBcB52704EE60",
"Proposals": "0x981234BBBC1ec93200F5BB3a65e2F9711A6109aa"
"DAO": "0xE799A82AEB525D35c671eAEb6AE6858E02a1EB24",
"Work1": "0x358A07B26F4c556140872ecdB69c58e8807E7178",
"Onboarding": "0x63472674239ffb70618Fae043610917f2d9B781C",
"Proposals": "0x38AE4ABD47B10f6660CD70Cc8FF3401341E13d9e"
},
"sepolia": {
"DAO": "0x98F7A2ce8C9b7F739b2bdBc174F59D0e5fDc4Af8",
"Work1": "0x514e65208d43865F84Ab6aE67dAAd06078613417",
"Onboarding": "0x0f2998E49aeA7081BF86561b9fe51604a962F9FC",
"Proposals": "0x9BaEdea14145c5368867b1f0cDd7CE298768737e"
"DAO": "0x8e9D6cb0097CE2E283Cdd5762F288d2D394eB713",
"Work1": "0xFC95d5d09e71f0C83F59765107eAa79125b01624",
"Onboarding": "0x32f5A03687406A5c66878349A7de667d0b5C2922",
"Proposals": "0x8273062d41a828ac67ae5837547d2Dd19f8CDc27"
}
}

View File

@ -137,6 +137,14 @@ 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;
@ -149,6 +157,10 @@ 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,6 +4,10 @@ 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,10 +41,6 @@ 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];
@ -143,7 +139,6 @@ 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;
@ -196,15 +191,6 @@ 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": "0xD60A1c64B96a133587A75C2771690072F238a549",
"Work1": "0xCF3f16D151052FA7b99a71E79EC3b0e6C793aa0b",
"Onboarding": "0xE148e864A646B8bFc95dcc9acd3dBcB52704EE60",
"Proposals": "0x981234BBBC1ec93200F5BB3a65e2F9711A6109aa"
"DAO": "0xE799A82AEB525D35c671eAEb6AE6858E02a1EB24",
"Work1": "0x358A07B26F4c556140872ecdB69c58e8807E7178",
"Onboarding": "0x63472674239ffb70618Fae043610917f2d9B781C",
"Proposals": "0x38AE4ABD47B10f6660CD70Cc8FF3401341E13d9e"
},
"sepolia": {
"DAO": "0x98F7A2ce8C9b7F739b2bdBc174F59D0e5fDc4Af8",
"Work1": "0x514e65208d43865F84Ab6aE67dAAd06078613417",
"Onboarding": "0x0f2998E49aeA7081BF86561b9fe51604a962F9FC",
"Proposals": "0x9BaEdea14145c5368867b1f0cDd7CE298768737e"
"DAO": "0x8e9D6cb0097CE2E283Cdd5762F288d2D394eB713",
"Work1": "0xFC95d5d09e71f0C83F59765107eAa79125b01624",
"Onboarding": "0x32f5A03687406A5c66878349A7de667d0b5C2922",
"Proposals": "0x8273062d41a828ac67ae5837547d2Dd19f8CDc27"
}
}

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