Sponsored:   [Largest VC Funded] TEMCO, millions sold out in seconds. Join TEMCO's last presale at CoinBene!
Contract Overview
Balance: 0 Ether
Ether Value: $0
Transactions: 2 txns
Misc:
Address Watch: Add To Watch List
Contract Creator: 0xffaba14532e9ce13639ceeddb6b71645f013bf5aat txn 0xb4ae9281f9500455678492f587e605c27b67c1b7fa08d66f195284690ac1f7a8
 Latest 2 txns

TxHash Age From To Value [TxFee]
0x63a9d4ef927c3b06f26e09b395f20b7d481af064ef2b0b430a4aa0a7062b5ca1145 days 16 hrs ago0xffaba14532e9ce13639ceeddb6b71645f013bf5a  IN   0xdea454c9c4ad408f324cc0ea382b2b7aad99640c0 Ether0.00061716
0xb4ae9281f9500455678492f587e605c27b67c1b7fa08d66f195284690ac1f7a8146 days 15 hrs ago0xffaba14532e9ce13639ceeddb6b71645f013bf5a  IN    Contract Creation0 Ether0.01453525


[ Download CSV Export  ] 
 Internal Transactions as a result of Contract Execution
View All
ParentTxHash Block Age From To Value
Warning: The Compiled Contract might be susceptible to ExpExponentCleanup (medium/high-severity), EventStructWrongData (very low-severity) SolidityCompiler Bugs.

Contract Source Code Verified (Exact Match)
Contract Name: CodexStakeContract
Compiler Text: v0.4.24+commit.e67f0147
Optimization Enabled: Yes
Runs (Optimiser):  200



  Contract Source Code   Find Similiar Contracts

pragma solidity 0.4.24;

// File: contracts/ERC900/ERC900.sol

/**
 * @title ERC900 Simple Staking Interface
 * @dev See https://github.com/ethereum/EIPs/blob/master/EIPS/eip-900.md
 */
contract ERC900 {
  event Staked(address indexed user, uint256 amount, uint256 total, bytes data);
  event Unstaked(address indexed user, uint256 amount, uint256 total, bytes data);

  function stake(uint256 amount, bytes data) public;
  function stakeFor(address user, uint256 amount, bytes data) public;
  function unstake(uint256 amount, bytes data) public;
  function totalStakedFor(address addr) public view returns (uint256);
  function totalStaked() public view returns (uint256);
  function token() public view returns (address);
  function supportsHistory() public pure returns (bool);

  // NOTE: Not implementing the optional functions
  // function lastStakedFor(address addr) public view returns (uint256);
  // function totalStakedForAt(address addr, uint256 blockNumber) public view returns (uint256);
  // function totalStakedAt(uint256 blockNumber) public view returns (uint256);
}

// File: contracts/CodexStakeContractInterface.sol

contract CodexStakeContractInterface is ERC900 {

  function stakeForDuration(
    address user,
    uint256 amount,
    uint256 lockInDuration,
    bytes data)
    public;

  function spendCredits(
    address user,
    uint256 amount)
    public;

  function creditBalanceOf(
    address user)
    public
    view
    returns (uint256);
}

// File: contracts/library/Ownable.sol

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


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


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

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

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

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

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

// File: contracts/ERC20/ERC20Basic.sol

/**
 * @title ERC20Basic
 * @dev Simpler version of ERC20 interface
 * @dev see https://github.com/ethereum/EIPs/issues/179
 */
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);
}

// File: contracts/ERC20/ERC20.sol

/**
 * @title ERC20 interface
 * @dev See https://github.com/ethereum/EIPs/blob/master/EIPS/eip-20.md
 */
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);
}

// File: contracts/library/SafeMath.sol

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

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

    c = a * b;
    assert(c / a == b);
    return c;
  }

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

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

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

// File: contracts/ERC900/ERC900BasicStakeContract.sol

/* solium-disable security/no-block-members */
pragma solidity 0.4.24;





/**
 * @title ERC900 Simple Staking Interface basic implementation
 * @dev See https://github.com/ethereum/EIPs/blob/master/EIPS/eip-900.md
 */
