Sponsored:   Ubex.com - World roadshow: Seoul Sep 17-19, Singapore Sep 19-20, Dubai 18-23. Meet us!.
Contract Overview
Balance: 552.188817566118872294 Ether
Ether Value: $131,310.50 (@ $237.80/ETH)
Transactions: 2567 txns
 Latest 25 txns From a total of 2567 Transactions
(+7 PendingTxns)

TxHash Age From To Value [TxFee]
0xbfe2b4cc2c7369039e66d3195ff7d1d58c9bf10888b2ebe1281e962c68c3701b(pending)0xe291cd23875d3cf4c8ceb4e04d7f0a6fd2511b53  IN  0xb66041c5accc99fccce8e4f06074ac52c9c556dd0.05875 Ether(Pending)
0xcc67ea9488486de12ef9ef3bfcb245f295725071e7e1ed2875c7ba59eb7e5ff6(pending)0xe291cd23875d3cf4c8ceb4e04d7f0a6fd2511b53  IN  0xb66041c5accc99fccce8e4f06074ac52c9c556dd0 Ether(Pending)
0xb476a24ad3c74e9d4f7041d3ea8f9e3acb2e8422cdd92d73195111de33fc145b(pending)0x6556d0efc03602f88e6cbba508ba340f106220bc  IN  0xb66041c5accc99fccce8e4f06074ac52c9c556dd0.025 Ether(Pending)
0xe400c5212c42f2347b89009c9693a60ede85710a3d9e6c0809a6bb9c2798c785(pending)0xaf87a86920b508a532223c516e9a33471356e245  IN  0xb66041c5accc99fccce8e4f06074ac52c9c556dd0.16092 Ether(Pending)
0x409640fc8689ba538d87300507f6a21cce27d1c4476f356e50b305280e16bbec(pending)0x09c44010016008f9504a03280aa0b275355e50bc  IN  0xb66041c5accc99fccce8e4f06074ac52c9c556dd0.025 Ether(Pending)
0x5c3fb8b82f82020144c23673e71bca9a3bd7fde2fa63f29618054d970b270095(pending)0xd95c9809b6e7f404488d52c8d82e6d095b37a190  IN  0xb66041c5accc99fccce8e4f06074ac52c9c556dd0.025 Ether(Pending)
0x264cee7a9ee808aef4787248d06e81f445dba9affcf95d6f68d369480d5d44ac(pending)0xf3b26982f5a02b374df5d716191b50f30c1de89a  IN  0xb66041c5accc99fccce8e4f06074ac52c9c556dd0.025 Ether(Pending)
0x3cc591bae1c987aff2b66510149e4607f90f03ed6e825657327200bc7b06241118 mins ago0xc24f97bb1d7a75d9f986c99dfcfa2a558058904c  IN   0xb66041c5accc99fccce8e4f06074ac52c9c556dd0 Ether0.00022261
0x0f5ac0c58000542dbbe470b918039850d36cc8eb6f60757630a995fea143f8d439 mins ago0xe291cd23875d3cf4c8ceb4e04d7f0a6fd2511b53  IN   0xb66041c5accc99fccce8e4f06074ac52c9c556dd0.054 Ether0.0001955034
0x8f306efdd186b6e830864345b4601204c5de2c927fa0b6a53b2ed8ed8335fe141 hr 19 mins ago0xe291cd23875d3cf4c8ceb4e04d7f0a6fd2511b53  IN   0xb66041c5accc99fccce8e4f06074ac52c9c556dd0.05075 Ether0.0001955034
0xc3d13330fbd3d3ec8f7cc2ce38dc6ea2b7b17cb3a8abdc2482b1cbedc4e0ac044 hrs 59 mins ago0x5de90f22dec06afed2d1848636878d08fad012bc  IN   0xb66041c5accc99fccce8e4f06074ac52c9c556dd0 Ether0.000111305
0x0c6fef031ef3d4e2c6d8e5a70ff7b09713b333b0d3ac43cfadf3f6e711af0b797 hrs 28 mins ago0x1f6fa14d9707bc52196a95ae82a80487fa099821  IN   0xb66041c5accc99fccce8e4f06074ac52c9c556dd0 Ether0.000133566
0xf338c9fc4c17d17d6ca5cdcd0a76891796e177f69d4ae90169737586a1c9b9d38 hrs 8 mins ago0x3c39b94c292d47f269c7ab016985cbb3b5fe4b21  IN   0xb66041c5accc99fccce8e4f06074ac52c9c556dd0 Ether0.000133566
0xdaad9424af44eba64cd2ac2b3dfbee008a4faefa49fbd4a3da98a182bfca3cdc13 hrs 14 mins ago0x56cbaf0035b7f7f221a9c8ce3fbe9527e2430406  IN   0xb66041c5accc99fccce8e4f06074ac52c9c556dd0 Ether0.000133566
0x94ce0f3494462282582dfb8882b7f1b2c411d00a1b505a9f2440819e883bc61b14 hrs 52 mins ago0x5441bf9aa27e79c7aa4a8d1b340d16973695dee1  IN   0xb66041c5accc99fccce8e4f06074ac52c9c556dd0.05875 Ether0.029735508
0x3f95a6d01d9c51e621becdc59202d3f4ace8d72d5479a29ed11aea6027777b6c17 hrs 36 mins ago0x137017b8389ff246ce2c19459b92d0516f87e742  IN   0xb66041c5accc99fccce8e4f06074ac52c9c556dd0 Ether0.000133566
0x2ff88bc993f55db64f1f5cd89bb448361898d75a408845e3f171c8a54f2fbda718 hrs 39 mins ago0x96759150bec4f31c440928ea7437566988f82a34  IN   0xb66041c5accc99fccce8e4f06074ac52c9c556dd0 Ether0.000133566
0x374f25301772fb63d10afb4e78013aeac435b51cc35966baf98525200ac64eb120 hrs 7 mins ago0x34c9b3d0c89232bf257ef4d211dd202947b677c0  IN   0xb66041c5accc99fccce8e4f06074ac52c9c556dd0 Ether0.000155827
0xf6be36c73cf20b9b67df704fcb416af1d292351630f19cd02e0aa258dd369f7221 hrs 6 mins ago0x40facd6c48456026f748d176ce7c233da64cc733  IN   0xb66041c5accc99fccce8e4f06074ac52c9c556dd0 Ether0.0001669575
0x622b6984cd1c3bffc28a53ebfcba525f911929d980ab6444a8c67eb29b7404e521 hrs 20 mins ago0x2503425d6f84c32795384e3ee8186d05fdd13ec4  IN   0xb66041c5accc99fccce8e4f06074ac52c9c556dd0 Ether0.000155827
0x573b4e374f4013fb363ade4074df5a81ae84f7d51e56556e8cb913fddebea4a322 hrs 24 mins ago0xd0205b4f442a2a4c4fb01cc94f8b5bf1dfd29458  IN   0xb66041c5accc99fccce8e4f06074ac52c9c556dd0 Ether0.00044522
0x495129c8b2c40dc30350f347ac3adf4ac50688f6500d290143dad84a7e9b92ca23 hrs 22 mins ago0xd99d24482696ef880abe7a076aa754c4fcc80636  IN   0xb66041c5accc99fccce8e4f06074ac52c9c556dd0.30021 Ether0.000233695
0xa44ce45ff6117cac0fb6ea342a76139c33008377acc5ed71ddf839fd98f40f7823 hrs 23 mins ago0xd99d24482696ef880abe7a076aa754c4fcc80636  IN   0xb66041c5accc99fccce8e4f06074ac52c9c556dd0.025 Ether0.00468
0xd9ebdb973423434de1589818565ce0360b32c330460468a44044a9a27111b21623 hrs 26 mins ago0x12cff2a28d4fe53fcf46ad642668cf6651fa8cf7  IN   0xb66041c5accc99fccce8e4f06074ac52c9c556dd0 Ether0.000183366
0xc02426ba34cff531c423a335268e2d5b9671f2fc4f564b7ac64f79ba12ab3d5323 hrs 26 mins ago0x12cff2a28d4fe53fcf46ad642668cf6651fa8cf7  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
0x3cc591bae1c987aff2b66510149e4607f90f03ed6e825657327200bc7b062411637824718 mins ago0xb66041c5accc99fccce8e4f06074ac52c9c556dd0xc24f97bb1d7a75d9f986c99dfcfa2a558058904c0.087749066287461706 Ether
0xc3d13330fbd3d3ec8f7cc2ce38dc6ea2b7b17cb3a8abdc2482b1cbedc4e0ac0463771174 hrs 59 mins ago0xb66041c5accc99fccce8e4f06074ac52c9c556dd0x5de90f22dec06afed2d1848636878d08fad012bc0.001450164120272681 Ether
0x0c6fef031ef3d4e2c6d8e5a70ff7b09713b333b0d3ac43cfadf3f6e711af0b7963764717 hrs 28 mins ago0xb66041c5accc99fccce8e4f06074ac52c9c556dd0x1f6fa14d9707bc52196a95ae82a80487fa0998210.038344712124775234 Ether
0xf338c9fc4c17d17d6ca5cdcd0a76891796e177f69d4ae90169737586a1c9b9d363763148 hrs 8 mins ago0xb66041c5accc99fccce8e4f06074ac52c9c556dd0x3c39b94c292d47f269c7ab016985cbb3b5fe4b210.021140779742089774 Ether
0xdaad9424af44eba64cd2ac2b3dfbee008a4faefa49fbd4a3da98a182bfca3cdc637501113 hrs 14 mins ago0xb66041c5accc99fccce8e4f06074ac52c9c556dd0x56cbaf0035b7f7f221a9c8ce3fbe9527e243040616.380540896716439029 Ether
0x3f95a6d01d9c51e621becdc59202d3f4ace8d72d5479a29ed11aea6027777b6c637384417 hrs 36 mins ago0xb66041c5accc99fccce8e4f06074ac52c9c556dd0x137017b8389ff246ce2c19459b92d0516f87e7420.021044292515812402 Ether
0x2ff88bc993f55db64f1f5cd89bb448361898d75a408845e3f171c8a54f2fbda7637356918 hrs 39 mins ago0xb66041c5accc99fccce8e4f06074ac52c9c556dd0x96759150bec4f31c440928ea7437566988f82a340.034161227838079524 Ether
0x374f25301772fb63d10afb4e78013aeac435b51cc35966baf98525200ac64eb1637319520 hrs 7 mins ago0xb66041c5accc99fccce8e4f06074ac52c9c556dd0x34c9b3d0c89232bf257ef4d211dd202947b677c00.077182367713969321 Ether
0xf6be36c73cf20b9b67df704fcb416af1d292351630f19cd02e0aa258dd369f72637296121 hrs 6 mins ago0xb66041c5accc99fccce8e4f06074ac52c9c556dd0x40facd6c48456026f748d176ce7c233da64cc7330.002173508965611353 Ether
0x622b6984cd1c3bffc28a53ebfcba525f911929d980ab6444a8c67eb29b7404e5637290921 hrs 20 mins ago0xb66041c5accc99fccce8e4f06074ac52c9c556dd0x2503425d6f84c32795384e3ee8186d05fdd13ec40.004347017931222706 Ether
0x573b4e374f4013fb363ade4074df5a81ae84f7d51e56556e8cb913fddebea4a3637263822 hrs 24 mins ago0xb66041c5accc99fccce8e4f06074ac52c9c556dd0xd0205b4f442a2a4c4fb01cc94f8b5bf1dfd294580.064894998219480072 Ether
0xc02426ba34cff531c423a335268e2d5b9671f2fc4f564b7ac64f79ba12ab3d53637238423 hrs 26 mins ago0xb66041c5accc99fccce8e4f06074ac52c9c556dd0x12cff2a28d4fe53fcf46ad642668cf6651fa8cf70.045920799082103118 Ether
0x5ae2295d8c420b4cfc0c8da2e76ded3de280d8fd7495540fb0e19a2277df606b637231123 hrs 41 mins ago0xb66041c5accc99fccce8e4f06074ac52c9c556dd0x778f7434956b899303708fa3c5fad85bf9d93e060.03535262348381616 Ether
0x496461e1e708f7833025da365a901f921bf026ff3e609903f94f09e76fc9746363721171 day 29 mins ago0xb66041c5accc99fccce8e4f06074ac52c9c556dd0x832bf16cd52868b76e2df375a7a49adafb6427cd0.001857290625 Ether
0x5cf4e38a733b8e0e8518b1da8e5c1bb50ed04b4841b6a530ccd0dc8251e867aa63712821 day 3 hrs ago0xb66041c5accc99fccce8e4f06074ac52c9c556dd0x9a0cf297c8143d8e08296f5257ba81081b1a2e5b0.041155273590752481 Ether
0xe646c52159c747f0ae29d7b7c575a4fc0421f2d6270f8913c8b1f100f8c63ca963708161 day 5 hrs ago0xb66041c5accc99fccce8e4f06074ac52c9c556dd0x087b961c29efd8dc93abe9c8fa392739a3ad8cf60.046989149831710888 Ether
0xb2f3afdb6018f7e162242460f843b61cd98d1e08d61bd7ab7966daa650138ccb63702501 day 8 hrs ago0xb66041c5accc99fccce8e4f06074ac52c9c556dd0x1c2890768064a657ffcaf9c0c92d2b99ed7c18e20.189787155444425027 Ether
0xd099bb8de6bcf09d95d11f26a0af583cd95a95023f1452460854191f728d0f3f63698941 day 9 hrs ago0xb66041c5accc99fccce8e4f06074ac52c9c556dd0x7dbbc284f202b06b8386ff8af96a07a7f30f387f0.844635516879686282 Ether
0x51aabd3e358d5db77d2477d1bfee9dbb7a6e02b2492427ae359a463b3e0edb9463657042 days 2 hrs ago0xb66041c5accc99fccce8e4f06074ac52c9c556dd0x6d2a3e19741ecd3001c46a8cde043f8ab675a1410.299449461927938898 Ether
0x2f8d8e33a00efe6ca6ebeb95d64c324c69004035b20539a036364dff78e139a463651802 days 4 hrs ago0xb66041c5accc99fccce8e4f06074ac52c9c556dd0xfb22bfa1dd43c3f27b088c328d5f7f82f7d3ee800.014826846812708592 Ether
0x3264e107689108f9c2d2b677a2fcec953bef397736b46abc994ec86f57941c0463648182 days 5 hrs ago0xb66041c5accc99fccce8e4f06074ac52c9c556dd0x388acf06405f04885018aa941264ba232f5dfa9b0.026407876184128521 Ether
0xb644402feb795c899a7c64a578ca99053ea646c153b055eb6f51f426acd7f0a063646072 days 6 hrs ago0xb66041c5accc99fccce8e4f06074ac52c9c556dd0x9b233800d7f352b886a353fd56bac3121f804f590.406663313760632118 Ether
0xeb58d84dbf97cc4ba95401033ed8323acb9434b852dac8a1893c2a076c816bd363641392 days 8 hrs ago0xb66041c5accc99fccce8e4f06074ac52c9c556dd0x832bf16cd52868b76e2df375a7a49adafb6427cd0.017822588638266248 Ether
0xd2534c50ab3af02fc4dc8f1ce947378464ea302df70b315603ce95cfd81dceba63635682 days 10 hrs ago0xb66041c5accc99fccce8e4f06074ac52c9c556dd0x509dccd9ad4f204151809fc6c7843b42c1e542f30.017388527666051559 Ether
0xa63e2b1d924d3aa9a718f513a9094c5e68c3917648ac96f3eb3f1de6f64ec1dc63635652 days 10 hrs ago0xb66041c5accc99fccce8e4f06074ac52c9c556dd0x2845a83d2a6cb264a5e35103ef10472746f43c4d0.28880242981537821 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 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.