Contract Overview
Balance: 0 Ether
Ether Value: $0
Transactions: 20812 txns
Token Tracker: Caelum Token (CLM)
 Latest 25 txns From a total of 20812 Transactions
(+1 PendingTxn)

TxHash Age From To Value [TxFee]
0x4c9b1ebd2caeb21c7b142507248b00379306467e13007768a6fac5d2818ef81d(pending)0xbbaf778404f29dafabfb07981e3cf3fae29ce385  IN  0x7600bf5112945f9f006c216d5d6db0df2806edc60 Ether(Pending)
0x28d4db66411238583b73df91075943ea237ac732ca43a127f94476eec7878d3817 mins ago0xd14fa4ea51d079779624ec391c9d77914ecafbce  IN   0x7600bf5112945f9f006c216d5d6db0df2806edc60 Ether0.001908522
0xbbe4da6aec24fd59b1475b0528eb23d16d2e82c9d0d21dff7861319dbc4d0e1b22 mins ago0xd14fa4ea51d079779624ec391c9d77914ecafbce  IN   0x7600bf5112945f9f006c216d5d6db0df2806edc60 Ether0.001273146
0xfe63318d748ca808ebc8ef1b995250e8f34188b8bdd001d0f7f936ab7c372b9437 mins ago0xbbaf778404f29dafabfb07981e3cf3fae29ce385  IN   0x7600bf5112945f9f006c216d5d6db0df2806edc60 Ether0.0007145
0x58ceb42416a7b73de0b08c333343654fc49f335f5a1fbfe6ffeab49076cba1a747 mins ago0xbbaf778404f29dafabfb07981e3cf3fae29ce385  IN   0x7600bf5112945f9f006c216d5d6db0df2806edc60 Ether0.00071578
0x0f48120d1f5ee325626299437f32685adb1e3f647b21e32dc12cf6418416828049 mins ago0xbbaf778404f29dafabfb07981e3cf3fae29ce385  IN   0x7600bf5112945f9f006c216d5d6db0df2806edc60 Ether0.00071546
0xf855260864aed13a094f7df401bc49c561f35eff28a3c23c7f9c7f8b16d4b5a452 mins ago0xbbaf778404f29dafabfb07981e3cf3fae29ce385  IN   0x7600bf5112945f9f006c216d5d6db0df2806edc60 Ether0.00072123
0x0013c7c463176d551aa950791201d8c362d85a1a263b3a2c2db077c3c0c7d9fe56 mins ago0xbbaf778404f29dafabfb07981e3cf3fae29ce385  IN   0x7600bf5112945f9f006c216d5d6db0df2806edc60 Ether0.0007145
0x743b40c6f3f2718386cd068d41f0c42fc3e46b036ce336b2064f866d601507c21 hr 1 min ago0xd14fa4ea51d079779624ec391c9d77914ecafbce  IN   0x7600bf5112945f9f006c216d5d6db0df2806edc60 Ether0.002088156
0xb5a2b1fad5cb4545f45fe8374d2cd1b6343dab26aa91d8186d88e68033139bfb1 hr 8 mins ago0xd14fa4ea51d079779624ec391c9d77914ecafbce  IN   0x7600bf5112945f9f006c216d5d6db0df2806edc60 Ether0.00189777
0xe7999345f893bc8e7fd8491954587272ac2b80c5feff29d7d2affc9561a7fb7d1 hr 9 mins ago0xbbaf778404f29dafabfb07981e3cf3fae29ce385  IN   0x7600bf5112945f9f006c216d5d6db0df2806edc60 Ether0.00073213
0x69379ec68b26ebc5f326fcef975da8079d3454bd1ba4b0e70a939b90d86b59341 hr 16 mins ago0xd14fa4ea51d079779624ec391c9d77914ecafbce  IN   0x7600bf5112945f9f006c216d5d6db0df2806edc60 Ether0.001061508
0xb5a4196a0b75a5924e72851ab15d5ac9069b56f57845e21afa49cbc7afc2315a1 hr 20 mins ago0xd14fa4ea51d079779624ec391c9d77914ecafbce  IN   0x7600bf5112945f9f006c216d5d6db0df2806edc60 Ether0.001021104
0x022f9860df1a05ec59c9e56f932b174d711ba56c5812ae2fb2abf7d989e3404e1 hr 23 mins ago0xbbaf778404f29dafabfb07981e3cf3fae29ce385  IN   0x7600bf5112945f9f006c216d5d6db0df2806edc60 Ether0.00071418
0x006c721a96fad2f3f76070fd2331567c76dc350e28c615b07dcd16e7fc45f0051 hr 24 mins ago0xbbaf778404f29dafabfb07981e3cf3fae29ce385  IN   0x7600bf5112945f9f006c216d5d6db0df2806edc60 Ether0.00071482
0x46715fa61657ee34ac92209f0cca0ae13739385b45e207aceabc02d097a856ba1 hr 30 mins ago0xd14fa4ea51d079779624ec391c9d77914ecafbce  IN   0x7600bf5112945f9f006c216d5d6db0df2806edc60 Ether0.000963312
0x9135635cc9378e98490b5a0ecc58f61cf6ca0691cfdc7f26b6d4bf5385bc03b51 hr 38 mins ago0xbbaf778404f29dafabfb07981e3cf3fae29ce385  IN   0x7600bf5112945f9f006c216d5d6db0df2806edc60 Ether0.00071418
0x8175031b49bb0eacaf5a7a34d238c78a316c0678f9dd7e3ae19538fffd5916c21 hr 44 mins ago0xbbaf778404f29dafabfb07981e3cf3fae29ce385  IN   0x7600bf5112945f9f006c216d5d6db0df2806edc60 Ether0.00071578
0xdd5a26f5a89cb0c6ad3fbbd4894de425edd7f0381d84020457f6fa91dbf839151 hr 48 mins ago0xbbaf778404f29dafabfb07981e3cf3fae29ce385  IN   0x7600bf5112945f9f006c216d5d6db0df2806edc60 Ether0.00071642
0xc1f09e3f04fda907b6d1f8c51aff9d8905bb88c54e7d9afd691507cbabc5858f1 hr 50 mins ago0xbbaf778404f29dafabfb07981e3cf3fae29ce385  IN   0x7600bf5112945f9f006c216d5d6db0df2806edc60 Ether0.00071514
0xe5f9cf21c242066c3fdeb12ccbb102f0e19064f443e52ed6242d3439bade30a81 hr 55 mins ago0xbbaf778404f29dafabfb07981e3cf3fae29ce385  IN   0x7600bf5112945f9f006c216d5d6db0df2806edc60 Ether0.00071642
0x1de358f900c37efcce90237e4f89d562ae2f113fe1ed9efa4784ddd03f0088172 hrs 6 mins ago0xbbaf778404f29dafabfb07981e3cf3fae29ce385  IN   0x7600bf5112945f9f006c216d5d6db0df2806edc60 Ether0.00071546
0xacb8c182b69389f38c0fa05c6be632c2a0c00598bb6eb4a090bf6d21dcb10aff2 hrs 11 mins ago0xbbaf778404f29dafabfb07981e3cf3fae29ce385  IN   0x7600bf5112945f9f006c216d5d6db0df2806edc60 Ether0.00071418
0x2442c3214126f315f44c62fdf3ca2d8d236cb04d14c29df96a34bf8f63e8af372 hrs 16 mins ago0xbbaf778404f29dafabfb07981e3cf3fae29ce385  IN   0x7600bf5112945f9f006c216d5d6db0df2806edc60 Ether0.00071642
0x3fba7346b05a08b8cd96a1bca6b324d746599835c473a9f090e5f233714411102 hrs 21 mins ago0xbbaf778404f29dafabfb07981e3cf3fae29ce385  IN   0x7600bf5112945f9f006c216d5d6db0df2806edc60 Ether0.00071418
[ Download CSV Export  ] 
 Internal Transactions as a result of Contract Execution
View All
ParentTxHash Block Age From To Value
Contract Source Code Verified (Exact Match)
Contract Name: CaelumMiner
Compiler Text: v0.4.25+commit.59dbf8f1
Optimization Enabled: Yes
Runs (Optimiser):  200



  Contract Source Code   Find Similiar Contracts

//solium-disable linebreak-style
pragma solidity ^0.4.24;

library ExtendedMath {
    function limitLessThan(uint a, uint b) internal pure returns(uint c) {
        if (a > b) return b;
        return a;
    }
}

library SafeMath {

    /**
     * @dev Multiplies two numbers, reverts on overflow.
     */
    function mul(uint256 _a, uint256 _b) internal pure returns(uint256) {
        // Gas optimization: this is cheaper than requiring '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;
        }

        uint256 c = _a * _b;
        require(c / _a == _b);

        return c;
    }

    /**
     * @dev Integer division of two numbers truncating the quotient, reverts on division by zero.
     */
    function div(uint256 _a, uint256 _b) internal pure returns(uint256) {
        require(_b > 0); // Solidity only automatically asserts 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 c;
    }

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

        return c;
    }

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

        return c;
    }

    /**
     * @dev Divides two numbers and returns the remainder (unsigned integer modulo),
     * reverts when dividing by zero.
     */
    function mod(uint256 a, uint256 b) internal pure returns(uint256) {
        require(b != 0);
        return a % b;
    }
}

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;
  }
}

contract ERC20Basic {
    function totalSupply() public view returns(uint256);

    function balanceOf(address _who) public view returns(uint256);

    function transfer(address _to, uint256 _value) public returns(bool);
    event Transfer(address indexed from, address indexed to, uint256 value);
}

contract ERC20 is ERC20Basic {
    function allowance(address _owner, address _spender) public view returns(uint256);

    function transferFrom(address _from, address _to, uint256 _value) public returns(bool);

    function approve(address _spender, uint256 _value) public returns(bool);

    event Approval(
        address indexed owner,
        address indexed spender,
        uint256 value
    );
}

contract BasicToken is ERC20Basic {
    using SafeMath
    for uint256;

    mapping(address => uint256) internal balances;

    uint256 internal totalSupply_;

    /**
     * @dev Total number of tokens in existence
     */
    function totalSupply() public view returns(uint256) {
        return totalSupply_;
    }

    /**
     * @dev Transfer token for a specified address
     * @param _to The address to transfer to.
     * @param _value The amount to be transferred.
     */
    function transfer(address _to, uint256 _value) public returns(bool) {
        require(_value <= balances[msg.sender]);
        require(_to != address(0));

        balances[msg.sender] = balances[msg.sender].sub(_value);
        balances[_to] = balances[_to].add(_value);
        emit Transfer(msg.sender, _to, _value);
        return true;
    }

    /**
     * @dev Gets the balance of the specified address.
     * @param _owner The address to query the the balance of.
     * @return An uint256 representing the amount owned by the passed address.
     */
    function balanceOf(address _owner) public view returns(uint256) {
        return balances[_owner];
    }

}

