ETH Price: $3,072.90 (-0.67%)
Gas: 24 Gwei

Contract

0x7fEcaB617c868Bb5996d99D95200D2Fa708218e4
 

Overview

ETH Balance

0 ETH

Eth Value

$0.00

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To
Value
Update Document ...116371702021-01-12 1:35:341191 days ago1610415334IN
0x7fEcaB61...a708218e4
0 ETH0.0261969680
Update Document ...92547262020-01-10 18:36:551558 days ago1578681415IN
0x7fEcaB61...a708218e4
0 ETH0.000327461
Transfer Ownersh...67849432018-11-27 23:34:091967 days ago1543361649IN
0x7fEcaB61...a708218e4
0 ETH0.000123964
0x6080604067849122018-11-27 23:25:181967 days ago1543361118IN
 Create: Polls
0 ETH0.005176924

View more zero value Internal Transactions in Advanced View mode

Advanced mode:
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
Polls

Compiler Version
v0.4.24+commit.e67f0147

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion

Contract Source Code (Solidity)

/**
 *Submitted for verification at Etherscan.io on 2019-01-04
*/

//  the azimuth polls data store
//  https://azimuth.network

pragma solidity 0.4.24;

////////////////////////////////////////////////////////////////////////////////
//  Imports
////////////////////////////////////////////////////////////////////////////////

// OpenZeppelin's SafeMath.sol

/**
 * @title SafeMath
 * @dev Math operations with safety checks that throw on error
 */
library SafeMath {

  /**
  * @dev Multiplies two numbers, throws on overflow.
  */
  function mul(uint256 _a, uint256 _b) internal pure returns (uint256 c) {
    // Gas optimization: this is cheaper than asserting 'a' not being zero, but the
    // benefit is lost if 'b' is also tested.
    // See: https://github.com/OpenZeppelin/openzeppelin-solidity/pull/522
    if (_a == 0) {
      return 0;
    }

    c = _a * _b;
    assert(c / _a == _b);
    return c;
  }

  /**
  * @dev Integer division of two numbers, truncating the quotient.
  */
  function div(uint256 _a, uint256 _b) internal pure returns (uint256) {
    // assert(_b > 0); // Solidity automatically throws when dividing by 0
    // uint256 c = _a / _b;
    // assert(_a == _b * c + _a % _b); // There is no case in which this doesn't hold
    return _a / _b;
  }

  /**
  * @dev Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend).
  */
  function sub(uint256 _a, uint256 _b) internal pure returns (uint256) {
    assert(_b <= _a);
    return _a - _b;
  }

  /**
  * @dev Adds two numbers, throws on overflow.
  */
  function add(uint256 _a, uint256 _b) internal pure returns (uint256 c) {
    c = _a + _b;
    assert(c >= _a);
    return c;
  }
}

// Azimuth's SafeMath8.sol

/**
 * @title SafeMath8
 * @dev Math operations for uint8 with safety checks that throw on error
 */
library SafeMath8 {
  function mul(uint8 a, uint8 b) internal pure returns (uint8) {
    uint8 c = a * b;
    assert(a == 0 || c / a == b);
    return c;
  }

  function div(uint8 a, uint8 b) internal pure returns (uint8) {
    // assert(b > 0); // Solidity automatically throws when dividing by 0
    uint8 c = a / b;
    // assert(a == b * c + a % b); // There is no case in which this doesn't hold
    return c;
  }

  function sub(uint8 a, uint8 b) internal pure returns (uint8) {
    assert(b <= a);
    return a - b;
  }

  function add(uint8 a, uint8 b) internal pure returns (uint8) {
    uint8 c = a + b;
    assert(c >= a);
    return c;
  }
}

// Azimuth's SafeMath16.sol

/**
 * @title SafeMath16
 * @dev Math operations for uint16 with safety checks that throw on error
 */
library SafeMath16 {
  function mul(uint16 a, uint16 b) internal pure returns (uint16) {
    uint16 c = a * b;
    assert(a == 0 || c / a == b);
    return c;
  }

  function div(uint16 a, uint16 b) internal pure returns (uint16) {
    // assert(b > 0); // Solidity automatically throws when dividing by 0
    uint16 c = a / b;
    // assert(a == b * c + a % b); // There is no case in which this doesn't hold
    return c;
  }

  function sub(uint16 a, uint16 b) internal pure returns (uint16) {
    assert(b <= a);
    return a - b;
  }

  function add(uint16 a, uint16 b) internal pure returns (uint16) {
    uint16 c = a + b;
    assert(c >= a);
    return c;
  }
}

// OpenZeppelin's Ownable.sol

/**
 * @title Ownable
 * @dev The Ownable contract has an owner address, and provides basic authorization control
 * functions, this simplifies the implementation of "user permissions".
 */
