Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

polling: Use QUORUM according to LIP-16 #380

Merged
merged 1 commit into from May 7, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
12 changes: 7 additions & 5 deletions contracts/polling/PollCreator.sol
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
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