Contract is supposed to the central point to enter to manipulate (create and navigate) polls. It aggregates: - creation of a new poll, - tracking a number of currently active polls, - getting paginated lists of all created polls, - implements ListenerInterface to support and use TimeHolder's functionality
/contracts/vote/VotingManager.sol

constructor

VotingManager

inputs0address_store
inputs1bytes32_crate
event

Error 9cf38cf2

inputs0addressself
inputs1uint256errorCode
event

PollCreated 02c09d2d

inputs0addressself
inputs1addresspollAddress
inputs2uint256optionsCount
inputs3bytes32detailsIpfsHash
inputs4uint256votelimit
inputs5uint256deadline
event

PollRemoved f8bb25a0

inputs0addressself
inputs1addresspollAddress
event

VotingSharesPercentUpdated 5598993b

inputs0addressself
inputs1uint256percent
function

changeContractOwnership 557f4bc9

Prepares ownership pass. * Can only be called by current owner.

inputs0address_to

address of the next owner. 0x0 is not allowed.

outputs0bool
function

claimContractOwnership 4592cd1d

Finalize ownership pass. * Can only be called by pending owner.

outputs0bool
function, constant

contractOwner ce606ee0

function, constant

contractsManager 53253d31

function

createPoll 3c101a3e

Creates a brand new poll with provided description and properties. Emits PollCreated event in case of success.

inputs0uint256_optionsCount

number of options provided for a poll

inputs1bytes32_detailsIpfsHash

ipfs hash of poll's description and other details

inputs2uint256_votelimit

limit when poll would be treated as completed

inputs3uint256_deadline

time after which poll isn't active anymore

outputs0uint256
function

destroy 83197ef0

function

emitError df26ca08

inputs0uint256errorCode
function

emitPollCreated 9f24f2b6

inputs0address_pollAddress
inputs1uint256_optionsCount
inputs2bytes32_detailsIpfsHash
inputs3uint256_votelimit
inputs4uint256_deadline
function

emitPollRemoved 5c053ca8

inputs0addresspollAddress
function

emitVotingSharesPercentUpdated 98d22b01

inputs0uint256_percent
function, constant

getActivePollsCount a9581703

Gets a number of active polls. Couldn't be more than ACTIVE_POLLS_MAX

outputs0uint256
function, constant

getEventsHistory fff10aba

function, constant

getPollsCount e0995916

Gets a number of polls registered in the manager. Includes a number of both active and inactive polls

outputs0uint256
function, constant

getPollsDetails fb39e8b3

Gets descriptions for a list of polls

inputs0address[]_polls

a list of polls

outputs0address[]_owner
outputs1bytes32[]_detailsIpfsHash
outputs2uint256[]_votelimit
outputs3uint256[]_deadline
outputs4bool[]_status
outputs5bool[]_active
outputs6uint256[]_creation
function, constant

getPollsPaginated 56f80c3c

Gets a paginated results of polls stored in the manager. Could be mixed with getPollsCount() passed as a pageSize to get full list of polls at one call.

inputs0uint256_startIndex

index of a poll to start. For first call should be equal to 0

inputs1uint32_pageSize

size of an output list

outputs0address[]_polls

list of polls

function, constant

getVoteLimit 657e8c13

Gets votes limit (or number of tokens to be voted to treat a poll as completed)

outputs0uint256
function, constant

getVotesPercent ec6dfab7

Returns votes percent value

function

init 184b9559

Initializes contract

inputs0address_contractsManager

address of a contracts manager

inputs1address_pollsFactory

address of a poll factory

inputs2address_pollBackend
outputs0uint256_resultCode

result code of an operation. REINITIALIZED if it was once initialized.

function, constant

isAuthorized fe9fbb80

inputs0addresskey
function, constant

lookupManager 4fe59012

Will crash if no manager in the system with given identifier.

Returns manager's address by its identifier (type).

inputs0bytes32_identifier

is a manager's identifier. 0x0 is not allowed.

function

onActivatePoll 654fd7d6

Emits PollActivated event in case of successful activation.

DO NOT СALL IT DIRECTLY. Used by a poll contract.

function

onEndPoll cfe0784a

Emits PollActivated event in case of successful ending (completing).

DO NOT СALL IT DIRECTLY. Used by a poll contract.

function

onRemovePoll d9b35f8a

Emits PollRemoved event in case of successful removal.

DO NOT СALL IT DIRECTLY. Used by a poll contract.

function

onVote a2ad5faa

Emits PollVoted event in case of successful voting.

DO NOT СALL IT DIRECTLY. Used by a poll contract.

inputs0address
inputs1uint8
function, constant

pendingContractOwner 5aa77d3c

function

setBackend da7fc24f

Sets poll backend address that will be used for future polls

inputs0address_backend
function

setContractsManager 71d3b573

Setter for ContractsManager. Force overrides currect manager.

inputs0address_contractsManager

contracts manager. 0x0 is not allowed.

function

setEventsHistory 6521afd7

inputs0address_eventsHistory
function

setVotesPercent 023fa93f

Sets votes percent. Multisignature required.

inputs0uint256_percent

a value of percent for a vote limit. Should be between 0 and 10000 (because not float in a system)

outputs0uint256_resultCode

result code of an operation

function

tokenDeposit 9cd00448

ListenerInterface interface

inputs0address_token
inputs1address_who
inputs2uint256_amount
inputs3uint256_total
function

tokenWithdrawn 4ca95be8

inputs0address_token
inputs1address_who
inputs2uint256_amount
inputs3uint256_total
function

transferContractOwnership a843c51f

Direct ownership pass without change/claim pattern. Can be invoked only by current contract owner

inputs0address_to

the next contract owner

outputs0bool
function, constant

voteShares 7b144b9c

Gets shares contract that is set up as default in TimeHolder

function

withdrawnTokens d8f9659b

inputs0address[]tokens
inputs1address_to