Backend contract is created to reduce size of poll contract and transfer all logic and operations (where it's possible) on a shoulders of this contract. This contract could be updatable through by publishing new poll factory. /// It is not supposed to be registered in ContractsManager.
/contracts/vote/PollBackend.sol

fallback, payable

PollBackend

function

activatePoll e9daae65

Activates poll so users could vote and no more changes can be made.

delegatecall only. Multisignature required

outputs0uint256_resultCode

result code of an operation.

function, constant

active 02fb0c5e

Gets if a poll has active status and people still could vote

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

destroy 83197ef0

Only owner can call it

Destroy contract and scrub a data

function

endPoll 8d99b2eb

Ends poll so after that users couldn't vote anymore.

delegatecall only. Multisignature required

outputs0uint256_resultCode

result code of an operation.

function, constant

getDetails fbbf93a0

Gets full details of a poll including a number of options

delegatecall only

outputs0address_owner
outputs1bytes32_detailsIpfsHash
outputs2uint256_votelimit
outputs3uint256_deadline
outputs4bool_status
outputs5bool_active
outputs6uint256_creation
outputs7uint256_optionsCount
function, constant

getEventsHistory fff10aba

Gets eventsHistory for the manager

outputs0address
function, constant

getPollListener f12e6101

returns listener to react on PollListenerInterface's actions

function, constant

getVoteLimit 657e8c13

Gets vote limit for a poll.

Actually shows the value from associated VotingManager

outputs0uint256
function, constant

getVotesBalances 934f2f0b

Gets intermediate retults of a poll by providing options and their balances.

delegatecall only

outputs0uint8[]_options

poll's options indices

outputs1uint256[]_balances

associated balances for options

function, constant

hasMember 12d42835

Checks if a user is participating in the poll

delegatecall only

inputs0address_user

address of a user to Checks

outputs0bool
function

init 19ab453c

Initializes internal fields. Contracts owner only.

Will rollback transaction if something goes wrong during initialization.

inputs0address_contractsManager

is contract manager, must be not 0x0

outputs0uint256
function

init 75a2490c

Initializes internal variables. Poll by default is not active so to start voting first activate a poll.

Could be invoked only once. delegatecall only

inputs0uint256_optionsCount

number of options in a poll

inputs1bytes32_detailsIpfsHash

ipfs hash for poll's details info

inputs2uint256_votelimit

votelimit. Should be less than votelimit that is defined on a backend

inputs3uint256_deadline

time to end voting

outputs0uint256
function, constant

isAuthorized fe9fbb80

Returns if _address is authorized (CBE)

inputs0address_key
outputs0bool
function

killPoll 483e3956

Erases poll from records. Should be called before activation or after poll completion. Couldn't be invoked in the middle of voting.

delegatecall only. Authorized contracts only.

function, constant

lookupManager 4fe59012

Makes search in contractsManager for registered contract by some identifier

inputs0bytes32_identifier

string identifier of a manager

outputs0addressmanager

address of a manager, 0x0 if nothing was found

function, constant

memberOptions 91c7a0ae

inputs0address
function, constant

memberVotes 4a9f914e

inputs0address
function, constant

optionsBalance 07e829d1

inputs0uint8
function, constant

owner 8da5cb5b

Gets owner of a poll

delegatecall only

function, constant

pendingContractOwner 5aa77d3c

function

tokenDeposit 9cd00448

Implements deposit method and receives calls from TimeHolder. Updates poll according to changes made with balance and adds value to a member chosen option. In case if were deposited enough amount to end a poll it will be ended automatically. Make sence only for active poll

initialized poll only. VotingManager only

inputs0address
inputs1address_address

address for which changes are made

inputs2uint256_amount

a value of change

inputs3uint256_total

total amount of tokens on _address's balance

outputs0uint256
function

tokenWithdrawn 4ca95be8

Implements withdrawn method and receives calls from TimeHolder. Updates poll according to changes made with balance and removes value from a member's chosen option. In case if _total value is equal to 0 then _address has no more rights to vote and his choice is reset.

initialized poll only. VotingManager only

inputs0address
inputs1address_address

address for which changes are made

inputs2uint256_amount

a value of change

inputs3uint256_total

total amount of tokens on _address's balance

outputs0uint256
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

updatePollDetailsIpfsHash 628c2bfc

Changes details hash with a new version. Should be called before poll will be activated Emits PollDetailsHashUpdated event

delegatecall only. poll owner only

inputs0bytes32_detailsIpfsHash

updated ipfs hash value

outputs0uint256
function

vote b3f98adc

Performs a vote of caller with provided choice. When a required balance for an option will reach votelimit value then poll automatically ends.

delegatecall only. Should be called by only those contracts that have balance in TimeHolder.

inputs0uint8_choice

picked option value by user. Should be between 1 and number of options in a poll

outputs0uint256_resultCode

result code of an operation. Returns ERROR_POLL_BACKEND_NO_SHARES if a balance in TimeHolder for the user is equal to zero.