contract Ownable {
  address public owner;


  event OwnershipRenounced(address indexed previousOwner);
  event OwnershipTransferred(
    address indexed previousOwner,
    address indexed newOwner
  );


  /**
   * @dev The Ownable constructor sets the original `owner` of the contract to the sender
   * account.
   */
  constructor() public {
    owner = msg.sender;
  }

  /**
   * @dev Throws if called by any account other than the owner.
   */
  modifier onlyOwner() {
    require(msg.sender == owner);
    _;
  }

  /**
   * @dev Allows the current owner to relinquish control of the contract.
   * @notice Renouncing to ownership will leave the contract without an owner.
   * It will not be possible to call the functions with the `onlyOwner`
   * modifier anymore.
   */
  function renounceOwnership() public onlyOwner {
    emit OwnershipRenounced(owner);
    owner = address(0);
  }

  /**
   * @dev Allows the current owner to transfer control of the contract to a newOwner.
   * @param _newOwner The address to transfer ownership to.
   */
  function transferOwnership(address _newOwner) public onlyOwner {
    _transferOwnership(_newOwner);
  }

  /**
   * @dev Transfers control of the contract to a newOwner.
   * @param _newOwner The address to transfer ownership to.
   */
  function _transferOwnership(address _newOwner) internal {
    require(_newOwner != address(0));
    emit OwnershipTransferred(owner, _newOwner);
    owner = _newOwner;
  }
}

////////////////////////////////////////////////////////////////////////////////
//  Polls
////////////////////////////////////////////////////////////////////////////////

