ETH Price: $2,362.54 (+0.41%)

Token

SCALE (SCALE)
 

Overview

Max Total Supply

10,227,155.4712117598636512 SCALE

Holders

241

Market

Onchain Market Cap

$0.00

Circulating Supply Market Cap

-

Other Info

Token Contract (WITH 18 Decimals)

Balance
13,780.24505 SCALE

Value
$0.00
0xd0ccd7f8bb4d22783ee9402f0491776cfeebca9c
Loading...
Loading
Loading...
Loading
Loading...
Loading

Click here to update the token information / general information
# Exchange Pair Price  24H Volume % Volume

Contract Source Code Verified (Exact Match)

Contract Name:
Scale

Compiler Version
v0.4.24+commit.e67f0147

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion

Contract Source Code (Solidity)

/**
 *Submitted for verification at Etherscan.io on 2018-10-12
*/

pragma solidity ^0.4.24;

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

/**
 * @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 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 transfer control of the contract to a newOwner.
   * @param newOwner The address to transfer ownership to.
   */
  function transferOwnership(address newOwner) public onlyOwner {
    require(newOwner != address(0));
    emit OwnershipTransferred(owner, newOwner);
    owner = newOwner;
  }

}

/**************************************************************
 * @title Scale Token Contract
 * @file Scale.sol
 * @author Jared Downing and Kane Thomas of the Scale Network
 * @version 1.0
 *
 * @section DESCRIPTION
 *
 * This is an ERC20-based token with staking and inflationary functionality.
 *
 *************************************************************/

//////////////////////////////////
/// OpenZeppelin library imports
//////////////////////////////////

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

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

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

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

/**
 * @title Basic token
 * @dev Basic version of StandardToken, with no allowances.
 */
contract BasicToken is ERC20Basic {
  using SafeMath for uint256;

  mapping(address => uint256) balances;

  /**
  * @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(_to != address(0));
    require(_value <= balances[msg.sender]);

    // SafeMath.sub will throw if there is not enough balance.
    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 balance) {
    return balances[_owner];
  }

}

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

/**
 * @title Standard ERC20 token
 *
 * @dev Implementation of the basic standard token.
 * @dev https://github.com/ethereum/EIPs/issues/20
 * @dev Based on code by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol
 */
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(_to != address(0));
    require(_value <= balances[_from]);
    require(_value <= allowed[_from][msg.sender]);

    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, uint _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, uint _subtractedValue) public returns (bool) {
    uint 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;
  }

}

/**
 * @title Mintable token
 * @dev Simple ERC20 Token example, with mintable token creation
 * @dev Issue: * https://github.com/OpenZeppelin/zeppelin-solidity/issues/120
 * Based on code by TokenMarketNet: https://github.com/TokenMarketNet/ico/blob/master/contracts/MintableToken.sol
 * Modified to allow minting for non-owner addresses
 */

contract MintableToken is StandardToken, Ownable {
  event Mint(address indexed to, uint256 amount);

  /**
   * @dev Function to mint tokens
   * @param _to The address that will receive the minted tokens.
   * @param _amount The amount of tokens to mint.
   * @return A boolean that indicates if the operation was successful.
   */
  function mint(address _to, uint256 _amount) internal returns (bool) {
    totalSupply = totalSupply.add(_amount);
    balances[_to] = balances[_to].add(_amount);
    emit Mint(_to, _amount);
    emit Transfer(address(0), _to, _amount);
    return true;
  }

}

/**
 * @title Contracts that should not own Ether
 * @author Remco Bloemen <remco@2π.com>
 * @dev This tries to block incoming ether to prevent accidental loss of Ether. Should Ether end up
 * in the contract, it will allow the owner to reclaim this ether.
 * @notice Ether can still be send to this contract by:
 * calling functions labeled `payable`
 * `selfdestruct(contract_address)`
 * mining directly to the contract address
*/
contract HasNoEther is Ownable {

  /**
  * @dev Constructor that rejects incoming Ether
  * @dev The `payable` flag is added so we can access `msg.value` without compiler warning. If we
  * leave out payable, then Solidity will allow inheriting contracts to implement a payable
  * constructor. By doing it this way we prevent a payable constructor from working. Alternatively
  * we could use assembly to access msg.value.
  */
  constructor() public payable {
    require(msg.value == 0);
  }

  /**
   * @dev Disallows direct send by settings a default function without the `payable` flag.
   */
  function() external {
  }

  /**
   * @dev Transfer all Ether held by the contract to the owner.
   */
  function reclaimEther() external onlyOwner {
    assert(owner.send(address(this).balance));
  }
}


/**
 * @title Burnable Token
 * @dev Token that can be irreversibly burned (destroyed).
 */
contract BurnableToken is BasicToken {

  event Burn(address indexed burner, uint256 value);

  /**
   * @dev Burns a specific amount of tokens.
   * @param _value The amount of token to be burned.
   */
  function burn(uint256 _value) public {
    _burn(msg.sender, _value);
  }

  function _burn(address _who, uint256 _value) internal {
    require(_value <= balances[_who]);
    // no need to require value <= totalSupply, since that would imply the
    // sender's balance is greater than the totalSupply, which *should* be an assertion failure

    balances[_who] = balances[_who].sub(_value);
    totalSupply = totalSupply.sub(_value);
    emit Burn(_who, _value);
    emit Transfer(_who, address(0), _value);
  }
}

//////////////////////////////////
/// Scale Token
//////////////////////////////////

