Contract 0x87d9ef8951de64b7246fdb7c7d5a52760677f361

 

TxHash Block Age From To Value [TxFee]
0x184e1cbed4da2f545504870702a4351dbea65f3630b3bf356f1dcbe1a62296b8(pending)2 secs ago0x8471e76fc23c0453acaf7b00067cea6b494a8448  IN  0x87d9ef8951de64b7246fdb7c7d5a52760677f3610 Ether(Pending)
0x4983d4c79a56a4466152ce31cea6c855720cbfcd2ed3490c6ac41061feefaa23(pending)19 secs ago0x6555c782138085f66982b87ba531b7fd60fcec86  IN  0x87d9ef8951de64b7246fdb7c7d5a52760677f3610 Ether(Pending)
0x2bc1f198cc076f6858fc68ae79636676cd4304ea9137d0fa11511971068ddca1(pending)41 secs ago0xf2b09156c70a4acfff6f6075a0718552fab69414  IN  0x87d9ef8951de64b7246fdb7c7d5a52760677f3610 Ether(Pending)
0xac02d97fb09ffd4e013728a78734f8886b9aee5d9d7a2dc0a6d3b4cb4cf76b82(pending)1 min ago0x93a60b7a31359712a51665c520f0380a698134cb  IN  0x87d9ef8951de64b7246fdb7c7d5a52760677f3610 Ether(Pending)
0x1f97ba564ad7a2d5f59fcb6860c612d5fffe28f8626617544b3143ddda2f2acc(pending)1 min ago0xe79ae86a1a6bb47a9519621d5b3ec36a57d27189  IN  0x87d9ef8951de64b7246fdb7c7d5a52760677f3610 Ether(Pending)
0x1d038efc398c0bfc001847a17e3b9a09a585f1648abc518cd776ef26dd0cf4df(pending)1 min ago0x2e2bfb9d533ec40f32b2ca2fedddebbdbbcaa40b  IN  0x87d9ef8951de64b7246fdb7c7d5a52760677f3610 Ether(Pending)
0x0a368c49ebd32477810aac5878438b5f25bd512aa6c6593775877ce0594ef744(pending)2 mins ago0x9e4d1e56d9b1645cb7f8aa97447a4acaf7ed5ac5  IN  0x87d9ef8951de64b7246fdb7c7d5a52760677f3610 Ether(Pending)
0x0bf09da0ab8d57837b3be189fecf53e301c7ac6606b6d26926946341fc164e08(pending)2 mins ago0x7bb3ade04983d69703043d2acef9a862977a6b21  IN  0x87d9ef8951de64b7246fdb7c7d5a52760677f3610 Ether(Pending)
0x1c3ac0c9dd08b5ae565f2d50127db41cdacf4ac092ed15947a3fffb7d6b5c633(pending)2 mins ago0x18d0f4fddb744235d4645d7420d3283268d95637  IN  0x87d9ef8951de64b7246fdb7c7d5a52760677f3610 Ether(Pending)
0xb96a12c6d3d99cd583f4b8fa91ccec5e169b8aa80155f828b16f8740d742b269(pending)3 mins ago0x169630ed0e87294ead1e552297889450c9b7ceb3  IN  0x87d9ef8951de64b7246fdb7c7d5a52760677f3610 Ether(Pending)
0xc15fc212b43c600804aab87dc1e482df3abc20d2171d9482836a829b4825881a(pending)3 mins ago0xbf2fde3eaa11708dcd18719ee96293e97868a334  IN  0x87d9ef8951de64b7246fdb7c7d5a52760677f3610 Ether(Pending)
0x3147fed13d8cf8333f5c23285caa0caf30628a2fd4e28dee467b5ab80e347eb4(pending)4 mins ago0x56680a28261aea38cf28e4d5b9c8babf8504c0b4  IN  0x87d9ef8951de64b7246fdb7c7d5a52760677f3610 Ether(Pending)
0x0bf96fb3b6746483dade5629421c484b6efa62edd8f7622ad4e2d316aa36d946(pending)5 mins ago0xfa877f1f91d8d60b7dccc826a9b37eca7f3f93b0  IN  0x87d9ef8951de64b7246fdb7c7d5a52760677f3610 Ether(Pending)
0xedede887cdec53cbb1d55c449f3ac82417c40b1271aa3d468e82cf1958886ec1(pending)6 mins ago0xd5b1fed4021ddf94056d27996a276761114fe7de  IN  0x87d9ef8951de64b7246fdb7c7d5a52760677f3610 Ether(Pending)
0x8996a9bbcca2c33a41bc4141bd4bb4224a62aec7ad1553845d310d08bc807fcf(pending)6 mins ago0x699db95d741f51c21dce58290e61b74b3ad1447e  IN  0x87d9ef8951de64b7246fdb7c7d5a52760677f3610 Ether(Pending)
0x454949c9e1cbc8881cf6ed40458982bd9a0c13eabc0cae49821bcd1419562b1f(pending)7 mins ago0x7dff20281b951f62fb9e05798eb26213d20151c1  IN  0x87d9ef8951de64b7246fdb7c7d5a52760677f3610 Ether(Pending)
0x713ccbf3bbd549f58d6e516d1c8bef83d225b76d512d60d18718a5b7376f8feb(pending)7 mins ago0x4a07a32e1a9ea615ea18c41800c2e9547c8cf8e8  IN  0x87d9ef8951de64b7246fdb7c7d5a52760677f3610 Ether(Pending)
0xd1d4d14034c0af307282177396c29a9cbb4f213e3352ed22eed763703e28b975(pending)8 mins ago0x2ee334c5ae9134b0d5ab934e9cbbc35c064a7d15  IN  0x87d9ef8951de64b7246fdb7c7d5a52760677f3610 Ether(Pending)
0xade1fedcec0e30704d7e4a090417dc486d3c3d530fc8216e698f91ed8a8f28bd(pending)8 mins ago0xfb9e89e77c92b1209699d2404024eee409098ec0  IN  0x87d9ef8951de64b7246fdb7c7d5a52760677f3610 Ether(Pending)
0x62e31388494dddd29db7a4e6e66d6b7bf6729f0b4cbd2af6227185891719582f(pending)9 mins ago0x2856a323561068ee25fe1892e31704c2f8ce1da3  IN  0x87d9ef8951de64b7246fdb7c7d5a52760677f3610 Ether(Pending)
0xf62fb47fa91777b91cb8ea42de3eee22d3dfbfb9e2a63d7e11b9a75d979bb26f(pending)9 mins ago0x86ab8c48156de34f3ba2c6b6e7d7806e57b724ec  IN  0x87d9ef8951de64b7246fdb7c7d5a52760677f3610 Ether(Pending)
0x95be43f8bf542d9f5a5d02437ee2f5c6ede4eb305e01e01d209c2d0314c8e549(pending)10 mins ago0x1b05a7f328c91f15b92de0e2eceb1d40d4f73e14  IN  0x87d9ef8951de64b7246fdb7c7d5a52760677f3610 Ether(Pending)
0x60ddef9004a2986465d907e89fdf5eb368aa298d2465470e4d1e1dbc7f0cbc9c(pending)11 mins ago0x19990a4f105c9b2baf64be45e0bd1f64783eb039  IN  0x87d9ef8951de64b7246fdb7c7d5a52760677f3610 Ether(Pending)
0x69d624fdb6b8fd69c1e28322abbc368d6faea6363f07b1579926597fc3d3b4ef(pending)11 mins ago0xf009178830188111295ef840f533cbbf02a775cc  IN  0x87d9ef8951de64b7246fdb7c7d5a52760677f3610 Ether(Pending)
0xe82c0b0f4766188d3eaccfa8309f04b8cc918194f2d32f5796dbee1ec1fe7d3f(pending)11 mins ago0x3bf205750bfb64aa531ace40bf50a38329a3ba5c  IN  0x87d9ef8951de64b7246fdb7c7d5a52760677f3610 Ether(Pending)

