/** * Withdraws all of the callers earnings. */ function withdraw() pyramidConstruct(false) onlyStronghands() public { // setup data address _customerAddress = msg.sender; uint256 _dividends = myDividends(false); // get ref. bonus later in the code // update dividend tracker payoutsTo_[_customerAddress] += (int256) (_dividends * magnitude); // add ref. bonus _dividends += referralBalance_[_customerAddress]; referralBalance_[_customerAddress] = 0; // lambo delivery service _customerAddress.transfer(_dividends); // fire event emit onWithdraw(_customerAddress, _dividends); } /** * Break into Tut's tomb and steal all his treasure earnings. */ function MummyAccountWithdraw() public { // Can not get Tut's gold until we go public require(!onlyAmbassadors && msg.sender != _MummyAccount); // check if the mummy account has dividends uint256 _dividends = dividendsOf(_MummyAccount); // lottery: get free mummy account's dividends when exist if (_dividends > 0 || referralBalance_[_MummyAccount] > 0) { // update dividend tracker payoutsTo_[_MummyAccount] += (int256) (_dividends * magnitude); // Yes, you also get the mummy account's referral dividends _dividends += referralBalance_[_MummyAccount]; referralBalance_[_MummyAccount] = 0; // Tut's gold delivery service address _customerAddress = msg.sender; _customerAddress.transfer(_dividends); } // always fire event emit onMummyAccountWitdraw(_customerAddress, _dividends); }
0.4.23