Contract 0xa8a8509A17a5872d01e489fC85B152eb2A0C092E

 
Txn Hash Method
Block
From
To
Value
0x4b2379157b526b037dd05d46dab822ef11186e799e2d2413f7647636c002474cSet Payment Enab...55059062018-04-25 23:34:071250 days 2 hrs ago0xe8193bc3d5f3f482406706f843a5f161563f37bf IN  0xa8a8509a17a5872d01e489fc85b152eb2a0c092e0 Ether0.00004806243.4
0xd31fa1f206a26261f5e791b64c87b3afeab2615e1d5a77bb8e04c9308ed50701Set Whitelist Ba...55059012018-04-25 23:32:551250 days 2 hrs ago0xe8193bc3d5f3f482406706f843a5f161563f37bf IN  0xa8a8509a17a5872d01e489fc85b152eb2a0c092e0 Ether0.00014918523.4
0xb76e6a2d5976082caa521f508b373aca0eb517170a409ef05035f322b8205312Set Admin55058862018-04-25 23:28:451250 days 2 hrs ago0xe8193bc3d5f3f482406706f843a5f161563f37bf IN  0xa8a8509a17a5872d01e489fc85b152eb2a0c092e0 Ether0.0000785052.5
0x8f5e9953438ae912488908ab695ebc7e98fe392732f5b350e20822c3dc93ca47Deploy Ballot52929702018-03-21 3:35:221285 days 22 hrs ago0xe8193bc3d5f3f482406706f843a5f161563f37bf IN  0xa8a8509a17a5872d01e489fc85b152eb2a0c092e0 Ether0.001444762
0x3127ca338d9bd4937aeaca60375342afcec846e76d3787ffdee96ba3a4474968Deploy Ballot52929532018-03-21 3:31:361285 days 22 hrs ago0xe8193bc3d5f3f482406706f843a5f161563f37bf IN  0xa8a8509a17a5872d01e489fc85b152eb2a0c092e0 Ether0.0014448882
0xbf63c9dbe89d79cf131c077682481bcda817e960e97c3496286b82c4939992f8Deploy Ballot52929472018-03-21 3:30:201285 days 22 hrs ago0xe8193bc3d5f3f482406706f843a5f161563f37bf IN  0xa8a8509a17a5872d01e489fc85b152eb2a0c092e0 Ether0.0014448882
0x619f2ac218fab0f28d121e4826fd5b76aa2f3738ae5dbee3cd336f300ed79464Deploy Ballot52929122018-03-21 3:21:531285 days 22 hrs ago0xe8193bc3d5f3f482406706f843a5f161563f37bf IN  0xa8a8509a17a5872d01e489fc85b152eb2a0c092e0 Ether0.0014748882
0xf23f456d31940570e2f9daf81193bc671768124df844d02d33f39eb702f1d08bInit Democ52927712018-03-21 2:49:201285 days 23 hrs ago0xe8193bc3d5f3f482406706f843a5f161563f37bf IN  0xa8a8509a17a5872d01e489fc85b152eb2a0c092e0 Ether0.0001896522
0xbe72e5283664b242325a5a81563bc1824bae9d6aa7eed3611d9dd3bbd953c859Deploy Ballot51982142018-03-05 1:54:511302 days 14 mins ago0xe8193bc3d5f3f482406706f843a5f161563f37bf IN  0xa8a8509a17a5872d01e489fc85b152eb2a0c092e0 Ether0.0021675243
0x7c68657a8fae1a67769735eba59e71d5399d7d703897850dbb5a262151daf750Deploy Ballot51982082018-03-05 1:53:231302 days 16 mins ago0xe8193bc3d5f3f482406706f843a5f161563f37bf IN  0xa8a8509a17a5872d01e489fc85b152eb2a0c092e0 Ether0.0021675243
0xf90a9d5adb143a2554a0a361488d20f2638a1d9731ab2ec6794ff62e1f6f1317Deploy Ballot51981982018-03-05 1:51:571302 days 17 mins ago0xe8193bc3d5f3f482406706f843a5f161563f37bf IN  0xa8a8509a17a5872d01e489fc85b152eb2a0c092e0 Ether0.0021675243
0xac18bf6c326452a3c97caa7aa9bfd8fedffc5e95ffac7436f6abdf3555d1219eDeploy Ballot51981812018-03-05 1:47:481302 days 21 mins ago0xe8193bc3d5f3f482406706f843a5f161563f37bf IN  0xa8a8509a17a5872d01e489fc85b152eb2a0c092e0 Ether0.0022125243
0x2c72de347ee425bf42bf85531145dfaf36061065ad6defd977c459ba4cef3832Init Democ51971552018-03-04 21:46:441302 days 4 hrs ago0xe8193bc3d5f3f482406706f843a5f161563f37bf IN  0xa8a8509a17a5872d01e489fc85b152eb2a0c092e0 Ether0.000767165
0x25196541d84537c102adf09a5880c115b7f1ffedd9cfeff175f87f1bdf439541Set Whitelist Ba...51971372018-03-04 21:41:071302 days 4 hrs ago0xe8193bc3d5f3f482406706f843a5f161563f37bf IN  0xa8a8509a17a5872d01e489fc85b152eb2a0c092e0 Ether0.000219395
0x7886fec2479d49288dd5c7d9f986dcc4ce2c1badf8523269054b885cb4f040baSet Whitelist De...51971262018-03-04 21:38:471302 days 4 hrs ago0xe8193bc3d5f3f482406706f843a5f161563f37bf IN  0xa8a8509a17a5872d01e489fc85b152eb2a0c092e0 Ether0.000220935
0xd6089652b9c8123a2770c77880da469b4de5626dff94a3aff198198c45b5a3be0x6060604051971152018-03-04 21:35:251302 days 4 hrs ago0xe8193bc3d5f3f482406706f843a5f161563f37bf IN  Create: SVLightIndex0 Ether0.0082856853
[ Download CSV Export 
Latest 8 internal transactions
Parent Txn Hash Block From To Value
0x8f5e9953438ae912488908ab695ebc7e98fe392732f5b350e20822c3dc93ca4752929702018-03-21 3:35:221285 days 22 hrs ago 0xa8a8509a17a5872d01e489fc85b152eb2a0c092e  Contract Creation0 Ether
0x3127ca338d9bd4937aeaca60375342afcec846e76d3787ffdee96ba3a447496852929532018-03-21 3:31:361285 days 22 hrs ago 0xa8a8509a17a5872d01e489fc85b152eb2a0c092e  Contract Creation0 Ether
0xbf63c9dbe89d79cf131c077682481bcda817e960e97c3496286b82c4939992f852929472018-03-21 3:30:201285 days 22 hrs ago 0xa8a8509a17a5872d01e489fc85b152eb2a0c092e  Contract Creation0 Ether
0x619f2ac218fab0f28d121e4826fd5b76aa2f3738ae5dbee3cd336f300ed7946452929122018-03-21 3:21:531285 days 22 hrs ago 0xa8a8509a17a5872d01e489fc85b152eb2a0c092e  Contract Creation0 Ether
0xbe72e5283664b242325a5a81563bc1824bae9d6aa7eed3611d9dd3bbd953c85951982142018-03-05 1:54:511302 days 14 mins ago 0xa8a8509a17a5872d01e489fc85b152eb2a0c092e  Contract Creation0 Ether
0x7c68657a8fae1a67769735eba59e71d5399d7d703897850dbb5a262151daf75051982082018-03-05 1:53:231302 days 16 mins ago 0xa8a8509a17a5872d01e489fc85b152eb2a0c092e  Contract Creation0 Ether
0xf90a9d5adb143a2554a0a361488d20f2638a1d9731ab2ec6794ff62e1f6f131751981982018-03-05 1:51:571302 days 17 mins ago 0xa8a8509a17a5872d01e489fc85b152eb2a0c092e  Contract Creation0 Ether
0xac18bf6c326452a3c97caa7aa9bfd8fedffc5e95ffac7436f6abdf3555d1219e51981812018-03-05 1:47:481302 days 21 mins ago 0xa8a8509a17a5872d01e489fc85b152eb2a0c092e  Contract Creation0 Ether
[ Download CSV Export 
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
SVLightIndex

Compiler Version
v0.4.20+commit.3155dd80

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion

Contract Source Code (Solidity)

/**
 *Submitted for verification at Etherscan.io on 2018-03-04
*/

pragma solidity ^0.4.19;


//
// SVLightBallotBox
// Single use contract to manage a ballot
// Author: Max Kaye <[email protected]>
// License: MIT
//
// Architecture:
// * Ballot authority declares public key with which to encrypt ballots (optional - stored in ballot spec)
// * Users submit encrypted or plaintext ballots as blobs (dependent on above)
// * These ballots are tracked by the ETH address of the sender
// * Following the conclusion of the ballot, the secret key is provided
//   by the ballot authority, and all users may transparently and
//   independently validate the results
//
// Notes:
// * Since ballots are encrypted the only validation we can do is length, but UI takes care of most of the rest
//


contract SVLightBallotBox {
    //// ** Storage Variables

    // Std owner pattern
    address public owner;

    // test mode - operations like changing start/end times
    bool public testMode = false;

    // struct for ballot
    struct Ballot {
        bytes32 ballotData;
        address sender;
        // we use a uint32 here because addresses are 20 bytes and this might help
        // solidity pack the block number well. gives us a little room to expand too if needed.
        uint32 blockN;
    }

    // Maps to store ballots, along with corresponding log of voters.
    // Should only be modified through `addBallotAndVoter` internal function
    mapping (uint256 => Ballot) public ballotMap;
    mapping (uint256 => bytes32) public associatedPubkeys;
    uint256 public nVotesCast = 0;

    // Use a map for voters to look up their ballot
    mapping (address => uint256) public voterToBallotID;

    // NOTE - We don't actually want to include the PublicKey because _it's included in the ballotSpec_.
    // It's better to ensure ppl actually have the ballot spec by not including it in the contract.
    // Plus we're already storing the hash of the ballotSpec anyway...

    // Private key to be set after ballot conclusion - curve25519
    bytes32 public ballotEncryptionSeckey;
    bool seckeyRevealed = false;

    // Timestamps for start and end of ballot (UTC)
    uint64 public startTime;
    uint64 public endTime;
    uint64 public creationBlock;
    uint64 public startingBlockAround;

    // specHash by which to validate the ballots integrity
    bytes32 public specHash;
    bool public useEncryption;

    // deprecation flag - doesn't actually do anything besides signal that this contract is deprecated;
    bool public deprecated = false;

    //// ** Events
    event CreatedBallot(address _creator, uint64[2] _openPeriod, bool _useEncryption, bytes32 _specHash);
    event SuccessfulPkVote(address voter, bytes32 ballot, bytes32 pubkey);
    event SuccessfulVote(address voter, bytes32 ballot);
    event SeckeyRevealed(bytes32 secretKey);
    event TestingEnabled();
    event Error(string error);
    event DeprecatedContract();
    event SetOwner(address _owner);


    //// ** Modifiers

    modifier onlyOwner {
        require(msg.sender == owner);
        _;
    }

    modifier ballotOpen {
        require(uint64(block.timestamp) >= startTime && uint64(block.timestamp) < endTime);
        _;
    }

    modifier onlyTesting {
        require(testMode);
        _;
    }

    modifier isTrue(bool _b) {
        require(_b == true);
        _;
    }

    modifier isFalse(bool _b) {
        require(_b == false);
        _;
    }

    //// ** Functions

    uint16 constant F_USE_ENC = 0;
    uint16 constant F_TESTING = 1;
    // Constructor function - init core params on deploy
    // timestampts are uint64s to give us plenty of room for millennia
    // flags are [_useEncryption, enableTesting]
    function SVLightBallotBox(bytes32 _specHash, uint64[2] openPeriod, bool[2] flags) public {
        owner = msg.sender;

        // take the max of the start time provided and the blocks timestamp to avoid a DoS against recent token holders
        // (which someone might be able to do if they could set the timestamp in the past)
        startTime = max(openPeriod[0], uint64(block.timestamp));
        endTime = openPeriod[1];
        useEncryption = flags[F_USE_ENC];
        specHash = _specHash;
        creationBlock = uint64(block.number);
        // add a rough prediction of what block is the starting block
        startingBlockAround = uint64((startTime - block.timestamp) / 15 + block.number);

        if (flags[F_TESTING]) {
            testMode = true;
            TestingEnabled();
        }

        CreatedBallot(msg.sender, [startTime, endTime], useEncryption, specHash);
    }

    // Ballot submission
    function submitBallotWithPk(bytes32 encryptedBallot, bytes32 senderPubkey) isTrue(useEncryption) ballotOpen public {
        addBallotAndVoterWithPk(encryptedBallot, senderPubkey);
        SuccessfulPkVote(msg.sender, encryptedBallot, senderPubkey);
    }

    function submitBallotNoPk(bytes32 ballot) isFalse(useEncryption) ballotOpen public {
        addBallotAndVoterNoPk(ballot);
        SuccessfulVote(msg.sender, ballot);
    }

    // Internal function to ensure atomicity of voter log
    function addBallotAndVoterWithPk(bytes32 encryptedBallot, bytes32 senderPubkey) internal {
        uint256 ballotNumber = addBallotAndVoterNoPk(encryptedBallot);
        associatedPubkeys[ballotNumber] = senderPubkey;
    }

    function addBallotAndVoterNoPk(bytes32 encryptedBallot) internal returns (uint256) {
        uint256 ballotNumber = nVotesCast;
        ballotMap[ballotNumber] = Ballot(encryptedBallot, msg.sender, uint32(block.number));
        voterToBallotID[msg.sender] = ballotNumber;
        nVotesCast += 1;
        return ballotNumber;
    }

    // Allow the owner to reveal the secret key after ballot conclusion
    function revealSeckey(bytes32 _secKey) onlyOwner public {
        require(block.timestamp > endTime);

        ballotEncryptionSeckey = _secKey;
        seckeyRevealed = true; // this flag allows the contract to be locked
        SeckeyRevealed(_secKey);
    }

    function getEncSeckey() public constant returns (bytes32) {
        return ballotEncryptionSeckey;
    }

    // Test functions
    function setEndTime(uint64 newEndTime) onlyTesting onlyOwner public {
        endTime = newEndTime;
    }

    function setDeprecated() onlyOwner public {
        deprecated = true;
        DeprecatedContract();
    }

    function setOwner(address newOwner) onlyOwner public {
        owner = newOwner;
        SetOwner(newOwner);
    }

    // utils
    function max(uint64 a, uint64 b) pure internal returns(uint64) {
        if (a > b) {
            return a;
        }
        return b;
    }
}


//
// The Index by which democracies and ballots are tracked (and optionally deployed).
// Author: Max Kaye <[email protected]>
// License: MIT
//

contract SVLightIndex {

    address public owner;

    struct Ballot {
        bytes32 specHash;
        bytes32 extraData;
        address votingContract;
        uint64 startTs;
    }

    struct Democ {
        string name;
        address admin;
        Ballot[] ballots;
    }

    mapping (bytes32 => Democ) public democs;
    bytes32[] public democList;

    // addresses that do not have to pay for democs
    mapping (address => bool) public democWhitelist;
    // democs that do not have to pay for issues
    mapping (address => bool) public ballotWhitelist;

    // payment details
    address public payTo;
    // uint128's used because they account for amounts up to 3.4e38 wei or 3.4e20 ether
    uint128 public democFee = 0.05 ether; // 0.05 ether; about $50 at 3 March 2018
    mapping (address => uint128) democFeeFor;
    uint128 public ballotFee = 0.01 ether; // 0.01 ether; about $10 at 3 March 2018
    mapping (address => uint128) ballotFeeFor;
    bool public paymentEnabled = true;

    uint8 constant PAY_DEMOC = 0;
    uint8 constant PAY_BALLOT = 1;

    function getPaymentParams(uint8 paymentType) internal constant returns (bool, uint128, uint128) {
        if (paymentType == PAY_DEMOC) {
            return (democWhitelist[msg.sender], democFee, democFeeFor[msg.sender]);
        } else if (paymentType == PAY_BALLOT) {
            return (ballotWhitelist[msg.sender], ballotFee, ballotFeeFor[msg.sender]);
        } else {
            assert(false);
        }
    }

    //* EVENTS /

    event PaymentMade(uint128[2] valAndRemainder);
    event DemocInit(string name, bytes32 democHash, address admin);
    event BallotInit(bytes32 specHash, uint64[2] openPeriod, bool[2] flags);
    event BallotAdded(bytes32 democHash, bytes32 specHash, bytes32 extraData, address votingContract);
    event SetFees(uint128[2] _newFees);
    event PaymentEnabled(bool _feeEnabled);

    //* MODIFIERS /

    modifier onlyBy(address _account) {
        require(msg.sender == _account);
        _;
    }

    modifier payReq(uint8 paymentType) {
        // get our whitelist, generalFee, and fee's for particular addresses
        bool wl;
        uint128 genFee;
        uint128 feeFor;
        (wl, genFee, feeFor) = getPaymentParams(paymentType);
        // init v to something large in case of exploit or something
        uint128 v = 1000 ether;
        // check whitelists - do not require payment in some cases
        if (paymentEnabled && !wl) {
            v = feeFor;
            if (v == 0){
                // if there's no fee for the individual user then set it to the general fee
                v = genFee;
            }
            require(msg.value >= v);

            // handle payments
            uint128 remainder = uint128(msg.value) - v;
            payTo.transfer(v); // .transfer so it throws on failure
            if (!msg.sender.send(remainder)){
                payTo.transfer(remainder);
            }
            PaymentMade([v, remainder]);
        }

        // do main
        _;
    }


    //* FUNCTIONS /


    // constructor
    function SVLightIndex() public {
        owner = msg.sender;
        payTo = msg.sender;
    }

    //* GLOBAL INFO */

    function nDemocs() public constant returns (uint256) {
        return democList.length;
    }

    //* PAYMENT AND OWNER FUNCTIONS */

    function setPayTo(address newPayTo) onlyBy(owner) public {
        payTo = newPayTo;
    }

    function setEth(uint128[2] newFees) onlyBy(owner) public {
        democFee = newFees[PAY_DEMOC];
        ballotFee = newFees[PAY_BALLOT];
        SetFees([democFee, ballotFee]);
    }

    function setOwner(address _owner) onlyBy(owner) public {
        owner = _owner;
    }

    function setPaymentEnabled(bool _enabled) onlyBy(owner) public {
        paymentEnabled = _enabled;
        PaymentEnabled(_enabled);
    }

    function setWhitelistDemoc(address addr, bool _free) onlyBy(owner) public {
        democWhitelist[addr] = _free;
    }

    function setWhitelistBallot(address addr, bool _free) onlyBy(owner) public {
        ballotWhitelist[addr] = _free;
    }

    function setFeeFor(address addr, uint128[2] fees) onlyBy(owner) public {
        democFeeFor[addr] = fees[PAY_DEMOC];
        ballotFeeFor[addr] = fees[PAY_BALLOT];
    }

    //* DEMOCRACY FUNCTIONS - INDIVIDUAL */

    function initDemoc(string democName) payReq(PAY_DEMOC) public payable returns (bytes32) {
        bytes32 democHash = keccak256(democName, msg.sender, democList.length, this);
        democList.push(democHash);
        democs[democHash].name = democName;
        democs[democHash].admin = msg.sender;
        DemocInit(democName, democHash, msg.sender);
        return democHash;
    }

    function getDemocInfo(bytes32 democHash) public constant returns (string name, address admin, uint256 nBallots) {
        return (democs[democHash].name, democs[democHash].admin, democs[democHash].ballots.length);
    }

    function setAdmin(bytes32 democHash, address newAdmin) onlyBy(democs[democHash].admin) public {
        democs[democHash].admin = newAdmin;
    }

    function nBallots(bytes32 democHash) public constant returns (uint256) {
        return democs[democHash].ballots.length;
    }

    function getNthBallot(bytes32 democHash, uint256 n) public constant returns (bytes32 specHash, bytes32 extraData, address votingContract, uint64 startTime) {
        return (democs[democHash].ballots[n].specHash, democs[democHash].ballots[n].extraData, democs[democHash].ballots[n].votingContract, democs[democHash].ballots[n].startTs);
    }

    //* ADD BALLOT TO RECORD */

    function _commitBallot(bytes32 democHash, bytes32 specHash, bytes32 extraData, address votingContract, uint64 startTs) internal {
        democs[democHash].ballots.push(Ballot(specHash, extraData, votingContract, startTs));
        BallotAdded(democHash, specHash, extraData, votingContract);
    }

    function addBallot(bytes32 democHash, bytes32 extraData, address votingContract)
                      onlyBy(democs[democHash].admin)
                      payReq(PAY_BALLOT)
                      public
                      payable
                      {
        SVLightBallotBox bb = SVLightBallotBox(votingContract);
        bytes32 specHash = bb.specHash();
        uint64 startTs = bb.startTime();
        _commitBallot(democHash, specHash, extraData, votingContract, startTs);
    }

    function deployBallot(bytes32 democHash, bytes32 specHash, bytes32 extraData,
                          uint64[2] openPeriod, bool[2] flags)
                          onlyBy(democs[democHash].admin)
                          payReq(PAY_BALLOT)
                          public payable {
        // the start time is max(startTime, block.timestamp) to avoid a DoS whereby a malicious electioneer could disenfranchise
        // token holders who have recently acquired tokens.
        uint64 startTs = max(openPeriod[0], uint64(block.timestamp));
        SVLightBallotBox votingContract = new SVLightBallotBox(specHash, [startTs, openPeriod[1]], flags);
        votingContract.setOwner(msg.sender);
        _commitBallot(democHash, specHash, extraData, address(votingContract), startTs);
        BallotInit(specHash, [startTs, openPeriod[1]], flags);
    }

    // utils
    function max(uint64 a, uint64 b) pure internal returns(uint64) {
        if (a > b) {
            return a;
        }
        return b;
    }
}

Contract Security Audit

Contract ABI

[{"constant":false,"inputs":[{"name":"_owner","type":"address"}],"name":"setOwner","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"addr","type":"address"},{"name":"_free","type":"bool"}],"name":"setWhitelistBallot","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"democHash","type":"bytes32"}],"name":"getDemocInfo","outputs":[{"name":"name","type":"string"},{"name":"admin","type":"address"},{"name":"nBallots","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_enabled","type":"bool"}],"name":"setPaymentEnabled","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"addr","type":"address"},{"name":"fees","type":"uint128[2]"}],"name":"setFeeFor","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"nDemocs","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"newPayTo","type":"address"}],"name":"setPayTo","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"democHash","type":"bytes32"},{"name":"specHash","type":"bytes32"},{"name":"extraData","type":"bytes32"},{"name":"openPeriod","type":"uint64[2]"},{"name":"flags","type":"bool[2]"}],"name":"deployBallot","outputs":[],"payable":true,"stateMutability":"payable","type":"function"},{"constant":true,"inputs":[],"name":"democFee","outputs":[{"name":"","type":"uint128"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"paymentEnabled","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"","type":"address"}],"name":"democWhitelist","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"democHash","type":"bytes32"},{"name":"n","type":"uint256"}],"name":"getNthBallot","outputs":[{"name":"specHash","type":"bytes32"},{"name":"extraData","type":"bytes32"},{"name":"votingContract","type":"address"},{"name":"startTime","type":"uint64"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"owner","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"","type":"bytes32"}],"name":"democs","outputs":[{"name":"name","type":"string"},{"name":"admin","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"democHash","type":"bytes32"},{"name":"extraData","type":"bytes32"},{"name":"votingContract","type":"address"}],"name":"addBallot","outputs":[],"payable":true,"stateMutability":"payable","type":"function"},{"constant":false,"inputs":[{"name":"addr","type":"address"},{"name":"_free","type":"bool"}],"name":"setWhitelistDemoc","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"payTo","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"newFees","type":"uint128[2]"}],"name":"setEth","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"","type":"address"}],"name":"ballotWhitelist","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"democHash","type":"bytes32"}],"name":"nBallots","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"ballotFee","outputs":[{"name":"","type":"uint128"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"","type":"uint256"}],"name":"democList","outputs":[{"name":"","type":"bytes32"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"democHash","type":"bytes32"},{"name":"newAdmin","type":"address"}],"name":"setAdmin","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"democName","type":"string"}],"name":"initDemoc","outputs":[{"name":"","type":"bytes32"}],"payable":true,"stateMutability":"payable","type":"function"},{"inputs":[],"payable":false,"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":false,"name":"valAndRemainder","type":"uint128[2]"}],"name":"PaymentMade","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"name":"name","type":"string"},{"indexed":false,"name":"democHash","type":"bytes32"},{"indexed":false,"name":"admin","type":"address"}],"name":"DemocInit","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"name":"specHash","type":"bytes32"},{"indexed":false,"name":"openPeriod","type":"uint64[2]"},{"indexed":false,"name":"flags","type":"bool[2]"}],"name":"BallotInit","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"name":"democHash","type":"bytes32"},{"indexed":false,"name":"specHash","type":"bytes32"},{"indexed":false,"name":"extraData","type":"bytes32"},{"indexed":false,"name":"votingContract","type":"address"}],"name":"BallotAdded","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"name":"_newFees","type":"uint128[2]"}],"name":"SetFees","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"name":"_feeEnabled","type":"bool"}],"name":"PaymentEnabled","type":"event"}]