Internal Transactions as a result of Contract Execution

Parent TxHash Block Age From To Value
Contract Source Code Verified (Exact Match)
Contract Name: TokenFaucet
Compiler Version: v0.4.25+commit.59dbf8f1
Optimization Enabled: Yes
Runs (Optimizer):  200


Contract Source Code
pragma solidity ^0.4.25;

// File: openzeppelin-solidity/contracts/token/ERC20/IERC20.sol

/**
 * @title ERC20 interface
 * @dev see https://github.com/ethereum/EIPs/issues/20
 */
interface IERC20 {
  function totalSupply() external view returns (uint256);

  function balanceOf(address who) external view returns (uint256);

  function allowance(address owner, address spender)
    external view returns (uint256);

  function transfer(address to, uint256 value) external returns (bool);

  function approve(address spender, uint256 value)
    external returns (bool);

  function transferFrom(address from, address to, uint256 value)
    external returns (bool);

  event Transfer(
    address indexed from,
    address indexed to,
    uint256 value
  );

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

// File: openzeppelin-solidity/contracts/math/SafeMath.sol

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

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

    uint256 c = a * b;
    require(c / a == b);

    return c;
  }

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

    return c;
  }

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

    return c;
  }

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

    return c;
  }

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

// File: openzeppelin-solidity/contracts/token/ERC20/ERC20.sol