contract Scale is MintableToken, HasNoEther, BurnableToken {

    // Libraries
    using SafeMath for uint;

    //////////////////////
    // Token Information
    //////////////////////
    string public constant name = "SCALE";
    string public constant symbol = "SCALE";
    uint8 public constant  decimals = 18;

    ///////////////////////////////////////////////////////////
    // Variables For Staking and Pooling
    ///////////////////////////////////////////////////////////

    // -- Pool Minting Rates and Percentages -- //
    // Pool for Scale distribution to rewards pool
    // Set to 0 to prohibit issuing to the pool before it is assigned
    address public pool = address(0);

    // Pool and Owner minted tokens per second
    uint public poolMintRate;
    uint public ownerMintRate;

    // Amount of Scale to be staked to the pool, staking, and owner, as calculated through their percentages
    uint public poolMintAmount;
    uint public stakingMintAmount;
    uint public ownerMintAmount;

    // Scale distribution percentages
    uint public poolPercentage = 70;
    uint public ownerPercentage = 5;
    uint public stakingPercentage = 25;

    // Last time minted for owner and pool
    uint public ownerTimeLastMinted;
    uint public poolTimeLastMinted;

    // -- Staking -- //
    // Minted tokens per second
    uint public stakingMintRate;

    // Total Scale currently staked
    uint public totalScaleStaked;

    // Mapping of the timestamp => totalStaking that is created each time an address stakes or unstakes
    mapping (uint => uint) totalStakingHistory;

    // Variable for staking accuracy. Set to 86400 for seconds in a day so that staking gains are based on the day an account begins staking.
    uint timingVariable = 86400;

    // Address staking information
    struct AddressStakeData {
        uint stakeBalance;
        uint initialStakeTime;
        uint unstakeTime;
        mapping (uint => uint) stakePerDay;
    }

    // Track all tokens staked
    mapping (address => AddressStakeData) public stakeBalances;

    // -- Inflation -- //
    // Inflation rate begins at 100% per year and decreases by 30% per year until it reaches 10% where it decreases by 0.5% per year
    uint256 inflationRate = 1000;

    // Used to manage when to inflate. Allowed to inflate once per year until the rate reaches 1%.
    uint256 public lastInflationUpdate;

    // -- Events -- //
    // Fired when tokens are staked
    event Stake(address indexed staker, uint256 value);
    // Fired when tokens are unstaked
    event Unstake(address indexed unstaker, uint256 stakedAmount);
    // Fired when a user claims their stake
    event ClaimStake(address indexed claimer, uint256 stakedAmount, uint256 stakingGains);

    //////////////////////////////////////////////////
    /// Scale Token Functionality
    //////////////////////////////////////////////////

    /// @dev Scale token constructor
    constructor() public {
        // Assign owner
        owner = msg.sender;

        // Assign initial owner supply
        uint _initOwnerSupply = 10000000 ether;
        // Mint given to owner only one-time
        bool _success = mint(msg.sender, _initOwnerSupply);
        // Require minting success
        require(_success);

        // Set pool and owner last minted to ensure extra coins are not minted by either
        ownerTimeLastMinted = now;
        poolTimeLastMinted = now;

        // Set minting amount for pool, staking, and owner over the course of 1 year
        poolMintAmount = _initOwnerSupply.mul(poolPercentage).div(100);
        ownerMintAmount = _initOwnerSupply.mul(ownerPercentage).div(100);
        stakingMintAmount = _initOwnerSupply.mul(stakingPercentage).div(100);

        // One year in seconds
        uint _oneYearInSeconds = 31536000 ether;

        // Set the rate of coins minted per second for the pool, owner, and global staking
        poolMintRate = calculateFraction(poolMintAmount, _oneYearInSeconds, decimals);
        ownerMintRate = calculateFraction(ownerMintAmount, _oneYearInSeconds, decimals);
        stakingMintRate = calculateFraction(stakingMintAmount, _oneYearInSeconds, decimals);

        // Set the last time inflation was updated to now so that the next time it can be updated is 1 year from now
        lastInflationUpdate = now;
    }

    /////////////
    // Inflation
    /////////////

    /// @dev the inflation rate begins at 100% and decreases by 30% every year until it reaches 10%
    /// at 10% the rate begins to decrease by 0.5% until it reaches 1%
    function adjustInflationRate() private {
      // Make sure adjustInflationRate cannot be called for at least another year
      lastInflationUpdate = now;

      // Decrease inflation rate by 30% each year
      if (inflationRate > 100) {
        inflationRate = inflationRate.sub(300);
      }
      // Inflation rate reaches 10%. Decrease inflation rate by 0.5% from here on out until it reaches 1%.
      else if (inflationRate > 10) {
        inflationRate = inflationRate.sub(5);
      }

      adjustMintRates();
    }

    /// @dev adjusts the mint rate when the yearly inflation update is called
    function adjustMintRates() internal {

      // Calculate new mint amount of Scale that should be created per year.
      poolMintAmount = totalSupply.mul(inflationRate).div(1000).mul(poolPercentage).div(100);
      ownerMintAmount = totalSupply.mul(inflationRate).div(1000).mul(ownerPercentage).div(100);
      stakingMintAmount = totalSupply.mul(inflationRate).div(1000).mul(stakingPercentage).div(100);

      // Adjust Scale created per-second for each rate
      poolMintRate = calculateFraction(poolMintAmount, 31536000 ether, decimals);
      ownerMintRate = calculateFraction(ownerMintAmount, 31536000 ether, decimals);
      stakingMintRate = calculateFraction(stakingMintAmount, 31536000 ether, decimals);
    }

    /// @dev anyone can call this function to update the inflation rate yearly
    function updateInflationRate() public {

      // Require 1 year to have passed for every inflation adjustment
      require(now.sub(lastInflationUpdate) >= 31536000);

      adjustInflationRate();
    }

    /////////////
    // Staking
    /////////////

    /// @dev staking function which allows users to stake an amount of tokens to gain interest for up to 1 year
    function stake(uint _stakeAmount) external {
        // Require that tokens are staked successfully
        require(stakeScale(msg.sender, _stakeAmount));
    }

   /// @dev staking function which allows users to stake an amount of tokens for another user
   function stakeFor(address _user, uint _amount) external {
        // Stake for the user
        require(stakeScale(_user, _amount));
   }

   /// @dev Transfer tokens from the contract to the user when unstaking
   /// @param _value uint256 the amount of tokens to be transferred
   function transferFromContract(uint _value) internal {

     // Sanity check to make sure we are not transferring more than the contract has
     require(_value <= balances[address(this)]);

     // Add to the msg.sender balance
     balances[msg.sender] = balances[msg.sender].add(_value);
     
     // Subtract from the contract's balance
     balances[address(this)] = balances[address(this)].sub(_value);

     // Fire an event for transfer
     emit Transfer(address(this), msg.sender, _value);
   }

   /// @dev stake function reduces the user's total available balance and adds it to their staking balance
   /// @param _value how many tokens a user wants to stake
   function stakeScale(address _user, uint256 _value) private returns (bool success) {

       // You can only stake / stakeFor as many tokens as you have
       require(_value <= balances[msg.sender]);

       // Require the user is not in power down period
       require(stakeBalances[_user].unstakeTime == 0);

       // Transfer tokens to contract address
       transfer(address(this), _value);

       // Now as a day
       uint _nowAsDay = now.div(timingVariable);

       // Adjust the new staking balance
       uint _newStakeBalance = stakeBalances[_user].stakeBalance.add(_value);

       // If this is the initial stake time, save
       if (stakeBalances[_user].stakeBalance == 0) {
         // Save the time that the stake started
         stakeBalances[_user].initialStakeTime = _nowAsDay;
       }

       // Add stake amount to staked balance
       stakeBalances[_user].stakeBalance = _newStakeBalance;

       // Assign the total amount staked at this day
       stakeBalances[_user].stakePerDay[_nowAsDay] = _newStakeBalance;

       // Increment the total staked tokens
       totalScaleStaked = totalScaleStaked.add(_value);

       // Set the new staking history
       setTotalStakingHistory();

       // Fire an event for newly staked tokens
       emit Stake(_user, _value);

       return true;
   }

    /// @dev deposit a user's initial stake plus earnings if the user unstaked at least 14 days ago
    function claimStake() external returns (bool) {

      // Require that at least 14 days have passed (days)
      require(now.div(timingVariable).sub(stakeBalances[msg.sender].unstakeTime) >= 14);

      // Get the user's stake balance 
      uint _userStakeBalance = stakeBalances[msg.sender].stakeBalance;

      // Calculate tokens to mint using unstakeTime, rewards are not received during power-down period
      uint _tokensToMint = calculateStakeGains(stakeBalances[msg.sender].unstakeTime);

      // Clear out stored data from mapping
      stakeBalances[msg.sender].stakeBalance = 0;
      stakeBalances[msg.sender].initialStakeTime = 0;
      stakeBalances[msg.sender].unstakeTime = 0;

      // Return the stake balance to the staker
      transferFromContract(_userStakeBalance);

      // Mint the new tokens to the sender
      mint(msg.sender, _tokensToMint);

      // Scale unstaked event
      emit ClaimStake(msg.sender, _userStakeBalance, _tokensToMint);

      return true;
    }

    /// @dev allows users to start the reclaim process for staked tokens and stake rewards
    /// @return bool on success
    function initUnstake() external returns (bool) {

        // Require that the user has not already started the unstaked process
        require(stakeBalances[msg.sender].unstakeTime == 0);

        // Require that there was some amount staked
        require(stakeBalances[msg.sender].stakeBalance > 0);

        // Log time that user started unstaking
        stakeBalances[msg.sender].unstakeTime = now.div(timingVariable);

        // Subtract stake balance from totalScaleStaked
        totalScaleStaked = totalScaleStaked.sub(stakeBalances[msg.sender].stakeBalance);

        // Set this every time someone adjusts the totalScaleStaked amount
        setTotalStakingHistory();

        // Scale unstaked event
        emit Unstake(msg.sender, stakeBalances[msg.sender].stakeBalance);

        return true;
    }

    /// @dev function to let the user know how much time they have until they can claim their tokens from unstaking
    /// @param _user to check the time until claimable of
    /// @return uint time in seconds until they may claim
    function timeUntilClaimAvaliable(address _user) view external returns (uint) {
      return stakeBalances[_user].unstakeTime.add(14).mul(86400);
    }

    /// @dev function to check the staking balance of a user
    /// @param _user to check the balance of
    /// @return uint of the stake balance
    function stakeBalanceOf(address _user) view external returns (uint) {
      return stakeBalances[_user].stakeBalance;
    }

    /// @dev returns how much Scale a user has earned so far
    /// @param _now is passed in to allow for a gas-free analysis
    /// @return staking gains based on the amount of time passed since staking began
    function getStakingGains(uint _now) view public returns (uint) {
        if (stakeBalances[msg.sender].stakeBalance == 0) {
          return 0;
        }
        return calculateStakeGains(_now.div(timingVariable));
    }

    /// @dev Calculates staking gains 
    /// @param _unstakeTime when the user stopped staking.
    /// @return uint for total coins to be minted
    function calculateStakeGains(uint _unstakeTime) view private returns (uint mintTotal)  {

      uint _initialStakeTimeInVariable = stakeBalances[msg.sender].initialStakeTime; // When the user started staking as a unique day in unix time
      uint _timePassedSinceStakeInVariable = _unstakeTime.sub(_initialStakeTimeInVariable); // How much time has passed, in days, since the user started staking.
      uint _stakePercentages = 0; // Keeps an additive track of the user's staking percentages over time
      uint _tokensToMint = 0; // How many new Scale tokens to create
      uint _lastDayStakeWasUpdated;  // Last day the totalScaleStaked was updated
      uint _lastStakeDay; // Last day that the user staked

      // If user staked and init unstaked on the same day, gains are 0
      if (_timePassedSinceStakeInVariable == 0) {
        return 0;
      }
      // If user has been staking longer than 365 days, staked days after 365 days do not earn interest 
      else if (_timePassedSinceStakeInVariable >= 365) {
       _unstakeTime = _initialStakeTimeInVariable.add(365);
       _timePassedSinceStakeInVariable = 365;
      }
      // Average this msg.sender's relative percentage ownership of totalScaleStaked throughout each day since they started staking
      for (uint i = _initialStakeTimeInVariable; i < _unstakeTime; i++) {

        // Total amount user has staked on i day
        uint _stakeForDay = stakeBalances[msg.sender].stakePerDay[i];

        // If this was a day that the user staked or added stake
        if (_stakeForDay != 0) {

            // If the day exists add it to the percentages
            if (totalStakingHistory[i] != 0) {

                // If the day does exist add it to the number to be later averaged as a total average percentage of total staking
                _stakePercentages = _stakePercentages.add(calculateFraction(_stakeForDay, totalStakingHistory[i], decimals));

                // Set the last day someone staked
                _lastDayStakeWasUpdated = totalStakingHistory[i];
            }
            else {
                // Use the last day found in the totalStakingHistory mapping
                _stakePercentages = _stakePercentages.add(calculateFraction(_stakeForDay, _lastDayStakeWasUpdated, decimals));
            }

            _lastStakeDay = _stakeForDay;
        }
        else {

            // If the day exists add it to the percentages
            if (totalStakingHistory[i] != 0) {

                // If the day does exist add it to the number to be later averaged as a total average percentage of total staking
                _stakePercentages = _stakePercentages.add(calculateFraction(_lastStakeDay, totalStakingHistory[i], decimals));

                // Set the last day someone staked
                _lastDayStakeWasUpdated = totalStakingHistory[i];
            }
            else {
                // Use the last day found in the totalStakingHistory mapping
                _stakePercentages = _stakePercentages.add(calculateFraction(_lastStakeDay, _lastDayStakeWasUpdated, decimals));
            }
        }
      }
        // Get the account's average percentage staked of the total stake over the course of all days they have been staking
        uint _stakePercentageAverage = calculateFraction(_stakePercentages, _timePassedSinceStakeInVariable, 0);

        // Calculate this account's mint rate per second while staking
        uint _finalMintRate = stakingMintRate.mul(_stakePercentageAverage);

        // Account for 18 decimals when calculating the amount of tokens to mint
        _finalMintRate = _finalMintRate.div(1 ether);

        // Calculate total tokens to be minted. Multiply by timingVariable to convert back to seconds.
        _tokensToMint = calculateMintTotal(_timePassedSinceStakeInVariable.mul(timingVariable), _finalMintRate);

        return  _tokensToMint;
    }

    /// @dev set the new totalStakingHistory mapping to the current timestamp and totalScaleStaked
    function setTotalStakingHistory() private {

      // Get now in terms of the variable staking accuracy (days in Scale's case)
      uint _nowAsTimingVariable = now.div(timingVariable);

      // Set the totalStakingHistory as a timestamp of the totalScaleStaked today
      totalStakingHistory[_nowAsTimingVariable] = totalScaleStaked;
    }

    /////////////
    // Scale Owner Claiming
    /////////////

    /// @dev allows contract owner to claim their allocated mint
    function ownerClaim() external onlyOwner {

        require(now > ownerTimeLastMinted);

        uint _timePassedSinceLastMint; // The amount of time passed since the owner claimed in seconds
        uint _tokenMintCount; // The amount of new tokens to mint
        bool _mintingSuccess; // The success of minting the new Scale tokens

        // Calculate the number of seconds that have passed since the owner last took a claim
        _timePassedSinceLastMint = now.sub(ownerTimeLastMinted);

        assert(_timePassedSinceLastMint > 0);

        // Determine the token mint amount, determined from the number of seconds passed and the ownerMintRate
        _tokenMintCount = calculateMintTotal(_timePassedSinceLastMint, ownerMintRate);

        // Mint the owner's tokens; this also increases totalSupply
        _mintingSuccess = mint(msg.sender, _tokenMintCount);

        require(_mintingSuccess);

        // New minting was a success. Set last time minted to current block.timestamp (now)
        ownerTimeLastMinted = now;
    }

    ////////////////////////////////
    // Scale Pool Distribution
    ////////////////////////////////

    // @dev anyone can call this function that mints Scale to the pool dedicated to Scale distribution to rewards pool
    function poolIssue() public {

        // Do not allow tokens to be minted to the pool until the pool is set
        require(pool != address(0));

        // Make sure time has passed since last minted to pool
        require(now > poolTimeLastMinted);
        require(pool != address(0));

        uint _timePassedSinceLastMint; // The amount of time passed since the pool claimed in seconds
        uint _tokenMintCount; // The amount of new tokens to mint
        bool _mintingSuccess; // The success of minting the new Scale tokens

        // Calculate the number of seconds that have passed since the owner last took a claim
        _timePassedSinceLastMint = now.sub(poolTimeLastMinted);

        assert(_timePassedSinceLastMint > 0);

        // Determine the token mint amount, determined from the number of seconds passed and the ownerMintRate
        _tokenMintCount = calculateMintTotal(_timePassedSinceLastMint, poolMintRate);

        // Mint the owner's tokens; this also increases totalSupply
        _mintingSuccess = mint(pool, _tokenMintCount);

        require(_mintingSuccess);

        // New minting was a success! Set last time minted to current block.timestamp (now)
        poolTimeLastMinted = now;
    }

    /// @dev sets the address for the rewards pool
    /// @param _newAddress pool Address
    function setPool(address _newAddress) public onlyOwner {
        pool = _newAddress;
    }

    ////////////////////////////////
    // Helper Functions
    ////////////////////////////////

    /// @dev calculateFraction allows us to better handle the Solidity ugliness of not having decimals as a native type
    /// @param _numerator is the top part of the fraction we are calculating
    /// @param _denominator is the bottom part of the fraction we are calculating
    /// @param _precision tells the function how many significant digits to calculate out to
    /// @return quotient returns the result of our fraction calculation
    function calculateFraction(uint _numerator, uint _denominator, uint _precision) pure private returns(uint quotient) {
        // Take passed value and expand it to the required precision
        _numerator = _numerator.mul(10 ** (_precision + 1));
        // Handle last-digit rounding
        uint _quotient = ((_numerator.div(_denominator)) + 5) / 10;
        return (_quotient);
    }

    /// @dev Determines the amount of Scale to create based on the number of seconds that have passed
    /// @param _timeInSeconds is the time passed in seconds to mint for
    /// @return uint with the calculated number of new tokens to mint
    function calculateMintTotal(uint _timeInSeconds, uint _mintRate) pure private returns(uint mintAmount) {
        // Calculates the amount of tokens to mint based upon the number of seconds passed
        return(_timeInSeconds.mul(_mintRate));
    }
}

