Skip to content

Refactoring voting modules & adding functionality #645

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

Merged
merged 13 commits into from
Apr 16, 2019
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 50 additions & 0 deletions contracts/interfaces/IVoting.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
pragma solidity ^0.5.0;

interface IVoting {

/**
* @notice Allows the token issuer to set the active stats of a ballot
* @param _ballotId The index of the target ballot
* @param _isActive The bool value of the active stats of the ballot
* @return bool success
*/
function changeBallotStatus(uint256 _ballotId, bool _isActive) external;

/**
* @notice Queries the result of a given ballot
* @param _ballotId Id of the target ballot
* @return uint256 voteWeighting
* @return uint256 tieWith
* @return uint256 winningProposal
* @return bool isVotingSucceed
* @return uint256 totalVoters
*/
function getBallotResults(uint256 _ballotId) external view returns(
uint256[] memory voteWeighting,
uint256[] memory tieWith,
uint256 winningProposal,
bool isVotingSucceed,
uint256 totalVoters
);

/**
* @notice Get the voted proposal
* @param _ballotId Id of the ballot
* @param _voter Address of the voter
*/
function getSelectedProposal(uint256 _ballotId, address _voter) external view returns(uint256 proposalId);

/**
* @notice Get the details of the ballot
* @param _ballotId The index of the target ballot
* @return uint256 quorum
* @return uint256 totalSupplyAtCheckpoint
* @return uint256 checkpointId
* @return uint256 startTime
* @return uint256 endTime
* @return uint256 totalProposals
* @return uint256 totalVoters
* @return bool isActive
*/
function getBallotDetails(uint256 _ballotId) external view returns(uint256, uint256, uint256, uint256, uint256, uint256, uint256, bool);
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@
*/
pragma solidity ^0.5.0;

import "./ICheckpoint.sol";
import "../../storage/modules/Checkpoint/DividendCheckpointStorage.sol";
import "../Module.sol";
import ".././ICheckpoint.sol";
import "../../../storage/modules/Checkpoint/Dividend/DividendCheckpointStorage.sol";
import "../../Module.sol";
import "openzeppelin-solidity/contracts/math/SafeMath.sol";
import "openzeppelin-solidity/contracts/math/Math.sol";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ pragma solidity ^0.5.0;

import "../DividendCheckpoint.sol";
import "./ERC20DividendCheckpointStorage.sol";
import "../../../interfaces/IOwnable.sol";
import "../../../../interfaces/IOwnable.sol";
import "openzeppelin-solidity/contracts/token/ERC20/IERC20.sol";

/**
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
pragma solidity ^0.5.0;

import "./ERC20DividendCheckpointProxy.sol";
import "../../../libraries/Util.sol";
import "../../../interfaces/IBoot.sol";
import "../../UpgradableModuleFactory.sol";
import "../../../../libraries/Util.sol";
import "../../../../interfaces/IBoot.sol";
import "../../../UpgradableModuleFactory.sol";

/**
* @title Factory for deploying ERC20DividendCheckpoint module
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
pragma solidity ^0.5.0;

import "../../../proxy/OwnedUpgradeabilityProxy.sol";
import "../../../../proxy/OwnedUpgradeabilityProxy.sol";
import "./ERC20DividendCheckpointStorage.sol";
import "../../../storage/modules/Checkpoint/DividendCheckpointStorage.sol";
import "../../../Pausable.sol";
import "../../../storage/modules/ModuleStorage.sol";
import "../../../../storage/modules/Checkpoint/Dividend/DividendCheckpointStorage.sol";
import "../../../../Pausable.sol";
import "../../../../storage/modules/ModuleStorage.sol";

/**
* @title Transfer Manager module for core transfer validation functionality
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
pragma solidity ^0.5.0;

import "../DividendCheckpoint.sol";
import "../../../interfaces/IOwnable.sol";
import "../../../../interfaces/IOwnable.sol";

/**
* @title Checkpoint module for issuing ether dividends
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
pragma solidity ^0.5.0;

import "./EtherDividendCheckpointProxy.sol";
import "../../../libraries/Util.sol";
import "../../../interfaces/IBoot.sol";
import "../../UpgradableModuleFactory.sol";
import "../../../../libraries/Util.sol";
import "../../../../interfaces/IBoot.sol";
import "../../../UpgradableModuleFactory.sol";

/**
* @title Factory for deploying EtherDividendCheckpoint module
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
pragma solidity ^0.5.0;

import "../../../proxy/OwnedUpgradeabilityProxy.sol";
import "../../../storage/modules/Checkpoint/DividendCheckpointStorage.sol";
import "../../../Pausable.sol";
import "../../../storage/modules/ModuleStorage.sol";
import "../../../../proxy/OwnedUpgradeabilityProxy.sol";
import "../../../../storage/modules/Checkpoint/Dividend/DividendCheckpointStorage.sol";
import "../../../../Pausable.sol";
import "../../../../storage/modules/ModuleStorage.sol";

/**
* @title Transfer Manager module for core transfer validation functionality
Expand Down
Loading