contract StandardToken is ERC20, BasicToken {

    mapping(address => mapping(address => uint256)) internal allowed;


    /**
     * @dev Transfer tokens from one address to another
     * @param _from address The address which you want to send tokens from
     * @param _to address The address which you want to transfer to
     * @param _value uint256 the amount of tokens to be transferred
     */
    function transferFrom(
        address _from,
        address _to,
        uint256 _value
    )
    public
    returns(bool) {
        require(_value <= balances[_from]);
        require(_value <= allowed[_from][msg.sender]);
        require(_to != address(0));

        balances[_from] = balances[_from].sub(_value);
        balances[_to] = balances[_to].add(_value);
        allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value);
        emit Transfer(_from, _to, _value);
        return true;
    }

    /**
     * @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender.
     * Beware that changing an allowance with this method brings the risk that someone may use both the old
     * and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this
     * race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards:
     * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
     * @param _spender The address which will spend the funds.
     * @param _value The amount of tokens to be spent.
     */
    function approve(address _spender, uint256 _value) public returns(bool) {
        allowed[msg.sender][_spender] = _value;
        emit Approval(msg.sender, _spender, _value);
        return true;
    }

    /**
     * @dev Function to check the amount of tokens that an owner allowed to a spender.
     * @param _owner address The address which owns the funds.
     * @param _spender address The address which will spend the funds.
     * @return A uint256 specifying the amount of tokens still available for the spender.
     */
    function allowance(
        address _owner,
        address _spender
    )
    public
    view
    returns(uint256) {
        return allowed[_owner][_spender];
    }

    /**
     * @dev Increase the amount of tokens that an owner allowed to a spender.
     * approve should be called when allowed[_spender] == 0. To increment
     * allowed value is better to use this function to avoid 2 calls (and wait until
     * the first transaction is mined)
     * From MonolithDAO Token.sol
     * @param _spender The address which will spend the funds.
     * @param _addedValue The amount of tokens to increase the allowance by.
     */
    function increaseApproval(
        address _spender,
        uint256 _addedValue
    )
    public
    returns(bool) {
        allowed[msg.sender][_spender] = (
            allowed[msg.sender][_spender].add(_addedValue));
        emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
        return true;
    }

    /**
     * @dev Decrease the amount of tokens that an owner allowed to a spender.
     * approve should be called when allowed[_spender] == 0. To decrement
     * allowed value is better to use this function to avoid 2 calls (and wait until
     * the first transaction is mined)
     * From MonolithDAO Token.sol
     * @param _spender The address which will spend the funds.
     * @param _subtractedValue The amount of tokens to decrease the allowance by.
     */
    function decreaseApproval(
        address _spender,
        uint256 _subtractedValue
    )
    public
    returns(bool) {
        uint256 oldValue = allowed[msg.sender][_spender];
        if (_subtractedValue >= oldValue) {
            allowed[msg.sender][_spender] = 0;
        } else {
            allowed[msg.sender][_spender] = oldValue.sub(_subtractedValue);
        }
        emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
        return true;
    }

}

interface IcaelumVoting {
    function getTokenProposalDetails() external view returns(address, uint, uint, uint);
    function getExpiry() external view returns (uint);
    function getContractType () external view returns (uint);
}

contract abstractCaelum {
    function isMasternodeOwner(address _candidate) public view returns(bool);
    function addToWhitelist(address _ad, uint _amount, uint daysAllowed) internal;
    function addMasternode(address _candidate) internal returns(uint);
    function deleteMasternode(uint entityAddress) internal returns(bool success);
    function getLastPerUser(address _candidate) public view returns (uint);
    function getMiningReward() public view returns(uint);
}

contract NewTokenProposal is IcaelumVoting {

    enum VOTE_TYPE {TOKEN, TEAM}

    VOTE_TYPE public contractType = VOTE_TYPE.TOKEN;
    address contractAddress;
    uint requiredAmount;
    uint validUntil;
    uint votingDurationInDays;

    /**
     * @dev Create a new vote proposal for an ERC20 token.
     * @param _contract ERC20 contract
     * @param _amount How many tokens are required as collateral
     * @param _valid How long do we accept these tokens on the contract (UNIX timestamp)
     * @param _voteDuration How many days is this vote available
     */
    constructor(address _contract, uint _amount, uint _valid, uint _voteDuration) public {
        require(_voteDuration >= 14 && _voteDuration <= 50, "Proposed voting duration does not meet requirements");

        contractAddress = _contract;
        requiredAmount = _amount;
        validUntil = _valid;
        votingDurationInDays = _voteDuration;
    }

    /**
     * @dev Returns all details about this proposal
     */
    function getTokenProposalDetails() public view returns(address, uint, uint, uint) {
        return (contractAddress, requiredAmount, validUntil, uint(contractType));
    }

    /**
     * @dev Displays the expiry date of contract
     * @return uint Days valid
     */
    function getExpiry() external view returns (uint) {
        return votingDurationInDays;
    }

    /**
     * @dev Displays the type of contract
     * @return uint Enum value {TOKEN, TEAM}
     */
    function getContractType () external view returns (uint){
        return uint(contractType);
    }
}

contract NewMemberProposal is IcaelumVoting {

    enum VOTE_TYPE {TOKEN, TEAM}
    VOTE_TYPE public contractType = VOTE_TYPE.TEAM;

    address memberAddress;
    uint totalMasternodes;
    uint votingDurationInDays;

    /**
     * @dev Create a new vote proposal for a team member.
     * @param _contract Future team member's address
     * @param _total How many masternodes do we want to give
     * @param _voteDuration How many days is this vote available
     */
    constructor(address _contract, uint _total, uint _voteDuration) public {
        require(_voteDuration >= 14 && _voteDuration <= 50, "Proposed voting duration does not meet requirements");
        memberAddress = _contract;
        totalMasternodes = _total;
        votingDurationInDays = _voteDuration;
    }

    /**
     * @dev Returns all details about this proposal
     */
    function getTokenProposalDetails() public view returns(address, uint, uint, uint) {
        return (memberAddress, totalMasternodes, 0, uint(contractType));
    }

    /**
     * @dev Displays the expiry date of contract
     * @return uint Days valid
     */
    function getExpiry() external view returns (uint) {
        return votingDurationInDays;
    }

    /**
     * @dev Displays the type of contract
     * @return uint Enum value {TOKEN, TEAM}
     */
    function getContractType () external view returns (uint){
        return uint(contractType);
    }
}

contract CaelumVotings is Ownable {
    using SafeMath for uint;

    enum VOTE_TYPE {TOKEN, TEAM}

    struct Proposals {
        address tokenContract;
        uint totalVotes;
        uint proposedOn;
        uint acceptedOn;
        VOTE_TYPE proposalType;
    }

    struct Voters {
        bool isVoter;
        address owner;
        uint[] votedFor;
    }

    uint MAJORITY_PERCENTAGE_NEEDED = 60;
    uint MINIMUM_VOTERS_NEEDED = 10;
    bool public proposalPending;

    mapping(uint => Proposals) public proposalList;
    mapping (address => Voters) public voterMap;
    mapping(uint => address) public voterProposals;
    uint public proposalCounter;
    uint public votersCount;
    uint public votersCountTeam;

    /**
     * @notice Define abstract functions for later user
     */
    function isMasternodeOwner(address _candidate) public view returns(bool);
    function addToWhitelist(address _ad, uint _amount, uint daysAllowed) internal;
    function addMasternode(address _candidate) internal returns(uint);
    function updateMasternodeAsTeamMember(address _member) internal returns (bool);
    function isTeamMember (address _candidate) public view returns (bool);
    
    event NewProposal(uint ProposalID);
    event ProposalAccepted(uint ProposalID);

    /**
     * @dev Create a new proposal.
     * @param _contract Proposal contract address
     * @return uint ProposalID
     */
    function pushProposal(address _contract) onlyOwner public returns (uint) {
        if(proposalCounter != 0)
        require (pastProposalTimeRules (), "You need to wait 90 days before submitting a new proposal.");
        require (!proposalPending, "Another proposal is pending.");

        uint _contractType = IcaelumVoting(_contract).getContractType();
        proposalList[proposalCounter] = Proposals(_contract, 0, now, 0, VOTE_TYPE(_contractType));

        emit NewProposal(proposalCounter);
        
        proposalCounter++;
        proposalPending = true;

        return proposalCounter.sub(1);
    }

    /**
     * @dev Internal function that handles the proposal after it got accepted.
     * This function determines if the proposal is a token or team member proposal and executes the corresponding functions.
     * @return uint Returns the proposal ID.
     */
    function handleLastProposal () internal returns (uint) {
        uint _ID = proposalCounter.sub(1);

        proposalList[_ID].acceptedOn = now;
        proposalPending = false;

        address _address;
        uint _required;
        uint _valid;
        uint _type;
        (_address, _required, _valid, _type) = getTokenProposalDetails(_ID);

        if(_type == uint(VOTE_TYPE.TOKEN)) {
            addToWhitelist(_address,_required,_valid);
        }

        if(_type == uint(VOTE_TYPE.TEAM)) {
            if(_required != 0) {
                for (uint i = 0; i < _required; i++) {
                    addMasternode(_address);
                }
            } else {
                addMasternode(_address);
            }
            updateMasternodeAsTeamMember(_address);
        }
        
        emit ProposalAccepted(_ID);
        
        return _ID;
    }

    /**
     * @dev Rejects the last proposal after the allowed voting time has expired and it's not accepted.
     */
    function discardRejectedProposal() onlyOwner public returns (bool) {
        require(proposalPending);
        require (LastProposalCanDiscard());
        proposalPending = false;
        return (true);
    }

    /**
     * @dev Checks if the last proposal allowed voting time has expired and it's not accepted.
     * @return bool
     */
    function LastProposalCanDiscard () public view returns (bool) {
        
        uint daysBeforeDiscard = IcaelumVoting(proposalList[proposalCounter - 1].tokenContract).getExpiry();
        uint entryDate = proposalList[proposalCounter - 1].proposedOn;
        uint expiryDate = entryDate + (daysBeforeDiscard * 1 days);

        if (now >= expiryDate)
        return true;
    }

    /**
     * @dev Returns all details about a proposal
     */
    function getTokenProposalDetails(uint proposalID) public view returns(address, uint, uint, uint) {
        return IcaelumVoting(proposalList[proposalID].tokenContract).getTokenProposalDetails();
    }

    /**
     * @dev Returns if our 90 day cooldown has passed
     * @return bool
     */
    function pastProposalTimeRules() public view returns (bool) {
        uint lastProposal = proposalList[proposalCounter - 1].proposedOn;
        if (now >= lastProposal + 90 days)
        return true;
    }


    /**
     * @dev Allow any masternode user to become a voter.
     */
    function becomeVoter() public  {
        require (isMasternodeOwner(msg.sender), "User has no masternodes");
        require (!voterMap[msg.sender].isVoter, "User Already voted for this proposal");

        voterMap[msg.sender].owner = msg.sender;
        voterMap[msg.sender].isVoter = true;
        votersCount = votersCount + 1;

        if (isTeamMember(msg.sender))
        votersCountTeam = votersCountTeam + 1;
    }

    /**
     * @dev Allow voters to submit their vote on a proposal. Voters can only cast 1 vote per proposal.
     * If the proposed vote is about adding Team members, only Team members are able to vote.
     * A proposal can only be published if the total of votes is greater then MINIMUM_VOTERS_NEEDED.
     * @param proposalID proposalID
     */
    function voteProposal(uint proposalID) public returns (bool success) {
        require(voterMap[msg.sender].isVoter, "Sender not listed as voter");
        require(proposalID >= 0, "No proposal was selected.");
        require(proposalID <= proposalCounter, "Proposal out of limits.");
        require(voterProposals[proposalID] != msg.sender, "Already voted.");


        if(proposalList[proposalID].proposalType == VOTE_TYPE.TEAM) {
            require (isTeamMember(msg.sender), "Restricted for team members");
            voterProposals[proposalID] = msg.sender;
            proposalList[proposalID].totalVotes++;

            if(reachedMajorityForTeam(proposalID)) {
                // This is the prefered way of handling vote results. It costs more gas but prevents tampering.
                // If gas is an issue, you can comment handleLastProposal out and call it manually as onlyOwner.
                handleLastProposal();
                return true;
            }
        } else {
            require(votersCount >= MINIMUM_VOTERS_NEEDED, "Not enough voters in existence to push a proposal");
            voterProposals[proposalID] = msg.sender;
            proposalList[proposalID].totalVotes++;

            if(reachedMajority(proposalID)) {
                // This is the prefered way of handling vote results. It costs more gas but prevents tampering.
                // If gas is an issue, you can comment handleLastProposal out and call it manually as onlyOwner.
                handleLastProposal();
                return true;
            }
        }


    }

    /**
     * @dev Check if a proposal has reached the majority vote
     * @param proposalID Token ID
     * @return bool
     */
    function reachedMajority (uint proposalID) public view returns (bool) {
        uint getProposalVotes = proposalList[proposalID].totalVotes;
        if (getProposalVotes >= majority())
        return true;
    }

    /**
     * @dev Internal function that calculates the majority
     * @return uint Total of votes needed for majority
     */
    function majority () internal view returns (uint) {
        uint a = (votersCount * MAJORITY_PERCENTAGE_NEEDED );
        return a / 100;
    }

    /**
     * @dev Check if a proposal has reached the majority vote for a team member
     * @param proposalID Token ID
     * @return bool
     */
    function reachedMajorityForTeam (uint proposalID) public view returns (bool) {
        uint getProposalVotes = proposalList[proposalID].totalVotes;
        if (getProposalVotes >= majorityForTeam())
        return true;
    }

    /**
     * @dev Internal function that calculates the majority
     * @return uint Total of votes needed for majority
     */
    function majorityForTeam () internal view returns (uint) {
        uint a = (votersCountTeam * MAJORITY_PERCENTAGE_NEEDED );
        return a / 100;
    }

}