//  Polls: proposals & votes data contract
//
//    This contract is used for storing all data related to the proposals
//    of the senate (galaxy owners) and their votes on those proposals.
//    It keeps track of votes and uses them to calculate whether a majority
//    is in favor of a proposal.
//
//    Every galaxy can only vote on a proposal exactly once. Votes cannot
//    be changed. If a proposal fails to achieve majority within its
//    duration, it can be restarted after its cooldown period has passed.
//
//    The requirements for a proposal to achieve majority are as follows:
//    - At least 1/4 of the currently active voters (rounded down) must have
//      voted in favor of the proposal,
//    - More than half of the votes cast must be in favor of the proposal,
//      and this can no longer change, either because
//      - the poll duration has passed, or
//      - not enough voters remain to take away the in-favor majority.
//    As soon as these conditions are met, no further interaction with
//    the proposal is possible. Achieving majority is permanent.
//
//    Since data stores are difficult to upgrade, all of the logic unrelated
//    to the voting itself (that is, determining who is eligible to vote)
//    is expected to be implemented by this contract's owner.
//
//    This contract will be owned by the Ecliptic contract.
//
contract Polls is Ownable
{
  using SafeMath for uint256;
  using SafeMath16 for uint16;
  using SafeMath8 for uint8;

  //  UpgradePollStarted: a poll on :proposal has opened
  //
  event UpgradePollStarted(address proposal);

  //  DocumentPollStarted: a poll on :proposal has opened
  //
  event DocumentPollStarted(bytes32 proposal);

  //  UpgradeMajority: :proposal has achieved majority
  //
  event UpgradeMajority(address proposal);

  //  DocumentMajority: :proposal has achieved majority
  //
  event DocumentMajority(bytes32 proposal);

  //  Poll: full poll state
  //
  struct Poll
  {
    //  start: the timestamp at which the poll was started
    //
    uint256 start;

    //  voted: per galaxy, whether they have voted on this poll
    //
    bool[256] voted;

    //  yesVotes: amount of votes in favor of the proposal
    //
    uint16 yesVotes;

    //  noVotes: amount of votes against the proposal
    //
    uint16 noVotes;

    //  duration: amount of time during which the poll can be voted on
    //
    uint256 duration;

    //  cooldown: amount of time before the (non-majority) poll can be reopened
    //
    uint256 cooldown;
  }

  //  pollDuration: duration set for new polls. see also Poll.duration above
  //
  uint256 public pollDuration;

  //  pollCooldown: cooldown set for new polls. see also Poll.cooldown above
  //
  uint256 public pollCooldown;

  //  totalVoters: amount of active galaxies
  //
  uint16 public totalVoters;

  //  upgradeProposals: list of all upgrades ever proposed
  //
  //    this allows clients to discover the existence of polls.
  //    from there, they can do liveness checks on the polls themselves.
  //
  address[] public upgradeProposals;

  //  upgradePolls: per address, poll held to determine if that address
  //                will become the new ecliptic
  //
  mapping(address => Poll) public upgradePolls;

  //  upgradeHasAchievedMajority: per address, whether that address
  //                              has ever achieved majority
  //
  //    If we did not store this, we would have to look at old poll data
  //    to see whether or not a proposal has ever achieved majority.
  //    Since the outcome of a poll is calculated based on :totalVoters,
  //    which may not be consistent across time, we need to store outcomes
  //    explicitly instead of re-calculating them. This allows us to always
  //    tell with certainty whether or not a majority was achieved,
  //    regardless of the current :totalVoters.
  //
  mapping(address => bool) public upgradeHasAchievedMajority;

  //  documentProposals: list of all documents ever proposed
  //
  //    this allows clients to discover the existence of polls.
  //    from there, they can do liveness checks on the polls themselves.
  //
  bytes32[] public documentProposals;

  //  documentPolls: per hash, poll held to determine if the corresponding
  //                 document is accepted by the galactic senate
  //
  mapping(bytes32 => Poll) public documentPolls;

  //  documentHasAchievedMajority: per hash, whether that hash has ever
  //                               achieved majority
  //
  //    the note for upgradeHasAchievedMajority above applies here as well
  //
  mapping(bytes32 => bool) public documentHasAchievedMajority;

  //  documentMajorities: all hashes that have achieved majority
  //
  bytes32[] public documentMajorities;

  //  constructor(): initial contract configuration
  //
  constructor(uint256 _pollDuration, uint256 _pollCooldown)
    public
  {
    reconfigure(_pollDuration, _pollCooldown);
  }

  //  reconfigure(): change poll duration and cooldown
  //
  function reconfigure(uint256 _pollDuration, uint256 _pollCooldown)
    public
    onlyOwner
  {
    require( (5 days <= _pollDuration) && (_pollDuration <= 90 days) &&
             (5 days <= _pollCooldown) && (_pollCooldown <= 90 days) );
    pollDuration = _pollDuration;
    pollCooldown = _pollCooldown;
  }

  //  incrementTotalVoters(): increase the amount of registered voters
  //
  function incrementTotalVoters()
    external
    onlyOwner
  {
    require(totalVoters < 256);
    totalVoters = totalVoters.add(1);
  }

  //  getAllUpgradeProposals(): return array of all upgrade proposals ever made
  //
  //    Note: only useful for clients, as Solidity does not currently
  //    support returning dynamic arrays.
  //
  function getUpgradeProposals()
    external
    view
    returns (address[] proposals)
  {
    return upgradeProposals;
  }

  //  getUpgradeProposalCount(): get the number of unique proposed upgrades
  //
  function getUpgradeProposalCount()
    external
    view
    returns (uint256 count)
  {
    return upgradeProposals.length;
  }

  //  getAllDocumentProposals(): return array of all upgrade proposals ever made
  //
  //    Note: only useful for clients, as Solidity does not currently
  //    support returning dynamic arrays.
  //
  function getDocumentProposals()
    external
    view
    returns (bytes32[] proposals)
  {
    return documentProposals;
  }

  //  getDocumentProposalCount(): get the number of unique proposed upgrades
  //
  function getDocumentProposalCount()
    external
    view
    returns (uint256 count)
  {
    return documentProposals.length;
  }

  //  getDocumentMajorities(): return array of all document majorities
  //
  //    Note: only useful for clients, as Solidity does not currently
  //    support returning dynamic arrays.
  //
  function getDocumentMajorities()
    external
    view
    returns (bytes32[] majorities)
  {
    return documentMajorities;
  }

  //  hasVotedOnUpgradePoll(): returns true if _galaxy has voted
  //                           on the _proposal
  //
  function hasVotedOnUpgradePoll(uint8 _galaxy, address _proposal)
    external
    view
    returns (bool result)
  {
    return upgradePolls[_proposal].voted[_galaxy];
  }

  //  hasVotedOnDocumentPoll(): returns true if _galaxy has voted
  //                            on the _proposal
  //
  function hasVotedOnDocumentPoll(uint8 _galaxy, bytes32 _proposal)
    external
    view
    returns (bool result)
  {
    return documentPolls[_proposal].voted[_galaxy];
  }

  //  startUpgradePoll(): open a poll on making _proposal the new ecliptic
  //
  function startUpgradePoll(address _proposal)
    external
    onlyOwner
  {
    //  _proposal must not have achieved majority before
    //
    require(!upgradeHasAchievedMajority[_proposal]);

    Poll storage poll = upgradePolls[_proposal];

    //  if the proposal is being made for the first time, register it.
    //
    if (0 == poll.start)
    {
      upgradeProposals.push(_proposal);
    }

    startPoll(poll);
    emit UpgradePollStarted(_proposal);
  }

  //  startDocumentPoll(): open a poll on accepting the document
  //                       whose hash is _proposal
  //
  function startDocumentPoll(bytes32 _proposal)
    external
    onlyOwner
  {
    //  _proposal must not have achieved majority before
    //
    require(!documentHasAchievedMajority[_proposal]);

    Poll storage poll = documentPolls[_proposal];

    //  if the proposal is being made for the first time, register it.
    //
    if (0 == poll.start)
    {
      documentProposals.push(_proposal);
    }

    startPoll(poll);
    emit DocumentPollStarted(_proposal);
  }

  //  startPoll(): open a new poll, or re-open an old one
  //
  function startPoll(Poll storage _poll)
    internal
  {
    //  check that the poll has cooled down enough to be started again
    //
    //    for completely new polls, the values used will be zero
    //
    require( block.timestamp > ( _poll.start.add(
                                 _poll.duration.add(
                                 _poll.cooldown )) ) );

    //  set started poll state
    //
    _poll.start = block.timestamp;
    delete _poll.voted;
    _poll.yesVotes = 0;
    _poll.noVotes = 0;
    _poll.duration = pollDuration;
    _poll.cooldown = pollCooldown;
  }

  //  castUpgradeVote(): as galaxy _as, cast a vote on the _proposal
  //
  //    _vote is true when in favor of the proposal, false otherwise
  //
  function castUpgradeVote(uint8 _as, address _proposal, bool _vote)
    external
    onlyOwner
    returns (bool majority)
  {
    Poll storage poll = upgradePolls[_proposal];
    processVote(poll, _as, _vote);
    return updateUpgradePoll(_proposal);
  }

  //  castDocumentVote(): as galaxy _as, cast a vote on the _proposal
  //
  //    _vote is true when in favor of the proposal, false otherwise
  //
  function castDocumentVote(uint8 _as, bytes32 _proposal, bool _vote)
    external
    onlyOwner
    returns (bool majority)
  {
    Poll storage poll = documentPolls[_proposal];
    processVote(poll, _as, _vote);
    return updateDocumentPoll(_proposal);
  }

  //  processVote(): record a vote from _as on the _poll
  //
  function processVote(Poll storage _poll, uint8 _as, bool _vote)
    internal
  {
    //  assist symbolic execution tools
    //
    assert(block.timestamp >= _poll.start);

    require( //  may only vote once
             //
             !_poll.voted[_as] &&
             //
             //  may only vote when the poll is open
             //
             (block.timestamp < _poll.start.add(_poll.duration)) );

    //  update poll state to account for the new vote
    //
    _poll.voted[_as] = true;
    if (_vote)
    {
      _poll.yesVotes = _poll.yesVotes.add(1);
    }
    else
    {
      _poll.noVotes = _poll.noVotes.add(1);
    }
  }

  //  updateUpgradePoll(): check whether the _proposal has achieved
  //                            majority, updating state, sending an event,
  //                            and returning true if it has
  //
  function updateUpgradePoll(address _proposal)
    public
    onlyOwner
    returns (bool majority)
  {
    //  _proposal must not have achieved majority before
    //
    require(!upgradeHasAchievedMajority[_proposal]);

    //  check for majority in the poll
    //
    Poll storage poll = upgradePolls[_proposal];
    majority = checkPollMajority(poll);

    //  if majority was achieved, update the state and send an event
    //
    if (majority)
    {
      upgradeHasAchievedMajority[_proposal] = true;
      emit UpgradeMajority(_proposal);
    }
    return majority;
  }

  //  updateDocumentPoll(): check whether the _proposal has achieved majority,
  //                        updating the state and sending an event if it has
  //
  //    this can be called by anyone, because the ecliptic does not
  //    need to be aware of the result
  //
  function updateDocumentPoll(bytes32 _proposal)
    public
    returns (bool majority)
  {
    //  _proposal must not have achieved majority before
    //
    require(!documentHasAchievedMajority[_proposal]);

    //  check for majority in the poll
    //
    Poll storage poll = documentPolls[_proposal];
    majority = checkPollMajority(poll);

    //  if majority was achieved, update state and send an event
    //
    if (majority)
    {
      documentHasAchievedMajority[_proposal] = true;
      documentMajorities.push(_proposal);
      emit DocumentMajority(_proposal);
    }
    return majority;
  }

  //  checkPollMajority(): returns true if the majority is in favor of
  //                       the subject of the poll
  //
  function checkPollMajority(Poll _poll)
    internal
    view
    returns (bool majority)
  {
    return ( //  poll must have at least the minimum required yes-votes
             //
             (_poll.yesVotes >= (totalVoters / 4)) &&
             //
             //  and have a majority...
             //
             (_poll.yesVotes > _poll.noVotes) &&
             //
             //  ...that is indisputable
             //
             ( //  either because the poll has ended
               //
               (block.timestamp > _poll.start.add(_poll.duration)) ||
               //
               //  or there are more yes votes than there can be no votes
               //
               ( _poll.yesVotes > totalVoters.sub(_poll.yesVotes) ) ) );
  }
}

