func
stringlengths
26
11k
label
int64
0
1
__index_level_0__
int64
0
2.89k
function PrivateSale(address _tokenSaleContract, uint256 _oneTokenInEurWei, uint256 _remainingTokens, uint256 _startTime , uint256 _endTime ) public { require ( _tokenSaleContract != 0 ); require ( _oneTokenInEurWei != 0 ); require( _remainingTokens != 0 ); tokenSaleContract = TokenSale(_tokenSaleContract); tokenSaleContract.addMeByRC(); soldTokens = 0; remainingTokens = _remainingTokens; oneTokenInEurWei = _oneTokenInEurWei; setTimeRC( _startTime, _endTime ); }
0
2,169
function chooseWinner() private { address seed1 = contestants[uint(block.coinbase) % totalTickets].addr; address seed2 = contestants[uint(msg.sender) % totalTickets].addr; uint seed3 = block.difficulty; bytes32 randHash = keccak256(seed1, seed2, seed3); uint winningNumber = uint(randHash) % totalTickets; address winningAddress = contestants[winningNumber].addr; RaffleResult(raffleId, winningNumber, winningAddress, seed1, seed2, seed3, randHash); raffleId++; nextTicket = 0; winningAddress.transfer(prize); feeAddress.transfer(fee); }
0
1,638
function claimDividends() payable public onlyThenCompletedICO { sendDividends(msg.sender, 0); }
1
1,095
function buyCopper(uint256 _CopperPrice, uint256 _expiration, uint8 _v, bytes32 _r, bytes32 _s ) payable external { require(_expiration >= block.timestamp); address signer = ecrecover(keccak256(_CopperPrice, _expiration), _v, _r, _s); require(signer == neverdieSigner); require(msg.value >= _CopperPrice); assert(ndc.transfer(msg.sender, COPPER_AMOUNT_NDC) && tpt.transfer(msg.sender, COPPER_AMOUNT_TPT) && skl.transfer(msg.sender, COPPER_AMOUNT_SKL) && xper.transfer(msg.sender, COPPER_AMOUNT_XPER)); emit BuyCopper(msg.sender, _CopperPrice, msg.value); }
1
1,130
function withdrawEther() payable onlyOwner returns (bool) { return owner.send(this.balance); }
1
1,294
function foundationWithdraw() external { require (isAdmin[msg.sender] == true || msg.sender == foundationFund); require (adminBalance > 0, "there must be a balance"); uint256 balance = foundationBalance; foundationBalance = 0; foundationFund.call.value(balance).gas(100000)(); emit adminWithdrew(balance, msg.sender, "an admin just withdrew to the foundation fund"); }
1
860