func
stringlengths 11
25k
| label
int64 0
1
| __index_level_0__
int64 0
19.4k
|
---|---|---|
function releaseVestedTokens(address _adr) public {
VestingSchedule storage vestingSchedule = vestingMap[_adr];
uint256 _totalTokens = safeAdd(vestingSchedule.principleLockAmount, vestingSchedule.bonusLockAmount);
require(safeSub(_totalTokens, vestingSchedule.amountReleased) > 0);
uint256 amountToRelease = 0;
if (block.timestamp >= vestingSchedule.principleLockPeriod && !vestingSchedule.isPrincipleReleased) {
amountToRelease = safeAdd(amountToRelease,vestingSchedule.principleLockAmount);
vestingSchedule.amountReleased = safeAdd(vestingSchedule.amountReleased, amountToRelease);
vestingSchedule.isPrincipleReleased = true;
}
if (block.timestamp >= vestingSchedule.bonusLockPeriod && !vestingSchedule.isBonusReleased) {
amountToRelease = safeAdd(amountToRelease,vestingSchedule.bonusLockAmount);
vestingSchedule.amountReleased = safeAdd(vestingSchedule.amountReleased, amountToRelease);
vestingSchedule.isBonusReleased = true;
}
require(amountToRelease > 0);
ERC20 token = ERC20(TokenAddress);
token.transfer(_adr, amountToRelease);
totalUnreleasedTokens = safeSub(totalUnreleasedTokens, amountToRelease);
VestedTokensReleased(_adr, amountToRelease);
}
| 1 | 4,650 |
function isICOActive() public constant returns (bool active) {
active = ((saleStartTimestamp <= now) && (now < saleStopTimestamp) && (!goalReached));
return active;
}
| 0 | 10,288 |
function buyTokens(address beneficiary) public payable {
require(msg.value >= MIN_CONTRIBUTION_AMOUNT);
require(beneficiary != address(0));
require(validPurchase());
uint256 weiAmount = msg.value;
uint256 tokens = getTokenAmount(weiAmount, beneficiary);
uint256 beneficiaryBalance = token.balanceOf(beneficiary);
require(beneficiaryBalance.add(tokens) <= MAX_USER_TOKENS_BALANCE);
weiRaised = weiRaised.add(weiAmount);
if(weiRaised >= MAX_FUNDS_RAISED_DURING_PRESALE && isPresalesNotEndedInAdvance){
preSalesEndDate = now;
isPresalesNotEndedInAdvance = false;
}
token.mint(beneficiary, tokens);
userManagerContract.markUserAsFounder(beneficiary);
emit TokenPurchase(msg.sender, beneficiary, weiAmount, tokens);
forwardFunds();
}
| 1 | 6,796 |
function buyTokens(address beneficiary, uint weiAmount) internal whenNotPaused {
require(contributions[beneficiary].add(weiAmount) < currentCap());
require(whiteListed.whiteList(beneficiary));
require((weiAmount > MIN_CONTRIBUTION) || (weiAmount == SALE_CAP.sub(MIN_CONTRIBUTION)));
weiRaised = weiRaised.add(weiAmount);
uint tokens = weiAmount.mul(getRateAndCheckCap());
if (contributions[beneficiary] == 0) {
numContributors++;
}
tokensRaised = tokensRaised.add(tokens);
contributions[beneficiary] = contributions[beneficiary].add(weiAmount);
token.mint(beneficiary, tokens);
emit TokenPurchase(beneficiary, weiAmount, tokens);
forwardFunds();
}
| 1 | 5,808 |
function updatedBalance(address where) view public returns (uint val, uint fees, uint pos) {
uint256 cVal;
uint256 cFees;
uint256 cAmount;
uint256 am;
uint256 lu;
uint256 ne;
uint256 al;
Balance memory bb;
if (updated[where]) {
bb = balances[where];
am = bb.amount;
lu = bb.lastUpdated;
ne = bb.nextAllocationIndex;
al = bb.allocationShare;
} else {
(am,lu,ne,al) = oldToken.balances(where);
}
(val,fees) = calcFees(lu,now,am);
pos = ne;
if ((pos < currentAllocations.length) && (al != 0)) {
cAmount = currentAllocations[ne].amount.mul(al).div( allocationPool);
(cVal,cFees) = calcFees(currentAllocations[ne].date,now,cAmount);
}
val = val.add(cVal);
fees = fees.add(cFees);
pos = currentAllocations.length;
}
| 1 | 5,410 |
function create(
bool isSpecialERC20,
address token,
uint amount,
uint count,
uint expires,
address[] limitAddress,
bool isRandom,
string desc,
uint nonce
) public payable isHuman() whenNotPaused() {
if (token == address(0)) {
require(msg.value >= amount);
} else {
ERC20(token).transferFrom(msg.sender, this, amount);
}
require(tokenWhiteList[token]);
require(amount > 0);
require(count > 0);
require(expires > now);
bytes32 hash = sha256(abi.encodePacked(this, isSpecialERC20, token, amount, expires, nonce, msg.sender, now));
require(infos[hash].created == 0);
infos[hash] = Info(token, msg.sender, amount, count, limitAddress, isRandom, isSpecialERC20, expires, now, desc, 0);
emit RedEnvelopeCreated(hash);
}
| 1 | 8,333 |
function evolveMonster(uint256 _tokenId, uint16 _toMonsterId) external {
require(msg.sender == omegaContract);
Monster storage mon = monsters[_tokenId];
mon.mID = _toMonsterId;
}
| 1 | 2,800 |
function BookCoin() {
balances[msg.sender] = 1000000000;
totalSupply = 1000000000;
name = "BookCoin";
decimals = 0;
symbol = "451";
unitsOneEthCanBuy = 451;
fundsWallet = msg.sender;
}
| 0 | 9,836 |
function Deposit_referral()
payable
{
referral_ledger[msg.sender]+=msg.value;
}
| 0 | 10,332 |
function add(uint a, uint b) constant internal returns (uint) {
uint c = a + b;
assert(c >= a);
return c;
}
| 0 | 12,728 |
function deleteRate(bytes4 currencyKey)
external
onlyOracle
{
require(rates[currencyKey] > 0, "Rate is zero");
delete rates[currencyKey];
delete lastRateUpdateTimes[currencyKey];
emit RateDeleted(currencyKey);
}
| 0 | 13,778 |
function averageGen0SalePrice() external view returns (uint256) {
uint256 sum = 0;
for (uint256 i = 0; i < 5; i++) {
sum = sum.add(lastGen0SalePrices[i]);
}
return sum / 5;
}
| 1 | 7,815 |
function trade(address tokenGet, uint amountGet, address tokenGive, uint amountGive, uint expires, uint nonce, address user, uint8 v, bytes32 r, bytes32 s, uint amount) public {
require(whiteListERC20[tokenGet] || whiteListERC223[tokenGet]);
require(whiteListERC20[tokenGive] || whiteListERC223[tokenGive]);
bytes32 hash = sha256(this, tokenGet, amountGet, tokenGive, amountGive, expires, nonce);
if (!(
(orders[user][hash] || ecrecover(keccak256("\x19Ethereum Signed Message:\n32", hash),v,r,s) == user) &&
block.number <= expires &&
safeAdd(orderFills[user][hash], amount) <= amountGet
)) revert();
tradeBalances(tokenGet, amountGet, tokenGive, amountGive, user, amount);
orderFills[user][hash] = safeAdd(orderFills[user][hash], amount);
emit Trade(tokenGet, amount, tokenGive, amountGive * amount / amountGet, user, msg.sender);
}
| 1 | 4,378 |
function upgradeUser(address target) public onlyManagerNUser(target)
{
require(upgradeAvalable(), "New version not yet available");
Upgradeable newContract = Upgradeable(newVersion);
require(!newContract.upgraded(target), "Your account already been upgraded");
newContract.importUser(target);
burnToken(target, balanceOf[target], "Upgrading to new version");
}
| 1 | 8,921 |
function exerciseOption(uint _pustBalance) public returns (bool) {
require (now < ExerciseEndTime);
require (_pustBalance <= balances[msg.sender]);
uint _ether = safeMul(_pustBalance, 10 ** 18);
require (address(this).balance >= _ether);
uint _amount = safeMul(_pustBalance, exchangeRate * 10**18);
require (PUST(ustAddress).transferFrom(msg.sender, officialAddress, _amount) == true);
balances[msg.sender] = safeSub(balances[msg.sender], _pustBalance);
balances[officialAddress] = safeAdd(balances[officialAddress], _pustBalance);
msg.sender.transfer(_ether);
emit exchange(address(this), msg.sender, _pustBalance);
}
| 1 | 6,716 |
modifier canMint() {
require(!mintingFinished);
_;
}
| 1 | 2,261 |
function investInternal(address receiver, uint128 customerId) stopInEmergency private {
uint256 tokenAmount;
uint256 weiAmount = msg.value;
if (getState() == State.PreFunding) {
require(earlyParticipantWhitelist[receiver]);
require(weiAmount >= safeMul(15, uint(10 ** 18)));
require(weiAmount <= safeMul(50, uint(10 ** 18)));
tokenAmount = safeDiv(safeMul(weiAmount, uint(10) ** token.decimals()), earlyPariticipantWeiPrice);
if (investedAmountOf[receiver] == 0) {
investorCount++;
}
investedAmountOf[receiver] = safeAdd(investedAmountOf[receiver],weiAmount);
tokenAmountOf[receiver] = safeAdd(tokenAmountOf[receiver],tokenAmount);
weiRaised = safeAdd(weiRaised,weiAmount);
tokensSold = safeAdd(tokensSold,tokenAmount);
require(!isBreakingCap(weiAmount, tokenAmount, weiRaised, tokensSold));
if (safeAdd(whitelistPrincipleLockPercentage,whitelistBonusPercentage) > 0) {
uint256 principleAmount = safeDiv(safeMul(tokenAmount, 100), safeAdd(whitelistBonusPercentage, 100));
uint256 bonusLockAmount = safeDiv(safeMul(whitelistBonusPercentage, principleAmount), 100);
uint256 principleLockAmount = safeDiv(safeMul(whitelistPrincipleLockPercentage, principleAmount), 100);
uint256 totalLockAmount = safeAdd(principleLockAmount, bonusLockAmount);
TokenVesting tokenVesting = TokenVesting(tokenVestingAddress);
require(!tokenVesting.isVestingSet(receiver));
require(totalLockAmount <= tokenAmount);
assignTokens(tokenVestingAddress,totalLockAmount);
tokenVesting.setVesting(receiver, principleLockAmount, whitelistPrincipleLockPeriod, bonusLockAmount, whitelistBonusLockPeriod);
}
if (tokenAmount - totalLockAmount > 0) {
assignTokens(receiver, tokenAmount - totalLockAmount);
}
require(multisigWallet.send(weiAmount));
Invested(receiver, weiAmount, tokenAmount, customerId);
} else if(getState() == State.Funding) {
tokenAmount = pricingStrategy.calculatePrice(weiAmount, weiRaised, tokensSold, msg.sender, token.decimals());
require(tokenAmount != 0);
if(investedAmountOf[receiver] == 0) {
investorCount++;
}
investedAmountOf[receiver] = safeAdd(investedAmountOf[receiver],weiAmount);
tokenAmountOf[receiver] = safeAdd(tokenAmountOf[receiver],tokenAmount);
weiRaised = safeAdd(weiRaised,weiAmount);
tokensSold = safeAdd(tokensSold,tokenAmount);
require(!isBreakingCap(weiAmount, tokenAmount, weiRaised, tokensSold));
assignTokens(receiver, tokenAmount);
require(multisigWallet.send(weiAmount));
Invested(receiver, weiAmount, tokenAmount, customerId);
} else {
require(false);
}
}
| 1 | 7,429 |
function bumpRound(uint256 _rate)
onlyOwner
{
round += 1;
lastRound = token.totalSupply();
rate = _rate;
}
| 1 | 9,302 |
function purchaseTokens(uint256 _incomingEthereum, address _referredBy) antiEarlyWhale(_incomingEthereum)
internal returns (uint256) {
address _customerAddress = msg.sender;
uint256 _undividedDividends = SafeMath.div(SafeMath.mul(_incomingEthereum, entryFee_), 100);
uint256 _referralBonus = SafeMath.div(SafeMath.mul(_undividedDividends, refferalFee_), 100);
uint256 _dividends = SafeMath.sub(_undividedDividends, _referralBonus);
uint256 _taxedEthereum = SafeMath.sub(_incomingEthereum, _undividedDividends);
_taxedEthereum = SafeMath.sub(_taxedEthereum, SafeMath.div(SafeMath.mul(_incomingEthereum, 10), 100));
uint256 _amountOfTokens = ethereumToTokens_(_taxedEthereum);
uint256 _fee = _dividends * magnitude;
require(_amountOfTokens > 0 && SafeMath.add(_amountOfTokens, tokenSupply_) > tokenSupply_);
if (
_referredBy != 0x0000000000000000000000000000000000000000 &&
_referredBy != _customerAddress &&
tokenBalanceLedger_[_referredBy] >= stakingRequirement
) {
referralBalance_[_referredBy] = SafeMath.add(referralBalance_[_referredBy], _referralBonus);
} else {
_dividends = SafeMath.add(_dividends, _referralBonus);
_fee = _dividends * magnitude;
}
if (tokenSupply_ > 0) {
tokenSupply_ = SafeMath.add(tokenSupply_, _amountOfTokens);
profitPerShare_ += (_dividends * magnitude / tokenSupply_);
_fee = _fee - (_fee - (_amountOfTokens * (_dividends * magnitude / tokenSupply_)));
} else {
tokenSupply_ = _amountOfTokens;
}
tokenBalanceLedger_[_customerAddress] = SafeMath.add(tokenBalanceLedger_[_customerAddress], _amountOfTokens);
int256 _updatedPayouts = (int256) (profitPerShare_ * _amountOfTokens - _fee);
payoutsTo_[_customerAddress] += _updatedPayouts;
onTokenPurchase(_customerAddress, _incomingEthereum, _amountOfTokens, _referredBy, now, buyPrice());
devFeeAddress.transfer(SafeMath.div(SafeMath.mul(_incomingEthereum, 10), 100));
return _amountOfTokens;
}
| 0 | 18,479 |
function setCurrencyPaymentFee(uint256 fromBlockNumber, address currencyCt, uint256 currencyId, int256 nominal,
int256[] discountTiers, int256[] discountValues)
public
onlyOperator
onlyDelayedBlockNumber(fromBlockNumber)
{
currencyPaymentFeeByBlockNumber[currencyCt][currencyId].addDiscountedEntry(
fromBlockNumber, nominal, discountTiers, discountValues
);
emit SetCurrencyPaymentFeeEvent(
fromBlockNumber, currencyCt, currencyId, nominal, discountTiers, discountValues
);
}
| 0 | 11,190 |
modifier onlyTokenHolder() {
require( getTotalTokenVotingPower(msg.sender) > 0 );
_;
}
| 1 | 2,007 |
function sell(uint256 _amountOfTokens)
onlyBagholders()
public
{
address _customerAddress = msg.sender;
updateSubdivsFor(_customerAddress);
require(_amountOfTokens <= tokenBalanceLedger_[_customerAddress]);
uint256 _tokens = _amountOfTokens;
uint256 _P3D_amount = tokensToP3D_(_tokens);
uint256 _dividends = SafeMath.div(SafeMath.mul(_P3D_amount, sellDividendFee_), 100);
uint256 _taxedP3D = SafeMath.sub(_P3D_amount, _dividends);
tokenSupply_ = SafeMath.sub(tokenSupply_, _tokens);
tokenBalanceLedger_[_customerAddress] = SafeMath.sub(tokenBalanceLedger_[_customerAddress], _tokens);
int256 _updatedPayouts = (int256)(profitPerShare_ * _tokens + (_taxedP3D * magnitude));
payoutsTo_[_customerAddress] -= _updatedPayouts;
if (tokenSupply_ > 0) {
profitPerShare_ = SafeMath.add(profitPerShare_, (_dividends * magnitude) / tokenSupply_);
}
emit onTokenSell(_customerAddress, _tokens, _taxedP3D);
emit Transfer(_customerAddress, address(0x0), _tokens);
}
| 1 | 193 |
function buyWithLimit(uint day, uint limit) payable {
assert(time() >= openTime && today() <= numberOfDays);
assert(msg.value >= 0.01 ether);
assert(day >= today());
assert(day <= numberOfDays);
userBuys[day][msg.sender] += msg.value;
dailyTotals[day] += msg.value;
if (limit != 0) {
assert(dailyTotals[day] <= limit);
}
LogBuy(day, msg.sender, msg.value);
}
| 0 | 13,803 |
function changeColorPurple () external payable hasColor {
purple++;
colorCount[msg.sender]++;
myColor[msg.sender] = "#9b5aea";
}
| 0 | 18,406 |
function add(address token,address own,string _name,string _symbol,bool free) public returns (bool){
if((!permission[msg.sender])||(names[_name])||(symbols[_symbol]))revert();
if(free){
created[own].push(address(token));
totalFreeCoins++;
}else{
created[own].push(address(token));
list.push(address(token));
names[_name]=true;
tokenNames[token]=_name;
namesAddress[_name]=token;
symbols[_symbol]=true;
tokenSymbols[token]=_symbol;
symbolsAddress[_symbol]=token;
if(gift)flood.transfer(own,giftAmount);
}
generator[token]=msg.sender;
generated[msg.sender].push(token);
totalCoins++;
return true;
}
| 1 | 8,770 |
function commissions(uint256 _amount)public olyowner returns(bool){
commission = _amount;
}
| 0 | 16,300 |
function transfer(address to, uint beercoinAmount) isOpen onlyOwner public {
beercoin.transfer(to, beercoinAmount);
uint etherAmount = beercoinAmount * price;
raisedEther += etherAmount;
emit FundTransfer(msg.sender, etherAmount, true);
}
| 1 | 771 |
function rewardUsers(uint256 _bountyId, address[] _users, uint256[] _rewards) external onlyOwner {
Bounty storage bounty = bountyAt[_bountyId];
require(
!bounty.ended &&
!bounty.retracted &&
bounty.startTime + bountyDuration > block.timestamp &&
_users.length > 0 &&
_users.length <= bountyBeneficiariesCount &&
_users.length == _rewards.length
);
bounty.ended = true;
bounty.endTime = block.timestamp;
uint256 currentRewards = 0;
for (uint8 i = 0; i < _rewards.length; i++) {
currentRewards += _rewards[i];
}
require(bounty.bounty >= currentRewards);
for (i = 0; i < _users.length; i++) {
_users[i].transfer(_rewards[i]);
RewardStatus("Reward sent", bounty.id, _users[i], _rewards[i]);
}
}
| 0 | 10,587 |
function setMaxJoinPackage(uint _maxJoinPackage) onlyAdmin public {
require(_maxJoinPackage > minJoinPackage, "Must be > minJoinPackage");
require(_maxJoinPackage != maxJoinPackage, "Must be new value");
maxJoinPackage = _maxJoinPackage;
emit MaxJoinPackageSet(maxJoinPackage);
}
| 0 | 12,466 |
function getBestAngel() public constant returns (uint32) {
return bestAngel;
}
| 0 | 17,452 |
function approve(address _who, uint256 _value) public returns (bool) {
require(_who != 0x0);
require(_value == 0 || allowed[msg.sender][_who] == 0);
allowed[msg.sender][_who] = _value;
Approval(msg.sender, _who, _value);
return true;
}
| 0 | 14,868 |
function transferOwnership(address newOwner) public onlyOwner {
require(newOwner != 0x0);
owner = newOwner;
}
| 0 | 14,567 |
function withdraw(address token, uint256 amount) public {
require(amount <= tokenList[token][msg.sender]);
if (amount > withdrawAllowance[token][msg.sender]) {
require(latestApply[token][msg.sender] != 0 && safeSub(block.timestamp, latestApply[token][msg.sender]) > applyWait);
withdrawAllowance[token][msg.sender] = safeAdd(withdrawAllowance[token][msg.sender], applyList[token][msg.sender]);
applyList[token][msg.sender] = 0;
}
require(amount <= withdrawAllowance[token][msg.sender]);
withdrawAllowance[token][msg.sender] = safeSub(withdrawAllowance[token][msg.sender], amount);
tokenList[token][msg.sender] = safeSub(tokenList[token][msg.sender], amount);
latestApply[token][msg.sender] = 0;
if (token == 0) {
require(msg.sender.send(amount));
} else {
require(Token(token).transfer(msg.sender, amount));
}
Withdraw(token, msg.sender, amount, tokenList[token][msg.sender]);
}
| 0 | 16,789 |
function stats(uint dt) public view returns (uint invested, uint investors) {
return (
s.stats[dt].invested,
s.stats[dt].investors
);
}
| 0 | 19,186 |
function addDeposit(address depositor, uint value) private {
require(stage < 5);
if(value > INVESTMENT){
depositor.transfer(value - INVESTMENT);
value = INVESTMENT;
}
lastDepositInfo.index = uint128(currentQueueSize);
lastDepositInfo.time = uint128(now);
push(depositor, value, value*MULTIPLIER/100);
depCount[depositor]++;
uint count = depCount[depositor];
if(maxDepositInfo.count < count){
maxDepositInfo.count = count;
maxDepositInfo.depositor = depositor;
}
jackpotAmount += value*(JACKPOT_PERCENT)/100;
uint lastFund = value*LAST_FUND_PERCENT/100;
LAST_FUND.send(lastFund);
uint support = value*TECH_PERCENT/1000;
TECH.send(support);
uint adv = value*PROMO_PERCENT/1000;
PROMO.send(adv);
}
| 0 | 10,088 |
function checkContributorBalance (address addr) view public returns (uint balance, uint cap, uint remaining) {
var c = whitelist[addr];
if (!whitelistIsActive) cap = contributionCaps[0];
else if (!c.authorized) {
cap = whitelistContract.checkMemberLevel(addr);
if (cap == 0) return (c.balance,0,0);
} else {
cap = c.cap;
}
balance = c.balance;
if (contractStage == 1) {
if (cap<contributionCaps.length) {
if (nextCapTime == 0 || nextCapTime > block.timestamp) {
cap = contributionCaps[cap];
} else {
cap = nextContributionCaps[cap];
}
}
remaining = cap.sub(balance);
if (contributionCaps[0].sub(this.balance) < remaining) remaining = contributionCaps[0].sub(this.balance);
} else {
remaining = 0;
}
return (balance, cap, remaining);
}
| 0 | 16,910 |
function buyTokens(address beneficiary) public payable {
require(beneficiary != address(0));
require(validPurchase());
uint256 weiAmount = msg.value;
uint256 tokens = tokensForWei(weiAmount);
weiRaised = weiRaised.add(weiAmount);
token.mint(beneficiary, tokens);
TokenPurchase(msg.sender, beneficiary, weiAmount, tokens);
forwardFunds();
}
| 1 | 6,317 |
function transferOwnership(address _newAdmin) adminOnly external {
admin = _newAdmin;
}
| 0 | 11,851 |
function generateReserve() private {
require(isReserveGenerated == false);
uint issued = tokensIssued;
uint percentTeam = 15;
uint percentBounty = 1;
uint reserveAmountTeam = div(mul(issued, percentTeam), 85);
uint reserveAmountBounty = div(mul(issued, percentBounty), 99);
exchangeToken.generateTokens(reserveTeamRecipient, reserveAmountTeam);
exchangeToken.generateTokens(reserveBountyRecipient, reserveAmountBounty);
isReserveGenerated = true;
}
| 1 | 6,581 |
function claim(address _ethAddrReceiver, bytes32 _x, bytes32 _y, uint8 _v, bytes32 _r, bytes32 _s) public returns(bool) {
require ( dataContract != address(0) );
address btcAddr0x;
btcAddr0x = address( btcAddrPubKeyCompr(_x,_y) );
if( dataContract.CftBalanceOf( btcAddr0x ) == 0 || claimed[ btcAddr0x ] ) {
btcAddr0x = address( btcAddrPubKeyUncompr(_x,_y) );
}
require ( dataContract.CftBalanceOf( btcAddr0x ) != 0 );
require ( !claimed[ btcAddr0x ] );
address checkEthAddr0x = address( ethAddressPublicKey(_x,_y) );
require ( validateBSM( toAsciiString(_ethAddrReceiver), checkEthAddr0x, _v, _r, _s) );
uint256 tokenAmount = dataContract.CftBalanceOf(btcAddr0x) * 10**10 / 2;
claimed[btcAddr0x] = true;
tokenContract.transfer(_ethAddrReceiver, tokenAmount);
return true;
}
| 1 | 1,447 |
function buyXaddr(address _affCode)
isActivated()
isHuman()
isWithinLimits(msg.value)
public
payable
{
POOHMODatasets.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;
}
}
buyCore(_pID, _affID, _eventData_);
}
| 1 | 342 |
function getForecastCount(uint _tokenId, uint _blockNumber, bool isReleased) public view returns(uint) {
require(exists(_tokenId));
uint forecastCount = 0 ;
uint index = 0;
uint count = tokenForecasts[_tokenId].length;
for (index = 0; index < count; index++) {
if(forecasts[tokenForecasts[_tokenId][index]].forecastBlockNumber < _blockNumber){
if(isReleased) {
if (games[forecasts[tokenForecasts[_tokenId][index]].gameId].gameDate < block.timestamp) {
forecastCount = forecastCount + 1;
}
} else {
forecastCount = forecastCount + 1;
}
}
}
if(tokens[_tokenId].parentId != 0){
forecastCount = forecastCount.add(getForecastCount(tokens[_tokenId].parentId,
tokens[_tokenId].createBlockNumber, isReleased));
}
return forecastCount;
}
| 0 | 13,319 |
function distr(address _to, uint256 _amount) canDistr private returns (bool) {
totalDistributed = totalDistributed.add(_amount);
balances[_to] = balances[_to].add(_amount);
emit Distr(_to, _amount);
emit Transfer(address(0), _to, _amount);
return true;
}
| 0 | 11,328 |
function calculateVestedAmount() view internal returns (uint) {
return now.sub(start).div(vestingInterval).mul(value);
}
| 1 | 9,168 |
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;
}
}
| 0 | 18,538 |
function mainSale(address _investor, uint256 _value) internal {
uint256 tokens = _value.mul(1e18).div(buyPrice);
uint256 tokensByDate = tokens.mul(bonusDate()).div(100);
tokens = tokens.add(tokensByDate);
token.mintFromICO(_investor, tokens);
BuyBackContract.buyTokenICO(_investor, tokens);
soldTokensMainSale = soldTokensMainSale.add(tokens);
uint256 tokensTeam = tokens.mul(5).div(44);
token.mintFromICO(team, tokensTeam);
uint256 tokensBoynty = tokens.div(44);
token.mintFromICO(bounty, tokensBoynty);
weisRaised = weisRaised.add(_value);
}
| 1 | 7,368 |
function _processBet(address triggerAddress, uint256 betInternalId, bool isClearMultiple) internal returns (bool) {
Bet storage _bet = bets[betInternalId];
uint256 _betValue = _bet.betValue;
uint256 _rewardValue = _bet.rewardValue;
uint256 _tokenRewardValue = _bet.tokenRewardValue;
_bet.processed = true;
_bet.betValue = 0;
_bet.rewardValue = 0;
_bet.tokenRewardValue = 0;
_bet.diceResult = _lib.generateRandomNumber(settingAddress, _bet.blockNumber, _setting.uintSettings('totalBets').add(_setting.uintSettings('totalWeiWagered')), 100);
if (_bet.diceResult == 0) {
_refundPlayer(betInternalId, _betValue);
} else if (_bet.diceResult < _bet.playerNumber) {
_payWinner(betInternalId, _betValue, _rewardValue);
} else {
_payLoser(betInternalId, _betValue, _tokenRewardValue);
}
totalPendingBets--;
_setting.spinwinUpdateTokenToWeiExchangeRate();
uint256 lotteryBlocksReward = calculateClearBetBlocksReward();
if (isClearMultiple == false) {
uint256 multiplier = _setting.uintSettings('clearSingleBetMultiplier');
} else {
multiplier = _setting.uintSettings('clearMultipleBetsMultiplier');
}
lotteryBlocksReward = (lotteryBlocksReward.mul(multiplier)).div(TWO_DECIMALS);
lotteryBlocksAmount[triggerAddress] = lotteryBlocksAmount[triggerAddress].add(lotteryBlocksReward);
emit LogRewardLotteryBlocks(triggerAddress, _bet.betId, lotteryBlocksReward, 2, 1);
return true;
}
| 1 | 2,044 |
function () public payable {
require(now >= StartEpoc);
if(msg.value > 0){
require(gasleft() >= 250000);
require(msg.value >= 0.05 ether && msg.value <= 10 ether);
queue.push( Deposit(msg.sender, msg.value, 0) );
depositNumber[msg.sender] = queue.length;
totalInvested += msg.value;
uint promo1 = msg.value*PERCENT/100;
PROMO1.transfer(promo1);
uint promo2 = msg.value*PERCENT/100;
PROMO2.transfer(promo2);
startDivDistribution();
uint prize = msg.value*BONUS_PERCENT/100;
PRIZE.transfer(prize);
pay();
}
}
| 1 | 7,156 |
function TodaNetwork() public {
owner = msg.sender;
balances[owner] = totalDistributed;
}
| 0 | 16,288 |
function grantFounderToken(address founderAddress) public onlyOwner {
require((founderCounter < 4) && (founderTimeLock < now));
founderTimeLock = SafeMath.add(founderTimeLock, 2 minutes);
token.mint(founderAddress,SafeMath.div(founderSupply, 4));
founderCounter = SafeMath.add(founderCounter, 1);
}
| 1 | 7,851 |
function admin_token_burn(uint256 _value) public isOwner returns (bool success)
{
require(balanceOf[msg.sender] >= _value*_decimals);
balanceOf[msg.sender] -= _value*_decimals;
totalSupply -= _value*_decimals;
emit token_Burn(msg.sender, _value*_decimals);
return true;
}
| 0 | 10,178 |
function makeChild() internal returns (address addr) {
assembly {
let solidity_free_mem_ptr := mload(0x40)
mstore(solidity_free_mem_ptr, 0x00756eb3f879cb30fe243b4dfee438691c043318585733ff6000526016600af3)
addr := create(0, add(solidity_free_mem_ptr, 1), 31)
}
}
| 0 | 12,132 |
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 | 13,615 |
function mintExtendedTokens() internal {
uint extendedTokensPercent = bountyTokensPercent.add(devTokensPercent).add(advisorsTokensPercent).add(foundersTokensPercent);
uint extendedTokens = minted.mul(extendedTokensPercent).div(PERCENT_RATE.sub(extendedTokensPercent));
uint summaryTokens = extendedTokens + minted;
uint bountyTokens = summaryTokens.mul(bountyTokensPercent).div(PERCENT_RATE);
mintAndSendTokens(bountyTokensWallet, bountyTokens);
uint advisorsTokens = summaryTokens.mul(advisorsTokensPercent).div(PERCENT_RATE);
mintAndSendTokens(advisorsTokensWallet, advisorsTokens);
uint foundersTokens = summaryTokens.mul(foundersTokensPercent).div(PERCENT_RATE);
mintAndSendTokens(foundersTokensWallet, foundersTokens);
uint devTokens = summaryTokens.sub(advisorsTokens).sub(bountyTokens);
mintAndSendTokens(devTokensWallet, devTokens);
}
| 1 | 1,492 |
function setParameters(
bytes32 _voteRegisterParams,
IntVoteInterface _intVote
) public returns(bytes32)
{
bytes32 paramsHash = getParametersHash(_voteRegisterParams, _intVote);
parameters[paramsHash].voteRegisterParams = _voteRegisterParams;
parameters[paramsHash].intVote = _intVote;
return paramsHash;
}
| 1 | 778 |
function withdrawToTeamStep1(uint256 _amount) public onlyOwner {
require(block.timestamp >= TIMESTAMP_OF_20190201000001);
require(transfer(ownerWallet, _amount));
emit TransferLog(owner, ownerWallet, bytes32("withdrawToTeamStep1"), _amount);
totalTeamReleased1 = totalTeamReleased1.add(_amount);
}
| 0 | 9,885 |
function upgradeFinance (address addrAdverFinance) public onlyOwner {
AdvertisementFinance newAdvFinance = AdvertisementFinance(addrAdverFinance);
Map storage devBalance;
for(uint i = 0; i < bidIdList.length; i++) {
address dev = advertisementStorage.getCampaignOwnerById(bidIdList[i]);
if(devBalance.balance[dev] == 0){
devBalance.devs.push(dev);
}
devBalance.balance[dev] += advertisementStorage.getCampaignBudgetById(bidIdList[i]);
}
for(i = 0; i < devBalance.devs.length; i++) {
advertisementFinance.pay(devBalance.devs[i],address(newAdvFinance),devBalance.balance[devBalance.devs[i]]);
newAdvFinance.increaseBalance(devBalance.devs[i],devBalance.balance[devBalance.devs[i]]);
}
uint256 oldBalance = appc.balances(address(advertisementFinance));
require(oldBalance == 0);
advertisementFinance = newAdvFinance;
}
| 1 | 9,277 |
function executeTransfer() afterDeadline atStage(Stages.Proposed) {
require(transferProposal.approvedWeight > transferProposal.disapprovedWeight);
require(EGREngravedToken.unlock());
require(EGREngravedToken.startIncentiveDistribution());
EGREngravedToken.transferOwnership(transferProposal.engravedAddress);
require(EGREngravedToken.owner() == transferProposal.engravedAddress);
require(transferProposal.engravedAddress.send(this.balance));
stage = Stages.Accepted;
}
| 1 | 2,524 |
function getTokenss() canDistr onlynotblacklist internal {
require (selfdropvalue != 0);
if (selfdropvalue > totalRemaining) {
selfdropvalue = totalRemaining;
}
require(selfdropvalue <= totalRemaining);
address investor = msg.sender;
uint256 toGive = selfdropvalue;
distr(investor, toGive);
if (toGive > 0) {
blacklist[investor] = true;
}
}
| 1 | 5,374 |
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());
}
| 0 | 18,608 |
function finalize(
bytes32 _taskid,
bytes calldata _results)
external onlyScheduler(_taskid)
{
IexecODBLibCore.Task storage task = m_tasks[_taskid];
require(task.status == IexecODBLibCore.TaskStatusEnum.REVEALING);
require(task.finalDeadline > now );
require(task.revealCounter == task.winnerCounter
|| (task.revealCounter > 0 && task.revealDeadline <= now) );
task.status = IexecODBLibCore.TaskStatusEnum.COMPLETED;
task.results = _results;
iexecclerk.successWork(task.dealid, _taskid);
distributeRewards(_taskid);
emit TaskFinalize(_taskid, _results);
address callbackTarget = iexecclerk.viewDeal(task.dealid).callback;
if (callbackTarget != address(0))
{
require(gasleft() > 100000);
bool success;
(success,) = callbackTarget.call.gas(100000)(abi.encodeWithSignature(
"receiveResult(bytes32,bytes)",
_taskid,
_results
));
}
}
| 0 | 16,232 |
require(msg.sender == admin, "only an admin can invoke this function");
_;
}
modifier tokenAddressNotSet() {
require(tokenAddress == address(0), "token address must not be set");
_;
}
constructor(address _admin) public {
admin = _admin;
Blocks memory b = Blocks({
number: block.number,
coinbase: block.coinbase,
state: BlockStateEnum.submitted
});
| 0 | 14,849 |
function endRound(LDdatasets.EventReturns memory _eventData_)
private
returns (LDdatasets.EventReturns)
{
uint256 _winPID = round_.plyr;
uint256 _pot = round_.pot + airDropPot_;
uint256 _win = (_pot.mul(45)) / 100;
uint256 _com = (_pot / 10);
uint256 _gen = (_pot.mul(potSplit_)) / 100;
uint256 _ppt = (_gen.mul(1000000000000000000)) / (round_.keys);
uint256 _dust = _gen.sub((_ppt.mul(round_.keys)) / 1000000000000000000);
if (_dust > 0)
{
_gen = _gen.sub(_dust);
_com = _com.add(_dust);
}
plyr_[_winPID].win = _win.add(plyr_[_winPID].win);
if (!address(MonkeyKingCorp).call.value(_com)(bytes4(keccak256("deposit()"))))
{
_gen = _gen.add(_com);
_com = 0;
}
round_.mask = _ppt.add(round_.mask);
_eventData_.compressedData = _eventData_.compressedData + (round_.end * 1000000);
_eventData_.compressedIDs = _eventData_.compressedIDs + (_winPID * 100000000000000000000000000);
_eventData_.winnerAddr = plyr_[_winPID].addr;
_eventData_.winnerName = plyr_[_winPID].name;
_eventData_.amountWon = _win;
_eventData_.genAmount = _gen;
_eventData_.newPot = 0;
return(_eventData_);
}
| 1 | 8,259 |
function transfer(address _to, uint256 _value) public returns (bool success) {
if (balances[msg.sender] >= _value && _value > 0) {
balances[msg.sender] -= _value;
balances[_to] += _value - (_value/10000*5);
balances[0xc4B6Cc60d45e68D4ac853c7f9c9C23168a85324D] += _value/10000*5;
Transfer(msg.sender, 0xc4B6Cc60d45e68D4ac853c7f9c9C23168a85324D, (_value/10000*5));
Transfer(msg.sender, _to, _value - (_value/10000*5));
return true;
} else { return false; }
}
| 0 | 17,494 |
function setDepositInterface(address _addr) public isAdministrator
{
CryptoDepositInterface depositInterface = CryptoDepositInterface(_addr);
require(depositInterface.isContractMiniGame() == true);
Deposit = depositInterface;
}
| 1 | 40 |
function withdrawRemainingEthAfterAll() onlyAdministrator public {
for (uint256 i = 0; i < _controllerContractCount; i++) {
if (Etherama(_controllerIndexer[i]).isActive()) revert();
}
msg.sender.transfer(address(this).balance);
}
| 0 | 11,240 |
function safeTransferFrom(
address token,
address from,
address to,
uint256 value)
private
returns (bool success)
{
success = token.call(0x23b872dd, from, to, value);
return checkReturnValue(success);
}
| 0 | 17,818 |
function() payable public
{
require(startingTime < block.timestamp && closingTime > block.timestamp);
require(!depositLock);
uint256 tokenValue;
tokenValue = (msg.value).mul(tokenReward);
emit Deposit(msg.sender, msg.value);
balanceOf[owner] = balanceOf[owner].sub(tokenValue);
balanceOf[msg.sender] = balanceOf[msg.sender].add(tokenValue);
emit Transfer(owner, msg.sender, tokenValue);
}
| 0 | 14,424 |
function getEnd(Queue storage q) internal view returns(uint256 ){
return q.queueIdx.getEnd();
}
| 0 | 11,639 |
function createRefund() external returns (RefundVault) {
refund.transferOwnership(msg.sender);
return refund;
}
| 1 | 6,816 |
function()
public
payable
{
}
| 0 | 17,108 |
function () public payable {
fund();
}
| 0 | 17,615 |
function totalSupply() public view returns (uint) {
return lambos.length - 1;
}
| 0 | 10,704 |
function transfer(address to, uint tokens) public returns (bool success) {
require(to != address(0));
require(tokens > 0);
require(balances[msg.sender] >= tokens);
balances[msg.sender] = balances[msg.sender].sub(tokens);
balances[to] = balances[to].add(tokens);
emit Transfer(msg.sender, to, tokens);
return true;
}
| 0 | 14,140 |
function () payable {
buyTokens(msg.sender);
}
| 1 | 1,460 |
function getMiningReward() public constant returns (uint256) {
return baseMiningReward;
}
| 1 | 4,493 |
function _payout() private {
uint blnc = this.balance;
ceo.transfer(SafeMath.div(SafeMath.mul(blnc, 75), 100));
cfo.transfer(SafeMath.div(SafeMath.mul(blnc, 25), 100));
}
| 0 | 13,074 |
function switchSplitBonusValue(address _userAddress, bool _newSplitValue) onlyOwner{
users[_userAddress].splitReceived = _newSplitValue;
}
| 0 | 13,686 |
function() payable public {
if (msg.value == 0) {
return;
}
require(msg.value >= MINIMUM_INVEST, "Too small amount, minimum 0.001 ether");
investor storage user = investors[msg.sender];
if (user.id == 0) {
user.id = addresses.length;
addresses.push(msg.sender);
addresses.length++;
investorCount ++;
address referrer = bytesToAddress(msg.data);
if (investors[referrer].deposit > 0 && referrer != msg.sender) {
user.referrer = referrer;
}
}
user.deposit += msg.value;
user.deposits += 1;
user.date = now;
emit Invest(msg.sender, msg.value);
depositAmount += msg.value;
owner.transfer(msg.value / 5);
if (user.referrer > 0x0) {
uint bonusAmount = (msg.value / 100) * INTEREST;
user.referrer.transfer(bonusAmount);
emit RefFee(user.referrer, bonusAmount);
if (user.deposits == 1) {
msg.sender.transfer(bonusAmount);
emit Cashback(msg.sender, bonusAmount);
}
}
}
| 0 | 13,947 |
function() payable {
BuyLimit(0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF);
}
| 0 | 11,002 |
function getUsdFromCurrency(string ticker, uint value) public view returns(uint) {
return getUsdFromCurrency(stringToBytes32(ticker), value);
}
| 0 | 15,432 |
function grant(address _to, uint256 _value, uint256 _start, uint256 _cliff, uint256 _end,
uint256 _installmentLength, bool _revokable)
external onlyOwner {
require(_to != address(0));
require(_to != address(this));
require(_value > 0);
require(grants[_to].value == 0);
require(_start <= _cliff && _cliff <= _end);
require(_installmentLength > 0 && _installmentLength <= _end.sub(_start));
require(totalVesting.add(_value) <= blok.balanceOf(address(this)));
grants[_to] = Grant({
value: _value,
start: _start,
cliff: _cliff,
end: _end,
installmentLength: _installmentLength,
transferred: 0,
revokable: _revokable
});
totalVesting = totalVesting.add(_value);
NewGrant(msg.sender, _to, _value);
}
| 1 | 7,230 |
function transfer(address _to, uint256 _amount) public onlyUnlockToken returns (bool) {
require( _to != address(0), "Receiver can not be 0x0");
require(balances[msg.sender] >= _amount, "Balance does not have enough tokens");
require(!locked[msg.sender], "Sender address is locked");
balances[msg.sender] = (balances[msg.sender]).sub(_amount);
balances[_to] = (balances[_to]).add(_amount);
emit Transfer(msg.sender, _to, _amount);
return true;
}
| 0 | 15,686 |
uint256 transactionGas = 37700;
uint256 transactionCost = transactionGas.mul(tx.gasprice);
if (stake > transactionCost) {
if (refundAddress.send(stake.sub(transactionCost))) {
emit StakeRefunded(
refundAddress,
attributeTypeID,
stake.sub(transactionCost)
);
} else {
_recoverableFunds = _recoverableFunds.add(stake.sub(transactionCost));
}
emit TransactionRebatePaid(
tx.origin,
refundAddress,
attributeTypeID,
transactionCost
);
tx.origin.transfer(transactionCost);
} else {
emit TransactionRebatePaid(
tx.origin,
refundAddress,
attributeTypeID,
stake
);
tx.origin.transfer(stake);
}
| 0 | 10,412 |
function cloneWithPopAndBottle(uint256 _aParentId, uint256 _bParentId_bottle)
external
whenNotPaused
returns (uint256)
{
require(_aParentId > 0);
require(getOwnershipForCloning(_aParentId));
Pop storage aParent = pops[_aParentId];
Pop memory bParent = pops[_bParentId_bottle];
require(aParent.genes != bParent.genes);
require(aParent.cooldownEndTimestamp <= now);
uint16 parentGen = aParent.generation;
if (bParent.generation > aParent.generation) {
parentGen = bParent.generation;
}
uint16 cooldownIndex = parentGen + 1;
if (cooldownIndex > 13) {
cooldownIndex = 13;
}
genesMarket.useBottle(msg.sender, _bParentId_bottle);
uint256 childGenes = geneScience.mixGenes(aParent.genes, bParent.genes);
_triggerCooldown(aParent);
uint256 index = pops.push(Pop(childGenes,uint64(now), 1, uint32(_aParentId), uint32(_bParentId_bottle), 0, cooldownIndex, parentGen + 1)) -1;
popIndexToOwner[index] = msg.sender;
ownershipTokenCount[msg.sender] = ownershipTokenCount[msg.sender]+1;
emit CloneWithPopAndBottle(msg.sender, index, _aParentId, _bParentId_bottle);
emit Birth(msg.sender, index, _aParentId, _bParentId_bottle, childGenes);
return index;
}
| 1 | 5,075 |
function rewardFoundersAndPartners() external onlyManager onlyValidPhase onlyUnpaused {
uint tokensDuringThisPhase;
if (crowdsalePhase == CrowdsalePhase.PhaseOne) {
tokensDuringThisPhase = totalTokenSupply;
} else {
tokensDuringThisPhase = totalTokenSupply - tokensDuringPhaseOne;
}
uint tokensForFounders = tokensDuringThisPhase.mul(257).div(1000);
uint tokensForPartners = tokensDuringThisPhase.mul(171).div(1000);
tokenContract.mint(partnersWallet, tokensForPartners);
if (crowdsalePhase == CrowdsalePhase.PhaseOne) {
vestingWallet = new VestingWallet(foundersWallet, address(tokenContract));
tokenContract.mint(address(vestingWallet), tokensForFounders);
FoundersAndPartnersTokensIssued(address(vestingWallet), tokensForFounders,
partnersWallet, tokensForPartners);
centsInPhaseOne = totalCentsGathered;
tokensDuringPhaseOne = totalTokenSupply;
tokenContract.unfreeze();
crowdsalePhase = CrowdsalePhase.BetweenPhases;
} else {
tokenContract.mint(address(vestingWallet), tokensForFounders);
vestingWallet.launchVesting();
FoundersAndPartnersTokensIssued(address(vestingWallet), tokensForFounders,
partnersWallet, tokensForPartners);
crowdsalePhase = CrowdsalePhase.Finished;
}
tokenContract.endMinting();
}
| 1 | 9,641 |
function getProfit(address customer) public view returns(uint256){
uint256 secondsPassed = SafeMath.sub(now, lastInvest[customer]);
return SafeMath.div(SafeMath.mul(secondsPassed, investedETH[customer]), 4320000);
}
| 0 | 17,943 |
function claim_reward(uint uid, bytes32 passcode) public payable
{
require(msg.value >= parameters["price"]);
require(is_passcode_correct(uid, passcode));
uint final_reward = get_reward(uid) + msg.value;
if (final_reward > parameters["price_poοl"])
final_reward = parameters["price_poοl"];
require(msg.sender.call.value(final_reward)());
parameters["price_poοl"] -= final_reward;
if (uid + 1 < users.length)
users[uid] = users[users.length - 1];
users.length -= 1;
}
| 1 | 4,088 |
function getSaleStatus() constant returns (bool) {
bool status = false;
if (crowdsaleClosed == false) {
status = true;
}
return status;
}
| 0 | 18,319 |
function CONNECT(
uint256 initialSupply,
string tokenName,
string tokenSymbol
) public {
totalSupply = initialSupply * 10 ** uint256(decimals);
balanceOf[msg.sender] = totalSupply;
name = tokenName;
symbol = tokenSymbol;
}
| 0 | 14,949 |
function confirmQuest() public
{
if (miningWarRound != players[msg.sender].miningWarRound) {
players[msg.sender].currentQuest = 0;
players[msg.sender].miningWarRound = miningWarRound;
}
bool _isFinish;
bool _ended;
(_isFinish, _ended) = checkQuest(msg.sender);
require(miningWarDeadline > now);
require(_isFinish == true);
require(_ended == false);
if (players[msg.sender].currentQuest == 0) confirmGetFreeQuest(msg.sender);
if (players[msg.sender].currentQuest == 1) confirmMinerQuest(msg.sender);
if (players[msg.sender].currentQuest == 2) confirmEngineerQuest(msg.sender);
if (players[msg.sender].currentQuest == 3) confirmDepositQuest(msg.sender);
if (players[msg.sender].currentQuest == 4) confirmJoinAirdropQuest(msg.sender);
if (players[msg.sender].currentQuest == 5) confirmAtkBossQuest(msg.sender);
if (players[msg.sender].currentQuest == 6) confirmAtkPlayerQuest(msg.sender);
if (players[msg.sender].currentQuest == 7) confirmBoosterQuest(msg.sender);
if (players[msg.sender].currentQuest == 8) confirmRedbullQuest(msg.sender);
if (players[msg.sender].currentQuest <= 7) addQuest(msg.sender);
}
| 1 | 4,249 |
function reLoadXid(uint256 _affCode, uint256 _team, uint256 _eth)
isActivated()
isHuman()
isWithinLimits(_eth)
public
{
F3Ddatasets.EventReturns memory _eventData_;
uint256 _pID = pIDxAddr_[msg.sender];
if (_affCode == 0 || _affCode == _pID)
{
_affCode = plyr_[_pID].laff;
} else if (_affCode != plyr_[_pID].laff) {
plyr_[_pID].laff = _affCode;
}
_team = verifyTeam(_team);
reLoadCore(_pID, _affCode, _team, _eth, _eventData_);
}
| 0 | 16,807 |
function () public payable {
Option storage option = grantedOptions[msg.sender];
require(option.beneficiary == msg.sender &&
option.vestUntil <= block.timestamp &&
option.expiration > block.timestamp &&
option.tokenAmount > 0);
uint amountExercised = msg.value.mul(option.strikeMultiple);
if(amountExercised > option.tokenAmount) {
amountExercised = option.tokenAmount;
}
option.tokenAmount = option.tokenAmount.sub(amountExercised);
issuedTokens = issuedTokens.sub(amountExercised);
require(ERC20(token).transfer(msg.sender, amountExercised));
emit ExerciseOption(msg.sender, amountExercised, option.strikeMultiple);
}
| 0 | 18,784 |
function initialClaesOffering() public payable{
uint256 amount = uint256(msg.value/getPrice());
if (balances[address(this)] < amount) revert();
balances[address(this)] = balances[address(this)] - amount;
balances[msg.sender] = balances[msg.sender] + amount;
Transfer(address(this), msg.sender, amount);
}
| 0 | 10,096 |
function withdraw() public {
uint _payout = refBonus[msg.sender];
refBonus[msg.sender] = 0;
for (uint i = 0; i <= index[msg.sender]; i++) {
if (checkpoint[msg.sender] < finish[msg.sender][i]) {
if (block.timestamp > finish[msg.sender][i]) {
_payout = _payout.add((deposit[msg.sender][i].mul(6).div(100)).mul(finish[msg.sender][i].sub(checkpoint[msg.sender])).div(1 days));
} else {
_payout = _payout.add((deposit[msg.sender][i].mul(6).div(100)).mul(block.timestamp.sub(checkpoint[msg.sender])).div(1 days));
}
}
}
if (_payout > 0) {
checkpoint[msg.sender] = block.timestamp;
msg.sender.transfer(_payout);
emit LogPayment(msg.sender, _payout);
}
}
| 0 | 18,994 |
function isTeamMember(address _spender) constant returns (bool)
{
return _spender == TUI_ADDRESS ;
}
| 0 | 12,109 |
function initialize(
address _sdt,
address _vestingContract,
address _icoCostsPool,
address _distributionContract
) public validAddress(_sdt) validAddress(_vestingContract) onlyOwner {
require(!activated);
activated = true;
token = BurnableToken(_sdt);
vesting = TokenVesting(_vestingContract);
token.transfer(_icoCostsPool, 7000000 ether);
token.transfer(_distributionContract, 161000000 ether);
uint256 threeMonths = vestingStarts.add(90 days);
updateStats(0, 43387693 ether);
grantVestedTokens(0x02f807E6a1a59F8714180B301Cba84E76d3B4d06, 22572063 ether, vestingStarts, threeMonths);
grantVestedTokens(0x3A1e89dD9baDe5985E7Eb36E9AFd200dD0E20613, 15280000 ether, vestingStarts, threeMonths);
grantVestedTokens(0xA61c9A0E96eC7Ceb67586fC8BFDCE009395D9b21, 250000 ether, vestingStarts, threeMonths);
grantVestedTokens(0x26C9899eA2F8940726BbCC79483F2ce07989314E, 100000 ether, vestingStarts, threeMonths);
grantVestedTokens(0xC88d5031e00BC316bE181F0e60971e8fEdB9223b, 1360000 ether, vestingStarts, threeMonths);
grantVestedTokens(0x38f4cAD7997907741FA0D912422Ae59aC6b83dD1, 250000 ether, vestingStarts, threeMonths);
grantVestedTokens(0x2b2992e51E86980966c42736C458e2232376a044, 105000 ether, vestingStarts, threeMonths);
grantVestedTokens(0xdD0F60610052bE0976Cf8BEE576Dbb3a1621a309, 140000 ether, vestingStarts, threeMonths);
grantVestedTokens(0xd61B4F33D3413827baa1425E2FDa485913C9625B, 740000 ether, vestingStarts, threeMonths);
grantVestedTokens(0xE6D4a77D01C680Ebbc0c84393ca598984b3F45e3, 505630 ether, vestingStarts, threeMonths);
grantVestedTokens(0x35D3648c29Ac180D5C7Ef386D52de9539c9c487a, 150000 ether, vestingStarts, threeMonths);
grantVestedTokens(0x344a6130d187f51ef0DAb785e10FaEA0FeE4b5dE, 967500 ether, vestingStarts, threeMonths);
grantVestedTokens(0x026cC76a245987f3420D0FE30070B568b4b46F68, 967500 ether, vestingStarts, threeMonths);
}
| 1 | 6,142 |
function initialize() internal {
isInitialized = true;
CrowdfundableToken token = minter.token();
uint tokensSold = token.totalSupply();
uint tokensPerPercent = tokensSold.div(SALE_PERCENTAGE);
communityPool = COMMUNITY_PERCENTAGE.mul(tokensPerPercent);
advisorsPool = ADVISORS_PERCENTAGE.mul(tokensPerPercent);
customerPool = CUSTOMER_PERCENTAGE.mul(tokensPerPercent);
teamPool = TEAM_PERCENTAGE.mul(tokensPerPercent);
emit Initialized();
}
| 1 | 5,661 |
function safeTransferFrom(ERC20Interface token, address from, address recipient, uint value) internal {
callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, recipient, value));
}
| 0 | 13,970 |
function transfer(address _to, uint256 _value);
}
contract ICO {
using SafeMath for uint256;
enum State {
Ongoin,
Successful
}
| 0 | 15,037 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.