Contract Security Audit

Contract ABI

[{"constant":true,"inputs":[],"name":"pollDuration","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_proposal","type":"bytes32"}],"name":"updateDocumentPoll","outputs":[{"name":"majority","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"getUpgradeProposals","outputs":[{"name":"proposals","type":"address[]"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[],"name":"incrementTotalVoters","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"getDocumentMajorities","outputs":[{"name":"majorities","type":"bytes32[]"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_as","type":"uint8"},{"name":"_proposal","type":"address"},{"name":"_vote","type":"bool"}],"name":"castUpgradeVote","outputs":[{"name":"majority","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"_proposal","type":"address"}],"name":"updateUpgradePoll","outputs":[{"name":"majority","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"totalVoters","outputs":[{"name":"","type":"uint16"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"_galaxy","type":"uint8"},{"name":"_proposal","type":"bytes32"}],"name":"hasVotedOnDocumentPoll","outputs":[{"name":"result","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_as","type":"uint8"},{"name":"_proposal","type":"bytes32"},{"name":"_vote","type":"bool"}],"name":"castDocumentVote","outputs":[{"name":"majority","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[],"name":"renounceOwnership","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"","type":"bytes32"}],"name":"documentHasAchievedMajority","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"owner","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_proposal","type":"bytes32"}],"name":"startDocumentPoll","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"","type":"uint256"}],"name":"upgradeProposals","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"","type":"bytes32"}],"name":"documentPolls","outputs":[{"name":"start","type":"uint256"},{"name":"yesVotes","type":"uint16"},{"name":"noVotes","type":"uint16"},{"name":"duration","type":"uint256"},{"name":"cooldown","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"","type":"uint256"}],"name":"documentProposals","outputs":[{"name":"","type":"bytes32"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"getUpgradeProposalCount","outputs":[{"name":"count","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"getDocumentProposalCount","outputs":[{"name":"count","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"getDocumentProposals","outputs":[{"name":"proposals","type":"bytes32[]"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"pollCooldown","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_pollDuration","type":"uint256"},{"name":"_pollCooldown","type":"uint256"}],"name":"reconfigure","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"","type":"address"}],"name":"upgradePolls","outputs":[{"name":"start","type":"uint256"},{"name":"yesVotes","type":"uint16"},{"name":"noVotes","type":"uint16"},{"name":"duration","type":"uint256"},{"name":"cooldown","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"","type":"address"}],"name":"upgradeHasAchievedMajority","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_proposal","type":"address"}],"name":"startUpgradePoll","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"_newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"","type":"uint256"}],"name":"documentMajorities","outputs":[{"name":"","type":"bytes32"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"_galaxy","type":"uint8"},{"name":"_proposal","type":"address"}],"name":"hasVotedOnUpgradePoll","outputs":[{"name":"result","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"inputs":[{"name":"_pollDuration","type":"uint256"},{"name":"_pollCooldown","type":"uint256"}],"payable":false,"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":false,"name":"proposal","type":"address"}],"name":"UpgradePollStarted","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"name":"proposal","type":"bytes32"}],"name":"DocumentPollStarted","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"name":"proposal","type":"address"}],"name":"UpgradeMajority","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"name":"proposal","type":"bytes32"}],"name":"DocumentMajority","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"previousOwner","type":"address"}],"name":"OwnershipRenounced","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"previousOwner","type":"address"},{"indexed":true,"name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"}]

