Compare commits
2 Commits
1ae1a336f5
...
fb29abb6b3
Author | SHA1 | Date |
---|---|---|
Ladd Hoffman | fb29abb6b3 | |
Ladd Hoffman | 078df362ec |
|
@ -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);
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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');
|
||||
});
|
||||
|
||||
|
|
Loading…
Reference in New Issue