contract CaelumFundraise is Ownable, BasicToken, abstractCaelum {

    /**
     * In no way is Caelum intended to raise funds. We leave this code to demonstrate the potential and functionality.
     * Should you decide to buy a masternode instead of mining, you can by using this function. Feel free to consider this a tipping jar for our dev team.
     * We strongly advice to use the `buyMasternode`function, but simply sending Ether to the contract should work as well.
     */

    uint AMOUNT_FOR_MASTERNODE = 50 ether;
    uint SPOTS_RESERVED = 10;
    uint COUNTER;
    bool fundraiseClosed = false;

    /**
     * @dev Not recommended way to accept Ether. Can be safely used if no storage operations are called
     * The contract may revert all the gas because of the gas limitions on the fallback operator.
     * We leave it in as template for other projects, however, for Caelum the function deposit should be adviced.
     */
    function() payable public {
        require(msg.value == AMOUNT_FOR_MASTERNODE && msg.value != 0);
        receivedFunds();
    }

    /** @dev This is the recommended way for users to deposit Ether in return of a masternode.
     * Users should be encouraged to use this approach as there is not gas risk involved.
     */
    function buyMasternode () payable public {
        require(msg.value == AMOUNT_FOR_MASTERNODE && msg.value != 0);
        receivedFunds();
    }

    /**
     * @dev Forward funds to owner before making any action. owner.transfer will revert if fail.
     */
    function receivedFunds() internal {
        require(!fundraiseClosed);
        require (COUNTER <= SPOTS_RESERVED);
        owner.transfer(msg.value);
        addMasternode(msg.sender);
    }

}

contract CaelumAcceptERC20 is Ownable, CaelumVotings, abstractCaelum { 
    using SafeMath for uint;

    address[] public tokensList;
    bool setOwnContract = true;

    struct _whitelistTokens {
        address tokenAddress;
        bool active;
        uint requiredAmount;
        uint validUntil;
        uint timestamp;
    }

    mapping(address => mapping(address => uint)) public tokens;
    mapping(address => _whitelistTokens) acceptedTokens;

    event Deposit(address token, address user, uint amount, uint balance);
    event Withdraw(address token, address user, uint amount, uint balance);

    /**
     * @dev Return the base rewards. This should be overrided by the miner contract.
     * Return a base value for standalone usage ONLY.
     */
    function getMiningReward() public view returns(uint) {
        return 50 * 1e8;
    }


    /**
     * @notice Allow the dev to set it's own token as accepted payment.
     * @dev Can be hardcoded in the constructor. Given the contract size, we decided to separate it.
     * @return bool
     */
    function addOwnToken() onlyOwner public returns (bool) {
        require(setOwnContract);
        addToWhitelist(this, 5000 * 1e8, 36500);
        setOwnContract = false;
        return true;
    }

    // TODO: Set visibility
    /**
     * @notice Add a new token as accepted payment method.
     * @param _token Token contract address.
     * @param _amount Required amount of this Token as collateral
     * @param daysAllowed How many days will we accept this token?
     */
    function addToWhitelist(address _token, uint _amount, uint daysAllowed) internal {
        _whitelistTokens storage newToken = acceptedTokens[_token];
        newToken.tokenAddress = _token;
        newToken.requiredAmount = _amount;
        newToken.timestamp = now;
        newToken.validUntil = now + (daysAllowed * 1 days);
        newToken.active = true;

        tokensList.push(_token);
    }

    /**
     * @dev internal function to determine if we accept this token.
     * @param _ad Token contract address
     * @return bool
     */
    function isAcceptedToken(address _ad) internal view returns(bool) {
        return acceptedTokens[_ad].active;
    }

    /**
     * @dev internal function to determine the requiredAmount for a specific token.
     * @param _ad Token contract address
     * @return bool
     */
    function getAcceptedTokenAmount(address _ad) internal view returns(uint) {
        return acceptedTokens[_ad].requiredAmount;
    }

    /**
     * @dev internal function to determine if the token is still accepted timewise.
     * @param _ad Token contract address
     * @return bool
     */
    function isValid(address _ad) internal view returns(bool) {
        uint endTime = acceptedTokens[_ad].validUntil;
        if (block.timestamp < endTime) return true;
        return false;
    }

    /**
     * @notice Returns an array of all accepted token. You can get more details by calling getTokenDetails function with this address.
     * @return array Address
     */
    function listAcceptedTokens() public view returns(address[]) {
        return tokensList;
    }

    /**
     * @notice Returns a full list of the token details
     * @param token Token contract address
     */
    function getTokenDetails(address token) public view returns(address ad,uint required, bool active, uint valid) {
        return (acceptedTokens[token].tokenAddress, acceptedTokens[token].requiredAmount,acceptedTokens[token].active, acceptedTokens[token].validUntil);
    }

    /**
     * @notice Public function that allows any user to deposit accepted tokens as collateral to become a masternode.
     * @param token Token contract address
     * @param amount Amount to deposit
     */
    function depositCollateral(address token, uint amount) public {
        require(isAcceptedToken(token), "ERC20 not authorised");  // Should be a token from our list
        require(amount == getAcceptedTokenAmount(token));         // The amount needs to match our set amount
        require(isValid(token));                                  // It should be called within the setup timeframe

        tokens[token][msg.sender] = tokens[token][msg.sender].add(amount);

        require(StandardToken(token).transferFrom(msg.sender, this, amount), "error with token");
        emit Deposit(token, msg.sender, amount, tokens[token][msg.sender]);

        addMasternode(msg.sender);
    }

    /**
     * @notice Public function that allows any user to withdraw deposited tokens and stop as masternode
     * @param token Token contract address
     * @param amount Amount to withdraw
     */
    function withdrawCollateral(address token, uint amount) public {
        require(token != 0); // token should be an actual address
        require(isAcceptedToken(token), "ERC20 not authorised"); // Should be a token from our list
        require(isMasternodeOwner(msg.sender)); // The sender must be a masternode prior to withdraw
        require(tokens[token][msg.sender] == amount); // The amount must be exactly whatever is deposited

        uint amountToWithdraw = tokens[token][msg.sender];
        tokens[token][msg.sender] = 0;

        deleteMasternode(getLastPerUser(msg.sender));

        if (!StandardToken(token).transfer(msg.sender, amountToWithdraw)) revert();
        emit Withdraw(token, msg.sender, amountToWithdraw, amountToWithdraw);
    }

}

