Skip to content

Commit

Permalink
polling: Use QUORUM according to LIP-16
Browse files Browse the repository at this point in the history
  • Loading branch information
yondonfu committed May 7, 2020
1 parent c25bb8e commit 52b191a
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
12 changes: 7 additions & 5 deletions contracts/polling/PollCreator.sol
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,11 @@ import "../token/ILivepeerToken.sol";


contract PollCreator {
// TODO: Update these values
uint256 public constant QUORUM = 20;
uint256 public constant THRESHOLD = 50;
// 33.33%
uint256 public constant QUORUM = 333300;
// 50%
uint256 public constant QUOTA = 500000;
// 10 rounds
uint256 public constant POLL_PERIOD = 10 * 5760;
uint256 public constant POLL_CREATION_COST = 100 * 1 ether;

Expand All @@ -18,7 +20,7 @@ contract PollCreator {
bytes proposal,
uint256 endBlock,
uint256 quorum,
uint256 threshold
uint256 quota
);

constructor(address _tokenAddr) public {
Expand Down Expand Up @@ -46,7 +48,7 @@ contract PollCreator {
_proposal,
endBlock,
QUORUM,
THRESHOLD
QUOTA
);
}
}
6 changes: 3 additions & 3 deletions test/unit/PollCreator.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ import {functionSig} from "../../utils/helpers"
const PollCreator = artifacts.require("PollCreator")
const GenericMock = artifacts.require("GenericMock")

const QUORUM = 20
const THRESHOLD = 50
const QUORUM = 333300
const QUOTA = 500000
const POLL_PERIOD = 10 * 5760

contract("PollCreator", accounts => {
Expand Down Expand Up @@ -61,7 +61,7 @@ contract("PollCreator", accounts => {
e => e.proposal == hash
&& e.endBlock.toNumber() == end
&& e.quorum.toNumber() == QUORUM
&& e.threshold.toNumber() == THRESHOLD
&& e.quota.toNumber() == QUOTA
,
"PollCreated event not emitted correctly"
)
Expand Down

0 comments on commit 52b191a

Please sign in to comment.