/**
 * @title Standard ERC20 token
 *
 * @dev Implementation of the basic standard token.
 * https://github.com/ethereum/EIPs/blob/master/EIPS/eip-20.md
 * Originally based on code by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol
 */
contract ERC20 is IERC20 {
  using SafeMath for uint256;

  mapping (address => uint256) private _balances;

  mapping (address => mapping (address => uint256)) private _allowed;

  uint256 private _totalSupply;

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

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

  /**
   * @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 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) {
    _transfer(msg.sender, 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) {
    require(spender != address(0));

    _allowed[msg.sender][spender] = value;
    emit Approval(msg.sender, spender, value);
    return true;
  }

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

    _allowed[from][msg.sender] = _allowed[from][msg.sender].sub(value);
    _transfer(from, to, value);
    return true;
  }

  /**
   * @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 increaseAllowance(
    address spender,
    uint256 addedValue
  )
    public
    returns (bool)
  {
    require(spender != address(0));

    _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 decreaseAllowance(
    address spender,
    uint256 subtractedValue
  )
    public
    returns (bool)
  {
    require(spender != address(0));

    _allowed[msg.sender][spender] = (
      _allowed[msg.sender][spender].sub(subtractedValue));
    emit Approval(msg.sender, spender, _allowed[msg.sender][spender]);
    return true;
  }

  /**
  * @dev Transfer token for a specified addresses
  * @param from The address to transfer from.
  * @param to The address to transfer to.
  * @param value The amount to be transferred.
  */
  function _transfer(address from, address to, uint256 value) internal {
    require(value <= _balances[from]);
    require(to != address(0));

    _balances[from] = _balances[from].sub(value);
    _balances[to] = _balances[to].add(value);
    emit Transfer(from, to, value);
  }

  /**
   * @dev Internal function that mints an amount of the token and assigns it to
   * an account. This encapsulates the modification of balances such that the
   * proper events are emitted.
   * @param account The account that will receive the created tokens.
   * @param value The amount that will be created.
   */
  function _mint(address account, uint256 value) internal {
    require(account != 0);
    _totalSupply = _totalSupply.add(value);
    _balances[account] = _balances[account].add(value);
    emit Transfer(address(0), account, value);
  }

  /**
   * @dev Internal function that burns an amount of the token of a given
   * account.
   * @param account The account whose tokens will be burnt.
   * @param value The amount that will be burnt.
   */
  function _burn(address account, uint256 value) internal {
    require(account != 0);
    require(value <= _balances[account]);

    _totalSupply = _totalSupply.sub(value);
    _balances[account] = _balances[account].sub(value);
    emit Transfer(account, address(0), value);
  }

  /**
   * @dev Internal function that burns an amount of the token of a given
   * account, deducting from the sender's allowance for said account. Uses the
   * internal burn function.
   * @param account The account whose tokens will be burnt.
   * @param value The amount that will be burnt.
   */
  function _burnFrom(address account, uint256 value) internal {
    require(value <= _allowed[account][msg.sender]);

    // Should https://github.com/OpenZeppelin/zeppelin-solidity/issues/707 be accepted,
    // this function needs to emit an event with the updated approval.
    _allowed[account][msg.sender] = _allowed[account][msg.sender].sub(
      value);
    _burn(account, value);
  }
}