Contract Security Audit

Contract ABI

[{"constant":true,"inputs":[],"name":"stakingMintAmount","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"name","outputs":[{"name":"","type":"string"}],"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":"pool","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"totalSupply","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":false,"inputs":[{"name":"_user","type":"address"},{"name":"_amount","type":"uint256"}],"name":"stakeFor","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"decimals","outputs":[{"name":"","type":"uint8"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"","type":"address"}],"name":"stakeBalances","outputs":[{"name":"stakeBalance","type":"uint256"},{"name":"initialStakeTime","type":"uint256"},{"name":"unstakeTime","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"poolPercentage","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"ownerPercentage","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_value","type":"uint256"}],"name":"burn","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"_newAddress","type":"address"}],"name":"setPool","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[],"name":"ownerClaim","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"poolTimeLastMinted","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[],"name":"updateInflationRate","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"stakingMintRate","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","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":"_now","type":"uint256"}],"name":"getStakingGains","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[],"name":"poolIssue","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"lastInflationUpdate","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"_owner","type":"address"}],"name":"balanceOf","outputs":[{"name":"balance","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"poolMintAmount","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"stakingPercentage","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":true,"inputs":[],"name":"poolMintRate","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"symbol","outputs":[{"name":"","type":"string"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[],"name":"reclaimEther","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[],"name":"initUnstake","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"ownerMintRate","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_stakeAmount","type":"uint256"}],"name":"stake","outputs":[],"payable":false,"stateMutability":"nonpayable","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":"ownerTimeLastMinted","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"_user","type":"address"}],"name":"timeUntilClaimAvaliable","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"_user","type":"address"}],"name":"stakeBalanceOf","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"ownerMintAmount","outputs":[{"name":"","type":"uint256"}],"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":"_owner","type":"address"},{"name":"_spender","type":"address"}],"name":"allowance","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[],"name":"claimStake","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"totalScaleStaked","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":false,"stateMutability":"nonpayable","type":"fallback"},{"anonymous":false,"inputs":[{"indexed":true,"name":"staker","type":"address"},{"indexed":false,"name":"value","type":"uint256"}],"name":"Stake","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"unstaker","type":"address"},{"indexed":false,"name":"stakedAmount","type":"uint256"}],"name":"Unstake","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"claimer","type":"address"},{"indexed":false,"name":"stakedAmount","type":"uint256"},{"indexed":false,"name":"stakingGains","type":"uint256"}],"name":"ClaimStake","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"burner","type":"address"},{"indexed":false,"name":"value","type":"uint256"}],"name":"Burn","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"to","type":"address"},{"indexed":false,"name":"amount","type":"uint256"}],"name":"Mint","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":"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"}]

