Contract Overview
Balance: 544.617925278499083778 Ether
Ether Value: $94,883.33 (@ $174.22/ETH)
Transactions: 2726 txns
Misc:
Address Watch: Add To Watch List
Contract Creator: 0x461eefeb4f384b5c7177732e0068f0caa43d3152at txn 0x8f72e190d652e564c3fdc65e249c07a7a30c1dfc215f09e01ea9e8bbca26ae10
 Latest 25 transactions from a total of 2726 transactions

TxHash Age From To Value [TxFee]
0xfe8879160627df792e319e75fdb778e014419bdb5a2f0bc6a50fee0bc59d98f815 hrs 33 mins ago0x0e42d32dcc5b83a9bc74523af3b8c3a3b4cf107f  IN   0xb66041c5accc99fccce8e4f06074ac52c9c556dd0 Ether0.000152805
0xddc97260365d4c41e18e905bc5e2d7f277d73d1800ee270008bf6d605771f9373 days 2 hrs ago0x91b3646948ae6b4ea91cf68a3357e25d66b043c6  IN   0xb66041c5accc99fccce8e4f06074ac52c9c556dd0 Ether0.000183366
0x51ac9a190accd300444dcf7b3a60047880a4bf1b76795a730d5483b6f54f22e24 days 3 hrs ago0x42bdd4f4e88ac64fcbd6c01aeac676e64db33aa9  IN   0xb66041c5accc99fccce8e4f06074ac52c9c556dd0 Ether0.000044522
0x244679de9250b9ea51a7bb3da1e16d9c0a5234123f16058a145521c6d0341ff84 days 15 hrs ago0x3c39b94c292d47f269c7ab016985cbb3b5fe4b21  IN   0xb66041c5accc99fccce8e4f06074ac52c9c556dd0 Ether0.000089044
0x6a667e744e1913c2f23a87f6a9c94f1ddbf5b7a9bb4cfd5a5367821b626330306 days 8 hrs ago0x8d7009fe1f0dc7ef2a7cc7a03ee6fe786ec0a7cd  IN   0xb66041c5accc99fccce8e4f06074ac52c9c556dd0 Ether0.000061122
0xbf1523c42a5787b67b5125188d23242e93ef7ad19db76b2db1cc42cddfb4d3157 days 10 hrs ago0x8908fde0f1a8adb6a421b2f0cac6199fbcd2c359  IN   0xb66041c5accc99fccce8e4f06074ac52c9c556dd0 Ether0.000111305
0xadee41b1566df00e59b1e77fa46128ab81de6fea1426b90a8c25d571eb7fa7957 days 15 hrs ago0x6c4ff1459cc4d95b9a7a7b20a3bc09bc2404b9a7  IN   0xb66041c5accc99fccce8e4f06074ac52c9c556dd0 Ether0.000089044
0x5ad3258078417f176e2e9c23fb21a7680185e9924927f239d392df80f0d971fe9 days 18 hrs ago0xec18c3b8a4caac7dfce048bc9ab8225a554dacfc  IN   0xb66041c5accc99fccce8e4f06074ac52c9c556dd0 Ether0.000244488
0xa6ea6bd87ddc61f39638506716746dc9b5028660e65ff44c64980f5bd1417b3e9 days 18 hrs ago0xec18c3b8a4caac7dfce048bc9ab8225a554dacfc  IN   0xb66041c5accc99fccce8e4f06074ac52c9c556dd0 Ether0.000200349
0xddb84532f13c143b98666f0f3748ecce7849fd797f939970dbf598893b35227c13 days 17 hrs ago0x4b80b7460083ed857445d92eab9972419ce5cb39  IN   0xb66041c5accc99fccce8e4f06074ac52c9c556dd0 Ether0.000089044
0xec458c5b0ac118253cfe08b318989939a9009e2906c02d7d6b6fc1e2bef881c413 days 18 hrs ago0xd92faa07c8cb79954581f76a83e469a474c82f78  IN   0xb66041c5accc99fccce8e4f06074ac52c9c556dd0 Ether0.000091683
0x8a026a24c4bd430b7eec85e3ff9fcccc48f0eb08e4657d1ea6994de4de73b11a19 days 2 hrs ago0xe8f9b8caa5291240ae66c9718815a9f47aa90ed8  IN   0xb66041c5accc99fccce8e4f06074ac52c9c556dd0 Ether0.000111305
0xb28ce99309ba6e14caa291f462e2205841becedab50347544b3626a681d15afe21 days 16 hrs ago0x5029f7897183d6ba6af44d4bee34421181e15455  IN   0xb66041c5accc99fccce8e4f06074ac52c9c556dd0 Ether0.000183366
0xb2488f1e240a5462ac9ee3a89744e56176e4d286be24a9cae04ef67b8aba562c21 days 19 hrs ago0x5029f7897183d6ba6af44d4bee34421181e15455  IN   0xb66041c5accc99fccce8e4f06074ac52c9c556dd0 Ether0.000244488
0x99f2ff29cfa60f8c4f62aaf867794b4b4cda7295a49c34ad92c62fd77cd44e5421 days 19 hrs ago0x5029f7897183d6ba6af44d4bee34421181e15455  IN   0xb66041c5accc99fccce8e4f06074ac52c9c556dd0 Ether0.0001864221
0x497ae6a013ac935c98b34210beb8f28ee7347d391929d682e8fc48ef2e5dadf621 days 19 hrs ago0x5029f7897183d6ba6af44d4bee34421181e15455  IN   0xb66041c5accc99fccce8e4f06074ac52c9c556dd0 Ether0.00022261
0xbb988fbd947a52d1846ac2e331cfa7fe97a017f09041b30c92de93816fb0872a22 days 12 hrs ago0x6927b050f440cc52c60c3daf58f3525a0b34b3d8  IN   0xb66041c5accc99fccce8e4f06074ac52c9c556dd0 Ether0.000213927
0x1ac463ac7a33c5b7923aee0718f11b845433c71f63e6060bd44f7e58eb5e3ebc23 days 6 hrs ago0x4fc5831b399369119eed6c81fd4bc67016f23d71  IN   0xb66041c5accc99fccce8e4f06074ac52c9c556dd0 Ether0.000111305
0xf41fd1212ca1fbc9b942e194ab69f2fd264993096913f9cc8b63d7830067561f23 days 11 hrs ago0xbb879a0e0cc18548b132a33cc4c973da45e9ee63  IN   0xb66041c5accc99fccce8e4f06074ac52c9c556dd0 Ether0.000178088
0xc545fff111954630bef7a835abc2eaccf9309e65df527a603ec2166734da30e023 days 20 hrs ago0x509dccd9ad4f204151809fc6c7843b42c1e542f3  IN   0xb66041c5accc99fccce8e4f06074ac52c9c556dd0 Ether0.000183366
0x16bc3116881baa309b01a65f62ff5b7bf53a4daf2ad5794b186c5a4d8f150e6824 days 11 hrs ago0x40facd6c48456026f748d176ce7c233da64cc733  IN   0xb66041c5accc99fccce8e4f06074ac52c9c556dd0 Ether0.000066783
0x903364d5e67c1d6f67786bbe091813feaf5148a1a80c9513151ba4442526ad4d24 days 13 hrs ago0xd0205b4f442a2a4c4fb01cc94f8b5bf1dfd29458  IN   0xb66041c5accc99fccce8e4f06074ac52c9c556dd0 Ether0.000152805
0x567d6adf0dcd34807c53a010214285aa44b0174c667c75ddccb3c7b1f32c3a6325 days 9 hrs ago0x9d7007416e7ccb2c352463d42640acc6c95eda6e  IN   0xb66041c5accc99fccce8e4f06074ac52c9c556dd0 Ether0.000066783
0x88707cf106a5ae2c3a63609de5583c4511afc982024f5d34466c8fe9e66e1ed425 days 10 hrs ago0x5ba3e11abf8c93186637847ec590fcd3aa588bd2  IN   0xb66041c5accc99fccce8e4f06074ac52c9c556dd0 Ether0.0001001745
0x9169db88b6e9145f9bafd738ddafd6f7673cab03d4d9700b21615b4f1e45679025 days 13 hrs ago0x14eefe5199839480d6fd58c2d720acdff959bcb0  IN   0xb66041c5accc99fccce8e4f06074ac52c9c556dd0 Ether0.000133566
[ Download CSV Export  ] 
 Internal Transactions as a result of Contract Execution
 Latest 25 Internal Txns, Click here To View More View All
