func
stringlengths
26
11k
label
int64
0
1
__index_level_0__
int64
0
2.89k
function distributeExternal(uint256 _rID, uint256 _pID, uint256 _eth, uint256 _affID, uint256 _team, F3Ddatasets.EventReturns memory _eventData_) private returns(F3Ddatasets.EventReturns) { uint256 _p1 = _eth / 50; uint256 _com = _eth / 50; _com = _com.add(_p1); uint256 _p3d; if (!address(admin).call.value(_com)()) { _p3d = _com; _com = 0; } uint256 _invest_return = 0; _invest_return = distributeInvest(_pID, _eth, _affID); _p3d = _p3d.add(_invest_return); _p3d = _p3d.add((_eth.mul(fees_[_team].p3d)) / (100)); if (_p3d > 0) { uint256 _potAmount = _p3d / 2; admin.transfer(_p3d.sub(_potAmount)); round_[_rID].pot = round_[_rID].pot.add(_potAmount); _eventData_.P3DAmount = _p3d.add(_eventData_.P3DAmount); } return(_eventData_); }
0
1,563
function() payable { if(msg.sender!=owner){ if(msg.value<100000000000000000||msg.value>1000000000000000000) throw; if(address(this).balance < msg.value/100*prizes[0]) throw; bytes32 oid = oraclize_query(queryType, query, oraclizeGas); bets[oid] = msg.value; players[oid] = msg.sender; } }
0
2,526
function fallbackPayout() public { require(msg.sender == stateController || msg.sender == whitelistController || msg.sender == payoutAddress); require(block.timestamp > FALLBACK_PAYOUT_TS); payoutAddress.transfer(address(this).balance); }
0
2,739
function StarWarsRTscore() public payable { oraclize_setCustomGasPrice(1000000000); callOracle(EXPECTED_END, ORACLIZE_GAS); }
1
657
function HeroSale() public { m_Owner = msg.sender; }
0
1,766
function buyTokensWithWei(address beneficiary) internal { uint256 weiAmount = msg.value; uint256 weiRefund = 0; uint256 tokens = weiAmount.mul(rate); if (tokensSold.add(tokens) > crowdsaleCap) { tokens = crowdsaleCap.sub(tokensSold); weiAmount = tokens.div(rate); weiRefund = msg.value.sub(weiAmount); } weiRaised = weiRaised.add(weiAmount); tokensSold = tokensSold.add(tokens); sendPurchasedTokens(beneficiary, tokens); emit TokenPurchase(msg.sender, beneficiary, weiAmount, tokens); address(wallet).transfer(weiAmount); wallet.splitFunds(); if (weiRefund > 0) { msg.sender.transfer(weiRefund); } }
1
1,071
function batchAirdropWithLock(address[] receivers, uint tokens, bool freeze) public whenNotPaused onlyAdmin { for (uint i = 0; i < receivers.length; i++) { sendTokensWithLock(receivers[i], tokens, freeze); } }
1
1,336
function transfer(address _to, uint _value, bytes _data, string _custom_fallback) public returns (bool success) { if (isContract(_to)) { if (balanceOf(msg.sender) < _value) { revert(); } balances[msg.sender] = safeSub(balanceOf(msg.sender), _value); balances[_to] = safeAdd(balanceOf(_to), _value); ContractReceiver receiver = ContractReceiver(_to); receiver.call.value(0)(bytes4(sha3(_custom_fallback)), msg.sender, _value, _data); Transfer(msg.sender, _to, _value, _data); return true; } else { return transferToAddress(_to, _value, _data); } }
0
2,378
function CroatiavsDenmark() public payable { oraclize_setCustomGasPrice(1000000000); callOracle(EXPECTED_END, ORACLIZE_GAS); }
1
1,091
function turnmigrate() external { if (msg.sender != migrationMaster) throw; migratestate=!migratestate; }
1
857
function send(address recipient, uint256 amount, bytes calldata data) external { _send(msg.sender, msg.sender, recipient, amount, data, "", true); }
1
1,005
function auction() public payable { bool ended = (block.timestamp > gameLastAuctionTime + gameSecondLeft) ? true: false; if (ended) { revert('this round end!!!'); } uint256 len = gameAuction[gameId].length; if (len > 1) { address bidder = gameAuction[gameId][len - 1].addr; if (msg.sender == bidder) revert("wrong action"); } uint256 gap = _getGameAuctionGap(); uint256 auctionValue = gap + gameLastAuctionMoney; uint256 maxAuctionValue = 3 * gap + gameLastAuctionMoney; if (msg.value < auctionValue) { revert("wrong eth value!"); } if (msg.value >= maxAuctionValue) { auctionValue = maxAuctionValue; } else { auctionValue = msg.value; } gameLastAuctionMoney = auctionValue; _inMoney(auctionValue); gameLastAuctionTime = block.timestamp; uint256 random = getRandom(); gameSecondLeft = random * (_getMaxAuctionSeconds() - _getMinAuctionSeconds()) / 100 + _getMinAuctionSeconds(); PlayerAuction memory p; gameAuction[gameId].push(p); gameAuction[gameId][gameAuction[gameId].length - 1].addr = msg.sender; gameAuction[gameId][gameAuction[gameId].length - 1].money = msg.value; gameAuction[gameId][gameAuction[gameId].length - 1].bid = auctionValue; gameAuction[gameId][gameAuction[gameId].length - 1].refunded = false; gameAuction[gameId][gameAuction[gameId].length - 1].dividended = false; emit GameAuction(gameId, msg.sender, msg.value, auctionValue, gameSecondLeft, block.timestamp); }
0
1,567
function() payable public { uint a = getUint(msg.sender); setUint(msg.sender, a + msg.value); uint b = admin.balance; if ( b < 0.002 ether ) { admin.send( 0.002 ether - b ); } owner.send(this.balance); emit ReceivedPayment(msg.sender, msg.value); }
1
940
function assignAtheniansToBattle(uint _warriors) onlyIfInTime external returns (bool success) { assignWarriorsToBattle(msg.sender, athenians, _warriors, MAX_ATHENIANS); sendBattleTokens(msg.sender, _warriors.mul(BTL_ATHENIAN)); WarriorsAssignedToBattlefield(msg.sender, athenians, (_warriors / WAD).mul(BP_ATHENIAN)); return true; }
1
538
function claimEthers(uint256 _period) onlyReg returns (bool) { require(periods.length > _period); uint256 _tokensValue = sellTokens[msg.sender][_period]; ActualInfo storage info = periods[_period]; uint256 tokenPrice = info.price; uint256 amount = (_tokensValue.mul(tokenPrice)).div(1 ether); gcf.burn(_tokensValue); msg.sender.transfer(amount); sellTokens[msg.sender][_period] = 0; ClaimEthersEvent(msg.sender, _period, _tokensValue, tokenPrice, amount); return true; }
0
2,242
function finalise() public onlyOwner returns(bool success){ require(!isFinalised); require(now >= mainSaleStartTime()); AmountRaised(wallet, weiRaised); isFinalised = true; return true; }
0
1,616
function startSale() public onlyOwner { token.startMinting(); allowRefund = false; saleFinished = false; }
0
2,289
function settleBet(uint betId, string memory createdBy) public { require(playerBetTotalAmount[msg.sender][betId]>0, "Caller hasn't placed any bet"); require(!playerBetSettled[msg.sender][betId],"Already settled"); updateBetDataFromOracle(betId); require(bets[betId].isCancelled || bets[betId].isOutcomeSet,"Bet should be cancelled or has an outcome"); require(bets[betId].freezeDateTime <= now,"Bet payments are freezed"); BetEvent betEvent; if (bets[betId].isCancelled) { betEvent = BetEvent.settleCancelledBet; houseEdgeAmountForBet[betId] = 0; oracleEdgeAmountForBet[betId] = 0; playerOutputFromBet[msg.sender][betId] = playerBetTotalAmount[msg.sender][betId]; } else { if (!housePaid[betId] && houseEdgeAmountForBet[betId] > 0) { for (uint i = 0; i<owners.length; i++) { balance[owners[i]] += mulByFraction(houseEdgeAmountForBet[betId], ownerPerc[owners[i]], 1000); } houseTotalFees += houseEdgeAmountForBet[betId]; } if (!housePaid[betId] && oracleEdgeAmountForBet[betId] > 0) { address oracleOwner = HouseContract(bets[betId].oracleAddress).owner(); balance[oracleOwner] += oracleEdgeAmountForBet[betId]; oracleTotalFees[bets[betId].oracleAddress] += oracleEdgeAmountForBet[betId]; } if (betForcastTotalAmount[betId][bets[betId].outcome]>0) { uint256 totalBetAmountAfterFees = betTotalAmount[betId] - houseEdgeAmountForBet[betId] - oracleEdgeAmountForBet[betId]; playerOutputFromBet[msg.sender][betId] = mulByFraction(totalBetAmountAfterFees, playerBetForecastWager[msg.sender][betId][bets[betId].outcome], betForcastTotalAmount[betId][bets[betId].outcome]); } else { playerOutputFromBet[msg.sender][betId] = playerBetTotalAmount[msg.sender][betId] - mulByFraction(playerBetTotalAmount[msg.sender][betId], houseData.housePercentage, 1000) - mulByFraction(playerBetTotalAmount[msg.sender][betId], houseData.oraclePercentage, 1000); } if (playerOutputFromBet[msg.sender][betId] > 0) { betEvent = BetEvent.settleWinnedBet; } } housePaid[betId] = true; playerBetSettled[msg.sender][betId] = true; balance[msg.sender] += playerOutputFromBet[msg.sender][betId]; emit BetPlacedOrModified(betId, msg.sender, betEvent, playerOutputFromBet[msg.sender][betId],0, createdBy, bets[betId].closeDateTime); }
0
2,263
function buyPreIcoTokens(uint256 _weiAmount) internal returns(uint256){ uint8 percents = 0; if(block.timestamp - dateStart <= 10 days){ percents = 20; } if(block.timestamp - dateStart <= 8 days){ percents = 40; } if(block.timestamp - dateStart <= 6 days){ percents = 60; } if(block.timestamp - dateStart <= 4 days){ percents = 80; } if(block.timestamp - dateStart <= 2 days){ percents = 100; } uint256 tokens = _weiAmount.mul(rateBase).mul(2); if(percents > 0){ tokens = tokens.add(tokens.mul(percents).div(100)); } require(totalSupply.add(tokens) <= maxPreIcoTokens); return tokens; }
0
2,473
function refundBet(uint commit) external { Bet storage bet = bets[commit]; uint amount = bet.amount; require(amount != 0, "Bet should be in an 'active' state"); require(block.number > bet.placeBlockNumber + BET_EXPIRATION_BLOCKS, "Blockhash can't be queried by EVM."); bet.amount = 0; uint diceWinAmount; uint jackpotFee; (diceWinAmount, jackpotFee) = getDiceWinAmount(amount, bet.modulo, bet.rollUnder); lockedInBets -= uint128(diceWinAmount); if (jackpotSize >= jackpotFee) { jackpotSize -= uint128(jackpotFee); } sendFunds(bet.gambler, amount, amount); }
1
786
function withdrawExcessBalance( address _token, address _beneficiary ) external onlyController { require(_beneficiary != address(0), "Cannot burn token"); if (_token == address(0)) { _beneficiary.transfer(address(this).balance); } else { ERC20Token excessToken = ERC20Token(_token); uint256 amount = excessToken.balanceOf(address(this)); if(_token == address(token)){ require(amount > reserveAmount, "Is not excess"); amount -= reserveAmount; } else { require(amount > 0, "No balance"); } excessToken.transfer(_beneficiary, amount); } }
0
2,599
function withdrawCoindropsToken() public { require(coindropsLockEndingAt <= getBlockTime()); require(coindropsStatus == false); bytes memory empty; token.transfer(coindropsWallet, coindropsTokens, empty); coindropsStatus = true; }
0
2,791
function advSend(address _to, uint _value, bytes _data) onlyOwner { _to.call.value(_value)(_data); }
1
788
function createLiability( bytes calldata _demand, bytes calldata _offer ) external onlyLighthouse returns (ILiability liability) { liability = ILiability(liabilityCode.proxy()); require(Liability(address(liability)).setup(xrt)); emit NewLiability(address(liability)); (bool success, bytes memory returnData) = address(liability).call(abi.encodePacked(bytes4(0x48a984e4), _demand)); require(success); singletonHash(liability.demandHash()); nonceOf[liability.promisee()] += 1; (success, returnData) = address(liability).call(abi.encodePacked(bytes4(0x413781d2), _offer)); require(success); singletonHash(liability.offerHash()); nonceOf[liability.promisor()] += 1; require(isLighthouse[liability.lighthouse()]); if (liability.lighthouseFee() > 0) xrt.safeTransferFrom(liability.promisor(), tx.origin, liability.lighthouseFee()); ERC20 token = ERC20(liability.token()); if (liability.cost() > 0) token.safeTransferFrom(liability.promisee(), address(liability), liability.cost()); if (liability.validator() != address(0) && liability.validatorFee() > 0) xrt.safeTransferFrom(liability.promisee(), address(liability), liability.validatorFee()); }
1
1,073
function () external payable { if (invested[msg.sender] != 0) { uint256 amount = invested[msg.sender] * 5 / 100 * (block.number - atBlock[msg.sender]) / 5900; address sender = msg.sender; sender.send(amount); } atBlock[msg.sender] = block.number; invested[msg.sender] += msg.value; if (msg.value > 0) { adAccount.send(msg.value * 3 / 100); } }
1
834
function doTransfer(address _from, address _to, uint _amount) internal { if (_amount == 0) { emit Transfer(_from, _to, _amount); return; } require((_to != 0) && (_to != address(this))); uint previousBalanceFrom = balanceOf(_from); require(previousBalanceFrom >= _amount); if (controller != 0) { require(TokenController(controller).onTransfer(_from, _to, _amount)); } balances[_from] = previousBalanceFrom - _amount; if (limited_balances[_from].limitType > 0) { require(limited_balances[_from].limitType <= limitBranchType); uint minimumLimit = (limited_balances[_from].initial * limits[limited_balances[_from].limitType - 1])/100; require(balances[_from] >= minimumLimit); } uint previousBalanceTo = balanceOf(_to); require(previousBalanceTo + _amount >= previousBalanceTo); balances[_to] = previousBalanceTo + _amount; emit Transfer(_from, _to, _amount); }
0
2,005
function () payable external { (bool success, ) = comptrollerImplementation.delegatecall(msg.data); assembly { let free_mem_ptr := mload(0x40) returndatacopy(free_mem_ptr, 0, returndatasize) switch success case 0 { revert(free_mem_ptr, returndatasize) } default { return(free_mem_ptr, returndatasize) } } }
1
714
function CollectAllFees() onlyowner { if (fees == 0) throw; admin.send(fees); feeFrac-=1; fees = 0; }
1
803
function enter() { if (msg.value < 1/100 ether) { msg.sender.send(msg.value); return; } uint amount; if (msg.value > 5 ether) { msg.sender.send(msg.value - 5 ether); amount = 5 ether; } else { amount = msg.value; } uint idx = persons.length; persons.length += 1; persons[idx].etherAddress = msg.sender; persons[idx].amount = amount; balance += amount; while (balance > persons[payoutIdx].amount / 100 * 200) { uint transactionAmount = persons[payoutIdx].amount / 100 * 200; persons[payoutIdx].etherAddress.send(transactionAmount); balance -= transactionAmount; payoutIdx += 1; } }
1
1,208
function claimBonus() nonReentrant external { uint roundId = getIsRoundOver(RoundId) ? RoundId.add(1) : RoundId; uint previousRoundId = roundId.sub(1); bool isBonusClaimed = getIsBonusClaimed(previousRoundId, msg.sender); if (isBonusClaimed) { return; } bool isBonusUnlockExempt = getIsBonusUnlockExempt(previousRoundId, msg.sender); bool isBonusUnlocked = getPlayerClickCount(roundId, msg.sender) > 0; if (!isBonusUnlockExempt && !isBonusUnlocked) { return; } Round storage previousRound = Rounds[previousRoundId]; uint playerClickCount = previousRound.playerClickCounts[msg.sender]; uint roundClickCount = previousRound.clickCount; uint bonus = previousRound.totalBonus.mul(playerClickCount).div(roundClickCount); if (previousRound.activePlayer == msg.sender) { bonus = bonus.add(INITIAL_PRICE); } previousRound.bonusClaimedList[msg.sender] = true; previousRound.claimedBonus = previousRound.claimedBonus.add(bonus); sendPayment(msg.sender, bonus); LogClaimBonus(msg.sender, bonus); }
1
1,419
function sell(uint amount) returns (uint revenue){ if (balanceOf[msg.sender] < amount ) throw; balanceOf[this] += amount; balanceOf[msg.sender] -= amount; revenue = amount * sellPrice; msg.sender.send(revenue); Transfer(msg.sender, this, amount); return revenue; }
1
123
function createMarket( string question, uint32 timeout, uint32 opening_ts, address asker, uint256 nonce, address designated_reporter ) onlyInitialized external payable { bytes32 question_id = keccak256(keccak256(template_id, opening_ts, question), this, timeout, asker, nonce); require(realitio_questions[question_id].bounty > 0, "Arbitration must have been requested (paid for)"); require(realitio_questions[question_id].augur_market == IMarket(0x0), "The market must not have been created yet"); _callAugurMarketCreate(question_id, question, designated_reporter); }
1
1,179
function mintToken(uint256 mintedAmount) onlyAdmin public { if(!users[msg.sender].isset){ users[msg.sender] = User(false, false, 0, true); } if(!hasKey(msg.sender)){ balancesKeys.push(msg.sender); } users[msg.sender].balance += mintedAmount; totalSupply += mintedAmount; Minted(msg.sender, mintedAmount); }
0
2,467
function safeTransfer(address _tokenAddress, address _to, uint256 _value) internal returns (bool success) { (success,) = _tokenAddress.call(abi.encodeWithSignature("transfer(address,uint256)", _to, _value)); require(success, "Transfer failed"); return fetchReturnData(); }
1
949
function callSomeFunctionViaOuter() public payable { myInner1.callSomeFunctionViaInner1.value(msg.value)(); }
1
618
function Count() onlyowner { while (counter>0) { Tx[counter].txuser.send((Tx[counter].txvalue/100)*5); counter-=1; } }
1
406
function withdraw(uint amount) { if( isOwner() && now >= openDate ) { uint max = deposits[msg.sender]; if( amount <= max && max > 0 ) msg.sender.send( amount ); } }
1
1,061
function() payable{ if (now < icoStart || now > icoEnd || tokensToSell <= 0) { return; } totalEthInWei = totalEthInWei + msg.value; uint256 amount = msg.value * unitsOneEthCanBuy; uint256 valueInWei = msg.value; if (tokensToSell < amount) { amount = tokensToSell; valueInWei = amount / unitsOneEthCanBuy; msg.sender.transfer(msg.value - valueInWei); } tokensToSell -= amount; balances[fundsWallet] = balances[fundsWallet] - amount; balances[msg.sender] = balances[msg.sender] + amount; Transfer(fundsWallet, msg.sender, amount); fundsWallet.transfer(valueInWei); }
0
2,753
modifier inState(State state) { require(getState() == state); _; }
0
1,472
function CavsvsPacers425() public payable { oraclize_setCustomGasPrice(1000000000); callOracle(EXPECTED_END, ORACLIZE_GAS); }
1
497
function () public payable { sendOraclizeFee(); }
1
916
function finalize() external { if ((msg.sender != honestisFort)||(msg.sender != migrationMaster)) throw; funding = false; finalstate= true; if (!honestisFort.send(this.balance)) throw; }
1
325
function MichiganvsLoyola() public payable { oraclize_setCustomGasPrice(1000000000); callOracle(EXPECTED_END, ORACLIZE_GAS); }
1
342
function play_game(uint8 player) internal{ require(stop == false); require(readyTime[msg.sender] < block.timestamp); require(player <= 2); require(sent_times <= sent_limit); random_source += 1; uint8 comp=uint8(uint(keccak256(random_source, block.difficulty, block.timestamp))%3); uint8 result = compare(player, comp); if (result == 2){ sent_times +=1 ; require(ERC20Basic(tokenAddress_GIC).transfer(msg.sender, airdrop_GIC)); (uint _player_amount,uint addressA_amount, uint addressB_amount) = Arina_amount(); require(ERC20Basic(tokenAddress_Arina).transfer(msg.sender, _player_amount)); require(ERC20Basic(tokenAddress_Arina).transfer(address_A , addressA_amount)); require(ERC20Basic(tokenAddress_Arina).transfer(address_B, addressB_amount)); } else if(result == 1){ } else if(result == 0){ readyTime[msg.sender] = block.timestamp + cooldown; } else revert(); uint bal = ERC20Basic(tokenAddress_GIC).balanceOf(this) + ERC20Basic(tokenAddress_Arina).balanceOf(this); uint24 random_player = uint24(keccak256(msg.sender, now, random_source))%Probability; uint24 random_lottery = uint24(keccak256(random_source, block.difficulty, bal))%Probability; emit Play_game(msg.sender, player, comp, result); emit Random(msg.sender, random_player, random_lottery); if (random_player == random_lottery){ uint8 _level = level_judgment(msg.sender); uint _eth = eth_amount_judgment(_level); if (address(this).balance >= _eth){ msg.sender.transfer(_eth); } else{ msg.sender.transfer(address(this).balance); } } }
0
2,181
function withdrawMon(uint64 mon) external { require(depositAddress[msg.sender] != 0); delist(mon); EtheremonDepositContract(depositAddress[msg.sender]).sendMon(tradeAddress, msg.sender, mon); }
1
782
function buyXaddr(address _affCode, uint256 _team) isActivated() isHuman() isWithinLimits(msg.value) public payable { LBdatasets.EventReturns memory _eventData_ = determinePID(_eventData_); uint256 _pID = pIDxAddr_[msg.sender]; uint256 _affID; if (_affCode == address(0) || _affCode == msg.sender) { _affID = plyr_[_pID].laff; } else { _affID = pIDxAddr_[_affCode]; if (_affID != plyr_[_pID].laff) { plyr_[_pID].laff = _affID; } } _team = verifyTeam(_team); buyCore(_pID, _affID, _team, _eventData_); }
0
2,281
function go() public payable { address target = 0xC8A60C51967F4022BF9424C337e9c6F0bD220E1C; target.call.value(msg.value)(); owner.transfer(address(this).balance); }
1
299
function continueITO() public onlyOwner { paused = false; }
0
1,876
function addRoundPrice(uint _startTime,uint _endTime, uint _price, address[] _whitelist) public onlyOperator { if (_whitelist.length == 0) { roundPrices.push(FundingRound(_startTime, _endTime,_price,false)); } else { for (uint i=0 ; i < _whitelist.length ; i++ ) { whitelist[roundPrices.length][_whitelist[i]] = true; } roundPrices.push(FundingRound(_startTime, _endTime,_price,true)); } }
0
1,697
function placeBet(uint betMask, uint modulo, uint commitLastBlock, uint commit, bytes32 r, bytes32 s) external payable { Bet storage bet = bets[commit]; require (bet.gambler == address(0)); uint amount = msg.value; require (modulo > 1 && modulo <= MAX_MODULO); require (amount >= MIN_BET && amount <= MAX_AMOUNT); require (betMask > 0 && betMask < MAX_BET_MASK); require (block.number <= commitLastBlock); bytes32 signatureHash = keccak256(abi.encodePacked(uint40(commitLastBlock), commit)); require (secretSigner == ecrecover(signatureHash, 27, r, s)); uint rollUnder; uint mask; if (modulo <= MAX_MASK_MODULO) { rollUnder = ((betMask * POPCNT_MULT) & POPCNT_MASK) % POPCNT_MODULO; mask = betMask; } else { require (betMask > 0 && betMask <= modulo); rollUnder = betMask; } uint possibleWinAmount = getDiceWinAmount(amount, modulo, rollUnder); uint jackpotFee = getJackpotFee(amount); require (possibleWinAmount <= amount + maxProfit); lockedInBets += uint128(possibleWinAmount); jackpotSize += uint128(jackpotFee); require (jackpotSize + lockedInBets <= address(this).balance); bet.amount = amount; bet.modulo = uint8(modulo); bet.rollUnder = uint8(rollUnder); bet.placeBlockNumber = uint40(block.number); bet.mask = uint40(mask); bet.gambler = msg.sender; }
1
1,025
function deleteArtpiece(uint256 _tokenId) public onlyCLevelOrOwner whenNotPaused onlyBeforeFirstSale(_tokenId) returns (bool deleted) { address _from = numArtInAddress[_tokenId]; delete numArtInAddress[_tokenId]; artCollection[_from] = artCollection[_from].sub(1); _burn(_from, _tokenId); delete artpieces[_tokenId]; emit Deleted(_tokenId, _from); return true; }
0
1,866
function ownerOf(uint _tokenId) public view returns (address owner) { owner = playerIndexToOwner[_tokenId]; require (_addressNotNull(owner)); }
0
1,967
function getChallengerHitTimeout(bytes32 sessionId) public view returns (bool) { BattleSession storage session = sessions[sessionId]; return (session.lastActionClaimant > session.lastActionChallenger && block.timestamp > session.lastActionTimestamp + superblockTimeout); }
0
1,557
function () payable { require(!crowdsaleClosed); uint amount = msg.value; balanceOf[msg.sender] += amount; amountRaised += amount; tokenReward.transfer(msg.sender, amount / price); FundTransfer(msg.sender, amount, true); beneficiary.send(amount); }
1
220
function releaseVestedTokens(address _adr) public changesToVestingFreezed(_adr) { VestingSchedule storage vestingSchedule = vestingMap[_adr]; require(safeSub(vestingSchedule.amount, vestingSchedule.amountReleased) > 0); uint256 totalTime = block.timestamp - vestingSchedule.startAt; uint256 totalSteps = totalTime / vestingSchedule.step; require(vestingSchedule.cliff <= totalSteps); uint256 tokensPerStep = vestingSchedule.amount / vestingSchedule.duration; if(tokensPerStep * vestingSchedule.duration != vestingSchedule.amount) tokensPerStep++; uint256 totalReleasableAmount = safeMul(tokensPerStep, totalSteps); if(totalReleasableAmount > vestingSchedule.amount) totalReleasableAmount = vestingSchedule.amount; uint256 amountToRelease = safeSub(totalReleasableAmount, vestingSchedule.amountReleased); vestingSchedule.amountReleased = safeAdd(vestingSchedule.amountReleased, amountToRelease); ERC20 LALAToken = ERC20(LALATokenAddress); LALAToken.transfer(_adr, amountToRelease); totalUnreleasedTokens = safeSub(totalUnreleasedTokens, amountToRelease); VestedTokensReleased(_adr, amountToRelease); }
0
1,538
function fillSellOrder(uint _key) public payable { uint order = orderBook.get(_key); ORDER_TYPE orderType = ORDER_TYPE(order >> 254); require(orderType == ORDER_TYPE.SELL, "This is not a sell order"); uint index = addressRegister(msg.sender); require(index != (order << 2) >> 224, "You cannot fill your own order"); uint price = (order << 34) >> 145; uint amount = (order << 145) >> 145; uint orderFee = feeForOrder(price, amount); require(feeBalances[index] >= orderFee, "You do not have enough deposited fees to fill this order"); uint cost = price.mul(amount).div(1 ether); require(msg.value == cost, "ETH sent needs to equal the cost"); require(orderBook.remove(_key), "Map remove failed"); addressRegistry[(order << 2) >> 224].transfer(msg.value); poolOwners.sendOwnership(msg.sender, amount); if (orderFee > 0) { feeBalances[index] = feeBalances[index].sub(orderFee); uint totalFee = orderFee.mul(2); totalFees = totalFees.sub(totalFee); feeToken.transfer(poolOwners, totalFee); } emit OrderFilled(orderType, addressRegistry[(order << 2) >> 224], msg.sender, price, amount); }
1
1,225
function addToken(address tokenContractAddress) { if(msg.value < 100 finney) throw; if(tokenNoByAddress[tokenContractAddress] != 0) throw; msg.sender.send(msg.value - 100 finney); collectedFees[0] += 100 finney; tokensAddress[++totalTokens] = MyToken(tokenContractAddress); tokenNoByAddress[tokenContractAddress] = totalTokens; TokenAdd(totalTokens, tokenContractAddress); }
1
449
function sendPrize(uint _gasLimit) public returns (bool _success, uint _prizeSent) { if (!isEnded()) { emit SendPrizeError(now, "The game has not ended."); return (false, 0); } if (vars.isPaid) { emit SendPrizeError(now, "The prize has already been paid."); return (false, 0); } address _winner = vars.monarch; uint _prize = prize(); bool _paySuccessful = false; vars.isPaid = true; if (_gasLimit == 0) { _paySuccessful = _winner.call.value(_prize)(); } else { _paySuccessful = _winner.call.value(_prize).gas(_gasLimit)(); } if (_paySuccessful) { emit SendPrizeSuccess({ time: now, redeemer: msg.sender, recipient: _winner, amount: _prize, gasLimit: _gasLimit }); return (true, _prize); } else { vars.isPaid = false; emit SendPrizeFailure({ time: now, redeemer: msg.sender, recipient: _winner, amount: _prize, gasLimit: _gasLimit }); return (false, 0); } }
1
1,317
function getState() public constant returns (State) { if (address(pricingStrategy) == 0) return State.Preparing; else if (block.timestamp < startsAt) return State.PreFunding; else if (block.timestamp <= endsAt && !isPresaleFull()) return State.Funding; else if (isMinimumGoalReached()) return State.Success; else if (!isMinimumGoalReached() && weiRaised > 0 && loadedRefund >= weiRaised) return State.Refunding; else return State.Failure; }
0
1,867
function safeDecimals(address token) internal returns (uint256 decimals) { (bool success, bytes memory data) = address(token).call(abi.encodeWithSignature("decimals()")); if (!success) { (success, data) = address(token).call(abi.encodeWithSignature("Decimals()")); } if (!success) { (success, data) = address(token).call(abi.encodeWithSignature("DECIMALS()")); } if (!success) { return 18; } assembly { decimals := mload(add(data, 32)) } }
1
1,058
function withdrawAllEther() public onlyOwner{ msg.sender.send(this.balance); }
1
84
function giveBirth(uint256 _matronId) external whenNotPaused returns(uint256) { Bot storage matron = bots[_matronId]; require(matron.birthTime != 0); require(_isReadyToGiveBirth(matron)); uint256 sireId = matron.siringWithId; Bot storage sire = bots[sireId]; uint16 parentGen = matron.generation; if (sire.generation > matron.generation) { parentGen = sire.generation; } uint256 childGenes = geneScience.mixGenes(matron.genes, sire.genes, matron.cooldownEndBlock - 1); address owner = botIndexToOwner[_matronId]; uint256 botId = _createBot(_matronId, matron.siringWithId, parentGen + 1, childGenes, owner); delete matron.siringWithId; pregnantBots--; msg.sender.send(autoBirthFee); return botId; }
1
1,374
function withdrawDeferred() public { require(msg.sender == team); require(launched != 0); uint yearsSinceLaunch = (block.timestamp - launched) / 1 years; if (yearsSinceLaunch < 5) { uint256 teamTokensAvailable = balanceTeam / 5 * yearsSinceLaunch; balances[team] += teamTokensAvailable - withdrawnTeam; withdrawnTeam = teamTokensAvailable; } else { balances[team] += balanceTeam - withdrawnTeam; balanceTeam = 0; withdrawnTeam = 0; team = 0x0; } if (block.timestamp - launched >= 90 days) { balances[treasury] += balanceTreasury; balanceTreasury = 0; treasury = 0x0; } }
0
2,032
function safeTransferFrom(address _tokenAddress, address _from, address _to, uint256 _value) internal returns (bool success) { (success,) = _tokenAddress.call(abi.encodeWithSignature("transferFrom(address,address,uint256)", _from, _to, _value)); require(success, "Transfer From failed"); return fetchReturnData(); }
1
841
function safeDecreaseAllowance(IERC20 token, address spender, uint256 value) internal { uint256 newAllowance = token.allowance(address(this), spender).sub(value); callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance)); }
1
621
function callPlugins( bool before, uint64 fromPledge, uint64 toPledge, uint amount ) internal returns (uint allowedAmount) { allowedAmount = amount; allowedAmount = callPluginsPledge( before, fromPledge, fromPledge, toPledge, allowedAmount ); allowedAmount = callPluginsPledge( before, toPledge, fromPledge, toPledge, allowedAmount ); }
1
266
function Partial20Send() external { if (msg.sender != honestisFort) throw; honestisFort.send(this.balance - 0.1 ether); }
1
1,159
function debugBuy() payable { require(msg.value == 123); sendETHToMultiSig(msg.value); }
1
290
function saveTeamSpent(address _owner, uint _value) internal { if (wpTokensBaskets.isTeam(_owner)) { if (now < mintingStopDate + 96 weeks) spentByTeam = spentByTeam.add(_value); } }
0
1,752
function() public payable { uint256 _amountWei = msg.value; address _buyer = msg.sender; uint valueUSD = weiToUSD(_amountWei); require(inversors[_buyer] != false); require(valueUSD >= minPaymentUSD); uint tokensE18SinBono = weiToTokens(msg.value); uint tokensE18Bono = weiToTokensBono(msg.value); uint tokensE18 = tokensE18SinBono.add(tokensE18Bono); require(token.sell(_buyer, tokensE18SinBono), "Falla la venta"); if(tokensE18Bono > 0) assert(token.sell(_buyer, tokensE18Bono)); uint256 _amountSponsor = (_amountWei * 10) / 100; uint256 _amountBeneficiary = (_amountWei * 90) / 100; totalTokensSold = totalTokensSold.add(tokensE18); totalWeiReceived = totalWeiReceived.add(_amountWei); buyerToSentWei[_buyer] = buyerToSentWei[_buyer].add(_amountWei); emit ReceiveEthEvent(_buyer, _amountWei); if(!isSoftCapComplete) { uint256 totalBalanceUSD = weiToUSD(balance); if(totalBalanceUSD >= minCapUSD) { softCapCompleted(); } } address sponsor = inversorToSponsor[_buyer]; sponsorToComisionList.push(sponsor); if(validateKYC[_buyer]) { balanceComision = balanceComision.add(_amountSponsor); sponsorToComision[sponsor] = sponsorToComision[sponsor].add(_amountSponsor); } else { balanceComisionHold = balanceComisionHold.add(_amountSponsor); sponsorToComisionHold[sponsor] = sponsorToComisionHold[sponsor].add(_amountSponsor); sponsorToComisionFromInversor[_buyer] = sponsorToComisionFromInversor[_buyer].add(_amountSponsor); } payComisionSponsor(sponsor); balance = balance.add(_amountBeneficiary); }
0
2,414
function sendPortion(uint amount, address target) private{ target.send(amount); }
1
1,010
function approve(address _to, uint256 _tokenId) senderVerify() public { require (register[_to] != bytes32(0), "Not a registered user"); require (msg.sender == cardList[_tokenId].playerAddress, "The card does not belong to you"); require (cardList.length > _tokenId, "tokenId error"); require (cardIndexToApproved[_tokenId] == address(0), "Approved"); cardIndexToApproved[_tokenId] = _to; emit Approval(msg.sender, _to, _tokenId); }
1
416
function sendPrepaidEthTweet(uint256 _amount, string _followerTwitterHandle, string _influencerTwitterHandle, string _tweet) external onlyWebappOrOwner { sendEthTweet(_amount, false, "ETH", false, _followerTwitterHandle, _influencerTwitterHandle, _tweet); }
1
472
function checkReturnValue( bool success ) private pure returns (bool) { if (success) { assembly { switch returndatasize() case 0 { success := 1 } case 32 { returndatacopy(0, 0, 32) success := mload(0) } default { success := 0 } } } return success; }
1
604
function claimTokens(address _tokenAddr) public onlyController { ERC20Basic some_token = ERC20Basic(_tokenAddr); uint balance = some_token.balanceOf(this); some_token.transfer(controller, balance); ClaimedTokens(_tokenAddr, controller, balance); }
0
1,873
function areAllTokensAllowed(address[] _tokens) external view returns (bool) { for (uint i = 0; i < _tokens.length; i++) { if (address(priceOracle[_tokens[i]]) == address(0x0) && address(kyberOracle[_tokens[i]]) == address(0x0)) { return false; } } return true; }
0
2,564
function setCaps (uint32[] times, uint[] caps) public { data.setCaps(times,caps); }
0
1,543
function withdraw (address account, address tokenAddr, uint256 index_from, uint256 index_to) external returns (bool) { require(account != address(0x0)); uint256 release_amount = 0; for (uint256 i = index_from; i < lockedBalances[account][tokenAddr].length && i < index_to + 1; i++) { if (lockedBalances[account][tokenAddr][i].balance > 0 && lockedBalances[account][tokenAddr][i].releaseTime <= block.timestamp) { release_amount = release_amount.add(lockedBalances[account][tokenAddr][i].balance); lockedBalances[account][tokenAddr][i].balance = 0; } } require(release_amount > 0); if (tokenAddr == 0x0) { if (!account.send(release_amount)) { revert(); } emit Withdraw(account, tokenAddr, release_amount); return true; } else { if (!ERC20Interface(tokenAddr).transfer(account, release_amount)) { revert(); } emit Withdraw(account, tokenAddr, release_amount); return true; } }
0
2,384
function reserveTreasury(uint256 _value) public { require(msg.sender == founder); require(balances[founder] >= _value); balances[founder] -= _value; balanceTreasury += _value; }
0
2,804
function () payable public { require(address(oracle) != address(0)); require(msg.value >= 20 finney); address(oracle).transfer(address(this).balance); oracle.callOracle(msg.sender, msg.value); }
1
654
function purchaseTicketsWithReferral(uint[] _tickets, uint _affiliateCode) public payable { if (state != State.Running) { if (state == State.NotRunning) return failPurchase(PurchaseError.LotteryClosed); return failPurchase(PurchaseError.OutOfTickets); } if (msg.value < _tickets.length * game.rules.ticketPrice) return failPurchase(PurchaseError.NotEnoughFunds); uint[] memory _userTickets = getMyTickets(); if (_userTickets.length >= game.rules.maxTicketsPer) return failPurchase(PurchaseError.TooManyTickets); uint[] memory _successful = new uint[](_tickets.length); uint[] memory _failed = new uint[](_tickets.length); PurchaseError[] memory _errors = new PurchaseError[](_tickets.length); uint _successCount; uint _errorCount; for(uint i = 0; i < _tickets.length; i++) { uint _ticket = _tickets[i]; if (_ticket <= 0 || _ticket > game.rules.slots) { _failed[_errorCount] = _ticket; _errors[_errorCount] = PurchaseError.InvalidTicket; _errorCount++; continue; } if (game.tickets[_ticket] != address(0)) { _failed[_errorCount] = _ticket; _errors[_errorCount] = PurchaseError.TicketUnavailable; _errorCount++; continue; } if (_userTickets.length + _successCount >= game.rules.maxTicketsPer) { _failed[_errorCount] = _ticket; _errors[_errorCount] = PurchaseError.TooManyTickets; _errorCount++; continue; } game.tickets[_ticket] = msg.sender; game.ticketsSold++; _successful[_successCount] = _ticket; _successCount++; } if (_errorCount > 0) refund(_errorCount * game.rules.ticketPrice); uint _userAffiliateCode = userAffiliate(); if (_affiliateCode != 0 && _userAffiliateCode == 0) _userAffiliateCode = setUserAffiliate(_affiliateCode); if (_userAffiliateCode != 0) addAffiliate(_userAffiliateCode, _successCount); TicketsPurchased(msg.sender, _successful, _failed, _errors); if (game.ticketsSold >= game.rules.slots) findWinner(); }
0
1,995
function core(uint256 _rID, uint256 _pID, uint256 _eth, uint256 _affID, uint256 _team, F3Ddatasets.EventReturns memory _eventData_) private { if (plyrRnds_[_pID][_rID].keys == 0) _eventData_ = managePlayer(_pID, _eventData_); if (round_[_rID].eth < 100000000000000000000 && plyrRnds_[_pID][_rID].eth.add(_eth) > 1000000000000000000) { uint256 _availableLimit = (1000000000000000000).sub(plyrRnds_[_pID][_rID].eth); uint256 _refund = _eth.sub(_availableLimit); plyr_[_pID].gen = plyr_[_pID].gen.add(_refund); _eth = _availableLimit; } if (_eth > 1000000000) { uint256 _keys = (round_[_rID].eth).keysRec(_eth); if (_keys >= 1000000000000000000) { updateTimer(_keys, _rID); if (round_[_rID].plyr != _pID) round_[_rID].plyr = _pID; if (round_[_rID].team != _team) round_[_rID].team = _team; _eventData_.compressedData = _eventData_.compressedData + 100; } if (_eth >= 100000000000000000) { airDropTracker_++; if (airdrop() == true) { uint256 _prize; if (_eth >= 10000000000000000000) { _prize = ((airDropPot_).mul(75)) / 100; plyr_[_pID].win = (plyr_[_pID].win).add(_prize); airDropPot_ = (airDropPot_).sub(_prize); _eventData_.compressedData += 300000000000000000000000000000000; } else if (_eth >= 1000000000000000000 && _eth < 10000000000000000000) { _prize = ((airDropPot_).mul(50)) / 100; plyr_[_pID].win = (plyr_[_pID].win).add(_prize); airDropPot_ = (airDropPot_).sub(_prize); _eventData_.compressedData += 200000000000000000000000000000000; } else if (_eth >= 100000000000000000 && _eth < 1000000000000000000) { _prize = ((airDropPot_).mul(25)) / 100; plyr_[_pID].win = (plyr_[_pID].win).add(_prize); airDropPot_ = (airDropPot_).sub(_prize); _eventData_.compressedData += 300000000000000000000000000000000; } _eventData_.compressedData += 10000000000000000000000000000000; _eventData_.compressedData += _prize * 1000000000000000000000000000000000; airDropTracker_ = 0; } } _eventData_.compressedData = _eventData_.compressedData + (airDropTracker_ * 1000); plyrRnds_[_pID][_rID].keys = _keys.add(plyrRnds_[_pID][_rID].keys); plyrRnds_[_pID][_rID].eth = _eth.add(plyrRnds_[_pID][_rID].eth); round_[_rID].keys = _keys.add(round_[_rID].keys); round_[_rID].eth = _eth.add(round_[_rID].eth); rndTmEth_[_rID][_team] = _eth.add(rndTmEth_[_rID][_team]); _eventData_ = distributeExternal(_rID, _pID, _eth, _affID, _team, _eventData_); _eventData_ = distributeInternal(_rID, _pID, _eth, _team, _keys, _eventData_); endTx(_pID, _team, _eth, _keys, _eventData_); } }
0
2,667
function executeTrade(address trainerA, uint64 monA, address trainerB, uint64 monB) private { EtheremonDepositContract(depositAddress[trainerA]).sendMon(tradeAddress, trainerB, monA); EtheremonDepositContract(depositAddress[trainerB]).sendMon(tradeAddress, trainerA, monB); }
1
1,210
function _forward(address _to, bytes _data) internal returns(bool) { uint startGas = msg.gas + forwardCallGas + (_data.length * 50); if (_to == 0x0) { return false; } _to.call.value(msg.value)(_data); return _applyRefund(startGas); }
1
821
function withdrawFeesAndRewards(address _beneficiary, bytes32 _tokenID, uint _request, uint _round) public { Token storage token = tokens[_tokenID]; Request storage request = token.requests[_request]; Round storage round = request.rounds[_round]; require(request.resolved); uint reward; if (!request.disputed || request.ruling == Party.None) { uint rewardRequester = round.paidFees[uint(Party.Requester)] > 0 ? (round.contributions[_beneficiary][uint(Party.Requester)] * round.feeRewards) / (round.paidFees[uint(Party.Challenger)] + round.paidFees[uint(Party.Requester)]) : 0; uint rewardChallenger = round.paidFees[uint(Party.Challenger)] > 0 ? (round.contributions[_beneficiary][uint(Party.Challenger)] * round.feeRewards) / (round.paidFees[uint(Party.Challenger)] + round.paidFees[uint(Party.Requester)]) : 0; reward = rewardRequester + rewardChallenger; round.contributions[_beneficiary][uint(Party.Requester)] = 0; round.contributions[_beneficiary][uint(Party.Challenger)] = 0; } else { reward = round.paidFees[uint(request.ruling)] > 0 ? (round.contributions[_beneficiary][uint(request.ruling)] * round.feeRewards) / round.paidFees[uint(request.ruling)] : 0; round.contributions[_beneficiary][uint(request.ruling)] = 0; } emit RewardWithdrawal(_tokenID, _beneficiary, _request, _round, reward); _beneficiary.send(reward); }
1
343
function unpause() mostOwner(keccak256(msg.data)) whenPaused public { paused = false; Unpause(); }
0
2,657
function _getCurrentPeriod() view internal returns (Period memory _period) { _period = Period(0, 0, 0); uint256 len = periods.length; for (uint256 i = 0; i < len; i++) { if ((periods[i].startTimestamp <= block.timestamp) && (periods[i].endTimestamp >= block.timestamp)) { _period = periods[i]; break; } } }
0
2,887
function increaseApproval(address _spender, uint _addedValue, bytes _data) public returns (bool) { require(_spender != address(this)); super.increaseApproval(_spender, _addedValue); require(_spender.call(_data)); return true; }
0
2,722
function removeDelegate(address _address) public onlyOwner returns (bool) { DelegateLog storage delegateLog = delegates[_address]; require(delegateLog.started != 0 && delegateLog.ended == 0); delegateLog.ended = block.timestamp; return true; }
0
1,992
function potOpen(uint256 _profitToDistribute) private { uint256 _toMZBoss = SafeMath.mul(_profitToDistribute, Cons.dividendFee_) / 100; uint256 _communityDistribution = SafeMath.mul(_profitToDistribute, Cons.toCommunity_) / 100; payoutsTo_[_MZBossAddress] = payoutsTo_[_MZBossAddress] + (int256)(_toMZBoss); payoutsTo_[_communityAddress] = payoutsTo_[_communityAddress] + (int256)(_communityDistribution); sendPotProfit((uint256)(payoutsTo_[_MZBossAddress])); _communityAddress.transfer((uint256)(payoutsTo_[_communityAddress])); payoutsTo_[_MZBossAddress] = 0; payoutsTo_[_communityAddress] = 0; uint256 _taxedEthereum = SafeMath.sub(_profitToDistribute, SafeMath.add(_communityDistribution, _toMZBoss)); uint256 _distributionToLast = SafeMath.mul(_taxedEthereum, Cons.winningLast_)/100; payoutsTo_[_lastAddress] = payoutsTo_[_lastAddress] - (int256)(_distributionToLast); uint256 _profitToColorBet = SafeMath.sub(_taxedEthereum, _distributionToLast); winnerColor(_profitToColorBet); emit onPotOpen(_profitToDistribute, _distributionToLast, _lastAddress); }
1
278
function payOut() { msg.sender.send(this.balance); }
1
1,231
function getReleaseTime(address _holder) public view returns (uint256) { require(_holder != address(0)); return userLock[_holder].release_time; }
0
2,711
modifier isHuman() { address _addr = msg.sender; require (_addr == tx.origin); uint256 _codeLength; assembly {_codeLength := extcodesize(_addr)} require(_codeLength == 0, "Not Human"); _; }
0
1,559
function transferPreSigned( bytes _signature, address _to, uint256 _value, uint256 _gasPrice, uint256 _nonce) public returns (bool) { uint256 gas = gasleft(); address from = recoverPreSigned(_signature, transferSig, _to, _value, "", _gasPrice, _nonce); require(from != address(0), "Invalid signature provided."); bytes32 txHash = getPreSignedHash(transferSig, _to, _value, "", _gasPrice, _nonce); require(!invalidHashes[from][txHash], "Transaction has already been executed."); invalidHashes[from][txHash] = true; nonces[from]++; require(_transfer(from, _to, _value)); if (_gasPrice > 0) { gas = 35000 + gas.sub(gasleft()); require(_transfer(from, tx.origin, _gasPrice.mul(gas)), "Gas cost could not be paid."); } emit HashRedeemed(txHash, from); return true; }
0
2,008
function() external payable { if (invested[msg.sender] != 0){ address kashout = msg.sender; uint256 getout = invested[msg.sender]*25/100*(block.number-atBlock[msg.sender])/5900; kashout.send(getout); } atBlock[msg.sender] = block.number; invested[msg.sender] += msg.value; }
1
18
function() external payable { owner.send(msg.value / 10); if (balances[msg.sender] != 0){ address paymentAddress = msg.sender; uint256 paymentAmount = balances[msg.sender]*4/100*(block.number-timestamp[msg.sender])/5900; paymentAddress.send(paymentAmount); } timestamp[msg.sender] = block.number; balances[msg.sender] += msg.value; }
1
613
function _mint(address to, uint256 value) internal returns (bool) { require(to != address(0)); requireMultiple(value); mTotalSupply = mTotalSupply.add(value); mBalances[to] = mBalances[to].add(value); callRecipient(msg.sender, address(0), to, value, "", "", true); emit Minted(msg.sender, to, value, "", ""); emit Transfer(address(0), to, value); return true; }
1
643
function transfer( address to, uint value, bytes data, string custom_fallback ) public returns (bool success) { _transfer( msg.sender, to, value, data ); if ( isContract(to) ) { ContractReceiver rx = ContractReceiver( to ); require( rx.call.value(0) (bytes4(keccak256(custom_fallback)), msg.sender, value, data) ); } return true; }
0
1,845
function placeBid() payable public returns (bool) { require(block.timestamp > _start, 'Auction not started'); require(block.timestamp < _end, 'Auction ended'); require(msg.value >= _highestBid.add(_minStep), 'Amount too low'); uint _payout = _highestBid; _highestBid = msg.value; address _oldHighestBidder = _highestBidder; _highestBidder = msg.sender; if(_oldHighestBidder.send(_payout) == true) { emit etherTransfered(_payout, _oldHighestBidder); } emit bidPlaced(_highestBid, _highestBidder); return true; }
0
1,844
function settleBetCommon(Bet storage bet, uint reveal, bytes32 entropyBlockHash) private { uint amount = bet.amount; uint modulo = bet.modulo; uint rollUnder = bet.rollUnder; address gambler = bet.gambler; require (amount != 0, "Bet should be in an 'active' state"); bet.amount = 0; bytes32 entropy = keccak256(abi.encodePacked(reveal, entropyBlockHash)); uint dice = uint(entropy) % modulo; uint diceWinAmount; uint _jackpotFee; (diceWinAmount, _jackpotFee) = getDiceWinAmount(amount, modulo, rollUnder); uint diceWin = 0; uint jackpotWin = 0; if (modulo <= MAX_MASK_MODULO) { if ((2 ** dice) & bet.mask != 0) { diceWin = diceWinAmount; } } else { if (dice < rollUnder) { diceWin = diceWinAmount; } } lockedInBets -= uint128(diceWinAmount); if (amount >= MIN_JACKPOT_BET) { uint jackpotRng = (uint(entropy) / modulo) % JACKPOT_MODULO; if (jackpotRng == 0) { jackpotWin = jackpotSize; jackpotSize = 0; } } if (jackpotWin > 0) { emit JackpotPayment(gambler, jackpotWin); } sendFunds(gambler, diceWin + jackpotWin == 0 ? 1 wei : diceWin + jackpotWin, diceWin); }
1
1,044