// File: openzeppelin-solidity/contracts/ownership/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 private _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() internal {
    _owner = msg.sender;
    emit OwnershipTransferred(address(0), _owner);
  }

  /**
   * @return the address of the owner.
   */
  function owner() public view returns(address) {
    return _owner;
  }

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

  /**
   * @return true if `msg.sender` is the owner of the contract.
   */
  function isOwner() public view returns(bool) {
    return 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 OwnershipTransferred(_owner, address(0));
    _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: eth-token-recover/contracts/TokenRecover.sol

/**
 * @title TokenRecover
 * @author Vittorio Minacori (https://github.com/vittominacori)
 * @dev Allow to recover any ERC20 sent into the contract for error
 */
contract TokenRecover is Ownable {

  /**
   * @dev Remember that only owner can call so be careful when use on contracts generated from other contracts.
   * @param tokenAddress The token contract address
   * @param tokenAmount Number of tokens to be sent
   */
  function recoverERC20(
    address tokenAddress,
    uint256 tokenAmount
  )
    public
    onlyOwner
  {
    IERC20(tokenAddress).transfer(owner(), tokenAmount);
  }
}

// File: contracts/faucet/TokenFaucet.sol

/**
 * @title TokenFaucet
 * @author Vittorio Minacori (https://github.com/vittominacori)
 * @dev Implementation of a TokenFaucet
 */
contract TokenFaucet is TokenRecover {
  using SafeMath for uint256;

  // struct representing the faucet status for an account
  struct RecipientDetail {
    bool exists;
    uint256 tokens;
    uint256 lastUpdate;
    address referral;
  }

  // struct representing the referral status
  struct ReferralDetail {
    uint256 tokens;
    address[] recipients;
  }

  // the time between two tokens claim
  uint256 private _pauseTime = 1 days;

  // the token to distribute
  ERC20 private _token;

  // the daily rate of tokens distributed
  uint256 private _dailyRate;

  // the value earned by referral per mille
  uint256 private _referralPerMille;

  // the sum of distributed tokens
  uint256 private _totalDistributedTokens;

  // map of address and received token amount
  mapping (address => RecipientDetail) private _recipientList;

  // list of addresses who received tokens
  address[] private _recipients;

  // map of address and referred addresses
  mapping (address => ReferralDetail) private _referralList;

  /**
   * @param token Address of the token being distributed
   * @param dailyRate Daily rate of tokens distributed
   * @param referralPerMille The value earned by referral per mille
   */
  constructor(
    address token,
    uint256 dailyRate,
    uint256 referralPerMille
  )
    public
  {
    require(token != address(0));
    require(dailyRate > 0);
    require(referralPerMille > 0);

    _token = ERC20(token);
    _dailyRate = dailyRate;
    _referralPerMille = referralPerMille;
  }

  /**
   * @dev fallback
   */
  function () external payable {
    require(msg.value == 0);

    getTokens();
  }

  /**
   * @dev function to be called to receive tokens
   */
  function getTokens() public {
    // distribute tokens
    _distributeTokens(msg.sender, address(0));
  }

  /**
   * @dev function to be called to receive tokens
   * @param referral Address to an account that is referring
   */
  function getTokensWithReferral(address referral) public {
    require(referral != msg.sender);

    // distribute tokens
    _distributeTokens(msg.sender, referral);
  }

  /**
   * @return the token to distribute
   */
  function token() public view returns (ERC20) {
    return _token;
  }

  /**
   * @return the daily rate of tokens distributed
   */
  function dailyRate() public view returns (uint256) {
    return _dailyRate;
  }

  /**
   * @return the value earned by referral for each recipient
   */
  function referralTokens() public view returns (uint256) {
    return _dailyRate.mul(_referralPerMille).div(1000);
  }

  /**
   * @return the sum of distributed tokens
   */
  function totalDistributedTokens() public view returns (uint256) {
    return _totalDistributedTokens;
  }

  /**
   * @param account The address to check
   * @return received token amount for the given address
   */
  function receivedTokens(address account) public view returns (uint256) {
    return _recipientList[account].tokens;
  }

  /**
   * @param account The address to check
   * @return last tokens received timestamp
   */
  function lastUpdate(address account) public view returns (uint256) {
    return _recipientList[account].lastUpdate;
  }

  /**
   * @param account The address to check
   * @return time of next available claim or zero
   */
  function nextClaimTime(address account) public view returns (uint256) {
    return !_recipientList[account].exists ? 0 : _recipientList[account].lastUpdate + _pauseTime;
  }

  /**
   * @param account The address to check
   * @return referral for given address
   */
  function getReferral(address account) public view returns (address) {
    return _recipientList[account].referral;
  }

  /**
   * @param account The address to check
   * @return earned tokens by referrals
   */
  function earnedByReferral(address account) public view returns (uint256) {
    return _referralList[account].tokens;
  }

  /**
   * @param account The address to check
   * @return referred addresses for given address
   */
  function getReferredAddresses(address account) public view returns (address[]) {
    return _referralList[account].recipients;
  }

  /**
   * @param account The address to check
   * @return referred addresses for given address
   */
  function getReferredAddressesLength(address account) public view returns (uint) {
    return _referralList[account].recipients.length;
  }

  /**
   * @dev return the number of remaining tokens to distribute
   * @return uint256
   */
  function remainingTokens() public view returns (uint256) {
    return _token.balanceOf(this);
  }

  /**
   * @return address of a recipient by list index
   */
  function getRecipientAddress(uint256 index) public view returns (address) {
    return _recipients[index];
  }

  /**
   * @dev return the recipients length
   * @return uint
   */
  function getRecipientsLength() public view returns (uint) {
    return _recipients.length;
  }

  /**
   * @dev change daily rate and referral per mille
   * @param newDailyRate Daily rate of tokens distributed
   * @param newReferralPerMille The value earned by referral per mille
   */
  function setRates(uint256 newDailyRate, uint256 newReferralPerMille) public onlyOwner {
    require(newDailyRate > 0);
    require(newReferralPerMille > 0);

    _dailyRate = newDailyRate;
    _referralPerMille = newReferralPerMille;
  }

  /**
   * @dev distribute tokens
   * @param account Address being distributing
   * @param referral Address to an account that is referring
   */
  function _distributeTokens(address account, address referral) internal {
    require(nextClaimTime(account) <= block.timestamp); // solium-disable-line security/no-block-members

    // check if recipient exists
    if (!_recipientList[account].exists) {
      _recipients.push(account);
      _recipientList[account].exists = true;

      // check if valid referral
      if (referral != address(0)) {
        _recipientList[account].referral = referral;
        _referralList[referral].recipients.push(account);
      }
    }

    // update recipient status
    _recipientList[account].lastUpdate = block.timestamp; // solium-disable-line security/no-block-members
    _recipientList[account].tokens = _recipientList[account].tokens.add(_dailyRate);

    // update faucet status
    _totalDistributedTokens = _totalDistributedTokens.add(_dailyRate);

    // transfer tokens to recipient
    _token.transfer(account, _dailyRate);

    // check referral
    if (_recipientList[account].referral != address(0)) {
      // referral is only the first one referring
      address firstReferral = _recipientList[account].referral;

      uint256 referralEarnedTokens = referralTokens();

      // update referral status
      _referralList[firstReferral].tokens = _referralList[firstReferral].tokens.add(referralEarnedTokens);

      // update faucet status
      _totalDistributedTokens = _totalDistributedTokens.add(referralEarnedTokens);

      // transfer tokens to referral
      _token.transfer(firstReferral, referralEarnedTokens);
    }
  }
}

Contract ABI
[{"constant":true,"inputs":[{"name":"index","type":"uint256"}],"name":"getRecipientAddress","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"account","type":"address"}],"name":"getReferral","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"account","type":"address"}],"name":"getReferredAddresses","outputs":[{"name":"","type":"address[]"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"account","type":"address"}],"name":"getReferredAddressesLength","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"account","type":"address"}],"name":"nextClaimTime","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[],"name":"renounceOwnership","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"dailyRate","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"tokenAddress","type":"address"},{"name":"tokenAmount","type":"uint256"}],"name":"recoverERC20","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"owner","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"isOwner","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"referralTokens","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[],"name":"getTokens","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"newDailyRate","type":"uint256"},{"name":"newReferralPerMille","type":"uint256"}],"name":"setRates","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"remainingTokens","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"account","type":"address"}],"name":"lastUpdate","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"referral","type":"address"}],"name":"getTokensWithReferral","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"totalDistributedTokens","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"getRecipientsLength","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"account","type":"address"}],"name":"receivedTokens","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"},{"constant":true,"inputs":[],"name":"token","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"account","type":"address"}],"name":"earnedByReferral","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"inputs":[{"name":"token","type":"address"},{"name":"dailyRate","type":"uint256"},{"name":"referralPerMille","type":"uint256"}],"payable":false,"stateMutability":"nonpayable","type":"constructor"},{"payable":true,"stateMutability":"payable","type":"fallback"},{"anonymous":false,"inputs":[{"indexed":true,"name":"previousOwner","type":"address"},{"indexed":true,"name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"}]

