Skip to content

Commit

Permalink
Merge pull request #645 from PolymathNetwork/abstract-class-voting
Browse files Browse the repository at this point in the history
Refactoring voting modules & adding functionality
  • Loading branch information
satyamakgec authored Apr 16, 2019
2 parents 248ef3e + df58fc9 commit feeb072
Show file tree
Hide file tree
Showing 23 changed files with 837 additions and 229 deletions.
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

0 comments on commit feeb072

Please sign in to comment.