contract CaelumMasternode is CaelumFundraise, CaelumAcceptERC20{
    using SafeMath for uint;

    bool onTestnet = false;
    bool genesisAdded = false;

    uint  masternodeRound;
    uint  masternodeCandidate;
    uint  masternodeCounter;
    uint  masternodeEpoch;
    uint  miningEpoch;

    uint rewardsProofOfWork;
    uint rewardsMasternode;
    uint rewardsGlobal = 50 * 1e8;

    uint MINING_PHASE_DURATION_BLOCKS = 4500;

    struct MasterNode {
        address accountOwner;
        bool isActive;
        bool isTeamMember;
        uint storedIndex;
        uint startingRound;
        uint[] indexcounter;
    }

    uint[] userArray;
    address[] userAddressArray;

    mapping(uint => MasterNode) userByIndex; // UINT masterMapping
    mapping(address => MasterNode) userByAddress; //masterMapping
    mapping(address => uint) userAddressIndex;

    event Deposit(address token, address user, uint amount, uint balance);
    event Withdraw(address token, address user, uint amount, uint balance);

    event NewMasternode(address candidateAddress, uint timeStamp);
    event RemovedMasternode(address candidateAddress, uint timeStamp);

    /**
     * @dev Add the genesis accounts
     */
    function addGenesis(address _genesis, bool _team) onlyOwner public {
        require(!genesisAdded);

        addMasternode(_genesis);

        if (_team) {
            updateMasternodeAsTeamMember(msg.sender);
        }

    }

    /**
     * @dev Close the genesis accounts
     */
    function closeGenesis() onlyOwner public {
        genesisAdded = true; // Forever lock this.
    }

    /**
     * @dev Add a user as masternode. Called as internal since we only add masternodes by depositing collateral or by voting.
     * @param _candidate Candidate address
     * @return uint Masternode index
     */
    function addMasternode(address _candidate) internal returns(uint) {
        userByIndex[masternodeCounter].accountOwner = _candidate;
        userByIndex[masternodeCounter].isActive = true;
        userByIndex[masternodeCounter].startingRound = masternodeRound + 1;
        userByIndex[masternodeCounter].storedIndex = masternodeCounter;

        userByAddress[_candidate].accountOwner = _candidate;
        userByAddress[_candidate].indexcounter.push(masternodeCounter);

        userArray.push(userArray.length);
        masternodeCounter++;

        emit NewMasternode(_candidate, now);
        return masternodeCounter - 1; //
    }

    /**
     * @dev Allow us to update a masternode's round to keep progress
     * @param _candidate ID of masternode
     */
    function updateMasternode(uint _candidate) internal returns(bool) {
        userByIndex[_candidate].startingRound++;
        return true;
    }

    /**
     * @dev Allow us to update a masternode to team member status
     * @param _member address
     */
    function updateMasternodeAsTeamMember(address _member) internal returns (bool) {
        userByAddress[_member].isTeamMember = true;
        return (true);
    }

    /**
     * @dev Let us know if an address is part of the team.
     * @param _member address
     */
    function isTeamMember (address _member) public view returns (bool) {
        if (userByAddress[_member].isTeamMember)
        return true;
    }

    /**
     * @dev Remove a specific masternode
     * @param _masternodeID ID of the masternode to remove
     */
    function deleteMasternode(uint _masternodeID) internal returns(bool success) {

        uint rowToDelete = userByIndex[_masternodeID].storedIndex;
        uint keyToMove = userArray[userArray.length - 1];

        userByIndex[_masternodeID].isActive = userByIndex[_masternodeID].isActive = (false);
        userArray[rowToDelete] = keyToMove;
        userByIndex[keyToMove].storedIndex = rowToDelete;
        userArray.length = userArray.length - 1;

        removeFromUserCounter(_masternodeID);

        emit RemovedMasternode(userByIndex[_masternodeID].accountOwner, now);

        return true;
    }

    /**
     * @dev returns what account belongs to a masternode
     */
    function isPartOf(uint mnid) public view returns (address) {
        return userByIndex[mnid].accountOwner;
    }

    /**
     * @dev Internal function to remove a masternode from a user address if this address holds multpile masternodes
     * @param index MasternodeID
     */
    function removeFromUserCounter(uint index)  internal returns(uint[]) {
        address belong = isPartOf(index);

        if (index >= userByAddress[belong].indexcounter.length) return;

        for (uint i = index; i<userByAddress[belong].indexcounter.length-1; i++){
            userByAddress[belong].indexcounter[i] = userByAddress[belong].indexcounter[i+1];
        }

        delete userByAddress[belong].indexcounter[userByAddress[belong].indexcounter.length-1];
        userByAddress[belong].indexcounter.length--;
        return userByAddress[belong].indexcounter;
    }

    /**
     * @dev Primary contract function to update the current user and prepare the next one.
     * A number of steps have been token to ensure the contract can never run out of gas when looping over our masternodes.
     */
    function setMasternodeCandidate() internal returns(address) {

        uint hardlimitCounter = 0;

        while (getFollowingCandidate() == 0x0) {
            // We must return a value not to break the contract. Require is a secondary killswitch now.
            require(hardlimitCounter < 6, "Failsafe switched on");
            // Choose if loop over revert/require to terminate the loop and return a 0 address.
            if (hardlimitCounter == 5) return (0);
            masternodeRound = masternodeRound + 1;
            masternodeCandidate = 0;
            hardlimitCounter++;
        }

        if (masternodeCandidate == masternodeCounter - 1) {
            masternodeRound = masternodeRound + 1;
            masternodeCandidate = 0;
        }

        for (uint i = masternodeCandidate; i < masternodeCounter; i++) {
            if (userByIndex[i].isActive) {
                if (userByIndex[i].startingRound == masternodeRound) {
                    updateMasternode(i);
                    masternodeCandidate = i;
                    return (userByIndex[i].accountOwner);
                }
            }
        }

        masternodeRound = masternodeRound + 1;
        return (0);

    }

    /**
     * @dev Helper function to loop through our masternodes at start and return the correct round
     */
    function getFollowingCandidate() internal view returns(address _address) {
        uint tmpRound = masternodeRound;
        uint tmpCandidate = masternodeCandidate;

        if (tmpCandidate == masternodeCounter - 1) {
            tmpRound = tmpRound + 1;
            tmpCandidate = 0;
        }

        for (uint i = masternodeCandidate; i < masternodeCounter; i++) {
            if (userByIndex[i].isActive) {
                if (userByIndex[i].startingRound == tmpRound) {
                    tmpCandidate = i;
                    return (userByIndex[i].accountOwner);
                }
            }
        }

        tmpRound = tmpRound + 1;
        return (0);
    }

    /**
     * @dev Displays all masternodes belonging to a user address.
     */
    function belongsToUser(address userAddress) public view returns(uint[]) {
        return (userByAddress[userAddress].indexcounter);
    }

    /**
     * @dev Helper function to know if an address owns masternodes
     */
    function isMasternodeOwner(address _candidate) public view returns(bool) {
        if(userByAddress[_candidate].indexcounter.length <= 0) return false;
        if (userByAddress[_candidate].accountOwner == _candidate)
        return true;
    }

    /**
     * @dev Helper function to get the last masternode belonging to a user
     */
    function getLastPerUser(address _candidate) public view returns (uint) {
        return userByAddress[_candidate].indexcounter[userByAddress[_candidate].indexcounter.length - 1];
    }


    /**
     * @dev Calculate and set the reward schema for Caelum.
     * Each mining phase is decided by multiplying the MINING_PHASE_DURATION_BLOCKS with factor 10.
     * Depending on the outcome (solidity always rounds), we can detect the current stage of mining.
     * First stage we cut the rewards to 5% to prevent instamining.
     * Last stage we leave 2% for miners to incentivize keeping miners running.
     */
    function calculateRewardStructures() internal {
        //ToDo: Set
        uint _global_reward_amount = getMiningReward();
        uint getStageOfMining = miningEpoch / MINING_PHASE_DURATION_BLOCKS * 10;

        if (getStageOfMining < 10) {
            rewardsProofOfWork = _global_reward_amount / 100 * 5;
            rewardsMasternode = 0;
            return;
        }

        if (getStageOfMining > 90) {
            rewardsProofOfWork = _global_reward_amount / 100 * 2;
            rewardsMasternode = _global_reward_amount / 100 * 98;
            return;
        }

        uint _mnreward = (_global_reward_amount / 100) * getStageOfMining;
        uint _powreward = (_global_reward_amount - _mnreward);

        setBaseRewards(_powreward, _mnreward);
    }

    function setBaseRewards(uint _pow, uint _mn) internal {
        rewardsMasternode = _mn;
        rewardsProofOfWork = _pow;
    }

    /**
     * @dev Executes the masternode flow. Should be called after mining a block.
     */
    function _arrangeMasternodeFlow() internal {
        calculateRewardStructures();
        setMasternodeCandidate();
        miningEpoch++;
    }

    /**
     * @dev Executes the masternode flow. Should be called after mining a block.
     * This is an emergency manual loop method.
     */
    function _emergencyLoop() onlyOwner public {
        calculateRewardStructures();
        setMasternodeCandidate();
        miningEpoch++;
    }

    function masternodeInfo(uint index) public view returns
    (
        address,
        bool,
        uint,
        uint
    )
    {
        return (
            userByIndex[index].accountOwner,
            userByIndex[index].isActive,
            userByIndex[index].storedIndex,
            userByIndex[index].startingRound
        );
    }

    function contractProgress() public view returns
    (
        uint epoch,
        uint candidate,
        uint round,
        uint miningepoch,
        uint globalreward,
        uint powreward,
        uint masternodereward,
        uint usercounter
    )
    {
        return (
            masternodeEpoch,
            masternodeCandidate,
            masternodeRound,
            miningEpoch,
            getMiningReward(),
            rewardsProofOfWork,
            rewardsMasternode,
            masternodeCounter
        );
    }

}

