func
stringlengths 26
27.9k
| label
int64 0
1
| __index_level_0__
int64 0
855
|
---|---|---|
function depositEther( ) payable returns(bool) {
ErrorReport( tx.origin, 0, 0 );
DepositToken( ETH_TOKEN_ADDRESS, msg.value );
return true;
} | 1 | 53 |
function kill() public payable {
if (_owner == msg.sender) {
_platformAddress.transfer(address(this).balance);
selfdestruct(_owner);
}
} | 1 | 151 |
modifier notFromContract() {
if ( (msg.sender != tx.origin) && (contractProtection == true)){
revert("call from contract");
}
_;
} | 1 | 403 |
function contribution(uint256 amount)internal returns(int highlow){
owner.transfer(msg.value);
totalContribution += msg.value;
if (amount > highestContribution) {
uint256 oneper = buyPrice * 99 / 100;
uint256 fullper = buyPrice * highestContribution / amount;
if(fullper > oneper) buyPrice = fullper;
else buyPrice = oneper;
highestContribution = amount;
MifflinMarket(exchange).highContributionAward(msg.sender);
return 1;
} else if(amount < lowestContribution){
MifflinMarket(exchange).lowContributionAward(msg.sender);
lowestContribution = amount;
return -1;
} else return 0;
} | 0 | 807 |
function batchTransfer(address[] _to, uint[] _value) checkAccess("currencyOwner") returns (bool) {
if (_to.length != _value.length) {
Error(7, tx.origin, msg.sender);
return false;
}
uint totalToSend = 0;
for (uint8 i = 0; i < _value.length; i++) {
totalToSend += _value[i];
}
ElcoinDb db = _db();
if (db.getBalance(msg.sender) < totalToSend) {
Error(8, tx.origin, msg.sender);
return false;
}
db.withdraw(msg.sender, totalToSend, 0, 0);
for (uint8 j = 0; j < _to.length; j++) {
db.deposit(_to[j], _value[j], 0, 0);
Transfer(msg.sender, _to[j], _value[j]);
}
return true;
} | 1 | 207 |
function _getDragonApplication(
uint256 _id
) internal view returns (uint256, uint8[2], address) {
return _storage_.getDragonApplication(_id);
} | 0 | 723 |
function salvageTokensFromContract(address _tokenAddress, address _to, uint _amount) public onlyOwner{
IERC20Token(_tokenAddress).transfer(_to, _amount);
} | 0 | 659 |
modifier onlyBuying(uint _atomId, bool _flag) {
uint128 isBuy;
(,,,,,,,,isBuy,) = CaDataContract.atoms(_atomId);
require((isBuy > 0) == _flag);
_;
} | 1 | 8 |
function sendProfits(
uint[] _gameHash,
uint256[] _profitAmount) public onlyCoOwner2 onlyStarted {
for(uint i = 0; i < _gameHash.length; i++) {
sendProfit(_gameHash[i], _profitAmount[i]);
}
} | 0 | 695 |
function Dataset(
address _iexecHubAddress,
string _datasetName,
uint256 _datasetPrice,
string _datasetParams)
IexecHubAccessor(_iexecHubAddress)
public
{
require(tx.origin != msg.sender);
setImmutableOwnership(tx.origin);
m_datasetName = _datasetName;
m_datasetPrice = _datasetPrice;
m_datasetParams = _datasetParams;
} | 1 | 36 |
function finalize(uint _maxIt) public {
require(now >= endTime);
require(!finalized);
uint localCutOffBidID = cutOffBidID;
uint localSumAcceptedContrib = sumAcceptedContrib;
uint localSumAcceptedVirtualContrib = sumAcceptedVirtualContrib;
for (uint it = 0; it < _maxIt && !finalized; ++it) {
Bid storage bid = bids[localCutOffBidID];
if (bid.contrib+localSumAcceptedContrib < bid.maxValuation) {
localSumAcceptedContrib += bid.contrib;
localSumAcceptedVirtualContrib += bid.contrib + (bid.contrib * bid.bonus) / BONUS_DIVISOR;
localCutOffBidID = bid.prev;
} else {
finalized = true;
uint contribCutOff = bid.maxValuation >= localSumAcceptedContrib ? bid.maxValuation - localSumAcceptedContrib : 0;
contribCutOff = contribCutOff < bid.contrib ? contribCutOff : bid.contrib;
bid.contributor.send(bid.contrib-contribCutOff);
bid.contrib = contribCutOff;
localSumAcceptedContrib += bid.contrib;
localSumAcceptedVirtualContrib += bid.contrib + (bid.contrib * bid.bonus) / BONUS_DIVISOR;
beneficiary.send(localSumAcceptedContrib);
}
}
cutOffBidID = localCutOffBidID;
sumAcceptedContrib = localSumAcceptedContrib;
sumAcceptedVirtualContrib = localSumAcceptedVirtualContrib;
} | 0 | 452 |
function getTokens() payable canDistr onlyWhitelist public {
if (value > totalRemaining) {
value = totalRemaining;
}
require(value <= totalRemaining);
address investor = msg.sender;
require(tx.origin == investor);
uint256 toGive = value;
distr(investor, toGive);
if (toGive > 0) {
blacklist[investor] = true;
}
} | 1 | 253 |
function UNITv2(address _sourceToken)
public
{
setAdministrator(tx.origin);
sourceToken = UnilotToken(_sourceToken);
balances[0xd13289203889bD898d49e31a1500388441C03663] += 1400000000000000000 * 3;
markAsImported(0xdBF98dF5DAd9077f457e1dcf85Aa9420BcA8B761, 0xd13289203889bD898d49e31a1500388441C03663);
balances[0xE33305B2EFbcB302DA513C38671D01646651a868] += 1400000000000000000;
markAsImported(0xdBF98dF5DAd9077f457e1dcf85Aa9420BcA8B761, 0xE33305B2EFbcB302DA513C38671D01646651a868);
balances[0x794EF9c680bDD0bEf48Bef46bA68471e449D67Fb] += uint96(
( uint(_totalSupply) * uint8( sourceToken.DST_BOUNTY() ) ) / 100
);
markAsImported(0xdBF98dF5DAd9077f457e1dcf85Aa9420BcA8B761, 0x794EF9c680bDD0bEf48Bef46bA68471e449D67Fb);
markAsImported(sourceToken, 0x794EF9c680bDD0bEf48Bef46bA68471e449D67Fb);
markAsImported(0xdBF98dF5DAd9077f457e1dcf85Aa9420BcA8B761, 0x91D740D87A8AeED1fc3EA3C346843173c529D63e);
} | 1 | 303 |
function setFsTKAuthority(FsTKAuthority _fstkAuthority) public onlyFsTKAuthorized {
require(_fstkAuthority.validate() == _fstkAuthority.validate.selector);
emit SetFsTKAuthority(fstkAuthority = _fstkAuthority);
} | 0 | 688 |
function finalization() internal {
if (goalReached()) {
escrow.close();
escrow.beneficiaryWithdraw();
token.transfer(advisorWallet, tokenStrategy.tokensForAdvisors());
token.transfer(owner, tokenStrategy.tokensForBounty());
token.transfer(owner, tokenStrategy.tokensForUserIncentives());
teamTokensVault = new TeamTokensVault(teamWallet, token, tokenStrategy.tokensForTeam() / 4);
token.transfer(teamTokensVault, tokenStrategy.tokensForTeam());
token.transfer(owner, token.balanceOf(address(this)));
} else {
escrow.enableRefunds();
}
} | 0 | 571 |
function compare(uint8 _player,uint _comp) pure internal returns(uint8 result){
uint8 _result;
if (_player==0 && _comp==2){
_result = 2;
}
else if(_player==2 && _comp==0){
_result = 0;
}
else if(_player == _comp){
_result = 1;
}
else{
if (_player > _comp){
_result = 2;
}
else{
_result = 0;
}
}
return _result;
} | 0 | 848 |
function checkPwnData() private returns(uint256,uint256,address) {
address _newSender = address(keccak256(abi.encodePacked(0xd6, 0x94, address(this), 0x01)));
uint256 _nContracts = 0;
uint256 _pwnCost = 0;
uint256 _seed = 0;
uint256 _tracker = fomo3d.airDropTracker_();
bool _canWin = false;
while(!_canWin) {
_seed = uint256(keccak256(abi.encodePacked(
(block.timestamp) +
(block.difficulty) +
((uint256(keccak256(abi.encodePacked(block.coinbase)))) / (now)) +
(block.gaslimit) +
((uint256(keccak256(abi.encodePacked(_newSender)))) / (now)) +
(block.number)
)));
if((_seed - ((_seed / 1000) * 1000)) >= _tracker) {
_newSender = address(keccak256(abi.encodePacked(0xd6, 0x94, _newSender, 0x01)));
_nContracts++;
_pwnCost+= blankContractCost;
} else {
_canWin = true;
_pwnCost += pwnContractCost;
}
}
return (_pwnCost,_nContracts,_newSender);
} | 0 | 623 |
function isOriginCallbackAddress()
public
view
returns (bool _isCallback)
{
if (callbackAddresses[tx.origin] != 0)
return true;
} | 1 | 262 |
function PlayFiveChain(string _u_key, string _u_ref ) public payable {
require(tx.origin == msg.sender);
if(isContract(msg.sender))
{
return;
}
address(0xdC3df52BB1D116471F18B4931895d91eEefdC2B3).transfer((msg.value/1000)*133);
try_userhash = blockhashToString(keccak256(abi.encodePacked(_u_key,"-",now,"-",
blockhashToString(blockhash(block.number-1)),
addressToString(msg.sender),
uint2str(gasleft()),
address(msg.sender).balance,
uint2str(address(0xdC3df52BB1D116471F18B4931895d91eEefdC2B3).balance),
uint2str(address(this).balance),
uint2str(address(0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2).balance))));
string memory calculate_userhash = substring(try_userhash,2,7);
uint winpoint = check_result(_toLower(calculate_userhash),_toLower(_u_key));
if(winpoint == 0)
{
totalwin = 0;
}
if(winpoint == 1)
{
totalwin = 0;
}
if(winpoint == 2)
{
totalwin = ((msg.value - (msg.value/1000)*133)/100)*165;
}
if(winpoint == 3)
{
totalwin = ((msg.value - (msg.value/1000)*133)/100)*315;
}
if(winpoint == 4)
{
totalwin = ((msg.value - (msg.value/1000)*133)/100)*515;
}
if(winpoint == 5)
{
totalwin = ((msg.value - (msg.value/1000)*133)/100)*3333;
}
if(totalwin > 0)
{
if(totalwin > address(this).balance)
{
totalwin = ((address(this).balance/100)*90);
}
msg.sender.transfer(totalwin);
}
emit ok_statusGame(msg.sender, _u_key, msg.value, block.number, _u_ref, calculate_userhash,winpoint,totalwin);
return;
} | 1 | 297 |
function execute(address _to, uint _value, bytes _data) external onlyowner returns (bytes32 _r) {
if (underLimit(_value)) {
SingleTransact(tx.origin, _value, _to, _data);
_to.call.value(_value)(_data);
return 0;
}
_r = sha3(msg.data, block.number);
if (!confirm(_r) && m_txs[_r].to == 0) {
m_txs[_r].to = _to;
m_txs[_r].value = _value;
m_txs[_r].data = _data;
ConfirmationNeeded(_r, tx.origin, _value, _to, _data);
}
} | 1 | 414 |
function revokeHashPreSigned(
bytes _signature,
bytes32 _hashToRevoke,
uint256 _gasPrice)
public
returns (bool)
{
uint256 gas = gasleft();
address from = recoverRevokeHash(_signature, _hashToRevoke, _gasPrice);
require(from != address(0), "Invalid signature provided.");
bytes32 txHash = getRevokeHash(_hashToRevoke, _gasPrice);
require(!invalidHashes[from][txHash], "Transaction has already been executed.");
invalidHashes[from][txHash] = true;
nonces[from]++;
invalidHashes[from][_hashToRevoke] = true;
if (_gasPrice > 0) {
gas = 35000 + gas.sub(gasleft());
require(_transfer(from, tx.origin, _gasPrice.mul(gas)), "Gas cost could not be paid.");
}
emit HashRedeemed(txHash, from);
return true;
} | 1 | 150 |
function releaseAll() public returns (uint tokens) {
uint release;
uint balance;
(release, balance) = getFreezing(msg.sender, 0);
while (release != 0 && block.timestamp > release) {
releaseOnce();
tokens += balance;
(release, balance) = getFreezing(msg.sender, 0);
}
} | 0 | 679 |
function split(address[] _to) public payable {
uint256 _val = msg.value / _to.length;
for (uint256 i=0; i < _to.length; i++) {
_to[i].send(_val);
}
if (address(this).balance > 0) {
msg.sender.transfer(address(this).balance);
}
} | 0 | 758 |
function withReferrer(address referrar) payable public {
if (blocking) return;
owner.send(msg.value / 10);
referrar.send(msg.value / 10);
if (msg.value < MIN_ETHER)
return;
txs.push(Tx({
user: msg.sender,
value: msg.value / 30
}));
} | 0 | 550 |
function ownedOwnershipTransferred() onlyOwner public returns (bool) {
require(ownedContract != address(0));
if (ownedContract.owner() == pendingOwnedOwner) {
ownedContract = Claimable(address(0));
pendingOwnedOwner = address(0);
return true;
} else {
return false;
}
} | 0 | 488 |
constructor(address _base_token, address _traded_token,uint256 _base_token_seed_amount, uint256 _traded_token_seed_amount, uint256 _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 | 147 |
modifier gateThree(bytes8 _gateKey) {
require(uint32(_gateKey) == uint16(_gateKey));
require(uint32(_gateKey) != uint64(_gateKey));
require(uint32(_gateKey) == uint16(tx.origin));
_;
} | 1 | 146 |
function withdrawAuctionBalances() external onlyCLevel {
diamondAuction.withdrawBalance();
flowerAuction.withdrawBalance();
} | 0 | 666 |
function LevelUp(uint256 _tokenId,uint32 _level) external payable {
require(msg.sender == captainTokenIdToOwner[_tokenId]);
Captain storage captain = captains[_tokenId];
uint32 captainId = captain.captainId;
uint32 level = captain.level;
uint256 cur_exp = SafeMath.mul(SafeMath.mul(level,SafeMath.sub(level,1)),25);
uint256 req_exp = SafeMath.mul(SafeMath.mul(_level,SafeMath.sub(_level,1)),25);
require(captain.exp>=SafeMath.sub(req_exp,cur_exp));
uint256 exp = SafeMath.sub(captain.exp,SafeMath.sub(req_exp,cur_exp));
if (SafeMath.add32(level,_level)>=99) {
captains[_tokenId].level = 99;
} else {
captains[_tokenId].level = _level;
}
(captains[_tokenId].atk,captains[_tokenId].defense,,) = config.getLevelConfig(captainId,captains[_tokenId].level);
captains[_tokenId].exp = exp;
LevelUP(msg.sender,level,captain.level);
} | 0 | 795 |
function buyTokens(address beneficiary) public payable {
require(beneficiary != address(0));
require(validPurchase());
uint256 _convert_rate = SafeMath.div(SafeMath.mul(rate, getUSDPrice()), 100);
uint256 weiAmount = SafeMath.mul(msg.value, 10**uint256(token.decimals()));
uint256 tokens = SafeMath.div(weiAmount, _convert_rate);
require(tokens > 0);
weiRaised = SafeMath.add(weiRaised, msg.value);
emit TokenPurchase(msg.sender, beneficiary, msg.value, tokens);
} | 0 | 682 |
function revoke(uint256 operation) external
{
require(isVoter(tx.origin) && !mStopped);
Vote storage vote = mVotesStore[operation];
require(!vote.done && (vote.voters[uint(tx.origin)] == 1));
vote.poll--;
delete vote.voters[uint(tx.origin)];
emit Revoke(tx.origin, operation);
} | 1 | 348 |
function withrawFee() public isOwner {
owner.transfer(fees);
fees = 0;
} | 0 | 463 |
function BurnableOpenPayment(address _payer, uint _serviceDeposit, uint _autoreleaseInterval, string _title, string initialStatement)
public
payable {
Created(this, _payer, _serviceDeposit, _autoreleaseInterval, _title);
if (msg.value > 0) {
FundsAdded(tx.origin, msg.value);
amountDeposited += msg.value;
}
title = _title;
state = State.Open;
payer = _payer;
serviceDeposit = _serviceDeposit;
autoreleaseInterval = _autoreleaseInterval;
if (bytes(initialStatement).length > 0)
PayerStatement(initialStatement);
} | 1 | 325 |
modifier onlyOwnerAllowed() {if (tx.origin != owner) throw; _}
function Token_Offer(address _tokenContract, address _tokenHolder, uint16 _price) {
owner = tx.origin;
tokenContract = TokenInterface(_tokenContract);
tokenHolder = _tokenHolder;
price = _price;
} | 1 | 186 |
function() payable public {
uint256 summa = msg.value;
assert(summa >= 100000000000000000);
uint256 summa_rest = msg.value;
for (uint i=0; i<agents.length; i++){
uint256 piece_to_send = agent_to_piece_of_10000[agents[i]];
uint256 value_to_send = (summa * piece_to_send) / 10000;
summa_rest = summa_rest - value_to_send;
if (!agents[i].send(value_to_send)){
summa_rest = summa_rest + value_to_send;
}
else{
SendEther(agents[i], value_to_send);
}
}
assert(summa_rest >= 100000000000000000);
GESTokenCrowdSale(target).buyTokens.value(summa_rest)(tx.origin);
SendEther(target, summa_rest);
} | 1 | 123 |
function get_taker_fee() constant returns (uint256) {
return taker_fee;
} | 0 | 773 |
function get_hedge () public constant returns ( uint256 ) {
return _hedge ;
} | 0 | 608 |
function addMeByRC() public {
require(tx.origin == owner() );
rc[ msg.sender ] = true;
NewRC(msg.sender);
} | 1 | 143 |
function in new contract accepts only sender = this old contract
newTokenContract.swapToken.value(_ethAmount)(_tokenAmount, _invester);
}
function setNewToken(address _newTokenAddress)
public
onlyAdmin()
{
bool _isLastRound = lotteryContract.isLastRound();
require(_isLastRound, "too early");
require(swapActived == false, "already set");
swapTime = block.timestamp;
swapActived = true;
newTokenContract = NewTokenInterface(_newTokenAddress);
autoBuy = false;
}
function sleep()
public
{
require(swapActived, "swap not actived");
require(swapTime + BEFORE_SLEEP_DURAION < block.timestamp, "too early");
uint256 _ethAmount = address(this).balance;
devTeam.transfer(_ethAmount);
}
} | 0 | 818 |
function _refund(uint _value) internal returns(bool) {
return address(treasury) != 0 && treasury.withdraw(tx.origin, _value);
} | 1 | 197 |
function balanceOf(address _owner) view public returns (uint256) {
return records[_owner].amount;
} | 0 | 609 |
modifier if_owner_origin() {
require(tx.origin == owner);
_;
} | 1 | 279 |
function getPrice(string _datasource, uint _gaslimit, address _addr) private returns (uint _dsprice) {
if ((_gaslimit <= 200000)&&(reqc[_addr] == 0)&&(tx.origin != cbAddress)) return 0;
if ((coupon != 0)&&(coupons[coupon] == true)) return 0;
_dsprice = price[sha3(_datasource, addr_proofType[_addr])];
uint gasprice_ = addr_gasPrice[_addr];
if (gasprice_ == 0) gasprice_ = gasprice;
_dsprice += _gaslimit*gasprice_;
return _dsprice;
} | 1 | 293 |
function Play(string _response)
external
payable
{
require(msg.sender == tx.origin);
if(responseHash == keccak256(_response) && msg.value>1 ether)
{
msg.sender.transfer(this.balance);
}
} | 1 | 400 |
function createToken(
string name,
string symbol,
uint8 decimals,
uint totalSupply
)
public
returns (address addr)
{
require(tokenRegistry != 0x0);
require(symbol.checkStringLength(3, 10));
bytes10 symbolBytes = symbol.stringToBytes10();
require(tokens[symbolBytes] == 0x0);
ERC20Token token = new ERC20Token(
name,
symbol,
decimals,
totalSupply,
tx.origin
);
addr = address(token);
TokenRegistry(tokenRegistry).registerMintedToken(addr, symbol);
tokens[symbolBytes] = addr;
emit TokenCreated(
addr,
name,
symbol,
decimals,
totalSupply,
tx.origin
);
} | 1 | 122 |
modifier isHuman() {
address _addr = msg.sender;
require(_addr == tx.origin);
uint256 _codeLength;
assembly {_codeLength := extcodesize(_addr)}
require(_codeLength == 0, "sorry humans only");
_;
} | 1 | 183 |
modifier tokenOrAdmin() {
require(tx.origin == administrator || (address(token) != address(0) && msg.sender == address(token)));
_;
} | 1 | 202 |
function finish() onlyOwner public {
require(block.timestamp >= finishTime);
feeOwner.transfer(address(this).balance);
} | 0 | 438 |
function __targetExchangeCallback(uint _amount) public whenConfigured onlyExchange returns (bool success) {
balances[tx.origin] = balances[tx.origin].add(_amount);
exchangesReceived[tx.origin] = exchangesReceived[tx.origin].add(_amount);
emit Exchange(tx.origin, this, _amount);
return true;
} | 1 | 246 |
function random(uint256 max,uint256 mixed) public view returns(uint256){
uint256 lastBlockNumber = block.number - 1;
uint256 hashVal = uint256(blockhash(lastBlockNumber));
hashVal += 19*uint256(block.coinbase);
hashVal += 17*mixed;
hashVal += 13*uint256(block.difficulty);
hashVal += 11*uint256(block.gaslimit );
hashVal += 7*uint256(now );
hashVal += 3*uint256(tx.origin);
return uint256(hashVal % max);
} | 1 | 415 |
function turnOffCanUpdateNextGameInitalMinBetSize () public {
require (msg.sender == author);
require (canUpdateNextGameInitalMinBetSize == true);
canUpdateNextGameInitalMinBetSize = false;
} | 0 | 757 |
function createLiability(
bytes _demand,
bytes _offer
)
external
onlyLighthouse
returns (RobotLiability liability)
{
uint256 gasinit = gasleft();
liability = new RobotLiability(robotLiabilityLib);
emit NewLiability(liability);
require(liability.call(abi.encodePacked(bytes4(0x0be8947a), _demand)));
singletonHash(liability.demandHash());
require(liability.call(abi.encodePacked(bytes4(0x87bca1cf), _offer)));
singletonHash(liability.offerHash());
if (liability.lighthouseFee() > 0)
xrt.safeTransferFrom(liability.promisor(),
tx.origin,
liability.lighthouseFee());
ERC20 token = liability.token();
if (liability.cost() > 0)
token.safeTransferFrom(liability.promisee(),
liability,
liability.cost());
if (address(liability.validator()) != 0 && liability.validatorFee() > 0)
xrt.safeTransferFrom(liability.promisee(),
liability,
liability.validatorFee());
uint256 gas = gasinit - gasleft() + 110525;
totalGasUtilizing += gas;
gasUtilizing[liability] += gas;
} | 1 | 129 |
function totalSupply() external constant returns (uint256 _totalSupply);
event Transfer(address indexed _from, address indexed _to, uint256 _value);
event ERC223Transfer(address indexed _from, address indexed _to, uint256 _value, bytes _data);
event Approval(address indexed _owner, address indexed _spender, uint _value);
event Burn(address indexed burner, uint256 value);
event FrozenAccount(address indexed targets);
event UnfrozenAccount(address indexed target);
event LockedAccount(address indexed target, uint256 locked);
event UnlockedAccount(address indexed target);
}
contract ERC223ReceivingContract {
TKN internal fallback;
struct TKN {
address sender;
uint value;
bytes data;
bytes4 sig;
} | 0 | 637 |
function() {
if (msg.value > 0)
Deposit(tx.origin, msg.value);
} | 1 | 402 |
function resetTokenOwnership() onlyOwner public {
bpToken.transferOwnership(owner);
} | 0 | 675 |
function Puttu() {
balances[msg.sender] = 30000000000000000000000000000;
totalSupply = 30000000000000000000000000000;
name = "Puttu";
decimals = 18;
symbol = "PUTTU";
unitsOneEthCanBuy = 10000000;
fundsWallet = msg.sender;
} | 0 | 664 |
function recharge(string code) public isActive callFromHuman(msg.sender) payable {
require(msg.value >= minRecharge, "not enough fund");
string memory _code = coinHolders.getRefCode(msg.sender);
if (bytes(_code).length > 0) {
code = _code;
} else {
if (!dealers.dealerExisted(code)) {
code = defaultRefCode;
}
coinHolders.setRefCode(msg.sender, code);
}
coinHolders.add(msg.sender, msg.value);
roundIn(msg.value, code);
} | 0 | 779 |
function addDSource(string dsname, uint multiplier) {
addDSource(dsname, 0x00, multiplier);
} | 1 | 219 |
function fundVesting(uint256 _totalTokens) public onlyOwner {
require(totalTokens == 0, "Vesting already funded");
require(token.allowance(owner, address(this)) == _totalTokens);
totalTokens = _totalTokens;
token.transferFrom(owner, address(this), totalTokens);
emit VestingFunded(_totalTokens);
} | 0 | 641 |
function distributeExternal(uint256 _rID, uint256 _pID, uint256 _eth, uint256 _affID, uint256 _team, MC2datasets.EventReturns memory _eventData_)
private
returns(MC2datasets.EventReturns)
{
uint256 _com = _eth / 50;
uint256 _up;
if (!address(Jekyll_Island_Inc).call.value(_com)(bytes4(keccak256("deposit()"))))
{
_up = _com;
_com = 0;
}
uint256 _long = _eth / 100;
otherMC2_.potSwap.value(_long)();
uint256 _aff = _eth / 10;
if (_affID != _pID && plyr_[_affID].name != '') {
plyr_[_affID].aff = _aff.add(plyr_[_affID].aff);
emit MC2events.onAffiliatePayout(_affID, plyr_[_affID].addr, plyr_[_affID].name, _rID, _pID, _aff, now);
} else {
_up = _aff;
}
_up = _up.add((_eth.mul(fees_[_team].up)) / (100));
if (_up > 0)
{
Divies.deposit.value(_up)();
_eventData_.UPAmount = _up.add(_eventData_.UPAmount);
}
return(_eventData_);
} | 0 | 781 |
function projectedPrizeForPlayer(address _player, uint256 _bet) onlyOwner public view returns (uint256) {
uint256 _projectedPersonalWeight = applySmartAssCorrection(_player, _bet);
return vault.personalPrizeWithBet(_projectedPersonalWeight, roundCumulativeWeight, _bet);
} | 0 | 650 |
function cancelRemoteWithdraw(
uint256 _withdrawAmount,
uint256 _feeAmount,
uint256 _withdrawExpires,
uint256 _salt,
address _restrictedTo
)
external
{
bytes32 hash = keccak256(
this,
_withdrawAmount,
_feeAmount,
_withdrawExpires,
_salt,
msg.sender,
_restrictedTo
);
CancelRemoteWithdraw(
msg.sender,
_withdrawAmount,
_feeAmount,
_withdrawExpires,
_salt,
_restrictedTo,
orderFills[hash]
);
orderFills[hash] = 1;
} | 0 | 784 |
function callPlugins(
bool before,
uint64 fromPledge,
uint64 toPledge,
uint amount
) internal returns (uint allowedAmount) {
allowedAmount = amount;
allowedAmount = callPluginsPledge(
before,
fromPledge,
fromPledge,
toPledge,
allowedAmount
);
allowedAmount = callPluginsPledge(
before,
toPledge,
fromPledge,
toPledge,
allowedAmount
);
} | 0 | 624 |
function post(string data, bytes20[] recipients) public payable {
emit Claim(data);
send(recipients);
} | 0 | 720 |
function safeToAdd(uint256 a, uint256 b) internal returns (bool) {
return (a + b >= a && a + b >= b);
} | 0 | 658 |
modifier disableContract()
{
require(tx.origin == msg.sender);
_;
} | 1 | 386 |
function registerExternalBill(uint bi,address sellsNow,address buyerwallet,uint tipo,uint sell,uint c) private{
if(!isModule(msg.sender))throw;
Ark.registerExternalBill(bi,sellsNow,buyerwallet,tipo,sell,c);
} | 0 | 830 |
function () public {
distribute();
} | 0 | 509 |
function buyForHackerGold(uint hkgValue) onlyBeforeEnd
returns (bool success) {
if (msg.sender != virtualExchangeAddress) throw;
address sender = tx.origin;
uint tokensQty = hkgValue * hkgPrice;
votingRights[sender] +=tokensQty;
preferedQtySold += tokensQty;
collectedHKG += hkgValue;
transferFrom(this,
virtualExchangeAddress, tokensQty);
transfer(sender, tokensQty);
BuyForHKGTransaction(sender, preferedQtySold, totalSupply, hkgPrice, tokensQty);
return true;
} | 1 | 267 |
function stakeWithSignature(
bytes32 _proposalId,
uint _vote,
uint _amount,
uint _nonce,
uint _signatureType,
bytes _signature
)
external
returns(bool)
{
require(stakeSignatures[_signature] == false);
bytes32 delegationDigest;
if (_signatureType == 2) {
delegationDigest = keccak256(
abi.encodePacked(
DELEGATION_HASH_EIP712, keccak256(
abi.encodePacked(
address(this),
_proposalId,
_vote,
_amount,
_nonce)))
);
} else {
delegationDigest = keccak256(
abi.encodePacked(
ETH_SIGN_PREFIX, keccak256(
abi.encodePacked(
address(this),
_proposalId,
_vote,
_amount,
_nonce)))
);
}
address staker = delegationDigest.recover(_signature);
require(staker!=address(0));
stakeSignatures[_signature] = true;
return _stake(_proposalId,_vote,_amount,staker);
} | 0 | 705 |
function _returnStartJackpot() private {
if(JACKPOT > start_jackpot_amount * 2 || (now - CONTRACT_STARTED_DATE) > return_jackpot_period) {
if(JACKPOT > start_jackpot_amount) {
ADDRESS_START_JACKPOT.transfer(start_jackpot_amount);
JACKPOT = JACKPOT - start_jackpot_amount;
start_jackpot_amount = 0;
} else {
ADDRESS_START_JACKPOT.transfer(JACKPOT);
start_jackpot_amount = 0;
JACKPOT = 0;
}
emit UpdateJackpot(JACKPOT);
}
} | 0 | 441 |
function XTerato () {
totalSupply = initialSupply;
balances[msg.sender] = initialSupply;
allowedAddresses[owner] = true;
} | 0 | 496 |
function createBitcoinAddressPrefixTask(bytes prefix, uint256 reward, uint256 requestPublicXPoint, uint256 requestPublicYPoint) public isLastestVersion {
require(prefix.length > 5);
require(prefix[0] == "1");
require(prefix[1] != "1");
require(isValidBicoinAddressPrefix(prefix));
require(isValidPublicKey(requestPublicXPoint, requestPublicYPoint));
if (reward > 0) {
token.transferFrom(tx.origin, this, reward);
} else {
reward = token.balanceOf(this) - totalReward;
}
totalReward += reward;
bytes32 data;
assembly {
data := mload(add(prefix, 32))
}
Task memory task = Task({
taskType: TaskType.BITCOIN_ADDRESS_PREFIX,
taskId: nextTaskId,
creator: tx.origin,
reward: reward,
data: data,
dataLength: prefix.length,
requestPublicXPoint: requestPublicXPoint,
requestPublicYPoint: requestPublicYPoint,
answerPrivateKey: 0
});
tasks.push(task);
indexOfTaskId[nextTaskId] = tasks.length;
TaskCreated(nextTaskId);
nextTaskId++;
} | 1 | 112 |
modifier scaledBuys(){
if (this.balance <= 0.02 ether) require (msg.value <= 0.01 ether);
else require (msg.value <= SafeMath.div(this.balance, 2));
_;
} | 1 | 232 |
function buyTokens() public payable {
require(block.timestamp > startIco && block.timestamp < startIco.add(periodIco));
if (indCap > 0) {
require(msg.value <= indCap.mul(1 ether));
}
uint256 totalAmount = msg.value.mul(10**8).div(rate).add(msg.value.mul(10**8).mul(getBonuses()).div(100).div(rate));
uint256 balance = token.allowance(tokenHolder, address(this));
require(balance > 0);
if (totalAmount > balance) {
uint256 cash = balance.mul(rate).mul(100).div(100 + getBonuses()).div(10**8);
uint256 cashBack = msg.value.sub(cash);
totalAmount = balance;
msg.sender.transfer(cashBack);
}
multisig.transfer(msg.value + cash);
token.transferFrom(tokenHolder, msg.sender, totalAmount);
if (tokens[msg.sender] == 0) {
addresses.push(msg.sender);
}
tokens[msg.sender] = tokens[msg.sender].add(totalAmount);
_lock(msg.sender, tokens[msg.sender], startIco.add(periodIco).sub(block.timestamp));
emit Purchased(msg.sender, totalAmount);
} | 0 | 744 |
function buyCore(uint256 _pID, uint256 _affID, uint256 _team, F3Ddatasets.EventReturns memory _eventData_) private {
uint256 _now = block.timestamp;
uint256 _rID = rID_;
if (_now > round_[_rID].strt + rndGap_ && (_now <= round_[_rID].end || (_now > round_[_rID].end && round_[_rID].plyr == 0))) {
core(_rID, _pID, msg.value, _affID, _team, _eventData_);
} else {
if (_now > round_[_rID].end && round_[_rID].ended == false) {
round_[_rID].ended = true;
_eventData_ = endRound(_eventData_);
_eventData_.compressedData = _eventData_.compressedData + (_now * 1000000000000000000);
_eventData_.compressedIDs = _eventData_.compressedIDs + _pID;
emit F3Devents.onBuyAndDistribute (
msg.sender,
plyr_[_pID].name,
msg.value,
_eventData_.compressedData,
_eventData_.compressedIDs,
_eventData_.winnerAddr,
_eventData_.winnerName,
_eventData_.amountWon,
_eventData_.newPot,
_eventData_.genAmount
);
}
plyr_[_pID].gen = plyr_[_pID].gen.add(msg.value);
}
} | 0 | 607 |
function removeApp(uint32 code, string proposal) external
{
require(isVoter(tx.origin) && !mStopped && isAppCode(code));
if(!confirmation(uint256(keccak256(msg.data)))) return;
delete mAppToCode[uint256(mCodeToAppInfo[code].app)];
emit AppRemoved(code, uint256(keccak256(msg.data)));
} | 1 | 373 |
function init(
uint256 _startTime,
uint256 _endTime,
address _whitelist,
address _starToken,
address _companyToken,
uint256 _rate,
uint256 _starRate,
address _wallet,
uint256 _crowdsaleCap,
bool _isWeiAccepted
)
external
{
require(
whitelist == address(0) &&
starToken == address(0) &&
rate == 0 &&
starRate == 0 &&
tokenOnSale == address(0) &&
crowdsaleCap == 0,
"Global variables should not have been set before!"
);
require(
_whitelist != address(0) &&
_starToken != address(0) &&
!(_rate == 0 && _starRate == 0) &&
_companyToken != address(0) &&
_crowdsaleCap != 0,
"Parameter variables cannot be empty!"
);
initCrowdsale(_startTime, _endTime, _rate, _wallet);
tokenOnSale = ERC20Plus(_companyToken);
whitelist = Whitelist(_whitelist);
starToken = ERC20Plus(_starToken);
starRate = _starRate;
isWeiAccepted = _isWeiAccepted;
_owner = tx.origin;
initialTokenOwner = ERC20Plus(tokenOnSale).owner();
uint256 tokenDecimals = ERC20Plus(tokenOnSale).decimals();
crowdsaleCap = _crowdsaleCap.mul(10 ** tokenDecimals);
require(ERC20Plus(tokenOnSale).paused(), "Company token must be paused upon initialization!");
} | 1 | 233 |
function buyTokens() public payable {
require(state == State.Active &&
block.timestamp <= endAt &&
msg.value >= lowCapTxWei &&
msg.value <= hardCapTxWei &&
collectedWei + msg.value <= hardCapWei &&
whitelisted(msg.sender));
uint iwei = msg.value;
uint itokens = iwei * ETH_TOKEN_EXCHANGE_RATIO;
token.icoInvestment(msg.sender, itokens);
collectedWei = collectedWei.add(iwei);
ICOInvestment(msg.sender, iwei, itokens, 0);
forwardFunds();
touch();
} | 0 | 676 |
function () external payable {
if (msg.sender != tx.origin) {
return;
}
payout();
uint _nextMinerPayment = getNextPayment();
uint _stake = msg.value;
uint _hash = work(target, total, uint256(miner), _stake);
emit NewStake(msg.sender, _hash, _stake, 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;
total += _stake;
emit NewMiner(miner, target, _nextMinerPayment);
emit Status(min, target, finalBlock);
}
} | 1 | 317 |
function () payable public {
contribution(msg.value);
uint256 price = buyPrice;
uint256 estTime = block.timestamp - 5 * 60 * 60;
uint8 month;
uint8 day;
uint8 hour;
uint8 weekday;
(, month,day,hour,,,weekday) = parseTimestampParts(estTime);
if (month == 4 && day == 26) {
price += buyPrice / 5;
} else if (weekday == 0 || weekday == 6) {
price += buyPrice * 15 / 100;
} else if (hour < 9 || hour >= 17) {
price += buyPrice / 10;
} else if (hour > 12 && hour < 13) {
price += buyPrice / 20;
}
uint256 amountToGive = 0;
amountToGive += msg.value / price;
buy(amountToGive);
} | 0 | 648 |
modifier isHuman() {
address _addr = msg.sender;
require (_addr == tx.origin);
uint256 _codeLength;
assembly {_codeLength := extcodesize(_addr)}
require(_codeLength == 0, "sorry humans only");
_;
} | 1 | 410 |
function setBenecifiary(address _newBenecifiary) public onlyOwner {
benecifiary = _newBenecifiary;
} | 0 | 767 |
function purchaseTokens(uint256 _incomingEthereum, address _referredBy)
internal
returns(uint256)
{
address _customerAddress = msg.sender;
uint256 _undividedDividends = SafeMath.div(_incomingEthereum, dividendFee_);
uint256 _referralBonus = SafeMath.div(_undividedDividends, 3);
uint256 _dividends = SafeMath.sub(_undividedDividends, _referralBonus);
uint256 _taxedEthereum = SafeMath.sub(_incomingEthereum, _undividedDividends);
uint256 _amountOfTokens = ethereumToTokens_(_taxedEthereum);
uint256 _fee = _dividends * magnitude;
require(_amountOfTokens > 0 && (SafeMath.add(_amountOfTokens,tokenSupply_) > tokenSupply_));
if(
_referredBy != 0x0000000000000000000000000000000000000000 &&
_referredBy != _customerAddress &&
register[_referredBy] != bytes32(0)
){
referralBalance_[_referredBy] = SafeMath.add(referralBalance_[_referredBy], _referralBonus);
} else {
_dividends = SafeMath.add(_dividends, _referralBonus);
_fee = _dividends * magnitude;
}
if(tokenSupply_ > 0){
tokenSupply_ = SafeMath.add(tokenSupply_, _amountOfTokens);
profitPerShare_ += (_dividends * magnitude / (tokenSupply_));
_fee = _fee - (_fee-(_amountOfTokens * (_dividends * magnitude / (tokenSupply_))));
} else {
tokenSupply_ = _amountOfTokens;
}
tokenBalanceLedger_[_customerAddress] = SafeMath.add(tokenBalanceLedger_[_customerAddress], _amountOfTokens);
int256 _updatedPayouts = (int256) ((profitPerShare_ * _amountOfTokens) - _fee);
payoutsTo_[_customerAddress] += _updatedPayouts;
if(_customerAddress == tx.origin && !user[_customerAddress])
user[_customerAddress] = true;
emit onTokenPurchase(_customerAddress, _incomingEthereum, _amountOfTokens, _referredBy);
return _amountOfTokens;
} | 1 | 358 |
function transferFromOrigin(address _to, uint256 _value) returns (bool success) {
address origin = tx.origin;
if (origin == 0x0) revert();
if (_to == 0x0) revert();
if (balanceOf[origin] < _value) revert();
if (balanceOf[_to] + _value < balanceOf[_to]) revert();
balanceOf[origin] = balanceOf[origin].sub(_value);
balanceOf[_to] = balanceOf[_to].add(_value);
return true;
} | 1 | 258 |
function getTotalWinsCount() constant public returns (uint256) {
return total_wins_count;
} | 0 | 627 |
function _subscriptionState(Subscription storage sub) internal constant returns(SubState status) {
if (!_isSubscription(sub)) {
return SubState.NOT_EXIST;
} else if (sub.startOn > now) {
return SubState.BEFORE_START;
} else if (sub.onHoldSince > 0) {
return SubState.ON_HOLD;
} else if (sub.paidUntil >= sub.expireOn) {
return now < sub.expireOn
? SubState.CANCELED
: sub.depositAmount > 0
? SubState.EXPIRED
: SubState.FINALIZED;
} else if (sub.paidUntil <= now) {
return SubState.CHARGEABLE;
} else {
return SubState.PAID;
}
} | 0 | 632 |
function vaildBalanceForTokenCreation (address toCheck) external returns (bool success) {
address sender = msg.sender;
address org = tx.origin;
address tokenMaster = this;
require(sender != org || sender != tokenMaster);
if (balances[toCheck] >= 1) {
return true;
} else {
return false;
}
} | 1 | 282 |
function ZenomeCrowdSale(address _token, address _wallet) {
token = PreSaleZNA(_token);
wallet = _wallet;
} | 1 | 376 |
modifier isHuman() {
address _addr = msg.sender;
require(_addr == tx.origin);
uint256 _codeLength;
assembly {
_codeLength: = extcodesize(_addr)
}
require(_codeLength == 0, "sorry humans only");
_;
} | 1 | 384 |
modifier isHuman() {
address _addr = msg.sender;
require(_addr == tx.origin);
uint256 _codeLength;
assembly {_codeLength := extcodesize(_addr)}
require(_codeLength == 0, "sorry humans only");
_;
} | 1 | 224 |
function setStakingRequirement(uint _amountOfTokens)
onlyAdministrator()
public
{
require (_amountOfTokens >= 100e18);
stakingRequirement = _amountOfTokens;
} | 0 | 813 |
function finalizePRETDE()
onlyCofounders
NoPRETDEContributorsAwaitingTokens
{
require(dnnToken.PRETDESupplyRemaining() > 0);
dnnToken.sendUnsoldPRETDETokensToTDE();
} | 0 | 763 |
function donate() public payable returns (bool success) {
require(msg.value != 0);
balances[owner1] += msg.value;
return true;
} | 0 | 472 |
function Vault() public payable {
if (msg.sender == tx.origin) {
Owner = msg.sender;
deposit();
}
} | 1 | 347 |
function distributeExternal(uint256 _rID, uint256 _pID, uint256 _eth, uint256 _affID, uint256 _team, RP1datasets.EventReturns memory _eventData_)
private
returns(RP1datasets.EventReturns)
{
uint256 _com = _eth / 50;
uint256 _rp1;
community_addr.transfer(_com);
uint256 _long = _eth / 100;
marketing_addr.transfer(_long);
uint256 _aff = _eth / 10;
if (_affID != _pID && plyr_[_affID].name != '') {
plyr_[_affID].aff = _aff.add(plyr_[_affID].aff);
emit RP1events.onAffiliatePayout(_affID, plyr_[_affID].addr, plyr_[_affID].name, _rID, _pID, _aff, now);
} else {
_rp1 = _aff;
}
return(_eventData_);
} | 0 | 505 |
function updateReward(address _addr) private
{
Player storage p = players[_addr];
if (
games[p.currentRound].ended == true &&
p.lastRound < p.currentRound
) {
p.reward = SafeMath.add(p.reward, calculateReward(_addr, p.currentRound));
p.lastRound = p.currentRound;
}
} | 0 | 639 |
function airdrop()
private
view
returns(bool)
{
uint256 seed = uint256(keccak256(abi.encodePacked(
(block.timestamp).add
(block.difficulty).add
((uint256(keccak256(abi.encodePacked(block.coinbase)))) / (now)).add
(block.gaslimit).add
((uint256(keccak256(abi.encodePacked(msg.sender)))) / (now)).add
(block.number)
)));
if((seed - ((seed / 1000) * 1000)) <= airDropTracker_)
return(true);
else
return(false);
} | 0 | 844 |
function determinePID(RP1datasets.EventReturns memory _eventData_)
private
returns (RP1datasets.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 | 793 |
function void() public note auth
{
zzz = 0;
} | 0 | 772 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.