Compare commits
No commits in common. "fb29abb6b30be664f9ff7641ad00798436351608" and "1ae1a336f50efa39e95da55687fb76c443d8010a" have entirely different histories.
fb29abb6b3
...
1ae1a336f5
|
@ -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 = 100_000_000; // Parts per billion
|
||||
uint public constant minQuorumPPB = 333_333_333; // Parts per billion
|
||||
|
||||
event PostAdded(uint postIndex);
|
||||
event ValidationPoolInitiated(uint poolIndex);
|
||||
|
|
|
@ -44,6 +44,9 @@ 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(
|
||||
|
@ -84,11 +87,6 @@ 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(
|
||||
|
@ -105,8 +103,8 @@ contract Proposals is DAOContract {
|
|||
}(
|
||||
proposal.postIndex,
|
||||
proposal.referenda[referendumIndex].duration,
|
||||
referendaQuora[referendumIndex][0],
|
||||
referendaQuora[referendumIndex][1],
|
||||
1,
|
||||
3,
|
||||
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: 11 });
|
||||
const init = () => initiateValidationPool({ quorumNumerator: 1, quorumDenominator: 4 });
|
||||
await expect(init()).to.be.revertedWith('Quorum is below minimum');
|
||||
});
|
||||
|
||||
|
|
Loading…
Reference in New Issue