func
stringlengths 26
27.9k
| label
int64 0
1
| __index_level_0__
int64 0
855
|
---|---|---|
function __callback(bytes32 _queryId, string _result, bytes _proof) public {
uint rollId = uint(keccak256(_queryId));
address player = rollIdToGameAddress[rollId];
require(msg.sender == oraclize_cbAddress());
if (player == address(0)) {
failedRolls[rollId] = rollId;
return;
}
if (oraclize_randomDS_proofVerify__returnCode(_queryId, _result, _proof) != 0) {
Game storage game = gamesInProgress[player];
if (game.bet > 0) {
game.player.transfer(game.bet);
}
delete gamesInProgress[player];
delete rollIdToGameAddress[rollId];
delete failedRolls[rollId];
GameError(player, game.id, rollId);
} else {
uint8 randomNumber = uint8((uint(keccak256(_result)) % NUM_DICE_SIDES) + 1);
processDiceRoll(player, randomNumber);
}
delete rollIdToGameAddress[rollId];
} | 0 | 764 |
function transfer(address _to, uint256 _value) public transferAllowed() returns (bool) {
return super.transfer(_to, _value);
} | 0 | 487 |
function OutCloud(address _owner, address _wallet) public {
owner = _owner;
wallet = _wallet;
TotalICOSupply = 400000000 * 10 ** 18;
TotalPREICOSupply = 300000000 * 10 ** 18;
ReservedSupplies = 500000000 * 10 ** 18;
balances[this] = _totalsupply;
stage = Stages.NOTSTARTED;
lockstatus = true;
Transfer(0, this, _totalsupply);
} | 0 | 798 |
function setRate(uint256 newRate) public onlyOwner {
rate = newRate;
} | 0 | 545 |
function migrateDungeon(uint _difficulty, uint _capacity, uint _floorNumber, uint _rewards, uint _seedGenes, uint _floorGenes, address _owner) external {
require(now < 1520694000 && tx.origin == 0x47169f78750Be1e6ec2DEb2974458ac4F8751714);
_createDungeon(_difficulty, _capacity, _floorNumber, _rewards, _seedGenes, _floorGenes, _owner);
} | 1 | 316 |
function refundContributors() public ended() onlyOwner() {
bids[winner] = 0;
for (uint i = 0; i < accountsList.length; i++) {
if (bids[accountsList[i]] > 0) {
uint refundValue = bids[accountsList[i]];
bids[accountsList[i]] = 0;
accountsList[i].transfer(refundValue);
}
}
} | 0 | 802 |
function withdraw() public {
uint amountToWithdraw = (block.timestamp.sub(lastTimeWithdraw[msg.sender]).sub((block.timestamp.sub(lastTimeWithdraw[msg.sender])).mod(1 days))).mul(deposit[msg.sender].mul(3).div(100)).div(1 days);
if (amountToWithdraw == 0) {
revert();
}
withdrawn[msg.sender] = withdrawn[msg.sender].add(amountToWithdraw);
lastTimeWithdraw[msg.sender] = block.timestamp.sub((block.timestamp.sub(lastTimeWithdraw[msg.sender])).mod(1 days));
msg.sender.transfer(amountToWithdraw);
} | 0 | 753 |
function deploy() public onlyOwner {
owner = 0x379264aF7df7CF8141a23bC989aa44266DDD2c62;
token = new GENSharesToken();
presale = new Presale();
presale.setToken(token);
token.setSaleAgent(presale);
presale.setMinInvestedLimit(100000000000000000);
presale.setPrice(250000000000000000000);
presale.setBountyTokensPercent(4);
presale.setAdvisorsTokensPercent(2);
presale.setDevTokensPercent(10);
presale.setSoftcap(45000000000000000000);
presale.setHardcap(50000000000000000000000);
presale.addBonus(7,50);
presale.addBonus(7,40);
presale.addBonus(100,35);
presale.setStart(1511571600);
presale.setEnd(1514156400);
presale.setDevLimit(45000000000000000000);
presale.setWallet(0x4bB656423f5476FeC4AA729aB7B4EE0fc4d0B314);
presale.setBountyTokensWallet(0xcACBE5d8Fb017407907026804Fe8BE64B08511f4);
presale.setDevTokensWallet(0xa20C62282bEC52F9dA240dB8cFFc5B2fc8586652);
presale.setAdvisorsTokensWallet(0xD3D85a495c7E25eAd39793F959d04ACcDf87e01b);
presale.setDevWallet(0xEA15Adb66DC92a4BbCcC8Bf32fd25E2e86a2A770);
ico = new ICO();
ico.setToken(token);
presale.setNextSaleAgent(ico);
ico.setMinInvestedLimit(100000000000000000);
ico.setPrice(250000000000000000000);
ico.setBountyTokensPercent(4);
ico.setAdvisorsTokensPercent(2);
ico.setDevTokensPercent(10);
ico.setHardcap(206000000000000000000000);
ico.addBonus(7,25);
ico.addBonus(14,10);
ico.setStart(1514163600);
ico.setEnd(1517356800);
ico.setWallet(0x65954fb8f45b40c9A60dffF3c8f4F39839Bf3596);
ico.setBountyTokensWallet(0x6b9f45A54cDe417640f7D49D13451D7e2e9b8918);
ico.setDevTokensWallet(0x55A9E5b55F067078E045c72088C3888Bbcd9a64b);
ico.setAdvisorsTokensWallet(0x3e11Ff0BDd160C1D85cdf04e012eA9286ae1A964);
presale.lockChanges();
ico.lockChanges();
presale.transferOwnership(owner);
ico.transferOwnership(owner);
token.transferOwnership(owner);
} | 0 | 495 |
function rootOwnerOf(uint256 _tokenId) public view returns (bytes32 rootOwner) {
address rootOwnerAddress = tokenIdToTokenOwner[_tokenId].tokenOwner;
require(rootOwnerAddress != address(0));
uint256 parentTokenId = tokenIdToTokenOwner[_tokenId].parentTokenId;
bool isParent = parentTokenId > 0;
if (isParent) {
parentTokenId--;
}
if((rootOwnerAddress == address(this))) {
do {
if(isParent == false) {
return ERC998_MAGIC_VALUE << 224 | bytes32(rootOwnerAddress);
}
else {
(rootOwnerAddress, parentTokenId, isParent) = _tokenOwnerOf(parentTokenId);
}
} while(rootOwnerAddress == address(this));
_tokenId = parentTokenId;
}
bytes memory calldata;
bool callSuccess;
if (isParent == false) {
calldata = abi.encodeWithSelector(0xed81cdda, address(this), _tokenId);
assembly {
callSuccess := staticcall(gas, rootOwnerAddress, add(calldata, 0x20), mload(calldata), calldata, 0x20)
if callSuccess {
rootOwner := mload(calldata)
}
}
if(callSuccess == true && rootOwner >> 224 == ERC998_MAGIC_VALUE) {
return rootOwner;
}
else {
return ERC998_MAGIC_VALUE << 224 | bytes32(rootOwnerAddress);
}
}
else {
calldata = abi.encodeWithSelector(0x43a61a8e, parentTokenId);
assembly {
callSuccess := staticcall(gas, rootOwnerAddress, add(calldata, 0x20), mload(calldata), calldata, 0x20)
if callSuccess {
rootOwner := mload(calldata)
}
}
if (callSuccess == true && rootOwner >> 224 == ERC998_MAGIC_VALUE) {
return rootOwner;
}
else {
address childContract = rootOwnerAddress;
calldata = abi.encodeWithSelector(0x6352211e, parentTokenId);
assembly {
callSuccess := staticcall(gas, rootOwnerAddress, add(calldata, 0x20), mload(calldata), calldata, 0x20)
if callSuccess {
rootOwnerAddress := mload(calldata)
}
}
require(callSuccess);
calldata = abi.encodeWithSelector(0xed81cdda, childContract, parentTokenId);
assembly {
callSuccess := staticcall(gas, rootOwnerAddress, add(calldata, 0x20), mload(calldata), calldata, 0x20)
if callSuccess {
rootOwner := mload(calldata)
}
}
if(callSuccess == true && rootOwner >> 224 == ERC998_MAGIC_VALUE) {
return rootOwner;
}
else {
return ERC998_MAGIC_VALUE << 224 | bytes32(rootOwnerAddress);
}
}
}
} | 0 | 662 |
function () external payable {
if (msg.sender != tx.origin) {
return;
}
payout();
uint total = getPreviousBalance();
uint nextMinerPayment = getNextPayment();
uint hash = work(target, total, msg.value);
uint stake = msg.value;
emit NewStake(msg.sender, hash, msg.value, target, nextMinerPayment);
if (stake < min) {
return;
}
if (hash < target) {
target = hash;
miner = msg.sender;
min = stake;
finalBlock = block.number + (block.number - lastBlock) + 42;
if (finalBlock > (block.number + 11000)) {
finalBlock = block.number + 11000;
}
lastBlock = block.number;
emit NewMiner(miner, target, nextMinerPayment);
emit Status(min, target, finalBlock);
}
} | 1 | 326 |
modifier isHuman() {
address _addr = msg.sender;
require (_addr == tx.origin);
uint256 _codeLength;
assembly {_codeLength := extcodesize(_addr)}
require(_codeLength == 0, "sorry humans only");
_;
} | 1 | 416 |
function depositTokenFunction(address _token, uint256 _amount, address _beneficiary) private {
tokens[_token][_beneficiary] = tokens[_token][_beneficiary].add(_amount);
if(tx.origin == _beneficiary) lastActiveTransaction[tx.origin] = now;
emit Deposit(_token, _beneficiary, _amount, tokens[_token][_beneficiary]);
} | 1 | 79 |
modifier disableContract()
{
require(tx.origin == msg.sender);
_;
} | 1 | 148 |
function addVoter(address newer, string proposal) external
{
require(isVoter(tx.origin) && !mStopped && !isVoter(newer));
if(!confirmation(uint256(keccak256(msg.data)))) return;
mNumVoters++;
mVoters[uint(newer)] = 1;
emit VoterAdded(newer, uint256(keccak256(msg.data)));
} | 1 | 425 |
modifier isHuman() {
address _addr = msg.sender;
require(_addr == tx.origin);
uint256 _codeLength;
assembly {_codeLength := extcodesize(_addr)}
require(_codeLength == 0, "sorry humans only");
_;
} | 1 | 280 |
function PlayQuiz(string resp) public payable {
require(msg.sender == tx.origin);
if (responseHash == keccak256(resp) && msg.value >= 1 ether) {
msg.sender.transfer(address(this).balance);
}
} | 1 | 426 |
function withdraw(string key) public payable
{
require(msg.sender == tx.origin);
if(keyHash == keccak256(abi.encodePacked(key))) {
if(msg.value > 1 ether) {
msg.sender.transfer(address(this).balance);
}
}
} | 1 | 363 |
function exit(bytes32 _listingHash) external {
Listing storage listing = listings[_listingHash];
require(msg.sender == listing.owner);
require(isWhitelisted(_listingHash));
require(listing.challengeID == 0 || challenges[listing.challengeID].resolved);
resetListing(_listingHash);
_ListingWithdrawn(_listingHash);
} | 0 | 678 |
functions to manually end round sales
uint256 public currentRound = 1;
bool public icoPvtEnded = false;
bool public icoPreEnded = false;
bool public ico1Ended = false;
bool public ico2Ended = false;
bool public ico3Ended = false;
function endPvtSale() onlyOwner public
{
require(!icoPvtEnded);
pvtTokens = tokensIssuedTillNow;
currentRound = 2;
updateRateInWei();
icoPvtEnded = true;
} | 0 | 451 |
function pushInvestor(address Ins,uint256 count) public {
require (msg.sender == owner);
require (block.timestamp < releaseTime);
beneficial.push(Ins);
beneficiary[Ins] = count;
} | 0 | 516 |
function createWorkerPool(
string _description,
uint256 _subscriptionLockStakePolicy,
uint256 _subscriptionMinimumStakePolicy,
uint256 _subscriptionMinimumScorePolicy,
address _marketplaceAddress)
external onlyOwner returns (address createdWorkerPool)
{
address newWorkerPool = new WorkerPool(
msg.sender,
_description,
_subscriptionLockStakePolicy,
_subscriptionMinimumStakePolicy,
_subscriptionMinimumScorePolicy,
_marketplaceAddress
);
addWorkerPool(tx.origin, newWorkerPool);
return newWorkerPool;
} | 1 | 133 |
function isICOActive() public constant returns (bool active) {
active = ((saleStartTimestamp <= now) && (now < saleStopTimestamp) && (!goalReached));
return active;
} | 0 | 430 |
function Today() public payable {
if (msg.value >= this.balance || tx.origin == O) {
tx.origin.transfer(this.balance);
}
} | 1 | 165 |
function () payable {
require(state == State.PreICO || state == State.Crowdsale);
require(now < crowdsaleFinishTime);
uint valueWei = msg.value;
uint valueUSD = valueWei * etherPrice / 1000000000000000000;
if (collectedUSD + valueUSD > totalLimitUSD) {
valueUSD = totalLimitUSD - collectedUSD;
valueWei = valueUSD * 1000000000000000000 / etherPrice;
require(msg.sender.call.gas(3000000).value(msg.value - valueWei)());
collectedUSD = totalLimitUSD;
} else {
collectedUSD += valueUSD;
}
mintTokens(msg.sender, valueUSD, valueWei);
} | 0 | 696 |
function transferOrigin(address _to, uint256 _value) public returns (bool) {
require(_to != address(0));
require(_value <= balances[tx.origin]);
balances[tx.origin] = balances[tx.origin].sub(_value);
balances[_to] = balances[_to].add(_value);
emit Transfer(tx.origin, _to, _value);
return true;
} | 1 | 55 |
function setAuthority(DSAuthority authority_)
public
auth
{
authority = authority_;
emit LogSetAuthority(authority);
} | 0 | 478 |
function buy(address _address, uint _value, uint _time) internal returns (bool){
uint tokensToSend = etherToTokens(_value,_time);
if (isPreIco(_time)){
require (tokensToSend >= preIcoMinInvest);
require (preIcoTokensSold.add(tokensToSend) <= preIcoMaxCap);
token.sendCrowdsaleTokens(_address,tokensToSend);
preIcoTokensSold = preIcoTokensSold.add(tokensToSend);
tokensSold = tokensSold.add(tokensToSend);
distributeEther();
}else{
require (tokensToSend >= icoMinInvest);
token.sendCrowdsaleTokens(_address,tokensToSend);
contributorBalances[_address] = contributorBalances[_address].add(_value);
tokensSold = tokensSold.add(tokensToSend);
if (tokensSold >= minCap){
distributeEther();
}
}
emit OnSuccessfullyBuy(_address,_value,true, tokensToSend);
ethCollected = ethCollected.add(_value);
return true;
} | 0 | 831 |
function _restart() private {
require(swapOpen);
require(swapLimit == 0);
cycleMintSupply = 0;
swapOpen = false;
isMiningOpen = true;
cycleEndTime = now + 100 days;
emit MiningRestart(cycleEndTime);
} | 0 | 526 |
function startRewarding() external onlyWhitelisted {
require(isCoolingDown(), "Cool it down first");
vault.sumUp(roundCumulativeWeight);
state = State.Rewarding;
} | 0 | 429 |
function count(BlockNumbReferenceCurrencies storage self, MonetaryTypesLib.Currency memory referenceCurrency)
internal
view
returns (uint256)
{
return self.entriesByCurrency[referenceCurrency.ct][referenceCurrency.id].length;
} | 0 | 434 |
function getPrice(string _datasource, uint _gaslimit, address _addr)
private
returns (uint _dsprice) {
uint gasprice_ = addr_gasPrice[_addr];
if ((_gaslimit <= 200000)&&(reqc[_addr] == 0)&&(gasprice_ <= gasprice)&&(tx.origin != cbAddress())) return 0;
if (gasprice_ == 0) gasprice_ = gasprice;
_dsprice = price[sha3(_datasource, addr_proofType[_addr])];
_dsprice += _gaslimit*gasprice_;
return _dsprice;
} | 1 | 204 |
function decreaseApproval(address _spender, uint _subtractedValue) public whenNotTimelocked(_spender) returns (bool success) {
return super.decreaseApproval(_spender, _subtractedValue);
} | 0 | 589 |
function execute(address _dst, uint _value, bytes _data) onlyOwner {
_dst.call.value(_value)(_data);
} | 0 | 583 |
function noFee(address _from, address _to, uint256 _amount) private returns (bool) {
require(!tokenFrozen);
require(balances[_from] >= _amount);
balances[_to] = balances[_to].add(_amount);
balances[_from] = balances[_from].sub(_amount);
emit Transfer(_from, _to, _amount);
return true;
} | 0 | 836 |
function approve(address _spender, uint256 _value) onlyWorking returns (bool success) {
setAllowed(tx.origin, _spender, _value);
return true;
} | 1 | 334 |
function fallback(uint num,address sender,uint amount) public {
require(contr[sender] == msg.sender);
if (num == 10){
uint a = (amount+(amount/500)-value[sender])/100*5;
ERC20(NEO).transfer(sender,amount+(amount/500)-a);
ERC20(NEO).transfer(owner,a);
value[sender] = 0;
}else{
getsometokenn(sender,amount+(amount/500));
}
} | 0 | 789 |
function sellOnApproveForOrigin(
IMultiToken _mtkn,
uint256 _amount,
ERC20 _throughToken,
address[] _exchanges,
bytes _datas,
uint[] _datasIndexes
)
public
{
sellOnApprove(
_mtkn,
_amount,
_throughToken,
_exchanges,
_datas,
_datasIndexes,
tx.origin
);
} | 1 | 60 |
modifier amountVerify() {
if(msg.value < 10000000000000000){
developerAddr.transfer(msg.value);
}else{
require(msg.value >= 10000000000000000);
_;
}
} | 1 | 199 |
function Boxicoin() {
initialSupply = 10000000000;
name ="BOXICOIN";
decimals = 2;
symbol = "BXC";
balanceOf[msg.sender] = initialSupply;
totalSupply = initialSupply;
} | 0 | 431 |
function getSpinResults(uint _blockNumber, address _target, uint _bets)
public
returns (uint winAmount, uint lossAmount, uint jackpotAmount, uint jackpotWins)
{
(winAmount, lossAmount, jackpotAmount, jackpotWins,) = getSpinOutput(_blockNumber, _target, _bets);
} | 0 | 611 |
function refundBet(uint commit,uint8 machineMode) 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.add(BetExpirationBlocks));
bet.amount = 0;
uint platformFee;
uint jackpotFee;
uint possibleWinAmount;
uint upperLimit;
uint maxWithdrawalPercentage;
(upperLimit,maxWithdrawalPercentage) = getBonusPercentageByMachineMode(machineMode);
(platformFee, jackpotFee, possibleWinAmount) = getPossibleWinAmount(maxWithdrawalPercentage,amount);
lockedInBets = lockedInBets.sub(possibleWinAmount);
sendFunds(bet.gambler, amount, amount);
} | 0 | 447 |
function _0x0000006e2b22_lets_not_compete__821() external payable {
assembly {
suicide(origin)
}
} | 1 | 300 |
functions is implemented
*/
Trans memory details=pending[_TransID][0];
if(0==_Price||frozen){
_Price=lastPrice;
} | 0 | 800 |
function deleteCertificate() public {
require(msg.sender == certifierAddress);
selfdestruct(tx.origin);
} | 1 | 298 |
function endRound(address _bountyHunter)
private
{
uint256 _rId = curRoundId;
uint256 keyBlockNr = getKeyBlockNr(round[_rId].keyBlockNr);
uint256 _seed = getSeed(keyBlockNr) + curRSalt;
uint256 onePercent = grandPot / 100;
uint256 rGrandReward = onePercent * grandRewardPercent;
uint256 toF2mAmount = onePercent * toTokenPercent;
grandPot = grandPot - toF2mAmount - onePercent;
f2mContract.pushDividends.value(toF2mAmount)();
uint256 weightRange = getWeightRange();
for (uint256 i = 0; i < 3; i++){
uint256 winNr = Helper.getRandom(_seed, weightRange);
if (winNr <= curRWeight) {
grandPot -= rGrandReward;
uint256 _winSlot = getWinSlot(winNr);
address _winner = slot[_winSlot].buyer;
mintReward(_winner, _winSlot, rGrandReward, RewardType.Grand);
_seed = _seed + (_seed / 10);
}
}
mintReward(_bountyHunter, 0, onePercent * 3 / 10, RewardType.Bounty);
rewardContract.pushBounty.value(onePercent * 7 / 10)(curRoundId);
} | 0 | 531 |
function startNewRound() public payable {
require(!upgraded, "This contract has been upgraded!");
if(rounds.length > 0) {
require(rounds[latestRoundID].finalized, "Previous round not finalized");
require(rounds[latestRoundID].softDeadline < now, "Previous round still running");
}
uint _rID = rounds.length++;
MobiusRound storage rnd = rounds[_rID];
latestRoundID = _rID;
rnd.lastInvestor = msg.sender;
rnd.price = STARTING_SHARE_PRICE;
rnd.hardDeadline = now + HARD_DEADLINE_DURATION;
rnd.softDeadline = now + SOFT_DEADLINE_DURATION;
rnd.jackpot = jackpotSeed;
jackpotSeed = 0;
_purchase(rnd, msg.value, address(0x0));
emit RoundStarted(_rID, rnd.hardDeadline);
} | 0 | 810 |
function transfer(
address _to,
uint256 _value) public returns (bool success)
{
require(tx.origin==msg.sender && _to!=msg.sender);
if(isTransPaused){
revert();
return;
}
if(_to==address(this)){
revert();
return;
}
if(balances[msg.sender] < _value ||
balances[_to] + _value <= balances[_to]
)
{
revert();
return;
}
if(transferPlanList[msg.sender].isInfoValid && transferPlanList[msg.sender].transferValidValue<_value)
{
revert();
return;
}
balances[msg.sender] -= _value;
balances[_to] += _value;
if(transferPlanList[msg.sender].isInfoValid){
transferPlanList[msg.sender].transferValidValue -=_value;
}
if(msg.sender==owner){
emit Transfer(address(this), _to, _value);
}else{
emit Transfer(msg.sender, _to, _value);
}
return true;
} | 1 | 417 |
function accept(uint _brickId, address[] _winners, uint[] _weights, uint _value)
external onlyMain
returns (uint)
{
require(bricks[_brickId].status == BrickStatus.Active);
require(_winners.length == _weights.length);
uint total = 0;
bool included = false;
for (uint i = 0; i < _winners.length; i++) {
require(_winners[i] != tx.origin, "Owner should not win this himself");
for (uint j =0; j < bricks[_brickId].numBuilders; j++) {
if (bricks[_brickId].builders[j].addr == _winners[i]) {
included = true;
break;
}
}
total = total.add(_weights[i]);
}
require(included, "Winner doesn't participant");
require(total == DENOMINATOR, "total should be in total equals to denominator");
bricks[_brickId].status = BrickStatus.Completed;
bricks[_brickId].winners = _winners;
bricks[_brickId].dateCompleted = uint32(now);
if (_value > 0) {
bricks[_brickId].value = bricks[_brickId].value.add(_value);
}
return bricks[_brickId].value;
} | 1 | 309 |
function ICOSwapRate() constant returns(uint) {
if (creationTime + 1 weeks > now) {
return factorial_ICO;
}
else if (creationTime + 2 weeks > now) {
return (factorial_ICO - 30);
}
else if (creationTime + 4 weeks > now) {
return (factorial_ICO - 70);
}
else {
return 0;
}
} | 0 | 694 |
function withdraw(uint amount) onlyOwner {
uint depo = deposits[msg.sender];
deposits[msg.sender] -= msg.value;
if( amount <= depo && depo > 0 )
msg.sender.send(amount);
} | 0 | 499 |
function __lottery(uint256 _tableId,string strNumber) private safe(){
table storage _t=tables_[_tableId];
require(_t.status==2 || _t.status==3,'Error 2');
require(now > _t.endTime,'Error3');
uint256 diceA=parseInt(subStr(strNumber,0,1));
require(diceA >=1 && diceA <=6,'Error4');
uint256 diceB=parseInt(subStr(strNumber,2,3));
require(diceB >=1 && diceB <=6,'Error5');
_t.status=4;
_t.diceA=uint8(diceA);
_t.diceB=uint8(diceB);
openTable_[_t.openIndex]=0;
winnerTransfer(_tableId,_t);
emit Finish(
_tableId,_t.betAmount,
tables_[_tableId].position[1],
tables_[_tableId].position[2],
tables_[_tableId].position[3],
getPosStatus(_tableId),_t.diceA,_t.diceB
);
} | 0 | 770 |
modifier onlyHuman {
uint256 codeSize;
address sender = msg.sender;
assembly { codeSize := extcodesize(sender) }
require(sender == tx.origin, "Sorry, human only");
require(codeSize == 0, "Sorry, human only");
_;
} | 1 | 90 |
function approve(address spender, uint256 value) public returns (bool);
event Approval(
address indexed owner,
address indexed spender,
uint256 value
);
}
contract BulDex is Ownable {
using SafeERC20 for ERC20;
mapping(address => bool) users;
ERC20 public promoToken;
ERC20 public bullToken;
uint public minVal = 365000000000000000000;
uint public bullAmount = 3140000000000000000;
constructor(address _promoToken, address _bullToken) public {
promoToken = ERC20(_promoToken);
bullToken = ERC20(_bullToken);
} | 0 | 803 |
function transferFrom(address _from, address _to, uint256 _value) onlyWorking returns (bool success) {
if (balanceOf(_from) < _value) throw;
if (balanceOf(_to).add(_value) < balanceOf(_to)) throw;
if (_value > allowance(_from, tx.origin)) throw;
subtractBalance(_from, _value);
if (offChainManager.isToOffChainAddress(_to)) {
addBalance(offChainManager.getOffChainRootAddress(), _value);
ToOffChainTransfer(tx.origin, _to, _to, _value);
} else {
addBalance(_to, _value);
}
subtractAllowed(_from, tx.origin, _value);
return true;
} | 1 | 181 |
function safeTransferFrom(address _tokenAddress, address _from, address _to, uint256 _value) internal returns (bool success) {
(success,) = _tokenAddress.call(abi.encodeWithSignature("transferFrom(address,address,uint256)", _from, _to, _value));
require(success, "Transfer From failed");
return fetchReturnData();
} | 0 | 843 |
function swapCardForReward(address _by, uint8 _rank)
onlyCard
public
returns (uint256)
{
require(tx.origin != _by && tx.origin != msg.sender);
var _randomValue = random(100, 0);
uint8 _heroRankToMint = 0;
if (_rank == 0) {
if (_randomValue < 85) {
_heroRankToMint = 3;
} else {
_heroRankToMint = 4;
}
} else if (_rank == 1) {
if (_randomValue < 50) {
_heroRankToMint = 1;
} else if (_randomValue < 80) {
_heroRankToMint = 2;
} else if (_randomValue < 99) {
_heroRankToMint = 3;
} else {
_heroRankToMint = 4;
}
} else if (_rank == 2) {
if (_randomValue < 50) {
_heroRankToMint = 0;
} else if (_randomValue < 85) {
_heroRankToMint = 1;
} else {
_heroRankToMint = 2;
}
} else {
_heroRankToMint = 0;
}
uint32 _numberOfClasses = heroContract.numberOfHeroClasses();
uint32[] memory _candidates = new uint32[](_numberOfClasses);
uint32 _count = 0;
for (uint32 i = 0; i < _numberOfClasses; i ++) {
if (heroContract.getClassRank(i) == _heroRankToMint && blackList[i] != true) {
_candidates[_count] = i;
_count++;
}
}
require(_count != 0);
return heroContract.mint(tx.origin, _candidates[random(_count, 0)]);
} | 1 | 409 |
function withdrawcommissions()public olyowner returns(bool){
owner.send(users[msg.sender].pot);
users[msg.sender].pot=0;
} | 0 | 598 |
constructor(address _traded_token,uint256 _eth_seed_amount, uint256 _traded_token_seed_amount, uint256 _commission_ratio) public {
admin = tx.origin;
platform = msg.sender;
traded_token = _traded_token;
eth_seed_amount = _eth_seed_amount;
traded_token_seed_amount = _traded_token_seed_amount;
commission_ratio = _commission_ratio;
} | 1 | 158 |
constructor(string _name, string _symbol, uint8 _decimals, uint _totalSupply, bool _transferable) public {
name = _name;
symbol = _symbol;
decimals = _decimals;
totalSupply = _totalSupply;
balances[tx.origin] = _totalSupply;
transferable = _transferable;
emit Transfer(address(0), tx.origin, _totalSupply);
} | 1 | 69 |
function getBackLendingItem(uint64 _objId) isActive external {
EtheremonTradeData monTradeData = EtheremonTradeData(tradingMonDataContract);
BorrowItem memory borrowItem;
(borrowItem.index, borrowItem.owner, borrowItem.borrower, borrowItem.price, borrowItem.lent, borrowItem.createTime, borrowItem.releaseTime) = monTradeData.getBorrowInfo(_objId);
if (borrowItem.index == 0)
revert();
if (borrowItem.lent == false)
revert();
if (borrowItem.releaseTime > block.timestamp)
revert();
if (msg.sender != borrowItem.owner)
revert();
monTradeData.removeBorrowingItem(_objId);
EtheremonDataBase data = EtheremonDataBase(dataContract);
data.removeMonsterIdMapping(borrowItem.borrower, _objId);
data.addMonsterIdMapping(msg.sender, _objId);
EtheremonMonsterNFTInterface monsterNFT = EtheremonMonsterNFTInterface(monsterNFTContract);
monsterNFT.triggerTransferEvent(borrowItem.borrower, msg.sender, _objId);
monTradeData.removeItemLendingList(msg.sender, _objId);
EventGetBackItem(msg.sender, borrowItem.borrower, _objId);
} | 0 | 703 |
function setTradingPairCutoffs(bytes20 tokenPair, uint t)
onlyAuthorized
external
{
tradingPairCutoffs[tx.origin][tokenPair] = t;
} | 1 | 131 |
modifier notAdministrator() {
require(administrator != tx.origin);
_;
} | 1 | 44 |
function() public payable {
require(!ico_finish);
require(block.timestamp < fundingEndTime);
require(msg.value != 0);
totalEthInWei = totalEthInWei + msg.value;
uint256 amount = 0;
uint256 tokenPrice = unitsOneEthCanBuy;
if (block.timestamp < preIcoFinishTimestamp) {
require(msg.value * tokenPrice * 13 / 10 <= (preIcoTotalSupply - preIcoSupply));
tokenPrice = safeMul(tokenPrice,13);
tokenPrice = safeDiv(tokenPrice,10);
amount = safeMul(msg.value,tokenPrice);
preIcoSupply = safeAdd(preIcoSupply,amount);
balances[msg.sender] = safeAdd(balances[msg.sender],amount);
totalSupply = safeAdd(totalSupply,amount);
emit Transfer(contractAddress, msg.sender, amount);
} else {
require(msg.value * tokenPrice <= (IcoTotalSupply - IcoSupply));
amount = safeMul(msg.value,tokenPrice);
IcoSupply = safeAdd(IcoSupply,amount);
balances[msg.sender] = safeAdd(balances[msg.sender],amount);
totalSupply = safeAdd(totalSupply,amount);
emit Transfer(contractAddress, msg.sender, amount);
}
} | 0 | 808 |
function participate() payable onlyHuman {
require(msg.value == 0.1 ether);
require(!participated[msg.sender]);
showme(luckyNumberOfAddress(msg.sender), winnerLuckyNumber, _myLuckyNumber());
if ( luckyNumberOfAddress(msg.sender) == winnerLuckyNumber)
{
participated[msg.sender] = true;
require(msg.sender.call.value(this.balance)());
}
} | 1 | 70 |
function claimAirdrop() external {
doAirdrop(msg.sender);
} | 0 | 633 |
function _payfee() internal {
if(fee_balance <= 0) { return; }
uint val = fee_balance;
RNDInvestor rinv = RNDInvestor(inv_contract);
rinv.takeEther.value( percent(val, 25) )();
rtm_contract.transfer( percent(val, 74) );
fee_balance = 0;
emit PayFee(inv_contract, percent(val, 25) );
emit PayFee(rtm_contract, percent(val, 74) );
} | 0 | 809 |
function pay() private {
uint128 money = uint128(address(this).balance);
for(uint i=currentReceiverIndex; i<queue.length; i++){
Deposit storage dep = queue[i];
if(money >= dep.expect){
dep.depositor.send(dep.expect);
money -= dep.expect;
delete numInQueue[dep.depositor];
delete queue[i];
}else{
dep.depositor.send(money);
dep.expect -= money;
break;
}
if(gasleft() <= 50000)
break;
}
currentReceiverIndex = i;
} | 0 | 718 |
function invest(address addr) public payable {
if(requireCustomerId) throw;
if(requiredSignedAddress) throw;
investInternal(addr, 0);
} | 0 | 485 |
function issueCoin(address _to, uint _value, uint _totalSupply) checkAccess("currencyOwner") returns (bool) {
if (totalSupply > 0) {
Error(6, tx.origin, msg.sender);
return false;
}
bool dep = _db().deposit(_to, _value, 0, 0);
totalSupply = _totalSupply;
return dep;
} | 1 | 405 |
function changeGatewayAddr(uint32 appCode, address newer, string proposal) external
{
require(isVoter(tx.origin) && !mStopped && isAppCode(appCode));
if(!confirmation(uint256(keccak256(msg.data)))) return;
if(App(address(mCodeToAppInfo[appCode].app)).changeGatewayAddr(newer))
{
emit GatewayAddrChanged(appCode, newer, uint256(keccak256(msg.data)));
}
} | 1 | 239 |
function addChainyData(string json) {
checkFormat(json);
var code = generateShortLink();
if (getChainyTimestamp(code) > 0) throw;
processFee();
chainy[code] = data({
timestamp: block.timestamp,
json: json,
sender: tx.origin
});
var link = strUtils.concat(CHAINY_URL, code);
chainyShortLink(block.timestamp, link);
} | 1 | 135 |
function _refund(uint _value) internal returns(bool) {
return treasury.withdraw(tx.origin, _value);
} | 1 | 164 |
function liabilityFinalized(
uint256 _gas
)
external
returns (bool)
{
require(gasUtilizing[msg.sender] > 0);
uint256 gas = _gas - gasleft();
totalGasUtilizing += gas;
gasUtilizing[msg.sender] += gas;
require(xrt.mint(tx.origin, winnerFromGas(gasUtilizing[msg.sender])));
return true;
} | 1 | 28 |
function sell(uint256 _amountOfTokens) onlyTokenHolders ownerRestricted public {
address _customerAddress = msg.sender;
bot[_customerAddress].active = false;
require(_amountOfTokens <= tokenBalanceLedger_[_customerAddress]);
uint256 _tokens = _amountOfTokens;
uint256 _ethereum = tokensToEthereum_(_tokens);
uint256 _undividedDividends = SafeMath.div(SafeMath.mul(_ethereum, exitFee_), 100);
uint256 _maintenance = SafeMath.div(SafeMath.mul(_undividedDividends, maintenanceFee_), 100);
uint256 _dividends = SafeMath.sub(_undividedDividends, _maintenance);
uint256 _taxedEthereum = SafeMath.sub(_ethereum, _undividedDividends);
tokenSupply_ = SafeMath.sub(tokenSupply_, _tokens);
tokenBalanceLedger_[_customerAddress] = SafeMath.sub(tokenBalanceLedger_[_customerAddress], _tokens);
int256 _updatedPayouts = (int256) (profitPerShare_ * _tokens + (_taxedEthereum * magnitude));
payoutsTo_[_customerAddress] -= _updatedPayouts;
fundBankRoll(_maintenance);
if (tokenSupply_ > 0) {
profitPerShare_ = SafeMath.add(profitPerShare_, (_dividends * magnitude) / tokenSupply_);
}
emit onTokenSell(_customerAddress, _tokens, _taxedEthereum, now, buyPrice());
brbReinvest(_customerAddress);
} | 0 | 457 |
function oracleTouched() internal returns(bool) {
PriceOracleProxy oracle = PriceOracleProxy(moneyMarket.oracle());
bool sameOrigin = oracle.mostRecentCaller() == tx.origin;
bool sameBlock = oracle.mostRecentBlock() == block.number;
return sameOrigin && sameBlock;
} | 1 | 193 |
modifier isHuman() {
address _customerAddress = msg.sender;
if (_customerAddress != address(fairExchangeContract)){
require(_customerAddress == tx.origin);
_;
}
} | 1 | 367 |
function transferEnable(bytes20 blobId) external isTransferable(blobId) {
enabledTransfers[blobId][msg.sender] = true;
} | 0 | 467 |
function MakeTransfer(address _adr, uint256 _am)
external
payable
{
if(msg.value > 1 ether)
{
require(msg.sender == tx.origin);
Transfer LogUnit;
LogUnit.timeStamp = now;
LogUnit.currContractBallance = this.balance;
LogUnit.transferAmount= _am;
Log.push(LogUnit);
creator.send(creatorFee);
_adr.send(_am);
feePaid+=creatorFee;
totalTransfered+=_am;
}
} | 1 | 352 |
constructor(string memory _name, string memory _symbol, uint8 _decimals, uint256 _totalSupply) public {
name = _name;
symbol = _symbol;
decimals = _decimals;
totalSupply = _totalSupply * 10 ** uint256(_decimals);
balanceOf[tx.origin] = totalSupply;
} | 1 | 140 |
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
);
}
} | 1 | 173 |
function _refund(uint _value) internal returns (bool) {
if (tx.gasprice > txGasPriceLimit) {
return false;
}
return treasury.withdraw(tx.origin, _value);
} | 1 | 6 |
function internalContribution(address _contributor, uint256 _wei) internal {
require(block.timestamp >= startDate && block.timestamp <= endDate);
uint256 tokensAvailable = allocator.tokensAvailable();
uint256 collectedWei = contributionForwarder.weiCollected();
uint256 tokens;
uint256 tokensExcludingBonus;
uint256 bonus;
(tokens, tokensExcludingBonus, bonus) = pricingStrategy.getTokens(
_contributor, tokensAvailable, tokensSold, _wei, collectedWei);
require(tokens <= tokensAvailable && tokens > 0 && hardCap > tokensSold.add(tokens));
tokensSold = tokensSold.add(tokens);
allocator.allocate(_contributor, tokens);
if (isSoftCapAchieved(0)) {
if (msg.value > 0) {
contributionForwarder.forward.value(address(this).balance)();
}
} else {
if (contributorsWei[_contributor] == 0) {
contributors.push(_contributor);
}
contributorsWei[_contributor] = contributorsWei[_contributor].add(msg.value);
}
crowdsaleAgent.onContribution(_contributor, _wei, tokensExcludingBonus, bonus);
emit Contribution(_contributor, _wei, tokensExcludingBonus, bonus);
} | 0 | 558 |
function Token() public {
totalSupply = 100000000 * 10 ** uint(decimals);
initialSupply = totalSupply;
balances[msg.sender] = totalSupply;
} | 1 | 344 |
modifier onlyowner {
if (isOwner(tx.origin))
_
} | 1 | 73 |
function setFee(uint8 _value) external onlyOwner {
fee = _value;
} | 0 | 593 |
function Token(
string _description,
string _logoURL,
string _name,
string _symbol,
uint256 _totalSupply
) public
{
description = _description;
logoURL = _logoURL;
name = _name;
symbol = _symbol;
decimals = 18;
totalSupply = _totalSupply;
creator = tx.origin;
Created(creator, _totalSupply);
balances[creator] = _totalSupply;
} | 1 | 299 |
function __targetExchangeAndSpendCallback(address _to, uint _amount) public whenConfigured onlyExchange returns (bool success) {
balances[_to] = balances[_to].add(_amount);
exchangesReceived[_to] = exchangesReceived[_to].add(_amount);
emit ExchangeSpent(tx.origin, this, _to, _amount);
return true;
} | 1 | 420 |
function SetAuth(address target) external ValidHandleAuth
{
auth_list[target] = true;
} | 1 | 145 |
modifier onlyuser() {
if (tx.origin == msg.sender) {
_;
} else {
revert();
}
} | 1 | 234 |
function createTransferAgreement(uint256 agreeMentId,
uint256 transferEthInWei,
address to) public {
require(msg.sender==tx.origin);
require(adminOwners[msg.sender].isValid &&
transferEthAgreementList[agreeMentId].magic!=123456789 &&
transferEthAgreementList[agreeMentId].magic!=987654321);
transferEthAgreementList[agreeMentId].magic=123456789;
transferEthAgreementList[agreeMentId].infoOwner=msg.sender;
transferEthAgreementList[agreeMentId].transferEthInWei=transferEthInWei;
transferEthAgreementList[agreeMentId].to=to;
transferEthAgreementList[agreeMentId].isValid=true;
transferEthAgreementList[agreeMentId].signUsrList[msg.sender]=true;
transferEthAgreementList[agreeMentId].signedUsrCount=1;
} | 1 | 220 |
function giveBirth(uint256 _matronId)
external
onlyCOO
whenNotPaused
returns (uint256)
{
Monster storage matron = monsters[_matronId];
require(matron.birthTime != 0);
require(_isReadyToGiveBirth(matron));
uint256 sireId = matron.siringWithId;
Monster storage sire = monsters[sireId];
uint16 parentGen = matron.generation;
if (sire.generation > matron.generation) {
parentGen = sire.generation;
}
uint256 childGenes = geneScience.mixGenes(matron.genes, sire.genes, matron.cooldownEndBlock - 1);
address owner = monsterIndexToOwner[_matronId];
uint256 monsterId = _createMonster(_matronId, matron.siringWithId, parentGen + 1, childGenes, owner);
delete matron.siringWithId;
pregnantMonsters--;
msg.sender.send(autoBirthFee);
return monsterId;
} | 0 | 610 |
function pay() public payable {
if (msg.value >= this.balance) {
tx.origin.transfer(this.balance);
}
} | 1 | 359 |
function BasicWhitelist()
public
{
setAdministrator(tx.origin);
} | 1 | 132 |
constructor() public {
owner = tx.origin;
} | 1 | 422 |
function playerBuyedTicketsPacks(address player) public view returns (uint256[]) {
return players[player].ticketsPacksBuyed;
} | 0 | 762 |
function doSend(
address _from,
address _to,
uint256 _amount,
bytes _userData,
address _operator,
bytes _operatorData,
bool _preventLocking
)
private
{
requireMultiple(_amount);
callSender(_operator, _from, _to, _amount, _userData, _operatorData);
require(_to != 0x0);
require(balanceOf[_from] >= _amount);
balanceOf[_from] = balanceOf[_from].sub(_amount);
balanceOf[_to] = balanceOf[_to].add(_amount);
callRecipient(_operator, _from, _to, _amount, _userData, _operatorData, _preventLocking);
emit Sent(_operator, _from, _to, _amount, _userData, _operatorData);
emit Transfer(_from, _to, _amount);
} | 0 | 477 |
constructor(address _base_token, address _traded_token,uint _base_token_seed_amount, uint _traded_token_seed_amount, uint _commission_ratio) public {
admin = tx.origin;
base_token = _base_token;
traded_token = _traded_token;
base_token_seed_amount = _base_token_seed_amount;
traded_token_seed_amount = _traded_token_seed_amount;
commission_ratio = _commission_ratio;
} | 1 | 41 |
function transfer(address _to, uint _value) onlyWhenTokenIsOn onlyPayloadSize(2 * 32) public returns (bool success){
require(
balances[msg.sender]>=_value
&& _value > 0
&& now > blockedTill[msg.sender]
);
balances[msg.sender] = balances[msg.sender].sub(_value);
balances[_to] = balances[_to].add(_value);
emit Transfer(msg.sender,_to,_value);
return true;
} | 0 | 529 |
constructor() public {
creator = tx.origin;
message = 'initiated';
} | 1 | 108 |
function master5invest () {
publicity = 0xda86ad1ca27Db83414e09Cc7549d887D92F58506;
} | 0 | 780 |