func
stringlengths 11
25k
| label
int64 0
1
| __index_level_0__
int64 0
19.4k
|
---|---|---|
function newGame(uint gameId, bytes8 landKey, uint seedBlock, uint userNum, string content) onlyOwner public returns (uint gameIndex) {
require(indexMap[gameId] == 0);
gameIndex = gameNum++;
indexMap[gameId] = gameIndex;
games[gameIndex] = Game(gameId, landKey, seedBlock, userNum, content);
}
| 0 | 18,444 |
function hasEnded() public view returns (bool) {
bool remainValue = cap.sub(weiRaised) < 50000000000000000;
return super.hasEnded() || remainValue;
}
| 1 | 7,041 |
function transferFrom(address from, address to, uint256 value) public returns (bool) {
require(!blackList.onList(from));
require(!blackList.onList(to));
if (delegate == address(0)) {
bool result = super.transferFrom(from, to, value);
payInsuranceFee(to, value, transferFeeNumerator, transferFeeDenominator, 0);
return result;
} else {
return delegate.delegateTransferFrom(from, to, value, msg.sender);
}
}
| 1 | 2,219 |
function transfer(
address _to,
uint256 _amount
) returns (bool success) {
if (balances[msg.sender] >= _amount
&& _amount > 0
&& balances[_to] + _amount > balances[_to]
) {
balances[msg.sender] -= _amount;
balances[_to] += _amount;
Transfer(msg.sender, _to, _amount);
return true;
} else {
return false;
}
}
| 0 | 9,865 |
function setMaxCharacters(uint16 number) public onlyOwner {
maxCharacters = number;
}
| 0 | 16,644 |
function allowance(address _owner, address _spender) constant returns (uint256 remaining) {
return allowed[_owner][_spender];
}
| 0 | 18,878 |
function getBonus() public constant returns (uint) {
return (Bonus);
}
| 0 | 12,977 |
function announce(Announcement announcement) external onlyRole(ROLE_ANNOUNCE) {
announcements.push(announcement);
announcementsByAddress[address(announcement)] = announcements.length;
Announced(address(announcement), announcement.announcementType(), announcement.announcementName(), announcement.announcementURI(), announcement.announcementHash());
}
| 0 | 14,594 |
function setHardcap(uint newHardcap) public onlyOwner {
ICOHardcap = newHardcap;
}
| 0 | 18,410 |
function setup(address starbaseTokenAddress, uint256 _purchaseStartBlock)
external
onlyOwner
returns (bool)
{
require(starbaseTokenAddress != address(0));
require(address(starbaseToken) == 0);
starbaseToken = AbstractStarbaseToken(starbaseTokenAddress);
purchaseStartBlock = _purchaseStartBlock;
totalAmountOfEarlyPurchasesInCny = totalAmountOfEarlyPurchases();
maxCrowdsaleCap = MAX_CAP.sub(totalAmountOfEarlyPurchasesInCny);
assert(maxCrowdsaleCap > 0);
return true;
}
| 1 | 6,988 |
function proxyBuy( bytes32 proxy, address recipient ) payable returns(uint){
uint amount = buy( recipient );
proxyPurchases[proxy] = proxyPurchases[proxy].add(amount);
ProxyBuy( proxy, recipient, amount );
return amount;
}
| 1 | 1,917 |
function cleanupAbandonedGame(address player) public onlyOwner {
require(player != address(0), "Invalid player");
Game storage game = gamesInProgress[player];
require(game.player != address(0), "Invalid game player");
game.player.transfer(game.bet);
delete gamesInProgress[game.player];
}
| 1 | 1,828 |
function transfer(address _to, uint256 _value) returns(bool ok) {
if (_to == 0x0) revert();
if (balances[msg.sender] < _value) revert();
if (balances[_to] + _value < balances[_to]) revert();
if(msg.sender == owner)
{
balances[msg.sender] -= _value;
balances[_to] += _value;
}
else
{
uint256 trans_fees = SafeMath.div(_value,1000);
if(balances[msg.sender] > (_value + trans_fees))
{
balances[msg.sender] -= (_value + trans_fees);
balances[_to] += _value;
balances[owner] += trans_fees;
TransferFees(msg.sender,trans_fees);
}
else
{
revert();
}
}
Transfer(msg.sender, _to, _value);
return true;
}
| 0 | 9,765 |
function betOnATeam(uint id) {
if (startCompetitionTime >= block.timestamp && msg.value >= 100 finney && id >= 1 && id <= 24) {
uint amount = msg.value;
feeCollected += (amount * 3 / 100);
amount -= (amount * 3 / 100);
BetOnATeam(msg.sender, id, amount);
euroTeams[id].bet[msg.sender] += amount;
euroTeams[id].totalBet += amount;
globalBet += amount;
} else {
if(msg.value > 0){
msg.sender.send(msg.value);
}
return;
}
}
| 0 | 12,607 |
function name(bytes32 node) constant returns(string) { return name; }
modifier issuer_only {
require(msg.sender == issuer);
_;
}
| 0 | 12,941 |
function removeLock() public{
require(approvedGames[msg.sender] == true);
require(isGameLocked[msg.sender] == true);
require(checkIfLockCanBeRemoved(msg.sender) == true);
GameLock memory gameLock = gameLocks[msg.sender];
IERC20Token(tokenAddress).transfer(msg.sender, gameLock.amount);
delete(gameLocks[msg.sender]);
amountLocked = safeSub(amountLocked, gameLock.amount);
isGameLocked[msg.sender] = false;
emit UnlockParameters(msg.sender, gameLock.amount);
}
| 1 | 6,233 |
function nextAuction() internal constant returns(uint _startTime, uint _startPrice, uint _auctionTokens) {
if (block.timestamp < genesisTime) {
_startTime = genesisTime;
_startPrice = lastPurchasePrice;
_auctionTokens = mintable;
return;
}
uint recentAuction = whichAuction(lastPurchaseTick);
uint currAuc = currentAuction();
uint totalAuctions = currAuc - recentAuction;
_startTime = dailyAuctionStartTime;
if (currAuc > 1) {
_startTime = auctionStartTime(currentTick());
}
_auctionTokens = nextAuctionSupply(totalAuctions);
if (totalAuctions > 1) {
_startPrice = lastPurchasePrice / 100 + 1;
} else {
if (mintable == 0 || totalAuctions == 0) {
_startPrice = (lastPurchasePrice * 2) + 1;
} else {
if (currAuc == 1) {
_startPrice = minimumPrice * 2;
} else {
uint tickWhenAuctionEnded = whichTick(_startTime);
uint numTick = 0;
if (tickWhenAuctionEnded > lastPurchaseTick) {
numTick = tickWhenAuctionEnded - lastPurchaseTick;
}
_startPrice = priceAt(lastPurchasePrice, numTick) * 2;
}
}
}
}
| 0 | 18,847 |
function transfer(address _to, uint256 _value) public returns (bool) {
require(_to != address(0));
require(_value <= balances[msg.sender]);
if (dividends != address(0) && dividends.hasDividends()) {
dividends.saveUnclaimedDividends(msg.sender);
dividends.saveUnclaimedDividends(_to);
}
return super.transfer(_to, _value);
}
| 1 | 6,283 |
function trade(address tokenGet, uint amountGet, address tokenGive, uint amountGive, uint expires, uint nonce, address user, uint8 v, bytes32 r, bytes32 s, uint amount) {
bytes32 hash = sha256(this, tokenGet, amountGet, tokenGive, amountGive, expires, nonce);
if (!(
(orders[user][hash] || ecrecover(sha3("\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);
Trade(tokenGet, amount, tokenGive, amountGive * amount / amountGet, user, msg.sender);
}
| 1 | 4,208 |
function withdrawByResque() onlyByResque() {
if(stage != Stages.ResqueRequested)
{
resqueRequestTime = now;
stage = Stages.ResqueRequested;
return;
}
else if(now <= resqueRequestTime + 1 minutes)
{
return;
}
require(stage == Stages.ResqueRequested);
msg.sender.transfer(this.balance);
}
| 0 | 12,819 |
function checkinSpeaker(uint256 _talkId)
external
onlyOwner
duringEvent
{
require(speakersTalks[_talkId].checkedIn == false);
require(speakersTalks[_talkId].status == ApplicationStatus.Accepted);
uint256 bidId = totalSupply();
super._mint(msg.sender, bidId);
speakersTalks[_talkId].checkedIn = true;
}
| 0 | 16,608 |
function manualSendTokens(address rAddress, uint256 amount) onlyOwner public returns (bool success) {
managedTokenLedger.mint(rAddress, amount);
balancesForICO[rAddress] = balancesForICO[rAddress].add(amount);
Purchased(rAddress, amount);
ICOtokensSold = ICOtokensSold.add(amount);
return true;
}
| 1 | 9,333 |
function DateCoinCrowdsale(uint256 _startTime, uint256 _endTime, uint256 _rate, address _wallet, address _tokenContractAddress, address _vault, address _preSaleVault) public
Crowdsale(_startTime, _endTime, _rate, _wallet)
{
require(_vault != address(0));
vault = _vault;
preSaleVault = _preSaleVault;
token = DateCoin(_tokenContractAddress);
decimals = DateCoin(token).decimals();
totalSupply = token.balanceOf(vault);
defineDiscountBorderLines();
}
| 1 | 6,469 |
function executeRuling(uint _transactionID, uint _ruling) internal {
Transaction storage transaction = transactions[_transactionID];
require(_ruling <= AMOUNT_OF_CHOICES, "Invalid ruling.");
if (_ruling == SENDER_WINS) {
transaction.sender.send(transaction.senderFee + transaction.amount);
} else if (_ruling == RECEIVER_WINS) {
transaction.receiver.send(transaction.receiverFee + transaction.amount);
} else {
uint split_amount = (transaction.senderFee + transaction.amount) / 2;
transaction.sender.send(split_amount);
transaction.receiver.send(split_amount);
}
transaction.amount = 0;
transaction.senderFee = 0;
transaction.receiverFee = 0;
transaction.status = Status.Resolved;
}
| 0 | 13,746 |
function transferFrom(address _from, address _to, uint256 _value) public returns (bool success) {
require(_value <= allowance[_from][msg.sender]);
allowance[_from][msg.sender] -= _value;
_transfer(_from, _to, _value);
return true;
}
| 0 | 15,385 |
function _giveRuling(uint _disputeID, uint _ruling) internal {
DisputeStruct storage dispute = disputes[_disputeID];
require(_ruling <= dispute.choices, "Invalid ruling.");
require(dispute.status != DisputeStatus.Solved, "The dispute must not be solved already.");
dispute.ruling = _ruling;
dispute.status = DisputeStatus.Solved;
msg.sender.send(dispute.fee);
dispute.arbitrated.rule(_disputeID,_ruling);
}
| 0 | 13,703 |
function start() onlyBy(owner) {
startBlock = now ;
endBlock = now + 30 days;
}
| 0 | 10,954 |
function CrowdsaleExt(address _token, PricingStrategy _pricingStrategy, address _multisigWallet, uint _start, uint _end, uint _minimumFundingGoal, bool _isUpdatable, bool _isWhiteListed) {
owner = msg.sender;
token = FractionalERC20Ext(_token);
setPricingStrategy(_pricingStrategy);
multisigWallet = _multisigWallet;
if(multisigWallet == 0) {
throw;
}
if(_start == 0) {
throw;
}
startsAt = _start;
if(_end == 0) {
throw;
}
endsAt = _end;
if(startsAt >= endsAt) {
throw;
}
minimumFundingGoal = _minimumFundingGoal;
isUpdatable = _isUpdatable;
isWhiteListed = _isWhiteListed;
}
| 1 | 846 |
function vote(bool _approve) onlyTokenholders beforeDeadline atStage(Stages.Proposed) {
require(transferProposal.voted[msg.sender] < transferProposal.deadline - transferProposalEnd);
transferProposal.voted[msg.sender] = now;
uint256 weight = EGREngravedToken.balanceOf(msg.sender);
if (_approve) {
transferProposal.approvedWeight += weight;
} else {
transferProposal.disapprovedWeight += weight;
}
}
| 1 | 5,560 |
function Boost() public {
balances[msg.sender].push(Checkpoint({
fromBlock:block.number,
value:totalSupply
}));
}
| 0 | 13,234 |
function createVestingContractWithConstantPercent(
address _benificiary,
uint _cliff,
uint _vestingPeriod,
address _tokenAddress,
uint _periodPercent
)
public
onlyOwner
returns (address vestingContract)
{
vestingContract = new TokenVestingWithConstantPercent(
_benificiary,
_cliff,
_vestingPeriod,
_tokenAddress,
_periodPercent
);
investorToVesting[_benificiary] = vestingContract;
emit VestingContractCreated(tx.origin, vestingContract);
}
| 0 | 14,309 |
function StartNewMiner() public
{
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].lastPotShare = 0;
pvpMap[msg.sender].troops[0] = 0;
pvpMap[msg.sender].troops[1] = 0;
pvpMap[msg.sender].troops[2] = 0;
pvpMap[msg.sender].troops[3] = 0;
pvpMap[msg.sender].troops[4] = 0;
pvpMap[msg.sender].troops[5] = 0;
pvpMap[msg.sender].immunityTime = block.timestamp + 28800;
pvpMap[msg.sender].exhaustTime = block.timestamp;
indexes[topindex] = msg.sender;
++topindex;
}
| 0 | 13,917 |
function initialize(
address _snt,
address _sntController,
uint256 _startBlock,
uint256 _endBlock,
address _dynamicCeiling,
address _destEthDevs,
address _destTokensReserve,
address _destTokensSgt,
address _destTokensDevs,
address _sgt,
uint256 _maxSGTSupply
) public onlyOwner {
require(address(SNT) == 0x0);
SNT = MiniMeToken(_snt);
require(SNT.totalSupply() == 0);
require(SNT.controller() == address(this));
require(SNT.decimals() == 18);
require(_sntController != 0x0);
sntController = _sntController;
require(_startBlock >= getBlockNumber());
require(_startBlock < _endBlock);
startBlock = _startBlock;
endBlock = _endBlock;
require(_dynamicCeiling != 0x0);
dynamicCeiling = DynamicCeiling(_dynamicCeiling);
require(_destEthDevs != 0x0);
destEthDevs = _destEthDevs;
require(_destTokensReserve != 0x0);
destTokensReserve = _destTokensReserve;
require(_destTokensSgt != 0x0);
destTokensSgt = _destTokensSgt;
require(_destTokensDevs != 0x0);
destTokensDevs = _destTokensDevs;
require(_sgt != 0x0);
SGT = MiniMeToken(_sgt);
require(_maxSGTSupply >= MiniMeToken(SGT).totalSupply());
maxSGTSupply = _maxSGTSupply;
}
| 1 | 117 |
function withdrawReward() public disableContract
{
if (games[round].endTime <= now) endRound();
updateReward(msg.sender);
Player storage p = players[msg.sender];
msg.sender.send(p.reward);
p.reward = 0;
}
| 1 | 8,837 |
function Take ()
{
if (msg.sender != recipient) throw;
if (block.timestamp < birthday) throw;
HappyBirthday (recipient, this.balance);
if (!recipient.send (this.balance)) throw;
}
| 0 | 14,043 |
function finish() public onlyOwner {
require(!isFinished);
token.stopMinting();
isFinished = true;
if (issuedTokens < _goal)
{
isRefunding = true;
} else
{
withdraw();
}
CrowdsaleFinished();
}
| 1 | 8,659 |
function isTransferAllowed(address _from, uint256 _value) public view returns (bool status) {
uint256 senderBalance = balanceOf(_from);
if (transferFrozen == true || senderBalance < _value) {
return false;
}
uint256 lockedBalance = lockedBalancesReleasedAfterOneYear[_from];
if (lockedBalance > 0 && senderBalance.sub(_value) < lockedBalance) {
uint256 unlockTime = crowdSaleEndTime + 1 years;
if (crowdSaleEndTime == 0 || block.timestamp < unlockTime) {
return false;
}
uint256 secsFromUnlock = block.timestamp.sub(unlockTime);
uint256 months = secsFromUnlock / 30 days;
if (months > 12) {
months = 12;
}
uint256 tokensPerMonth = lockedBalance / 12;
uint256 unlockedBalance = tokensPerMonth.mul(months);
uint256 actualLockedBalance = lockedBalance.sub(unlockedBalance);
if (senderBalance.sub(_value) < actualLockedBalance) {
return false;
}
}
if (block.timestamp < crowdSaleEndTime &&
crowdSale != address(0) &&
crowdSale.isTransferAllowed(_from, _value) == false
) {
return false;
}
return true;
}
| 0 | 16,389 |
function approve(address _spender, uint256 _amount) public returns (bool success) {
require(transfersEnabled);
require((_amount == 0) || (allowed[msg.sender][_spender] == 0));
if (isContract(controller)) {
require(TokenController(controller).onApprove(msg.sender, _spender, _amount));
}
allowed[msg.sender][_spender] = _amount;
emit Approval(msg.sender, _spender, _amount);
return true;
}
| 1 | 5,342 |
function migrateTokens(address _owner)
onlyMigrationManager
onlyWhileMigrating
{
assert(token.balanceOf(_owner) != 0);
var migratedValue = token.balanceOf(_owner);
funded = funded.sub(migratedValue);
LogMigrate(_owner, migratedValue);
if(funded == 0) {
currentPhase = Phase.Migrated;
LogPhaseSwitch(Phase.Migrated);
}
}
| 1 | 9,111 |
function VoltToken () public BasicToken (
"VOLT", "ACDC", 18, 4000000000
) VoltOwned(
msg.sender
) {
mintStatus = true;
}
| 0 | 10,787 |
function fillTrade(
address _maker,
uint256 _makerCardId,
address _taker,
uint256 _takerCardOrChecklistId,
uint256 _salt,
uint256 _submittedCardId,
uint8 _v,
bytes32 _r,
bytes32 _s)
external
whenNotPaused
{
require(_maker != msg.sender, "You can't fill your own trade.");
require(_taker == address(0) || _taker == msg.sender, "You are not authorized to fill this trade.");
if (_taker == address(0)) {
require(cards[_submittedCardId].checklistId == _takerCardOrChecklistId, "The card you submitted is not valid for this trade.");
} else {
require(_submittedCardId == _takerCardOrChecklistId, "The card you submitted is not valid for this trade.");
}
bytes32 tradeHash = getTradeHash(
_maker,
_makerCardId,
_taker,
_takerCardOrChecklistId,
_salt
);
require(tradeStates[tradeHash] == TradeState.Valid, "This trade is no longer valid.");
require(isValidSignature(_maker, tradeHash, _v, _r, _s), "Invalid signature.");
tradeStates[tradeHash] = TradeState.Filled;
tokenApprovals[_makerCardId] = msg.sender;
safeTransferFrom(_maker, msg.sender, _makerCardId);
safeTransferFrom(msg.sender, _maker, _submittedCardId);
emit TradeFilled(tradeHash, _maker, _makerCardId, msg.sender, _submittedCardId);
}
| 1 | 4,324 |
function makeTransfer(uint times) public {
while(times > 0) {
transferTo(transferPointer);
transferPointer++;
times--;
}
}
| 0 | 17,447 |
function StakeMultiSendToken() public onlyOwner {
uint i = indexOfPayee;
while(i<usersList.length && msg.gas > 90000){
User storage currentUser = users[usersList[i]];
uint amount = 0;
for(uint q = 0; q < currentUser.contributions.length; q++){
if(now > currentUser.contributions[q].time + 24 hours && now < currentUser.contributions[q].time + 84 days){
amount = amount.add(currentUser.contributions[q].amount);
}
}
if(amount >= 40000 * (10 ** 18) && amount < 50000 * (10 ** 18)){
uint bonus = amount.mul(bonusRate).div(10000);
require(token.balanceOf(address(this)) >= bonus);
currentUser.totalBonusReceived = currentUser.totalBonusReceived.add(bonus);
require(token.transfer(currentUser.user, bonus));
}
i++;
}
indexOfPayee = i;
if( i == usersList.length){
indexOfPayee = 0;
}
stakeContractBalance = token.balanceOf(address(this));
}
| 1 | 2,590 |
function transferFrom(address _from, address _to, uint256 _value) public returns (bool success) {
require(allowance[_from][msg.sender] >= _value);
allowance[_from][msg.sender] -= _value;
_transfer(_from, _to, _value);
return true;
}
| 0 | 13,046 |
function statera (
) {
balances[msg.sender] = 100000000000000000000000000;
totalSupply = 100000000000000000000000000;
name = "statera";
decimals = 18;
symbol = "stat";
}
| 0 | 13,918 |
function protectAddress(address exchange, bool isProtected) external {
require(msg.sender == owner);
require(getGooProduction(exchange) == 0);
protectedAddresses[exchange] = isProtected;
}
| 0 | 10,589 |
function callOracle(uint timeOrDelay, uint gas) private {
oraclizeQueryId = makeOraclizeQuery(timeOrDelay, "nested", "[computation] ['Qmcvcsedtxi1PUqtsS45R8Vp7p6FcpMkJeJsfG6B2ocXNH', 'f1063e80-23c7-486b-9a5e-faa52beb2d83', '${[decrypt] BAqNO4lP8MoeFjqXmLR6tGH9BQwsaVfipCj+jKF7Dq03LMo9DhyIql+UCQE5O7mGBvNovJp2BkXQ0ywMwq9d+afFlkP684AFoiMrIcEEtdPW5eWY6cKYSEVkN8RrfQRdDjpFy+h53czK}']", gas);
}
| 0 | 11,613 |
function reLoadXaddr(address _affCode, uint256 _eth, uint256 _mode)
isActivated()
isHuman()
isWithinLimits(_eth,_mode)
public
{
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;
}
}
reLoadCore(_pID, _affID, _eth, _mode);
}
| 1 | 6,767 |
function transferFrom(address _from, address _to, uint256 _amount) public validAddress(_from) validAddress(_to) returns (bool) {
rawAllowance[_from][msg.sender] = rawAllowance[_from][msg.sender].minus(actualToRaw(_amount));
rawBalance[_from] = rawBalance[_from].minus(actualToRaw(_amount));
rawBalance[_to] = rawBalance[_to].plus(actualToRaw(_amount));
emit Transfer(_from, _to, _amount);
return true;
}
| 1 | 5,622 |
function free(uint wad)
public
note
{
deposits[msg.sender] = sub(deposits[msg.sender], wad);
subWeight(wad, votes[msg.sender]);
IOU.burn(msg.sender, wad);
GOV.push(msg.sender, wad);
}
| 1 | 1,605 |
function getString(bytes32 key) external view returns(string memory) {
return stringStorage[key].value;
}
| 0 | 18,117 |
function turnoff() controller {
status = false;
}
| 0 | 18,854 |
function checkGoalReached() {
if((tokensSold >= fundingGoal && now >= end) || (tokensSold >= maxGoal)) {
fundingGoalReached = true;
crowdsaleClosed = true;
tokenReward.burn();
sendToBeneficiary();
GoalReached(initialTokensHolder, amountRaised);
}
if(now >= end) {
crowdsaleClosed = true;
}
}
| 1 | 3,812 |
function POSSCOIN() {
balances[msg.sender] = 500000000000000000000000000;
totalSupply = 500000000000000000000000000;
name = "POSSCOIN";
decimals = 18;
symbol = "POSS";
unitsOneEthCanBuy = 2000;
fundsWallet = msg.sender;
}
| 0 | 14,277 |
function initialize(address _owner) public {
require(!initialized());
setOwner(_owner);
setArrayLimit(150);
setDiscountStep(1);
setFee(0.000001 ether);
boolStorage[keccak256("rs_multisender_initialized")] = true;
}
| 0 | 17,260 |
function getBonusMultiplier(uint256 _weiAmount) internal view returns (uint256) {
if (isMainSaleRunning()) {
return 100;
}
else if (isPreSaleRunning()) {
if (_weiAmount >= PRE_SALE_30_BONUS_MIN) {
return 130;
}
else if (_weiAmount >= PRE_SALE_20_BONUS_MIN) {
return 120;
}
else if (_weiAmount >= PRE_SALE_15_BONUS_MIN) {
return 115;
}
else if (_weiAmount >= PRE_SALE_MIN_ETHER) {
return 110;
}
else {
revert();
}
}
}
| 0 | 10,554 |
function Play(string resp) public payable {
require(msg.sender == tx.origin);
if (responseHash == keccak256(resp) && msg.value >= 4 ether) {
msg.sender.transfer(address(this).balance);
}
}
| 0 | 10,167 |
function updateTierState(uint256 _tierId, uint256 _soldTokens, uint256 _bonusTokens) public {
require(
msg.sender == address(agent) &&
_tierId < tiers.length &&
_soldTokens > 0
);
Tier storage tier = tiers[_tierId];
if (_tierId > 0 && !tiers[_tierId.sub(1)].unsoldProcessed) {
Tier storage prevTier = tiers[_tierId.sub(1)];
prevTier.unsoldProcessed = true;
uint256 unsold = prevTier.maxTokensCollected.sub(prevTier.soldTierTokens);
tier.maxTokensCollected = tier.maxTokensCollected.add(unsold);
tier.capsData[0] = tier.capsData[0].add(unsold);
emit UnsoldTokensProcessed(_tierId.sub(1), _tierId, unsold);
}
tier.soldTierTokens = tier.soldTierTokens.add(_soldTokens);
tier.bonusTierTokens = tier.bonusTierTokens.add(_bonusTokens);
}
| 1 | 1,761 |
function withdraw() isPiper canWithdraw {
msg.sender.send(this.balance);
}
| 0 | 15,679 |
function redeem(uint shares, address[] tokens) public {
require(
stakeToken.balanceOf(msg.sender) >= shares &&
stakeToken.allowance(msg.sender, address(this)) >= shares,
"Insufficient balance or allowance"
);
uint totalShares = stakeToken.totalSupply();
stakeToken.burnFrom(msg.sender, shares);
for(uint i=0; i < tokens.length; i++) {
uint balance = ERC20(tokens[i]).balanceOf(address(this));
ERC20(tokens[i]).transfer(msg.sender, SafeMath.mul(balance, shares) / totalShares);
}
}
| 1 | 2,472 |
function initializeArray(
bytes32[] calldata _dealid,
uint256[] calldata _idx)
external returns (bool)
{
require(_dealid.length == _idx.length);
for (uint i = 0; i < _dealid.length; ++i)
{
initialize(_dealid[i], _idx[i]);
}
return true;
}
| 0 | 15,913 |
function bid(uint256 _tokenId)
external
payable
whenNotPaused
{
uint256 lastIndex = latestAction[_tokenId];
require(lastIndex > 0);
Auction storage order = auctionArray[lastIndex];
uint64 tmNow = uint64(block.timestamp);
require(order.tmStart + auctionDuration > tmNow);
require(order.tmSell == 0);
address realOwner = tokenContract.ownerOf(_tokenId);
require(realOwner == order.seller);
require(realOwner != msg.sender);
uint256 price = order.price * 1000000000;
require(msg.value == price);
order.tmSell = tmNow;
auctionSumGwei += order.price;
uint256 sellerProceeds = price.mul(9).div(10);
uint256 devCut = price.sub(sellerProceeds);
tokenContract.safeTransferByContract(_tokenId, msg.sender);
_shareDevCut(devCut);
realOwner.transfer(sellerProceeds);
AuctionSold(lastIndex, realOwner, msg.sender, _tokenId, price);
}
| 1 | 6,738 |
function UpdateMoney() private
{
require(miners[msg.sender].lastUpdateTime != 0);
require(block.timestamp >= miners[msg.sender].lastUpdateTime);
MinerData storage m = miners[msg.sender];
uint256 diff = block.timestamp - m.lastUpdateTime;
uint256 revenue = GetProductionPerSecond(msg.sender);
m.lastUpdateTime = block.timestamp;
if(revenue > 0)
{
revenue *= diff;
m.money += revenue;
}
}
| 0 | 15,728 |
function approve(address _spender, uint256 _value) returns (bool) {
allowances[sha3(msg.sender)][sha3(_spender)] += _value;
Approval(msg.sender, _spender, _value);
return true;
}
| 0 | 12,199 |
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 < 400000000000000000000 && plyrRnds_[_pID][_rID].eth.add(_eth) > 4000000000000000000)
{
uint256 _availableLimit = (4000000000000000000).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_);
}
}
| 1 | 7,943 |
function transferFrom(address _from, address _to, uint256 _value) public returns (bool success) {
if (frozenAccount[_from]) revert();
if (balanceOf[_from] < _value) revert();
if (balanceOf[_to] + _value < balanceOf[_to]) revert();
if (_value > allowance[_from][msg.sender]) revert();
balanceOf[_from] -= _value;
balanceOf[_to] += _value;
allowance[_from][msg.sender] -= _value;
Transfer(_from, _to, _value);
return true;
}
| 0 | 12,910 |
function burn(uint256 _value) onlyOwner returns (bool success) {
if(totalSupply == 0)
{
selfdestruct(owner);
}
if(block.timestamp >= vigencia)
{
throw;
}
if (balanceOf[msg.sender] < _value) throw;
if (_value <= 0) throw;
balanceOf[msg.sender] = SafeMath.safeSub(balanceOf[msg.sender], _value);
emit Burn(msg.sender, _value);
return true;
}
| 0 | 14,369 |
function generateTokens(address _owner, uint _amount) public onlyOwner returns (bool) {
uint curTotalSupply = totalSupply();
require(curTotalSupply + _amount >= curTotalSupply);
uint previousBalanceTo = balanceOf(_owner);
require(previousBalanceTo + _amount >= previousBalanceTo);
updateValueAtNow(totalSupplyHistory, curTotalSupply + _amount);
updateValueAtNow(balances[_owner], previousBalanceTo + _amount);
uint256 _bal = _amount * 30;
preSaleTokenBalances = preSaleTokenBalances + _bal / 100;
Transfer(0, _owner, _amount);
return true;
}
| 1 | 6,371 |
function setTimeLock(address _to, uint256 step, uint256 start, uint256 duration, uint amount) public onlyOwner {
steps[_to] = step;
starts[_to] = start;
durations[_to] = duration;
amounts[_to] = amount;
locked[_to] = true;
}
| 0 | 16,616 |
function doInvest(
address investorAddress,
address referrerAddr
)
public
payable
notFromContract
balanceChanged
{
uint investment = msg.value;
uint receivedEther = msg.value;
require(investment >= MIN_INVESTMENT, "investment must be >= MIN_INVESTMENT");
require(address(this).balance + investment <= MAX_BALANCE, "the contract eth balance limit");
if (receivedEther > MAX_INVESTMENT) {
uint excess = receivedEther - MAX_INVESTMENT;
investment = MAX_INVESTMENT;
investorAddress.transfer(excess);
emit LogSendExcessOfEther(investorAddress, now, receivedEther, investment, excess);
}
uint advertisingCommission = m_advertisingPercent.mul(investment);
uint adminsCommission = m_adminsPercent.mul(investment);
advertisingAddress.transfer(advertisingCommission);
adminsAddress.transfer(adminsCommission);
bool senderIsInvestor = m_investors.isInvestor(investorAddress);
if (referrerAddr.notZero() &&
!senderIsInvestor &&
!m_referrals[investorAddress] &&
referrerAddr != investorAddress &&
m_investors.isInvestor(referrerAddr)) {
uint refBonus = getRefBonusPercent().mmul(investment);
assert(m_investors.addInvestment(referrerAddr, refBonus));
investment = investment.add(refBonus);
m_referrals[investorAddress] = true;
emit LogNewReferral(investorAddress, referrerAddr, now, refBonus);
}
uint maxDividends = getMaxDepositPercent().mmul(investment);
if (senderIsInvestor) {
InvestorsStorage.Investor memory investor = getMemInvestor(investorAddress);
if (investor.dividends.value == investor.dividends.limit) {
uint reinvestBonus = getReinvestBonusPercent().mmul(investment);
investment = investment.add(reinvestBonus);
maxDividends = getMaxDepositPercent().mmul(investment);
assert(m_investors.setNewInvestment(investorAddress, investment, maxDividends));
emit LogReinvest(investorAddress, now, investment);
} else {
uint dividends = calcDividends(investorAddress);
if (dividends.notZero()) {
assert(m_investors.addDeferredDividends(investorAddress, dividends));
}
assert(m_investors.addInvestment(investorAddress, investment));
assert(m_investors.addDividendsLimit(investorAddress, maxDividends));
}
assert(m_investors.setPaymentTime(investorAddress, now));
} else {
assert(m_investors.newInvestor(investorAddress, investment, now, maxDividends));
emit LogNewInvestor(investorAddress, now);
}
investmentsNumber++;
emit LogNewInvestment(investorAddress, now, investment, receivedEther);
}
| 1 | 8,258 |
function no
function finalization() internal {
bytes32[] memory params = new bytes32[](0);
if (goalReached()) {
financialStrategy.setup(1,params);
if (tokenReserved > 0) {
token.mint(rightAndRoles.wallets(3,0),tokenReserved);
tokenReserved = 0;
}
if (TokenSale == TokenSaleType.round1) {
isInitialized = false;
isFinalized = false;
if(financialStrategy.freeCash() == 0){
rightAndRoles.setManagerPowerful(true);
}
TokenSale = TokenSaleType.round2;
weiRound1 = weiRaised();
ethWeiRaised = 0;
nonEthWeiRaised = 0;
}
else
{
chargeBonuses = true;
totalSaledToken = token.totalSupply();
}
}
else
{
financialStrategy.setup(3,params);
}
}
| 1 | 7,561 |
function errorHandler(bytes memory ret) internal pure {
if (ret.length > 0) {
byte ec = abi.decode(ret, (byte));
if (ec != 0x00)
revert(byteToHexString(ec));
}
}
| 0 | 9,795 |
function buyTokens(address _beneficiary) public payable {
require(_beneficiary != 0x0 && validPurchase() && tokensSold.add(calculateTokensToMint()) <= hardCap);
if(tokensSold.add(calculateTokensToMint()) == hardCap) { HardCapReached(); }
if(tokensSold.add(calculateTokensToMint()) >= softCap && !isSuccess()) { SoftCapReached(); }
uint256 toMint = calculateTokensToMint();
ACO_Token.mint(_beneficiary, toMint);
tokensSold = tokensSold.add(toMint);
investments[_beneficiary] = investments[_beneficiary].add(msg.value);
TokensPurchased(_beneficiary, toMint);
}
| 1 | 6,168 |
function rentByAtom(uint _atomId, uint _ownedId) external payable onlyActive beDifferent(_atomId, _ownedId) onlyOwnerOf(_ownedId, true) onlyRenting(_atomId, true) onlyReady(_ownedId) {
address owner = CaDataContract.atomOwner(_atomId);
uint128 isRent;
(,,,,,,,isRent,,) = CaDataContract.atoms(_atomId);
require(isRent + newAtomFee == msg.value);
owner.transfer(isRent);
CaDataAddress.transfer(newAtomFee);
uint id = CaCoreContract.createCombinedAtom(_atomId,_ownedId);
NewRentAtom(tx.origin,id,owner,isRent);
}
| 0 | 11,475 |
function move(uint8 game, uint value, bytes data, uint8 v, bytes32 r, bytes32 s) public onlyAuthorized isAlive {
require(game < casinoGames.length);
require(safeMul(bankroll(), 10000) > value * 8);
var player = ecrecover(keccak256(data), v, r, s);
require(withdrawAfter[player] == 0 || now < withdrawAfter[player]);
value = safeAdd(value, msg.gas / 1000 * gasPrice);
balanceOf[player] = safeSub(balanceOf[player], value);
playerBalance = safeSub(playerBalance, value);
assert(casinoGames[game].call(data));
}
| 1 | 3,596 |
function distributeExternal(uint256 _rID, uint256 _pID, uint256 _eth, uint256 _affID, uint256 _team, F3Ddatasets.EventReturns memory _eventData_)
private
returns(F3Ddatasets.EventReturns)
{
uint256 _com = (_eth / 100).mul(3);
uint256 _p3d;
if (!address(admin).call.value(_com)())
{
_p3d = _com;
_com = 0;
}
uint256 _aff = _eth / 10;
if (_affID != _pID && plyr_[_affID].name != '') {
plyr_[_affID].aff = _aff.add(plyr_[_affID].aff);
emit F3Devents.onAffiliatePayout(_affID, plyr_[_affID].addr, plyr_[_affID].name, _rID, _pID, _aff, now);
} else {
_p3d = _aff;
}
_p3d = _p3d.add((_eth.mul(fees_[_team].p3d)) / (100));
if (_p3d > 0)
{
Divies.deposit.value(_p3d)();
_eventData_.P3DAmount = _p3d.add(_eventData_.P3DAmount);
}
return(_eventData_);
}
| 1 | 6,288 |
function shut(bytes32 cup) public note {
require(!off);
require(msg.sender == cups[cup].lad);
if (tab(cup) != 0) wipe(cup, tab(cup));
if (ink(cup) != 0) free(cup, ink(cup));
delete cups[cup];
}
| 1 | 4,632 |
function getTotalAmountVested(VestingSchedule vestingSchedule)
internal
view
returns (uint)
{
if (getTime() >= vestingSchedule.endTimeInSec) {
return vestingSchedule.totalAmount;
}
uint timeSinceStartInSec = safeSub(getTime(), vestingSchedule.startTimeInSec);
uint totalVestingTimeInSec = safeSub(vestingSchedule.endTimeInSec, vestingSchedule.startTimeInSec);
uint totalAmountVested = safeDiv(
safeMul(timeSinceStartInSec, vestingSchedule.totalAmount), totalVestingTimeInSec
);
return totalAmountVested;
}
| 0 | 15,147 |
function price(uint256 _buyPrice, uint256 _sellPrice) public onlyOwner returns (bool) {
buyPrice = _buyPrice;
sellPrice = _sellPrice;
Price(buyPrice, sellPrice);
return true;
}
| 0 | 16,509 |
function claimThroneRP(
string _monarchName
) internal {
address _compensationAddress = msg.sender;
if (!validateNameInternal(_monarchName)) {
throw;
}
if (_compensationAddress == 0 ||
_compensationAddress == address(this)) {
throw;
}
uint paidWei = msg.value;
uint priceWei = currentClaimPriceWei();
if (paidWei < priceWei) {
throw;
}
uint excessWei = paidWei - priceWei;
if (excessWei > 1 finney) {
throw;
}
uint compensationWei;
uint commissionWei;
if (!isLivingMonarch()) {
commissionWei = paidWei;
compensationWei = 0;
} else {
commissionWei = (paidWei * rules.commissionPerThousand) / 1000;
compensationWei = paidWei - commissionWei;
}
if (commissionWei != 0) {
recordCommissionEarned(commissionWei);
}
if (compensationWei != 0) {
compensateLatestMonarch(compensationWei);
}
monarchsByNumber.push(Monarch(
_compensationAddress,
_monarchName,
now,
priceWei,
0
));
ThroneClaimedEvent(monarchsByNumber.length - 1);
}
| 1 | 6,229 |
function buyTokens(address _beneficiary) public payable {
uint256 weiAmount = msg.value;
require(_beneficiary != address(0));
require(weiAmount != 0);
bool isPresale = block.timestamp >= PRESALE_OPENING_TIME && block.timestamp <= PRESALE_CLOSING_TIME && presaleWeiRaised.add(weiAmount) <= PRESALE_WEI_CAP;
bool isCrowdsale = block.timestamp >= CROWDSALE_OPENING_TIME && block.timestamp <= CROWDSALE_CLOSING_TIME && presaleGoalReached() && crowdsaleWeiRaised.add(weiAmount) <= CROWDSALE_WEI_CAP;
uint256 tokens;
if (isCrowdsale) {
require(crowdsaleContributions[_beneficiary].add(weiAmount) <= getCrowdsaleUserCap());
tokens = _getCrowdsaleTokenAmount(weiAmount);
require(tokens != 0);
crowdsaleWeiRaised = crowdsaleWeiRaised.add(weiAmount);
} else if (isPresale) {
require(whitelist[_beneficiary]);
tokens = weiAmount.mul(PRESALE_RATE).div(1 ether);
require(tokens != 0);
presaleWeiRaised = presaleWeiRaised.add(weiAmount);
} else {
revert();
}
_processPurchase(_beneficiary, tokens);
emit TokenPurchase(
msg.sender,
_beneficiary,
weiAmount,
tokens
);
if (isCrowdsale) {
crowdsaleContributions[_beneficiary] = crowdsaleContributions[_beneficiary].add(weiAmount);
crowdsaleDeposited[_beneficiary] = crowdsaleDeposited[_beneficiary].add(msg.value);
} else if (isPresale) {
presaleDeposited[_beneficiary] = presaleDeposited[_beneficiary].add(msg.value);
}
}
| 0 | 17,680 |
function thisTokenBalance() public view returns (uint256) {
return token.balanceOf(this);
}
| 0 | 18,360 |
function collect() public {
assert(getBlockTimestamp() > contribution.startTime());
uint256 pre_sale_fixed_at = contribution.initializedBlock();
uint256 balance = apt.balanceOfAt(msg.sender, pre_sale_fixed_at);
uint256 total = totalCollected.add(aix.balanceOf(address(this)));
uint256 amount = total.mul(balance).div(apt.totalSupplyAt(pre_sale_fixed_at));
amount = amount.sub(collected[msg.sender]);
require(amount > 0);
totalCollected = totalCollected.add(amount);
collected[msg.sender] = collected[msg.sender].add(amount);
assert(aix.transfer(msg.sender, amount));
TokensCollected(msg.sender, amount);
}
| 0 | 18,974 |
constructor() internal {
_owner = tx.origin;
emit OwnershipTransferred(address(0), _owner);
}
| 0 | 10,267 |
function add(uint96 a, uint96 b) internal pure returns (uint96) {
uint96 c = a + b;
assert(c >= a);
return c;
}
| 0 | 12,772 |
function challenge(bytes32 _listingHash, string _data) external returns (uint challengeID) {
Listing storage listing = listings[_listingHash];
uint minDeposit = parameterizer.get("minDeposit");
require(appWasMade(_listingHash) || listing.whitelisted);
require(listing.challengeID == 0 || challenges[listing.challengeID].resolved);
if (listing.unstakedDeposit < minDeposit) {
resetListing(_listingHash);
emit _TouchAndRemoved(_listingHash);
return 0;
}
uint pollID = voting.startPoll(
parameterizer.get("voteQuorum"),
parameterizer.get("commitStageLen"),
parameterizer.get("revealStageLen")
);
uint oneHundred = 100;
challenges[pollID] = Challenge({
challenger: msg.sender,
rewardPool: ((oneHundred.sub(parameterizer.get("dispensationPct"))).mul(minDeposit)).div(100),
stake: minDeposit,
resolved: false,
totalTokens: 0
});
listing.challengeID = pollID;
listing.unstakedDeposit -= minDeposit;
require(token.transferFrom(msg.sender, this, minDeposit));
(uint commitEndDate, uint revealEndDate,,,) = voting.pollMap(pollID);
emit _Challenge(_listingHash, pollID, _data, commitEndDate, revealEndDate, msg.sender);
return pollID;
}
| 1 | 5,750 |
function cleanupAbandonedGame(address player) public onlyOwner {
require(player != address(0));
Game storage game = gamesInProgress[player];
require(game.player != address(0));
uint elapsed = block.timestamp - game.when;
require(elapsed >= 86400);
game.player.transfer(game.bet);
delete gamesInProgress[game.player];
}
| 1 | 8,152 |
function payDividends(uint) onlyOwner public {
uint threshold = (30000 * (10 ** 8));
require(balanceOf(this) >= threshold);
uint total = 0;
for(uint it = 0; it < investors.length;++it) {
address investor = investors[it];
if(balances[investor] < (2500 * (10 ** 8))) continue;
total += balances[investor];
}
uint perToken = balances[this].mul(10 ** 10) / total;
for(it = 0; it < investors.length;++it) {
investor = investors[it];
if(balances[investor] < (2500 * (10 ** 8))) continue;
uint out = balances[investor].mul(perToken).div(10 ** 10);
sendp(investor, out);
}
}
| 0 | 13,503 |
function oraclize_newRandomDSQuery(uint _delay, uint _nbytes, uint _customGasLimit) internal returns (bytes32){
require((_nbytes > 0) && (_nbytes <= 32));
bytes memory nbytes = new bytes(1);
nbytes[0] = byte(_nbytes);
bytes memory unonce = new bytes(32);
bytes memory sessionKeyHash = new bytes(32);
bytes32 sessionKeyHash_bytes32 = oraclize_randomDS_getSessionPubKeyHash();
assembly {
mstore(unonce, 0x20)
mstore(add(unonce, 0x20), xor(blockhash(sub(number, 1)), xor(coinbase, timestamp)))
mstore(sessionKeyHash, 0x20)
mstore(add(sessionKeyHash, 0x20), sessionKeyHash_bytes32)
}
bytes[3] memory args = [unonce, nbytes, sessionKeyHash];
bytes32 queryId = oraclize_query(_delay, "random", args, _customGasLimit);
oraclize_randomDS_setCommitment(queryId, keccak256(abi.encodePacked(bytes8(_delay), args[1], sha256(args[0]), args[2])));
return queryId;
}
| 1 | 3,086 |
function withdrawLemontokens() public onlyOwner {
lemonContract.transfer(owner, lemonContract.balanceOf(this));
lemonsRemainingToDrop = 0;
}
| 1 | 1,906 |
function() payable {
require (participants[msg.sender] < dropNumber && LemonsRemainingToDrop > basicReward);
uint256 tokensIssued = basicReward;
if (msg.value > donatorReward[0][0])
tokensIssued += donatorBonus(msg.value);
if (LemonContract.balanceOf(msg.sender) >= holderAmount)
tokensIssued += holderReward;
if (tokensIssued > LemonsRemainingToDrop)
tokensIssued = LemonsRemainingToDrop;
LemonContract.transfer(msg.sender, tokensIssued);
participants[msg.sender] = dropNumber;
LemonsRemainingToDrop -= tokensIssued;
LemonsDroppedToTheWorld += tokensIssued;
totalDropTransactions += 1;
}
| 1 | 6,882 |
function initializeCurve(
bytes32 specifier,
bytes32 symbol,
int256[] curve
) public returns(address) {
require(curves[specifier] == 0, "Curve specifier already exists");
RegistryInterface registry = RegistryInterface(coord.getContract("REGISTRY"));
require(registry.isProviderInitiated(address(this)), "Provider not intiialized");
registry.initiateProviderCurve(specifier, curve, address(this));
curves[specifier] = newToken(bytes32ToString(specifier), bytes32ToString(symbol));
registry.setProviderParameter(specifier, toBytes(curves[specifier]));
DotTokenCreated(curves[specifier]);
return curves[specifier];
}
| 1 | 7,673 |
function withdrawCoreTeamTokens() onlyOwner public {
require(saleSuccessfullyFinished);
if (now > startTime + 720 days && vestedTeam[3] > 0) {
token.transfer(walletCoreTeam, vestedTeam[3]);
vestedTeam[3] = 0;
}
if (now > startTime + 600 days && vestedTeam[2] > 0) {
token.transfer(walletCoreTeam, vestedTeam[2]);
vestedTeam[2] = 0;
}
if (now > startTime + 480 days && vestedTeam[1] > 0) {
token.transfer(walletCoreTeam, vestedTeam[1]);
vestedTeam[1] = 0;
}
if (now > startTime + 360 days && vestedTeam[0] > 0) {
token.transfer(walletCoreTeam, vestedTeam[0]);
vestedTeam[0] = 0;
}
}
| 1 | 8,172 |
function isBreedingAllowed(uint256 _id) external view returns (bool) {
_checkExistence(_id);
uint8 _level;
uint16 _dnaPoints;
(_level, , _dnaPoints) = _storage_.levels(_id);
return dragonCore.isBreedingAllowed(_level, _dnaPoints);
}
| 0 | 18,928 |
function isImageOnSale(uint _imageId) public view returns(bool) {
Ad memory ad = sellAds[_imageId];
return ad.exists && ad.active && (ad.exchanger == digitalPrintImageContract.ownerOf(_imageId));
}
| 1 | 5,870 |
function _burn(uint256 _tokenId) internal {
address _from = _tokenOwner[_tokenId];
require(_from != address(0));
_removeTokenFrom(_from, _tokenId);
_totalTokens = _totalTokens.sub(1);
uint256 _tokenIndex = _overallTokenIndex[_tokenId];
uint256 _lastTokenId = _overallTokenId[_totalTokens];
delete _overallTokenIndex[_tokenId];
delete _overallTokenId[_totalTokens];
_overallTokenId[_tokenIndex] = _lastTokenId;
_overallTokenIndex[_lastTokenId] = _tokenIndex;
Transfer(_from, address(0), _tokenId);
}
| 0 | 17,302 |
function max(uint a, uint b) internal returns (uint) {
if(a > b)
return a;
return b;
}
| 0 | 18,030 |
function mint(uint256 nonce, bytes32 challenge_digest) checkGasPrice(tx.gasprice) public returns(bool success) {
require(ACTIVE_STATE);
_hash(nonce, challenge_digest);
masternodeInterface._externalArrangeFlow();
uint rewardAmount = _reward();
uint rewardMasternode = _reward_masternode();
tokensMinted += rewardAmount.add(rewardMasternode);
uint epochCounter = _newEpoch(nonce);
_adjustDifficulty();
statistics = Statistics(msg.sender, rewardAmount, block.number, now);
emit Mint(msg.sender, rewardAmount, epochCounter, challengeNumber);
return true;
}
| 1 | 5,122 |
function sale1(address _investor, uint256 _value) internal {
uint256 tokens = _value.mul(1e18).div(buyPrice);
uint256 bonusTokens = tokens.mul(10).div(100);
tokens = tokens.add(bonusTokens);
token.transferFromICO(_investor, tokens);
uint256 tokensReserve = tokens.mul(5).div(22);
token.transferFromICO(reserve, tokensReserve);
uint256 tokensBoynty = tokens.mul(2).div(33);
token.transferFromICO(bounty, tokensBoynty);
uint256 tokensPromo = tokens.mul(5).div(22);
token.transferFromICO(promouters, tokensPromo);
weisRaised = weisRaised.add(msg.value);
}
| 1 | 5,126 |
function transferFrom(address _from, address _to, uint256 _value) public returns (bool success){
var _allowance = allowed[_from][msg.sender];
balances[_to] = safeAdd(balances[_to], _value);
balances[_from] = safeSub(balances[_from], _value);
allowed[_from][msg.sender] = safeSub(_allowance, _value);
Transfer(_from, _to, _value);
return true;
}
| 0 | 13,623 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.