Contract 0xE19866986976E84b2C2691169C9F9B1bAA433893 1

 
 
Txn Hash
Method
Block
From
To
Value
0x7a47296f1abe013a1a7e929a1087d0c9176b47e6ecf8707ff85b6d1265ee3655Buy Boxs66055852018-10-29 13:35:401493 days 8 hrs ago0x70522079447b80da4981dac3c1dc6a5840f3c2ef IN  0xe19866986976e84b2c2691169c9f9b1baa4338930.1 Ether0.000122325
0xb5228669710a9132f8c6a57918e9bea9db1367b44af8e03a2f1f97887b5a1f7aBuy Boxs66055812018-10-29 13:35:191493 days 8 hrs ago0x70522079447b80da4981dac3c1dc6a5840f3c2ef IN  0xe19866986976e84b2c2691169c9f9b1baa4338930.1 Ether0.0002446410
0xf39ec1a8b235fb059a7e9662def83a06b2ca226781e22476e929a8d20d09a501Buy Boxs66055792018-10-29 13:34:591493 days 8 hrs ago0x70522079447b80da4981dac3c1dc6a5840f3c2ef IN  0xe19866986976e84b2c2691169c9f9b1baa4338930.1 Ether0.000171247
0x09b4559c4dfd00256e7061489779c44ae7b25de921af2fe86cd3d56e9704301fBuy Boxs66055762018-10-29 13:34:311493 days 8 hrs ago0x70522079447b80da4981dac3c1dc6a5840f3c2ef IN  0xe19866986976e84b2c2691169c9f9b1baa4338930.1 Ether0.00013215.4
0x6585fee7cfa5e8194f94061505acd7c3ae9771219d9b4475dfba3241293b1c6cBuy Boxs66055742018-10-29 13:34:061493 days 8 hrs ago0x70522079447b80da4981dac3c1dc6a5840f3c2ef IN  0xe19866986976e84b2c2691169c9f9b1baa4338930.1 Ether0.00013215.4
0x4464d8f2907bc24f96934836e8d0371ede656a3eec4df0bffa1f9f582b539427Buy Boxs66053282018-10-29 12:41:131493 days 8 hrs ago0xadcade70ea746abeb8a17a7917eeabfc67c1cbdb IN  0xe19866986976e84b2c2691169c9f9b1baa4338930.25 Ether0.000134555.5
0x495caf0fe02c388aee66bdbe9e01b30ca1d5b62aca308edec68bb3eab41276e3Buy Boxs66053152018-10-29 12:38:391493 days 8 hrs ago0xadcade70ea746abeb8a17a7917eeabfc67c1cbdb IN  0xe19866986976e84b2c2691169c9f9b1baa4338930.4 Ether0.000102744.2
0xd933e0906f388ee333c71799fdd9e46e8db15aafbd0364fd5e6398fd9979efc9Buy Boxs66053152018-10-29 12:38:391493 days 8 hrs ago0xadcade70ea746abeb8a17a7917eeabfc67c1cbdb IN  0xe19866986976e84b2c2691169c9f9b1baa4338930.25 Ether0.000102744.2
0x77a949e80f271356ea9a33b3b9926f24975643bced7cbbbdfcd33de6c9b177f9Buy Boxs66053152018-10-29 12:38:391493 days 8 hrs ago0xadcade70ea746abeb8a17a7917eeabfc67c1cbdb IN  0xe19866986976e84b2c2691169c9f9b1baa4338930.05 Ether0.00020068.2
0xcdeceb435dd8cfbde25a4fa02ad37d97f0f38c5ded48446c0c95ca7f565470a8Buy Boxs66053152018-10-29 12:38:391493 days 8 hrs ago0xadcade70ea746abeb8a17a7917eeabfc67c1cbdb IN  0xe19866986976e84b2c2691169c9f9b1baa4338930.25 Ether0.000104734.28125
0xf1948139036592c496f1b2d581af11eebb557c01a304ae2796a10acf27a8abf9Buy Boxs66053122018-10-29 12:38:031493 days 8 hrs ago0xadcade70ea746abeb8a17a7917eeabfc67c1cbdb IN  0xe19866986976e84b2c2691169c9f9b1baa4338930.4 Ether0.000153666.28125
0x4330b336fa4d8a68566584d0fef4263101d117952e318877c5bfe052050d16e3Buy Boxs66053112018-10-29 12:37:551493 days 9 hrs ago0xadcade70ea746abeb8a17a7917eeabfc67c1cbdb IN  0xe19866986976e84b2c2691169c9f9b1baa4338930.45 Ether0.000269111
0x3c468783f302e824a7567ecc0e6f1a717c924abadac3915309169ce73116a953Buy Boxs66053112018-10-29 12:37:551493 days 9 hrs ago0xadcade70ea746abeb8a17a7917eeabfc67c1cbdb IN  0xe19866986976e84b2c2691169c9f9b1baa4338930.45 Ether0.000171247
0x4879ea0481645588185c93a1f666261f6c819ae087b60dadcb7b7fa9c6d2f682Buy Boxs66053062018-10-29 12:36:181493 days 9 hrs ago0xadcade70ea746abeb8a17a7917eeabfc67c1cbdb IN  0xe19866986976e84b2c2691169c9f9b1baa4338930.45 Ether0.000110084.5
0x5a304a8f3b04be6f364f8fa78cf19a6a78a63d71570712b831ebf3cc11c37fb7Buy Boxs66053062018-10-29 12:36:181493 days 9 hrs ago0xadcade70ea746abeb8a17a7917eeabfc67c1cbdb IN  0xe19866986976e84b2c2691169c9f9b1baa4338931.5 Ether0.00014556
0xebe379b08d3f6d8dbf76a9dc6904796029a07239c1e023162b5d5b1bcf335359Buy Boxs66053032018-10-29 12:35:231493 days 9 hrs ago0xadcade70ea746abeb8a17a7917eeabfc67c1cbdb IN  0xe19866986976e84b2c2691169c9f9b1baa4338931.5 Ether0.0000974
0xaa6a7974bfe89c2f722ffdf987f78ed7dc759c9f86ed345928bfaaf992b90ad8Buy Boxs66052872018-10-29 12:31:471493 days 9 hrs ago0xadcade70ea746abeb8a17a7917eeabfc67c1cbdb IN  0xe19866986976e84b2c2691169c9f9b1baa4338931.5 Ether0.0000974
0x9cda5e10c26a7dee886caba8b60065fa7c61c9f3d8566fa7447de0dc1833462bBuy Boxs66052742018-10-29 12:29:001493 days 9 hrs ago0xadcade70ea746abeb8a17a7917eeabfc67c1cbdb IN  0xe19866986976e84b2c2691169c9f9b1baa4338931.5 Ether0.0000974
0x7d2179fe096afe8cd87499e614ec19cf7c210205612378a82c2742209dbec975Buy Boxs66052592018-10-29 12:22:171493 days 9 hrs ago0xadcade70ea746abeb8a17a7917eeabfc67c1cbdb IN  0xe19866986976e84b2c2691169c9f9b1baa4338931.5 Ether0.0000974
0xaf9b39b371e70e536e05a698ce115885f8d554688c5bd71f5458bd984da4f82eBuy Boxs66052592018-10-29 12:22:171493 days 9 hrs ago0xadcade70ea746abeb8a17a7917eeabfc67c1cbdb IN  0xe19866986976e84b2c2691169c9f9b1baa4338931.5 Ether0.0000974
0x6657895474805b80af14dc9db2bbc1c188c22eefd808b25eff146a0814f197c0Buy Boxs66052532018-10-29 12:20:491493 days 9 hrs ago0xadcade70ea746abeb8a17a7917eeabfc67c1cbdb IN  0xe19866986976e84b2c2691169c9f9b1baa4338931.5 Ether0.0000974
0x8a8abddd098d5e757e46ead981bcbcbd65c8e9bd2b9c23637b43eb7693c85062Buy Boxs66052502018-10-29 12:20:141493 days 9 hrs ago0xadcade70ea746abeb8a17a7917eeabfc67c1cbdb IN  0xe19866986976e84b2c2691169c9f9b1baa4338931.5 Ether0.0000974
0x1985307e543efc8b71aa14cb78883f15f3819ddf697d1010cb229563db12a73bBuy Boxs66052422018-10-29 12:18:201493 days 9 hrs ago0xadcade70ea746abeb8a17a7917eeabfc67c1cbdb IN  0xe19866986976e84b2c2691169c9f9b1baa4338931.5 Ether0.0000974
0x2833cafaf1b44f1572082f2d7337f2aabb716dcb5acf35336d9f8d7a978ee4bbBuy Boxs66052402018-10-29 12:17:541493 days 9 hrs ago0xadcade70ea746abeb8a17a7917eeabfc67c1cbdb IN  0xe19866986976e84b2c2691169c9f9b1baa4338931.5 Ether0.0000974
0xf05c2f5bb74f3b60777100afdce4431fbefe3a43c895709c8435463d77b43534Buy Boxs66052372018-10-29 12:17:191493 days 9 hrs ago0xadcade70ea746abeb8a17a7917eeabfc67c1cbdb IN  0xe19866986976e84b2c2691169c9f9b1baa4338931.5 Ether0.0000974
[ Download CSV Export 
Latest 25 internal transaction
Parent Txn Hash Block From To Value
0x4c837aebb1dcff85429556825b25cc1aa2dcd42c1937b6ef5b1774862ff248c763757682018-09-22 1:12:261530 days 20 hrs ago 0xe19866986976e84b2c2691169c9f9b1baa433893 0x4710573b853fdd3561cb4f60ec9394f0155d51052.85 Ether
0xc2de7b581f477f04e7afb9304f44b8bd5be4132c88ea09550b87a081267e0d9d63757602018-09-22 1:10:221530 days 20 hrs ago 0xe19866986976e84b2c2691169c9f9b1baa433893 0x4710573b853fdd3561cb4f60ec9394f0155d51054.45 Ether
0xe2e09ae744741fd29fa1e4a04d0a88906621308290630103ff0be0305108496d63757282018-09-22 1:03:101530 days 20 hrs ago 0xe19866986976e84b2c2691169c9f9b1baa433893 0x4710573b853fdd3561cb4f60ec9394f0155d51050.75 Ether
0xa6a25ae9cf7e61659c4e416d3b9abf2ebb8d18a601f53e90ded468eb67b883fd63738052018-09-21 17:48:101531 days 3 hrs ago 0xe19866986976e84b2c2691169c9f9b1baa433893 0x4710573b853fdd3561cb4f60ec9394f0155d51055 Ether
0xf32b318ee870a30e02fba3b876897faa9cbafe35fdd1bd616959f140f0da5bbb63736692018-09-21 17:13:461531 days 4 hrs ago 0xe19866986976e84b2c2691169c9f9b1baa433893 0x4710573b853fdd3561cb4f60ec9394f0155d51053.95 Ether
0xff94f627b29e0a66bb0c87e03d3931624fab196e1bc421327862785427f5ee7f63736502018-09-21 17:10:041531 days 4 hrs ago 0xe19866986976e84b2c2691169c9f9b1baa433893 0x4710573b853fdd3561cb4f60ec9394f0155d51055 Ether
0x1a08e66ba495b60e02bbad86be3c1659db026708ec4ccc598a0c573fa955591b63722492018-09-21 11:37:491531 days 10 hrs ago 0xe19866986976e84b2c2691169c9f9b1baa433893 0x4710573b853fdd3561cb4f60ec9394f0155d51050.3 Ether
0x5361fc60c376c9283bc860c3bbdbe890481d6dfae79d00334bfee323c488470963720322018-09-21 10:43:401531 days 10 hrs ago 0xe19866986976e84b2c2691169c9f9b1baa433893 0x4710573b853fdd3561cb4f60ec9394f0155d51050.35 Ether
0x0d8f06aa9354f868ad2708daf061d6a165b91bb32cfe386073fd492ddc6ef46363715872018-09-21 8:53:401531 days 12 hrs ago 0xe19866986976e84b2c2691169c9f9b1baa433893 0x4710573b853fdd3561cb4f60ec9394f0155d51050.1 Ether
0x04a4a0c4929ea740b3878eac10187b373000568cbabd08b283af584d73fad54e63715572018-09-21 8:46:471531 days 12 hrs ago 0xe19866986976e84b2c2691169c9f9b1baa433893 0x4710573b853fdd3561cb4f60ec9394f0155d51050.05 Ether
0x83588ad59ae9634f3004bee2498a37f0931c0edad8eb3741d2927e8b255f01fb63714942018-09-21 8:29:351531 days 13 hrs ago 0xe19866986976e84b2c2691169c9f9b1baa433893 0x4710573b853fdd3561cb4f60ec9394f0155d51050.1 Ether
0xea40f07aa68a80db0a561fe432a4c4d02a72d97869ae13ed5acd77385e29314663712302018-09-21 7:25:381531 days 14 hrs ago 0xe19866986976e84b2c2691169c9f9b1baa433893 0x4710573b853fdd3561cb4f60ec9394f0155d51050.25 Ether
0x22db68c66f7faba5e0dda57ab97704c8f4b2fda82db45dcded82a7ad2e4f086263676882018-09-20 17:11:471532 days 4 hrs ago 0xe19866986976e84b2c2691169c9f9b1baa433893 0x4710573b853fdd3561cb4f60ec9394f0155d51055 Ether
0x14fc6c8686dce929cbb6986b334a52c4b59a45953864f402650ce9d480edb3c063674552018-09-20 16:19:061532 days 5 hrs ago 0xe19866986976e84b2c2691169c9f9b1baa433893 0x4710573b853fdd3561cb4f60ec9394f0155d51050.35 Ether
0x8e7a16ceaf87dda8419464e371358d6b3d7be1df47c44253249ef32a8a7661ef63670852018-09-20 14:45:361532 days 6 hrs ago 0xe19866986976e84b2c2691169c9f9b1baa433893 0x4710573b853fdd3561cb4f60ec9394f0155d51050.5 Ether
0x19ea9881ca8353495dfd213e5f40ca04a0a324524c57df97cbf101d89ab6a11e63670592018-09-20 14:40:071532 days 6 hrs ago 0xe19866986976e84b2c2691169c9f9b1baa433893 0x4710573b853fdd3561cb4f60ec9394f0155d51050.9 Ether
0x026bac3d637a97c49e672cf17379b8aa2080f5e4dd9b37c94bd9a27af9a0fb8063661012018-09-20 10:51:481532 days 10 hrs ago 0xe19866986976e84b2c2691169c9f9b1baa433893 0x4710573b853fdd3561cb4f60ec9394f0155d51050.05 Ether
0xfa09ebc8a5713d6f3d2766c7ab550aa1f86fe741def72c01213c7a744afba15463659432018-09-20 10:15:161532 days 11 hrs ago 0xe19866986976e84b2c2691169c9f9b1baa433893 0x4710573b853fdd3561cb4f60ec9394f0155d51050.05 Ether
0x65712d18817775a11ff55c57a2979d4bfcb2f46c6074d10b6516668a1e3aca8063657032018-09-20 9:21:241532 days 12 hrs ago 0xe19866986976e84b2c2691169c9f9b1baa433893 0x4710573b853fdd3561cb4f60ec9394f0155d51050.05 Ether
0xecc1a901e1674caf28ce78aac706cd762fb24db324a7c4a4e5de2378aba42ae463656802018-09-20 9:14:331532 days 12 hrs ago 0xe19866986976e84b2c2691169c9f9b1baa433893 0x4710573b853fdd3561cb4f60ec9394f0155d51050.05 Ether
0xf143b2bf40686376eb9582f5a95ec10d8417b51a24db3532dffa44eb5a09df9963656572018-09-20 9:07:471532 days 12 hrs ago 0xe19866986976e84b2c2691169c9f9b1baa433893 0x4710573b853fdd3561cb4f60ec9394f0155d51050.1 Ether
0x93433eb7b5f477fbadb46ce54de8b478c4343e8143861b0c27e28913727e11d463650622018-09-20 6:43:151532 days 14 hrs ago 0xe19866986976e84b2c2691169c9f9b1baa433893 0x4710573b853fdd3561cb4f60ec9394f0155d51050.15 Ether
0xa733d5290ebfb098526651647071d5899e5d380074b544f1e6b8c79aef32abe663638672018-09-20 2:01:001532 days 19 hrs ago 0xe19866986976e84b2c2691169c9f9b1baa433893 0x4710573b853fdd3561cb4f60ec9394f0155d51051.05 Ether
0x036637fa014dbdcb0fdf867fa778235d6731f057722f80c47885d25f157e949163636702018-09-20 1:11:361532 days 20 hrs ago 0xe19866986976e84b2c2691169c9f9b1baa433893 0x4710573b853fdd3561cb4f60ec9394f0155d51050.1 Ether
0xbcfe0a0d4007d887a46f70a96a88cb5adf2041604dde69c1f040ae781928a4f763601122018-09-19 11:11:411533 days 10 hrs ago 0xe19866986976e84b2c2691169c9f9b1baa433893 0x4710573b853fdd3561cb4f60ec9394f0155d51050.05 Ether
[ Download CSV Export 
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
LuckyBox

Compiler Version
v0.4.24+commit.e67f0147

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion
/**
 *Submitted for verification at Etherscan.io on 2018-09-05
*/

pragma solidity ^0.4.24;

// 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 public owner;


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


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

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

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

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

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

// File: openzeppelin-solidity/contracts/lifecycle/Pausable.sol

/**
 * @title Pausable
 * @dev Base contract which allows children to implement an emergency stop mechanism.
 */
contract Pausable is Ownable {
  event Pause();
  event Unpause();

  bool public paused = false;


  /**
   * @dev Modifier to make a function callable only when the contract is not paused.
   */
  modifier whenNotPaused() {
    require(!paused);
    _;
  }

  /**
   * @dev Modifier to make a function callable only when the contract is paused.
   */
  modifier whenPaused() {
    require(paused);
    _;
  }

  /**
   * @dev called by the owner to pause, triggers stopped state
   */
  function pause() public onlyOwner whenNotPaused {
    paused = true;
    emit Pause();
  }

  /**
   * @dev called by the owner to unpause, returns to normal state
   */
  function unpause() public onlyOwner whenPaused {
    paused = false;
    emit Unpause();
  }
}

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

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

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

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

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

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

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

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

/**
 * @title ERC20Basic
 * @dev Simpler version of ERC20 interface
 * See https://github.com/ethereum/EIPs/issues/179
 */
contract ERC20Basic {
  function totalSupply() public view returns (uint256);
  function balanceOf(address _who) public view returns (uint256);
  function transfer(address _to, uint256 _value) public returns (bool);
  event Transfer(address indexed from, address indexed to, uint256 value);
}

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

/**
 * @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
  );
}

// File: contracts/luckybox/LuckyBox.sol

contract LuckyBox is Pausable {
    using SafeMath for *;

    uint256 public goldBoxAmountForSale;
    uint256 public silverBoxAmountForSale;

    uint256 public goldBoxPrice;    // amount of eth for each gold bag.
    uint256 public silverBoxPrice;

    address public wallet;

    mapping (address => uint256) public goldSalesRecord;
    mapping (address => uint256) public silverSalesRecord;

    uint256 public goldSaleLimit;
    uint256 public silverSaleLimit;

    constructor(address _wallet, uint256 _goldBoxAmountForSale, uint256 _silverBoxAmountForSale) public
    {
        require(_wallet != address(0), "need a good wallet to store fund");
        require(_goldBoxAmountForSale > 0, "Gold bag amount need to be no-zero");
        require(_silverBoxAmountForSale > 0, "Silver bag amount need to be no-zero");

        wallet = _wallet;
        goldBoxAmountForSale = _goldBoxAmountForSale;
        silverBoxAmountForSale = _silverBoxAmountForSale;

        goldSaleLimit = 10;
        silverSaleLimit = 100;
    }

    function buyBoxs(address _buyer, uint256 _goldBoxAmount, uint256 _silverBoxAmount) payable public whenNotPaused {
        require(_buyer != address(0));
        require(_goldBoxAmount <= goldBoxAmountForSale && _silverBoxAmount <= silverBoxAmountForSale);
        require(goldSalesRecord[_buyer] + _goldBoxAmount <= goldSaleLimit);
        require(silverSalesRecord[_buyer] + _silverBoxAmount <= silverSaleLimit);

        uint256 charge = _goldBoxAmount.mul(goldBoxPrice).add(_silverBoxAmount.mul(silverBoxPrice));
        require(msg.value >= charge, "No enough ether for buying lucky bags.");
        require(_goldBoxAmount > 0 || _silverBoxAmount > 0);

        if (_goldBoxAmount > 0)
        {
            goldBoxAmountForSale = goldBoxAmountForSale.sub(_goldBoxAmount);
            goldSalesRecord[_buyer] += _goldBoxAmount;
            emit GoldBoxSale(_buyer, _goldBoxAmount, goldBoxPrice);
        }

        if (_silverBoxAmount > 0)
        {
            silverBoxAmountForSale = silverBoxAmountForSale.sub(_silverBoxAmount);
            silverSalesRecord[_buyer] += _silverBoxAmount;
            emit SilverBoxSale(_buyer, _silverBoxAmount, silverBoxPrice);
        }

        wallet.transfer(charge);

        if (msg.value > charge)
        {
            uint256 weiToRefund = msg.value.sub(charge);
            _buyer.transfer(weiToRefund);
            emit EthRefunded(_buyer, weiToRefund);
        }
    }

    function buyBoxs(uint256 _goldBoxAmount, uint256 _silverBoxAmount) payable public whenNotPaused {
        buyBoxs(msg.sender, _goldBoxAmount, _silverBoxAmount);
    }

    function updateGoldBoxAmountAndPrice(uint256 _goldBoxAmountForSale, uint256 _goldBoxPrice, uint256 _goldLimit) public onlyOwner {
        goldBoxAmountForSale = _goldBoxAmountForSale;
        goldBoxPrice = _goldBoxPrice;
        goldSaleLimit = _goldLimit;
    }

    function updateSilverBoxAmountAndPrice(uint256 _silverBoxAmountForSale, uint256 _silverBoxPrice, uint256 _silverLimit) public onlyOwner {
        silverBoxAmountForSale = _silverBoxAmountForSale;
        silverBoxPrice = _silverBoxPrice;
        silverSaleLimit = _silverLimit;
    }


//////////
// Safety Methods
//////////

    /// @notice This method can be used by the controller to extract mistakenly
    ///  sent tokens to this contract.
    /// @param _token The address of the token contract that you want to recover
    ///  set to 0 in case you want to extract ether.
    function claimTokens(address _token) onlyOwner public {
      if (_token == 0x0) {
          owner.transfer(address(this).balance);
          return;
      }

      ERC20 token = ERC20(_token);
      uint balance = token.balanceOf(this);
      token.transfer(owner, balance);

      emit ClaimedTokens(_token, owner, balance);
    }


    event GoldBoxSale(address indexed _user, uint256 _amount, uint256 _price);
    
    event SilverBoxSale(address indexed _user, uint256 _amount, uint256 _price);

    event EthRefunded(address indexed buyer, uint256 value);

    event ClaimedTokens(address indexed _token, address indexed _to, uint _amount);

}

Contract Security Audit

Contract ABI

[{"constant":true,"inputs":[],"name":"goldSaleLimit","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[],"name":"unpause","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"wallet","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"paused","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"goldBoxPrice","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[],"name":"renounceOwnership","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[],"name":"pause","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"owner","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_silverBoxAmountForSale","type":"uint256"},{"name":"_silverBoxPrice","type":"uint256"},{"name":"_silverLimit","type":"uint256"}],"name":"updateSilverBoxAmountAndPrice","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"","type":"address"}],"name":"silverSalesRecord","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_goldBoxAmountForSale","type":"uint256"},{"name":"_goldBoxPrice","type":"uint256"},{"name":"_goldLimit","type":"uint256"}],"name":"updateGoldBoxAmountAndPrice","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"silverSaleLimit","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"silverBoxAmountForSale","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"goldBoxAmountForSale","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"silverBoxPrice","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_goldBoxAmount","type":"uint256"},{"name":"_silverBoxAmount","type":"uint256"}],"name":"buyBoxs","outputs":[],"payable":true,"stateMutability":"payable","type":"function"},{"constant":false,"inputs":[{"name":"_token","type":"address"}],"name":"claimTokens","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"","type":"address"}],"name":"goldSalesRecord","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_buyer","type":"address"},{"name":"_goldBoxAmount","type":"uint256"},{"name":"_silverBoxAmount","type":"uint256"}],"name":"buyBoxs","outputs":[],"payable":true,"stateMutability":"payable","type":"function"},{"constant":false,"inputs":[{"name":"_newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"inputs":[{"name":"_wallet","type":"address"},{"name":"_goldBoxAmountForSale","type":"uint256"},{"name":"_silverBoxAmountForSale","type":"uint256"}],"payable":false,"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"name":"_user","type":"address"},{"indexed":false,"name":"_amount","type":"uint256"},{"indexed":false,"name":"_price","type":"uint256"}],"name":"GoldBoxSale","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"_user","type":"address"},{"indexed":false,"name":"_amount","type":"uint256"},{"indexed":false,"name":"_price","type":"uint256"}],"name":"SilverBoxSale","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"buyer","type":"address"},{"indexed":false,"name":"value","type":"uint256"}],"name":"EthRefunded","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"_token","type":"address"},{"indexed":true,"name":"_to","type":"address"},{"indexed":false,"name":"_amount","type":"uint256"}],"name":"ClaimedTokens","type":"event"},{"anonymous":false,"inputs":[],"name":"Pause","type":"event"},{"anonymous":false,"inputs":[],"name":"Unpause","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"previousOwner","type":"address"}],"name":"OwnershipRenounced","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"previousOwner","type":"address"},{"indexed":true,"name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"}]

60806040526000805460a060020a60ff021916905534801561002057600080fd5b50604051606080610e0683398101604090815281516020830151919092015160008054600160a060020a03191633179055600160a060020a03831615156100c857604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f6e656564206120676f6f642077616c6c657420746f2073746f72652066756e64604482015290519081900360640190fd5b6000821161015d57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602260248201527f476f6c642062616720616d6f756e74206e65656420746f206265206e6f2d7a6560448201527f726f000000000000000000000000000000000000000000000000000000000000606482015290519081900360840190fd5b600081116101f157604080517f08c379a0000000000000000000000000000000000000000000000000000000008152602060048201526024808201527f53696c7665722062616720616d6f756e74206e65656420746f206265206e6f2d60448201527f7a65726f00000000000000000000000000000000000000000000000000000000606482015290519081900360840190fd5b60058054600160a060020a031916600160a060020a039490941693909317909255600155600255600a6008556064600955610bd5806102316000396000f3006080604052600436106101115763ffffffff7c01000000000000000000000000000000000000000000000000000000006000350416633284627081146101165780633f4ba83a1461013d578063521eb273146101545780635c975abb1461018557806366b464de146101ae578063715018a6146101c35780638456cb59146101d85780638da5cb5b146101ed5780639dafe5f014610202578063a5ddff8314610220578063b3e19c1e14610241578063b48666ee1461025f578063b5aece0214610274578063c42cb81914610289578063c6180d271461029e578063c65af3f5146102b3578063df8de3e7146102c1578063e1087aa7146102e2578063f2a08d0b14610303578063f2fde38b1461031d575b600080fd5b34801561012257600080fd5b5061012b61033e565b60408051918252519081900360200190f35b34801561014957600080fd5b50610152610344565b005b34801561016057600080fd5b506101696103ba565b60408051600160a060020a039092168252519081900360200190f35b34801561019157600080fd5b5061019a6103c9565b604080519115158252519081900360200190f35b3480156101ba57600080fd5b5061012b6103d9565b3480156101cf57600080fd5b506101526103df565b3480156101e457600080fd5b5061015261044b565b3480156101f957600080fd5b506101696104c6565b34801561020e57600080fd5b506101526004356024356044356104d5565b34801561022c57600080fd5b5061012b600160a060020a03600435166104fa565b34801561024d57600080fd5b5061015260043560243560443561050c565b34801561026b57600080fd5b5061012b610531565b34801561028057600080fd5b5061012b610537565b34801561029557600080fd5b5061012b61053d565b3480156102aa57600080fd5b5061012b610543565b610152600435602435610549565b3480156102cd57600080fd5b50610152600160a060020a036004351661056f565b3480156102ee57600080fd5b5061012b600160a060020a0360043516610756565b610152600160a060020a0360043516602435604435610768565b34801561032957600080fd5b50610152600160a060020a0360043516610abb565b60085481565b600054600160a060020a0316331461035b57600080fd5b60005460a060020a900460ff16151561037357600080fd5b6000805474ff0000000000000000000000000000000000000000191681556040517f7805862f689e2f13df9f062ff482ad3ad112aca9e0847911ed832e158c525b339190a1565b600554600160a060020a031681565b60005460a060020a900460ff1681565b60035481565b600054600160a060020a031633146103f657600080fd5b60008054604051600160a060020a03909116917ff8df31144d9c2f0f6b59d69b8b98abd5459d07f2742c4df920b25aae33c6482091a26000805473ffffffffffffffffffffffffffffffffffffffff19169055565b600054600160a060020a0316331461046257600080fd5b60005460a060020a900460ff161561047957600080fd5b6000805474ff0000000000000000000000000000000000000000191660a060020a1781556040517f6985a02210a168e66602d3235cb6db0e70f92b3ba4d376a33c0f3d9434bff6259190a1565b600054600160a060020a031681565b600054600160a060020a031633146104ec57600080fd5b600292909255600455600955565b60076020526000908152604090205481565b600054600160a060020a0316331461052357600080fd5b600192909255600355600855565b60095481565b60025481565b60015481565b60045481565b60005460a060020a900460ff161561056057600080fd5b61056b338383610768565b5050565b600080548190600160a060020a0316331461058957600080fd5b600160a060020a03831615156105da5760008054604051600160a060020a0390911691303180156108fc02929091818181858888f193505050501580156105d4573d6000803e3d6000fd5b50610751565b604080517f70a082310000000000000000000000000000000000000000000000000000000081523060048201529051849350600160a060020a038416916370a082319160248083019260209291908290030181600087803b15801561063e57600080fd5b505af1158015610652573d6000803e3d6000fd5b505050506040513d602081101561066857600080fd5b505160008054604080517fa9059cbb000000000000000000000000000000000000000000000000000000008152600160a060020a0392831660048201526024810185905290519394509085169263a9059cbb92604480840193602093929083900390910190829087803b1580156106de57600080fd5b505af11580156106f2573d6000803e3d6000fd5b505050506040513d602081101561070857600080fd5b5050600054604080518381529051600160a060020a03928316928616917ff931edb47c50b4b4104c187b5814a9aef5f709e17e2ecf9617e860cacade929c919081900360200190a35b505050565b60066020526000908152604090205481565b60008054819060a060020a900460ff161561078257600080fd5b600160a060020a038516151561079757600080fd5b60015484111580156107ab57506002548311155b15156107b657600080fd5b600854600160a060020a038616600090815260066020526040902054850111156107df57600080fd5b600954600160a060020a0386166000908152600760205260409020548401111561080857600080fd5b61084061082060045485610ade90919063ffffffff16565b60035461083490879063ffffffff610ade16565b9063ffffffff610b0d16565b9150348211156108d757604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f4e6f20656e6f75676820657468657220666f7220627579696e67206c75636b7960448201527f20626167732e0000000000000000000000000000000000000000000000000000606482015290519081900360840190fd5b60008411806108e65750600083115b15156108f157600080fd5b600084111561096c5760015461090d908563ffffffff610b1a16565b600155600160a060020a03851660008181526006602090815260409182902080548801905560035482518881529182015281517febf5045b46d5017e80c6c7cb4620d753d3c68fad99b673ddde3b63f82d019d56929181900390910190a25b60008311156109e757600254610988908463ffffffff610b1a16565b600255600160a060020a03851660008181526007602090815260409182902080548701905560045482518781529182015281517fba6ad43450a5c89e76b27315def4d5e0bafeba1f915c0089779d789e59b00153929181900390910190a25b600554604051600160a060020a039091169083156108fc029084906000818181858888f19350505050158015610a21573d6000803e3d6000fd5b5081341115610ab457610a3a348363ffffffff610b1a16565b604051909150600160a060020a0386169082156108fc029083906000818181858888f19350505050158015610a73573d6000803e3d6000fd5b50604080518281529051600160a060020a038716917fffab3269bdaceca4d1bbc53e74b982ac2b306687e17e21f1e499e7fdf6751ac8919081900360200190a25b5050505050565b600054600160a060020a03163314610ad257600080fd5b610adb81610b2c565b50565b6000821515610aef57506000610b07565b50818102818382811515610aff57fe5b0414610b0757fe5b92915050565b81810182811015610b0757fe5b600082821115610b2657fe5b50900390565b600160a060020a0381161515610b4157600080fd5b60008054604051600160a060020a03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a36000805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a03929092169190911790555600a165627a7a72305820bd5baecaec99e2d28aacef94dd8f2c6af71c336f843a6eca11f988fcf3d10d3000290000000000000000000000004710573b853fdd3561cb4f60ec9394f0155d510500000000000000000000000000000000000000000000000000000000000001f40000000000000000000000000000000000000000000000000000000000001388

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

0000000000000000000000004710573b853fdd3561cb4f60ec9394f0155d510500000000000000000000000000000000000000000000000000000000000001f40000000000000000000000000000000000000000000000000000000000001388

-----Decoded View---------------
Arg [0] : _wallet (address): 0x4710573B853fDD3561cb4F60EC9394f0155d5105
Arg [1] : _goldBoxAmountForSale (uint256): 500
Arg [2] : _silverBoxAmountForSale (uint256): 5000

-----Encoded View---------------
3 Constructor Arguments found :
Arg [0] : 0000000000000000000000004710573b853fdd3561cb4f60ec9394f0155d5105
Arg [1] : 00000000000000000000000000000000000000000000000000000000000001f4
Arg [2] : 0000000000000000000000000000000000000000000000000000000000001388


Swarm Source

bzzr://bd5baecaec99e2d28aacef94dd8f2c6af71c336f843a6eca11f988fcf3d10d30
Block Transaction Difficulty Gas Used Reward
Block Uncle Number Difficulty Gas Used Reward
Loading
Loading
Make sure to use the "Vote Down" button for any spammy posts, and the "Vote Up" for interesting conversations.

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