608060405234801561001057600080fd5b506040516040806111ee83398101604052805160209091015160008054600160a060020a0319163317905561004e8282640100000000610055810204565b50506100b6565b600054600160a060020a0316331461006c57600080fd5b81620697801115801561008257506276a7008211155b80156100915750806206978011155b80156100a057506276a7008111155b15156100ab57600080fd5b600191909155600255565b611129806100c56000396000f3006080604052600436106101695763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166303a6930b811461016e578063172a735c146101955780631d075862146101c1578063246d41a91461022657806334fe00b11461023d57806351de5541146102525780635623715b1461027e5780635f5300ff1461029f57806369422924146102cb5780636eb58224146102e9578063715018a61461030c578063834e3822146103215780638da5cb5b146103395780639a33aff91461036a5780639fa4276914610382578063a2ebd2d51461039a578063a46d41cf146103e4578063a6245974146103fc578063b953a9ac14610411578063bc634abb14610426578063d22687e41461043b578063da3d7d7f14610450578063dbbd96d21461046b578063dc2b054e1461048c578063e31f3e0c146104ad578063f2fde38b146104ce578063f740d100146104ef578063f8abb93d14610507575b600080fd5b34801561017a57600080fd5b5061018361052e565b60408051918252519081900360200190f35b3480156101a157600080fd5b506101ad600435610534565b604080519115158252519081900360200190f35b3480156101cd57600080fd5b506101d6610698565b60408051602080825283518183015283519192839290830191858101910280838360005b838110156102125781810151838201526020016101fa565b505050509050019250505060405180910390f35b34801561023257600080fd5b5061023b6106fb565b005b34801561024957600080fd5b506101d6610758565b34801561025e57600080fd5b506101ad60ff60043516600160a060020a036024351660443515156107b0565b34801561028a57600080fd5b506101ad600160a060020a0360043516610800565b3480156102ab57600080fd5b506102b461094c565b6040805161ffff9092168252519081900360200190f35b3480156102d757600080fd5b506101ad60ff60043516602435610956565b3480156102f557600080fd5b506101ad60ff600435166024356044351515610994565b34801561031857600080fd5b5061023b6109d1565b34801561032d57600080fd5b506101ad600435610a3d565b34801561034557600080fd5b5061034e610a52565b60408051600160a060020a039092168252519081900360200190f35b34801561037657600080fd5b5061023b600435610a61565b34801561038e57600080fd5b5061034e600435610b22565b3480156103a657600080fd5b506103b2600435610b4a565b6040805195865261ffff9485166020870152929093168483015260608401526080830191909152519081900360a00190f35b3480156103f057600080fd5b50610183600435610b7f565b34801561040857600080fd5b50610183610b9e565b34801561041d57600080fd5b50610183610ba4565b34801561043257600080fd5b506101d6610baa565b34801561044757600080fd5b50610183610c01565b34801561045c57600080fd5b5061023b600435602435610c07565b34801561047757600080fd5b506103b2600160a060020a0360043516610c68565b34801561049857600080fd5b506101ad600160a060020a0360043516610c9d565b3480156104b957600080fd5b5061023b600160a060020a0360043516610cb2565b3480156104da57600080fd5b5061023b600160a060020a0360043516610db3565b3480156104fb57600080fd5b50610183600435610dd6565b34801561051357600080fd5b506101ad60ff60043516600160a060020a0360243516610de4565b60015481565b600081815260096020526040812054819060ff161561055257600080fd5b506000828152600860209081526040808320815160c0810183528154815282516120008101938490529194610606949193869392850192916001850191610100918390855b825461010083900a900460ff16151581526020600192830181810494850194909303909202910180841161059757505050928452505050600982015461ffff808216602084015262010000909104166040820152600a8201546060820152600b90910154608090910152610e0e565b91508115610692576000838152600960209081526040808320805460ff19166001908117909155600a805491820181559093527fc65a7bb8d6351c1cf70c95a316cc6a92839c986682d98bc35f958f4883f9d2a8909201859055815185815291517fb11c3a231f918730636de6d815e478d63aead4aaaac95266c95b0278ff7183199281900390910190a15b50919050565b606060048054806020026020016040519081016040528092919081815260200182805480156106f057602002820191906000526020600020905b8154600160a060020a031681526001909101906020018083116106d2575b505050505090505b90565b600054600160a060020a0316331461071257600080fd5b60035461010061ffff9091161061072857600080fd5b6003546107409061ffff16600163ffffffff610e9e16565b6003805461ffff191661ffff92909216919091179055565b6060600a8054806020026020016040519081016040528092919081815260200182805480156106f057602002820191906000526020600020905b81548152600190910190602001808311610792575050505050905090565b600080548190600160a060020a031633146107ca57600080fd5b50600160a060020a03831660009081526005602052604090206107ee818685610ebb565b6107f784610800565b95945050505050565b600080548190600160a060020a0316331461081a57600080fd5b600160a060020a03831660009081526006602052604090205460ff161561084057600080fd5b50600160a060020a038216600090815260056020908152604091829020825160c0810184528154815283516120008101948590526001808401805460ff161515835293956108e6959394879486810194939192610100929091849190860180841161059757505050928452505050600982015461ffff808216602084015262010000909104166040820152600a8201546060820152600b90910154608090910152610e0e565b9150811561069257600160a060020a038316600081815260066020908152604091829020805460ff19166001179055815192835290517f1ea969d04c4e4e370253bdeb7fb9638e50e75c206b4c42be36eb9844d37f44419281900390910190a150919050565b60035461ffff1681565b600081815260086020526040812060010160ff8416610100811061097657fe5b602081049091015460ff601f9092166101000a900416905092915050565b600080548190600160a060020a031633146109ae57600080fd5b5060008381526008602052604090206109c8818685610ebb565b6107f784610534565b600054600160a060020a031633146109e857600080fd5b60008054604051600160a060020a03909116917ff8df31144d9c2f0f6b59d69b8b98abd5459d07f2742c4df920b25aae33c6482091a26000805473ffffffffffffffffffffffffffffffffffffffff19169055565b60096020526000908152604090205460ff1681565b600054600160a060020a031681565b60008054600160a060020a03163314610a7957600080fd5b60008281526009602052604090205460ff1615610a9557600080fd5b50600081815260086020526040902080541515610ae257600780546001810182556000919091527fa66cc928b5edb82af9bd49922954155ab7b0942694bea4ce44661d9a8736c688018290555b610aeb81610fc9565b6040805183815290517fac68c1f0dc8aca8ee1bf445a687669d7d404b12dd0886f747e696115f00485279181900360200190a15050565b6004805482908110610b3057fe5b600091825260209091200154600160a060020a0316905081565b600860205260009081526040902080546009820154600a830154600b90930154919261ffff8083169362010000909304169185565b6007805482908110610b8d57fe5b600091825260209091200154905081565b60045490565b60075490565b606060078054806020026020016040519081016040528092919081815260200182805480156106f0576020028201919060005260206000209081548152600190910190602001808311610792575050505050905090565b60025481565b600054600160a060020a03163314610c1e57600080fd5b816206978011158015610c3457506276a7008211155b8015610c435750806206978011155b8015610c5257506276a7008111155b1515610c5d57600080fd5b600191909155600255565b600560205260009081526040902080546009820154600a830154600b90930154919261ffff8083169362010000909304169185565b60066020526000908152604090205460ff1681565b60008054600160a060020a03163314610cca57600080fd5b600160a060020a03821660009081526006602052604090205460ff1615610cf057600080fd5b50600160a060020a038116600090815260056020526040902080541515610d6a57600480546001810182556000919091527f8a35acfbc15ff81a39ae7d344fd709f28e8600b4aa8c65c6b64bfe7fe36bd19b01805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0384161790555b610d7381610fc9565b60408051600160a060020a038416815290517f6ffd05e058c57083a3d6fea058fbdbec172b55ce532b0f778f16e929a0ff516b9181900360200190a15050565b600054600160a060020a03163314610dca57600080fd5b610dd381611033565b50565b600a805482908110610b8d57fe5b600160a060020a038116600090815260056020526040812060010160ff8416610100811061097657fe5b60035460009060049061ffff160461ffff16826040015161ffff1610158015610e465750816060015161ffff16826040015161ffff16115b8015610e98575060808201518251610e639163ffffffff6110b016565b421180610e9857506040820151600354610e899161ffff9091169063ffffffff6110bd16565b61ffff16826040015161ffff16115b92915050565b600082820161ffff8085169082161015610eb457fe5b9392505050565b8254421015610ec657fe5b6001830160ff83166101008110610ed957fe5b602081049091015460ff601f9092166101000a900416158015610f105750600a8301548354610f0d9163ffffffff6110b016565b42105b1515610f1b57600080fd5b600183810160ff84166101008110610f2f57fe5b602091828204019190066101000a81548160ff0219169083151502179055508015610f8b576009830154610f6e9061ffff16600163ffffffff610e9e16565b60098401805461ffff191661ffff92909216919091179055610fc4565b6009830154610fa59062010000900461ffff166001610e9e565b8360090160026101000a81548161ffff021916908361ffff1602179055505b505050565b610ff5610fe782600b015483600a01546110b090919063ffffffff16565b82549063ffffffff6110b016565b421161100057600080fd5b4281556110116001820160006110d6565b60098101805463ffffffff19169055600154600a820155600254600b90910155565b600160a060020a038116151561104857600080fd5b60008054604051600160a060020a03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a36000805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b81810182811015610e9857fe5b600061ffff80841690831611156110d057fe5b50900390565b50610dd3906106f89060088101905b808211156110f957600081556001016110e5565b50905600a165627a7a723058207ddba978801062ab0811349871c0d748d820e1c9e9a8f08d0ca9d0d72e9ff94400290000000000000000000000000000000000000000000000000000000000278d000000000000000000000000000000000000000000000000000000000000278d00