contract CaelumMiner is StandardToken, CaelumMasternode {
    using SafeMath for uint;
    using ExtendedMath for uint;

    string public symbol = "CLM";
    string public name = "Caelum Token";
    uint8 public decimals = 8;
    uint256 public totalSupply = 2100000000000000;

    uint public latestDifficultyPeriodStarted;
    uint public epochCount;
    uint public baseMiningReward = 50;
    uint public blocksPerReadjustment = 512;
    uint public _MINIMUM_TARGET = 2 ** 16;
    uint public _MAXIMUM_TARGET = 2 ** 234;
    uint public rewardEra = 0;

    uint public maxSupplyForEra;
    uint public MAX_REWARD_ERA = 39;
    uint public MINING_RATE_FACTOR = 60; //mint the token 60 times less often than ether
    //difficulty adjustment parameters- be careful modifying these
    uint public MAX_ADJUSTMENT_PERCENT = 100;
    uint public TARGET_DIVISOR = 2000;
    uint public QUOTIENT_LIMIT = TARGET_DIVISOR.div(2);
    mapping(bytes32 => bytes32) solutionForChallenge;
    mapping(address => mapping(address => uint)) allowed;

    bytes32 public challengeNumber;
    uint public difficulty;
    uint public tokensMinted;


    struct Statistics {
        address lastRewardTo;
        uint lastRewardAmount;
        uint lastRewardEthBlockNumber;
        uint lastRewardTimestamp;
    }

    Statistics public statistics;
    
    event Mint(address indexed from, uint reward_amount, uint epochCount, bytes32 newChallengeNumber);
    event RewardMasternode(address candidate, uint amount);

    constructor() public {
        tokensMinted = 0;
        maxSupplyForEra = totalSupply.div(2);
        difficulty = _MAXIMUM_TARGET;
        latestDifficultyPeriodStarted = block.number;
        _newEpoch(0);

        balances[msg.sender] = balances[msg.sender].add(420000 * 1e8); // 2% Premine as determined by the community meeting.
        emit Transfer(this, msg.sender, 420000 * 1e8);
    }

    function mint(uint256 nonce, bytes32 challenge_digest) public returns(bool success) {
        // perform the hash function validation
        _hash(nonce, challenge_digest);

        _arrangeMasternodeFlow();

        uint rewardAmount = _reward();
        uint rewardMasternode = _reward_masternode();

        tokensMinted += rewardAmount.add(rewardMasternode);

        uint epochCounter = _newEpoch(nonce);

        _adjustDifficulty();

        statistics = Statistics(msg.sender, rewardAmount, block.number, now);

        emit Mint(msg.sender, rewardAmount, epochCounter, challengeNumber);

        return true;
    }

    function _newEpoch(uint256 nonce) internal returns(uint) {

        if (tokensMinted.add(getMiningReward()) > maxSupplyForEra && rewardEra < MAX_REWARD_ERA) {
            rewardEra = rewardEra + 1;
        }
        maxSupplyForEra = totalSupply - totalSupply.div(2 ** (rewardEra + 1));
        epochCount = epochCount.add(1);
        challengeNumber = blockhash(block.number - 1);
        return (epochCount);
    }

    function _hash(uint256 nonce, bytes32 challenge_digest) internal returns(bytes32 digest) {
        digest = keccak256(challengeNumber, msg.sender, nonce);
        if (digest != challenge_digest) revert();
        if (uint256(digest) > difficulty) revert();
        bytes32 solution = solutionForChallenge[challengeNumber];
        solutionForChallenge[challengeNumber] = digest;
        if (solution != 0x0) revert(); //prevent the same answer from awarding twice
    }

    function _reward() internal returns(uint) {

        uint _pow = rewardsProofOfWork;

        balances[msg.sender] = balances[msg.sender].add(_pow);
        emit Transfer(this, msg.sender, _pow);

        return _pow;
    }

    function _reward_masternode() internal returns(uint) {

        uint _mnReward = rewardsMasternode;
        if (masternodeCounter == 0) return 0;

        address _mnCandidate = userByIndex[masternodeCandidate].accountOwner;
        if (_mnCandidate == 0x0) return 0;

        balances[_mnCandidate] = balances[_mnCandidate].add(_mnReward);
        emit Transfer(this, _mnCandidate, _mnReward);

        emit RewardMasternode(_mnCandidate, _mnReward);

        return _mnReward;
    }


    //DO NOT manually edit this method unless you know EXACTLY what you are doing
    function _adjustDifficulty() internal returns(uint) {
        //every so often, readjust difficulty. Dont readjust when deploying
        if (epochCount % blocksPerReadjustment != 0) {
            return difficulty;
        }

        uint ethBlocksSinceLastDifficultyPeriod = block.number - latestDifficultyPeriodStarted;
        //assume 360 ethereum blocks per hour
        //we want miners to spend 10 minutes to mine each 'block', about 60 ethereum blocks = one 0xbitcoin epoch
        uint epochsMined = blocksPerReadjustment;
        uint targetEthBlocksPerDiffPeriod = epochsMined * MINING_RATE_FACTOR;
        //if there were less eth blocks passed in time than expected
        if (ethBlocksSinceLastDifficultyPeriod < targetEthBlocksPerDiffPeriod) {
            uint excess_block_pct = (targetEthBlocksPerDiffPeriod.mul(MAX_ADJUSTMENT_PERCENT)).div(ethBlocksSinceLastDifficultyPeriod);
            uint excess_block_pct_extra = excess_block_pct.sub(100).limitLessThan(QUOTIENT_LIMIT);
            // If there were 5% more blocks mined than expected then this is 5.  If there were 100% more blocks mined than expected then this is 100.
            //make it harder
            difficulty = difficulty.sub(difficulty.div(TARGET_DIVISOR).mul(excess_block_pct_extra)); //by up to 50 %
        } else {
            uint shortage_block_pct = (ethBlocksSinceLastDifficultyPeriod.mul(MAX_ADJUSTMENT_PERCENT)).div(targetEthBlocksPerDiffPeriod);
            uint shortage_block_pct_extra = shortage_block_pct.sub(100).limitLessThan(QUOTIENT_LIMIT); //always between 0 and 1000
            //make it easier
            difficulty = difficulty.add(difficulty.div(TARGET_DIVISOR).mul(shortage_block_pct_extra)); //by up to 50 %
        }
        latestDifficultyPeriodStarted = block.number;
        if (difficulty < _MINIMUM_TARGET) //very difficult
        {
            difficulty = _MINIMUM_TARGET;
        }
        if (difficulty > _MAXIMUM_TARGET) //very easy
        {
            difficulty = _MAXIMUM_TARGET;
        }
    }
    //this is a recent ethereum block hash, used to prevent pre-mining future blocks
    function getChallengeNumber() public view returns(bytes32) {
        return challengeNumber;
    }
    //the number of zeroes the digest of the PoW solution requires.  Auto adjusts
    function getMiningDifficulty() public view returns(uint) {
        return _MAXIMUM_TARGET.div(difficulty);
    }

    function getMiningTarget() public view returns(uint) {
        return difficulty;
    }

    function getMiningReward() public view returns(uint) {
        return (baseMiningReward * 1e8).div(2 ** rewardEra);
    }

    //help debug mining software
    function getMintDigest(
        uint256 nonce,
        bytes32 challenge_digest,
        bytes32 challenge_number
    )
    public view returns(bytes32 digesttest) {
        bytes32 digest = keccak256(challenge_number, msg.sender, nonce);
        return digest;
    }
    //help debug mining software
    function checkMintSolution(
        uint256 nonce,
        bytes32 challenge_digest,
        bytes32 challenge_number,
        uint testTarget
    )
    public view returns(bool success) {
        bytes32 digest = keccak256(challenge_number, msg.sender, nonce);
        if (uint256(digest) > testTarget) revert();
        return (digest == challenge_digest);
    }
}

    Contract ABI  