ParentTxHash Block Age From To Value
0x51ac9a190accd300444dcf7b3a60047880a4bf1b76795a730d5483b6f54f22e266939664 days 3 hrs ago0xb66041c5accc99fccce8e4f06074ac52c9c556dd0x42bdd4f4e88ac64fcbd6c01aeac676e64db33aa90.002283508727474894 Ether
0x244679de9250b9ea51a7bb3da1e16d9c0a5234123f16058a145521c6d0341ff866908424 days 15 hrs ago0xb66041c5accc99fccce8e4f06074ac52c9c556dd0x3c39b94c292d47f269c7ab016985cbb3b5fe4b210.008189026750208053 Ether
0xbf1523c42a5787b67b5125188d23242e93ef7ad19db76b2db1cc42cddfb4d31566738097 days 10 hrs ago0xb66041c5accc99fccce8e4f06074ac52c9c556dd0x8908fde0f1a8adb6a421b2f0cac6199fbcd2c3590.000476863547130876 Ether
0xadee41b1566df00e59b1e77fa46128ab81de6fea1426b90a8c25d571eb7fa79566726887 days 15 hrs ago0xb66041c5accc99fccce8e4f06074ac52c9c556dd0x6c4ff1459cc4d95b9a7a7b20a3bc09bc2404b9a70.286215798080757378 Ether
0xa6ea6bd87ddc61f39638506716746dc9b5028660e65ff44c64980f5bd1417b3e66595579 days 18 hrs ago0xb66041c5accc99fccce8e4f06074ac52c9c556dd0xec18c3b8a4caac7dfce048bc9ab8225a554dacfc0.00041543672328746 Ether
0xddb84532f13c143b98666f0f3748ecce7849fd797f939970dbf598893b35227c663544013 days 17 hrs ago0xb66041c5accc99fccce8e4f06074ac52c9c556dd0x4b80b7460083ed857445d92eab9972419ce5cb390.031035185828983513 Ether
0x8a026a24c4bd430b7eec85e3ff9fcccc48f0eb08e4657d1ea6994de4de73b11a660290319 days 2 hrs ago0xb66041c5accc99fccce8e4f06074ac52c9c556dd0xe8f9b8caa5291240ae66c9718815a9f47aa90ed80.001975533006793815 Ether
0x497ae6a013ac935c98b34210beb8f28ee7347d391929d682e8fc48ef2e5dadf6658612821 days 19 hrs ago0xb66041c5accc99fccce8e4f06074ac52c9c556dd0x5029f7897183d6ba6af44d4bee34421181e154550.000476863547130876 Ether
0x1ac463ac7a33c5b7923aee0718f11b845433c71f63e6060bd44f7e58eb5e3ebc657735223 days 6 hrs ago0xb66041c5accc99fccce8e4f06074ac52c9c556dd0x4fc5831b399369119eed6c81fd4bc67016f23d710.331397142021653459 Ether
0xf41fd1212ca1fbc9b942e194ab69f2fd264993096913f9cc8b63d7830067561f657595923 days 11 hrs ago0xb66041c5accc99fccce8e4f06074ac52c9c556dd0xbb879a0e0cc18548b132a33cc4c973da45e9ee630.000258801596106123 Ether
0x16bc3116881baa309b01a65f62ff5b7bf53a4daf2ad5794b186c5a4d8f150e68656991224 days 11 hrs ago0xb66041c5accc99fccce8e4f06074ac52c9c556dd0x40facd6c48456026f748d176ce7c233da64cc7330.001505768976485425 Ether
0x567d6adf0dcd34807c53a010214285aa44b0174c667c75ddccb3c7b1f32c3a63656428325 days 9 hrs ago0xb66041c5accc99fccce8e4f06074ac52c9c556dd0x9d7007416e7ccb2c352463d42640acc6c95eda6e0.007733472094261752 Ether
0x88707cf106a5ae2c3a63609de5583c4511afc982024f5d34466c8fe9e66e1ed4656395625 days 10 hrs ago0xb66041c5accc99fccce8e4f06074ac52c9c556dd0x5ba3e11abf8c93186637847ec590fcd3aa588bd20.000889711105530615 Ether
0x9169db88b6e9145f9bafd738ddafd6f7673cab03d4d9700b21615b4f1e456790656322525 days 13 hrs ago0xb66041c5accc99fccce8e4f06074ac52c9c556dd0x14eefe5199839480d6fd58c2d720acdff959bcb00.001907454188523504 Ether
0xeaf9c83034c85025bcd1297d2dde82041313b9d6c1d79c8fb9792c5a928f20e2656314825 days 13 hrs ago0xb66041c5accc99fccce8e4f06074ac52c9c556dd0xc24f97bb1d7a75d9f986c99dfcfa2a558058904c0.011644838329883916 Ether
0xbf2c8d61efa251e0ba6758a6b452dde93075b7eef148f9e049b8ceddae88554f656308725 days 14 hrs ago0xb66041c5accc99fccce8e4f06074ac52c9c556dd0x34c9b3d0c89232bf257ef4d211dd202947b677c00.001957364432167353 Ether
0xf33d83a2a8d7552da089c1b7475b101b1693420ff217d808505ab421dd205517656296725 days 14 hrs ago0xb66041c5accc99fccce8e4f06074ac52c9c556dd0xe7ce0dce6d1e4664d2c0c7ff524b019bd00f65c40.245083993504373705 Ether
0xeb632c6efe3957e3c5272a7d5c78f745b4908e6e5e43dd1fc62caaef2eb586b6656254125 days 16 hrs ago0xb66041c5accc99fccce8e4f06074ac52c9c556dd0x52af787439a82f36d6ef6b0da0f0e5ecce29ff900.020918045884193556 Ether
0x604016afa9e5ef70c73de2515a066b9e1fbd3267f199a6b5c78f6a911d7af0c8655483626 days 22 hrs ago0xb66041c5accc99fccce8e4f06074ac52c9c556dd0xe9beb23b9f8fd24edaddc9389b56d7227ad5c1b00.043062832719423427 Ether
0x609118d7c93494d4231e4e0b5bf3b8d0774457f47c228a0a2b9000d3ce5117eb655358727 days 3 hrs ago0xb66041c5accc99fccce8e4f06074ac52c9c556dd0x9b233800d7f352b886a353fd56bac3121f804f590.02028560920297085 Ether
0xfdbb2ee43508ad6030da997eab4a491ce1e3d78d48f2ce7ef36819bd6d96d5fc655098627 days 13 hrs ago0xb66041c5accc99fccce8e4f06074ac52c9c556dd0x9b3319caa84a3dba6be70df1eb7af3ca413f8eb10.003872668801044076 Ether
0x2acadf8cc843cb965852043f995bc0437273b5bc6dfab6f1c4d965ecd76a6497655094327 days 13 hrs ago0xb66041c5accc99fccce8e4f06074ac52c9c556dd0x9a164541fd8018d280ff69001951d5ccde9b34930.699942663615916392 Ether
0x41bedbb4618638560693ae0bb494be5bd3a9bee3017f583477f86d303c836bcc654985127 days 18 hrs ago0xb66041c5accc99fccce8e4f06074ac52c9c556dd0xab72a297d971f5d035738f39ddbe81f658d8796e0.108370981786053973 Ether
0x02d4e4149a03b45f31e1a4c10b7bf1a66597392e63dc05d5303ddd3583cab0a3654940827 days 19 hrs ago0xb66041c5accc99fccce8e4f06074ac52c9c556dd0x832bf16cd52868b76e2df375a7a49adafb6427cd0.000953727094261752 Ether
0x496f73581009270744cd44e0968885ce6617bdebb1152f3872e86780b3477c19654882127 days 22 hrs ago0xb66041c5accc99fccce8e4f06074ac52c9c556dd0x7be01bec1ababc771290c8fca44d9789af8ae0f30.000953727094261752 Ether
[ Download CSV Export  ] 
Warning: The Compiled Contract might be susceptible to ExpExponentCleanup (medium/high-severity), EventStructWrongData (very low-severity) SolidityCompiler Bugs.

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



  Contract Source Code   Find Similiar Contracts

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 Switch To Opcodes View
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

 

View All
Block Age transaction Difficulty GasUsed Reward
View All
Block Age UncleNumber Difficulty GasUsed Reward
Make sure to use the "Vote Down" button for any spammy posts, and the "Vote Up" for interesting conversations.