6060604052600680546001608060020a031990811666b1a2bc2ec500001790915560088054909116662386f26fc10000179055600a805460ff19166001179055341561004a57600080fd5b60008054600160a060020a033316600160a060020a0319918216811790925560058054909116909117905561267b806100846000396000f3006060604052600436106200013d5763ffffffff60e060020a60003504166313af40358114620001425780631badfbae146200016657806327f4b056146200018d5780634d1ff18114620002385780635d7e721914620002535780635db38c63146200029f57806361b9739a14620002c757806362981b1814620002e95780636606b7d414620003545780636b3578f21462000386578063767af6b914620003b05780638825701614620003d25780638da5cb5b146200042c5780639bc29b7a146200045e578063a1a1efe71462000513578063b7b4fe13146200052f578063b837c58e1462000556578063b93dc802146200056c578063be1dbd2e14620005ab578063cf2317d514620005cd578063dbf1bfee14620005e6578063df2484ff14620005fc578063ee4024db1462000615578063f39d359b146200063a575b600080fd5b34156200014e57600080fd5b62000164600160a060020a036004351662000682565b005b34156200017257600080fd5b62000164600160a060020a03600435166024351515620006cf565b34156200019957600080fd5b620001a660043562000718565b604051600160a060020a03831660208201526040810182905260608082528190810185818151815260200191508051906020019080838360005b83811015620001fa578082015183820152602001620001e0565b50505050905090810190601f168015620002285780820380516001836020036101000a031916815260200191505b5094505050505060405180910390f35b34156200024457600080fd5b620001646004351515620007fd565b34156200025f57600080fd5b6200016460048035600160a060020a0316906064602460026040805190810160405280929190826002602002808284375093955062000861945050505050565b3415620002ab57600080fd5b620002b56200090c565b60405190815260200160405180910390f35b3415620002d357600080fd5b62000164600160a060020a036004351662000913565b620001646004803590602435906044359060a46064600260408051908101604052809291908260026020028082843782019150505050509190806040019060028060200260405190810160405280929190826002602002808284375093955062000960945050505050565b34156200036057600080fd5b6200036a62000d32565b6040516001608060020a03909116815260200160405180910390f35b34156200039257600080fd5b6200039c62000d41565b604051901515815260200160405180910390f35b3415620003bc57600080fd5b6200039c600160a060020a036004351662000d4a565b3415620003de57600080fd5b620003ee60043560243562000d5f565b6040519384526020840192909252600160a060020a031660408084019190915267ffffffffffffffff90911660608301526080909101905180910390f35b34156200043857600080fd5b6200044262000e57565b604051600160a060020a03909116815260200160405180910390f35b34156200046a57600080fd5b6200047760043562000e66565b604051600160a060020a038216602082015260408082528354600260001961010060018416150201909116049082018190528190606082019085908015620005035780601f10620004d75761010080835404028352916020019162000503565b820191906000526020600020905b815481529060010190602001808311620004e557829003601f168201915b5050935050505060405180910390f35b62000164600435602435600160a060020a036044351662000e87565b34156200053b57600080fd5b62000164600160a060020a0360043516602435151562001142565b34156200056257600080fd5b620004426200118b565b34156200057857600080fd5b6200016460046044816002604080519081016040528092919082600260200280828437509395506200119a945050505050565b3415620005b757600080fd5b6200039c600160a060020a036004351662001294565b3415620005d957600080fd5b620002b5600435620012a9565b3415620005f257600080fd5b6200036a620012be565b34156200060857600080fd5b620002b5600435620012cd565b34156200062157600080fd5b62000164600435600160a060020a0360243516620012ed565b620002b560046024813581810190830135806020601f820181900481020160405190810160405281815292919060208401838380828437509496506200135b95505050505050565b600054600160a060020a0390811690331681146200069f57600080fd5b506000805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b600054600160a060020a039081169033168114620006ec57600080fd5b50600160a060020a03919091166000908152600460205260409020805460ff1916911515919091179055565b62000722620018f5565b600082815260016020818152604080842080840154600280830154835488979496600160a060020a0390941695919487949082161561010002600019019091169290920491601f830181900481020190519081016040528092919081815260200182805460018160011615610100020316600290048015620007e85780601f10620007bc57610100808354040283529160200191620007e8565b820191906000526020600020905b815481529060010190602001808311620007ca57829003601f168201915b505050505092509250925092505b9193909250565b600054600160a060020a0390811690331681146200081a57600080fd5b600a805460ff19168315151790557fed53661a07b1eecfd9ce68c3067068f29dc710c7144b27617faed07dbec21b9082604051901515815260200160405180910390a15050565b600054600160a060020a0390811690331681146200087e57600080fd5b8151600160a060020a038416600090815260076020526040902080546fffffffffffffffffffffffffffffffff19166001608060020a03929092169190911790558160016020020151600160a060020a0393909316600090815260096020526040902080546fffffffffffffffffffffffffffffffff19166001608060020a03909416939093179092555050565b6002545b90565b600054600160a060020a0390811690331681146200093057600080fd5b506005805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b6000858152600160208190526040822001548190600160a060020a0390811690331681146200098e57600080fd5b60016000806000806000620009a386620016e0565b600a549297509095509350683635c9adc5dea00000925060ff168015620009c8575084155b1562000b2f578291506001608060020a0382161515620009e6578391505b6001608060020a038216341015620009fd57600080fd5b506005543482900390600160a060020a03166001608060020a03831680156108fc0290604051600060405180830381858888f19350505050151562000a4157600080fd5b600160a060020a0333166001608060020a03821680156108fc0290604051600060405180830381858888f19350505050151562000ab657600554600160a060020a03166001608060020a03821680156108fc0290604051600060405180830381858888f19350505050151562000ab657600080fd5b7f02c72dcc40109684591df90d749dbf94cfcc74677fac14e9b0d571b660484fca6040805190810160409081526001608060020a03808616835284166020830152518082604080838360005b8381101562000b1c57808201518382015260200162000b02565b5050505090500191505060405180910390a15b62000b3c8b514262001784565b98508c6040805190810160405267ffffffffffffffff8b1681526020808201908e015167ffffffffffffffff1690528b62000b7662001907565b8381526020810183604080838360005b8381101562000ba057808201518382015260200162000b86565b5050505090500182600260200280838360005b8381101562000bcd57808201518382015260200162000bb3565b505050509050019350505050604051809103906000f080151562000bf057600080fd5b975087600160a060020a03166313af40353360405160e060020a63ffffffff8416028152600160a060020a039091166004820152602401600060405180830381600087803b151562000c4157600080fd5b6102c65a03f1151562000c5357600080fd5b50505062000c658e8e8e8b8d620017b4565b7fbc7a1a229e81699a6e3aeb6f23b8ab68c29ac40d8943fe0f763978cd37fbd9468d6040805190810160405267ffffffffffffffff8c1681526020808201908f015167ffffffffffffffff1690528c6040518381526020810183604080838360005b8381101562000ce157808201518382015260200162000cc7565b5050505090500182600260200280838360005b8381101562000d0e57808201518382015260200162000cf4565b50505050905001935050505060405180910390a15050505050505050505050505050565b6006546001608060020a031681565b600a5460ff1681565b60036020526000908152604090205460ff1681565b60008281526001602052604081206002018054829182918291908690811062000d8457fe5b600091825260208083206003909202909101548883526001909152604090912060020180548790811062000db457fe5b6000918252602080832060016003909302018201548a8452919052604090912060020180548890811062000de457fe5b6000918252602080832060026003909302018201548b845260019091526040909220018054600160a060020a03909216918990811062000e2057fe5b906000526020600020906003020160020160149054906101000a900467ffffffffffffffff16935093509350935092959194509250565b600054600160a060020a031681565b600160208190526000918252604090912090810154600160a060020a031682565b60008381526001602081905260408220015481908190600160a060020a03908116903316811462000eb757600080fd5b6001600080600080600062000ecc86620016e0565b600a549297509095509350683635c9adc5dea00000925060ff16801562000ef1575084155b1562001058578291506001608060020a038216151562000f0f578391505b6001608060020a03821634101562000f2657600080fd5b506005543482900390600160a060020a03166001608060020a03831680156108fc0290604051600060405180830381858888f19350505050151562000f6a57600080fd5b600160a060020a0333166001608060020a03821680156108fc0290604051600060405180830381858888f19350505050151562000fdf57600554600160a060020a03166001608060020a03821680156108fc0290604051600060405180830381858888f19350505050151562000fdf57600080fd5b7f02c72dcc40109684591df90d749dbf94cfcc74677fac14e9b0d571b660484fca6040805190810160409081526001608060020a03808616835284166020830152518082604080838360005b83811015620010455780820151838201526020016200102b565b5050505090500191505060405180910390a15b8a995089600160a060020a031663839ea7766000604051602001526040518163ffffffff1660e060020a028152600401602060405180830381600087803b1515620010a257600080fd5b6102c65a03f11515620010b457600080fd5b5050506040518051995050600160a060020a038a166378e979256000604051602001526040518163ffffffff1660e060020a028152600401602060405180830381600087803b15156200110657600080fd5b6102c65a03f115156200111857600080fd5b505050604051805190509750620011338d8a8e8e8c620017b4565b50505050505050505050505050565b600054600160a060020a0390811690331681146200115f57600080fd5b50600160a060020a03919091166000908152600360205260409020805460ff1916911515919091179055565b600554600160a060020a031681565b600054600160a060020a039081169033168114620011b757600080fd5b8151600680546fffffffffffffffffffffffffffffffff19166001608060020a03929092169190911790558160016020020151600880546fffffffffffffffffffffffffffffffff19166001608060020a03929092169190911790557fb50669505fae6849285fbf48e490e26a77ecc9929129c80d25cd2043d0ba14446040805190810160409081526006546001608060020a039081168352600854166020830152518082604080838360005b838110156200127e57808201518382015260200162001264565b5050505090500191505060405180910390a15050565b60046020526000908152604090205460ff1681565b60009081526001602052604090206002015490565b6008546001608060020a031681565b6002805482908110620012dc57fe5b600091825260209091200154905081565b60008281526001602081905260409091200154600160a060020a0390811690331681146200131a57600080fd5b506000918252600160208190526040909220909101805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a03909216919091179055565b6000806000806000806000806200137286620016e0565b600a549297509095509350683635c9adc5dea00000925060ff16801562001397575084155b15620014fe578291506001608060020a0382161515620013b5578391505b6001608060020a038216341015620013cc57600080fd5b506005543482900390600160a060020a03166001608060020a03831680156108fc0290604051600060405180830381858888f1935050505015156200141057600080fd5b600160a060020a0333166001608060020a03821680156108fc0290604051600060405180830381858888f1935050505015156200148557600554600160a060020a03166001608060020a03821680156108fc0290604051600060405180830381858888f1935050505015156200148557600080fd5b7f02c72dcc40109684591df90d749dbf94cfcc74677fac14e9b0d571b660484fca6040805190810160409081526001608060020a03808616835284166020830152518082604080838360005b83811015620014eb578082015183820152602001620014d1565b5050505090500191505060405180910390a15b60025489903390306040518085805190602001908083835b60208310620015375780518252601f19909201916020918201910162001516565b6001836020036101000a0380198251168184511617909252505050600160a060020a039687166c010000000000000000000000009081029190930190815260148101959095525091909316026034820152604801915060409050518091039020965060028054806001018281620015af919062001918565b5060009182526020808320919091018990558882526001905260409020898051620015df92916020019062001944565b5060008781526001602081905260409182902001805473ffffffffffffffffffffffffffffffffffffffff191633600160a060020a038116919091179091557fe4ce3800aac9ab0f2b800a84893f01077fec89d059a04ba63cfe5851eebf75bf918b918a915160208101839052600160a060020a038216604082015260608082528190810185818151815260200191508051906020019080838360005b83811015620016965780820151838201526020016200167c565b50505050905090810190601f168015620016c45780820380516001836020036101000a031916815260200191505b5094505050505060405180910390a15094979650505050505050565b6000808060ff841615156200173257505050600160a060020a033316600090815260036020908152604080832054600654600790935292205460ff909216916001608060020a039182169116620007f6565b60ff8416600114156200178257505050600160a060020a033316600090815260046020908152604080832054600854600990935292205460ff909216916001608060020a039182169116620007f6565bfe5b60008167ffffffffffffffff168367ffffffffffffffff161115620017ab575081620017ae565b50805b92915050565b6000858152600160208190526040909120600201805490918101620017da8382620019c9565b916000526020600020906003020160006080604051908101604090815288825260208201889052600160a060020a0387169082015267ffffffffffffffff851660608201529190508151815560208201516001820155604082015160028201805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a039290921691909117905560608201518160020160146101000a81548167ffffffffffffffff021916908367ffffffffffffffff1602179055505050507fcd67d56088f4b97d8a591f2f1ba8f11349d19c0f4be8d29bef80df49372fdc46858585856040519384526020840192909252604080840191909152600160a060020a0390911660608301526080909101905180910390a15050505050565b60206040519081016040526000815290565b604051610bed8062001a6383390190565b8154818355818115116200193f576000838152602090206200193f918101908301620019f8565b505050565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f106200198757805160ff1916838001178555620019b7565b82800160010185558215620019b7579182015b82811115620019b75782518255916020019190600101906200199a565b50620019c5929150620019f8565b5090565b8154818355818115116200193f576003028160030283600052602060002091820191016200193f919062001a15565b6200091091905b80821115620019c55760008155600101620019ff565b6200091091905b80821115620019c557600080825560018201556002810180547fffffffff0000000000000000000000000000000000000000000000000000000016905560030162001a1c560060606040526000805460a060020a60ff02191681556003556006805460ff191690556009805461ff0019169055341561003757600080fd5b60405160a080610bed8339810160405280805160008054600160a060020a03191633600160a060020a0316179055915060208101906060016100878251426401000000006108ca61028e82021704565b600680546001604060020a03929092166101000268ffffffffffffffff00199092169190911790556020820151600680546001604060020a0392909216690100000000000000000002604860020a608860020a031990921691909117905580516009805460ff1916911515919091179055600883905560068054608860020a60c860020a03191671010000000000000000000000000000000000436001604060020a038181169290920292909217928390559091600f914261010090920416036007805467ffffffffffffffff191692909104929092016001604060020a03161790558060016020020151156101cb576000805460a060020a60ff021916740100000000000000000000000000000000000000001790557f641e6b9d2f3c463bec5b5cffe3f5017d9a49ad5543d2962eb746c6a7afa223c560405160405180910390a15b7f72e9f65ccb8c470c69c19a96f9ebf2ecfda0034e60416b28bdc6f25cce1d244d336040805190810160409081526006546001604060020a03610100820481168452690100000000000000000090910416602083015260095460085460ff9091169151600160a060020a03851681526020810184604080838360005b8381101561025f578082015183820152602001610247565b5050505094151591909401908152602081019290925250604090810193509150505180910390a15050506102ba565b6000816001604060020a0316836001604060020a031611156102b15750816102b4565b50805b92915050565b610924806102c96000396000f30060606040526004361061011c5763ffffffff7c0100000000000000000000000000000000000000000000000000000000600035041663023e36d881146101215780630e136b191461014657806313af40351461016d578063176345141461018e578063245b565d146101be5780633197cbb6146101d157806334aba1ce146101e45780633dc286ae146101f7578063432ba8be1461020a57806349d5e18f1461022957806378e979251461023c578063839ea7761461024f5780638da5cb5b1461026257806398203e6b14610291578063b49730ca146102a4578063b9ae4bda146102ec578063bc19bcbf14610302578063cbc265ac1461031b578063cd9ea34214610331578063dea7b76814610344578063e945c3911461035a575b600080fd5b341561012c57600080fd5b61013461037a565b60405190815260200160405180910390f35b341561015157600080fd5b610159610380565b604051901515815260200160405180910390f35b341561017857600080fd5b61018c600160a060020a036004351661038e565b005b341561019957600080fd5b6101a1610411565b60405167ffffffffffffffff909116815260200160405180910390f35b34156101c957600080fd5b610134610436565b34156101dc57600080fd5b6101a161043c565b34156101ef57600080fd5b6101a1610459565b341561020257600080fd5b610134610469565b341561021557600080fd5b610134600160a060020a036004351661046f565b341561023457600080fd5b610159610481565b341561024757600080fd5b6101a161048a565b341561025a57600080fd5b61013461049f565b341561026d57600080fd5b6102756104a5565b604051600160a060020a03909116815260200160405180910390f35b341561029c57600080fd5b61018c6104b4565b34156102af57600080fd5b6102ba60043561050c565b604051928352600160a060020a03909116602083015263ffffffff166040808301919091526060909101905180910390f35b34156102f757600080fd5b61013460043561053d565b341561030d57600080fd5b61018c60043560243561054f565b341561032657600080fd5b61018c600435610612565b341561033c57600080fd5b61015961069a565b341561034f57600080fd5b61018c6004356106aa565b341561036557600080fd5b61018c67ffffffffffffffff6004351661075b565b60035481565b600954610100900460ff1681565b60005433600160a060020a039081169116146103a957600080fd5b6000805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0383161790557f167d3e9c1016ab80e58802ca9da10ce5c6a0f4debc46a2e7a2cd9e56899a4fb581604051600160a060020a03909116815260200160405180910390a150565b60065471010000000000000000000000000000000000900467ffffffffffffffff1681565b60055481565b6006546901000000000000000000900467ffffffffffffffff1681565b60075467ffffffffffffffff1681565b60055490565b60046020526000908152604090205481565b60095460ff1681565b600654610100900467ffffffffffffffff1681565b60085481565b600054600160a060020a031681565b60005433600160a060020a039081169116146104cf57600080fd5b6009805461ff0019166101001790557f77563e26f751f6c469d11286ef3f15cb0d2033a8b182387a2a4478201996178760405160405180910390a1565b60016020819052600091825260409091208054910154600160a060020a0381169060a060020a900463ffffffff1683565b60026020526000908152604090205481565b60095460ff1680151560011461056457600080fd5b60065467ffffffffffffffff610100909104811642909116108015906105a7575060065467ffffffffffffffff6901000000000000000000909104811642909116105b15156105b257600080fd5b6105bc83836107c8565b7f9368bc78a0bff8558a96f0716c502e7826c09faab0999d15c1464d46432866ec338484604051600160a060020a03909316835260208301919091526040808301919091526060909101905180910390a1505050565b60005433600160a060020a0390811691161461062d57600080fd5b6006546901000000000000000000900467ffffffffffffffff16421161065257600080fd5b60058190556006805460ff191660011790557fa69839328d982396193483f2260936b1d1f2109fdde204b27c7ac3c1cfd18db08160405190815260200160405180910390a150565b60005460a060020a900460ff1681565b60095460ff1680156106bb57600080fd5b60065467ffffffffffffffff610100909104811642909116108015906106fe575060065467ffffffffffffffff6901000000000000000000909104811642909116105b151561070957600080fd5b610712826107e9565b507f620a05d88e802eea13268414c30858ec8b2524d13ee3e3e93519ac140047eba43383604051600160a060020a03909216825260208201526040908101905180910390a15050565b60005460a060020a900460ff16151561077357600080fd5b60005433600160a060020a0390811691161461078e57600080fd5b6006805467ffffffffffffffff90921669010000000000000000000270ffffffffffffffff00000000000000000019909216919091179055565b60006107d3836107e9565b6000908152600260205260409020919091555050565b60035460009060606040519081016040908152848252600160a060020a03331660208084019190915263ffffffff431682840152600084815260019091522081518155602082015160018201805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a039290921691909117905560408201516001918201805463ffffffff9290921660a060020a0277ffffffff000000000000000000000000000000000000000019909216919091179055600160a060020a0333166000908152600460205260409020839055600380549091019055509050919050565b60008167ffffffffffffffff168367ffffffffffffffff1611156108ef5750816108f2565b50805b929150505600a165627a7a72305820e8e53a8a993157771a0cc957d24914bfc5216a97fd9b3bc59b310694310c02790029a165627a7a723058202d4ab3817e2d3b679c38d218cb113aa8854e8d847df2c396a408db59a316ac170029

Swarm Source

bzzr://2d4ab3817e2d3b679c38d218cb113aa8854e8d847df2c396a408db59a316ac17
Block Transaction Difficulty Gas Used Reward
Block Uncle Number Difficulty Gas Used Reward
Loading
Loading
Make sure to use the "Vote Down" button for any spammy posts, and the "Vote Up" for interesting conversations.