Deployed Bytecode

0x6080604052600436106101695763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166303a6930b811461016e578063172a735c146101955780631d075862146101c1578063246d41a91461022657806334fe00b11461023d57806351de5541146102525780635623715b1461027e5780635f5300ff1461029f57806369422924146102cb5780636eb58224146102e9578063715018a61461030c578063834e3822146103215780638da5cb5b146103395780639a33aff91461036a5780639fa4276914610382578063a2ebd2d51461039a578063a46d41cf146103e4578063a6245974146103fc578063b953a9ac14610411578063bc634abb14610426578063d22687e41461043b578063da3d7d7f14610450578063dbbd96d21461046b578063dc2b054e1461048c578063e31f3e0c146104ad578063f2fde38b146104ce578063f740d100146104ef578063f8abb93d14610507575b600080fd5b34801561017a57600080fd5b5061018361052e565b60408051918252519081900360200190f35b3480156101a157600080fd5b506101ad600435610534565b604080519115158252519081900360200190f35b3480156101cd57600080fd5b506101d6610698565b60408051602080825283518183015283519192839290830191858101910280838360005b838110156102125781810151838201526020016101fa565b505050509050019250505060405180910390f35b34801561023257600080fd5b5061023b6106fb565b005b34801561024957600080fd5b506101d6610758565b34801561025e57600080fd5b506101ad60ff60043516600160a060020a036024351660443515156107b0565b34801561028a57600080fd5b506101ad600160a060020a0360043516610800565b3480156102ab57600080fd5b506102b461094c565b6040805161ffff9092168252519081900360200190f35b3480156102d757600080fd5b506101ad60ff60043516602435610956565b3480156102f557600080fd5b506101ad60ff600435166024356044351515610994565b34801561031857600080fd5b5061023b6109d1565b34801561032d57600080fd5b506101ad600435610a3d565b34801561034557600080fd5b5061034e610a52565b60408051600160a060020a039092168252519081900360200190f35b34801561037657600080fd5b5061023b600435610a61565b34801561038e57600080fd5b5061034e600435610b22565b3480156103a657600080fd5b506103b2600435610b4a565b6040805195865261ffff9485166020870152929093168483015260608401526080830191909152519081900360a00190f35b3480156103f057600080fd5b50610183600435610b7f565b34801561040857600080fd5b50610183610b9e565b34801561041d57600080fd5b50610183610ba4565b34801561043257600080fd5b506101d6610baa565b34801561044757600080fd5b50610183610c01565b34801561045c57600080fd5b5061023b600435602435610c07565b34801561047757600080fd5b506103b2600160a060020a0360043516610c68565b34801561049857600080fd5b506101ad600160a060020a0360043516610c9d565b3480156104b957600080fd5b5061023b600160a060020a0360043516610cb2565b3480156104da57600080fd5b5061023b600160a060020a0360043516610db3565b3480156104fb57600080fd5b50610183600435610dd6565b34801561051357600080fd5b506101ad60ff60043516600160a060020a0360243516610de4565b60015481565b600081815260096020526040812054819060ff161561055257600080fd5b506000828152600860209081526040808320815160c0810183528154815282516120008101938490529194610606949193869392850192916001850191610100918390855b825461010083900a900460ff16151581526020600192830181810494850194909303909202910180841161059757505050928452505050600982015461ffff808216602084015262010000909104166040820152600a8201546060820152600b90910154608090910152610e0e565b91508115610692576000838152600960209081526040808320805460ff19166001908117909155600a805491820181559093527fc65a7bb8d6351c1cf70c95a316cc6a92839c986682d98bc35f958f4883f9d2a8909201859055815185815291517fb11c3a231f918730636de6d815e478d63aead4aaaac95266c95b0278ff7183199281900390910190a15b50919050565b606060048054806020026020016040519081016040528092919081815260200182805480156106f057602002820191906000526020600020905b8154600160a060020a031681526001909101906020018083116106d2575b505050505090505b90565b600054600160a060020a0316331461071257600080fd5b60035461010061ffff9091161061072857600080fd5b6003546107409061ffff16600163ffffffff610e9e16565b6003805461ffff191661ffff92909216919091179055565b6060600a8054806020026020016040519081016040528092919081815260200182805480156106f057602002820191906000526020600020905b81548152600190910190602001808311610792575050505050905090565b600080548190600160a060020a031633146107ca57600080fd5b50600160a060020a03831660009081526005602052604090206107ee818685610ebb565b6107f784610800565b95945050505050565b600080548190600160a060020a0316331461081a57600080fd5b600160a060020a03831660009081526006602052604090205460ff161561084057600080fd5b50600160a060020a038216600090815260056020908152604091829020825160c0810184528154815283516120008101948590526001808401805460ff161515835293956108e6959394879486810194939192610100929091849190860180841161059757505050928452505050600982015461ffff808216602084015262010000909104166040820152600a8201546060820152600b90910154608090910152610e0e565b9150811561069257600160a060020a038316600081815260066020908152604091829020805460ff19166001179055815192835290517f1ea969d04c4e4e370253bdeb7fb9638e50e75c206b4c42be36eb9844d37f44419281900390910190a150919050565b60035461ffff1681565b600081815260086020526040812060010160ff8416610100811061097657fe5b602081049091015460ff601f9092166101000a900416905092915050565b600080548190600160a060020a031633146109ae57600080fd5b5060008381526008602052604090206109c8818685610ebb565b6107f784610534565b600054600160a060020a031633146109e857600080fd5b60008054604051600160a060020a03909116917ff8df31144d9c2f0f6b59d69b8b98abd5459d07f2742c4df920b25aae33c6482091a26000805473ffffffffffffffffffffffffffffffffffffffff19169055565b60096020526000908152604090205460ff1681565b600054600160a060020a031681565b60008054600160a060020a03163314610a7957600080fd5b60008281526009602052604090205460ff1615610a9557600080fd5b50600081815260086020526040902080541515610ae257600780546001810182556000919091527fa66cc928b5edb82af9bd49922954155ab7b0942694bea4ce44661d9a8736c688018290555b610aeb81610fc9565b6040805183815290517fac68c1f0dc8aca8ee1bf445a687669d7d404b12dd0886f747e696115f00485279181900360200190a15050565b6004805482908110610b3057fe5b600091825260209091200154600160a060020a0316905081565b600860205260009081526040902080546009820154600a830154600b90930154919261ffff8083169362010000909304169185565b6007805482908110610b8d57fe5b600091825260209091200154905081565b60045490565b60075490565b606060078054806020026020016040519081016040528092919081815260200182805480156106f0576020028201919060005260206000209081548152600190910190602001808311610792575050505050905090565b60025481565b600054600160a060020a03163314610c1e57600080fd5b816206978011158015610c3457506276a7008211155b8015610c435750806206978011155b8015610c5257506276a7008111155b1515610c5d57600080fd5b600191909155600255565b600560205260009081526040902080546009820154600a830154600b90930154919261ffff8083169362010000909304169185565b60066020526000908152604090205460ff1681565b60008054600160a060020a03163314610cca57600080fd5b600160a060020a03821660009081526006602052604090205460ff1615610cf057600080fd5b50600160a060020a038116600090815260056020526040902080541515610d6a57600480546001810182556000919091527f8a35acfbc15ff81a39ae7d344fd709f28e8600b4aa8c65c6b64bfe7fe36bd19b01805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0384161790555b610d7381610fc9565b60408051600160a060020a038416815290517f6ffd05e058c57083a3d6fea058fbdbec172b55ce532b0f778f16e929a0ff516b9181900360200190a15050565b600054600160a060020a03163314610dca57600080fd5b610dd381611033565b50565b600a805482908110610b8d57fe5b600160a060020a038116600090815260056020526040812060010160ff8416610100811061097657fe5b60035460009060049061ffff160461ffff16826040015161ffff1610158015610e465750816060015161ffff16826040015161ffff16115b8015610e98575060808201518251610e639163ffffffff6110b016565b421180610e9857506040820151600354610e899161ffff9091169063ffffffff6110bd16565b61ffff16826040015161ffff16115b92915050565b600082820161ffff8085169082161015610eb457fe5b9392505050565b8254421015610ec657fe5b6001830160ff83166101008110610ed957fe5b602081049091015460ff601f9092166101000a900416158015610f105750600a8301548354610f0d9163ffffffff6110b016565b42105b1515610f1b57600080fd5b600183810160ff84166101008110610f2f57fe5b602091828204019190066101000a81548160ff0219169083151502179055508015610f8b576009830154610f6e9061ffff16600163ffffffff610e9e16565b60098401805461ffff191661ffff92909216919091179055610fc4565b6009830154610fa59062010000900461ffff166001610e9e565b8360090160026101000a81548161ffff021916908361ffff1602179055505b505050565b610ff5610fe782600b015483600a01546110b090919063ffffffff16565b82549063ffffffff6110b016565b421161100057600080fd5b4281556110116001820160006110d6565b60098101805463ffffffff19169055600154600a820155600254600b90910155565b600160a060020a038116151561104857600080fd5b60008054604051600160a060020a03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a36000805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b81810182811015610e9857fe5b600061ffff80841690831611156110d057fe5b50900390565b50610dd3906106f89060088101905b808211156110f957600081556001016110e5565b50905600a165627a7a723058207ddba978801062ab0811349871c0d748d820e1c9e9a8f08d0ca9d0d72e9ff9440029

Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)

0000000000000000000000000000000000000000000000000000000000278d000000000000000000000000000000000000000000000000000000000000278d00

-----Decoded View---------------
Arg [0] : _pollDuration (uint256): 2592000
Arg [1] : _pollCooldown (uint256): 2592000

-----Encoded View---------------
2 Constructor Arguments found :
Arg [0] : 0000000000000000000000000000000000000000000000000000000000278d00
Arg [1] : 0000000000000000000000000000000000000000000000000000000000278d00


Swarm Source

bzzr://7ddba978801062ab0811349871c0d748d820e1c9e9a8f08d0ca9d0d72e9ff944

Block Transaction Difficulty Gas Used Reward
View All Blocks Produced

Block Uncle Number Difficulty Gas Used Reward
View All Uncles
Loading...
Loading
Loading...
Loading

Validator Index Block Amount
View All Withdrawals

Transaction Hash Block Value Eth2 PubKey Valid
View All Deposits
[ Download: CSV Export  ]

A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.