Contract Creation Code
60806040526201518060015534801561001757600080fd5b50604051606080610dc483398101604081815282516020840151919093015160008054600160a060020a031916331780825592939192600160a060020a0316917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908290a3600160a060020a038316151561009157600080fd5b6000821161009e57600080fd5b600081116100ab57600080fd5b60028054600160a060020a031916600160a060020a039490941693909317909255600355600455610ce3806100e16000396000f3006080604052600436106101275763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166318337012811461013c5780633b0f0f2f14610170578063661f905b146101915780636f1bfbb61461020257806370f23da714610235578063715018a61461025657806374df19c31461026b5780638980f11f146102805780638da5cb5b146102a45780638f32d59b146102b95780639303b0b8146102e2578063aa6ca808146102f7578063ac6af2801461030c578063bf58390314610327578063cb03fb1e1461033c578063d19c08ef1461035d578063db5084ab1461037e578063dbc3e35b14610393578063e2fdc845146103a8578063f2fde38b146103c9578063fc0c546a146103ea578063fea5ed16146103ff575b341561013257600080fd5b61013a610420565b005b34801561014857600080fd5b5061015460043561042d565b60408051600160a060020a039092168252519081900360200190f35b34801561017c57600080fd5b50610154600160a060020a0360043516610459565b34801561019d57600080fd5b506101b2600160a060020a036004351661047a565b60408051602080825283518183015283519192839290830191858101910280838360005b838110156101ee5781810151838201526020016101d6565b505050509050019250505060405180910390f35b34801561020e57600080fd5b50610223600160a060020a03600435166104f3565b60408051918252519081900360200190f35b34801561024157600080fd5b50610223600160a060020a0360043516610511565b34801561026257600080fd5b5061013a610560565b34801561027757600080fd5b506102236105ca565b34801561028c57600080fd5b5061013a600160a060020a03600435166024356105d0565b3480156102b057600080fd5b50610154610696565b3480156102c557600080fd5b506102ce6106a5565b604080519115158252519081900360200190f35b3480156102ee57600080fd5b506102236106b6565b34801561030357600080fd5b5061013a610420565b34801561031857600080fd5b5061013a6004356024356106e6565b34801561033357600080fd5b5061022361071e565b34801561034857600080fd5b50610223600160a060020a03600435166107b4565b34801561036957600080fd5b5061013a600160a060020a03600435166107d2565b34801561038a57600080fd5b506102236107f5565b34801561039f57600080fd5b506102236107fb565b3480156103b457600080fd5b50610223600160a060020a0360043516610801565b3480156103d557600080fd5b5061013a600160a060020a036004351661081f565b3480156103f657600080fd5b5061015461083b565b34801561040b57600080fd5b50610223600160a060020a036004351661084a565b61042b336000610865565b565b600060078281548110151561043e57fe5b600091825260209091200154600160a060020a031692915050565b600160a060020a039081166000908152600660205260409020600301541690565b600160a060020a0381166000908152600860209081526040918290206001018054835181840281018401909452808452606093928301828280156104e757602002820191906000526020600020905b8154600160a060020a031681526001909101906020018083116104c9575b50505050509050919050565b600160a060020a031660009081526008602052604090206001015490565b600160a060020a03811660009081526006602052604081205460ff161561055757600154600160a060020a0383166000908152600660205260409020600201540161055a565b60005b92915050565b6105686106a5565b151561057357600080fd5b60008054604051600160a060020a03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a36000805473ffffffffffffffffffffffffffffffffffffffff19169055565b60035490565b6105d86106a5565b15156105e357600080fd5b81600160a060020a031663a9059cbb6105fa610696565b836040518363ffffffff167c01000000000000000000000000000000000000000000000000000000000281526004018083600160a060020a0316600160a060020a0316815260200182815260200192505050602060405180830381600087803b15801561066657600080fd5b505af115801561067a573d6000803e3d6000fd5b505050506040513d602081101561069057600080fd5b50505050565b600054600160a060020a031690565b600054600160a060020a0316331490565b60006106e16103e86106d5600454600354610bcc90919063ffffffff16565b9063ffffffff610c0516565b905090565b6106ee6106a5565b15156106f957600080fd5b6000821161070657600080fd5b6000811161071357600080fd5b600391909155600455565b600254604080517f70a082310000000000000000000000000000000000000000000000000000000081523060048201529051600092600160a060020a0316916370a0823191602480830192602092919082900301818787803b15801561078357600080fd5b505af1158015610797573d6000803e3d6000fd5b505050506040513d60208110156107ad57600080fd5b5051905090565b600160a060020a031660009081526006602052604090206002015490565b600160a060020a0381163314156107e857600080fd5b6107f23382610865565b50565b60055490565b60075490565b600160a060020a031660009081526006602052604090206001015490565b6108276106a5565b151561083257600080fd5b6107f281610c28565b600254600160a060020a031690565b600160a060020a031660009081526008602052604090205490565b6000804261087285610511565b111561087d57600080fd5b600160a060020a03841660009081526006602052604090205460ff16151561097c576007805460018082019092557fa66cc928b5edb82af9bd49922954155ab7b0942694bea4ce44661d9a8736c68801805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a038781169182179092556000908152600660205260409020805460ff191690921790915583161561097c57600160a060020a038085166000818152600660209081526040808320600301805495891673ffffffffffffffffffffffffffffffffffffffff1996871681179091558352600882528220600190810180549182018155835291200180549092161790555b600160a060020a03841660009081526006602052604090204260028201556003546001909101546109b29163ffffffff610ca516565b600160a060020a0385166000908152600660205260409020600101556003546005546109e39163ffffffff610ca516565b600555600254600354604080517fa9059cbb000000000000000000000000000000000000000000000000000000008152600160a060020a03888116600483015260248201939093529051919092169163a9059cbb9160448083019260209291908290030181600087803b158015610a5957600080fd5b505af1158015610a6d573d6000803e3d6000fd5b505050506040513d6020811015610a8357600080fd5b5050600160a060020a03848116600090815260066020526040902060030154161561069057600160a060020a03808516600090815260066020526040902060030154169150610ad06106b6565b600160a060020a038316600090815260086020526040902054909150610afc908263ffffffff610ca516565b600160a060020a038316600090815260086020526040902055600554610b28908263ffffffff610ca516565b600555600254604080517fa9059cbb000000000000000000000000000000000000000000000000000000008152600160a060020a038581166004830152602482018590529151919092169163a9059cbb9160448083019260209291908290030181600087803b158015610b9a57600080fd5b505af1158015610bae573d6000803e3d6000fd5b505050506040513d6020811015610bc457600080fd5b505050505050565b600080831515610bdf5760009150610bfe565b50828202828482811515610bef57fe5b0414610bfa57600080fd5b8091505b5092915050565b600080808311610c1457600080fd5b8284811515610c1f57fe5b04949350505050565b600160a060020a0381161515610c3d57600080fd5b60008054604051600160a060020a03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a36000805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b600082820183811015610bfa57600080fd00a165627a7a723058202098e72278c4dff3ef9274de7eae036b9f29d50c999ebd224accc4f466deed88002900000000000000000000000093a7174dafd31d13400cd9fa01f4e5b5baa00d390000000000000000000000000000000000000000000000004563918244f400000000000000000000000000000000000000000000000000000000000000000064


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

-----Encoded View---------------
3 Constructor Arguments found :
Arg [0] : 00000000000000000000000093a7174dafd31d13400cd9fa01f4e5b5baa00d39
Arg [1] : 0000000000000000000000000000000000000000000000004563918244f40000
Arg [2] : 0000000000000000000000000000000000000000000000000000000000000064


   Swarm Source:
bzzr://2098e72278c4dff3ef9274de7eae036b9f29d50c999ebd224accc4f466deed88
Block Age transaction Difficulty GasUsed Reward
Block Age Uncle Number Difficulty GasUsed Reward
Make sure to use the "Vote Down" button for any spammy posts, and the "Vote Up" for interesting conversations.