contract ERC900BasicStakeContract is ERC900 {
  // @TODO: deploy this separately so we don't have to deploy it multiple times for each contract
  using SafeMath for uint256;

  // Token used for staking
  ERC20 stakingToken;

  // The default duration of stake lock-in (in seconds)
  uint256 public defaultLockInDuration;

  // To save on gas, rather than create a separate mapping for totalStakedFor & personalStakes,
  //  both data structures are stored in a single mapping for a given addresses.
  //
  // It's possible to have a non-existing personalStakes, but have tokens in totalStakedFor
  //  if other users are staking on behalf of a given address.
  mapping (address => StakeContract) public stakeHolders;

  // Struct for personal stakes (i.e., stakes made by this address)
  // unlockedTimestamp - when the stake unlocks (in seconds since Unix epoch)
  // actualAmount - the amount of tokens in the stake
  // stakedFor - the address the stake was staked for
  struct Stake {
    uint256 unlockedTimestamp;
    uint256 actualAmount;
    address stakedFor;
  }

  // Struct for all stake metadata at a particular address
  // totalStakedFor - the number of tokens staked for this address
  // personalStakeIndex - the index in the personalStakes array.
  // personalStakes - append only array of stakes made by this address
  // exists - whether or not there are stakes that involve this address
  struct StakeContract {
    uint256 totalStakedFor;

    uint256 personalStakeIndex;

    Stake[] personalStakes;

    bool exists;
  }

  /**
   * @dev Modifier that checks that this contract can transfer tokens from the
   *  balance in the stakingToken contract for the given address.
   * @dev This modifier also transfers the tokens.
   * @param _address address to transfer tokens from
   * @param _amount uint256 the number of tokens
   */
  modifier canStake(address _address, uint256 _amount) {
    require(
      stakingToken.transferFrom(_address, this, _amount),
      "Stake required");

    _;
  }

  /**
   * @dev Constructor function
   * @param _stakingToken ERC20 The address of the token contract used for staking
   */
  constructor(ERC20 _stakingToken) public {
    stakingToken = _stakingToken;
  }

  /**
   * @dev Returns the timestamps for when active personal stakes for an address will unlock
   * @dev These accessors functions are needed until https://github.com/ethereum/web3.js/issues/1241 is solved
   * @param _address address that created the stakes
   * @return uint256[] array of timestamps
   */
  function getPersonalStakeUnlockedTimestamps(address _address) external view returns (uint256[]) {
    uint256[] memory timestamps;
    (timestamps,,) = getPersonalStakes(_address);

    return timestamps;
  }

  /**
   * @dev Returns the stake actualAmount for active personal stakes for an address
   * @dev These accessors functions are needed until https://github.com/ethereum/web3.js/issues/1241 is solved
   * @param _address address that created the stakes
   * @return uint256[] array of actualAmounts
   */
  function getPersonalStakeActualAmounts(address _address) external view returns (uint256[]) {
    uint256[] memory actualAmounts;
    (,actualAmounts,) = getPersonalStakes(_address);

    return actualAmounts;
  }

  /**
   * @dev Returns the addresses that each personal stake was created for by an address
   * @dev These accessors functions are needed until https://github.com/ethereum/web3.js/issues/1241 is solved
   * @param _address address that created the stakes
   * @return address[] array of amounts
   */
  function getPersonalStakeForAddresses(address _address) external view returns (address[]) {
    address[] memory stakedFor;
    (,,stakedFor) = getPersonalStakes(_address);

    return stakedFor;
  }

  /**
   * @notice Stakes a certain amount of tokens, this MUST transfer the given amount from the user
   * @notice MUST trigger Staked event
   * @param _amount uint256 the amount of tokens to stake
   * @param _data bytes optional data to include in the Stake event
   */
  function stake(uint256 _amount, bytes _data) public {
    createStake(
      msg.sender,
      _amount,
      defaultLockInDuration,
      _data);
  }

  /**
   * @notice Stakes a certain amount of tokens, this MUST transfer the given amount from the caller
   * @notice MUST trigger Staked event
   * @param _user address the address the tokens are staked for
   * @param _amount uint256 the amount of tokens to stake
   * @param _data bytes optional data to include in the Stake event
   */
  function stakeFor(address _user, uint256 _amount, bytes _data) public {
    createStake(
      _user,
      _amount,
      defaultLockInDuration,
      _data);
  }

  /**
   * @notice Unstakes a certain amount of tokens, this SHOULD return the given amount of tokens to the user, if unstaking is currently not possible the function MUST revert
   * @notice MUST trigger Unstaked event
   * @dev Unstaking tokens is an atomic operation—either all of the tokens in a stake, or none of the tokens.
   * @dev Users can only unstake a single stake at a time, it is must be their oldest active stake. Upon releasing that stake, the tokens will be
   *  transferred back to their account, and their personalStakeIndex will increment to the next active stake.
   * @param _amount uint256 the amount of tokens to unstake
   * @param _data bytes optional data to include in the Unstake event
   */
  function unstake(uint256 _amount, bytes _data) public {
    withdrawStake(
      _amount,
      _data);
  }

  /**
   * @notice Returns the current total of tokens staked for an address
   * @param _address address The address to query
   * @return uint256 The number of tokens staked for the given address
   */
  function totalStakedFor(address _address) public view returns (uint256) {
    return stakeHolders[_address].totalStakedFor;
  }

  /**
   * @notice Returns the current total of tokens staked
   * @return uint256 The number of tokens staked in the contract
   */
  function totalStaked() public view returns (uint256) {
    return stakingToken.balanceOf(this);
  }

  /**
   * @notice Address of the token being used by the staking interface
   * @return address The address of the ERC20 token used for staking
   */
  function token() public view returns (address) {
    return stakingToken;
  }

  /**
   * @notice MUST return true if the optional history functions are implemented, otherwise false
   * @dev Since we don't implement the optional interface, this always returns false
   * @return bool Whether or not the optional history functions are implemented
   */
  function supportsHistory() public pure returns (bool) {
    return false;
  }

  /**
   * @dev Helper function to get specific properties of all of the personal stakes created by an address
   * @param _address address The address to query
   * @return (uint256[], uint256[], address[])
   *  timestamps array, actualAmounts array, stakedFor array
   */
  function getPersonalStakes(
    address _address
  )
    view
    public
    returns(uint256[], uint256[], address[])
  {
    StakeContract storage stakeContract = stakeHolders[_address];

    uint256 arraySize = stakeContract.personalStakes.length - stakeContract.personalStakeIndex;
    uint256[] memory unlockedTimestamps = new uint256[](arraySize);
    uint256[] memory actualAmounts = new uint256[](arraySize);
    address[] memory stakedFor = new address[](arraySize);

    for (uint256 i = stakeContract.personalStakeIndex; i < stakeContract.personalStakes.length; i++) {
      uint256 index = i - stakeContract.personalStakeIndex;
      unlockedTimestamps[index] = stakeContract.personalStakes[i].unlockedTimestamp;
      actualAmounts[index] = stakeContract.personalStakes[i].actualAmount;
      stakedFor[index] = stakeContract.personalStakes[i].stakedFor;
    }

    return (
      unlockedTimestamps,
      actualAmounts,
      stakedFor
    );
  }

  /**
   * @dev Helper function to create stakes for a given address
   * @param _address address The address the stake is being created for
   * @param _amount uint256 The number of tokens being staked
   * @param _lockInDuration uint256 The duration to lock the tokens for
   * @param _data bytes optional data to include in the Stake event
   */
  function createStake(
    address _address,
    uint256 _amount,
    uint256 _lockInDuration,
    bytes _data
  )
    internal
    canStake(msg.sender, _amount)
  {
    if (!stakeHolders[msg.sender].exists) {
      stakeHolders[msg.sender].exists = true;
    }

    stakeHolders[_address].totalStakedFor = stakeHolders[_address].totalStakedFor.add(_amount);
    stakeHolders[msg.sender].personalStakes.push(
      Stake(
        block.timestamp.add(_lockInDuration),
        _amount,
        _address)
      );

    emit Staked(
      _address,
      _amount,
      totalStakedFor(_address),
      _data);
  }

  /**
   * @dev Helper function to withdraw stakes for the msg.sender
   * @param _amount uint256 The amount to withdraw. MUST match the stake amount for the
   *  stake at personalStakeIndex.
   * @param _data bytes optional data to include in the Unstake event
   */
  function withdrawStake(
    uint256 _amount,
    bytes _data
  )
    internal
  {
    Stake storage personalStake = stakeHolders[msg.sender].personalStakes[stakeHolders[msg.sender].personalStakeIndex];

    // Check that the current stake has unlocked & matches the unstake amount
    require(
      personalStake.unlockedTimestamp <= block.timestamp,
      "The current stake hasn't unlocked yet");

    require(
      personalStake.actualAmount == _amount,
      "The unstake amount does not match the current stake");

    // Transfer the staked tokens from this contract back to the sender
    // Notice that we are using transfer instead of transferFrom here, so
    //  no approval is needed beforehand.
    require(
      stakingToken.transfer(msg.sender, _amount),
      "Unable to withdraw stake");

    stakeHolders[personalStake.stakedFor].totalStakedFor = stakeHolders[personalStake.stakedFor]
      .totalStakedFor.sub(personalStake.actualAmount);

    personalStake.actualAmount = 0;
    stakeHolders[msg.sender].personalStakeIndex++;

    emit Unstaked(
      personalStake.stakedFor,
      _amount,
      totalStakedFor(personalStake.stakedFor),
      _data);
  }
}