[{"constant":true,"inputs":[],"name":"name","outputs":[{"name":"","type":"string"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"TARGET_DIVISOR","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_spender","type":"address"},{"name":"_value","type":"uint256"}],"name":"approve","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"proposalCounter","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[],"name":"discardRejectedProposal","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"mnid","type":"uint256"}],"name":"isPartOf","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[],"name":"_emergencyLoop","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[],"name":"buyMasternode","outputs":[],"payable":true,"stateMutability":"payable","type":"function"},{"constant":true,"inputs":[],"name":"getMiningDifficulty","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"nonce","type":"uint256"},{"name":"challenge_digest","type":"bytes32"}],"name":"mint","outputs":[{"name":"success","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"totalSupply","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"difficulty","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"MAX_ADJUSTMENT_PERCENT","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_from","type":"address"},{"name":"_to","type":"address"},{"name":"_value","type":"uint256"}],"name":"transferFrom","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"","type":"address"}],"name":"voterMap","outputs":[{"name":"isVoter","type":"bool"},{"name":"owner","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"rewardEra","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"decimals","outputs":[{"name":"","type":"uint8"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"getMiningTarget","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"MINING_RATE_FACTOR","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"token","type":"address"},{"name":"amount","type":"uint256"}],"name":"withdrawCollateral","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"_genesis","type":"address"},{"name":"_team","type":"bool"}],"name":"addGenesis","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"","type":"uint256"}],"name":"voterProposals","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"MAX_REWARD_ERA","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"getMiningReward","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[],"name":"addOwnToken","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"","type":"uint256"}],"name":"tokensList","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"getChallengeNumber","outputs":[{"name":"","type":"bytes32"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"maxSupplyForEra","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"","type":"address"},{"name":"","type":"address"}],"name":"tokens","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"baseMiningReward","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[],"name":"closeGenesis","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"proposalID","type":"uint256"}],"name":"getTokenProposalDetails","outputs":[{"name":"","type":"address"},{"name":"","type":"uint256"},{"name":"","type":"uint256"},{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[],"name":"becomeVoter","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"_spender","type":"address"},{"name":"_subtractedValue","type":"uint256"}],"name":"decreaseApproval","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"tokensMinted","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"_owner","type":"address"}],"name":"balanceOf","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[],"name":"renounceOwnership","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"contractProgress","outputs":[{"name":"epoch","type":"uint256"},{"name":"candidate","type":"uint256"},{"name":"round","type":"uint256"},{"name":"miningepoch","type":"uint256"},{"name":"globalreward","type":"uint256"},{"name":"powreward","type":"uint256"},{"name":"masternodereward","type":"uint256"},{"name":"usercounter","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"proposalID","type":"uint256"}],"name":"voteProposal","outputs":[{"name":"success","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"nonce","type":"uint256"},{"name":"challenge_digest","type":"bytes32"},{"name":"challenge_number","type":"bytes32"},{"name":"testTarget","type":"uint256"}],"name":"checkMintSolution","outputs":[{"name":"success","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"epochCount","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"_MAXIMUM_TARGET","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"listAcceptedTokens","outputs":[{"name":"","type":"address[]"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"token","type":"address"}],"name":"getTokenDetails","outputs":[{"name":"ad","type":"address"},{"name":"required","type":"uint256"},{"name":"active","type":"bool"},{"name":"valid","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"challengeNumber","outputs":[{"name":"","type":"bytes32"}],"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":"_contract","type":"address"}],"name":"pushProposal","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"proposalID","type":"uint256"}],"name":"reachedMajorityForTeam","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"symbol","outputs":[{"name":"","type":"string"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"statistics","outputs":[{"name":"lastRewardTo","type":"address"},{"name":"lastRewardAmount","type":"uint256"},{"name":"lastRewardEthBlockNumber","type":"uint256"},{"name":"lastRewardTimestamp","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"proposalID","type":"uint256"}],"name":"reachedMajority","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"nonce","type":"uint256"},{"name":"challenge_digest","type":"bytes32"},{"name":"challenge_number","type":"bytes32"}],"name":"getMintDigest","outputs":[{"name":"digesttest","type":"bytes32"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"votersCount","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"pastProposalTimeRules","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"_candidate","type":"address"}],"name":"isMasternodeOwner","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"token","type":"address"},{"name":"amount","type":"uint256"}],"name":"depositCollateral","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"_candidate","type":"address"}],"name":"getLastPerUser","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_to","type":"address"},{"name":"_value","type":"uint256"}],"name":"transfer","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"QUOTIENT_LIMIT","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"_member","type":"address"}],"name":"isTeamMember","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"userAddress","type":"address"}],"name":"belongsToUser","outputs":[{"name":"","type":"uint256[]"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"proposalPending","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"","type":"uint256"}],"name":"proposalList","outputs":[{"name":"tokenContract","type":"address"},{"name":"totalVotes","type":"uint256"},{"name":"proposedOn","type":"uint256"},{"name":"acceptedOn","type":"uint256"},{"name":"proposalType","type":"uint8"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"latestDifficultyPeriodStarted","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"LastProposalCanDiscard","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_spender","type":"address"},{"name":"_addedValue","type":"uint256"}],"name":"increaseApproval","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"blocksPerReadjustment","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"_MINIMUM_TARGET","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"_owner","type":"address"},{"name":"_spender","type":"address"}],"name":"allowance","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"index","type":"uint256"}],"name":"masternodeInfo","outputs":[{"name":"","type":"address"},{"name":"","type":"bool"},{"name":"","type":"uint256"},{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"votersCountTeam","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"inputs":[],"payable":false,"stateMutability":"nonpayable","type":"constructor"},{"payable":true,"stateMutability":"payable","type":"fallback"},{"anonymous":false,"inputs":[{"indexed":true,"name":"from","type":"address"},{"indexed":false,"name":"reward_amount","type":"uint256"},{"indexed":false,"name":"epochCount","type":"uint256"},{"indexed":false,"name":"newChallengeNumber","type":"bytes32"}],"name":"Mint","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"name":"candidate","type":"address"},{"indexed":false,"name":"amount","type":"uint256"}],"name":"RewardMasternode","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"name":"token","type":"address"},{"indexed":false,"name":"user","type":"address"},{"indexed":false,"name":"amount","type":"uint256"},{"indexed":false,"name":"balance","type":"uint256"}],"name":"Deposit","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"name":"token","type":"address"},{"indexed":false,"name":"user","type":"address"},{"indexed":false,"name":"amount","type":"uint256"},{"indexed":false,"name":"balance","type":"uint256"}],"name":"Withdraw","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"name":"candidateAddress","type":"address"},{"indexed":false,"name":"timeStamp","type":"uint256"}],"name":"NewMasternode","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"name":"candidateAddress","type":"address"},{"indexed":false,"name":"timeStamp","type":"uint256"}],"name":"RemovedMasternode","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"name":"ProposalID","type":"uint256"}],"name":"NewProposal","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"name":"ProposalID","type":"uint256"}],"name":"ProposalAccepted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"owner","type":"address"},{"indexed":true,"name":"spender","type":"address"},{"indexed":false,"name":"value","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"from","type":"address"},{"indexed":true,"name":"to","type":"address"},{"indexed":false,"name":"value","type":"uint256"}],"name":"Transfer","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"}]

  Contract Creation Code Switch To Opcodes View
603c600455600a60058190556802b5e3af16b1880000600d55600e556010805460ff199081169091556012805490911660011790556015805461ffff1916905564012a05f200601d55611194601e5560c0604052600360808190527f434c4d000000000000000000000000000000000000000000000000000000000060a09081526200008f916024919062000377565b5060408051808201909152600c8082527f4361656c756d20546f6b656e00000000000000000000000000000000000000006020909201918252620000d69160259162000377565b506026805460ff19166008179055660775f05a07400060279081556032602a819055610200602b5562010000602c557d040000000000000000000000000000000000000000000000000000000000602d556000602e55603091909155603c603155606490556107d060338190556200015e90600264010000000062002a806200024d82021704565b6034553480156200016e57600080fd5b5060008054600160a060020a03191633178155603955602754620001a290600264010000000062002a806200024d82021704565b602f55602d5460385543602855620001c4600064010000000062000272810204565b5033600090815260016020526040902054620001f590652632e314a00064010000000062002c756200032b82021704565b33600081815260016020908152604091829020939093558051652632e314a00081529051919230927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9281900390910190a362000419565b6000808083116200025d57600080fd5b82848115156200026957fe5b04949350505050565b6000602f54620002ac6200029462000345640100000000026401000000009004565b6039549064010000000062002c756200032b82021704565b118015620002bd5750603054602e54105b15620002cd57602e805460010190555b602e54602754620002f29160010160020a64010000000062002a806200024d82021704565b60275403602f556029546200031790600164010000000062002c756200032b82021704565b602981905543600019014060375592915050565b6000828201838110156200033e57600080fd5b9392505050565b602e54602a5460009162000371916305f5e100029060020a64010000000062002a806200024d82021704565b90505b90565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f10620003ba57805160ff1916838001178555620003ea565b82800160010185558215620003ea579182015b82811115620003ea578251825591602001919060010190620003cd565b50620003f8929150620003fc565b5090565b6200037491905b80821115620003f8576000815560010162000403565b6135d980620004296000396000f30060806040526004361061034d5763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166306fdde038114610372578063095b6d4c146103fc578063095ea7b3146104235780630c0512e91461045b5780630f8143f61461047057806310cb56281461048557806314dfad27146104b957806316c85710146104ce57806317da485f146104d65780631801fbe5146104eb57806318160ddd1461050657806319cae4621461051b5780631beddf1c1461053057806323b872dd146105455780632be652251461056f5780632d38bf7a146105b3578063313ce567146105c857806332e99708146105f35780633426e5f514610608578063350c35e91461061d578063372210d114610641578063415fe9c41461066757806346eed3f31461067f578063490203a714610694578063493953de146106a95780634d12e34e146106be5780634ef37628146106d65780634fa972e1146106eb578063508493bc1461070057806354bcb1641461072757806355e97e931461073c5780635a43fa901461075157806363d494ea1461079957806366188463146107ae5780636de9f32b146107d257806370a08231146107e7578063715018a6146108085780637558d81e1461081d578063807896d51461087357806381269a561461088b578063829965cc146108ac57806387a2a9d6146108c15780638843c1ba146108d657806388aa8bee1461093b5780638ae0368b1461098c5780638da5cb5b146109a15780638e955978146109b657806391fb4583146109d757806395d89b41146109ef57806395e272bd14610a045780639601065d14610a1957806397566aa014610a3157806398c0793814610a4f5780639b598caf14610a645780639fc7535414610a79578063a5d5db0c14610a9a578063a73c52e714610abe578063a9059cbb14610adf578063ad1dfe3b14610b03578063bbe9f99d14610b18578063c325ae4e14610b39578063c5efa85f14610b5a578063c6311e3f14610b6f578063cb9ae70714610bd9578063cf866d6f14610bee578063d73dd62314610c03578063d87b8fcb14610c27578063dc6e9cf914610c3c578063dd62ed3e14610c51578063eae445ed14610c78578063f2f3eb8214610cc0578063f2fde38b14610cd5575b600d543414801561035d57503415155b151561036857600080fd5b610370610cf6565b005b34801561037e57600080fd5b50610387610d5e565b6040805160208082528351818301528351919283929083019185019080838360005b838110156103c15781810151838201526020016103a9565b50505050905090810190601f1680156103ee5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561040857600080fd5b50610411610dec565b60408051918252519081900360200190f35b34801561042f57600080fd5b50610447600160a060020a0360043516602435610df2565b604080519115158252519081900360200190f35b34801561046757600080fd5b50610411610e59565b34801561047c57600080fd5b50610447610e5f565b34801561049157600080fd5b5061049d600435610eac565b60408051600160a060020a039092168252519081900360200190f35b3480156104c557600080fd5b50610370610eca565b610370610efd565b3480156104e257600080fd5b50610411610f22565b3480156104f757600080fd5b50610447600435602435610f40565b34801561051257600080fd5b5061041161102b565b34801561052757600080fd5b50610411611031565b34801561053c57600080fd5b50610411611037565b34801561055157600080fd5b50610447600160a060020a036004358116906024351660443561103d565b34801561057b57600080fd5b50610590600160a060020a03600435166111a2565b604080519215158352600160a060020a0390911660208301528051918290030190f35b3480156105bf57600080fd5b506104116111c7565b3480156105d457600080fd5b506105dd6111cd565b6040805160ff9092168252519081900360200190f35b3480156105ff57600080fd5b506104116111d6565b34801561061457600080fd5b506104116111dc565b34801561062957600080fd5b50610370600160a060020a03600435166024356111e2565b34801561064d57600080fd5b50610370600160a060020a036004351660243515156113ca565b34801561067357600080fd5b5061049d600435611415565b34801561068b57600080fd5b50610411611430565b3480156106a057600080fd5b50610411611436565b3480156106b557600080fd5b50610447611458565b3480156106ca57600080fd5b5061049d6004356114a3565b3480156106e257600080fd5b506104116114cb565b3480156106f757600080fd5b506104116114d1565b34801561070c57600080fd5b50610411600160a060020a03600435811690602435166114d7565b34801561073357600080fd5b506104116114f4565b34801561074857600080fd5b506103706114fa565b34801561075d57600080fd5b50610769600435611522565b60408051600160a060020a0390951685526020850193909352838301919091526060830152519081900360800190f35b3480156107a557600080fd5b506103706115dd565b3480156107ba57600080fd5b50610447600160a060020a0360043516602435611727565b3480156107de57600080fd5b50610411611818565b3480156107f357600080fd5b50610411600160a060020a036004351661181e565b34801561081457600080fd5b50610370611839565b34801561082957600080fd5b50610832611898565b604080519889526020890197909752878701959095526060870193909352608086019190915260a085015260c084015260e083015251908190036101000190f35b34801561087f57600080fd5b506104476004356118d9565b34801561089757600080fd5b50610447600435602435604435606435611c10565b3480156108b857600080fd5b50610411611c5a565b3480156108cd57600080fd5b50610411611c60565b3480156108e257600080fd5b506108eb611c66565b60408051602080825283518183015283519192839290830191858101910280838360005b8381101561092757818101518382015260200161090f565b505050509050019250505060405180910390f35b34801561094757600080fd5b5061095c600160a060020a0360043516611cc8565b60408051600160a060020a0390951685526020850193909352901515838301526060830152519081900360800190f35b34801561099857600080fd5b50610411611d02565b3480156109ad57600080fd5b5061049d611d08565b3480156109c257600080fd5b50610411600160a060020a0360043516611d17565b3480156109e357600080fd5b50610447600435611fcd565b3480156109fb57600080fd5b50610387611ff6565b348015610a1057600080fd5b50610769612051565b348015610a2557600080fd5b5061044760043561206c565b348015610a3d57600080fd5b50610411600435602435604435612086565b348015610a5b57600080fd5b506104116120bb565b348015610a7057600080fd5b506104476120c1565b348015610a8557600080fd5b50610447600160a060020a03600435166120ef565b348015610aa657600080fd5b50610370600160a060020a0360043516602435612144565b348015610aca57600080fd5b50610411600160a060020a036004351661237d565b348015610aeb57600080fd5b50610447600160a060020a03600435166024356123ba565b348015610b0f57600080fd5b50610411612489565b348015610b2457600080fd5b50610447600160a060020a036004351661248f565b348015610b4557600080fd5b506108eb600160a060020a03600435166124d1565b348015610b6657600080fd5b50610447612540565b348015610b7b57600080fd5b50610b87600435612549565b6040518086600160a060020a0316600160a060020a03168152602001858152602001848152602001838152602001826001811115610bc157fe5b60ff1681526020019550505050505060405180910390f35b348015610be557600080fd5b50610411612585565b348015610bfa57600080fd5b5061044761258b565b348015610c0f57600080fd5b50610447600160a060020a0360043516602435612664565b348015610c3357600080fd5b506104116126fd565b348015610c4857600080fd5b50610411612703565b348015610c5d57600080fd5b50610411600160a060020a0360043581169060243516612709565b348015610c8457600080fd5b50610c90600435612734565b60408051600160a060020a0390951685529215156020850152838301919091526060830152519081900360800190f35b348015610ccc57600080fd5b50610411612769565b348015610ce157600080fd5b50610370600160a060020a036004351661276f565b60105460ff1615610d0657600080fd5b600e54600f541115610d1757600080fd5b60008054604051600160a060020a03909116913480156108fc02929091818181858888f19350505050158015610d51573d6000803e3d6000fd5b50610d5b3361278f565b50565b6025805460408051602060026001851615610100026000190190941693909304601f81018490048402820184019092528181529291830182828015610de45780601f10610db957610100808354040283529160200191610de4565b820191906000526020600020905b815481529060010190602001808311610dc757829003601f168201915b505050505081565b60335481565b336000818152600360209081526040808320600160a060020a038716808552908352818420869055815186815291519394909390927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925928290030190a35060015b92915050565b600a5481565b60008054600160a060020a03163314610e7757600080fd5b60065460ff161515610e8857600080fd5b610e9061258b565b1515610e9b57600080fd5b506006805460ff1916905560015b90565b600081815260216020526040902054600160a060020a03165b919050565b600054600160a060020a03163314610ee157600080fd5b610ee96128b4565b610ef1612930565b50601a80546001019055565b600d5434148015610f0d57503415155b1515610f1857600080fd5b610f20610cf6565b565b6000610f3b603854602d54612a8090919063ffffffff16565b905090565b600080600080610f508686612aa3565b50610f59610ee1565b610f61612b13565b9250610f6b612b78565b9150610f7d838363ffffffff612c7516565b603980549091019055610f8f86612c8e565b9050610f99612d16565b506040805160808101825233808252602080830187905243838501819052426060948501819052603a8054600160a060020a03191685179055603b899055603c91909155603d55603754845188815291820186905281850152925190927fcf6fbb9dcea7d07263ab4f5c3a92f53af33dffc421d9d121e1c74b307e68189d92908290030190a250600195945050505050565b60275481565b60385481565b60325481565b600160a060020a03831660009081526001602052604081205482111561106257600080fd5b600160a060020a038416600090815260036020908152604080832033845290915290205482111561109257600080fd5b600160a060020a03831615156110a757600080fd5b600160a060020a0384166000908152600160205260409020546110d0908363ffffffff612e8616565b600160a060020a038086166000908152600160205260408082209390935590851681522054611105908363ffffffff612c7516565b600160a060020a038085166000908152600160209081526040808320949094559187168152600382528281203382529091522054611149908363ffffffff612e8616565b600160a060020a038086166000818152600360209081526040808320338452825291829020949094558051868152905192871693919260008051602061358e833981519152929181900390910190a35060019392505050565b60086020526000908152604090205460ff8116906101009004600160a060020a031682565b602e5481565b60265460ff1681565b60385490565b60315481565b6000600160a060020a03831615156111f957600080fd5b61120283612e9d565b1515611258576040805160e560020a62461bcd02815260206004820152601460248201527f4552433230206e6f7420617574686f7269736564000000000000000000000000604482015290519081900360640190fd5b611261336120ef565b151561126c57600080fd5b600160a060020a0383166000908152601360209081526040808320338452909152902054821461129b57600080fd5b50600160a060020a0382166000908152601360209081526040808320338085529252822080549290556112d6906112d19061237d565b612ec2565b50604080517fa9059cbb000000000000000000000000000000000000000000000000000000008152336004820152602481018390529051600160a060020a0385169163a9059cbb9160448083019260209291908290030181600087803b15801561133f57600080fd5b505af1158015611353573d6000803e3d6000fd5b505050506040513d602081101561136957600080fd5b5051151561137657600080fd5b60408051600160a060020a03851681523360208201528082018390526060810183905290517ff341246adaac6f497bc2a656f546ab9e182111d630394f0c57c710a59a2cb5679181900360800190a1505050565b600054600160a060020a031633146113e157600080fd5b601554610100900460ff16156113f657600080fd5b6113ff8261278f565b5080156114115761140f33612fd7565b505b5050565b600960205260009081526040902054600160a060020a031681565b60305481565b6000610f3b602e5460020a602a546305f5e10002612a8090919063ffffffff16565b60008054600160a060020a0316331461147057600080fd5b60125460ff16151561148157600080fd5b6114933064746a528800618e94613028565b506012805460ff19169055600190565b60118054829081106114b157fe5b600091825260209091200154600160a060020a0316905081565b60375490565b602f5481565b601360209081526000928352604080842090915290825290205481565b602a5481565b600054600160a060020a0316331461151157600080fd5b6015805461ff001916610100179055565b6000818152600760205260408082205481517f08a1b5740000000000000000000000000000000000000000000000000000000081529151839283928392600160a060020a03909116916308a1b57491600480830192608092919082900301818787803b15801561159157600080fd5b505af11580156115a5573d6000803e3d6000fd5b505050506040513d60808110156115bb57600080fd5b5080516020820151604083015160609093015191989097509195509350915050565b6115e6336120ef565b151561163c576040805160e560020a62461bcd02815260206004820152601760248201527f5573657220686173206e6f206d61737465726e6f646573000000000000000000604482015290519081900360640190fd5b3360009081526008602052604090205460ff16156116c9576040805160e560020a62461bcd028152602060048201526024808201527f5573657220416c726561647920766f74656420666f7220746869732070726f7060448201527f6f73616c00000000000000000000000000000000000000000000000000000000606482015290519081900360840190fd5b3360008181526008602052604090208054600174ffffffffffffffffffffffffffffffffffffffff001990911661010084021760ff19168117909155600b805490910190556117179061248f565b15610f2057600c80546001019055565b336000908152600360209081526040808320600160a060020a038616845290915281205480831061177b57336000908152600360209081526040808320600160a060020a03881684529091528120556117b0565b61178b818463ffffffff612e8616565b336000908152600360209081526040808320600160a060020a03891684529091529020555b336000818152600360209081526040808320600160a060020a0389168085529083529281902054815190815290519293927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929181900390910190a3600191505b5092915050565b60395481565b600160a060020a031660009081526001602052604090205490565b600054600160a060020a0316331461185057600080fd5b60008054604051600160a060020a03909116917ff8df31144d9c2f0f6b59d69b8b98abd5459d07f2742c4df920b25aae33c6482091a260008054600160a060020a0319169055565b600080600080600080600080601954601754601654601a546118b8611436565b601b54601c54601854969f959e50939c50919a509850965094509092509050565b3360009081526008602052604081205460ff161515611942576040805160e560020a62461bcd02815260206004820152601a60248201527f53656e646572206e6f74206c697374656420617320766f746572000000000000604482015290519081900360640190fd5b600082101561199b576040805160e560020a62461bcd02815260206004820152601960248201527f4e6f2070726f706f73616c207761732073656c65637465642e00000000000000604482015290519081900360640190fd5b600a548211156119f5576040805160e560020a62461bcd02815260206004820152601760248201527f50726f706f73616c206f7574206f66206c696d6974732e000000000000000000604482015290519081900360640190fd5b600082815260096020526040902054600160a060020a0316331415611a64576040805160e560020a62461bcd02815260206004820152600e60248201527f416c726561647920766f7465642e000000000000000000000000000000000000604482015290519081900360640190fd5b600160008381526007602052604090206004015460ff166001811115611a8657fe5b1415611b4457611a953361248f565b1515611aeb576040805160e560020a62461bcd02815260206004820152601b60248201527f5265737472696374656420666f72207465616d206d656d626572730000000000604482015290519081900360640190fd5b60008281526009602090815260408083208054600160a060020a0319163317905560079091529020600190810180549091019055611b2882611fcd565b15611b3f57611b356130ca565b5060019050610ec5565b610ec5565b600554600b541015611bc6576040805160e560020a62461bcd02815260206004820152603160248201527f4e6f7420656e6f75676820766f7465727320696e206578697374656e6365207460448201527f6f207075736820612070726f706f73616c000000000000000000000000000000606482015290519081900360840190fd5b60008281526009602090815260408083208054600160a060020a0319163317905560079091529020600190810180549091019055611c038261206c565b15610ec557611b356130ca565b604080518381526c010000000000000000000000003302602082015260348101869052905190819003605401902060009082811115611c4e57600080fd5b93909314949350505050565b60295481565b602d5481565b60606011805480602002602001604051908101604052809291908181526020018280548015611cbe57602002820191906000526020600020905b8154600160a060020a03168152600190910190602001808311611ca0575b5050505050905090565b600160a060020a0390811660009081526014602052604090208054600182015460029092015492811693919260a060020a90910460ff1691565b60375481565b600054600160a060020a031681565b600080548190600160a060020a03163314611d3157600080fd5b600a5415611dbd57611d416120c1565b1515611dbd576040805160e560020a62461bcd02815260206004820152603a60248201527f596f75206e65656420746f20776169742039302064617973206265666f72652060448201527f7375626d697474696e672061206e65772070726f706f73616c2e000000000000606482015290519081900360840190fd5b60065460ff1615611e18576040805160e560020a62461bcd02815260206004820152601c60248201527f416e6f746865722070726f706f73616c2069732070656e64696e672e00000000604482015290519081900360640190fd5b82600160a060020a031663c51a29e06040518163ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401602060405180830381600087803b158015611e6f57600080fd5b505af1158015611e83573d6000803e3d6000fd5b505050506040513d6020811015611e9957600080fd5b50516040805160a081018252600160a060020a03861681526000602082018190524292820192909252606081019190915290915060808101826001811115611edd57fe5b6001811115611ee857fe5b9052600a5460009081526007602090815260409182902083518154600160a060020a031916600160a060020a039091161781559083015160018083019190915591830151600282015560608301516003820155608083015160048201805492939192909160ff19909116908381811115611f5e57fe5b021790555050600a5460408051918252517f9a863892f20a6b9c6cec64d611b5864be6373191ce2cacc3b05a299bce3bf80e92509081900360200190a1600a80546001908101918290556006805460ff191682179055611fc4919063ffffffff612e8616565b91505b50919050565b600081815260076020526040812060010154611fe76131b7565b8110611fc75760019150611fc7565b6024805460408051602060026001851615610100026000190190941693909304601f81018490048402820184019092528181529291830182828015610de45780601f10610db957610100808354040283529160200191610de4565b603a54603b54603c54603d54600160a060020a039093169284565b600081815260076020526040812060010154611fe76131cc565b604080518281526c01000000000000000000000000330260208201526034810185905290519081900360540190209392505050565b600b5481565b600a54600019016000908152600760205260408120600201546276a700810142106120eb57600191505b5090565b600160a060020a038116600090815260226020526040812060030154811061211957506000610ec5565b600160a060020a038083166000818152602260205260409020549091161415610ec557506001610ec5565b61214d82612e9d565b15156121a3576040805160e560020a62461bcd02815260206004820152601460248201527f4552433230206e6f7420617574686f7269736564000000000000000000000000604482015290519081900360640190fd5b6121ac826131de565b81146121b757600080fd5b6121c0826131fc565b15156121cb57600080fd5b600160a060020a03821660009081526013602090815260408083203384529091529020546121ff908263ffffffff612c7516565b600160a060020a0383166000818152601360209081526040808320338085529083528184209590955580517f23b872dd0000000000000000000000000000000000000000000000000000000081526004810195909552306024860152604485018690525192936323b872dd9360648083019491928390030190829087803b15801561228957600080fd5b505af115801561229d573d6000803e3d6000fd5b505050506040513d60208110156122b357600080fd5b5051151561230b576040805160e560020a62461bcd02815260206004820152601060248201527f6572726f72207769746820746f6b656e00000000000000000000000000000000604482015290519081900360640190fd5b600160a060020a03821660008181526013602090815260408083203380855290835292819020548151948552918401929092528282018490526060830152517fdcbc1c05240f31ff3ad067ef1ee35ce4997762752e3a095284754544f4c709d79181900360800190a161140f3361278f565b600160a060020a0381166000908152602260205260408120600301805460001981019081106123a857fe5b90600052602060002001549050919050565b336000908152600160205260408120548211156123d657600080fd5b600160a060020a03831615156123eb57600080fd5b3360009081526001602052604090205461240b908363ffffffff612e8616565b3360009081526001602052604080822092909255600160a060020a0385168152205461243d908363ffffffff612c7516565b600160a060020a03841660008181526001602090815260409182902093909355805185815290519192339260008051602061358e8339815191529281900390910190a350600192915050565b60345481565b600160a060020a0381166000908152602260205260408120547501000000000000000000000000000000000000000000900460ff1615610ec557506001610ec5565b600160a060020a03811660009081526022602090815260409182902060030180548351818402810184019094528084526060939283018282801561253457602002820191906000526020600020905b815481526020019060010190808311612520575b50505050509050919050565b60065460ff1681565b60076020526000908152604090208054600182015460028301546003840154600490940154600160a060020a0390931693919290919060ff1685565b60285481565b600a546000190160009081526007602090815260408083205481517ff61c266b0000000000000000000000000000000000000000000000000000000081529151849384938493600160a060020a03169263f61c266b9260048084019391929182900301818787803b1580156125ff57600080fd5b505af1158015612613573d6000803e3d6000fd5b505050506040513d602081101561262957600080fd5b5051600a5460001901600090815260076020526040902060020154909350915050620151808202810142811161265e57600193505b50505090565b336000908152600360209081526040808320600160a060020a0386168452909152812054612698908363ffffffff612c7516565b336000818152600360209081526040808320600160a060020a0389168085529083529281902085905580519485525191937f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929081900390910190a350600192915050565b602b5481565b602c5481565b600160a060020a03918216600090815260036020908152604080832093909416825291909152205490565b600090815260216020526040902080546001820154600290920154600160a060020a0382169360a060020a90920460ff169291565b600c5481565b600054600160a060020a0316331461278657600080fd5b610d5b81613232565b6018805460009081526021602090815260408083208054600160a060020a038716600160a060020a0319918216811790925585548552828520805474ff0000000000000000000000000000000000000000191660a060020a17905560165486548652838620600191820160029091015586548087528487208201558286526022855283862080549092168317825586546003909201805480830182559087528587200191909155601f805480830182559086527fa03837a25210ee280c2113ff4b77ca23440b19d4866cca721c801278fd08d80781015585540190945580519384524291840191909152805191927f14fa498a21d9dd10ef5c439bffbff97aa63c4d9186dce598a3ed9c43501b57fb929081900390910190a150506018546000190190565b6000806000806128c2611436565b9350601e54601a548115156128d357fe5b04600a029250600a8310156128f65760648404600502601b556000601c5561292a565b605a831115612915576064840460028102601b55606202601c5561292a565b505060648204810280830361292a81836132a2565b50505050565b600080805b61293d6132aa565b600160a060020a031615156129d157600682106129a4576040805160e560020a62461bcd02815260206004820152601460248201527f4661696c73616665207377697463686564206f6e000000000000000000000000604482015290519081900360640190fd5b81600514156129b65760009250612a7b565b60168054600190810190915560006017559190910190612935565b60016018540360175414156129ef5760168054600101905560006017555b506017545b601854811015612a6d5760008181526021602052604090205460a060020a900460ff1615612a65576016546000828152602160205260409020600201541415612a6557612a408161334a565b506017819055600081815260216020526040902054600160a060020a03169250612a7b565b6001016129f4565b601680546001019055600092505b505090565b600080808311612a8f57600080fd5b8284811515612a9a57fe5b04949350505050565b603754604080519182526c010000000000000000000000003302602083015260348201849052519081900360540190206000828214612ae157600080fd5b603854821115612af057600080fd5b506037546000908152603560205260409020805490829055801561181157600080fd5b601b5433600090815260016020526040812054909190612b39908263ffffffff612c7516565b3360008181526001602090815260409182902093909355805184815290519192309260008051602061358e8339815191529281900390910190a3919050565b601c546018546000919082901515612b935760009250612a7b565b50601754600090815260216020526040902054600160a060020a0316801515612bbf5760009250612a7b565b600160a060020a038116600090815260016020526040902054612be8908363ffffffff612c7516565b600160a060020a03821660008181526001602090815260409182902093909355805185815290519192309260008051602061358e8339815191529281900390910190a360408051600160a060020a03831681526020810184905281517f8f9a423c71e43ad001bebf147d969f424a8fac4e5970a367c5e53abb17cbe710929181900390910190a150919050565b600082820183811015612c8757600080fd5b9392505050565b6000602f54612cad612c9e611436565b6039549063ffffffff612c7516565b118015612cbd5750603054602e54105b15612ccc57602e805460010190555b602e54602754612ce79160010160020a63ffffffff612a8016565b60275403602f55602954612d0290600163ffffffff612c7516565b602981905543600019014060375592915050565b600080600080600080600080602b54602954811515612d3157fe5b0615612d41576038549750612e7c565b60285443039650602b5495506031548602945084871015612deb57612d8187612d756032548861336890919063ffffffff16565b9063ffffffff612a8016565b603454909450612da890612d9c86606463ffffffff612e8616565b9063ffffffff61339616565b9250612de3612dd484612dc8603354603854612a8090919063ffffffff16565b9063ffffffff61336816565b6038549063ffffffff612e8616565b603855612e52565b612e0485612d756032548a61336890919063ffffffff16565b603454909250612e1f90612d9c84606463ffffffff612e8616565b9050612e4e612e3f82612dc8603354603854612a8090919063ffffffff16565b6038549063ffffffff612c7516565b6038555b43602855602c546038541015612e6957602c546038555b602d546038541115612e7c57602d546038555b5050505050505090565b60008083831115612e9657600080fd5b5050900390565b600160a060020a031660009081526014602052604090205460a060020a900460ff1690565b600081815260216020526040812060010154601f80548391906000198101908110612ee957fe5b600091825260208083209091015486835260219091526040909120805474ff000000000000000000000000000000000000000019169055601f8054919250829184908110612f3357fe5b6000918252602080832090910192909255828152602190915260409020600101829055601f80546000190190612f699082613554565b50612f73846133ae565b50600084815260216020908152604091829020548251600160a060020a039091168152429181019190915281517fb9951e039957c4967e11bd6882bc288c70c4c049dd782362a293c2bfeeb5fedc929181900390910190a1600192505b5050919050565b600160a060020a03166000908152602260205260409020805475ff00000000000000000000000000000000000000000019167501000000000000000000000000000000000000000000179055600190565b600160a060020a0390921660008181526014602052604081208054600180830195909555426003830181905562015180909602909501600282015574ff000000000000000000000000000000000000000019600160a060020a031995861684171660a060020a17905560118054938401815590527f31ecc21a745e3968a04e9570e4425bc18fa8019c68028196b546d1669c200c689091018054909216179055565b60008060008060008060006130eb6001600a54612e8690919063ffffffff16565b6000818152600760205260409020426003909101556006805460ff19169055955061311586611522565b9297509095509350915081151561313157613131858585613028565b6001821415613179578315613163575060005b8381101561315e576131558561278f565b50600101613144565b61316e565b61316c8561278f565b505b61317785612fd7565b505b6040805187815290517fd24c2047577899547bacebb29e319fc7d73f6712b5adb401d45556f34bb2aa3b9181900360200190a1509395945050505050565b600454600c54600091026064815b0491505090565b600454600b54600091026064816131c5565b600160a060020a031660009081526014602052604090206001015490565b600160a060020a038116600090815260146020526040812060020154428111156132295760019150611fc7565b50600092915050565b600160a060020a038116151561324757600080fd5b60008054604051600160a060020a03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a360008054600160a060020a031916600160a060020a0392909216919091179055565b601c55601b55565b60165460175460185460009291908390600019018214156132d057826001019250600091505b506017545b6018548110156133405760008181526021602052604090205460a060020a900460ff16156133385760008181526021602052604090206002015483141561333857600081815260216020526040902054600160a060020a0316935090508061265e565b6001016132d5565b5060009392505050565b60009081526021602052604090206002018054600190810190915590565b60008083151561337b5760009150611811565b5082820282848281151561338b57fe5b0414612c8757600080fd5b6000818311156133a7575080610e53565b5090919050565b60606000806133bc84610eac565b600160a060020a03811660009081526022602052604090206003015490925084106133e657612fd0565b50825b600160a060020a0382166000908152602260205260409020600301546000190181101561348157600160a060020a038216600090815260226020526040902060030180546001830190811061343a57fe5b6000918252602080832090910154600160a060020a03851683526022909152604090912060030180548390811061346d57fe5b6000918252602090912001556001016133e9565b600160a060020a0382166000908152602260205260409020600301805460001981019081106134ac57fe5b60009182526020808320909101829055600160a060020a038416825260229052604090206003018054906134e4906000198301613554565b50600160a060020a0382166000908152602260209081526040918290206003018054835181840281018401909452808452909183018282801561354657602002820191906000526020600020905b815481526020019060010190808311613532575b505050505092505050919050565b81548183558181111561140f5760008381526020902061140f918101908301610ea991905b808211156120eb57600081556001016135795600ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3efa165627a7a723058202af7da4b6ff170da0b8322f123449c1a370434d9493db63c8bfed116faefe3c10029

   Swarm Source:
bzzr://2af7da4b6ff170da0b8322f123449c1a370434d9493db63c8bfed116faefe3c1

 

View All
Block Age transaction Difficulty GasUsed Reward
View All
Block Age UncleNumber Difficulty GasUsed Reward
Make sure to use the "Vote Down" button for any spammy posts, and the "Vote Up" for interesting conversations.