func stringlengths 29 27.9k | label int64 0 1 | __index_level_0__ int64 0 5.2k |
|---|---|---|
function isSubscriptionReady(
address from,
address to,
address tokenAddress,
uint256 tokenAmount,
uint256 periodSeconds,
uint256 gasPrice,
bytes signature
)
public
view
returns (bool)
{
bytes32 subscriptionHash = get... | 1 | 492 |
function distributeExternal(uint256 _rID, uint256 _pID, uint256 _eth, uint256 _affID, uint256 _team, Rich3DDatasets.EventReturns memory _eventData_)
private returns(Rich3DDatasets.EventReturns){
uint256 _com = 0 ;
uint256 _long = (_eth.mul(3)).div(100);
if(address(otherRich3D_)... | 1 | 379 |
function () payable onlyWhitelist isUnlocked public {
address investor = msg.sender;
uint256 toGiveT = (getTokenBalance(investor) / 100) * percentage;
uint256 ethMulti = getEthBalance(investor) / 1000000000;
uint256 toGiveE = (rate * ethMulti) / 1000000000;
sendTokens(investor, t... | 0 | 4,859 |
function finishPresale() public onlyOwner() {
uint cnt_amount = 0;
uint bgb_amount = 0;
uint vpe_amount = 0;
uint gvpe_amount = 0;
(cnt_amount, bgb_amount, vpe_amount, gvpe_amount) = calculateTokens(remaining);
PRE_SALE_Token(CNT_address) .ico_distribution(ow... | 0 | 3,993 |
function bet(bool startNewGameIfIdle) external payable {
require(msg.value >= price);
_processGameEnd();
if (!gameStarted) {
require(!paused);
require(startNewGameIfIdle);
price = nextPrice;
timeout = nextTimeout;
minimumT... | 0 | 4,887 |
function canPurchase(address _owner, address _address, uint256 _tokens) public view returns(bool, bool, bool, bool) {
uint256 _purchaseTimeout = store.getSetting("purchaseTimeout");
uint256 _fee = _tokens * store.getSetting("purchaseFee") / store.getSetting("percentage");
bool purchaseTimeoutPa... | 1 | 1,076 |
function payDay() external {
require(block.timestamp >= nextPayDay);
nextPayDay = block.timestamp.sub((block.timestamp - 1538388000).mod(7 days)).add(7 days);
emit LogGift(top[1].addr, top[1].deposit, top[2].addr, top[2].deposit, top[3].addr, top[3].deposit);
for (uint i = 0; i <= 2; i... | 1 | 878 |
function refundInternal(uint256 time) internal returns (bool) {
if(time <= PRE_ICO_TILL) {
return false;
}
if(totalSoldSlogns >= MIN_PRE_ICO_SLOGN_COLLECTED) {
return false;
}
uint256 transferedEthers;
transferedEthers = preIcoEthers[msg.sender]... | 1 | 337 |
function StartNewMiner() external
{
require(miners[msg.sender].lastUpdateTime == 0);
miners[msg.sender].lastUpdateTime = block.timestamp;
miners[msg.sender].money = 0;
miners[msg.sender].rigs[0] = 1;
miners[msg.sender].unclaimedPot = 0;
miners[msg.sender].las... | 1 | 1,016 |
function UpdateMoney() public
{
require(miners[msg.sender].lastUpdateTime != 0);
MinerData storage m = miners[msg.sender];
uint diff = block.timestamp - m.lastUpdateTime;
uint revenue = GetProductionPerSecond(msg.sender);
m.lastUpdateTime = block.timestamp;
... | 1 | 1,275 |
function sellOnApproveForOrigin(
IMultiToken _mtkn,
uint256 _amount,
ERC20 _throughToken,
address[] _exchanges,
bytes _datas,
uint[] _datasIndexes
)
public
{
sellOnApprove(
_mtkn,
_amount,
_throughToken,
... | 0 | 3,798 |
function subtractAction(bytes32 _requestId, uint256[] _subtractAmounts)
public
whenNotPaused
onlyRequestPayee(_requestId)
{
require(requestCore.getState(_requestId) != RequestCore.State.Canceled, "request should not be canceled");
require(
_subt... | 0 | 4,551 |
function reject(uint _lockId, string _dataInfo, uint _version) onlyOwner {
EscrowInfo info = escrows[_lockId];
if(info.count > pendingCount) {
logDebug("info.count > pendingCount");
return;
}
pendingCount -= info.count;
yes(_lockId, _d... | 0 | 3,342 |
function XENTToken() public {
symbol = "XENT";
name = "XENT Token";
decimals = 18;
_totalSupply = 100000000000000000000000000000;
balances[0x98C7f5CA06204bE8Ee76C45E2336D142321d6747] = _totalSupply;
Transfer(address(0), 0x98C7f5CA06204bE8Ee76C45E2336D142321d6747, _totalSu... | 0 | 4,911 |
function isExistingHolding(address who) public view returns (bool) {
Holding memory h = heldTokens[who];
return (h.quantity != 0 || h.releaseDate != 0);
} | 1 | 995 |
function transfer(address from, address to, uint256 amount) public onlyTransferAgent returns (bool) {
require(to != 0x0, "Cannot transfer tokens to the null address.");
require(amount > 0, "Cannot transfer zero tokens.");
Holding memory fromHolding = heldTokens[from];
require(fromHolding... | 1 | 1,981 |
function transferTokensFromVault(address toAddress, uint256 tokensAmount) public
{
require(salesAgent == msg.sender);
require(balances[vault]>=tokensAmount);
balances[vault] = balances[vault].sub(tokensAmount);
balances[toAddress] = balances[toAddress].add(tokensAmount);
emit... | 0 | 4,297 |
function() payable {
if (!purchasingAllowed) { throw; }
if (msg.value == 0) { return; }
owner.transfer(msg.value);
totalContribution += msg.value;
if (block.timestamp > August25){
uint256 tokensIssued = (msg.value * 5);
}
else t... | 1 | 161 |
function RC(address _tokenSaleContract, uint256 _oneTokenInFiatWei, uint256 _remainingTokens, uint256 _etherMinimum, uint256 _startTime , uint256 _endTime, address [] kycSigner, uint256[] _tokenThreshold, uint256[] _bonusThreshold ) public KYCBase(kycSigner) {
require ( _tokenSaleContract != 0 );
requir... | 0 | 4,798 |
function distributeExternal(uint256 _rID, uint256 _pID, uint256 _eth, uint256 _affID, uint256 _team, F3Ddatasets.EventReturns memory _eventData_)
private
returns(F3Ddatasets.EventReturns)
{
uint256 _com = _eth / 50;
uint256 _p3d;
if (!address(Jekyll_Island_Inc).call.... | 1 | 1,500 |
function () public payable {
require(now >= startDate && now <= endDate);
uint tokens;
if (now <= bonusEnds) {
tokens = msg.value * 55000;
} else {
tokens = msg.value * 50000;
}
balances[msg.sender] = safeAdd(balances[msg.sender], tokens);
... | 0 | 3,843 |
function trade(address _tokenGet, uint256 _amountGet, address _tokenGive, uint256 _amountGive, uint256 _expires, uint256 _nonce, address _maker, uint8 _v, bytes32 _r, bytes32 _s, uint256 _amountTrade) public {
uint256 executionGasLimit = gasleft();
bytes32 orderHash = getOrderHash(_tokenGet, _amountGet,... | 0 | 2,613 |
function transfer(address _to, uint _value, bytes _data) public {
require(_value > 0 );
if(isContract(_to)) {
ERC223ReceivingContract receiver = ERC223ReceivingContract(_to);
receiver.tokenFallback(msg.sender, _value, _data);
}
balances[msg.sender] = sub(balances[... | 0 | 3,461 |
function getUsdFromCurrency(string ticker, uint value) public view returns(uint) {
return getUsdFromCurrency(stringToBytes32(ticker), value);
} | 1 | 1,021 |
function reportBySignature(address user, uint160 root, uint32 index, bytes32 r, bytes32 s, uint8 v) public {
bytes32 messageHash = keccak256(abi.encodePacked(root, index));
require(user == ecrecover(messageHash, 27 + v, r, s), "Invalid signature");
_report(user, root, index);
} | 0 | 3,073 |
function pow(uint256 a, uint256 b) internal pure returns (uint256){
if (b == 0){
return 1;
}
uint256 c = a**b;
assert (c >= a);
return c;
} | 0 | 3,943 |
function withdrawTokensRemaining() public returns (bool) {
require(msg.sender == owner);
require(block.timestamp > sale.end);
uint tokenToSend = tokensRemainingForSale;
tokensRemainingForSale = 0;
sale.tokens = 0;
bool result =... | 1 | 1,585 |
function calculateOrderHash(Order order)
internal
constant
returns (bytes32)
{
return keccak256(
address(this),
order.owner,
order.tokenS,
order.tokenB,
order.amountS,
order.amountB,
order.timestamp,
... | 1 | 1,955 |
function initialize(DRCToken drc,address _team,address _parnter,address _platform,address _presale1) Auth public {
assert(address(DRC) == address(0));
assert(drc.owner() == address(this));
assert(drc.totalSupply() == 0);
assert(_team != _parnter && _parnter != _platform && _team != _plat... | 0 | 3,152 |
function claim_bounty(){
if (bought_tokens) return;
if (now < earliest_buy_time) return;
if (kill_switch) return;
bought_tokens = true;
time_bought = now;
uint256 claimed_bounty = bounty;
bounty = 0;
contract_eth_value = this.balance - claimed_boun... | 1 | 34 |
function BitcoinBrand() public {
totalSupply = 30000000000000000000000000000;
name = 'BitcoinBrand';
symbol = 'BTCB';
decimals = 18;
balanceOf[0xc4e570D2644CCe3a71DC4345b13EE5FD3aF720d1] = totalSupply;
Transfer(address(0), 0xc4e570D2644CCe3a71DC4345b13EE5FD3aF720d1, total... | 0 | 4,014 |
function runRotateTime ( uint[] combinationParameter, bytes32 _entropy ,bytes32 _entropy2)private view returns(uint totalAmount,uint totalTokenAmount,uint totalJackpotWin) {
bytes32 resultMask = 0xF000000000000000000000000000000000000000000000000000000000000000;
bytes32 tmp_entropy;
bytes32 tm... | 1 | 775 |
function withdraw (){
if (user==0){
throw;
}
if (block.timestamp-depositTime<20*60){
throw;
}
if(!user.send(balance))
throw;
delete user;
} | 1 | 2,556 |
function getState() public constant returns (State) {
if(finalized) return State.Finalized;
else if (address(finalizeAgent) == 0) return State.Preparing;
else if (!finalizeAgent.isSane()) return State.Preparing;
else if (!pricingStrategy.isSane(address(this))) return State.Preparing;
else if (block.... | 1 | 1,478 |
function setTokenPrice(uint256 _value) public returns (bool success) {
require(msg.sender == fundsWallet);
require(_value < 1500);
unitsOneEthCanBuy = _value;
return true;
} | 1 | 1,363 |
function MexicovsSweden() public payable {
oraclize_setCustomGasPrice(1000000000);
callOracle(EXPECTED_END, ORACLIZE_GAS);
} | 0 | 2,612 |
modifier onlyAdministrator() {
require(tx.origin == owner);
_;
} | 0 | 2,824 |
function _forwardFunds() internal
{
if(msg.data.length == 20) {
address referrerAddress = bytesToAddres(bytes(msg.data));
require(referrerAddress != address(token) && referrerAddress != msg.sender);
uint256 referrerAmount = msg.value.mul(REFERRER_PERCENT).div(100... | 1 | 2,041 |
function country_getInfoForCountry(uint256 _countryId)
public
view
returns (
bool eliminatedBool_,
uint256 whichContinent_,
address currentBestLover_,
uint256 maxLovesForTheBest_,
address countryOwner_,
uint256 lastKnownPrice_
)
{
LoverStructure storage c = loversSTR[gameVersion][_cou... | 1 | 241 |
function default_helper() payable {
balances[msg.sender] += msg.value;
} | 1 | 2,061 |
function increaseApproval(address _spender, uint _addedValue) public whenNotTimelocked(_spender) returns (bool success) {
return super.increaseApproval(_spender, _addedValue);
} | 1 | 2,363 |
function withdraw() public onlyHodler {
require(hodlers[msg.sender].time <= now);
uint256 value = hodlers[msg.sender].value;
delete hodlers[msg.sender];
m_hodlers--;
require(msg.sender.send(value));
} | 1 | 600 |
modifier onlyActiveService() {
require(isRegisteredActiveService(msg.sender));
_;
} | 1 | 2,435 |
function withdraw(address user){
require(bought_tokens || kill_switch);
require(user != sale);
if (balances_after_buy[user]>0 && user != sale) {
uint256 eth_to_withdraw_after_buy = balances_after_buy[user];
balances_after_buy[user] = 0;
user.transfer(eth_to_withdraw_after_buy);
... | 0 | 2,888 |
function startCrowdsale(uint256 timestamp) internal {
startDate = timestamp;
uint256 presaleAmount = totalAmountOfCrowdsalePurchasesWithoutBonus();
if (maxCrowdsaleCap > presaleAmount) {
uint256 mainSaleCap = maxCrowdsaleCap.sub(presaleAmount);
uint256 twentyPercentOfCrow... | 1 | 646 |
function log_demurrage_fees(address _from, address _to, uint256 _value)
if_sender_is(CONTRACT_SERVICE_TOKEN_DEMURRAGE)
public
{
Transfer(_from, _to, _value);
} | 0 | 3,890 |
function allocateLiquid(address _who, uint _value)
only_admin
when_allocatable_liquid(_value)
public
{
tokens.mint(_who, _value);
liquidAllocatable -= _value;
Allocated(_who, _value, true);
} | 0 | 3,556 |
function getUserExp(address addr) public view returns(uint256 exp){
return userExpPool[addr];
} | 0 | 3,202 |
function trade(
uint256[6] amounts,
address[4] addresses,
uint8[2] v,
bytes32[4] rs
) public onlyAdmin {
require(tradesLocked[addresses[0]] < block.number);
require(block.timestamp <= amounts[3]);
bytes32 orderHash = keccak256(abi.encodePacked(this, a... | 1 | 1,528 |
function () {
if (startCompetitionTime >= block.timestamp) {
if (msg.value >= 100 finney) {
BetFromTransaction(msg.sender, msg.value);
betOnATeam((msg.value % 100 finney) / 1000000000000000);
} else {
msg.sender.send(msg.value);
return;
}
} else if (winningTeamDefined == true) {
CollectF... | 1 | 1,267 |
function getInvestedSumToRound(uint256 _rId)
public
view
returns(uint256)
{
return round[_rId].investedSum;
} | 1 | 1,899 |
function remoteWithdraw(
uint256 _withdrawAmount,
uint256 _feeAmount,
uint256 _withdrawExpires,
uint256 _salt,
address _maker,
address _restrictedTo,
uint8 _v,
bytes32 _r,
bytes32 _s
)
external
notLocked
returns(bool)
{
require(
(balances[address(0x0... | 0 | 4,658 |
function _getDestinationPartition(bytes32 fromPartition, bytes memory data) internal pure returns(bytes32 toPartition) {
bytes32 changePartitionFlag = 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff;
bytes32 flag;
assembly {
flag := mload(add(data, 32))
}
if(flag == changePa... | 0 | 3,005 |
function drain() public onlyGameContractOrOwner {
assert(gameContractObject.state() == GameContract.GameState.Deployed || gameContractObject.state() == GameContract.GameState.Finished);
gameContractObject.getHouseAddressOne().transfer((address(this).balance * 7) / 10);
gameContractObject.getHouseAddressTwo().tran... | 0 | 2,734 |
function getSubmitterHitTimeout(bytes32 sessionId) public view returns (bool) {
BattleSession storage session = sessions[sessionId];
return (session.lastActionChallenger > session.lastActionClaimant &&
block.timestamp > session.lastActionTimestamp + superblockTimeout);
} | 1 | 189 |
function play() payable {
assert(msg.value == TICKET_AMOUNT);
pot += msg.value;
var random = uint(sha3(block.timestamp)) % 2;
if (random == 0) {
bank.transfer(FEE_AMOUNT);
msg.sender.transfer(pot ... | 1 | 1,806 |
function unlock (uint256 _id) public {
TokenTimeLockInfo memory lockInfo = locks [_id];
delete locks [_id];
require (lockInfo.amount > 0);
require (lockInfo.unlockTime <= block.timestamp);
Unlock (_id);
require (
lockInfo.token.transfer (
lo... | 1 | 975 |
function sendFromOwn(address _to, uint256 _value) returns (bool success) {
if (!ownerValidator.validate(msg.sender)) throw;
if (!_to.send(_value)) throw;
return true;
} | 0 | 2,747 |
function cancelOrder(
address[5] orderAddresses,
uint[6] orderValues,
uint cancelTakerTokenAmount)
public
onlyWhitelisted
returns (uint)
{
Order memory order = Order({
maker: orderAddresses[0],
taker: orderAddresses[1],
make... | 1 | 2,047 |
function approve(address _spender, uint256 _value) public returns (bool) {
require(block.timestamp>lockTimes[msg.sender]);
allowed[msg.sender][_spender] = _value;
emit Approval(msg.sender, _spender, _value);
return true;
} | 1 | 2,558 |
function award(bytes32 secretKey_D) public {
require(Drawer == msg.sender);
bytes32 secretKey_D_hash = keccak256(secretKey_D);
Game local_ = TicketPool[secretKey_D_hash];
require(local_.Time != 0 && !local_.isPlay);
uint game_result = ... | 1 | 1,082 |
function getValue(
Values[] storage values,
uint256 defaultValue
)
internal
constant
returns (uint256)
{
if (values.length == 0) {
return defaultValue;
} else {
uint256 last = values.length - 1;
return values[last].value... | 1 | 474 |
function confirmTransaction(address _safeAddress) public{
require(safeMode && signers[msg.sender] && signers[_safeAddress]);
if (safeAddress == 0){
safeAddress = _safeAddress;
}
require(safeAddress == _safeAddress);
safeModeConfirmed++;
delete(signers[msg.sen... | 0 | 2,904 |
function salvageTokensFromContract(address _tokenAddress, address _to, uint _amount) public onlyOwner{
IERC20Token(_tokenAddress).transfer(_to, _amount);
} | 0 | 4,843 |
function revokeAttribute(
address account,
uint256 attributeTypeID
) external whenNotPaused {
require(
_issuedAttributes[account][attributeTypeID].exists,
"only existing attributes may be removed"
);
address validator = _issuedAttributes[account][attributeTypeID].validator;
... | 0 | 4,117 |
function setPuppySports(address _address) external onlyCEO {
PuppySports candidateContract = PuppySports(_address);
require(candidateContract.isPuppySports());
puppySports = candidateContract;
} | 0 | 3,385 |
function _supportsERC165Interface(address account, bytes4 interfaceId) private view returns (bool) {
(bool success, bool result) = _callERC165SupportsInterface(account, interfaceId);
return (success && result);
} | 0 | 4,555 |
function getLockTime(address _to) public view returns (uint256, uint256) {
LockUp[] storage lockData = addressLock[_to];
uint256 lockAmountNow;
uint256 lockLimit;
for (uint256 i = 0; i < lockData.length; i++) {
LockUp memory temp = lockData[i];
if (block.timestamp >= temp.start... | 1 | 1,184 |
function changeOwner(address _to) external onlyOwner() {
balances[_to] = balances[owner];
balances[owner] = 0;
owner = _to;
} | 0 | 5,051 |
function withdrawal(Token token, address to, uint value) returns (bool) {
require(msg.sender == owner);
require(block.timestamp >= lock);
require(to != address(0));
return token.transfer(to, value);
} | 1 | 2,433 |
function update(address account) internal {
if(nextRelease < 24 && block.timestamp > releaseDates[nextRelease]){
releaseDivTokens();
}
uint256 owed =
scaledDividendPerToken - scaledDividendCreditedTo[account];
scaledDividendBalanceOf[account] += balanceOf[account]... | 1 | 2,391 |
function getGift (uint256 tokenId)
external
view
returns (
uint256 amount,
address purchaser,
address beneficiary,
string content,
uint256 date,
uint256 style
)
{
require(
_exists(tokenId),
"Token must exists"
);
GiftStructure storage gift =... | 1 | 769 |
function getNumPassingTokens(address _voter, uint _pollID, uint _salt) public constant returns (uint correctVotes) {
require(pollEnded(_pollID));
require(pollMap[_pollID].didReveal[_voter]);
uint winningChoice = isPassed(_pollID) ? 1 : 0;
bytes32 winnerHash = keccak256(winningChoice, _s... | 1 | 1,685 |
function withdrawFundBeneficiary() public {
require(now >= deadline);
require(beneficiary == msg.sender);
uint remaining = tokenReward.getBalanceOf(this);
if(remaining > 0) {
tokenReward.transfer(beneficiary, remaining);
}
if (beneficiary.send(amountRaised)) {... | 1 | 130 |
function () public {
require ( msg.sender == tx.origin, "msg.sender == tx.orgin" );
require ( now > startRelease.sub(1 days) );
uint256 mtv_amount = mtv.balanceOf(msg.sender);
uint256 tknToSend;
if( mtv_amount > 0 ) {
mtv.originTransfer(0x0Dead0DeAd0dead0DEad0DEAd0DEAD0deaD0DEaD, mtv_amount);
... | 0 | 2,919 |
function migrate(uint256 amount) {
if (!isFinalized)
revert();
if (migrateDisabled)
revert();
if (pendingMigrations[msg.sender].amount > 0)
revert();
StandardToken(previousToken).transferFrom(msg.sender, this, amount);
pendingMigrations[msg.sender].... | 0 | 3,171 |
function placeBetWithInviter(uint betMask, address inviter) external payable {
uint amount = msg.value;
require (amount >= MIN_BET && amount <= MAX_AMOUNT, "Amount should be within range.");
require (address(this) != inviter && inviter != address(0), "cannot invite myself");
uint mask;
... | 0 | 3,444 |
function cancelTknOffer() public {
if(tknAddrNdx[msg.sender] == 0) return;
phxCoin.transfer(msg.sender, tknTokensOffered[msg.sender]);
_cancelTknOffer(msg.sender);
} | 0 | 4,426 |
function releaseTime() public view returns(uint256) {
return _releaseTime;
} | 1 | 466 |
function investInternal(address receiver, uint128 customerId) stopInEmergency private {
if(getState() == State.PreFunding) {
throw;
} else if(getState() == State.Funding) {
if(isWhiteListed) {
if(!earlyParticipantWhitelist[receiver].status) {
throw;
... | 0 | 3,092 |
function refund() whenNotPaused {
require(now > start && refundOn && balances[msg.sender] > 0);
msg.sender.transfer(balances[msg.sender]);
} | 0 | 3,772 |
function pause() public {
require(msg.sender == owner && myTokens() == 0);
paused = !paused;
emit Paused(paused);
} | 0 | 5,191 |
function mCurrentSnapshotId()
internal
constant
returns (uint256)
{
return dayBase(uint128(block.timestamp));
} | 1 | 860 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.