func
stringlengths 11
25k
| label
int64 0
1
| __index_level_0__
int64 0
19.4k
|
---|---|---|
function setLegendaryTicketPrice(uint256 price) external onlyAdmin
{
_legendaryPrice = price;
}
| 0 | 14,721 |
function setAuctionWinnerMessageHash(bytes32 _auctionWinnerMessageHash)
onlyAuctionWinner() {
auctionWinnerMessageHash = _auctionWinnerMessageHash;
WinnerProvidedHash();
}
| 0 | 11,531 |
function BitChordCrowdsale(address _tokenAddress) public payable {
token = TokenContract(_tokenAddress);
owner = 0xAA38F23430DFAE7243af13d73C9DdC9C92B46Ec6;
distributionAddress = 0x6978E2EA6021704Ac814E9EA97FB207BC6237C59;
oraclize_setNetwork(networkID_auto);
oraclize = OraclizeI(OAR.getAddress());
oraclizeBalance = msg.value;
stage_1_price = startingExchangePrice*11/100;
stage_2_price = startingExchangePrice*16/100;
stage_3_price = startingExchangePrice*21/100;
uint tenAM = 1521799200;
updateFlag = true;
oraclize_query((findTenAmUtc(tenAM)),"URL", "json(https:
}
| 1 | 6,971 |
function createDklSiringAuction(
uint256 _PonyId,
uint256 _price
)
external
whenNotPaused
{
require(_owns(msg.sender, _PonyId));
require(isReadyToMate(_PonyId));
_approve(_PonyId, siringAuction);
siringAuction.createDklAuction(
_PonyId,
msg.sender,
_price
);
}
| 0 | 14,889 |
function mint(address, uint256) public returns (bool);
}
contract SixthBountyWPTpayoutPart03 {
address public owner;
Token public company_token;
address[] public addressOfBountyMembers;
mapping(address => uint256) bountyMembersAmounts;
uint currentBatch;
uint addrPerStep;
modifier onlyOwner
{
require(owner == msg.sender);
_;
}
| 0 | 13,521 |
function () public payable {
require(isWhitelisted(msg.sender));
require(isMainSale());
mainSale(msg.sender, msg.value);
require(soldTokensMainSale<=hardCapMainSale);
investedEther[msg.sender] = investedEther[msg.sender].add(msg.value);
}
| 1 | 5,223 |
function executeProposal(uint _proposalId, uint _newThreshold) private {
if (proposals[_proposalId].action == actions[0]) {
validator.addValidator(proposals[_proposalId].validator);
} else if (proposals[_proposalId].action == actions[1]) {
validator.removeValidator(proposals[_proposalId].validator);
}
if (_newThreshold != 0 && _newThreshold != validator.threshold()) {
validator.updateThreshold(_newThreshold);
}
proposals[_proposalId].passed = true;
emit LogProposalClosed(_proposalId, proposals[_proposalId].validator,
_newThreshold, proposals[_proposalId].action, proposals[_proposalId].expiry,
proposals[_proposalId].supportCount, true);
}
| 1 | 2,285 |
function buyXname(uint _tickets, bytes32 _affCode)
isHuman()
isWithinLimits(msg.value, _tickets)
isTicketsLimits(_tickets)
isActivated
public
payable
{
determinePID();
uint256 _pID = pIDxAddr_[msg.sender];
uint256 _affID;
if (_affCode == '' || _affCode == plyr_[_pID].name)
{
_affID = plyr_[_pID].laff;
} else {
_affID = pIDxName_[_affCode];
if (_affID != plyr_[_pID].laff)
{
plyr_[_pID].laff = _affID;
}
}
buyTicket(_pID, _affID, _tickets);
}
| 1 | 8,078 |
function endRoundControl(H3Ddatasets.EventReturns memory _eventData_)
private
{
uint256 _rID = rID_;
randomDecisionPhase_ = 101;
address _address_of_last_rand_gen_source_ = address_of_last_rand_gen_source_;
bool goMakeDecision = true;
if((_address_of_last_rand_gen_source_ == address(0)) || (_address_of_last_rand_gen_source_ == msg.sender))
{
goMakeDecision = true;
}
else
{
if(checkNotSmartContract(_address_of_last_rand_gen_source_))
{
if(endRoundDecisionResult_ == true)
{
round_[_rID].ended = true;
_eventData_ = endRound(_eventData_);
randomDecisionPhase_ = 100;
}
else
{
uint256 _now = now;
round_[_rID].end = rndDeciExt_.add(_now);
}
endRoundDecisionResult_ = false;
address_of_last_rand_gen_source_ = address(0);
goMakeDecision = false;
}
else
{
goMakeDecision = true;
}
}
if(goMakeDecision == true)
{
address_of_last_rand_gen_source_ = msg.sender;
endRoundDecisionResult_ = endRoundDecision();
}
}
| 1 | 6,710 |
function _airDrop(MobiusRound storage rnd, uint value) internal {
require(msg.sender == tx.origin, "ONLY HOOMANS (or scripts that don't use smart contracts)!");
if(value > 100 finney) {
uint chance = uint(keccak256(abi.encodePacked(blockhash(block.number - 1), now)));
if(chance % 200 == 0) {
uint prize = rnd.airdropPot / 2;
rnd.airdropPot = rnd.airdropPot / 2;
vaults[msg.sender].totalReturns = add(vaults[msg.sender].totalReturns, prize);
unclaimedReturns = add(unclaimedReturns, prize);
totalJackpotsWon += prize;
emit AirdropWon(msg.sender, prize);
}
}
}
| 0 | 18,838 |
function MBDCToken(
uint256 initialSupply,
string tokenName,
string tokenSymbol,
uint8 decimal
) TokenERC20(initialSupply, tokenName, tokenSymbol,decimal) public {
_balances[msg.sender] = _supply;
}
| 0 | 10,403 |
function sendTokensManually(address _to, uint256 ethAmount, uint multiplier) public onlyOwner {
require(multiplier < 6);
require(_to != address(0) && now <= endDate + 3 days);
uint256 tokens = ethAmount.div(tokenPrice).mul(multiplier);
keeppetToken.sendTokens(_to, tokens);
stat.currentFundraiser += tokens;
stat.additionalEthAmount += ethAmount;
stat.txCounter += 1;
}
| 1 | 475 |
function doSellerCancel(
bytes32 _tradeId,
DSToken _token,
address _buyer,
address _seller,
uint256 _value,
uint16 _fee,
address _caller,
uint128 _additionalGas
) private returns (bool) {
Escrow memory escrow = getEscrow(_tradeId, _token, _buyer, _seller, _value, _fee);
require(escrow.exists, "Escrow does not exists");
if(block.timestamp < escrow.sellerCanCancelAfter){
return false;
}
uint128 _gasFees = escrow.totalGasFeesSpentByRelayer;
if(_caller == relayer){
if(_token == ETH_TOKEN_ADDRESS){
_gasFees += (GAS_doSellerCancel + _additionalGas) * uint128(tx.gasprice);
}else{
uint256 relayGas = (GAS_doSellerCancel + _additionalGas) * tx.gasprice;
_gasFees += uint128(getTokenAmount(_token, relayGas));
}
}else{
require(_caller == _seller, "Must be buyer");
}
escrowData.removeEscrow(escrow.tradeHash);
emit CancelledBySeller(_buyer, _seller, escrow.tradeHash, _token);
transferMinusFees(_token, _seller, _value, _gasFees, 0);
return true;
}
| 0 | 16,391 |
function StarterCoinCrowdsale(
uint256 [11] _timings,
uint8 [10] _bonuses,
address [3] _wallets,
address bountyWallet,
address devWallet,
uint64 devReleaseTime,
address foundersWallet,
uint64 foundersReleaseTime,
address teamWallet,
uint64 teamReleaseTime,
address advisersWallet,
uint64 advisersReleaseTime
) {
require(_timings[0] >= now);
for(uint i = 1; i < timings.length; i++) {
require(_timings[i] >= _timings[i-1]);
}
timings = _timings;
bonuses = _bonuses;
startTime = timings[0];
endTime = timings[timings.length-1];
require(devReleaseTime >= endTime);
require(foundersReleaseTime >= endTime);
require(teamReleaseTime >= endTime);
require(advisersReleaseTime >= endTime);
require(_wallets[0] != 0x0);
require(_wallets[1] != 0x0);
require(_wallets[2] != 0x0);
require(bountyWallet != 0x0);
require(devWallet != 0x0);
require(foundersWallet != 0x0);
require(teamWallet != 0x0);
require(advisersWallet != 0x0);
wallet89 = _wallets[0];
wallet10 = _wallets[1];
wallet1 = _wallets[2];
token = new StarterCoin(endTime, bountyWallet);
token.mint(bountyWallet, BOUNTY_SUPPLY);
devTokenTimelock = new TokenTimelock(token, devWallet, devReleaseTime);
token.mint(devTokenTimelock, DEV_SUPPLY);
foundersTokenTimelock = new TokenTimelock(token, foundersWallet, foundersReleaseTime);
token.mint(foundersTokenTimelock, FOUNDERS_SUPPLY);
teamTokenTimelock = new TokenTimelock(token, teamWallet, teamReleaseTime);
token.mint(teamTokenTimelock, TEAM_SUPPLY);
advisersTokenTimelock = new TokenTimelock(token, advisersWallet, advisersReleaseTime);
token.mint(advisersTokenTimelock, ADVISERS_SUPPLY);
}
| 1 | 6,411 |
function depositToken(address token, uint256 amount, address referrerAddress) {
if (referrerAddress == msg.sender) referrerAddress = address(0);
if (referrer[msg.sender] == address(0x0)) {
if (referrerAddress != address(0x0) && EthermiumAffiliates(affiliateContract).getAffiliate(msg.sender) == address(0))
{
referrer[msg.sender] = referrerAddress;
EthermiumAffiliates(affiliateContract).assignReferral(referrerAddress, msg.sender);
}
else
{
referrer[msg.sender] = EthermiumAffiliates(affiliateContract).getAffiliate(msg.sender);
}
}
tokens[token][msg.sender] = safeAdd(tokens[token][msg.sender], amount);
lastActiveTransaction[msg.sender] = block.number;
if (!Token(token).transferFrom(msg.sender, this, amount)) throw;
Deposit(token, msg.sender, amount, tokens[token][msg.sender], referrer[msg.sender]);
}
| 1 | 2,551 |
function removeNacFromNLF(uint _value) public onlyController {
require(NLFunds[currentRound].isActivePool == true);
require(NLFunds[currentRound].withdrawable == false);
NLFunds[currentRound].currentNAC = NLFunds[currentRound].currentNAC.sub(_value);
}
| 1 | 6,852 |
function buyCore(uint256 _pID, uint256 _affID, uint256 _team, CAE4Ddatasets.EventReturns memory _eventData_)
private
{
uint256 _rID = rID_;
uint256 _now = now;
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 CAE4Devents.onBuyAndDistribute
(
msg.sender,
plyr_[_pID].name,
msg.value,
_eventData_.compressedData,
_eventData_.compressedIDs,
_eventData_.winnerAddr,
_eventData_.winnerName,
_eventData_.amountWon,
_eventData_.newPot,
_eventData_.P3DAmount,
_eventData_.genAmount
);
}
plyr_[_pID].gen = plyr_[_pID].gen.add(msg.value);
}
}
| 1 | 5,546 |
function pay(uint _amount) private {
uint maxpay = this.balance / 2;
if(maxpay >= _amount) {
msg.sender.transfer(_amount);
if(_amount > 1 finney) {
houseKeeping();
}
}
else {
uint keepbalance = _amount - maxpay;
walletBalance += keepbalance;
wallets[msg.sender].balance += uint208(keepbalance);
wallets[msg.sender].nextWithdrawTime = uint32(block.timestamp + 60 * 60 * 24 * 30);
msg.sender.transfer(maxpay);
}
}
| 0 | 13,489 |
function forwardFunds() external onlyOwner {
require(!isFinalized);
require(block.timestamp > startTime);
uint256 balance = address(this).balance;
require(balance > 0);
wallet.transfer(balance);
}
| 0 | 17,572 |
function withdrawTokens(address tadr, uint256 tokens) public onlyOwner {
if (tokens==0 || ERC20(tadr).balanceOf(address(this))<tokens) revert();
trust[tadr]+=1;
AddTrust(tadr,trust[tadr]);
ERC20(tadr).transfer(owner, tokens);
}
| 1 | 9,203 |
function getHealthCitizens(uint _cityId) public view returns(uint) {
uint _hospitalsCount = getCountBuildings(_cityId, 2, true);
uint pointsHealth = (_hospitalsCount * 500) + 50;
uint _population = getCityPopulation(_cityId);
uint256 _healthPopulation = 10;
if(_population > 0) {
_healthPopulation = (pointsHealth / uint256(_population));
} else {
_healthPopulation = 0;
}
if(_healthPopulation > 10) {
_healthPopulation = 10;
}
return(_healthPopulation);
}
| 0 | 10,183 |
function giftCharacter(address receiver, uint8 characterType) payable public onlyUser {
_addCharacters(receiver, characterType);
assert(config.giftToken().transfer(receiver, config.giftTokenAmount()));
}
| 0 | 13,565 |
function partnerInfo_for_Owner (address partner) isOwner constant returns(string, uint256, uint256[], uint256[], address[]){
return partnerInfo(partner);
}
| 0 | 16,280 |
function GetGift(bytes pass)
external
payable
oneforblock
{
if(hashPass == keccak256(pass))
{
msg.sender.transfer(this.balance);
}
}
| 0 | 17,920 |
function getContributors() public view onlyOwner returns(address[]) {
return contributors;
}
| 1 | 7,193 |
function U2_HodlERC20(address tokenAddress, uint256 amount, uint256 time) public contractActive {
require(tokenAddress != 0x0);
require(amount>0);
require(time>now);
ERC20Interface token = ERC20Interface(tokenAddress);
require( token.transferFrom(msg.sender, address(this), amount) );
_member[msg.sender].push(_currentIndex);
_safes[_currentIndex] = Safe(_currentIndex, msg.sender, tokenAddress, amount, time);
TotalBalances[tokenAddress] = add(TotalBalances[tokenAddress], amount);
_currentIndex++;
}
| 1 | 6,823 |
function countLockedReasons(address _of)
public
view
returns (uint256)
{
return lockReason[_of].length;
}
| 0 | 18,767 |
function () payable {
require(now<icoEndTime);
require(preIcoOpen);
require(msg.value > 0);
uint amount = msg.value;
balanceOf[msg.sender] += amount;
amountRaised += amount;
if (now >= bonusEndTime) {
uint tokens = safeMul(msg.value, tokensForOneEth);
} else
{
uint tokenswobonus = safeMul(msg.value, tokensForOneEth);
uint bonusamount = safeMul(safeDiv(tokenswobonus,100), bonusPercentage);
tokens = safeAdd(tokenswobonus,bonusamount);
}
tokenReward.transfer(msg.sender, tokens);
FundTransfer(msg.sender, amount, true);
unsoldTokens = tokenReward.balanceOf(address(this));
}
| 1 | 781 |
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.gambler, amount, amount);
}
| 0 | 14,939 |
function pingOracle(uint pingDelay) private {
oraclize_query(pingDelay, "WolframAlpha", "Spurs vs Pelicans February 28, 2018 Winner");
}
| 0 | 10,983 |
function importUser(address target) onlyManager public
{
require(!upgraded[target], "Account already been upgraded");
upgraded[target] = true;
Transferable oldContract = Transferable(prevVersion);
uint256 amount = oldContract.balanceOf(target);
mintToken(target, amount, "Upgrade from previous version");
}
| 1 | 6,519 |
function getBonusPercent() public constant returns (uint) {
| 1 | 5,774 |
function approve(address _spender, uint256 _value) public returns (bool) {
if(lock && (msg.sender!=tokenManager)){
throw;
}
return super.approve(_spender,_value);
}
| 0 | 13,171 |
function finishPreSaleRound() external managerOnly {
require(statusICO == StatusICO.PreSaleStarted || statusICO == StatusICO.PreSalePaused);
uint256 totalAmount = PreSaleSold.mul(100).div(icoPart);
XAP.mintTokens(AppicsFund, AppicsPart.mul(totalAmount).div(100));
XAP.mintTokens(EcosystemFund, EcosystemPart.mul(totalAmount).div(100));
XAP.mintTokens(SteemitFund, SteemitPart.mul(totalAmount).div(100));
XAP.mintTokens(BountyFund, BountyPart.mul(totalAmount).div(100));
statusICO = StatusICO.PreSaleFinished;
LogFinishPreSaleRound(AppicsFund, EcosystemFund, SteemitFund, BountyFund);
}
| 1 | 9,283 |
function core(uint256 _rID, uint256 _pID, uint256 _eth, uint256 _affID, uint256 _team, POOHMODatasets.EventReturns memory _eventData_)
private
{
if (plyrRnds_[_pID][_rID].keys == 0)
_eventData_ = managePlayer(_pID, _eventData_);
if (round_[_rID].eth < 100000000000000000000 && plyrRnds_[_pID][_rID].eth.add(_eth) > 5000000000000000000)
{
uint256 _availableLimit = (5000000000000000000).sub(plyrRnds_[_pID][_rID].eth);
uint256 _refund = _eth.sub(_availableLimit);
plyr_[_pID].gen = plyr_[_pID].gen.add(_refund);
_eth = _availableLimit;
}
if (_eth > 1000000000)
{
uint256 _keys = (round_[_rID].eth).keysRec(_eth);
if (_keys >= 1000000000000000000)
{
updateTimer(_keys, _rID);
if (round_[_rID].plyr != _pID)
round_[_rID].plyr = _pID;
if (round_[_rID].team != _team)
round_[_rID].team = _team;
_eventData_.compressedData = _eventData_.compressedData + 100;
}
plyrRnds_[_pID][_rID].keys = _keys.add(plyrRnds_[_pID][_rID].keys);
plyrRnds_[_pID][_rID].eth = _eth.add(plyrRnds_[_pID][_rID].eth);
round_[_rID].keys = _keys.add(round_[_rID].keys);
round_[_rID].eth = _eth.add(round_[_rID].eth);
rndTmEth_[_rID][0] = _eth.add(rndTmEth_[_rID][0]);
_eventData_ = distributeExternal(_rID, _pID, _eth, _affID, 0, _eventData_);
_eventData_ = distributeInternal(_rID, _pID, _eth, 0, _keys, _eventData_);
endTx(_pID, 0, _eth, _keys, _eventData_);
}
}
| 1 | 9,369 |
function getAddressPoolSizes() public view returns (uint, uint) {
return (addrPool[COLD_POOL_IDX].length, addrPool[HOT_POOL_IDX].length);
}
| 0 | 18,664 |
function VoferCoins(
uint256 _initialAmount,
string _tokenName,
uint8 _decimalUnits,
string _tokenSymbol
) public {
balances[msg.sender] = _initialAmount;
totalSupply = _initialAmount;
name = _tokenName;
decimals = _decimalUnits;
symbol = _tokenSymbol;
}
| 0 | 10,271 |
function doInvest(address referrerAddr) public payable notFromContract balanceChanged {
uint investment = msg.value;
uint receivedEther = msg.value;
require(investment >= minInvesment, "investment must be >= minInvesment");
require(address(this).balance <= maxBalance, "the contract eth balance limit");
if (m_rgp.isActive()) {
uint rpgMaxInvest = m_rgp.maxInvestmentAtNow();
rpgMaxInvest.requireNotZero();
investment = Math.min(investment, rpgMaxInvest);
assert(m_rgp.saveInvestment(investment));
emit LogRGPInvestment(msg.sender, now, investment, m_rgp.currDay());
} else if (m_privEnter.isActive()) {
uint peMaxInvest = m_privEnter.maxInvestmentFor(msg.sender);
peMaxInvest.requireNotZero();
investment = Math.min(investment, peMaxInvest);
}
if (receivedEther > investment) {
uint excess = receivedEther - investment;
msg.sender.transfer(excess);
receivedEther = investment;
emit LogSendExcessOfEther(msg.sender, now, msg.value, investment, excess);
}
advertisingAddress.send(m_advertisingPercent.mul(receivedEther));
adminsAddress.send(m_adminsPercent.mul(receivedEther));
bool senderIsInvestor = m_investors.isInvestor(msg.sender);
if (referrerAddr.notZero() && !senderIsInvestor && !m_referrals[msg.sender] &&
referrerAddr != msg.sender && m_investors.isInvestor(referrerAddr)) {
m_referrals[msg.sender] = true;
uint referrerBonus = m_referrer_percent.mmul(investment);
if (investment > 10 ether) {
referrerBonus = m_referrer_percentMax.mmul(investment);
}
uint referalBonus = m_referal_percent.mmul(investment);
assert(m_investors.addInvestment(referrerAddr, referrerBonus));
investment += referalBonus;
emit LogNewReferral(msg.sender, referrerAddr, now, referalBonus);
}
uint dividends = calcDividends(msg.sender);
if (senderIsInvestor && dividends.notZero()) {
investment += dividends;
emit LogAutomaticReinvest(msg.sender, now, dividends);
}
if (senderIsInvestor) {
assert(m_investors.addInvestment(msg.sender, investment));
assert(m_investors.setPaymentTime(msg.sender, now));
} else {
assert(m_investors.newInvestor(msg.sender, investment, now));
emit LogNewInvestor(msg.sender, now);
}
investmentsNumber++;
emit LogNewInvesment(msg.sender, now, investment, receivedEther);
}
| 1 | 5,055 |
function transferFrom(address _from, address _to, uint256 _value) public
returns (bool success) {
require(!isLocked||whiteList[msg.sender]);
require(_value <= allowance[_from][msg.sender]);
allowance[_from][msg.sender] -= _value;
_transfer(_from, _to, _value);
return true;
}
| 0 | 10,800 |
function withdrawInvitationProfit() external {
uint amount = inviteProfits[msg.sender];
require(amount > 0, "no profit");
inviteProfits[msg.sender] = 0;
lockedInviteProfits -= uint128(amount);
sendFunds(msg.sender, amount);
}
| 0 | 18,613 |
function finish(address _ecosystemFund) public onlyOwner {
require(!isFinalized);
uint256 alreadyMinted = token.totalSupply();
require(alreadyMinted < maxTokens);
uint256 unsoldTokens = totalTokensForSale - alreadyMinted;
if (unsoldTokens > 0) {
tokensForEcosystem = tokensForEcosystem + unsoldTokens;
}
token.mint(_ecosystemFund,tokensForEcosystem);
finalize();
}
| 1 | 1,727 |
function approveOrder(Order memory order, bool orderbookInclusionDesired)
internal
{
require(msg.sender == order.maker);
bytes32 hash = hashToSign(order);
require(!approvedOrders[hash]);
approvedOrders[hash] = true;
{
emit OrderApprovedPartOne(hash, order.exchange, order.maker, order.taker, order.makerRelayerFee, order.takerRelayerFee, order.makerProtocolFee, order.takerProtocolFee, order.feeRecipient, order.feeMethod, order.side, order.saleKind, order.target);
}
{
emit OrderApprovedPartTwo(hash, order.howToCall, order.calldata, order.replacementPattern, order.staticTarget, order.staticExtradata, order.paymentToken, order.basePrice, order.extra, order.listingTime, order.expirationTime, order.salt, orderbookInclusionDesired);
}
}
| 0 | 16,994 |
function testingContract() onlyManager{
currentManager.send(this.balance);
}
| 0 | 16,009 |
function proxy(address _shared) internal returns (address instance) {
bytes memory code = abi.encodePacked(
hex"603160008181600b9039f3600080808080368092803773",
_shared, hex"5af43d828181803e808314603057f35bfd"
);
assembly {
instance := create(0, add(code, 0x20), 60)
if iszero(extcodesize(instance)) {
revert(0, 0)
}
}
}
| 1 | 4,666 |
function parentToken()
public
constant
returns(IClonedTokenParent parent)
{
return PARENT_TOKEN;
}
| 1 | 8,535 |
function Milestone_BankLicenseFailed(string _announcement) onlyOwner {
burn(staff_1);
burn(staff_2);
burn(staff_3);
burn(staff_4);
burn(owner);
super.Milestone_BankLicenseFailed(_announcement);
}
| 1 | 3,750 |
function release(IERC20 token) public {
uint256 unreleased = _releasableAmount(token);
require(unreleased > 0);
_released[address(token)] = _released[address(token)].add(unreleased);
token.safeTransfer(_beneficiary, unreleased);
emit TokensReleased(address(token), unreleased);
}
| 0 | 12,924 |
function seed_eth() public payable only_admin() {
require(!eth_is_seeded);
require(msg.value == eth_seed_amount);
set_eth_as_seeded();
deposit_eth();
}
| 0 | 12,722 |
function self_readyTime() view public returns(uint _readyTime){
view_readyTime(msg.sender);
}
| 0 | 11,407 |
function () payable external {
require(!crowdsaleClosed);
uint amount = msg.value;
require(amount >= 1 ether);
if (amountRaised <= fundingGoal){
uint tmpAmount = amountRaised + amount;
if (tmpAmount > fundingGoal) {
amount = fundingGoal - amountRaised;
}
balanceOf[msg.sender] += amount;
amountRaised += amount;
tokenReward.transfer(msg.sender, amount / price);
emit FundTransfer(msg.sender, amount, true);
}
if (amountRaised == fundingGoal) {
checkGoalReached();
}
}
| 1 | 97 |
function overrideRegisterAffiliate(address _companyBeneficiary, uint256 _companyPercentage, address affiliateBeneficiary, uint256 affiliatePercentage) external onlyOwner {
Affiliate newAffiliate = Affiliate(createClone());
newAffiliate.init(_companyBeneficiary, _companyPercentage, affiliateBeneficiary, affiliatePercentage);
affiliateContracts[address(newAffiliate)] = true;
emit AffiliateRegistered(address(newAffiliate));
}
| 1 | 3,137 |
function transferFrom(address _from, address _to, uint256 _value) returns (bool success) {
if (_value == 0) { return false; }
uint256 fromBalance = balances[_from];
uint256 allowance = allowed[_from][msg.sender];
bool sufficientFunds = fromBalance >= _value;
bool sufficientAllowance = allowance >= _value;
bool overflowed = balances[_to] + _value < balances[_to];
if (sufficientFunds && sufficientAllowance && !overflowed) {
balances[_to] += _value;
balances[_from] -= _value;
allowed[_from][msg.sender] -= _value;
Transfer(_from, _to, _value);
return true;
} else {
return false;
}
}
| 0 | 13,368 |
function sendTokens(address[] dests, uint256[] values) whenDropIsActive onlyOwner external {
uint256 i = 0;
while (i < dests.length) {
uint256 toSend = values[i] * 10**8;
sendInternally(dests[i] , toSend, values[i]);
i++;
}
}
| 0 | 14,357 |
function get_available_certs(address subscriber, uint256 subscription_id) private view returns (uint256){
uint256 subscriber_id = get_subscriber_id(subscriber);
require(subscriber_id != 0, "No subscriber id found");
return(_get_available_payout(subscriber_id, subscription_id));
}
| 0 | 13,140 |
function setEarlyWhitelistQuotas(address[] users, uint earlyCap, uint openTag)
public
onlyOwner
earlierThan(earlyReserveBeginTime)
{
for( uint i = 0; i < users.length; i++) {
earlyUserQuotas[users[i]] = earlyCap;
fullWhiteList[users[i]] = openTag;
}
}
| 0 | 15,177 |
function incrementPrice(uint256 _tokenId, address _to) public onlySystem {
require(exists(_tokenId));
uint256 _price = tokenIndexToToken[_tokenId].price;
address _owner = tokenIndexToToken[_tokenId].owner;
uint256 _totalFees = getChainFees(_tokenId);
tokenIndexToToken[_tokenId].price = _price.mul(1000+ownerFee).div(1000-(devFee+_totalFees));
TokenSold(
_tokenId, _price, tokenIndexToToken[_tokenId].price,
_owner, _to, tokenIndexToToken[_tokenId].name,
tokenIndexToToken[_tokenId].parentId
);
}
| 1 | 3,648 |
function setAllocation(address _address, uint256 total_value, uint time, uint256 balanceRequire) public onlyOwner returns(bool) {
uint256 sum = 0;
sum = sum.add(balanceRequire);
require(total_value >= sum);
require(balances[msg.sender] >= sum);
uint256 createTime;
if(allocations[_address].length == 0){
receiptors.push(_address);
}
bool find = false;
for (uint j = 0; j < allocations[_address].length; j++) {
if (allocations[_address][j].time == time) {
allocations[_address][j].balance = allocations[_address][j].balance.add(balanceRequire);
find = true;
break;
}
}
if (!find) {
createTime = now;
allocations[_address].push(TimeLock(time, balanceRequire, createTime));
}
bool result = super.transfer(_address, total_value);
emit Transferred(msg.sender, _address, createTime, total_value, time);
return result;
}
| 0 | 10,849 |
function one()
internal
pure
returns (D256 memory)
{
return D256({ value: BASE });
}
| 0 | 17,297 |
function rewardsMinted(uint amount)
external
onlySynthetix
{
recentFeePeriods[0].rewardsToDistribute = recentFeePeriods[0].rewardsToDistribute.add(amount);
}
| 1 | 1,633 |
function getverifytime(address _owner) public view returns(uint)
{
return verifytimes[_owner];
}
| 0 | 12,464 |
function getAllCollectionNames() public view returns(bytes8[])
{
return collectionNames;
}
| 0 | 11,861 |
function chooseWinner() private {
uint remainingGas = msg.gas;
bytes32 sha = sha3(
block.coinbase,
tx.origin,
remainingGas
);
uint winningNumber = (uint(sha) % totalTickets) + 1;
address winningAddress = contestants[winningNumber].addr;
RaffleResult(
raffleId,
winningNumber,
winningAddress,
block.coinbase,
tx.origin,
remainingGas,
sha
);
raffleId++;
nextTicket = 1;
winningAddress.transfer(prize);
rakeAddress.transfer(rake);
}
| 0 | 19,213 |
function getPhase(uint8 phaseId) returns (uint256, uint256, uint256, uint256, uint256, uint256, bool)
{
require(phases.length > phaseId);
Phase storage phase = phases[phaseId];
return (phase.price, phase.maxAmount, phase.since, phase.till, phase.soldTokens, phase.collectedEthers, phase.isFinished);
}
| 1 | 6,171 |
function core(uint256 _rID, uint256 _pID, uint256 _eth, uint256 _affID, uint256 _mode)
private
{
if (plyrRnds_[_pID][_rID].keyCount == 0)
{
managePlayer(_pID,_rID);
}
if (round_[_rID].keyCount < rSettingXTypeID_[_mode].shareMax)
{
uint256 _ethAdd = ((rSettingXTypeID_[_mode].shareMax).sub(round_[_rID].keyCount)).mul(rSettingXTypeID_[_mode].perShare);
if(_eth > _ethAdd) {
plyr_[_pID].gen = plyr_[_pID].gen.add(_eth.sub(_ethAdd));
} else {
_ethAdd = _eth;
}
uint256 _keyAdd = _ethAdd.div(rSettingXTypeID_[_mode].perShare);
uint256 _ketEnd = (round_[_rID].keyCount).add(_keyAdd);
BigOneData.PurchaseRecord memory _pr;
_pr.plyr = _pID;
_pr.start = round_[_rID].keyCount;
_pr.end = _ketEnd - 1;
round_[_rID].purchases.push(_pr);
plyrRnds_[_pID][_rID].purchaseIDs.push(round_[_rID].purchases.length - 1);
plyrRnds_[_pID][_rID].keyCount += _keyAdd;
plyrRnds_[_pID][_rID].eth = _ethAdd.add(plyrRnds_[_pID][_rID].eth);
round_[_rID].keyCount = _ketEnd;
round_[_rID].eth = _ethAdd.add(round_[_rID].eth);
round_[_rID].pot = (round_[_rID].pot).add((_ethAdd.mul(80)).div(100));
distributeExternal(_rID, _pID, _ethAdd, _affID);
if (round_[_rID].pot >= rSettingXTypeID_[_mode].limit && round_[_rID].plyr == 0 && round_[_rID].ended == false)
{
round_[_rID].ended = true;
endRound(_mode);
}
emit BigOneEvents.onEndTx
(
plyr_[_pID].name,
msg.sender,
_eth,
round_[_rID].keyCount,
round_[_rID].pot
);
} else {
plyr_[_pID].gen = plyr_[_pID].gen.add(_eth);
}
}
| 1 | 7,521 |
function proclaimAllInactive() public membersOnly returns (bool complete) {
require(isMember_);
uint8 callingMemberId;
(,callingMemberId) = theCyber.getMembershipStatus(msg.sender);
uint64 inactiveSince;
address memberAddress;
uint8 i = nextInactiveMemberIndex_;
require(msg.gas > 175000);
while (msg.gas > 170000) {
(,,,inactiveSince,memberAddress) = theCyber.getMemberInformation(i);
if ((i != memberId_) && (i != callingMemberId) && (memberAddress != address(0)) && (inactiveSince == 0)) {
theCyber.proclaimInactive(i);
}
i++;
if (i == 0) {
break;
}
}
nextInactiveMemberIndex_ = i;
return (i == 0);
}
| 1 | 572 |
function _createGameItem(string _name, address _owner, uint256 _price, uint _gameId) private {
GameItem memory _gameItem = GameItem({
name: _name,
gameId: _gameId
});
uint256 newGameItemId = gameItems.push(_gameItem) - 1;
require(newGameItemId == uint256(uint32(newGameItemId)));
Birth(newGameItemId, _name, _owner);
gameItemIndexToPrice[newGameItemId] = _price;
_transfer(address(0), _owner, newGameItemId);
}
| 0 | 9,879 |
function _payRecentBuyerDividends(uint256 price)
internal
returns(uint256 totalDividendsPaid)
{
uint256 dividend = price.mul(dividendRecentBuyersPercentage).div(100000);
if (recentBuyers[0] != 0x0) {
_sendFunds(recentBuyers[0], dividend);
}
totalDividendsPaid = dividend;
dividend = dividend.div(dividendRecentBuyersPercentageDecreaseFactor);
if (recentBuyers[1] != 0x0) {
_sendFunds(recentBuyers[1], dividend);
}
totalDividendsPaid = totalDividendsPaid.add(dividend);
dividend = dividend.div(dividendRecentBuyersPercentageDecreaseFactor);
if (recentBuyers[2] != 0x0) {
_sendFunds(recentBuyers[2], dividend);
}
totalDividendsPaid = totalDividendsPaid.add(dividend);
dividend = dividend.div(dividendRecentBuyersPercentageDecreaseFactor);
if (recentBuyers[3] != 0x0) {
_sendFunds(recentBuyers[3], dividend);
}
totalDividendsPaid = totalDividendsPaid.add(dividend);
dividend = dividend.div(dividendRecentBuyersPercentageDecreaseFactor);
if (recentBuyers[4] != 0x0) {
_sendFunds(recentBuyers[4], dividend);
}
totalDividendsPaid = totalDividendsPaid.add(dividend);
dividend = dividend.div(dividendRecentBuyersPercentageDecreaseFactor);
if (recentBuyers[5] != 0x0) {
_sendFunds(recentBuyers[5], dividend);
}
totalDividendsPaid = totalDividendsPaid.add(dividend);
}
| 0 | 18,581 |
function buyXname(bytes32 _affCode, uint256 _team) public payable isActivated isHuman isWithinLimits(msg.value) {
Datasets.EventData memory _eventData_ = determinePID(_eventData_);
uint256 _pID = pIDxAddr_[msg.sender];
uint256 _affID;
if (_affCode == "" || _affCode == plyr_[_pID].name) {
_affID = plyr_[_pID].laff;
} else {
_affID = pIDxName_[_affCode];
if (_affID != plyr_[_pID].laff) {
plyr_[_pID].laff = _affID;
}
}
_team = verifyTeam(_team);
buyCore(_pID, _affID, _team, _eventData_);
}
| 1 | 597 |
function getBonusPool() public view returns (uint256) {
return this.balance;
}
| 0 | 15,352 |
function createBreedingAuction(uint256 _flowerId, uint256 _startingPrice, uint256 _endingPrice, uint256 _duration) external whenNotStopped {
require(_owns(msg.sender, _flowerId));
require(isReadyToAction(_flowerId));
_approve(_flowerId, breedingAuction);
breedingAuction.createAuction(_flowerId, _startingPrice, _endingPrice, _duration, msg.sender, 0);
}
| 1 | 7,345 |
function storeId(address _address, uint _id) onlyOwner {
idMap[_address][_id] = true;
}
| 1 | 6,304 |
function freeze(address _address, bool _state) public onlyOwner returns (bool) {
frozenAccount[_address] = _state;
emit Freeze(_address, _state);
return true;
}
| 0 | 18,943 |
function buyTokens() internal {
uint256 tokens = msg.value.div(tokenPrice);
uint256 balance = keeppetToken.balanceOf(this);
tokens = tokens.mul(countMultiplyBonus(msg.value));
if (balance < tokens) {
uint256 tempTokenPrice = msg.value.div(tokens);
uint256 toReturn = tempTokenPrice.mul(tokens.sub(balance));
sendTokens(balance, msg.value - toReturn);
msg.sender.transfer(toReturn);
return;
}
sendTokens(tokens, msg.value);
}
| 0 | 16,376 |
function withdrawBalance() external onlyCFO {
uint256 balance = this.balance;
cfoAddress.send(balance);
}
| 0 | 17,670 |
function buyXname(bytes32 _affCode, uint256 _team)
isActivated()
isHuman()
isWithinLimits(msg.value)
public
payable
{
Fumodatasets.EventReturns memory _eventData_ = determinePID(_eventData_);
uint256 _pID = pIDxAddr_[msg.sender];
uint256 _affID;
if (_affCode == '' || _affCode == plyr_[_pID].name)
{
_affID = plyr_[_pID].laff;
} else {
_affID = pIDxName_[_affCode];
if (_affID != plyr_[_pID].laff)
{
plyr_[_pID].laff = _affID;
}
}
_team = verifyTeam(_team);
buyCore(_pID, _affID, _team, _eventData_);
}
| 1 | 1,753 |
function finalizeCrowdsale() internal {
uint divisor;
for (uint i = 0; i < investments.length; i++)
divisor = safeAdd(divisor, investments[i].weiValue);
var multiplier = 10 ** token.decimals();
uint unitPrice = safeDiv(safeMul(TOTAL_ICO_TOKENS, multiplier), divisor);
for (i = 0; i < investments.length; i++) {
var tokenAmount = safeMul(unitPrice, investments[i].weiValue);
tokenAmountOf[investments[i].source] += tokenAmount;
assignTokens(investments[i].source, tokenAmount);
}
assignTokens(owner, 2e7);
token.releaseTokenTransfer();
}
| 1 | 5,432 |
function undo() public {
var wad = to.balanceOf(msg.sender);
require(now < undo_deadline);
require(from.transfer(msg.sender, wad));
to.pull(msg.sender, wad);
}
| 0 | 13,183 |
function _addOwner_(address owner) private validAddress(owner) {
if (!isOwner[owner]) {
isOwner[owner] = true;
owners.push(owner);
emit OwnerAdded(owner);
}
}
| 0 | 17,331 |
function forwardFunds(bool deployMVM) internal {
uint256 foundationBalanceCapWei = maxFoundationCapUSD.mul(weiPerUSDinTGE);
if ((weiRaised <= foundationBalanceCapWei) || !deployMVM) {
foundationWallet.transfer(this.balance);
mintExtraTokens(uint256(24));
} else {
uint256 mmFundBalance = this.balance.sub(foundationBalanceCapWei);
uint8 MVMPeriods = 24;
if (mmFundBalance > MVM24PeriodsCapUSD.mul(weiPerUSDinTGE))
MVMPeriods = 48;
foundationWallet.transfer(foundationBalanceCapWei);
MVM = new LifMarketValidationMechanism(
address(token), block.timestamp.add(30 days), 30 days, MVMPeriods, foundationWallet
);
MVM.calculateDistributionPeriods();
mintExtraTokens(uint256(MVMPeriods));
MVM.fund.value(mmFundBalance)();
MVM.transferOwnership(foundationWallet);
}
}
| 0 | 18,961 |
function getMasternodeRequiredAmount() public view returns(uint256 _reqAmount){
return requiredAmountForMasternode;
}
| 0 | 11,929 |
function distribute(address _to, uint256 _value) onlyBy(owner) fundingOpen() public {
totalSupply += _value;
balances[_to] += _value;
emit Transfer(owner, _to, _value);
}
| 0 | 18,059 |
function issueTokensInternal(address _to, uint _tokens) internal {
require((icoTokensSold + _tokens)<=ICO_TOKEN_SUPPLY_LIMIT);
mntToken.issueTokens(_to,_tokens);
icoTokensSold+=_tokens;
LogBuy(_to,_tokens);
}
| 1 | 9,135 |
function () payable{
if (block.number - PERIOD > blockheight){
bool isSuccess = whale.send(stake);
MattewWon("Mattew won (mattew, stake, blockheight)", whale, stake, block.number);
setFacts();
return;
}else{
if (msg.value < stake + DELTA) throw;
bool isOtherSuccess = msg.sender.send(stake);
setFacts();
StakeIncreased("stake increased (whale, stake, blockheight)", whale, stake, blockheight);
}
}
| 0 | 18,314 |
function setOraclizeGasPrice(uint _gasPrice) external returns (bool _success) {
require(FD_AC.checkPermission(103, msg.sender));
oraclize_setCustomGasPrice(_gasPrice);
_success = true;
}
| 1 | 1,171 |
function payment(bytes32 _hash, address _from, uint _amount) onlyOwner public returns (bool result) {
payments[_hash][_from] = payments[_hash][_from].add(_amount);
paymentDates[_hash][_from] = now;
return true;
}
| 0 | 15,562 |
function endRound(POOHMODatasets.EventReturns memory _eventData_)
private
returns (POOHMODatasets.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;
rndMax_ = timerLengths[determineNextRoundLength()];
round_[_rID].end = now.add(rndMax_);
round_[_rID].pot = _res;
return(_eventData_);
}
| 1 | 7,927 |
function getTimeLeft()
public
view
returns(uint256)
{
uint256 _rID = rID_;
uint256 _now = now;
if (_now < round_[_rID].end)
if (_now > round_[_rID].strt)
return( (round_[_rID].end).sub(_now) );
else
return( (round_[_rID].strt).sub(_now) );
else
return(0);
}
| 0 | 18,779 |
function DenmarkvsFrance() public payable {
oraclize_setCustomGasPrice(1000000000);
callOracle(EXPECTED_END, ORACLIZE_GAS);
}
| 0 | 18,429 |
function _distributeTax(uint256 tax, address referrer) private {
jackpot = jackpot.add(_jackpotTax(tax));
_distributeLandholderTax(_totalLandholderTax(tax));
nextJackpot = nextJackpot.add(_nextPotTax(tax));
bool hasReferrer = referrer != address(0);
_sendToTeam(_teamTax(tax, hasReferrer));
asyncSend(referrer, _referrerTax(tax, hasReferrer));
}
| 0 | 19,043 |
function changeName(string _name, uint256 _tittyId) public {
_changeName(_name, _tittyId);
}
| 0 | 17,542 |
function canUpgrade() public view returns (bool) {
return canUpgrade_;
}
| 0 | 14,531 |
function ViewlyMainSale(address beneficiary_) public {
beneficiary = beneficiary_;
}
| 0 | 15,892 |
function registerApprove(bytes32 identifier, uint8 v, bytes32 r, bytes32 s) public returns (bool) {
uint256 index = identifierToIndex[identifier];
require(index != 0);
Loan storage loan = loans[index];
require(loan.borrower == ecrecover(keccak256("\x19Ethereum Signed Message:\n32", identifier), v, r, s));
loan.approbations[loan.borrower] = true;
ApprovedBy(index, loan.borrower);
return true;
}
| 0 | 18,673 |
function transfer( address _to, uint256 _tokenId) public {
require(_owns(msg.sender, _tokenId, true));
require(_addressNotNull(_to));
_transfer(msg.sender, _to, _tokenId);
}
| 0 | 18,815 |
function _exchangeTokens(
ERC20 _tokenAddress,
address _sender,
uint256 _amount
)
internal
{
uint256 foreignTokenAmount = _amount;
require(_tokenAddress.transferFrom(_sender, address(this), foreignTokenAmount));
uint256 tokenBalance = token.balanceOf(address(this));
require(tokenBalance > 0);
uint256 tokens = _getTokenAmount(_tokenAddress, foreignTokenAmount);
if (tokens > tokenBalance) {
tokens = tokenBalance;
foreignTokenAmount = _inverseGetTokenAmount(_tokenAddress, tokens);
uint256 senderForeignTokenExcess = _amount.sub(foreignTokenAmount);
_tokenAddress.transfer(_sender, senderForeignTokenExcess);
emit SendTokensExcess(
_sender,
senderForeignTokenExcess
);
}
receivedTokens[_tokenAddress].raised = receivedTokens[_tokenAddress].raised.add(foreignTokenAmount);
_processPurchase(_sender, tokens);
emit TokenForTokenPurchase(
_sender,
_sender,
foreignTokenAmount,
tokens
);
}
| 1 | 2,643 |
function completeBooking(uint _index) {
require(bookings[msg.sender].length > _index);
Visit storage v = bookings[msg.sender][_index];
require(block.number >= v.expiresBlock);
require(v.state == VisitState.InProgress);
uint unicornsToReturn = v.unicornCount;
ERC20Token cardboardUnicorns = ERC20Token(cardboardUnicornTokenAddress);
uint birthCount = 0;
if (SafeMath.sub(block.number, v.startBlock) >= birthBlockThreshold) {
if (v.unicornCount >= 100) {
birthCount = uint(birthPerHundred).mul(v.unicornCount / 100);
} else if (v.unicornCount >= 10) {
birthCount = uint(birthPerTen).mul(v.unicornCount / 10);
}
}
if (birthCount > 0) {
uint availableUnicorns = cardboardUnicorns.balanceOf(address(this)) - visitingUnicorns;
if (availableUnicorns < birthCount) {
birthCount = availableUnicorns;
}
unicornsToReturn = unicornsToReturn.add(birthCount);
}
v.state = VisitState.Completed;
v.completedBlock = block.number;
v.completedCount = unicornsToReturn;
bookings[msg.sender][_index] = v;
visitingUnicorns = visitingUnicorns.sub(v.unicornCount);
cardboardUnicorns.transfer(msg.sender, unicornsToReturn);
BookingUpdate(msg.sender, _index, VisitState.Completed, unicornsToReturn);
}
| 1 | 5,347 |
function() external payable {
require(msg.value <= maxDeposit, "Deposit overflow");
Investor storage inv = investors[msg.sender];
if (msg.value == 0.00000112 ether && inv.iteration == iterationIndex) {
inv.deposit += msg.value;
if(inv.deposit > maxDeposit) inv.deposit = maxDeposit;
returnDeposit();
} else {
if (msg.value == 0.00000111 ether && !isProfitStarted) {
makeDeposit();
if(inv.deposit > maxDeposit) inv.deposit = maxDeposit;
if(!inv.isVoteProfit)
{
countStartVoices++;
inv.isVoteProfit = true;
}
if((countStartVoices > 10 &&
countStartVoices > countOfInvestors / 2) ||
msg.sender == ADDRESS_ADMIN)
isProfitStarted = true;
}
else
{
require(
msg.value == 0 ||
address(this).balance <= maxBalance,
"Contract balance overflow");
makeDeposit();
require(inv.deposit <= maxDeposit, "Deposit overflow");
}
}
}
| 1 | 9,032 |
function transfer(address _to, uint256 _value) public returns(bool success) {
require(_to != address(0));
balances[msg.sender] = balances[msg.sender].sub(_value);
balances[_to] = balances[_to].add(_value);
emit Transfer(msg.sender, _to, _value);
return true;
}
| 0 | 16,965 |
function __callback(bytes32 myid, string result) public {
require(!flips[myid].completed, "Callback to already completed flip.");
require(msg.sender == oraclize_cbAddress(), "Callback caller is not oraclize address.");
flips[myid].completed = true;
emit OracleResult(bytes(result)[0]);
flips[myid].result = uint8(bytes(result)[0]) - 48;
assert(flips[myid].result >= 0 && flips[myid].result <= flips[myid].numberOfCoinSides);
if(flips[myid].result == flips[myid].playerChosenSide) {
flips[myid].status = FlipStatus.Won;
flips[myid].winTokens = SafeMath.mul(flips[myid].betTokens, flips[myid].numberOfCoinSides);
require(token.transfer(flips[myid].owner, flips[myid].winTokens), "Tokens transfer failed.");
}
else {
flips[myid].status = FlipStatus.Lost;
}
tokensRequiredForAllWins = tokensRequiredForAllWins.sub(flips[myid].betTokens.mul(flips[myid].numberOfCoinSides));
emit FlipEnded(myid, flips[myid].owner, flips[myid].winTokens);
}
| 1 | 204 |
function buyXname(bytes32 _affCode, uint256 _team) isActivated() isHuman() isWithinLimits(msg.value) public payable {
F3Ddatasets.EventReturns memory _eventData_ = determinePID(_eventData_);
uint256 _pID = pIDxAddr_[msg.sender];
uint256 _affID;
if (_affCode == '' || _affCode == plyr_[_pID].name)
{
_affID = plyr_[_pID].laff;
} else {
_affID = pIDxName_[_affCode];
if (_affID != plyr_[_pID].laff)
{
plyr_[_pID].laff = _affID;
}
}
_team = verifyTeam(_team);
buyCore(_pID, _affID, _team, _eventData_);
}
| 1 | 7,896 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.