Compare commits

...

2 Commits

Author SHA1 Message Date
Ladd Hoffman fb29abb6b3 Lower minimum quorum
Gitea Actions Demo / Explore-Gitea-Actions (push) Failing after 42s Details
2024-03-27 20:01:25 -05:00
Ladd Hoffman 078df362ec Parameterize quorum 2024-03-27 20:00:46 -05:00
3 changed files with 9 additions and 7 deletions

View File

@ -63,7 +63,7 @@ contract DAO is ERC20("Reputation", "REP") {
uint public constant minDuration = 1; // 1 second
uint public constant maxDuration = 365_000_000 days; // 1 million years
uint public constant minQuorumPPB = 333_333_333; // Parts per billion
uint public constant minQuorumPPB = 100_000_000; // Parts per billion
event PostAdded(uint postIndex);
event ValidationPoolInitiated(uint poolIndex);

View File

@ -44,9 +44,6 @@ contract Proposals is DAOContract {
event ProposalFailed(uint proposalIndex, string reason);
event ProposalAccepted(uint proposalIndex);
uint[3] referendaBindingPercent = [0, 1, 100];
bool[3] referendaRedistributeLosingStakes = [false, false, true];
constructor(DAO dao) DAOContract(dao) {}
function propose(
@ -87,6 +84,11 @@ contract Proposals is DAOContract {
attestation.amount = amount;
}
// Sequences of validation pool parameters
uint[3] referendaBindingPercent = [0, 1, 100];
bool[3] referendaRedistributeLosingStakes = [false, false, true];
uint[2][3] referendaQuora = [[1, 10], [1, 2], [1, 3]];
/// Internal convenience function to wrap our call to dao.initiateValidationPool
/// and to emit an event
function initiateValidationPool(
@ -103,8 +105,8 @@ contract Proposals is DAOContract {
}(
proposal.postIndex,
proposal.referenda[referendumIndex].duration,
1,
3,
referendaQuora[referendumIndex][0],
referendaQuora[referendumIndex][1],
bindingPercent,
redistributeLosingStakes,
true,

View File

@ -84,7 +84,7 @@ describe('DAO', () => {
});
it('should not be able to initiate a validation pool with a quorum below the minimum', async () => {
const init = () => initiateValidationPool({ quorumNumerator: 1, quorumDenominator: 4 });
const init = () => initiateValidationPool({ quorumNumerator: 1, quorumDenominator: 11 });
await expect(init()).to.be.revertedWith('Quorum is below minimum');
});