// File: contracts/ERC900/ERC900CreditsStakeContract.sol

/**
 * @title ERC900 Credits-based staking implementation
 * @dev See https://github.com/ethereum/EIPs/blob/master/EIPS/eip-900.md
 *
 * Notice that credits aren't lost when tokens are unstaked--only when credits are spent.
 * This means that after the initial lock in duration expires, a user can re-stake those tokens
 *  for more credits.
 * Another important note: spendCredits can only be called by the contract's owner. This
 *  is meant to be another smart contract. For example, the smart contract can offer call
 *  spendCredits to reduce a user's credit balance in place of spending real tokens.
 */
contract ERC900CreditsStakeContract is ERC900BasicStakeContract, Ownable {

  // NOTE: Credits do not have decimal places
  // Users cannot own fractional credits
  mapping (address => uint256) public creditBalances;

  /**
   * @dev Returns the balance of credits at a user's address.
   * @param _user address The address to check.
   * @return uint256 The credit balance.
   */
  function creditBalanceOf(
    address _user
  )
    public
    view
    returns (uint256)
  {
    return creditBalances[_user];
  }

  /**
   * @dev Spends credits for a user. Only callable by the owner. Reverts if the
   *  user doesn't have enough credits.
   * @param _user address The address that owns the credits being spent.
   * @param _amount uint256 The number of credits to spend.
   */
  function spendCredits(
    address _user,
    uint256 _amount
  )
    public
    onlyOwner
  {
    require(
      creditBalances[_user] >= _amount,
      "Insufficient balance");

    creditBalances[_user] = creditBalances[_user].sub(_amount);
  }

  /**
   * @dev Stakes tokens for the caller and rewards them with credits. Reverts
   *  if less than 1 token is being staked.
   * @param _amount uint256 The number of tokens to stake
   * @param _data bytes optional data to include in the Stake event
   */
  function stake(
    uint256 _amount,
    bytes _data
  )
    public
  {
    super.stake(
      _amount,
      _data);

    updateCreditBalance(
      msg.sender,
      _amount,
      defaultLockInDuration);
  }

  /**
   * Stakes tokens from the caller for a particular user, and rewards that user with credits.
   * Reverts if less than 1 token is being staked.
   * @param _user address The address the tokens are staked for
   * @param _amount uint256 The number of tokens to stake
   * @param _data bytes optional data to include in the Stake event
   */
  function stakeFor(
    address _user,
    uint256 _amount,
    bytes _data
  )
    public
  {
    super.stakeFor(
      _user,
      _amount,
      _data);

    updateCreditBalance(
      _user,
      _amount,
      defaultLockInDuration);
  }

  /**
   * @dev Stakes tokens from the caller for a given user & duration, and rewards that user with credits.
   * Reverts if less than 1 token is being staked, or if the duration specified is less than the default.
   * @param _user address The address the tokens are staked for
   * @param _amount uint256 The number of tokens to stake
   * @param _lockInDuration uint256 The duration (in seconds) that the stake should be locked for
   * @param _data bytes optional data to be included in the Stake event
   */
  function stakeForDuration(
    address _user,
    uint256 _amount,
    uint256 _lockInDuration,
    bytes _data
  )
    public
  {
    require(
      _lockInDuration >= defaultLockInDuration,
      "Insufficient stake duration");

    super.createStake(
      _user,
      _amount,
      _lockInDuration,
      _data);

    updateCreditBalance(
      _user,
      _amount,
      _lockInDuration);
  }

  /**
   * @dev Internal function to update the credit balance of a user when staking tokens.
   *  Users are rewarded with more tokens the longer they stake for.
   * @param _user address The address to award credits to
   * @param _amount uint256 The number of tokens being staked
   * @param _lockInDuration uint256 The duration (in seconds) that the stake should be locked for
   */
  function updateCreditBalance(
    address _user,
    uint256 _amount,
    uint256 _lockInDuration
  )
    internal
  {
    uint256 divisor = 1 ether;

    require(
      _amount >= divisor,
      "Insufficient amount");

    // NOTE: Truncation is intentional here
    // If a user stakes for less than the minimum duration, they are awarded with 0 credits
    // If they stake 2x the minimum duration, they are awarded with 2x credits
    // etc.
    uint256 rewardMultiplier = _lockInDuration / defaultLockInDuration;

    uint256 creditsAwarded = _amount.mul(rewardMultiplier).div(divisor);
    creditBalances[_user] = creditBalances[_user].add(creditsAwarded);
  }
}

