Contract 0xb66041c5accc99fccce8e4f06074ac52c9c556dd

 

Contract Overview

Balance:
0.555357375121908345 Ether

EtherValue:
$70.22 (@ $126.44/ETH)
TxHash Block Age From To Value [TxFee]
0x124e9e90a6e02e9a4d7ef1d73c971cf1f23b8027a5b598c67ef42451fd1829e5709379228 days 19 hrs ago0x57fcc23ad10fa6196559aea71d580a89740c9133  IN   0xb66041c5accc99fccce8e4f06074ac52c9c556dd0 Ether0.000267132
0xd8aa883bbcd9219eca61dccf55410b0f1d593abf1adf68f73be7d2bd910082e0709378228 days 20 hrs ago0x7dbbc284f202b06b8386ff8af96a07a7f30f387f  IN   0xb66041c5accc99fccce8e4f06074ac52c9c556dd0 Ether0.000066783
0xe3340c3b27aaaca61176c0c1dbe00a51ae8e7bff4d71e50c2efe02c71e344ef4709376028 days 20 hrs ago0x3130259deedb3052e24fad9d5e1f490cb8cccaa0  IN   0xb66041c5accc99fccce8e4f06074ac52c9c556dd0 Ether0.000111305
0x852f3f3f2253da48bdb1a962d8ae3fef40047ee7a6c0b3e0cf9d8e25ee5bde57694993254 days 1 hr ago0xff107821cb2a1671531f284313ebcd0a569c3148  IN   0xb66041c5accc99fccce8e4f06074ac52c9c556dd0 Ether0.000200349
0xc4f7792a74af3cdc4373b3c9191007d7c9010d7a60ecceaaad2057dbde10314c694781954 days 9 hrs ago0xd99d24482696ef880abe7a076aa754c4fcc80636  IN   0xb66041c5accc99fccce8e4f06074ac52c9c556dd0 Ether0.000089044
0x178a435e7b6b6f26a8a426d32a7c1c5f59e7f4fc3e561ab59afbc3e18bee992d694349855 days 3 hrs ago0x5441bf9aa27e79c7aa4a8d1b340d16973695dee1  IN   0xb66041c5accc99fccce8e4f06074ac52c9c556dd0 Ether0.000066783
0x55358f17dda4a7bfcb3732ef9be2e8e90b7f362c2194123110a25a0a6867b880690118962 days 8 hrs ago0x516b88e8c700e364c2f969f2c059fed3bfb2fa29  IN   0xb66041c5accc99fccce8e4f06074ac52c9c556dd0 Ether0.000111305
0x14e9be073a0d942fb61f59c964e8f2dc7df9cf3f55ce1109746e126e5d8ef2cc683912272 days 14 hrs ago0x6556d0efc03602f88e6cbba508ba340f106220bc  IN   0xb66041c5accc99fccce8e4f06074ac52c9c556dd0 Ether0.000133566
0x2934fa4073e00ff5ae4d96b26da9638b6f1145adc196cae3e7a571e1e6f23d73680641878 days 11 mins ago0x2e6d72f09cb04425a29d420b5869b06d95352908  IN   0xb66041c5accc99fccce8e4f06074ac52c9c556dd0 Ether0.000200349
0x3b0fafb33d9acb01fab7bdc599853a65bb782f0bfdb34cfb08ec4a1535d7942f678494381 days 13 hrs ago0xd8f2ce72f19834f5e0072ea870a18ef6f57f8ccd  IN   0xb66041c5accc99fccce8e4f06074ac52c9c556dd0 Ether0.000066783
0xcf7c9940c0e6635ed4b7a7cce4aead790b7d7bdbf0164479c7b4dc5704453def677737882 days 19 hrs ago0xe138ac394a8b8a81570c70083ab3492c1ad37de5  IN   0xb66041c5accc99fccce8e4f06074ac52c9c556dd0 Ether0.000089044
0x5fd8e16255734cb9e813968ea42e99638683079e68ad04e6038144d84bb9ce2f677342783 days 10 hrs ago0x600d797b923206f2f03125ea81fd5d47c6ced772  IN   0xb66041c5accc99fccce8e4f06074ac52c9c556dd0 Ether0.000111305
0x9d0f904ae18cc1312bb6379e3c34435cde65eaba31dd1804570c8d5d85f00056676167185 days 8 hrs ago0x33497f64e2997669057710ccadd583d70798954a  IN   0xb66041c5accc99fccce8e4f06074ac52c9c556dd0 Ether0.0000534264
0xcb43e6036cc408e3cfa43ecc6a7ab915ed7b52492b13265c0512ce421ef09520676068485 days 12 hrs ago0x12cff2a28d4fe53fcf46ad642668cf6651fa8cf7  IN   0xb66041c5accc99fccce8e4f06074ac52c9c556dd0 Ether0.0000534264
0x5f644db0621b58d3e1334b57291df2371eb195b802e39159627b224e06fe3456675959185 days 16 hrs ago0x297683b64a416f2b105e776b88e8dc31e1114fa6  IN   0xb66041c5accc99fccce8e4f06074ac52c9c556dd0 Ether0.000133566
0xd80ed06551822372a985e79395621df68fbbcb69a2e88cd6f2eb1ac91b54b625675023487 days 5 hrs ago0xe0eb76c368b483afd6dede2da53224edf700b953  IN   0xb66041c5accc99fccce8e4f06074ac52c9c556dd0 Ether0.000089044
0x8347c6180e133855c923a2ea052c730184e16eb75bfb84c7ac469b6d4a7c2eb5674884987 days 11 hrs ago0x14eefe5199839480d6fd58c2d720acdff959bcb0  IN   0xb66041c5accc99fccce8e4f06074ac52c9c556dd0 Ether0.000213927
0xe1d58f9f451356e5195e7080e70b9753a604c67411514877fae18513d7355935674741887 days 16 hrs ago0xfb45597d51280e094c1d3520f1c22e2652aa72e4  IN   0xb66041c5accc99fccce8e4f06074ac52c9c556dd0 Ether0.000089044
0xa32fd622b034ad50f4c502d6b180664267d8a6ae83a930a9e1acb887c806e402674737587 days 16 hrs ago0x940b99ca07524598923cff6aff035c71fc9f57ca  IN   0xb66041c5accc99fccce8e4f06074ac52c9c556dd0 Ether0.000089044
0x30ddec8b8d32dc030a3779345056a47aac2739144bbd5064a1af019d0f218865674663387 days 19 hrs ago0xa24e91f2684a69ffe0a10a5cc384f9e0b163dd8b  IN   0xb66041c5accc99fccce8e4f06074ac52c9c556dd0 Ether0.000089044
0xce6368ff23aa3c7bbbaf32e2896982d2dd636f51fca60917fe6349747f440494674489088 days 2 hrs ago0x36f84534671906bbc4a0bed28cf84fa66dc52303  IN   0xb66041c5accc99fccce8e4f06074ac52c9c556dd0 Ether0.000089044
0x79d756855b230b3506e9ce85ab7545109b627d6bf795be213c5561bc4396aa23674423488 days 5 hrs ago0xfbaae0f8ff8541194daf1221ac39e78ebb3b3cad  IN   0xb66041c5accc99fccce8e4f06074ac52c9c556dd0 Ether0.000089044
0xeb0d9e3f98588d4d0ed76d2b1eff534a419e06f2bc886ebe7b53217b719830e7674419388 days 5 hrs ago0x55ea8a1613de642d17329a9c6b2d8afda69e62a1  IN   0xb66041c5accc99fccce8e4f06074ac52c9c556dd0 Ether0.000044522
0x87500569d87a94e9ae0c115789db358e4b86de4e7f8337be10e13c33d97a4822674200788 days 14 hrs ago0x6b42bca7a9608ff5b1bf28533cf59b40ef4475b9  IN   0xb66041c5accc99fccce8e4f06074ac52c9c556dd0 Ether0.000089044
0xfcf0ef19cbc1d0217436f64b4b5c4c94acdcc42ecd260462f04e6f9f7ed2dce0674118088 days 17 hrs ago0x96759150bec4f31c440928ea7437566988f82a34  IN   0xb66041c5accc99fccce8e4f06074ac52c9c556dd0 Ether0.000111305
[ Download CSV Export 

Latest 25 Internal Transaction, Click here to view more Internal Transactions as a result of Contract Execution

Parent TxHash Block Age From To Value
0x124e9e90a6e02e9a4d7ef1d73c971cf1f23b8027a5b598c67ef42451fd1829e5709379228 days 19 hrs ago0xb66041c5accc99fccce8e4f06074ac52c9c556dd0x57fcc23ad10fa6196559aea71d580a89740c91330.400011639520259392 Ether
0xd8aa883bbcd9219eca61dccf55410b0f1d593abf1adf68f73be7d2bd910082e0709378228 days 20 hrs ago0xb66041c5accc99fccce8e4f06074ac52c9c556dd0x7dbbc284f202b06b8386ff8af96a07a7f30f387f0.064219887210397975 Ether
0xe3340c3b27aaaca61176c0c1dbe00a51ae8e7bff4d71e50c2efe02c71e344ef4709376028 days 20 hrs ago0xb66041c5accc99fccce8e4f06074ac52c9c556dd0x3130259deedb3052e24fad9d5e1f490cb8cccaa00.005202763270865172 Ether
0x852f3f3f2253da48bdb1a962d8ae3fef40047ee7a6c0b3e0cf9d8e25ee5bde57694993254 days 1 hr ago0xb66041c5accc99fccce8e4f06074ac52c9c556dd0xff107821cb2a1671531f284313ebcd0a569c31480.032640629906235224 Ether
0xc4f7792a74af3cdc4373b3c9191007d7c9010d7a60ecceaaad2057dbde10314c694781954 days 9 hrs ago0xb66041c5accc99fccce8e4f06074ac52c9c556dd0xd99d24482696ef880abe7a076aa754c4fcc806360.000476863547130876 Ether
0x178a435e7b6b6f26a8a426d32a7c1c5f59e7f4fc3e561ab59afbc3e18bee992d694349855 days 3 hrs ago0xb66041c5accc99fccce8e4f06074ac52c9c556dd0x5441bf9aa27e79c7aa4a8d1b340d16973695dee10.00080238862086071 Ether
0x55358f17dda4a7bfcb3732ef9be2e8e90b7f362c2194123110a25a0a6867b880690118962 days 8 hrs ago0xb66041c5accc99fccce8e4f06074ac52c9c556dd0x516b88e8c700e364c2f969f2c059fed3bfb2fa290.007133853080465911 Ether
0x14e9be073a0d942fb61f59c964e8f2dc7df9cf3f55ce1109746e126e5d8ef2cc683912272 days 14 hrs ago0xb66041c5accc99fccce8e4f06074ac52c9c556dd0x6556d0efc03602f88e6cbba508ba340f106220bc0.000038659793814432 Ether
0x2934fa4073e00ff5ae4d96b26da9638b6f1145adc196cae3e7a571e1e6f23d73680641878 days 11 mins ago0xb66041c5accc99fccce8e4f06074ac52c9c556dd0x2e6d72f09cb04425a29d420b5869b06d953529080.059097549215720411 Ether
0x3b0fafb33d9acb01fab7bdc599853a65bb782f0bfdb34cfb08ec4a1535d7942f678494381 days 13 hrs ago0xb66041c5accc99fccce8e4f06074ac52c9c556dd0xd8f2ce72f19834f5e0072ea870a18ef6f57f8ccd0.012654905794525414 Ether
0xcf7c9940c0e6635ed4b7a7cce4aead790b7d7bdbf0164479c7b4dc5704453def677737882 days 19 hrs ago0xb66041c5accc99fccce8e4f06074ac52c9c556dd0xe138ac394a8b8a81570c70083ab3492c1ad37de50.000476863547130876 Ether
0x5fd8e16255734cb9e813968ea42e99638683079e68ad04e6038144d84bb9ce2f677342783 days 10 hrs ago0xb66041c5accc99fccce8e4f06074ac52c9c556dd0x600d797b923206f2f03125ea81fd5d47c6ced7720.001505768976485425 Ether
0x9d0f904ae18cc1312bb6379e3c34435cde65eaba31dd1804570c8d5d85f00056676167185 days 8 hrs ago0xb66041c5accc99fccce8e4f06074ac52c9c556dd0x33497f64e2997669057710ccadd583d70798954a0.009826282087804782 Ether
0xcb43e6036cc408e3cfa43ecc6a7ab915ed7b52492b13265c0512ce421ef09520676068485 days 12 hrs ago0xb66041c5accc99fccce8e4f06074ac52c9c556dd0x12cff2a28d4fe53fcf46ad642668cf6651fa8cf70.00019329896907216 Ether
0x5f644db0621b58d3e1334b57291df2371eb195b802e39159627b224e06fe3456675959185 days 16 hrs ago0xb66041c5accc99fccce8e4f06074ac52c9c556dd0x297683b64a416f2b105e776b88e8dc31e1114fa60.038572239607902845 Ether
0xd80ed06551822372a985e79395621df68fbbcb69a2e88cd6f2eb1ac91b54b625675023487 days 5 hrs ago0xb66041c5accc99fccce8e4f06074ac52c9c556dd0xe0eb76c368b483afd6dede2da53224edf700b9530.002861181282785256 Ether
0xe1d58f9f451356e5195e7080e70b9753a604c67411514877fae18513d7355935674741887 days 16 hrs ago0xb66041c5accc99fccce8e4f06074ac52c9c556dd0xfb45597d51280e094c1d3520f1c22e2652aa72e40.011700165678053663 Ether
0xa32fd622b034ad50f4c502d6b180664267d8a6ae83a930a9e1acb887c806e402674737587 days 16 hrs ago0xb66041c5accc99fccce8e4f06074ac52c9c556dd0x940b99ca07524598923cff6aff035c71fc9f57ca0.300294862953367845 Ether
0x30ddec8b8d32dc030a3779345056a47aac2739144bbd5064a1af019d0f218865674663387 days 19 hrs ago0xb66041c5accc99fccce8e4f06074ac52c9c556dd0xa24e91f2684a69ffe0a10a5cc384f9e0b163dd8b0.001907454188523504 Ether
0xce6368ff23aa3c7bbbaf32e2896982d2dd636f51fca60917fe6349747f440494674489088 days 2 hrs ago0xb66041c5accc99fccce8e4f06074ac52c9c556dd0x36f84534671906bbc4a0bed28cf84fa66dc523030.02697075159936043 Ether
0x79d756855b230b3506e9ce85ab7545109b627d6bf795be213c5561bc4396aa23674423488 days 5 hrs ago0xb66041c5accc99fccce8e4f06074ac52c9c556dd0xfbaae0f8ff8541194daf1221ac39e78ebb3b3cad0.000476863547130876 Ether
0xeb0d9e3f98588d4d0ed76d2b1eff534a419e06f2bc886ebe7b53217b719830e7674419388 days 5 hrs ago0xb66041c5accc99fccce8e4f06074ac52c9c556dd0x55ea8a1613de642d17329a9c6b2d8afda69e62a10.016784875177217907 Ether
0x87500569d87a94e9ae0c115789db358e4b86de4e7f8337be10e13c33d97a4822674200788 days 14 hrs ago0xb66041c5accc99fccce8e4f06074ac52c9c556dd0x6b42bca7a9608ff5b1bf28533cf59b40ef4475b90.045557502794745646 Ether
0xfcf0ef19cbc1d0217436f64b4b5c4c94acdcc42ecd260462f04e6f9f7ed2dce0674118088 days 17 hrs ago0xb66041c5accc99fccce8e4f06074ac52c9c556dd0x96759150bec4f31c440928ea7437566988f82a340.001907454188523504 Ether
0xa045046a9a93b56b90f80733f02bcbf8b34d91441eaa9eea7bd1180d33f18caf674115888 days 17 hrs ago0xb66041c5accc99fccce8e4f06074ac52c9c556dd0x51bd4c735927f958a90db80398826ff47a9832f10.000258801596106123 Ether
[ Download CSV Export 
Warning: The compiled contract might be susceptible to ExpExponentCleanup (medium/high-severity), EventStructWrongData (very low-severity) Solidity Compiler Bugs.

Contract Source Code Verified (Exact Match)
Contract Name: Amber
Compiler Version: v0.4.24+commit.e67f0147
Optimization Enabled: Yes
Runs (Optimizer):  200


Contract Source Code
pragma solidity 0.4.24;

library SafeMathExt{
  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 pow(uint256 a, uint256 b) internal pure returns (uint256) {
    if (b == 0){
      return 1;
    }
    if (b == 1){
      return a;
    }
    uint256 c = a;
    for(uint i = 1; i<b; i++){
      c = mul(c, a);
    }
    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;
  }

  function roundUp(uint256 a, uint256 b) public pure returns(uint256){
    // ((a + b - 1) / b) * b
    uint256 c = (mul(div(sub(add(a, b), 1), b), b));
    return c;
  }
}

library PureAmber{
    /*==============================
    =             BUY              =
    ==============================*/
    function isValidBuy(uint256 price_, uint256 msgValue_) public pure returns(bool){
        return (price_ == msgValue_);
    }
    function refererAllowed(address msgSender_, address currentReferer_, address newReferer_) public pure returns(bool){
        return (addressNotSet(currentReferer_) && isAddress(newReferer_) && isNotSelf(msgSender_, newReferer_));
    }
    function addressNotSet(address address_) public pure returns(bool){
        return (address_ == 0x0);
    }
    function isAddress(address address_) public pure returns(bool){
        return (address_ != 0x0);
    }
    function isNotSelf(address msgSender_, address compare_) public pure returns(bool){
        return (msgSender_ != compare_);
    }

    /*==============================
    =         BADGE SYSTEM         =
    ==============================*/
    function isFirstBadgeEle(uint256 badgeID_) public pure returns(bool){
        return (badgeID_ == 0);
    }
    function isLastBadgeEle(uint256 badgeID_, uint256 badgeLength_) public pure returns(bool){
        assert(badgeID_ <= SafeMathExt.sub(badgeLength_, 1));
        return (badgeID_ == SafeMathExt.sub(badgeLength_, 1));
    }

    function roundUp(uint256 input_, uint256 decimals_) public pure returns(uint256){
        return ((input_ + decimals_ - 1) / decimals_) * decimals_;
    }

    /*==============================
    =          DIVI SPLIT          =
    ==============================*/   
    function calcShare(uint256 msgValue_, uint256 ratio_) public pure returns(uint256){
        assert(ratio_ <= 100 && msgValue_ >= 0);
        return SafeMathExt.div((SafeMathExt.mul(msgValue_, ratio_)), 100);
    }
    function calcDiviDistribution(uint256 value_, uint256 userCount_) public pure returns(uint256){
        assert(value_ >= 0);
        return SafeMathExt.div(value_, userCount_);
    }
}

contract BadgeFactoryInterface{
	function _initBadges(address admin_, uint256 badgeBasePrice_, uint256 badgeStartMultiplier_, uint256 badgeStartQuantity_) external;
	function _createNewBadge(address owner_, uint256 price_) external;
	function _setOwner(uint256 badgeID_, address owner_) external;
	function getOwner(uint256 badgeID_) public view returns(address);
	function _increasePrice(uint256 badgeID_) external;
	function getPrice(uint256 badgeID_) public view returns(uint256);
	function _increaseTotalDivis(uint256 badgeID_, uint256 divis_) external;
	function getTotalDivis(uint256 badgeID_) public view returns(uint256);
	function _setBuyTime(uint256 badgeID_, uint32 timeStamp_) external;
	function getBuyTime(uint256 badgeID_) public view returns(uint32);
	function getCreationTime(uint256 badgeID_) public view returns(uint32);
	function getChainLength() public view returns(uint256);
}

contract TeamAmberInterface{
    function distribute() public payable;
}

contract Amber{
	using SafeMathExt for uint256;
    /*===============================================================================
    =                      DATA SET                     DATA SET                    =
    ===============================================================================*/
    /*==============================
    =          INTERFACES          =
    ==============================*/
    BadgeFactoryInterface internal _badgeFactory;
    TeamAmberInterface internal _teamAmber;

    /*==============================
    =          CONSTANTS           =
    ==============================*/
    uint256 internal constant FINNEY = 10**15;
    uint256 internal constant _sharePreviousOwnerRatio = 50;
    uint256 internal constant _shareReferalRatio = 5;
    uint256 internal constant _shareDistributionRatio = 45;

    /*==============================
    =          VARIABLES           =
    ==============================*/
    address internal _contractOwner;
    address internal _admin;
    uint256 internal _badgeBasePrice;
    uint256 internal _startTime;

    /*==============================
    =        USER MAPPINGS         =
    ==============================*/
    mapping(address => uint256) private _balanceDivis;
    mapping(address => address) private _referer;

    /*==============================
    =            EVENTS            =
    ==============================*/
    event onContractStart(uint256 startTime_);
    event onRefererSet(address indexed user_, address indexed referer_);
    event onBadgeBuy(uint256 indexed badgeID_, address indexed previousOwner_, address indexed buyer_, uint256 price_, uint256 newPrice_);
    event onWithdraw(address indexed receiver_, uint256 amount_);

    /*==============================
    =          MODIFIERS           =
    ==============================*/
    modifier onlyContractOwner(){
    	require(msg.sender == _contractOwner, 'Sender is not the contract owner.');
    	_;
    }
    modifier isNotAContract(){
        require (msg.sender == tx.origin, 'Contracts are not allowed to interact.');
        _;
    }
    modifier isRunning(){
    	require(_startTime != 0 && _startTime <= now, 'The contract is not running yet.');
    	_;
    }

    /*===============================================================================
    =                       FUNCTIONS                       FUNCTIONS               =
    ===============================================================================*/
    /*==============================
    =           OWNER ONLY         =
    ==============================*/
    constructor(address admin_, address teamAmberAddress_) public{
    	_contractOwner = msg.sender;
        _admin = admin_;
        _teamAmber = TeamAmberInterface(teamAmberAddress_);
    }

    function initGame(address badgesFactoryAddress_, uint256 badgeBasePrice_, uint256 badgeStartMultiplier_, uint256 badgeStartQuantity_) external onlyContractOwner{
        require(_badgeBasePrice == 0);

        _badgeBasePrice = badgeBasePrice_;
        _badgeFactory = BadgeFactoryInterface(badgesFactoryAddress_);
        _badgeFactory._initBadges(_admin, badgeBasePrice_, badgeStartMultiplier_, badgeStartQuantity_);
    }

    function _startContract(uint256 delay_) external onlyContractOwner{
    	require(_startTime == 0);
        _startTime = now + delay_;

        emit onContractStart(_startTime);
    }

    /*==============================
    =             BUY              =
    ==============================*/
    //Hex Data: 0x7deb6025
    function buy(uint256 badgeID_, address newReferer_) public payable isNotAContract isRunning{
    	_refererUpdate(msg.sender, newReferer_);
    	_buy(badgeID_, msg.sender, msg.value);
    }

    function _buy(uint256 badgeID_, address msgSender_, uint256 msgValue_) internal{
        address previousOwner = _badgeFactory.getOwner(badgeID_);
        require(PureAmber.isNotSelf(msgSender_, _badgeFactory.getOwner(badgeID_)), 'You can not buy from yourself.');
        require(PureAmber.isValidBuy(_badgeFactory.getPrice(badgeID_), msgValue_), 'It is not a valid buy.');        

        _diviSplit(badgeID_, previousOwner, msgSender_, msgValue_);
        _extendBadges(badgeID_, msgSender_, _badgeBasePrice);
        _badgeOwnerChange(badgeID_, msgSender_);
        _badgeFactory._increasePrice(badgeID_);

        emit onBadgeBuy (badgeID_, previousOwner, msgSender_, msgValue_, _badgeFactory.getPrice(badgeID_));
    }

    function _refererUpdate(address user_, address newReferer_) internal{
    	if (PureAmber.refererAllowed(user_, _referer[user_], newReferer_)){
    		_referer[user_] = newReferer_;
    		emit onRefererSet(user_, newReferer_);
    	}
    }

    /*==============================
    =         BADGE SYSTEM         =
    ==============================*/
    function _extendBadges(uint256 badgeID_, address owner_, uint256 price_) internal{
        if (PureAmber.isLastBadgeEle(badgeID_, _badgeFactory.getChainLength())){
            _badgeFactory._createNewBadge(owner_, price_);
        }
    }

    function _badgeOwnerChange(uint256 badgeID_, address newOwner_) internal{      
        _badgeFactory._setOwner(badgeID_, newOwner_);
        _badgeFactory._setBuyTime(badgeID_, uint32(now));
    }

    /*==============================
    =          DIVI SPLIT          =
    ==============================*/
    function _diviSplit(uint256 badgeID_, address previousOwner_, address msgSender_, uint256 msgValue_) internal{
    	_shareToPreviousOwner(previousOwner_, msgValue_, _sharePreviousOwnerRatio);
    	_shareToReferer(_referer[msgSender_], msgValue_, _shareReferalRatio);
    	_shareToDistribution(badgeID_, previousOwner_, msgValue_, _shareDistributionRatio);
    }

    function _shareToPreviousOwner(address previousOwner_, uint256 msgValue_, uint256 ratio_) internal{
    	_increasePlayerDivis(previousOwner_, PureAmber.calcShare(msgValue_, ratio_));
    }

    function _shareToReferer(address referer_, uint256 msgValue_, uint256 ratio_) internal{
    	if (PureAmber.addressNotSet(referer_)){
    		_increasePlayerDivis(_admin, PureAmber.calcShare(msgValue_, ratio_));
    	} else {
    		_increasePlayerDivis(referer_, PureAmber.calcShare(msgValue_, ratio_));
    	}
    }

    function _shareToDistribution(uint256 badgeID_, address previousOwner_, uint256 msgValue_, uint256 ratio_) internal{
    	uint256 share = PureAmber.calcShare(msgValue_, ratio_);

    	if (PureAmber.isFirstBadgeEle(badgeID_)){
    		_specialDistribution(previousOwner_, share);
    	} else {
    		_normalDistribution(badgeID_, PureAmber.calcDiviDistribution(share, badgeID_));
    	}
    }

    function _normalDistribution(uint256 badgeID_, uint256 divis_) internal{
    	for(uint256 i = 0; i<badgeID_; i++){
            _badgeFactory._increaseTotalDivis(i, divis_);
            _increasePlayerDivis(_badgeFactory.getOwner(i), divis_);
        }
    }

    function _specialDistribution(address previousOwner_, uint256 divis_) internal{
        _badgeFactory._increaseTotalDivis(0, divis_);
        _increasePlayerDivis(previousOwner_, divis_);
    }

    function _increasePlayerDivis(address user_, uint256 amount_) internal{
        _balanceDivis[user_] = SafeMathExt.add(_balanceDivis[user_], amount_);
    }

    /*==============================
    =           WITHDRAW           =
    ==============================*/
    //Hex Data: 0x0ed86f04
    function withdrawDivis() public isNotAContract{
    	_withdrawDivis(msg.sender);
    }

    function _withdrawDivis(address msgSender_) internal{
    	require (_balanceDivis[msgSender_] >= 0, 'Hack attempt: Sender does not have enough Divis to withdraw.');
    	uint256 payout = _balanceDivis[msgSender_];
        _resetBalanceDivis(msgSender_);
        _transferDivis(msgSender_, payout);

        emit onWithdraw (msgSender_, payout);
    }

    function _transferDivis(address msgSender_, uint256 payout_) internal{
    	assert(address(this).balance >= payout_);
    	if(msgSender_ == _admin){
    		_teamAmber.distribute.value(payout_)();
    	} else {
    		msgSender_.transfer(payout_); 		
    	}
    }

    function _resetBalanceDivis(address user_) internal{
    	_balanceDivis[user_] = 0;
    }

    /*==============================
    =            HELPERS           =
    ==============================*/
    function getStartTime() public view returns (uint256){
        return _startTime;
    }

    function getBalanceDivis(address user_) public view returns(uint256){
    	return _balanceDivis[user_];
    }

    function getReferer(address user_) public view returns(address){
    	return _referer[user_];
    }

    function getBalanceContract() public view returns(uint256){
    	return address(this).balance;
    }

    function getBadges() public view returns(address[], uint256[], uint256[], uint32[], uint32[]){
    	uint256 length = _badgeFactory.getChainLength();
    	address[] memory owner = new address[](length);
    	uint256[] memory price = new uint256[](length);
    	uint256[] memory totalDivis = new uint256[](length);
    	uint32[] memory buyTime = new uint32[](length);
        uint32[] memory creationTime = new uint32[](length);

        for (uint256 i = 0; i < length; i++) {
           owner[i] = _badgeFactory.getOwner(i);
           price[i] = _badgeFactory.getPrice(i);
           totalDivis[i] = _badgeFactory.getTotalDivis(i);
           buyTime[i] = _badgeFactory.getBuyTime(i);
           creationTime[i] = _badgeFactory.getCreationTime(i);
       }
       return (owner, price, totalDivis, buyTime, creationTime);
   }
}

Contract ABI
[{"constant":false,"inputs":[],"name":"withdrawDivis","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"user_","type":"address"}],"name":"getBalanceDivis","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"getBadges","outputs":[{"name":"","type":"address[]"},{"name":"","type":"uint256[]"},{"name":"","type":"uint256[]"},{"name":"","type":"uint32[]"},{"name":"","type":"uint32[]"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"getBalanceContract","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"user_","type":"address"}],"name":"getReferer","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"badgesFactoryAddress_","type":"address"},{"name":"badgeBasePrice_","type":"uint256"},{"name":"badgeStartMultiplier_","type":"uint256"},{"name":"badgeStartQuantity_","type":"uint256"}],"name":"initGame","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"badgeID_","type":"uint256"},{"name":"newReferer_","type":"address"}],"name":"buy","outputs":[],"payable":true,"stateMutability":"payable","type":"function"},{"constant":true,"inputs":[],"name":"getStartTime","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"delay_","type":"uint256"}],"name":"_startContract","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"inputs":[{"name":"admin_","type":"address"},{"name":"teamAmberAddress_","type":"address"}],"payable":false,"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":false,"name":"startTime_","type":"uint256"}],"name":"onContractStart","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"user_","type":"address"},{"indexed":true,"name":"referer_","type":"address"}],"name":"onRefererSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"badgeID_","type":"uint256"},{"indexed":true,"name":"previousOwner_","type":"address"},{"indexed":true,"name":"buyer_","type":"address"},{"indexed":false,"name":"price_","type":"uint256"},{"indexed":false,"name":"newPrice_","type":"uint256"}],"name":"onBadgeBuy","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"receiver_","type":"address"},{"indexed":false,"name":"amount_","type":"uint256"}],"name":"onWithdraw","type":"event"}]