608060405260048054600160a060020a03191690556046600a556005600b556019600c55620151806012556103e86014553480156200003d57600080fd5b5060038054600160a060020a031916331790556000808034156200006057600080fd5b60038054600160a060020a031916339081179091556a084595161401484a0000009350620000989084640100000000620001b2810204565b9150811515620000a757600080fd5b42600d819055600e55600a54620000eb90606490620000d69086906401000000006200170e620002a182021704565b90640100000000620014e1620002db82021704565b600755600b546200011490606490620000d69086906401000000006200170e620002a182021704565b600955600c546200013d90606490620000d69086906401000000006200170e620002a182021704565b600855506007546a1a1601fc4ea7109e000000906200016890826012640100000000620002f3810204565b6005556009546200018590826012640100000000620002f3810204565b600655600854620001a290826012640100000000620002f3810204565b600f55505042601555506200035b565b60008054620001d09083640100000000620011436200034b82021704565b6000908155600160a060020a038416815260016020526040902054620002059083640100000000620011436200034b82021704565b600160a060020a038416600081815260016020908152604091829020939093558051858152905191927f0f6798a560793a54c3bcfe86a93cde1e73087d944c0ea20544137d412139688592918290030190a2604080518381529051600160a060020a038516916000917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9181900360200190a350600192915050565b600080831515620002b65760009150620002d4565b50828202828482811515620002c757fe5b0414620002d057fe5b8091505b5092915050565b6000808284811515620002ea57fe5b04949350505050565b600080620003168560018501600a0a6401000000006200170e620002a182021704565b9450600a620003348686640100000000620014e1620002db82021704565b6005018115156200034157fe5b0495945050505050565b600082820183811015620002d057fe5b611952806200036b6000396000f3006080604052600436106101f85763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166304e78a30811461020757806306fdde031461022e578063095ea7b3146102b857806316f0115b146102f057806318160ddd1461032157806323b872dd146103365780632ee4090814610360578063313ce567146103865780633b317dab146103b15780633e7e30ba146103f057806341da75551461040557806342966c681461041a5780634437152a146104325780634dbe588914610453578063531e48271461046857806361c083b91461047d578063628a01ce1461049257806366188463146104a757806366e1cebd146104cb5780636b178f47146104e35780636b4e8bb0146104f857806370a082311461050d5780637e5755241461052e57806381e1ccba146105435780638da5cb5b1461055857806390cad5371461056d57806395d89b411461022e5780639f727c2714610582578063a08ed1cb14610597578063a0d8b4e9146105ac578063a694fc3a146105c1578063a9059cbb146105d9578063ac185644146105fd578063af2759f714610612578063af46aa0814610633578063bb00c8f914610654578063d73dd62314610669578063dd62ed3e1461068d578063eb321173146106b4578063f162c5a1146106c9578063f2fde38b146106de575b34801561020457600080fd5b50005b34801561021357600080fd5b5061021c6106ff565b60408051918252519081900360200190f35b34801561023a57600080fd5b50610243610705565b6040805160208082528351818301528351919283929083019185019080838360005b8381101561027d578181015183820152602001610265565b50505050905090810190601f1680156102aa5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156102c457600080fd5b506102dc600160a060020a036004351660243561073c565b604080519115158252519081900360200190f35b3480156102fc57600080fd5b506103056107a2565b60408051600160a060020a039092168252519081900360200190f35b34801561032d57600080fd5b5061021c6107b1565b34801561034257600080fd5b506102dc600160a060020a03600435811690602435166044356107b7565b34801561036c57600080fd5b50610384600160a060020a036004351660243561091e565b005b34801561039257600080fd5b5061039b610937565b6040805160ff9092168252519081900360200190f35b3480156103bd57600080fd5b506103d2600160a060020a036004351661093c565b60408051938452602084019290925282820152519081900360600190f35b3480156103fc57600080fd5b5061021c61095d565b34801561041157600080fd5b5061021c610963565b34801561042657600080fd5b50610384600435610969565b34801561043e57600080fd5b50610384600160a060020a0360043516610976565b34801561045f57600080fd5b506103846109bc565b34801561047457600080fd5b5061021c610a37565b34801561048957600080fd5b50610384610a3d565b34801561049e57600080fd5b5061021c610a6c565b3480156104b357600080fd5b506102dc600160a060020a0360043516602435610a72565b3480156104d757600080fd5b5061021c600435610b64565b3480156104ef57600080fd5b50610384610ba7565b34801561050457600080fd5b5061021c610c46565b34801561051957600080fd5b5061021c600160a060020a0360043516610c4c565b34801561053a57600080fd5b5061021c610c67565b34801561054f57600080fd5b5061021c610c6d565b34801561056457600080fd5b50610305610c73565b34801561057957600080fd5b5061021c610c82565b34801561058e57600080fd5b50610384610c88565b3480156105a357600080fd5b506102dc610cd0565b3480156105b857600080fd5b5061021c610d9b565b3480156105cd57600080fd5b50610384600435610da1565b3480156105e557600080fd5b506102dc600160a060020a0360043516602435610db6565b34801561060957600080fd5b5061021c610e87565b34801561061e57600080fd5b5061021c600160a060020a0360043516610e8d565b34801561063f57600080fd5b5061021c600160a060020a0360043516610ecf565b34801561066057600080fd5b5061021c610eea565b34801561067557600080fd5b506102dc600160a060020a0360043516602435610ef0565b34801561069957600080fd5b5061021c600160a060020a0360043581169060243516610f89565b3480156106c057600080fd5b506102dc610fb4565b3480156106d557600080fd5b5061021c611096565b3480156106ea57600080fd5b50610384600160a060020a036004351661109c565b60085481565b60408051808201909152600581527f5343414c45000000000000000000000000000000000000000000000000000000602082015281565b336000818152600260209081526040808320600160a060020a038716808552908352818420869055815186815291519394909390927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925928290030190a350600192915050565b600454600160a060020a031681565b60005481565b6000600160a060020a03831615156107ce57600080fd5b600160a060020a0384166000908152600160205260409020548211156107f357600080fd5b600160a060020a038416600090815260026020908152604080832033845290915290205482111561082357600080fd5b600160a060020a03841660009081526001602052604090205461084c908363ffffffff61113116565b600160a060020a038086166000908152600160205260408082209390935590851681522054610881908363ffffffff61114316565b600160a060020a0380851660009081526001602090815260408083209490945591871681526002825282812033825290915220546108c5908363ffffffff61113116565b600160a060020a0380861660008181526002602090815260408083203384528252918290209490945580518681529051928716939192600080516020611907833981519152929181900390910190a35060019392505050565b6109288282611159565b151561093357600080fd5b5050565b601281565b60136020526000908152604090208054600182015460029092015490919083565b600a5481565b600b5481565b61097333826112bf565b50565b600354600160a060020a0316331461098d57600080fd5b6004805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b60035460009081908190600160a060020a031633146109da57600080fd5b600d5442116109e857600080fd5b600d546109fc90429063ffffffff61113116565b925060008311610a0857fe5b610a14836006546113af565b9150610a2033836113c1565b9050801515610a2e57600080fd5b505042600d5550565b600e5481565b6301e13380610a576015544261113190919063ffffffff16565b1015610a6257600080fd5b610a6a61148a565b565b600f5481565b336000908152600260209081526040808320600160a060020a038616845290915281205480831115610ac757336000908152600260209081526040808320600160a060020a0388168452909152812055610afc565b610ad7818463ffffffff61113116565b336000908152600260209081526040808320600160a060020a03891684529091529020555b336000818152600260209081526040808320600160a060020a0389168085529083529281902054815190815290519293927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929181900390910190a3600191505b5092915050565b336000908152601360205260408120541515610b8257506000610ba2565b610b9f610b9a601254846114e190919063ffffffff16565b6114f8565b90505b919050565b60045460009081908190600160a060020a03161515610bc557600080fd5b600e544211610bd357600080fd5b600454600160a060020a03161515610bea57600080fd5b600e54610bfe90429063ffffffff61113116565b925060008311610c0a57fe5b610c16836005546113af565b600454909250610c2f90600160a060020a0316836113c1565b9050801515610c3d57600080fd5b505042600e5550565b60155481565b600160a060020a031660009081526001602052604090205490565b60075481565b600c5481565b600354600160a060020a031681565b60055481565b600354600160a060020a03163314610c9f57600080fd5b600354604051600160a060020a0390911690303180156108fc02916000818181858888f193505050501515610a6a57fe5b3360009081526013602052604081206002015415610ced57600080fd5b3360009081526013602052604081205411610d0757600080fd5b601254610d1b90429063ffffffff6114e116565b336000908152601360205260409020600281019190915554601054610d459163ffffffff61113116565b601055610d506116e1565b3360008181526013602090815260409182902054825190815291517f85082129d87b2fe11527cb1b3b7a520aeb5aa6913f88a3d8757fe40d1db02fdd9281900390910190a250600190565b60065481565b610dab3382611159565b151561097357600080fd5b6000600160a060020a0383161515610dcd57600080fd5b33600090815260016020526040902054821115610de957600080fd5b33600090815260016020526040902054610e09908363ffffffff61113116565b3360009081526001602052604080822092909255600160a060020a03851681522054610e3b908363ffffffff61114316565b600160a060020a0384166000818152600160209081526040918290209390935580518581529051919233926000805160206119078339815191529281900390910190a350600192915050565b600d5481565b600160a060020a038116600090815260136020526040812060020154610b9f906201518090610ec390600e63ffffffff61114316565b9063ffffffff61170e16565b600160a060020a031660009081526013602052604090205490565b60095481565b336000908152600260209081526040808320600160a060020a0386168452909152812054610f24908363ffffffff61114316565b336000818152600260209081526040808320600160a060020a0389168085529083529281902085905580519485525191937f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929081900390910190a350600192915050565b600160a060020a03918216600090815260026020908152604080832093909416825291909152205490565b3360009081526013602052604081206002015460125482918291600e91610ff291610fe690429063ffffffff6114e116565b9063ffffffff61113116565b1015610ffd57600080fd5b3360009081526013602052604090208054600290910154909250611020906114f8565b3360009081526013602052604081208181556001810182905560020155905061104882611739565b61105233826113c1565b506040805183815260208101839052815133927f15bc237520b6d2aec89530f79038b72606e52b24f8d9608be55f9a674861562e928290030190a260019250505090565b60105481565b600354600160a060020a031633146110b357600080fd5b600160a060020a03811615156110c857600080fd5b600354604051600160a060020a038084169216907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a36003805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b60008282111561113d57fe5b50900390565b60008282018381101561115257fe5b9392505050565b336000908152600160205260408120548190819084111561117957600080fd5b600160a060020a0385166000908152601360205260409020600201541561119f57600080fd5b6111a93085610db6565b506012546111be90429063ffffffff6114e116565b600160a060020a0386166000908152601360205260409020549092506111ea908563ffffffff61114316565b600160a060020a038616600090815260136020526040902054909150151561122b57600160a060020a03851660009081526013602052604090206001018290555b600160a060020a0385166000908152601360209081526040808320848155858452600301909152902081905560105461126a908563ffffffff61114316565b6010556112756116e1565b604080518581529051600160a060020a038716917febedb8b3c678666e7f36970bc8f57abf6d8fa2e828c0da91ea5b75bf68ed101a919081900360200190a2506001949350505050565b600160a060020a0382166000908152600160205260409020548111156112e457600080fd5b600160a060020a03821660009081526001602052604090205461130d908263ffffffff61113116565b600160a060020a0383166000908152600160205260408120919091555461133a908263ffffffff61113116565b600055604080518281529051600160a060020a038416917fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5919081900360200190a2604080518281529051600091600160a060020a038516916000805160206119078339815191529181900360200190a35050565b6000611152838363ffffffff61170e16565b600080546113d5908363ffffffff61114316565b6000908155600160a060020a038416815260016020526040902054611400908363ffffffff61114316565b600160a060020a038416600081815260016020908152604091829020939093558051858152905191927f0f6798a560793a54c3bcfe86a93cde1e73087d944c0ea20544137d412139688592918290030190a2604080518381529051600160a060020a038516916000916000805160206119078339815191529181900360200190a350600192915050565b42601555601454606410156114b6576014546114ae9061012c63ffffffff61113116565b6014556114d9565b600a60145411156114d9576014546114d590600563ffffffff61113116565b6014555b610a6a6117d7565b60008082848115156114ef57fe5b04949350505050565b336000908152601360205260408120600101548180808080808080806115248c8b63ffffffff61113116565b98506000975087965088151561153d5760009a506116d2565b61016d8910611560576115588a61016d63ffffffff61114316565b9b5061016d98505b8993505b8b841015611670573360009081526013602090815260408083208784526003019091529020549250821561160657600084815260116020526040902054156115ec576000848152601160205260409020546115d3906115c690859060126118c3565b899063ffffffff61114316565b60008581526011602052604090205490985095506115fe565b6115fb6115c6848860126118c3565b97505b829450611665565b600084815260116020526040902054156116535760008481526011602052604090205461163a906115c690879060126118c3565b6000858152601160205260409020549098509550611665565b6116626115c6868860126118c3565b97505b600190930192611564565b61167c888a60006118c3565b600f54909250611692908363ffffffff61170e16565b90506116ac81670de0b6b3a764000063ffffffff6114e116565b90506116cc6116c66012548b61170e90919063ffffffff16565b826113af565b9650869a505b50505050505050505050919050565b60006116f8601254426114e190919063ffffffff16565b6010546000918252601160205260409091205550565b6000808315156117215760009150610b5d565b5082820282848281151561173157fe5b041461115257fe5b3060009081526001602052604090205481111561175557600080fd5b33600090815260016020526040902054611775908263ffffffff61114316565b3360009081526001602052604080822092909255308152205461179e908263ffffffff61113116565b3060008181526001602090815260409182902093909355805184815290513393600080516020611907833981519152928290030190a350565b61180b60646117ff600a54610ec36103e86117ff60145460005461170e90919063ffffffff16565b9063ffffffff6114e116565b60078190555061183960646117ff600b54610ec36103e86117ff60145460005461170e90919063ffffffff16565b60098190555061186760646117ff600c54610ec36103e86117ff60145460005461170e90919063ffffffff16565b600855600754611884906a1a1601fc4ea7109e00000060126118c3565b6005556009546118a1906a1a1601fc4ea7109e00000060126118c3565b6006556008546118be906a1a1601fc4ea7109e00000060126118c3565b600f55565b6000806118dc8560018501600a0a63ffffffff61170e16565b9450600a6118f0868663ffffffff6114e116565b6005018115156118fc57fe5b04959450505050505600ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3efa165627a7a723058203ed3180bdb3bd1367da573ea28bc86db78cc91f3ad42f8b3c0667b6283b91dbe0029