// File: contracts/CodexStakeContract.sol

/**
 * @title CodexStakeContract
 */
contract CodexStakeContract is CodexStakeContractInterface, ERC900CreditsStakeContract {

  /**
   * @dev Constructor function
   * @param _stakingToken ERC20 The address of the token used for staking
   * @param _defaultLockInDuration uint256 The duration (in seconds) that stakes are required to be locked for
   */
  constructor(
    ERC20 _stakingToken,
    uint256 _defaultLockInDuration
  )
    public
    ERC900BasicStakeContract(_stakingToken)
  {
    defaultLockInDuration = _defaultLockInDuration;
  }

  /**
   * @dev Sets the lockInDuration for stakes. Only callable by the owner
   * @param _defaultLockInDuration uint256 The duration (in seconds) that stakes are required to be locked for
   */
  function setDefaultLockInDuration(
    uint256 _defaultLockInDuration
  )
    external
    onlyOwner
  {
    defaultLockInDuration = _defaultLockInDuration;
  }
}

    Contract ABI  
[{"constant":false,"inputs":[{"name":"_amount","type":"uint256"},{"name":"_data","type":"bytes"}],"name":"stake","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"_user","type":"address"},{"name":"_amount","type":"uint256"},{"name":"_data","type":"bytes"}],"name":"stakeFor","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"_address","type":"address"}],"name":"getPersonalStakeUnlockedTimestamps","outputs":[{"name":"","type":"uint256[]"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"_address","type":"address"}],"name":"getPersonalStakes","outputs":[{"name":"","type":"uint256[]"},{"name":"","type":"uint256[]"},{"name":"","type":"address[]"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_user","type":"address"},{"name":"_amount","type":"uint256"}],"name":"spendCredits","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"_user","type":"address"}],"name":"creditBalanceOf","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"_address","type":"address"}],"name":"totalStakedFor","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"","type":"address"}],"name":"creditBalances","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"_address","type":"address"}],"name":"getPersonalStakeActualAmounts","outputs":[{"name":"","type":"uint256[]"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_user","type":"address"},{"name":"_amount","type":"uint256"},{"name":"_lockInDuration","type":"uint256"},{"name":"_data","type":"bytes"}],"name":"stakeForDuration","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"supportsHistory","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"pure","type":"function"},{"constant":false,"inputs":[],"name":"renounceOwnership","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"_address","type":"address"}],"name":"getPersonalStakeForAddresses","outputs":[{"name":"","type":"address[]"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"totalStaked","outputs":[{"name":"","type":"uint256"}],"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":"_amount","type":"uint256"},{"name":"_data","type":"bytes"}],"name":"unstake","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"","type":"address"}],"name":"stakeHolders","outputs":[{"name":"totalStakedFor","type":"uint256"},{"name":"personalStakeIndex","type":"uint256"},{"name":"exists","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"defaultLockInDuration","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_defaultLockInDuration","type":"uint256"}],"name":"setDefaultLockInDuration","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"_newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"token","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"inputs":[{"name":"_stakingToken","type":"address"},{"name":"_defaultLockInDuration","type":"uint256"}],"payable":false,"stateMutability":"nonpayable","type":"constructor"},{"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"},{"anonymous":false,"inputs":[{"indexed":true,"name":"user","type":"address"},{"indexed":false,"name":"amount","type":"uint256"},{"indexed":false,"name":"total","type":"uint256"},{"indexed":false,"name":"data","type":"bytes"}],"name":"Staked","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"user","type":"address"},{"indexed":false,"name":"amount","type":"uint256"},{"indexed":false,"name":"total","type":"uint256"},{"indexed":false,"name":"data","type":"bytes"}],"name":"Unstaked","type":"event"}]

  Contract Creation Code Switch To Opcodes View
608060405234801561001057600080fd5b5060405160408061141383398101604052805160209091015160008054600160a060020a03909316600160a060020a03199384161790556003805490921633179091556001556113ae806100656000396000f30060806040526004361061011c5763ffffffff7c01000000000000000000000000000000000000000000000000000000006000350416630e89439b81146101215780630ef9635614610181578063201d3be7146101ea57806320bf96201461025b5780632614d4a41461035a57806332a922291461037e5780634b341aed146103b15780636009a2d8146103d257806366e6360d146103f35780636b2ce4ce146104145780637033e4a614610480578063715018a6146104a95780638033f6bc146104be578063817b1cd2146104df5780638da5cb5b146104f4578063c8fd6ed014610525578063e26ff10a14610583578063e8297da2146105c4578063f0b85b19146105d9578063f2fde38b146105f1578063fc0c546a14610612575b600080fd5b34801561012d57600080fd5b5060408051602060046024803582810135601f810185900485028601850190965285855261017f9583359536956044949193909101919081908401838280828437509497506106279650505050505050565b005b34801561018d57600080fd5b50604080516020600460443581810135601f810184900484028501840190955284845261017f948235600160a060020a03169460248035953695946064949201919081908401838280828437509497506106429650505050505050565b3480156101f657600080fd5b5061020b600160a060020a036004351661065f565b60408051602080825283518183015283519192839290830191858101910280838360005b8381101561024757818101518382015260200161022f565b505050509050019250505060405180910390f35b34801561026757600080fd5b5061027c600160a060020a0360043516610675565b60405180806020018060200180602001848103845287818151815260200191508051906020019060200280838360005b838110156102c45781810151838201526020016102ac565b50505050905001848103835286818151815260200191508051906020019060200280838360005b838110156103035781810151838201526020016102eb565b50505050905001848103825285818151815260200191508051906020019060200280838360005b8381101561034257818101518382015260200161032a565b50505050905001965050505050505060405180910390f35b34801561036657600080fd5b5061017f600160a060020a0360043516602435610832565b34801561038a57600080fd5b5061039f600160a060020a0360043516610902565b60408051918252519081900360200190f35b3480156103bd57600080fd5b5061039f600160a060020a036004351661091d565b3480156103de57600080fd5b5061039f600160a060020a0360043516610938565b3480156103ff57600080fd5b5061020b600160a060020a036004351661094a565b34801561042057600080fd5b50604080516020601f60643560048181013592830184900484028501840190955281845261017f94600160a060020a03813516946024803595604435953695608494930191819084018382808284375094975061095f9650505050505050565b34801561048c57600080fd5b506104956109d6565b604080519115158252519081900360200190f35b3480156104b557600080fd5b5061017f6109db565b3480156104ca57600080fd5b5061020b600160a060020a0360043516610a49565b3480156104eb57600080fd5b5061039f610a5e565b34801561050057600080fd5b50610509610af5565b60408051600160a060020a039092168252519081900360200190f35b34801561053157600080fd5b5060408051602060046024803582810135601f810185900485028601850190965285855261017f958335953695604494919390910191908190840183828082843750949750610b049650505050505050565b34801561058f57600080fd5b506105a4600160a060020a0360043516610b0e565b604080519384526020840192909252151582820152519081900360600190f35b3480156105d057600080fd5b5061039f610b32565b3480156105e557600080fd5b5061017f600435610b38565b3480156105fd57600080fd5b5061017f600160a060020a0360043516610b54565b34801561061e57600080fd5b50610509610b77565b6106318282610b86565b61063e3383600154610b94565b5050565b61064d838383610c78565b61065a8383600154610b94565b505050565b60608061066b83610675565b5090949350505050565b600160a060020a038116600090815260026020818152604080842060018101549381015482519490038085528084028501909301909152606093849384939184918291829181908680156106d3578160200160208202803883390190505b50945085604051908082528060200260200182016040528015610700578160200160208202803883390190505b5093508560405190808252806020026020018201604052801561072d578160200160208202803883390190505b509250866001015491505b600287015482101561082257866001015482039050866002018281548110151561075e57fe5b906000526020600020906003020160000154858281518110151561077e57fe5b602090810290910101526002870180548390811061079857fe5b90600052602060002090600302016001015484828151811015156107b857fe5b60209081029091010152600287018054839081106107d257fe5b60009182526020909120600260039092020101548351600160a060020a039091169084908390811061080057fe5b600160a060020a03909216602092830290910190910152600190910190610738565b5092999198509650945050505050565b600354600160a060020a0316331461084957600080fd5b600160a060020a0382166000908152600460205260409020548111156108b9576040805160e560020a62461bcd02815260206004820152601460248201527f496e73756666696369656e742062616c616e6365000000000000000000000000604482015290519081900360640190fd5b600160a060020a0382166000908152600460205260409020546108e2908263ffffffff610c8616565b600160a060020a0390921660009081526004602052604090209190915550565b600160a060020a031660009081526004602052604090205490565b600160a060020a031660009081526002602052604090205490565b60046020526000908152604090205481565b60608061095683610675565b50949350505050565b6001548210156109b9576040805160e560020a62461bcd02815260206004820152601b60248201527f496e73756666696369656e74207374616b65206475726174696f6e0000000000604482015290519081900360640190fd5b6109c584848484610c9d565b6109d0848484610b94565b50505050565b600090565b600354600160a060020a031633146109f257600080fd5b600354604051600160a060020a03909116907ff8df31144d9c2f0f6b59d69b8b98abd5459d07f2742c4df920b25aae33c6482090600090a26003805473ffffffffffffffffffffffffffffffffffffffff19169055565b606080610a5583610675565b95945050505050565b60008054604080517f70a082310000000000000000000000000000000000000000000000000000000081523060048201529051600160a060020a03909216916370a082319160248082019260209290919082900301818787803b158015610ac457600080fd5b505af1158015610ad8573d6000803e3d6000fd5b505050506040513d6020811015610aee57600080fd5b5051905090565b600354600160a060020a031681565b61063e8282610f64565b60026020526000908152604090208054600182015460039092015490919060ff1683565b60015481565b600354600160a060020a03163314610b4f57600080fd5b600155565b600354600160a060020a03163314610b6b57600080fd5b610b74816112b9565b50565b600054600160a060020a031690565b61063e338360015484610c9d565b670de0b6b3a764000060008082851015610bf8576040805160e560020a62461bcd02815260206004820152601360248201527f496e73756666696369656e7420616d6f756e7400000000000000000000000000604482015290519081900360640190fd5b60015484811515610c0557fe5b049150610c2883610c1c878563ffffffff61133716565b9063ffffffff61136016565b600160a060020a038716600090815260046020526040902054909150610c54908263ffffffff61137516565b600160a060020a039096166000908152600460205260409020959095555050505050565b61065a838360015484610c9d565b600082821115610c9257fe5b508082035b92915050565b60008054604080517f23b872dd000000000000000000000000000000000000000000000000000000008152336004820181905230602483015260448201889052915191938793600160a060020a0316926323b872dd926064808201936020939283900390910190829087803b158015610d1557600080fd5b505af1158015610d29573d6000803e3d6000fd5b505050506040513d6020811015610d3f57600080fd5b50511515610d97576040805160e560020a62461bcd02815260206004820152600e60248201527f5374616b65207265717569726564000000000000000000000000000000000000604482015290519081900360640190fd5b3360009081526002602052604090206003015460ff161515610dd157336000908152600260205260409020600301805460ff191660011790555b600160a060020a038616600090815260026020526040902054610dfa908663ffffffff61137516565b600160a060020a03871660009081526002602081905260408083209390935533825290829020825160608101909352019080610e3c428863ffffffff61137516565b81526020808201899052600160a060020a038a811660409384018190528554600180820188556000978852968490208651600390920201908155928501519583019590955592909101516002909101805473ffffffffffffffffffffffffffffffffffffffff1916919092161790557fc65e53b88159e7d2c0fc12a0600072e28ae53ff73b4c1715369c30f16093514286610ed68961091d565b866040518084815260200183815260200180602001828103825283818151815260200191508051906020019080838360005b83811015610f20578181015183820152602001610f08565b50505050905090810190601f168015610f4d5780820380516001836020036101000a031916815260200191505b5094505050505060405180910390a2505050505050565b33600090815260026020819052604082206001810154910180549091908110610f8957fe5b906000526020600020906003020190504281600001541115151561101d576040805160e560020a62461bcd02815260206004820152602560248201527f5468652063757272656e74207374616b65206861736e277420756e6c6f636b6560448201527f6420796574000000000000000000000000000000000000000000000000000000606482015290519081900360840190fd5b6001810154831461109e576040805160e560020a62461bcd02815260206004820152603360248201527f54686520756e7374616b6520616d6f756e7420646f6573206e6f74206d61746360448201527f68207468652063757272656e74207374616b6500000000000000000000000000606482015290519081900360840190fd5b60008054604080517fa9059cbb000000000000000000000000000000000000000000000000000000008152336004820152602481018790529051600160a060020a039092169263a9059cbb926044808401936020939083900390910190829087803b15801561110c57600080fd5b505af1158015611120573d6000803e3d6000fd5b505050506040513d602081101561113657600080fd5b5051151561118e576040805160e560020a62461bcd02815260206004820152601860248201527f556e61626c6520746f207769746864726177207374616b650000000000000000604482015290519081900360640190fd5b6001810154600280830154600160a060020a0316600090815260209190915260409020546111c19163ffffffff610c8616565b60028281018054600160a060020a039081166000908152602093909352604080842094909455600180860184905533845293909220830180549093019092559054167faf01bfc8475df280aca00b578c4a948e6d95700f0db8c13365240f7f973c87548461122e8361091d565b856040518084815260200183815260200180602001828103825283818151815260200191508051906020019080838360005b83811015611278578181015183820152602001611260565b50505050905090810190601f1680156112a55780820380516001836020036101000a031916815260200191505b5094505050505060405180910390a2505050565b600160a060020a03811615156112ce57600080fd5b600354604051600160a060020a038084169216907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a36003805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b600082151561134857506000610c97565b5081810281838281151561135857fe5b0414610c9757fe5b6000818381151561136d57fe5b049392505050565b81810182811015610c9757fe00a165627a7a7230582007b624dcf2770dcd96c28559cc4ab2a2706d0ff2a3aae693dcfa79d6eef24c6e0029000000000000000000000000f226e38c3007b3d974fc79bcf5a77750035436ee000000000000000000000000000000000000000000000000000000000076a700

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

-----Encoded View---------------
2 Constructor Arguments found :
Arg [0] : 000000000000000000000000f226e38c3007b3d974fc79bcf5a77750035436ee
Arg [1] : 000000000000000000000000000000000000000000000000000000000076a700


   Swarm Source:
bzzr://07b624dcf2770dcd96c28559cc4ab2a2706d0ff2a3aae693dcfa79d6eef24c6e

 

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.