Contract Creation Code
608060405234801561001057600080fd5b50604051604080611d3583398101604052805160209091015160028054600160a060020a0319908116331790915560038054600160a060020a0394851690831617905560018054939092169216919091179055611cc3806100726000396000f30060806040526004361061007f5763ffffffff60e060020a6000350416630ed86f0481146100845780633e9bee1b1461009b57806342a04fea146100ce57806366bd78fd1461024b5780636d03fa87146102605780637d49300d1461029d5780637deb6025146102c7578063c828371e146102de578063f08ea4cc146102f3575b600080fd5b34801561009057600080fd5b5061009961030b565b005b3480156100a757600080fd5b506100bc600160a060020a0360043516610393565b60408051918252519081900360200190f35b3480156100da57600080fd5b506100e36103ae565b60405180806020018060200180602001806020018060200186810386528b818151815260200191508051906020019060200280838360005b8381101561013357818101518382015260200161011b565b5050505090500186810385528a818151815260200191508051906020019060200280838360005b8381101561017257818101518382015260200161015a565b50505050905001868103845289818151815260200191508051906020019060200280838360005b838110156101b1578181015183820152602001610199565b50505050905001868103835288818151815260200191508051906020019060200280838360005b838110156101f05781810151838201526020016101d8565b50505050905001868103825287818151815260200191508051906020019060200280838360005b8381101561022f578181015183820152602001610217565b505050509050019a505050505050505050505060405180910390f35b34801561025757600080fd5b506100bc6108bb565b34801561026c57600080fd5b50610281600160a060020a03600435166108c0565b60408051600160a060020a039092168252519081900360200190f35b3480156102a957600080fd5b50610099600160a060020a03600435166024356044356064356108de565b610099600435600160a060020a0360243516610a34565b3480156102ea57600080fd5b506100bc610b33565b3480156102ff57600080fd5b50610099600435610b39565b333214610388576040805160e560020a62461bcd02815260206004820152602660248201527f436f6e74726163747320617265206e6f7420616c6c6f77656420746f20696e7460448201527f65726163742e0000000000000000000000000000000000000000000000000000606482015290519081900360840190fd5b61039133610c0b565b565b600160a060020a031660009081526006602052604090205490565b60608060608060606000606080606080606060008060009054906101000a9004600160a060020a0316600160a060020a0316638f2bab076040518163ffffffff1660e060020a028152600401602060405180830381600087803b15801561041457600080fd5b505af1158015610428573d6000803e3d6000fd5b505050506040513d602081101561043e57600080fd5b505160408051828152602080840282010190915290975087801561046c578160200160208202803883390190505b50955086604051908082528060200260200182016040528015610499578160200160208202803883390190505b509450866040519080825280602002602001820160405280156104c6578160200160208202803883390190505b509350866040519080825280602002602001820160405280156104f3578160200160208202803883390190505b50925086604051908082528060200260200182016040528015610520578160200160208202803883390190505b509150600090505b868110156108a85760008054604080517fc41a360a000000000000000000000000000000000000000000000000000000008152600481018590529051600160a060020a039092169263c41a360a926024808401936020939083900390910190829087803b15801561059857600080fd5b505af11580156105ac573d6000803e3d6000fd5b505050506040513d60208110156105c257600080fd5b505186518790839081106105d257fe5b600160a060020a03928316602091820290920181019190915260008054604080517fe7572230000000000000000000000000000000000000000000000000000000008152600481018790529051919094169363e7572230936024808301949193928390030190829087803b15801561064957600080fd5b505af115801561065d573d6000803e3d6000fd5b505050506040513d602081101561067357600080fd5b5051855186908390811061068357fe5b602090810290910181019190915260008054604080517f7dc5cc64000000000000000000000000000000000000000000000000000000008152600481018690529051600160a060020a0390921693637dc5cc649360248084019492938390030190829087803b1580156106f557600080fd5b505af1158015610709573d6000803e3d6000fd5b505050506040513d602081101561071f57600080fd5b5051845185908390811061072f57fe5b602090810290910181019190915260008054604080517f9c14c77b000000000000000000000000000000000000000000000000000000008152600481018690529051600160a060020a0390921693639c14c77b9360248084019492938390030190829087803b1580156107a157600080fd5b505af11580156107b5573d6000803e3d6000fd5b505050506040513d60208110156107cb57600080fd5b505183518490839081106107db57fe5b63ffffffff909216602092830290910182015260008054604080517f97ec23cb000000000000000000000000000000000000000000000000000000008152600481018690529051600160a060020a03909216936397ec23cb9360248084019492938390030190829087803b15801561085257600080fd5b505af1158015610866573d6000803e3d6000fd5b505050506040513d602081101561087c57600080fd5b5051825183908390811061088c57fe5b63ffffffff909216602092830290910190910152600101610528565b50939a9299509097509550909350915050565b303190565b600160a060020a039081166000908152600760205260409020541690565b600254600160a060020a03163314610966576040805160e560020a62461bcd02815260206004820152602160248201527f53656e646572206973206e6f742074686520636f6e7472616374206f776e657260448201527f2e00000000000000000000000000000000000000000000000000000000000000606482015290519081900360840190fd5b6004541561097357600080fd5b60048381556000805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0387811691909117808355600354604080517fce7ba91600000000000000000000000000000000000000000000000000000000815291841695820195909552602481018890526044810187905260648101869052935191169263ce7ba91692608480830193919282900301818387803b158015610a1657600080fd5b505af1158015610a2a573d6000803e3d6000fd5b5050505050505050565b333214610ab1576040805160e560020a62461bcd02815260206004820152602660248201527f436f6e74726163747320617265206e6f7420616c6c6f77656420746f20696e7460448201527f65726163742e0000000000000000000000000000000000000000000000000000606482015290519081900360840190fd5b60055415801590610ac457504260055411155b1515610b1a576040805160e560020a62461bcd02815260206004820181905260248201527f54686520636f6e7472616374206973206e6f742072756e6e696e67207965742e604482015290519081900360640190fd5b610b243382610d11565b610b2f823334610e38565b5050565b60055490565b600254600160a060020a03163314610bc1576040805160e560020a62461bcd02815260206004820152602160248201527f53656e646572206973206e6f742074686520636f6e7472616374206f776e657260448201527f2e00000000000000000000000000000000000000000000000000000000000000606482015290519081900360840190fd5b60055415610bce57600080fd5b428101600581905560408051918252517fc95500414a933625aebaf804d96decf560ff6c63826e9ff60c61408e05bb004f9181900360200190a150565b600160a060020a038116600090815260066020526040812054811115610ca1576040805160e560020a62461bcd02815260206004820152603c60248201527f4861636b20617474656d70743a2053656e64657220646f6573206e6f7420686160448201527f766520656e6f75676820446976697320746f2077697468647261772e00000000606482015290519081900360840190fd5b50600160a060020a038116600090815260066020526040902054610cc482611336565b610cce8282611350565b604080518281529051600160a060020a038416917fccad973dcd043c7d680389db4378bd6b9775db7124092e9e0422c9e46d7985dc919081900360200190a25050565b600160a060020a038083166000818152600760209081526040918290205482517f5b8b4f9100000000000000000000000000000000000000000000000000000000815260048101949094528416602484015292841660448301525173b0d6cde34e2c79021891230dc6457eebfcaffe7492635b8b4f919260648082019391829003018186803b158015610da357600080fd5b505af4158015610db7573d6000803e3d6000fd5b505050506040513d6020811015610dcd57600080fd5b505115610b2f57600160a060020a03828116600081815260076020526040808220805473ffffffffffffffffffffffffffffffffffffffff19169486169485179055517fb3f1c8ed4ff0777d22e70236169841472c2775e96f5349e766a140ab2a579ec89190a35050565b60008054604080517fc41a360a000000000000000000000000000000000000000000000000000000008152600481018790529051600160a060020a039092169163c41a360a9160248082019260209290919082900301818787803b158015610e9f57600080fd5b505af1158015610eb3573d6000803e3d6000fd5b505050506040513d6020811015610ec957600080fd5b505160008054604080517fc41a360a00000000000000000000000000000000000000000000000000000000815260048101899052905193945073b0d6cde34e2c79021891230dc6457eebfcaffe7493637a91e53d938893600160a060020a03169263c41a360a9260248083019360209383900390910190829087803b158015610f5157600080fd5b505af1158015610f65573d6000803e3d6000fd5b505050506040513d6020811015610f7b57600080fd5b50516040805160e060020a63ffffffff8616028152600160a060020a039384166004820152929091166024830152516044808301926020929190829003018186803b158015610fc957600080fd5b505af4158015610fdd573d6000803e3d6000fd5b505050506040513d6020811015610ff357600080fd5b5051151561104b576040805160e560020a62461bcd02815260206004820152601e60248201527f596f752063616e206e6f74206275792066726f6d20796f757273656c662e0000604482015290519081900360640190fd5b60008054604080517fe757223000000000000000000000000000000000000000000000000000000000815260048101889052905173b0d6cde34e2c79021891230dc6457eebfcaffe749363bcc4f0ed93600160a060020a03169263e75722309260248083019360209383900390910190829087803b1580156110cc57600080fd5b505af11580156110e0573d6000803e3d6000fd5b505050506040513d60208110156110f657600080fd5b50516040805160e060020a63ffffffff8516028152600481019290925260248201869052516044808301926020929190829003018186803b15801561113a57600080fd5b505af415801561114e573d6000803e3d6000fd5b505050506040513d602081101561116457600080fd5b505115156111bc576040805160e560020a62461bcd02815260206004820152601660248201527f4974206973206e6f7420612076616c6964206275792e00000000000000000000604482015290519081900360640190fd5b6111c88482858561141d565b6111d58484600454611463565b6111df84846115f8565b60008054604080517fedb9548c000000000000000000000000000000000000000000000000000000008152600481018890529051600160a060020a039092169263edb9548c9260248084019382900301818387803b15801561124057600080fd5b505af1158015611254573d6000803e3d6000fd5b5050505082600160a060020a031681600160a060020a0316857f2686f82b0aa94a5654f3447b6942219f9bb3554040f9ab28ccff24f318c90322856000809054906101000a9004600160a060020a0316600160a060020a031663e75722308a6040518263ffffffff1660e060020a02815260040180828152602001915050602060405180830381600087803b1580156112ec57600080fd5b505af1158015611300573d6000803e3d6000fd5b505050506040513d602081101561131657600080fd5b50516040805192835260208301919091528051918290030190a450505050565b600160a060020a0316600090815260066020526040812055565b303181111561135b57fe5b600354600160a060020a03838116911614156113e257600160009054906101000a9004600160a060020a0316600160a060020a031663e4fc6b6d826040518263ffffffff1660e060020a0281526004016000604051808303818588803b1580156113c457600080fd5b505af11580156113d8573d6000803e3d6000fd5b5050505050610b2f565b604051600160a060020a0383169082156108fc029083906000818181858888f19350505050158015611418573d6000803e3d6000fd5b505050565b61142983826032611706565b600160a060020a038083166000908152600760205260409020546114509116826005611795565b61145d848483602d6118c2565b50505050565b73b0d6cde34e2c79021891230dc6457eebfcaffe7463c4dd5acc846000809054906101000a9004600160a060020a0316600160a060020a0316638f2bab076040518163ffffffff1660e060020a028152600401602060405180830381600087803b1580156114d057600080fd5b505af11580156114e4573d6000803e3d6000fd5b505050506040513d60208110156114fa57600080fd5b50516040805160e060020a63ffffffff861602815260048101939093526024830191909152516044808301926020929190829003018186803b15801561153f57600080fd5b505af4158015611553573d6000803e3d6000fd5b505050506040513d602081101561156957600080fd5b5051156114185760008054604080517fdceacb93000000000000000000000000000000000000000000000000000000008152600160a060020a038681166004830152602482018690529151919092169263dceacb93926044808201939182900301818387803b1580156115db57600080fd5b505af11580156115ef573d6000803e3d6000fd5b50505050505050565b60008054604080517f6205983900000000000000000000000000000000000000000000000000000000815260048101869052600160a060020a038581166024830152915191909216926362059839926044808201939182900301818387803b15801561166357600080fd5b505af1158015611677573d6000803e3d6000fd5b505060008054604080517f70e4b8090000000000000000000000000000000000000000000000000000000081526004810188905263ffffffff421660248201529051600160a060020a0390921694506370e4b8099350604480820193929182900301818387803b1580156116ea57600080fd5b505af11580156116fe573d6000803e3d6000fd5b505050505050565b6114188373b0d6cde34e2c79021891230dc6457eebfcaffe7463ab51902085856040518363ffffffff1660e060020a028152600401808381526020018281526020019250505060206040518083038186803b15801561176457600080fd5b505af4158015611778573d6000803e3d6000fd5b505050506040513d602081101561178e57600080fd5b5051611a8f565b604080517f579d94c0000000000000000000000000000000000000000000000000000000008152600160a060020a0385166004820152905173b0d6cde34e2c79021891230dc6457eebfcaffe749163579d94c0916024808301926020929190829003018186803b15801561180857600080fd5b505af415801561181c573d6000803e3d6000fd5b505050506040513d602081101561183257600080fd5b50511561170657600354604080517fab519020000000000000000000000000000000000000000000000000000000008152600481018590526024810184905290516118bd92600160a060020a03169173b0d6cde34e2c79021891230dc6457eebfcaffe749163ab51902091604480820192602092909190829003018186803b15801561176457600080fd5b611418565b600073b0d6cde34e2c79021891230dc6457eebfcaffe7463ab51902084846040518363ffffffff1660e060020a028152600401808381526020018281526020019250505060206040518083038186803b15801561191e57600080fd5b505af4158015611932573d6000803e3d6000fd5b505050506040513d602081101561194857600080fd5b5051604080517f8a80dfb100000000000000000000000000000000000000000000000000000000815260048101889052905191925073b0d6cde34e2c79021891230dc6457eebfcaffe7491638a80dfb191602480820192602092909190829003018186803b1580156119b957600080fd5b505af41580156119cd573d6000803e3d6000fd5b505050506040513d60208110156119e357600080fd5b5051156119f9576119f48482611ad2565b611a88565b611a888573b0d6cde34e2c79021891230dc6457eebfcaffe7463c287fa7284896040518363ffffffff1660e060020a028152600401808381526020018281526020019250505060206040518083038186803b158015611a5757600080fd5b505af4158015611a6b573d6000803e3d6000fd5b505050506040513d6020811015611a8157600080fd5b5051611b5c565b5050505050565b600160a060020a038216600090815260066020526040902054611ab29082611c81565b600160a060020a0390921660009081526006602052604090209190915550565b60008054604080517f75718e2c00000000000000000000000000000000000000000000000000000000815260048101849052602481018590529051600160a060020a03909216926375718e2c9260448084019382900301818387803b158015611b3a57600080fd5b505af1158015611b4e573d6000803e3d6000fd5b50505050610b2f8282611a8f565b60005b828110156114185760008054604080517f75718e2c00000000000000000000000000000000000000000000000000000000815260048101859052602481018690529051600160a060020a03909216926375718e2c9260448084019382900301818387803b158015611bcf57600080fd5b505af1158015611be3573d6000803e3d6000fd5b50505050611c796000809054906101000a9004600160a060020a0316600160a060020a031663c41a360a836040518263ffffffff1660e060020a02815260040180828152602001915050602060405180830381600087803b158015611c4757600080fd5b505af1158015611c5b573d6000803e3d6000fd5b505050506040513d6020811015611c7157600080fd5b505183611a8f565b600101611b5f565b600082820183811015611c9057fe5b93925050505600a165627a7a72305820e966811642418f241f22e010340931e41701c41d694ca7e3830ef2a2ac9ba5020029000000000000000000000000ae5ac19f938f8338920e630cc9a8ecd6ce89bca10000000000000000000000001ce75bfd524489e7dd8678d4905cbd8f47f22083


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

-----Encoded View---------------
2 Constructor Arguments found :
Arg [0] : 000000000000000000000000ae5ac19f938f8338920e630cc9a8ecd6ce89bca1
Arg [1] : 0000000000000000000000001ce75bfd524489e7dd8678d4905cbd8f47f22083


   Library Used
PureAmber : 0xb0d6cdE34E2C79021891230Dc6457eEBFcaFFE74

   Swarm Source:
bzzr://e966811642418f241f22e010340931e41701c41d694ca7e3830ef2a2ac9ba502
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.