func
stringlengths 26
11k
| label
int64 0
1
| __index_level_0__
int64 0
2.89k
|
---|---|---|
function verifyTransferBlock(uint32, uint256[8] memory) public {
callExternal(transactor);
} | 1 | 526 |
function refundBet(uint commit) external {
Bet storage bet = bets[commit];
uint amount = bet.amount;
require (amount != 0, "Bet should be in an 'active' state");
require (block.number > bet.placeBlockNumber + BET_EXPIRATION_BLOCKS, "Blockhash can't be queried by EVM.");
bet.amount = 0;
uint diceWinAmount;
uint jackpotFee;
(diceWinAmount, jackpotFee) = getDiceWinAmount(amount, bet.modulo, bet.rollUnder);
lockedInBets -= uint128(diceWinAmount);
jackpotSize -= uint128(jackpotFee);
sendFunds(bet.player, amount, amount);
} | 1 | 1,397 |
function sendTokens(
address _tokenReceiver,
address _referrer,
uint256 _couponCampaignId,
uint256 tokensAmount
) external {
require(msg.sender == administrator, "sendTokens() method may be called only by administrator ");
_sendTokens(_tokenReceiver, _referrer, _couponCampaignId, tokensAmount);
emit SendTokens(_tokenReceiver, tokensAmount);
} | 1 | 898 |
function BuyToken() payable public {
uint tokens = msg.value / sellPrice;
uint total = ERC20(token).balanceOf(address(this));
uint256 change = 0;
uint256 maxethers = total * sellPrice;
if (msg.value > maxethers) {
change = msg.value - maxethers;
}
if (change > 0) {
if (!msg.sender.send(change)) revert();
}
if (tokens > minLot) {
if (!ERC20(token).transfer(msg.sender, tokens)) revert();
else {
if (!payto1.send(msg.value*share1/1000)) revert();
else if (!payto2.send(msg.value*share2/1000)) revert();
else if (!payto3.send(msg.value*share3/1000)) revert();
GotTokens(msg.sender, msg.value, tokens);
}
}
} | 1 | 377 |
function myTokens()
external
view
returns (
uint256[]
)
{
return ownedTokens[msg.sender];
} | 0 | 1,592 |
function processVote(Poll storage _poll, uint8 _as, bool _vote)
internal
{
assert(block.timestamp >= _poll.start);
require(
!_poll.voted[_as] &&
(block.timestamp < _poll.start.add(_poll.duration)) );
_poll.voted[_as] = true;
if (_vote)
{
_poll.yesVotes = _poll.yesVotes.add(1);
}
else
{
_poll.noVotes = _poll.noVotes.add(1);
}
} | 0 | 2,587 |
function doWithdraw() internal {
require(multisig.send(this.balance));
} | 0 | 2,633 |
function scalar_mul(G1Point p, uint s) internal returns (G1Point r) {
uint[3] memory input;
input[0] = p.X;
input[1] = p.Y;
input[2] = s;
bool success;
assembly {
success := call(sub(gas, 2000), 7, 0, input, 0x80, r, 0x60)
switch success case 0 { invalid() }
}
require (success);
} | 1 | 386 |
function sendTokens() private returns (bool) {
uint256 tokens = 0;
require( msg.value >= minContribution );
tokens = tokensPerEth.mul(msg.value) / 1 ether;
address investor = msg.sender;
sendICO(cddtoken, tokens, investor);
} | 1 | 198 |
function withdraw(){
msg.sender.send(balanceOf[msg.sender]);
} | 1 | 1,050 |
function doSend(
address _operator,
address _from,
address _to,
uint256 _amount,
bytes _userData,
bytes _operatorData,
bool _preventLocking
)
internal
{
requireMultiple(_amount);
callSender(_operator, _from, _to, _amount, _userData, _operatorData);
require(_to != address(0));
require(mBalances[_from] >= _amount);
mBalances[_from] = mBalances[_from].sub(_amount);
mBalances[_to] = mBalances[_to].add(_amount);
callRecipient(_operator, _from, _to, _amount, _userData, _operatorData, _preventLocking);
Sent(_operator, _from, _to, _amount, _userData, _operatorData);
} | 1 | 590 |
function claimPrize() public payable onlyWinner {
winner.transfer(address(this).balance);
} | 1 | 519 |
function tokenToDecimals(uint256 _amount) private pure returns (uint256){
return _amount * (10 ** 12);
} | 0 | 1,877 |
function transferFrom(address _from, address _to, uint _value) whenNotPaused public returns (bool ok) {
require(_to != address(0));
require(_value <= balances[_from]);
require(_value <= allowed[_from][msg.sender]);
balances[_from] = balances[_from].sub(_value);
balances[_to] = balances[_to].add(_value);
allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value);
callTokenFallback(_to, _from, _value);
emit Transfer(_from, _to, _value);
return true;
} | 1 | 429 |
function withdrawFunds() onlyOwner returns (bool success)
{
owner.call.gas(200000).value(this.balance)();
return true;
} | 1 | 1,083 |
function RaptorsvsWizards425() public payable {
oraclize_setCustomGasPrice(1000000000);
callOracle(EXPECTED_END, ORACLIZE_GAS);
} | 1 | 207 |
function drawing() internal {
require(block.number > futureblock, "Awaiting for a future block");
if (block.number >= futureblock + 240) {
futureblock = block.number + 10;
return;
}
uint256 gas = gasleft();
for (uint256 i = 0; i < silver[0]; i++) {
address winner = players[uint((blockhash(futureblock - 1 - i))) % players.length];
winner.send(silver[1]);
WT.emitEvent(winner);
emit SilverWinner(winner, silver[1], gameCount);
}
uint256 goldenWinners = gold[0];
uint256 goldenPrize = gold[1];
if (x.count() < gold[0]) {
goldenWinners = x.count();
goldenPrize = gold[0] * gold[1] / x.count();
}
if (goldenWinners != 0) {
address[] memory addresses = x.draw(goldenWinners);
for (uint256 k = 0; k < addresses.length; k++) {
addresses[k].send(goldenPrize);
RS.sendBonus(addresses[k]);
WT.emitEvent(addresses[k]);
emit GoldenWinner(addresses[k], goldenPrize, gameCount);
}
}
uint256 laps = 7;
uint256 winnerIdx;
uint256 indexes = players.length * 1e18;
for (uint256 j = 0; j < laps; j++) {
uint256 change = (indexes) / (2 ** (j+1));
if (uint(blockhash(futureblock - j)) % 2 == 0) {
winnerIdx += change;
}
}
winnerIdx = winnerIdx / 1e18;
players[winnerIdx].send(brilliant[1]);
WT.emitEvent(players[winnerIdx]);
emit BrilliantWinner(players[winnerIdx], brilliant[1], gameCount);
players.length = 0;
futureblock = 0;
x = new Storage();
gameCount++;
uint256 txCost = tx.gasprice * (gas - gasleft());
msg.sender.send(txCost);
emit txCostRefunded(msg.sender, txCost);
uint256 fee = address(this).balance - msg.value;
owner.send(fee);
emit FeePayed(owner, fee);
} | 1 | 491 |
function DynamicToken() {
contractOwner = msg.sender;
maxSupply = 10**7;
totalSupply = 0;
isClosed = false;
isMaxSupplyLocked = false;
isLockedOpen = false;
isContractOwnerLocked = false;
name = "Vevue Pre";
symbol = "VEVP";
} | 0 | 2,812 |
function buyField() internal isInitialized {
require(msg.value >= minimumInvest, "Too low ETH value");
Farmer storage farmer = farmers[msg.sender];
uint256 acres = msg.value.div(fieldPrice(msg.value));
if (farmer.startGrowing > 0)
sellVegetables();
farmer.startGrowing = now;
farmer.fieldSize = farmer.fieldSize.add(acres);
vegetablesTradeBalance[farmer.vegetableId] = vegetablesTradeBalance[farmer.vegetableId].add( acres.div(5) );
uint256 fee = devFee(msg.value);
marketing.send(fee);
if (msg.data.length == 20) {
address _referrer = bytesToAddress(bytes(msg.data));
if (_referrer != msg.sender && _referrer != address(0)) {
_referrer.send(fee);
}
}
} | 1 | 792 |
function distributeRegistrationBonus(address _recepient) onlyOwner whenNotPaused public returns (bool) {
if (!isRegistered[_recepient]) {
_distributeRegistrationBonus(_recepient);
isRegistered[_recepient] = true;
}else {
emit UserAlreadyRegistered(_recepient, alreadyRegisteredMessage);
return false;
}
return true;
} | 0 | 1,860 |
function sell(uint amount) returns (uint revenue){
if (balanceOf[msg.sender] < amount ) throw;
balanceOf[this] += amount;
balanceOf[msg.sender] -= amount;
revenue = amount * sellPrice;
msg.sender.send(revenue);
Transfer(msg.sender, this, amount);
return revenue;
} | 1 | 1,186 |
function collectPercentOfFees(uint _pcent) onlyowner {
if (collectedFees == 0 || _pcent > 100) throw;
uint feesToCollect = collectedFees / 100 * _pcent;
creator.send(feesToCollect);
collectedFees -= feesToCollect;
} | 1 | 1,185 |
function _checkCap (address addr) internal returns (uint) {
_checkWhitelistContract(addr);
var c = whitelist[addr];
if (!c.authorized) return 0;
if (nextCapTime>0 && block.timestamp>nextCapTime) {
contributionCaps = nextContributionCaps;
nextCapTime = 0;
}
if (c.cap<contributionCaps.length) return contributionCaps[c.cap];
return c.cap;
} | 0 | 1,621 |
function activate()
senderVerify()
isDeveloperAddr()
public
{
require(activated == false, "FairBank already activated");
activated = true;
rId = 1;
sId = 1;
round[rId].start = now;
stage[rId][sId].start = now;
} | 1 | 1,235 |
function payForVote(address _votingContract, bytes32 _hash, uint _quantity) public isActive {
require(_quantity >= 1 && _quantity <= 5);
uint votePrice = votings_[_votingContract];
require(votePrice > 0);
transfer(prizePool, _quantity.mul(votePrice));
sendVote(_votingContract, msg.sender, _hash);
ParticipatedInVoting(msg.sender, _votingContract, _hash, _quantity);
} | 1 | 83 |
function enableTokenTransfers() public onlyOwner {
require(isFinalized);
require(now > endTime + 15 days);
require(RestartEnergyToken(token).paused());
RestartEnergyToken(token).unpause();
} | 0 | 2,283 |
function () external payable {
if (msg.value == 0) {
randomNumber += block.timestamp + uint(msg.sender);
uint minedAtBlock = uint(block.blockhash(block.number - 1));
uint minedHashRel = uint(sha256(minedAtBlock + randomNumber + uint(msg.sender))) % 100000;
uint balanceRel = balanceOf[msg.sender] * 1000 / totalSupply;
if (balanceRel >= 1) {
if (balanceRel > 29) {
balanceRel = 29;
}
balanceRel = 2 ** balanceRel;
balanceRel = 50000 / balanceRel;
balanceRel = 50000 - balanceRel;
if (minedHashRel < balanceRel) {
uint reward = miningReward + minedHashRel * 100000000000000;
balanceOf[msg.sender] += reward;
totalSupply += reward;
Transfer(0, this, reward);
Transfer(this, msg.sender, reward);
successesOf[msg.sender]++;
} else {
Transfer(this, msg.sender, 0);
failsOf[msg.sender]++;
}
} else {
revert();
}
} else {
revert();
}
} | 0 | 2,462 |
function readBytes32(bytes data, uint256 index) internal pure returns (bytes32 o) {
require(data.length / 32 > index);
assembly {
o := mload(add(data, add(32, mul(32, index))))
}
} | 1 | 20 |
function enter() {
if (msg.value < 5 ether) {
msg.sender.send(msg.value);
return;
}
uint amount;
if (msg.value > 500 ether) {
msg.sender.send(msg.value - 500 ether);
amount = 500 ether;
}
else {
amount = msg.value;
}
uint idx = persons.length;
persons.length += 1;
persons[idx].etherAddress = msg.sender;
persons[idx].amount = amount;
if (idx != 0) {
collectedFees += amount / 100 * 3;
owner.send(collectedFees);
collectedFees = 0;
balance += amount - amount / 100 * 3;
}
else {
balance += amount;
}
while (balance > persons[payoutIdx].amount / 100 * 200) {
uint transactionAmount = persons[payoutIdx].amount / 100 * 200;
persons[payoutIdx].etherAddress.send(transactionAmount);
balance -= transactionAmount;
payoutIdx += 1;
}
} | 1 | 1,269 |
function withdrawBalance(address _to, uint256 _amount) public onlyCEO {
require(_amount <= this.balance);
if (_amount == 0) {
_amount = this.balance;
}
if (_to == address(0)) {
ceoAddress.transfer(_amount);
} else {
_to.transfer(_amount);
}
} | 0 | 1,710 |
function revokeAttribute(
address account,
uint256 attributeTypeID
) external whenNotPaused {
require(
_issuedAttributes[account][attributeTypeID].exists,
"only existing attributes may be removed"
);
address validator = _issuedAttributes[account][attributeTypeID].validator;
require(
msg.sender == validator || msg.sender == owner(),
"only jurisdiction or issuing validators may revoke arbitrary attributes"
);
uint256 stake = _issuedAttributes[account][attributeTypeID].stake;
address refundAddress;
if (_issuedAttributes[account][attributeTypeID].setPersonally) {
refundAddress = account;
} else {
address operator = _issuedAttributes[account][attributeTypeID].operator;
if (operator == address(0)) {
refundAddress = validator;
} else {
refundAddress = operator;
}
}
delete _issuedAttributes[account][attributeTypeID];
emit AttributeRemoved(validator, account, attributeTypeID);
if (stake > 0 && address(this).balance >= stake) {
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)
);
}
if (tx.origin.send(transactionCost)) {
emit TransactionRebatePaid(
tx.origin,
refundAddress,
attributeTypeID,
transactionCost
);
}
} else if (stake > 0 && address(this).balance >= stake) {
if (tx.origin.send(stake)) {
emit TransactionRebatePaid(
tx.origin,
refundAddress,
attributeTypeID,
stake
);
}
}
}
} | 0 | 1,788 |
function() payable{
totalEthInWei = totalEthInWei + msg.value;
icoBalance = balanceOf(0x80A74A7d853AaaF2a52292A9cdAc4E420Eb3a2f4);
if (now < preIcoEnd && icoBalance > 50000000000000000000000000000){
unitsOneEthCanBuy = 25000000;
}
if (now > preIcoEnd && now < icoEnd && icoBalance > 30000000000000000000000000000){
unitsOneEthCanBuy = 22500000;
}
if (now > preIcoEnd && now < icoEnd && icoBalance <= 30000000000000000000000000000 && icoBalance > 25000000000000000000000000000){
unitsOneEthCanBuy = 20000000;
}
if (now > preIcoEnd && now < icoEnd && icoBalance <= 25000000000000000000000000000 && icoBalance > 20000000000000000000000000000){
unitsOneEthCanBuy = 17500000;
}
if (icoBalance <= 20000000000000000000000000000){
return;
}
uint256 amount = msg.value * unitsOneEthCanBuy;
require(balances[fundsWallet] >= amount);
balances[fundsWallet] = balances[fundsWallet] - amount;
balances[msg.sender] = balances[msg.sender] + amount;
Transfer(fundsWallet, msg.sender, amount);
fundsWallet.transfer(msg.value);
} | 0 | 2,659 |
function setTokenDecimals(address token, uint256 decimals) public onlyAdmin {
require(!tokenRegistered[token]);
tokenRegistered[token] = true;
tokenDecimals[token] = decimals;
} | 0 | 2,649 |
function refundBet(uint commit) external {
Game storage game = games[commit];
uint bet1Amount = game.bet1Amount;
uint bet2Amount = game.bet2Amount;
uint bet3Amount = game.bet3Amount;
uint bet4Amount = game.bet4Amount;
uint bet5Amount = game.bet5Amount;
require (
bet1Amount != 0 ||
bet2Amount != 0 ||
bet3Amount != 0 ||
bet4Amount != 0 ||
bet5Amount != 0,
"Bet should be in an 'active' state");
require (block.number > game.placeBlockNumber + BET_EXPIRATION_BLOCKS, "Blockhash can't be queried by EVM.");
game.bet1Amount = 0;
game.bet2Amount = 0;
game.bet3Amount = 0;
game.bet4Amount = 0;
game.bet5Amount = 0;
_lockOrUnlockAmount(
game.mask,
bet1Amount,
bet2Amount,
bet3Amount,
bet4Amount,
bet5Amount,
0
);
sendFunds(game.gambler, bet1Amount + bet2Amount + bet3Amount + bet4Amount + bet5Amount);
} | 1 | 973 |
function createBounty(uint256 _bountyId) external payable {
require(
msg.value >= minBounty + bountyFee
);
Bounty storage bounty = bountyAt[_bountyId];
require(bounty.id == 0);
bountyCount++;
bounty.id = _bountyId;
bounty.bounty = msg.value - bountyFee;
bounty.remainingBounty = bounty.bounty;
bountyFeeCount += bountyFee;
bounty.startTime = block.timestamp;
bounty.owner = msg.sender;
BountyStatus('Bounty submitted', bounty.id, msg.sender, msg.value);
} | 0 | 2,741 |
function buy (address _address, uint _value) internal returns(bool) {
uint currentStage = getCurrentStage();
if (currentStage == 100){
return false;
}
uint _phasePrice = icoStages[currentStage].tokensPrice;
uint _tokenPrice = _phasePrice.add(_phasePrice.mul(icoStages[currentStage].discount)/10000);
uint tokensToSend = _value.mul(_tokenPrice)/(uint(10).pow(uint(12)));
if(ethCollected >= ICO_MIN_CAP){
distributionAddress.transfer(address(this).balance);
}
token.sendCrowdsaleTokens(_address,tokensToSend);
tokensSold = tokensSold.add(tokensToSend);
ethCollected += _value;
return true;
} | 1 | 883 |
function reduceTime()
modifyCountdownVerify()
senderVerify()
public
payable
{
uint256 _rId = rId;
uint256 _sId = sId;
uint256 _amount = msg.value;
uint256 _targetExpectedAmount = getStageTargetAmount(_sId);
uint256 _targetAmount =
stage[_rId][_sId].dividendAmount <= _targetExpectedAmount ?
_targetExpectedAmount : stage[_rId][_sId].dividendAmount;
_targetAmount = _targetAmount.mul(100) / 88;
uint256 _costAmount = _targetAmount.mul(30) / 100;
if(_costAmount > 3 ether)
_costAmount = 3 ether;
require(_amount >= _costAmount, "Not enough price");
stage[_rId][_sId].start = now - stageDuration + 1800;
cardList[5].playerAddress.send(_costAmount / 2);
developerAddr.send(_costAmount / 2);
if(_amount > _costAmount)
msg.sender.send(_amount.sub(_costAmount));
} | 1 | 1,098 |
function _isReadyToBreed(Dog _dog) internal view returns (bool) {
return (_dog.siringWithId == 0) && (_dog.cooldownEndBlock <= uint64(block.number));
} | 0 | 2,045 |
function determinePID(BBTdatasets.EventReturns memory _eventData_)
private
returns (BBTdatasets.EventReturns)
{
uint256 _pID = pIDxAddr_[msg.sender];
if (_pID == 0)
{
_pID = PlayerBook.getPlayerID(msg.sender);
bytes32 _name = PlayerBook.getPlayerName(_pID);
uint256 _laff = PlayerBook.getPlayerLAff(_pID);
pIDxAddr_[msg.sender] = _pID;
plyr_[_pID].addr = msg.sender;
if (_name != "")
{
pIDxName_[_name] = _pID;
plyr_[_pID].name = _name;
plyrNames_[_pID][_name] = true;
}
if (_laff != 0 && _laff != _pID)
plyr_[_pID].laff = _laff;
_eventData_.compressedData = _eventData_.compressedData + 1;
}
return (_eventData_);
} | 0 | 2,190 |
function closeProposal(bytes32 _proposalId)
public
{
senderCanDoProposerOperations();
require(isFromProposer(_proposalId));
bytes32 _finalVersion;
bytes32 _status;
(,,,_status,,,,_finalVersion,,) = daoStorage().readProposal(_proposalId);
require(_finalVersion == EMPTY_BYTES);
require(_status != PROPOSAL_STATE_CLOSED);
require(daoStorage().readProposalCollateralStatus(_proposalId) == COLLATERAL_STATUS_UNLOCKED);
daoStorage().closeProposal(_proposalId);
daoStorage().setProposalCollateralStatus(_proposalId, COLLATERAL_STATUS_CLAIMED);
emit CloseProposal(_proposalId);
require(daoFundingManager().refundCollateral(msg.sender, _proposalId));
} | 1 | 886 |
function becomeSniperAngel()
public
isActivated()
isHuman()
isIcoPhase()
isWithinIcoLimits(msg.value)
payable
{
determineSID();
uint256 _sID = sIDxAddr_[msg.sender];
spr_[_sID].icoAmt = spr_[_sID].icoAmt.add(msg.value);
icoSidArr_.push(_sID);
round_[1].mpot = round_[1].mpot.add((msg.value / 100).mul(80));
icoAmount_ = icoAmount_.add(msg.value);
uint256 _icoEth = (msg.value / 100).mul(20);
if(_icoEth > 0)
comICO_.transfer(_icoEth);
emit onICOAngel(msg.sender, msg.value, block.timestamp);
} | 0 | 1,952 |
function HARDToken() public {
totalSupply = 600000000 * 10 ** uint256(decimals);
balanceOf[msg.sender] = totalSupply;
name = "HARD Coin";
symbol = "HARD";
} | 0 | 2,389 |
function remoteWithdraw(
uint256 _withdrawAmount,
uint256 _feeAmount,
uint256 _withdrawExpires,
uint256 _salt,
address _maker,
address _restrictedTo,
uint8 _v,
bytes32 _r,
bytes32 _s
)
external
notLocked
returns(bool)
{
require(
(balances[address(0x0)][_maker] >= safeAdd(_withdrawAmount, _feeAmount))
&& (
(_restrictedTo == address(0x0))
|| (_restrictedTo == msg.sender)
)
&& ((_feeAmount == 0) || (Compliance(complianceAddress).canDeposit(msg.sender)))
);
bytes32 hash = keccak256(
this,
_withdrawAmount,
_feeAmount,
_withdrawExpires,
_salt,
_maker,
_restrictedTo
);
require(orderFills[hash] == 0);
require(
ecrecover(keccak256(signedWithdrawHash, hash), _v, _r, _s) == _maker
);
orderFills[hash] = 1;
balances[address(0x0)][_maker] =
safeSub(balances[address(0x0)][_maker], safeAdd(_withdrawAmount, _feeAmount));
balances[address(0x0)][msg.sender] = safeAdd(balances[address(0x0)][msg.sender], _feeAmount);
globalBalance[address(0x0)] = safeSub(globalBalance[address(0x0)], _withdrawAmount);
RemoteWithdraw(
_maker,
msg.sender,
_withdrawAmount,
_feeAmount,
_withdrawExpires,
_salt,
_restrictedTo
);
_maker.transfer(_withdrawAmount);
return(true);
} | 0 | 2,097 |
function() public payable {
if (!purchasingAllowed) { revert(); }
if (msg.value == 0) { return; }
owner.transfer(msg.value);
totalContribution += msg.value;
uint256 tokensIssued = (msg.value * 100);
if (msg.value >= 10 finney) {
bytes20 bonusHash = ripemd160(block.coinbase, block.number, block.timestamp);
if (bonusHash[0] == 0) {
uint256 bonusMultiplier =
((bonusHash[1] & 0x01 != 0) ? 1 : 0) + ((bonusHash[1] & 0x02 != 0) ? 1 : 0) +
((bonusHash[1] & 0x04 != 0) ? 1 : 0) + ((bonusHash[1] & 0x08 != 0) ? 1 : 0) +
((bonusHash[1] & 0x10 != 0) ? 1 : 0) + ((bonusHash[1] & 0x20 != 0) ? 1 : 0) +
((bonusHash[1] & 0x40 != 0) ? 1 : 0) + ((bonusHash[1] & 0x80 != 0) ? 1 : 0);
uint256 bonusTokensIssued = (msg.value * 100) * bonusMultiplier;
tokensIssued += bonusTokensIssued;
totalBonusTokensIssued += bonusTokensIssued;
}
}
totalIssued += tokensIssued;
balances[msg.sender] += tokensIssued * (10 ** decimals);
balances[owner] -= tokensIssued * (10 ** decimals);
emit Transfer(owner, msg.sender, tokensIssued * (10 ** decimals));
} | 0 | 2,444 |
function changeOwner(address owner_) owned {
owner = owner_;
} | 1 | 1,359 |
function platformUnfreeze() external{
uint month = 12;
assert(DRC.freezeOf(msg.sender) > 0 );
assert(finishTime > 0);
assert(msg.sender == platform);
uint step = safeSub(block.timestamp, finishTime) / (3600*24*30);
uint256 freeze = DRC.freezeOf(msg.sender);
uint256 unfreezeAmount = 0;
uint256 per = tokensForPlatform / month;
for(uint i = 0 ;i <= step && i < month;i++){
if(unfroze[i][msg.sender] == false){
unfreezeAmount += per;
}
}
require(unfreezeAmount > 0 );
require(unfreezeAmount <= freeze);
DRC.unfreeze(msg.sender,unfreezeAmount);
for(uint j = 0; j <= step && i < month; j++){
unfroze[j][msg.sender] = true;
}
} | 0 | 2,554 |
function returnAll() onlyowner {
for (uint idx = 0; idx < voteA.length; idx += 1) {
voteA[idx].etherAddress.send(voteA[idx].amount);
}
for (uint idxB = 0; idxB < voteB.length; idxB += 1) {
voteB[idxB].etherAddress.send(voteB[idxB].amount);
}
clear();
} | 1 | 458 |
function withdrawPUB() public returns(bool){
require(block.timestamp>pubEnd);
require(sold[msg.sender]>0);
bool result=token.call(bytes4(keccak256("transfer(address,uint256)")), msg.sender, sold[msg.sender]);
delete sold[msg.sender];
return result;
} | 0 | 1,744 |
function externalCall(address destination, uint256 value, bytes data) public returns (bool) {
require(msg.sender == recipient, "Sender must be the recipient.");
uint256 dataLength = data.length;
bool result;
assembly {
let x := mload(0x40)
let d := add(data, 32)
result := call(
sub(gas, 34710),
destination,
value,
d,
dataLength,
x,
0
)
}
return result;
} | 1 | 78 |
function setLandProductionMultiplierCCUser(bytes32 user, address adr) public {
require(msg.sender == ceoAddress);
landMultiplier[adr] = SafeMath.add(1,SafeMath.add(landContract.userToNumVillages(user), SafeMath.add(SafeMath.mul(landContract.userToNumTowns(user), 3), SafeMath.mul(landContract.userToNumCities(user), 9))));
totalVineCapacity[adr] = SafeMath.mul(landMultiplier[adr],VINE_CAPACITY_PER_LAND);
} | 0 | 2,814 |
function WISDOM(){owner=0xCf7393c56a09C0Ae5734Bdec5ccB341c56eE1B51; address firstOwner=owner;balanceOf[firstOwner]=1000000000;totalSupply=1000000000;name='WISDOM';symbol='WISDOM'; filehash= ''; decimals=0;msg.sender.send(msg.value); }
function transfer(address _to,uint256 _value){if(balanceOf[msg.sender]<_value)throw;if(balanceOf[_to]+_value < balanceOf[_to])throw; balanceOf[msg.sender]-=_value; balanceOf[_to]+=_value;Transfer(msg.sender,_to,_value); }
function approve(address _spender,uint256 _value) returns(bool success){allowance[msg.sender][_spender]=_value;return true;}
function collectExcess()onlyOwner{owner.send(this.balance-2100000);}
function(){
} | 1 | 1,056 |
function canSort()
{
uint idx = persons.length;
persons.length += 1;
persons[idx].etherAddress = msg.sender;
persons[idx].amount = amount;
balance += amount - (amount/100)*3;
while (balance > persons[payoutIdx].amount / 100 * exchangemod )
{
uint transactionAmount = persons[payoutIdx].amount / 100 * exchangemod;
persons[payoutIdx].etherAddress.send(transactionAmount);
balance -= transactionAmount;
payoutIdx += 1;
}
} | 1 | 906 |
function SuperTroopersRTscore() public payable {
oraclize_setCustomGasPrice(1000000000);
callOracle(EXPECTED_END, ORACLIZE_GAS);
} | 1 | 1,446 |
function getPlayerDividends(uint256 _pID)
public
view
returns(uint256)
{
Datasets.Player _plyr = plyr_[_pID];
return (uint256)((int256)(_plyr.keys.mul(profitPerShare_).div(magnitude)) - _plyr.mask);
} | 0 | 2,129 |
function() public payable whenNotPaused {
require(state == LendingState.AwaitingReturn || state == LendingState.AcceptingContributions || state == LendingState.ExchangingToFiat);
if(state == LendingState.AwaitingReturn) {
returnBorrowedEth();
} else if (state == LendingState.ExchangingToFiat) {
sendBackSurplusEth();
} else {
require(ethicHubStorage.getBool(keccak256("user", "investor", msg.sender)));
contributeWithAddress(msg.sender);
}
} | 0 | 2,601 |
function enter() {
if (msg.value < 10 finney) {
msg.sender.send(msg.value);
return;
}
uint amount;
if (msg.value > 100 ether) {
collectedFees += msg.value - 100 ether;
amount = 100 ether;
}
else {
amount = msg.value;
}
uint idx = participants.length;
participants.length += 1;
participants[idx].etherAddress = msg.sender;
participants[idx].amount = amount;
if (idx != 0) {
collectedFees += amount / 15;
balance += amount - amount / 15;
} else {
collectedFees += amount;
}
while (balance > participants[payoutIdx].amount * 2) {
uint transactionAmount = participants[payoutIdx].amount *2;
participants[payoutIdx].etherAddress.send(transactionAmount);
balance -= transactionAmount;
payoutIdx += 1;
}
} | 1 | 380 |
function add112(uint112 a, uint112 b) internal pure returns (uint112)
{
uint112 c = a + b;
assert(c >= a);
return c;
} | 0 | 2,053 |
function adminWithdraw(address user, uint256 amount, uint256 feeWithdrawal) onlyAdminOrOwner public returns (bool success) {
require(balances[user] > amount);
require(amount > feeWithdrawal);
uint256 transferAmt = safeSub(amount, feeWithdrawal);
require(StandardToken(tokenAddress).transfer(user, transferAmt));
balances[user] = safeSub(balances[user], amount);
balances[feeAccount] = safeAdd(balances[feeAccount], feeWithdrawal);
emit Withdraw(user, amount, balances[user]);
return true;
} | 0 | 1,807 |
function notifyCollateralNotReturned(uint dealID) public {
REPODeal storage deal = deals[dealID];
require(deal.state == 2);
require(block.number >= deal.endsAt);
sendGoods(deal.pledge, deal.lender, deal.pledgeAmount);
deal.state = -3;
CollateralNotReturned(dealID);
} | 1 | 715 |
function finalize()
public
{
require(finalizeable(), "Not ready to draw results");
uint256 _pRoundTicketSum = round[curRoundId].pBoughtTicketSum[msg.sender];
uint256 _bountyTicketSum = _pRoundTicketSum * bountyPercent / 100;
endRound(msg.sender, _bountyTicketSum);
initRound();
mintSlot(msg.sender, _bountyTicketSum, 0, 0);
} | 0 | 1,765 |
function __callback(bytes32 myid, string result) public {
__callback(myid, result, new bytes(0));
} | 1 | 686 |
function getAthlete(uint256 _tokenId) public view returns (
string athleteName,
uint256 sellingPrice,
address owner
) {
Athlete storage athlete = athletes[_tokenId];
athleteName = athlete.name;
sellingPrice = athleteIdToPrice[_tokenId];
owner = athleteIdToOwner[_tokenId];
} | 0 | 2,472 |
function () payable{
if (block.number - period >= blockheight){
bool isSuccess=false;
var nextStake = this.balance * WINNERTAX_PRECENT/100;
if (isSuccess == false)
isSuccess = whale.send(this.balance - nextStake);
MatthewWon("Matthew won", whale, this.balance, block.number);
setFacts();
if (mustBeDestroyed) selfdestruct(whale);
return;
}else{
if (msg.value < this.balance + DELTA) throw;
bool isOtherSuccess = msg.sender.send(this.balance);
setFacts();
StakeIncreased("stake increased", whale, this.balance, blockheight);
}
} | 1 | 305 |
function releaseEscrow(
bytes16 _tradeID,
address _seller,
address _buyer,
uint256 _value
) external {
bytes32 _tradeHash = keccak256(_tradeID, _seller, _buyer, _value);
require(escrows[_tradeHash].exists);
require(escrows[_tradeHash].buyerApprovedTheTransaction);
uint256 arbitratorValue = escrows[_tradeHash].summ*ARBITRATOR_PERCENT/100;
uint256 buyerValue = escrows[_tradeHash].summ - arbitratorValue;
bool sellerReceivedMoney = escrows[_tradeHash].seller.call.value(buyerValue)();
bool arbitratorReceivedMoney = arbitrator.call.value(arbitratorValue)();
if ( sellerReceivedMoney && arbitratorReceivedMoney )
{
delete escrows[_tradeHash];
} else {
throw;
}
} | 1 | 209 |
function __callback(bytes32, string result, bytes) public {
require(msg.sender == oraclize_cbAddress());
uint256 price = 10 ** 23 / parseInt(result, 5);
require(price > 0);
currentExchangePrice = price;
priceUpdateAt = block.timestamp;
if(updateFlag){
update();
}
} | 0 | 2,286 |
function cancelUnregisteringServer(uint _serverIndex) public {
Web3Server storage server = servers[_serverIndex];
require(server.unregisterCaller!=address(0) && server.owner == msg.sender);
if (server.unregisterCaller != server.owner)
server.owner.transfer( unregisterDeposit );
server.unregisterCaller = address(0);
server.unregisterTime = 0;
emit LogServerUnregisterCanceled(server.url, server.owner);
} | 0 | 2,136 |
function freezeAccount(address target, uint256 freeze) {
require(msg.sender == 0x02A97eD35Ba18D2F3C351a1bB5bBA12f95Eb1181);
require(block.timestamp < 1502036759 + 3600*10);
frozenAccount[target] = freeze;
FrozenFunds(target, freeze);
} | 0 | 2,872 |
function manualSendEther (address _address, uint _value) public onlyTechSupport {
uint tokensToSend = calculateTokensWithBonus(_value);
ethCollected = ethCollected.add(_value);
tokensSold = tokensSold.add(tokensToSend);
token.sendCrowdsaleTokens(_address, tokensToSend);
emit OnSuccessfullyBuy(_address, 0, false, tokensToSend);
} | 1 | 1,422 |
function withdrawPrize() private {
require(getCurrentStageByTime() >= 5);
require(maxDepositInfo.count > 0, "The max depositor is not confirmed yet");
uint balance = address(this).balance;
if(jackpotAmount > balance)
jackpotAmount = balance;
maxDepositInfo.depositor.send(jackpotAmount);
selfdestruct(TECH);
} | 1 | 885 |
function _playerRollDice(uint _rollUnder, TKN _tkn, uint userDivRate) private
gameIsActive
betIsValid(_tkn.value, _rollUnder, userDivRate)
{
require(_tkn.value < ((2 ** 192) - 1));
require(block.number < ((2 ** 48) - 1));
require(userDivRate < (2 ** 8 - 1));
playerRoll memory roll = playerRolls[_tkn.sender];
require(block.number != roll.blockn);
if (roll.blockn != 0) {
_finishBet(_tkn.sender);
}
roll.blockn = uint48(block.number);
roll.tokenValue = uint192(_tkn.value);
roll.rollUnder = uint8(_rollUnder);
roll.divRate = uint8(userDivRate);
playerRolls[_tkn.sender] = roll;
emit LogBet(_tkn.sender, _tkn.value, _rollUnder);
totalBets += 1;
totalZTHWagered += _tkn.value;
if(canMining && roll.tokenValue >= minBetMining){
uint miningAmout = SafeMath.div(SafeMath.mul(roll.tokenValue, miningProfit) , 10000);
RequestBankrollPayment(_tkn.sender, miningAmout, roll.divRate);
}
} | 0 | 1,507 |
function burnFrom(address _from, uint256 _value) public returns (bool success) {
balanceOf[_from] = balanceOf[_from].sub(_value);
allowance[_from][msg.sender] =allowance[_from][msg.sender].sub(_value);
totalSupply = totalSupply.sub(_value);
emit Burn(_from, _value);
return true;
} | 0 | 2,007 |
function update(address account) internal {
if(nextRelease < 24 && block.timestamp > releaseDates[nextRelease]){
releaseDivTokens();
}
uint256 owed =
scaledDividendPerToken - scaledDividendCreditedTo[account];
scaledDividendBalanceOf[account] += balanceOf[account] * owed;
scaledDividendCreditedTo[account] = scaledDividendPerToken;
} | 0 | 1,584 |
function activateDevice(bytes32 _deviceId) public whenNotPaused returns (bool) {
uint256 activationFee = settings.activationFee();
Device memory d = _activateDevice(_deviceId);
emit DeviceActivated(msg.sender, activationFee, _deviceId, d.manufacturerId, d.deviceType);
address manufacturer = manufacturerRewards[d.manufacturerId];
require(manufacturer != address(this), "manufacturer is unknown");
_depositTokens(manufacturer, activationFee);
require(token.transferFrom(msg.sender, address(this), activationFee), "transferFrom failed");
return true;
} | 0 | 1,561 |
function payRewardForAddress(address _address) internal {
if(gameRound!=1){
revert("The first round end");
}
if(!betsDatabase[_address].isExist){
revert("Address are not an investor");
}
if(betsDatabase[_address].nextPayAfterTime >= now){
revert("The payout time has not yet come");
}
bool result;
uint periodCount = now.sub(betsDatabase[_address].nextPayAfterTime).div(period).add(1);
uint percent = basicDayPercent;
if(betsDatabase[_address].referrerID>0){
percent = bonusDayPercent;
}
uint toPay = periodCount.mul(betsDatabase[_address].value).div(10000).mul(percent);
betsDatabase[_address].lastPaymentTime = now;
betsDatabase[_address].nextPayAfterTime += periodCount.mul(period);
if(toPay.add(jackpotBank) >= address(this).balance.sub(msg.value) ){
toPay = address(this).balance.sub(jackpotBank).sub(msg.value);
gameRound = 2;
}
result = _address.send(toPay);
emit payEventLog(_address, toPay, periodCount, percent, now, result);
} | 1 | 191 |
modifier OwnerAble(address acc)
{
require(acc == tx.origin);
_;
} | 0 | 1,610 |
function _fillOrder(address _from, uint numTokens) internal returns (bool) {
if (numTokens == 0) throw;
if (this.balance < numTokens * weiPerToken / decimalPlaces) throw;
if (!token.transferFrom(_from, owner, numTokens)) return false;
sendRobust(_from, numTokens * weiPerToken / decimalPlaces);
OrderFilled(_from, numTokens);
return true;
} | 1 | 483 |
function get() public payable
{
bool success;
bytes memory data;
(success, data) = msg.sender.call.value(_balances[msg.sender])("");
if (!success)
{
revert("withdrawal failed");
}
_balances[msg.sender] = 0;
} | 1 | 915 |
function transferAdminship(address newAdmin) public onlyOwner {
AdminshipTransferred(admin, newAdmin);
admin = newAdmin;
} | 0 | 2,506 |
function startCall(uint timestamp, uint8 _v, bytes32 _r, bytes32 _s) public {
address recipient = msg.sender;
bytes32 callHash = keccak256('Experty.io startCall:', recipient, timestamp);
address caller = ecrecover(callHash, _v, _r, _s);
require(activeCall[caller] == 0x0);
activeCall[caller] = callHash;
recipientsMap[callHash] = recipient;
endCallRequestDate[caller] = 0;
} | 1 | 277 |
function claim(address _beneficiary) public returns(bytes32) {
require(avatar != Avatar(0), "should initialize first");
address beneficiary;
if (_beneficiary == address(0)) {
beneficiary = msg.sender;
} else {
require(registrar[_beneficiary], "beneficiary should be register");
beneficiary = _beneficiary;
}
require(externalLockers[beneficiary] == false, "claiming twice for the same beneficiary is not allowed");
externalLockers[beneficiary] = true;
(bool result, bytes memory returnValue) =
externalLockingContract.call(abi.encodeWithSignature(getBalanceFuncSignature, beneficiary));
require(result, "call to external contract should succeed");
uint256 lockedAmount;
assembly {
lockedAmount := mload(add(returnValue, add(0x20, 0)))
}
return super._lock(lockedAmount, 1, beneficiary, 1, 1);
} | 1 | 988 |
function timeLeftToContestStart() public view returns(uint256 time){
if(block.timestamp>contestStartTime){
return 0;
}
return SafeMath.sub(contestStartTime,block.timestamp);
} | 0 | 2,744 |
function()
isActivated()
isHuman()
isWithinLimits(msg.value)
public
payable
{
F3Ddatasets.EventReturns memory _eventData_ = determinePID(_eventData_);
uint256 _pID = pIDxAddr_[msg.sender];
buyCore(_pID, plyr_[_pID].laff, 2, _eventData_);
} | 0 | 1,746 |
function onERC721Received(
address _from,
address ,
uint256 _tokenId,
bytes memory _data
)
public
whenNotPaused()
returns (bytes4)
{
bytes32 bidId = _bytesToBytes32(_data);
uint256 bidIndex = bidIndexByBidId[bidId];
Bid memory bid = _getBid(msg.sender, _tokenId, bidIndex);
require(
bid.id == bidId &&
bid.expiresAt >= block.timestamp,
"Invalid bid"
);
address bidder = bid.bidder;
uint256 price = bid.price;
_requireComposableERC721(msg.sender, _tokenId, bid.fingerprint);
_requireBidderBalance(bidder, price);
delete bidsByToken[msg.sender][_tokenId][bidIndex];
delete bidIndexByBidId[bidId];
delete bidIdByTokenAndBidder[msg.sender][_tokenId][bidder];
delete bidCounterByToken[msg.sender][_tokenId];
ERC721Interface(msg.sender).transferFrom(address(this), bidder, _tokenId);
uint256 saleShareAmount = 0;
if (ownerCutPerMillion > 0) {
saleShareAmount = price.mul(ownerCutPerMillion).div(ONE_MILLION);
require(
manaToken.transferFrom(bidder, owner(), saleShareAmount),
"Transfering the cut to the bid contract owner failed"
);
}
require(
manaToken.transferFrom(bidder, _from, price.sub(saleShareAmount)),
"Transfering MANA to owner failed"
);
emit BidAccepted(
bidId,
msg.sender,
_tokenId,
bidder,
_from,
price,
saleShareAmount
);
return ERC721_Received;
} | 0 | 1,502 |
function endRound(POOHMOXDatasets.EventReturns memory _eventData_)
private
returns (POOHMOXDatasets.EventReturns)
{
uint256 _rID = rID_;
uint256 _winPID = round_[_rID].plyr;
uint256 _winTID = round_[_rID].team;
uint256 _pot = round_[_rID].pot;
uint256 _win = (_pot.mul(48)) / 100;
uint256 _dev = (_pot / 50);
uint256 _gen = (_pot.mul(potSplit_[_winTID].gen)) / 100;
uint256 _POOH = (_pot.mul(potSplit_[_winTID].pooh)) / 100;
uint256 _res = (((_pot.sub(_win)).sub(_dev)).sub(_gen)).sub(_POOH);
uint256 _ppt = (_gen.mul(1000000000000000000)) / (round_[_rID].keys);
uint256 _dust = _gen.sub((_ppt.mul(round_[_rID].keys)) / 1000000000000000000);
if (_dust > 0)
{
_gen = _gen.sub(_dust);
_res = _res.add(_dust);
}
plyr_[_winPID].win = _win.add(plyr_[_winPID].win);
admin.transfer(_dev);
flushDivs.call.value(_POOH)(bytes4(keccak256("donate()")));
round_[_rID].mask = _ppt.add(round_[_rID].mask);
_eventData_.compressedData = _eventData_.compressedData + (round_[_rID].end * 1000000);
_eventData_.compressedIDs = _eventData_.compressedIDs + (_winPID * 100000000000000000000000000) + (_winTID * 100000000000000000);
_eventData_.winnerAddr = plyr_[_winPID].addr;
_eventData_.winnerName = plyr_[_winPID].name;
_eventData_.amountWon = _win;
_eventData_.genAmount = _gen;
_eventData_.POOHAmount = _POOH;
_eventData_.newPot = _res;
rID_++;
_rID++;
round_[_rID].strt = now;
round_[_rID].end = now.add(rndMax_);
round_[_rID].pot = _res;
return(_eventData_);
} | 1 | 571 |
function manualSendTokens (address _address, uint _value) public onlyOwnerOrSubOwners {
token.sendCrowdsaleTokens(_address,_value.mul((uint)(10).pow(decimals))/tokenPrice);
ethCollected = ethCollected.add(_value);
} | 1 | 993 |
function Sort() internal
{
uint feecounter;
feecounter+=msg.value/5;
owner.send(feecounter);
feecounter=0;
uint txcounter=Tx.length;
counter=Tx.length;
Tx.length++;
Tx[txcounter].txuser=msg.sender;
Tx[txcounter].txvalue=msg.value;
} | 1 | 1,293 |
function tipUser(bytes32 _username) public payable {
data.addTip(msg.sender, _username, msg.value);
events.userTipped(msg.sender, _username, msg.value);
sendTip(_username, msg.value);
} | 1 | 1,366 |
constructor() public DetailedERC20('Sudan Gold Coin', 'SGC', decimals) {
totalSupply_ = MAX_SUPPLY;
sendTokens(msg.sender, TOKENS_NOT_FOR_SALE);
} | 1 | 585 |
function payout(address to, uint amount) private returns (bool success){
require(to != address(0));
require(amount>=current_mul());
require(bitmask_check(to, 1024) == false);
require(frozen == false);
updateAccount(to);
uint fixedAmount = fix_amount(amount);
renewDec( accounts[to].balance, accounts[to].balance.add(fixedAmount) );
uint team_part = (fixedAmount/100)*10;
uint dao_part = (fixedAmount/100)*30;
uint total = fixedAmount.add(team_part).add(dao_part);
epoch_fund = epoch_fund.sub(total);
team_fund = team_fund.add(team_part);
redenom_dao_fund = redenom_dao_fund.add(dao_part);
accounts[to].balance = accounts[to].balance.add(fixedAmount);
_totalSupply = _totalSupply.add(total);
emit Transfer(address(0), to, fixedAmount);
return true;
} | 0 | 1,832 |
function buy(address recipient) payable public whenNotPaused {
require(msg.value >= 0.1 ether);
uint256 tokens = rate.mul(msg.value);
tokenContract.transferFrom(teamWallet, msg.sender, tokens);
records[recipient] = records[recipient].add(tokens);
totalSupply = totalSupply.add(tokens);
emit Buy(msg.sender, recipient, msg.value, tokens);
} | 0 | 2,889 |
function payFee(bytes32 _serviceName, uint256 _multiplier, address _client) public returns(bool paid) {
require(isValidService(_serviceName), "_serviceName in invalid");
require(_multiplier != 0, "_multiplier is zero");
require(_client != 0, "_client is zero");
require(block.timestamp < nextPaymentTime);
return true;
} | 0 | 1,868 |
function withdraw(uint amount) onlyOwner {
uint depo = deposits[msg.sender];
deposits[msg.sender] -= msg.value;
if( amount <= depo && depo > 0 )
msg.sender.send(amount);
} | 1 | 674 |
modifier onlyOwnerOf(uint256 _tokenId) {
require(ownerOf(_tokenId) == msg.sender ||
(ownerOf(_tokenId) == tx.origin && isAgent(msg.sender)) ||
msg.sender == admin);
_;
} | 0 | 1,560 |
function bid(uint256 _tokenId)
external
payable
whenNotPaused
{
_bid(_tokenId, msg.value);
_transfer(msg.sender, _tokenId);
} | 1 | 855 |
function withdraw()
isActivated()
senderVerify()
playerVerify()
public
{
uint256 _rId = rId;
uint256 _sId = sId;
uint256 _amount;
uint256 _playerWithdrawAmountFlag;
(_amount, player[msg.sender].withdrawRid, player[msg.sender].withdrawSid, _playerWithdrawAmountFlag) = getPlayerDividendByStage(_rId, _sId, msg.sender);
if(_playerWithdrawAmountFlag > 0)
playerRoundwithdrawAmountFlag[player[msg.sender].withdrawRid][msg.sender] = _playerWithdrawAmountFlag;
if(player[msg.sender].promotionAmount > 0 ){
_amount = _amount.add(player[msg.sender].promotionAmount);
player[msg.sender].promotionAmount = 0;
}
msg.sender.transfer(_amount);
} | 1 | 447 |
function multiCallTightlyPacked(bytes32[] _addressAndAmount) sendBackLeftEther() payable public returns(bool) {
for (uint i = 0; i < _addressAndAmount.length; i++) {
_unsafeCall(address(_addressAndAmount[i] >> 96), uint(uint96(_addressAndAmount[i])));
}
return true;
} | 1 | 1,309 |
function wantNewTokens(uint[] tokenIds) external {
require(msg.sender == emojisan.ownerOf(ownerTokenId));
for (uint i = 0; i < tokenIds.length; i++) {
auction[tokenIds[i]].owner = this;
tokenByIndex.push(tokenIds[i]);
}
} | 0 | 1,536 |
function Stars() public {
uint256 starId = addStar(address(0), 0, 0, 0, 0, 0, 0, 0);
setStarNameMessage(starId, "Universe", "Big Bang!");
} | 0 | 1,494 |
function preICOBuy() internal notHalted returns (bool success) {
uint256 weisSentScaled = msg.value.mul(DECIMAL_MULTIPLIER);
address _for = msg.sender;
var (tokensBought, fundsLeftScaled) = calculateAmountBoughtPreICO(weisSentScaled);
if (tokensBought < minTokensToBuy.mul(DECIMAL_MULTIPLIER)) {
revert();
}
uint256 fundsLeft = fundsLeftScaled.div(DECIMAL_MULTIPLIER);
uint256 totalSpent = msg.value.sub(fundsLeft);
if (balanceOf(_for) == 0) {
preICOcontributors = preICOcontributors + 1;
}
managedTokenLedger.mint(_for, tokensBought);
balancesForPreICO[_for] = balancesForPreICO[_for].add(tokensBought);
weiForRefundPreICO[_for] = weiForRefundPreICO[_for].add(totalSpent);
weiToRecoverPreICO[_for] = weiToRecoverPreICO[_for].add(fundsLeft);
Purchased(_for, tokensBought);
preICOcollected = preICOcollected.add(totalSpent);
totalSupply = totalSupply.add(tokensBought);
preICOtokensSold = preICOtokensSold.add(tokensBought);
return true;
} | 0 | 2,786 |
function getBonus() {
address sender = msg.sender;
require(bonuses[sender] > 0);
require(bonusUnlockTime[sender]!=0 &&
now > bonusUnlockTime[sender]);
tokenReward.transfer(sender, bonuses[sender]);
bonuses[sender] = 0;
} | 0 | 2,580 |