Deployed Bytecode

0x6080604052600436106101f85763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166304e78a30811461020757806306fdde031461022e578063095ea7b3146102b857806316f0115b146102f057806318160ddd1461032157806323b872dd146103365780632ee4090814610360578063313ce567146103865780633b317dab146103b15780633e7e30ba146103f057806341da75551461040557806342966c681461041a5780634437152a146104325780634dbe588914610453578063531e48271461046857806361c083b91461047d578063628a01ce1461049257806366188463146104a757806366e1cebd146104cb5780636b178f47146104e35780636b4e8bb0146104f857806370a082311461050d5780637e5755241461052e57806381e1ccba146105435780638da5cb5b1461055857806390cad5371461056d57806395d89b411461022e5780639f727c2714610582578063a08ed1cb14610597578063a0d8b4e9146105ac578063a694fc3a146105c1578063a9059cbb146105d9578063ac185644146105fd578063af2759f714610612578063af46aa0814610633578063bb00c8f914610654578063d73dd62314610669578063dd62ed3e1461068d578063eb321173146106b4578063f162c5a1146106c9578063f2fde38b146106de575b34801561020457600080fd5b50005b34801561021357600080fd5b5061021c6106ff565b60408051918252519081900360200190f35b34801561023a57600080fd5b50610243610705565b6040805160208082528351818301528351919283929083019185019080838360005b8381101561027d578181015183820152602001610265565b50505050905090810190601f1680156102aa5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156102c457600080fd5b506102dc600160a060020a036004351660243561073c565b604080519115158252519081900360200190f35b3480156102fc57600080fd5b506103056107a2565b60408051600160a060020a039092168252519081900360200190f35b34801561032d57600080fd5b5061021c6107b1565b34801561034257600080fd5b506102dc600160a060020a03600435811690602435166044356107b7565b34801561036c57600080fd5b50610384600160a060020a036004351660243561091e565b005b34801561039257600080fd5b5061039b610937565b6040805160ff9092168252519081900360200190f35b3480156103bd57600080fd5b506103d2600160a060020a036004351661093c565b60408051938452602084019290925282820152519081900360600190f35b3480156103fc57600080fd5b5061021c61095d565b34801561041157600080fd5b5061021c610963565b34801561042657600080fd5b50610384600435610969565b34801561043e57600080fd5b50610384600160a060020a0360043516610976565b34801561045f57600080fd5b506103846109bc565b34801561047457600080fd5b5061021c610a37565b34801561048957600080fd5b50610384610a3d565b34801561049e57600080fd5b5061021c610a6c565b3480156104b357600080fd5b506102dc600160a060020a0360043516602435610a72565b3480156104d757600080fd5b5061021c600435610b64565b3480156104ef57600080fd5b50610384610ba7565b34801561050457600080fd5b5061021c610c46565b34801561051957600080fd5b5061021c600160a060020a0360043516610c4c565b34801561053a57600080fd5b5061021c610c67565b34801561054f57600080fd5b5061021c610c6d565b34801561056457600080fd5b50610305610c73565b34801561057957600080fd5b5061021c610c82565b34801561058e57600080fd5b50610384610c88565b3480156105a357600080fd5b506102dc610cd0565b3480156105b857600080fd5b5061021c610d9b565b3480156105cd57600080fd5b50610384600435610da1565b3480156105e557600080fd5b506102dc600160a060020a0360043516602435610db6565b34801561060957600080fd5b5061021c610e87565b34801561061e57600080fd5b5061021c600160a060020a0360043516610e8d565b34801561063f57600080fd5b5061021c600160a060020a0360043516610ecf565b34801561066057600080fd5b5061021c610eea565b34801561067557600080fd5b506102dc600160a060020a0360043516602435610ef0565b34801561069957600080fd5b5061021c600160a060020a0360043581169060243516610f89565b3480156106c057600080fd5b506102dc610fb4565b3480156106d557600080fd5b5061021c611096565b3480156106ea57600080fd5b50610384600160a060020a036004351661109c565b60085481565b60408051808201909152600581527f5343414c45000000000000000000000000000000000000000000000000000000602082015281565b336000818152600260209081526040808320600160a060020a038716808552908352818420869055815186815291519394909390927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925928290030190a350600192915050565b600454600160a060020a031681565b60005481565b6000600160a060020a03831615156107ce57600080fd5b600160a060020a0384166000908152600160205260409020548211156107f357600080fd5b600160a060020a038416600090815260026020908152604080832033845290915290205482111561082357600080fd5b600160a060020a03841660009081526001602052604090205461084c908363ffffffff61113116565b600160a060020a038086166000908152600160205260408082209390935590851681522054610881908363ffffffff61114316565b600160a060020a0380851660009081526001602090815260408083209490945591871681526002825282812033825290915220546108c5908363ffffffff61113116565b600160a060020a0380861660008181526002602090815260408083203384528252918290209490945580518681529051928716939192600080516020611907833981519152929181900390910190a35060019392505050565b6109288282611159565b151561093357600080fd5b5050565b601281565b60136020526000908152604090208054600182015460029092015490919083565b600a5481565b600b5481565b61097333826112bf565b50565b600354600160a060020a0316331461098d57600080fd5b6004805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b60035460009081908190600160a060020a031633146109da57600080fd5b600d5442116109e857600080fd5b600d546109fc90429063ffffffff61113116565b925060008311610a0857fe5b610a14836006546113af565b9150610a2033836113c1565b9050801515610a2e57600080fd5b505042600d5550565b600e5481565b6301e13380610a576015544261113190919063ffffffff16565b1015610a6257600080fd5b610a6a61148a565b565b600f5481565b336000908152600260209081526040808320600160a060020a038616845290915281205480831115610ac757336000908152600260209081526040808320600160a060020a0388168452909152812055610afc565b610ad7818463ffffffff61113116565b336000908152600260209081526040808320600160a060020a03891684529091529020555b336000818152600260209081526040808320600160a060020a0389168085529083529281902054815190815290519293927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929181900390910190a3600191505b5092915050565b336000908152601360205260408120541515610b8257506000610ba2565b610b9f610b9a601254846114e190919063ffffffff16565b6114f8565b90505b919050565b60045460009081908190600160a060020a03161515610bc557600080fd5b600e544211610bd357600080fd5b600454600160a060020a03161515610bea57600080fd5b600e54610bfe90429063ffffffff61113116565b925060008311610c0a57fe5b610c16836005546113af565b600454909250610c2f90600160a060020a0316836113c1565b9050801515610c3d57600080fd5b505042600e5550565b60155481565b600160a060020a031660009081526001602052604090205490565b60075481565b600c5481565b600354600160a060020a031681565b60055481565b600354600160a060020a03163314610c9f57600080fd5b600354604051600160a060020a0390911690303180156108fc02916000818181858888f193505050501515610a6a57fe5b3360009081526013602052604081206002015415610ced57600080fd5b3360009081526013602052604081205411610d0757600080fd5b601254610d1b90429063ffffffff6114e116565b336000908152601360205260409020600281019190915554601054610d459163ffffffff61113116565b601055610d506116e1565b3360008181526013602090815260409182902054825190815291517f85082129d87b2fe11527cb1b3b7a520aeb5aa6913f88a3d8757fe40d1db02fdd9281900390910190a250600190565b60065481565b610dab3382611159565b151561097357600080fd5b6000600160a060020a0383161515610dcd57600080fd5b33600090815260016020526040902054821115610de957600080fd5b33600090815260016020526040902054610e09908363ffffffff61113116565b3360009081526001602052604080822092909255600160a060020a03851681522054610e3b908363ffffffff61114316565b600160a060020a0384166000818152600160209081526040918290209390935580518581529051919233926000805160206119078339815191529281900390910190a350600192915050565b600d5481565b600160a060020a038116600090815260136020526040812060020154610b9f906201518090610ec390600e63ffffffff61114316565b9063ffffffff61170e16565b600160a060020a031660009081526013602052604090205490565b60095481565b336000908152600260209081526040808320600160a060020a0386168452909152812054610f24908363ffffffff61114316565b336000818152600260209081526040808320600160a060020a0389168085529083529281902085905580519485525191937f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929081900390910190a350600192915050565b600160a060020a03918216600090815260026020908152604080832093909416825291909152205490565b3360009081526013602052604081206002015460125482918291600e91610ff291610fe690429063ffffffff6114e116565b9063ffffffff61113116565b1015610ffd57600080fd5b3360009081526013602052604090208054600290910154909250611020906114f8565b3360009081526013602052604081208181556001810182905560020155905061104882611739565b61105233826113c1565b506040805183815260208101839052815133927f15bc237520b6d2aec89530f79038b72606e52b24f8d9608be55f9a674861562e928290030190a260019250505090565b60105481565b600354600160a060020a031633146110b357600080fd5b600160a060020a03811615156110c857600080fd5b600354604051600160a060020a038084169216907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a36003805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b60008282111561113d57fe5b50900390565b60008282018381101561115257fe5b9392505050565b336000908152600160205260408120548190819084111561117957600080fd5b600160a060020a0385166000908152601360205260409020600201541561119f57600080fd5b6111a93085610db6565b506012546111be90429063ffffffff6114e116565b600160a060020a0386166000908152601360205260409020549092506111ea908563ffffffff61114316565b600160a060020a038616600090815260136020526040902054909150151561122b57600160a060020a03851660009081526013602052604090206001018290555b600160a060020a0385166000908152601360209081526040808320848155858452600301909152902081905560105461126a908563ffffffff61114316565b6010556112756116e1565b604080518581529051600160a060020a038716917febedb8b3c678666e7f36970bc8f57abf6d8fa2e828c0da91ea5b75bf68ed101a919081900360200190a2506001949350505050565b600160a060020a0382166000908152600160205260409020548111156112e457600080fd5b600160a060020a03821660009081526001602052604090205461130d908263ffffffff61113116565b600160a060020a0383166000908152600160205260408120919091555461133a908263ffffffff61113116565b600055604080518281529051600160a060020a038416917fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5919081900360200190a2604080518281529051600091600160a060020a038516916000805160206119078339815191529181900360200190a35050565b6000611152838363ffffffff61170e16565b600080546113d5908363ffffffff61114316565b6000908155600160a060020a038416815260016020526040902054611400908363ffffffff61114316565b600160a060020a038416600081815260016020908152604091829020939093558051858152905191927f0f6798a560793a54c3bcfe86a93cde1e73087d944c0ea20544137d412139688592918290030190a2604080518381529051600160a060020a038516916000916000805160206119078339815191529181900360200190a350600192915050565b42601555601454606410156114b6576014546114ae9061012c63ffffffff61113116565b6014556114d9565b600a60145411156114d9576014546114d590600563ffffffff61113116565b6014555b610a6a6117d7565b60008082848115156114ef57fe5b04949350505050565b336000908152601360205260408120600101548180808080808080806115248c8b63ffffffff61113116565b98506000975087965088151561153d5760009a506116d2565b61016d8910611560576115588a61016d63ffffffff61114316565b9b5061016d98505b8993505b8b841015611670573360009081526013602090815260408083208784526003019091529020549250821561160657600084815260116020526040902054156115ec576000848152601160205260409020546115d3906115c690859060126118c3565b899063ffffffff61114316565b60008581526011602052604090205490985095506115fe565b6115fb6115c6848860126118c3565b97505b829450611665565b600084815260116020526040902054156116535760008481526011602052604090205461163a906115c690879060126118c3565b6000858152601160205260409020549098509550611665565b6116626115c6868860126118c3565b97505b600190930192611564565b61167c888a60006118c3565b600f54909250611692908363ffffffff61170e16565b90506116ac81670de0b6b3a764000063ffffffff6114e116565b90506116cc6116c66012548b61170e90919063ffffffff16565b826113af565b9650869a505b50505050505050505050919050565b60006116f8601254426114e190919063ffffffff16565b6010546000918252601160205260409091205550565b6000808315156117215760009150610b5d565b5082820282848281151561173157fe5b041461115257fe5b3060009081526001602052604090205481111561175557600080fd5b33600090815260016020526040902054611775908263ffffffff61114316565b3360009081526001602052604080822092909255308152205461179e908263ffffffff61113116565b3060008181526001602090815260409182902093909355805184815290513393600080516020611907833981519152928290030190a350565b61180b60646117ff600a54610ec36103e86117ff60145460005461170e90919063ffffffff16565b9063ffffffff6114e116565b60078190555061183960646117ff600b54610ec36103e86117ff60145460005461170e90919063ffffffff16565b60098190555061186760646117ff600c54610ec36103e86117ff60145460005461170e90919063ffffffff16565b600855600754611884906a1a1601fc4ea7109e00000060126118c3565b6005556009546118a1906a1a1601fc4ea7109e00000060126118c3565b6006556008546118be906a1a1601fc4ea7109e00000060126118c3565b600f55565b6000806118dc8560018501600a0a63ffffffff61170e16565b9450600a6118f0868663ffffffff6114e116565b6005018115156118fc57fe5b04959450505050505600ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3efa165627a7a723058203ed3180bdb3bd1367da573ea28bc86db78cc91f3ad42f8b3c0667b6283b91dbe0029

Swarm Source

bzzr://3ed3180bdb3bd1367da573ea28bc86db78cc91f3ad42f8b3c0667b6283b91dbe
Loading...
Loading
Loading...
Loading
[ Download: CSV Export  ]
[ Download: CSV Export  ]

A token is a representation of an on-chain or off-chain asset. The token page shows information such as price, total supply, holders, transfers and social links. Learn more about this page in our Knowledge Base.