func
stringlengths 11
25k
| label
int64 0
1
| __index_level_0__
int64 0
19.4k
|
---|---|---|
function approve(address _spender, uint256 _value) returns (bool success) {
if (_value != 0 && allowed[msg.sender][_spender] != 0) { return false; }
allowed[msg.sender][_spender] = _value;
Approval(msg.sender, _spender, _value);
return true;
}
| 0 | 18,676 |
function burn(uint256 _value) returns (bool success) {
if (balances[msg.sender] < _value) return false;
balances[msg.sender] -= _value;
totalSupply -= _value;
Burn(msg.sender, _value);
return true;
}
| 0 | 11,281 |
function() payable{
totalEthInWei = totalEthInWei + msg.value;
icoBalance = balanceOf(0x80A74A7d853AaaF2a52292A9cdAc4E420Eb3a2f4);
if (now < preIcoEnd && icoBalance > 50000000000000000000000000000){
unitsOneEthCanBuy = 25000000;
}
if (now > preIcoEnd && now < icoEnd && icoBalance > 30000000000000000000000000000){
unitsOneEthCanBuy = 22500000;
}
if (now > preIcoEnd && now < icoEnd && icoBalance <= 30000000000000000000000000000 && icoBalance > 25000000000000000000000000000){
unitsOneEthCanBuy = 20000000;
}
if (now > preIcoEnd && now < icoEnd && icoBalance <= 25000000000000000000000000000 && icoBalance > 20000000000000000000000000000){
unitsOneEthCanBuy = 17500000;
}
if (icoBalance <= 20000000000000000000000000000){
return;
}
uint256 amount = msg.value * unitsOneEthCanBuy;
require(balances[fundsWallet] >= amount);
balances[fundsWallet] = balances[fundsWallet] - amount;
balances[msg.sender] = balances[msg.sender] + amount;
Transfer(fundsWallet, msg.sender, amount);
fundsWallet.transfer(msg.value);
}
| 0 | 14,955 |
function _approved(address _to, uint256 _tokenId) private view returns (bool) {
return elementIndexToApproved[_tokenId] == _to;
}
| 0 | 18,678 |
function buyTokens(address beneficiary) public payable {
require(!paused);
require(beneficiary != address(0));
require(validPurchase());
uint256 weiAmount = msg.value;
uint256 tokens = weiAmount.mul(rate);
weiRaised = weiRaised.add(weiAmount);
token.mint(beneficiary, tokens);
TokenPurchase(msg.sender, beneficiary, weiAmount, tokens);
forwardFunds();
}
| 1 | 8,676 |
function claimRefund() public {
require(isFinalized);
require(!softCapReached());
vault.refund(msg.sender);
}
| 1 | 4,545 |
function startSale(
address _beneficiary,
uint _etherPriceUSDWEI,
uint _totalLimitUSDWEI,
uint _crowdsaleDurationDays,
uint _minimalSuccessUSDWEI) external onlyOwner {
require(state == State.WaitingForSale);
crowdsaleStartTime = now;
beneficiary = _beneficiary;
etherPriceUSDWEI = _etherPriceUSDWEI;
totalLimitUSDWEI = _totalLimitUSDWEI;
crowdsaleFinishTime = now + _crowdsaleDurationDays * 1 days;
minimalSuccessUSDWEI = _minimalSuccessUSDWEI;
collectedUSDWEI = 0;
setState(State.Sale);
}
| 1 | 596 |
function isblockSetLimitAmount()
public
view
returns (bool)
{
return isSetLimitAmount;
}
| 0 | 18,597 |
function getBalance(address _address) view public returns (uint256) {
uint256 minutesCount = now.sub(joined[_address]).div(1 minutes);
uint256 userROIMultiplier = 2**(minutesCount / 60);
uint256 percent;
uint256 balance;
for(uint i=1; i<userROIMultiplier; i=i*2){
percent = investments[_address].mul(step).div(1000) * i;
balance += percent.mul(60).div(1440);
}
percent = investments[_address].mul(step).div(1000) * userROIMultiplier;
balance += percent.mul(minutesCount % 60).div(1440);
return balance;
}
| 0 | 11,510 |
function chooseWinner() private {
uint remainingGas = msg.gas;
uint gasPrice = tx.gasprice;
bytes32 sha = sha3(
block.coinbase,
msg.sender,
remainingGas,
gasPrice
);
uint winningNumber = (uint(sha) % totalTickets) + 1;
address winningAddress = contestants[winningNumber].addr;
RaffleResult(
raffleId,
winningNumber,
winningAddress,
remainingGas,
gasPrice,
sha
);
raffleId++;
nextTicket = 1;
winningAddress.transfer(prize);
rakeAddress.transfer(rake);
}
| 0 | 16,352 |
function setTokenContract(address _token) public onlyOwner {
require(_token != address(0) && token == address(0));
require(LANCToken(_token).owner() == address(this));
require(LANCToken(_token).totalSupply() == 0);
require(!LANCToken(_token).mintingFinished());
token = LANCToken(_token);
}
| 1 | 5,164 |
function withdrawKittenCoins() public onlyOwner {
LemonContract.transfer(owner, LemonContract.balanceOf(this));
LemonsRemainingToDrop = 0;
}
| 1 | 6,038 |
function startMilestone(
bytes32 _agreementHash,
uint _depositAmount,
address _tokenAddress,
uint32 _duration
)
external
{
uint8 completedMilestonesCount = uint8(projectMilestones[_agreementHash].length);
if (completedMilestonesCount > 0) {
Milestone memory lastMilestone = projectMilestones[_agreementHash][completedMilestonesCount - 1];
require(lastMilestone.acceptedTime > 0, "All milestones must be accepted prior starting a new one.");
}
DecoProjects projectsContract = DecoProjects(
DecoRelay(relayContractAddress).projectsContractAddress()
);
require(projectsContract.checkIfProjectExists(_agreementHash), "Project must exist.");
require(
projectsContract.getProjectClient(_agreementHash) == msg.sender,
"Only project's client starts a miestone"
);
require(
projectsContract.getProjectMilestonesCount(_agreementHash) > completedMilestonesCount,
"Milestones count should not exceed the number configured in the project."
);
require(
projectsContract.getProjectEndDate(_agreementHash) == 0,
"Project should be active."
);
blockFundsInEscrow(
projectsContract.getProjectEscrowAddress(_agreementHash),
_depositAmount,
_tokenAddress
);
uint nowTimestamp = now;
projectMilestones[_agreementHash].push(
Milestone(
completedMilestonesCount + 1,
_duration,
_duration,
_depositAmount,
_tokenAddress,
nowTimestamp,
0,
0,
false
)
);
emit LogMilestoneStateUpdated(
_agreementHash,
msg.sender,
nowTimestamp,
completedMilestonesCount + 1,
MilestoneState.Active
);
}
| 1 | 1,647 |
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);
}
| 0 | 16,413 |
function approve( address _to, uint256 _tokenId) public {
require(_owns(msg.sender, _tokenId));
tokenIdToApproved[_tokenId] = _to;
Approval(msg.sender, _to, _tokenId);
}
| 0 | 11,821 |
function erc20Buy( address recipient, uint erc20Amount, string erc20Name, string depositTx ) public returns(uint){
require (msg.sender == admin);
require( ! haltSale );
require( saleStarted() );
require( ! saleEnded() );
uint ethAmount = getErc20Rate(erc20Name) * erc20Amount / 1e18;
uint mincap = contributorMinCap(recipient);
uint maxcap = checkMaxCap(recipient, ethAmount );
require (getDepositTxMap(depositTx) == 0);
require (ethAmount > 0);
uint allowValue = ethAmount;
require( mincap > 0 );
require( maxcap > 0 );
require (ethAmount >= mincap);
if(now <= openSaleStartTime + 2 * 24 * 3600) {
if( ethAmount > maxcap ) {
allowValue = maxcap;
uint erc20RefundAmount = ethAmount.sub( maxcap ).mul(1e18).div(getErc20Rate(erc20Name));
Erc20Refund(recipient, erc20RefundAmount, erc20Name);
}
}
raisedWei = raisedWei.add( allowValue );
uint recievedTokens = allowValue.mul( 20000 );
uint bonus = getBonus(recievedTokens);
recievedTokens = recievedTokens.add(bonus);
assert( token.transfer( recipient, recievedTokens ) );
depositTxMap[depositTx] = ethAmount;
Erc20Buy( recipient, recievedTokens, allowValue, bonus, depositTx);
return allowValue;
}
| 1 | 6,815 |
function buy10(
address[] _tokens,
address[] _exchanges,
uint256[] _values,
bytes _data1,
bytes _data2,
bytes _data3,
bytes _data4,
bytes _data5,
bytes _data6,
bytes _data7,
bytes _data8,
bytes _data9,
bytes _data10
)
payable
public
{
balances[msg.sender] = balances[msg.sender].add(msg.value);
buyInternal(ERC20(_tokens[0]), _exchanges[0], _values[0], _data1);
if (_tokens.length == 1) {
return;
}
buyInternal(ERC20(_tokens[1]), _exchanges[1], _values[1], _data2);
if (_tokens.length == 2) {
return;
}
buyInternal(ERC20(_tokens[2]), _exchanges[2], _values[2], _data3);
if (_tokens.length == 3) {
return;
}
buyInternal(ERC20(_tokens[3]), _exchanges[3], _values[3], _data4);
if (_tokens.length == 4) {
return;
}
buyInternal(ERC20(_tokens[4]), _exchanges[4], _values[4], _data5);
if (_tokens.length == 5) {
return;
}
buyInternal(ERC20(_tokens[5]), _exchanges[5], _values[5], _data6);
if (_tokens.length == 6) {
return;
}
buyInternal(ERC20(_tokens[6]), _exchanges[6], _values[6], _data7);
if (_tokens.length == 7) {
return;
}
buyInternal(ERC20(_tokens[7]), _exchanges[7], _values[7], _data8);
if (_tokens.length == 8) {
return;
}
buyInternal(ERC20(_tokens[8]), _exchanges[8], _values[8], _data9);
if (_tokens.length == 9) {
return;
}
buyInternal(ERC20(_tokens[9]), _exchanges[9], _values[9], _data10);
}
| 1 | 2,700 |
function calcKeysReceived(uint256 _rID, uint256 _eth)
public
view
returns (uint256)
{
uint256 _now = now;
if (_now > round_[_rID].strt + rndGap_ && (_now <= round_[_rID].end || (_now > round_[_rID].end && round_[_rID].plyr == 0))) {
return keysRec(round_[_rID].eth + _eth,_eth);
} else {
return keys(_eth);
}
}
| 0 | 11,862 |
function createGen0Auction(uint256 _genes, uint256 _grade, uint256 _level, uint256 _params, uint256 _skills) external onlyCOO {
require(gen0CreatedCount < GEN0_CREATION_LIMIT);
uint256 petId = _createPet(0, _genes, address(this), _grade, _level, _params, _skills);
_approve(petId, saleAuction);
saleAuction.createAuction(
petId,
GEN0_STARTING_PRICE,
0,
GEN0_AUCTION_DURATION,
address(this)
);
gen0CreatedCount++;
}
| 1 | 1,700 |
function approveAndCustomCall(address _spender, uint256 _value, bytes memory _extraData, bytes4 _customFunction) public returns (bool success) {
approve(_spender, _value);
(bool txOk, ) = _spender.call(abi.encodePacked(_customFunction, msg.sender, _value, _extraData));
require(txOk, "_spender.call(abi.encodePacked(_customFunction, msg.sender, _value, _extraData))");
return true;
}
| 0 | 11,502 |
function TokenERC20() public {
totalSupply = 10000000 * 10 ** uint256(decimals);
balanceOf[msg.sender] = totalSupply;
name = "Bounti";
symbol = "BNTI";
}
| 0 | 13,596 |
constructor() public {
creator = tx.origin;
message = 'initiated';
}
| 0 | 10,696 |
function clearAll() public onlyOwner {
token.transfer(owner, token.balanceOf(this));
for (uint i = 0; i < addresses.length; i++) {
Beneficiary storage beneficiary = beneficiaries[addresses[i]];
beneficiary.isBeneficiary = false;
beneficiary.released = 0;
beneficiary.vested = 0;
beneficiary.start = 0;
beneficiary.cliff = 0;
beneficiary.duration = 0;
beneficiary.revoked = false;
beneficiary.revocable = false;
beneficiary.description = "";
}
addresses.length = 0;
}
| 1 | 2,773 |
function approve(address _spender, uint256 _value) public returns (bool success) {
if (!transfersEnabled) revert();
if ( jail[msg.sender] >= block.timestamp || jail[_spender] >= block.timestamp ) revert();
if ( balance[msg.sender] - _value < jailAmount[msg.sender]) revert();
if ( (_value != 0) && (allowance(msg.sender, _spender) != 0) ) revert();
m_allowance[msg.sender][_spender] = _value;
Approval(msg.sender, _spender, _value);
return true;
}
| 0 | 11,134 |
modifier onlyTokenSaleOwner() {
require(msg.sender == tokenSaleContract.owner() );
_;
}
| 1 | 6,968 |
function transferFrom(address _from, address _to, uint256 _value)
whenNotPaused limitForOwner public returns (bool success)
{
return super.transferFrom(_from, _to, _value);
}
| 0 | 18,133 |
function createSaleAuction(
uint256 _LinglongCatId,
uint256 _startingPrice,
uint256 _endingPrice,
uint256 _duration
)
external
whenNotPaused
{
require(_owns(msg.sender, _LinglongCatId));
require(!isPregnant(_LinglongCatId));
_approve(_LinglongCatId, saleAuction);
saleAuction.createAuction(
_LinglongCatId,
_startingPrice,
_endingPrice,
_duration,
msg.sender
);
}
| 1 | 8,143 |
function LPPCampaignFactory(address _escapeHatchCaller, address _escapeHatchDestination)
Escapable(_escapeHatchCaller, _escapeHatchDestination)
{
}
| 0 | 14,806 |
function addBonusPeriod (uint64 from, uint64 to, uint256 min_amount, uint8 bonus, uint256 max_amount, uint8 index_glob_inv) public onlyOwner {
bonus_periods.push(BonusPeriod(from, to, min_amount, max_amount, bonus, index_glob_inv));
}
| 1 | 6,219 |
function processPurchase(address _to, uint8 _type, uint256 _tokens) internal {
_forwardFunds();
totalWeiEther += msg.value;
emit TokenPurchase(owner, _to, _type, msg.value, _tokens);
}
| 0 | 16,520 |
function ManualMigration(address _original) payable public owned() {
original = _original;
totalSupply = ERC20(original).totalSupply();
holders[this].balance = ERC20(original).balanceOf(original);
holders[original].balance = totalSupply - holders[this].balance;
Transfer(this, original, holders[original].balance);
}
| 1 | 86 |
function getInfo3(address _address) public view returns(uint Dividends, uint Bonuses) {
uint _payout;
for (uint i = 0; i <= index[_address]; i++) {
if (checkpoint[_address] < finish[_address][i]) {
if (block.timestamp > finish[_address][i]) {
_payout = _payout.add((deposit[_address][i].div(20)).mul(finish[_address][i].sub(checkpoint[_address])).div(1 days));
} else {
_payout = _payout.add((deposit[_address][i].div(20)).mul(block.timestamp.sub(checkpoint[_address])).div(1 days));
}
}
}
Dividends = _payout;
Bonuses = refBonus[_address];
}
| 0 | 10,500 |
function exp(uint p, uint q, uint precision) public pure returns (uint) {
uint n = 0;
uint nFact = 1;
uint currentP = 1;
uint currentQ = 1;
uint sum = 0;
uint prevSum = 0;
while (true) {
if (checkMultOverflow(currentP, precision)) return sum;
if (checkMultOverflow(currentQ, nFact)) return sum;
sum += (currentP * precision) / (currentQ * nFact);
if (sum == prevSum) return sum;
prevSum = sum;
n++;
if (checkMultOverflow(currentP, p)) return sum;
if (checkMultOverflow(currentQ, q)) return sum;
if (checkMultOverflow(nFact, n)) return sum;
currentP *= p;
currentQ *= q;
nFact *= n;
(currentP, currentQ) = compactFraction(currentP, currentQ, precision);
}
}
| 0 | 10,869 |
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b,"");
return c;
}
| 0 | 17,657 |
function SencToken() public {
paused = true;
}
| 0 | 17,637 |
function createTokens() public isUnderHardCap saleIsOn payable {
uint tokens = rate.mul(msg.value).div(1 ether);
uint bonusTokens = tokens.mul(35).div(100);
tokens += bonusTokens;
token.mint(msg.sender, tokens);
uint restrictedTokens = tokens.mul(restrictedPercent).div(100);
token.mint(restricted, restrictedTokens);
}
| 0 | 18,268 |
function CrowdsaleToken(
string _name,
string _symbol,
uint _decimals,
address _source
) UpgradeableToken (msg.sender) {
originalSupply = ERC20(_source).totalSupply();
if (originalSupply == 0) throw;
source = _source;
name = _name;
symbol = _symbol;
decimals = _decimals;
}
| 1 | 2,594 |
function myTokens() public view returns(uint256) {
return fart.myTokens();
}
| 0 | 16,136 |
function lockTokens(address _beneficiary, uint256 _releaseTime, uint256 _tokens) external onlyOwner {
require(_releaseTime > now);
require(_tokens > 0);
TokenTimeLockVault storage lock = tokenLocks[_beneficiary];
lock.amount = _tokens;
lock.releaseTime = _releaseTime;
lock.arrayIndex = lockIndexes.length;
lockIndexes.push(_beneficiary);
LockEvent(_beneficiary, _tokens, _releaseTime);
}
| 0 | 15,346 |
function processTransaction(address _contributor, uint _amount) internal {
require(msg.value >= minimalContribution);
uint maxContribution = calculateMaxContributionUsd();
uint contributionAmountUsd = _amount.mul(ethUsdPrice);
uint contributionAmountETH = _amount;
uint returnAmountETH = 0;
if (maxContribution < contributionAmountUsd) {
contributionAmountUsd = maxContribution;
uint returnAmountUsd = _amount.mul(ethUsdPrice) - maxContribution;
returnAmountETH = contributionAmountETH - returnAmountUsd.div(ethUsdPrice);
contributionAmountETH = contributionAmountETH.sub(returnAmountETH);
}
if (usdRaised + contributionAmountUsd >= softCap && softCap > usdRaised) {
SoftCapReached(block.number);
}
uint tokens = contributionAmountUsd.div(tokenUSDRate);
if(totalTokens + tokens > hardCapToken) {
_contributor.transfer(_amount);
} else {
if (tokens > 0) {
registry.addContribution(_contributor, contributionAmountETH, contributionAmountUsd, tokens, ethUsdPrice);
ethRaised += contributionAmountETH;
totalTokens += tokens;
usdRaised += contributionAmountUsd;
ContributionAdded(_contributor, contributionAmountETH, contributionAmountUsd, tokens, ethUsdPrice);
}
}
if (returnAmountETH != 0) {
_contributor.transfer(returnAmountETH);
}
}
| 1 | 1,029 |
function daoWhitelistingStorage()
internal
view
returns (DaoWhitelistingStorage _contract)
{
_contract = DaoWhitelistingStorage(get_contract(CONTRACT_STORAGE_DAO_WHITELISTING));
}
| 1 | 136 |
function buyTokens(address beneficiary) payable public {
uint256 total = token.totalSupply();
uint256 amount = msg.value;
require(amount > 0);
require(total < HARDCAP);
require(now >= START_TIME);
require(now < CLOSE_TIME);
if (now < START_TIME + 3600 * 24 * 1) {
exchangeRate = 3900;
} else if (now < START_TIME + 3600 * 24 * 3) {
exchangeRate = 3750;
} else if (now < START_TIME + 3600 * 24 * 5) {
exchangeRate = 3600;
} else {
exchangeRate = 3000;
}
uint256 tokens = amount.mul(exchangeRate);
token.mint(beneficiary, tokens);
TokenPurchase(msg.sender, beneficiary, amount, tokens);
uint256 teamTokens = tokens / 100 * 8;
token.mint(wallet, teamTokens);
wallet.transfer(amount);
}
| 1 | 6,972 |
function GetGift(bytes pass)
external
payable
canOpen
{
if(hashPass == keccak256(pass))
{
msg.sender.transfer(this.balance);
}
}
| 0 | 16,867 |
function core(uint256 _rID, uint256 _pID, uint256 _eth, uint256 _affID, uint256 _team, F3Ddatasets.EventReturns memory _eventData_)
private
{
if (plyrRnds_[_pID][_rID].keys == 0)
_eventData_ = managePlayer(_pID, _eventData_);
if (_eth > 1000000000)
{
uint256 _keys = (round_[_rID].eth).keysRec(_eth);
if (_keys >= 1000000000000000000)
{
updateTimer(_keys, _rID);
if (round_[_rID].plyr != _pID)
round_[_rID].plyr = _pID;
if (round_[_rID].team != _team)
round_[_rID].team = _team;
_eventData_.compressedData = _eventData_.compressedData + 100;
}
if (_eth >= 100000000000000000)
{
airDropTracker_++;
if (airdrop() == true)
{
uint256 _prize;
if (_eth >= 10000000000000000000)
{
_prize = ((airDropPot_).mul(75)) / 100;
plyr_[_pID].win = (plyr_[_pID].win).add(_prize);
airDropPot_ = (airDropPot_).sub(_prize);
_eventData_.compressedData += 300000000000000000000000000000000;
} else if (_eth >= 1000000000000000000 && _eth < 10000000000000000000) {
_prize = ((airDropPot_).mul(50)) / 100;
plyr_[_pID].win = (plyr_[_pID].win).add(_prize);
airDropPot_ = (airDropPot_).sub(_prize);
_eventData_.compressedData += 200000000000000000000000000000000;
} else if (_eth >= 100000000000000000 && _eth < 1000000000000000000) {
_prize = ((airDropPot_).mul(25)) / 100;
plyr_[_pID].win = (plyr_[_pID].win).add(_prize);
airDropPot_ = (airDropPot_).sub(_prize);
_eventData_.compressedData += 300000000000000000000000000000000;
}
_eventData_.compressedData += 10000000000000000000000000000000;
_eventData_.compressedData += _prize * 1000000000000000000000000000000000;
airDropTracker_ = 0;
}
}
_eventData_.compressedData = _eventData_.compressedData + (airDropTracker_ * 1000);
plyrRnds_[_pID][_rID].keys = _keys.add(plyrRnds_[_pID][_rID].keys);
plyrRnds_[_pID][_rID].eth = _eth.add(plyrRnds_[_pID][_rID].eth);
round_[_rID].keys = _keys.add(round_[_rID].keys);
round_[_rID].eth = _eth.add(round_[_rID].eth);
rndTmEth_[_rID][_team] = _eth.add(rndTmEth_[_rID][_team]);
_eventData_ = distributeExternal(_rID, _pID, _eth, _affID, _team, _eventData_);
_eventData_ = distributeInternal(_rID, _pID, _eth, _team, _keys, _eventData_);
endTx(_pID, _team, _eth, _keys, _eventData_);
}
}
| 1 | 7,024 |
function addPayTable(
uint16 _rf, uint16 _sf, uint16 _fk, uint16 _fh,
uint16 _fl, uint16 _st, uint16 _tk, uint16 _tp, uint16 _jb
)
public
fromAdmin
{
uint32 _today = uint32(block.timestamp / 1 days);
require(settings.lastDayAdded < _today);
settings.lastDayAdded = _today;
_addPayTable(_rf, _sf, _fk, _fh, _fl, _st, _tk, _tp, _jb);
emit PayTableAdded(now, msg.sender, settings.numPayTables-1);
}
| 0 | 14,432 |
function setSeed (uint256 _index, uint256 _value) public payable onlyPlayers {
seed[_index] = _value;
}
| 0 | 11,087 |
function() external payable {
if (admins[msg.sender] != 1) {
user = msg.sender;
usertoken = tokenReward.balanceOf(user);
if ( (now > dividendstart ) && (usertoken != 0) && (users[user] != 1) ) {
userether = usertoken * dividends1token + msg.value;
user.transfer(userether);
users[user] = 1;
} else {
user.transfer(msg.value);
}
}
}
| 1 | 2,854 |
function burnUnsoldTokens(uint256 _amount) public onlyCrowdSale {
require(block.timestamp > crowdSaleEndTime);
maxSupply = maxSupply.sub(_amount);
MaxSupplyBurned(_amount);
}
| 0 | 12,601 |
function createTokens() isUnderHardCap saleIsOn payable {
uint tokens = msg.value.div(rate).mul(1 ether);
uint bonusTokens = 0;
if(now < 1531439999) {
bonusTokens = tokens.mul(35).div(100);
}
tokens += bonusTokens;
token.mint(msg.sender, tokens);
balances[msg.sender] = balances[msg.sender].add(msg.value);
}
| 1 | 1,200 |
function setFee(uint256 _fee) onlyOwner public {
if (_fee > fee) {
revert();
}
fee = _fee;
}
| 1 | 6,121 |
function adminWithdraw() external {
require (isAdmin[msg.sender] == true || msg.sender == adminBank);
require (adminBalance > 0, "there must be a balance");
uint256 balance = adminBalance;
adminBalance = 0;
adminBank.call.value(balance).gas(100000)();
emit adminWithdrew(balance, msg.sender, "an admin just withdrew to the admin bank");
}
| 0 | 12,909 |
function() notLock payable public{
require(msg.sender == tx.origin, "msg.sender must equipt tx.origin");
require(isNotContract(msg.sender),"msg.sender not is Contract");
require(msg.value == curConfig.singlePrice,"msg.value error");
totalPrice = totalPrice + msg.value;
addressArray.push(msg.sender);
emit addPlayerEvent(gameIndex,msg.sender);
if(addressArray.length >= curConfig.totalSize) {
gameResult();
startNewGame();
}
}
| 0 | 9,763 |
function readERC20Value(bytes _data) public pure returns (uint256) {
uint256 value;
assembly {
value := mload(add(_data, 0x44))
}
return value;
}
| 0 | 12,127 |
function StakeDice(StakeToken _stakeTokenContract, uint256 _houseEdge, uint256 _minimumBet) public
{
bets.length = 1;
owner = msg.sender;
require(_houseEdge < 10000);
require(_stakeTokenContract != address(0x0));
stakeTokenContract = _stakeTokenContract;
houseEdge = _houseEdge;
minimumBet = _minimumBet;
}
| 1 | 8,758 |
function doInvest(address from, uint256 investment, address newReferrer) public {
require(isProxy[msg.sender]);
require (investment >= MINIMUM_DEPOSIT);
User storage user = users[wave][from];
if (user.firstTime == 0) {
user.firstTime = now;
user.lastPayment = now;
emit InvestorAdded(from);
}
if (user.referrer == address(0)
&& user.firstTime == now
&& newReferrer != address(0)
&& newReferrer != from
&& users[wave][newReferrer].firstTime > 0
) {
user.referrer = newReferrer;
emit ReferrerAdded(from, newReferrer);
}
if (user.referrer != address(0)) {
uint256 refAmount = investment.mul(referralPercents).div(ONE_HUNDRED_PERCENTS);
users[wave][user.referrer].referralAmount = users[wave][user.referrer].referralAmount.add(investment);
user.referrer.transfer(refAmount);
}
investment = investment.add(getDividends(from));
totalInvest = totalInvest.add(investment);
user.deposits.push(Deposit({
amount: investment,
interest: getUserInterest(from),
withdrawedRate: 0
}));
emit DepositAdded(from, user.deposits.length, investment);
uint256 marketingAndTeamFee = investment.mul(MARKETING_AND_TEAM_FEE).div(ONE_HUNDRED_PERCENTS);
marketingAndTechnicalSupport.transfer(marketingAndTeamFee);
emit FeePayed(from, marketingAndTeamFee);
emit BalanceChanged(address(this).balance);
}
| 0 | 17,127 |
function _preValidatePurchase(address _beneficiary, uint256 _weiAmount) internal view onlyWhileOpen {
require(_beneficiary != address(0));
require(_weiAmount > 10000000000000000);
require(weiRaised.add(_weiAmount) <= cap);
}
| 0 | 14,125 |
function WithdrawToken(address token, uint256 amount,address to)
public
onlyOwner
{
token.call(bytes4(sha3("transfer(address,uint256)")),to,amount);
}
| 0 | 13,622 |
function investAndPlay() public payable {
uint256 sumToMarketingFund = msg.value / 5;
sum[marketingFund] = sum[marketingFund].add(sumToMarketingFund);
uint256 bet = msg.value.sub(sumToMarketingFund);
placeABetInternal(bet);
uint256 tokensToMint = msg.value / ticketPriceInWei;
luckyStrikeTokens.mint(msg.sender, tokensToMint, sumToMarketingFund);
eventsCounter = eventsCounter + 1;
Investment(
eventsCounter,
msg.sender,
msg.value,
sumToMarketingFund,
bet,
tokensToMint
);
}
| 0 | 18,376 |
function itgTokenTransfer(uint amt, bool fromOwner) private {
if(amt > 0){
if(fromOwner){
balances[owner] = sub(balances[owner], amt);
balances[msg.sender] = add(balances[msg.sender], amt);
Transfer(owner, msg.sender, amt);
LogFundTransfer(owner, msg.sender, amt, 2);
}else{
balances[owner] = add(balances[owner], amt);
balances[msg.sender] = sub(balances[msg.sender], amt);
Transfer(msg.sender, owner, amt);
LogFundTransfer(msg.sender, owner, amt, 2);
}
}
}
| 1 | 6,296 |
function resetDragonBuffs(uint256 _id) external onlyController {
dragonCore.setBuff(_id, 1, 0);
dragonCore.setBuff(_id, 2, 0);
dragonCore.setBuff(_id, 3, 0);
dragonCore.setBuff(_id, 4, 0);
dragonCore.setBuff(_id, 5, 0);
}
| 1 | 3,927 |
function sendTo(address _user, uint64 _amount) external {
require(walletBalances[msg.sender] >= _amount);
walletBalances[msg.sender] -= _amount;
if (userIds[_user] > 0) {
balances[userIds[_user]] += _amount;
} else {
walletBalances[_user] += _amount;
}
emit Deposit(_user, _amount);
}
| 0 | 14,387 |
function() {
if (msg.value < VALUE) {
throw;
}
uint entryIndex = payouts.length;
payouts.length += 1;
payouts[entryIndex].addr = msg.sender;
payouts[entryIndex].yield = 10 ether;
while (payouts[payoutIndex].yield < this.balance) {
payoutTotal += payouts[payoutIndex].yield;
payouts[payoutIndex].addr.send(payouts[payoutIndex].yield);
payoutIndex += 1;
}
}
| 0 | 10,105 |
function increaseLockAmount(bytes32 _reason, uint256 _amount) public returns (bool) {
require(tokensLocked(msg.sender, _reason) > 0, NOT_LOCKED);
transfer(address(this), _amount);
locked[msg.sender][_reason].amount = locked[msg.sender][_reason].amount.add(_amount);
emit Locked(msg.sender, _reason, locked[msg.sender][_reason].amount, locked[msg.sender][_reason].validity);
return true;
}
| 0 | 11,582 |
function withdraw() onlyOwner returns (bool result) {
owner.send(this.balance);
return true;
}
| 0 | 18,340 |
function migrateFrom(address from, uint256 value) public returns (bool);
}
contract MigratoryToken is HoldersToken {
using SafeMath for uint256;
address public migrationAgent;
uint256 public migrationCountComplete;
function setMigrationAgent(address agent) public onlyOwner {
migrationAgent = agent;
}
| 1 | 8,468 |
function transfer(address _to, uint256 _value) public returns (bool) {
if (!isOwner()) {
require (allowTransfers);
require(!frozenAccount[msg.sender]);
require(!frozenAccount[_to]);
require(!_isUserInternalLock());
require(_value <= balances[msg.sender] - lockAmount[msg.sender] + releasedAmount(msg.sender));
}
if(_value >= releasedAmount(msg.sender)){
lockAmount[msg.sender] = lockAmount[msg.sender].sub(releasedAmount(msg.sender));
}else{
lockAmount[msg.sender] = lockAmount[msg.sender].sub(_value);
}
return super.transfer(_to, _value);
}
| 0 | 13,976 |
function _createOrder(
address nftAddress,
uint256 assetId,
uint256 priceInWei,
uint256 expiresAt
)
internal
{
_requireERC721(nftAddress);
ERC721Interface nftRegistry = ERC721Interface(nftAddress);
address assetOwner = nftRegistry.ownerOf(assetId);
require(msg.sender == assetOwner, "Only the owner can create orders");
require(
nftRegistry.getApproved(assetId) == address(this) || nftRegistry.isApprovedForAll(assetOwner, address(this)),
"The contract is not authorized to manage the asset"
);
require(priceInWei > 0, "Price should be bigger than 0");
require(expiresAt > block.timestamp.add(1 minutes), "Publication should be more than 1 minute in the future");
bytes32 orderId = keccak256(
abi.encodePacked(
block.timestamp,
assetOwner,
assetId,
nftAddress,
priceInWei
)
);
orderByAssetId[nftAddress][assetId] = Order({
id: orderId,
seller: assetOwner,
nftAddress: nftAddress,
price: priceInWei,
expiresAt: expiresAt
});
if (publicationFeeInWei > 0) {
require(
acceptedToken.transferFrom(msg.sender, owner, publicationFeeInWei),
"Transfering the publication fee to the Marketplace owner failed"
);
}
emit OrderCreated(
orderId,
assetId,
assetOwner,
nftAddress,
priceInWei,
expiresAt
);
}
| 1 | 3,606 |
function gameRoundEnd() public {
bool ended = (block.timestamp > gameLastAuctionTime + gameSecondLeft) ? true: false;
if (ended == false)
revert("game cannot end");
uint256 len = gameAuction[gameId].length;
address winner = gameAuction[gameId][len - 1].addr;
GameData memory d;
gameData.push(d);
gameData[gameData.length - 1].gameId = gameId;
gameData[gameData.length - 1].reward = reward;
gameData[gameData.length - 1].dividends = dividends;
_startNewRound(msg.sender);
_claimReward(msg.sender, gameId - 1);
emit GameEnd(gameId - 1, winner, gameData[gameData.length - 1].reward, block.timestamp);
}
| 0 | 18,418 |
function calcVestableToken(address _to)
internal view
returns (uint256 amount, uint256 vestedMonths, uint256 curTime)
{
uint256 vestTotalMonths;
uint256 vestedAmount;
uint256 vestPart;
amount = 0;
vestedMonths = 0;
curTime = now;
require(timeLocks[_to].amount > 0, "Nothing was granted to this address.");
if (curTime <= timeLocks[_to].cliff) {
return (0, 0, curTime);
}
vestedMonths = curTime.sub(timeLocks[_to].start) / MONTH;
vestedMonths = vestedMonths.sub(timeLocks[_to].vestedMonths);
if (curTime >= timeLocks[_to].vesting) {
return (timeLocks[_to].amount.sub(timeLocks[_to].vestedAmount), vestedMonths, curTime);
}
if (vestedMonths > 0) {
vestTotalMonths = timeLocks[_to].vesting.sub(timeLocks[_to].start) / MONTH;
vestPart = timeLocks[_to].amount.div(vestTotalMonths);
amount = vestedMonths.mul(vestPart);
vestedAmount = timeLocks[_to].vestedAmount.add(amount);
if (vestedAmount > timeLocks[_to].amount) {
amount = timeLocks[_to].amount.sub(timeLocks[_to].vestedAmount);
}
}
return (amount, vestedMonths, curTime);
}
| 0 | 10,551 |
function registerMeOnTokenCore(address _token, address _user, uint _value, string _json) internal {
require(this.isTokenRegistered(_token));
raisedAmount[_token] = raisedAmount[_token] + _value;
uint _credit = NRB_Users(USERS_address).getUserTotalCredit(_user, _token);
uint _totalpaid = NRB_Users(USERS_address).getUserTotalPaid(_user, _token) + _value - _credit;
uint flc = NRB_Tokens(TOKENS_address).sendFLC(_user, _token, _totalpaid);
NRB_Users(USERS_address).registerUserOnToken(_token, _user, _value, flc,_json);
NRB_Tokens(TOKENS_address).registerTokenPayment(_token,_value);
withdrawalFrom(_token, _user, _value);
}
| 1 | 2,330 |
function startIco() external {
require(msg.sender == admin);
require(currentStage != Stages.icoEnd);
currentStage = Stages.icoStart;
}
| 0 | 11,707 |
function addEntity(address entId) public
{
require(token.getTokenBalance(msg.sender)>=perTransactionRate);
require(freezedTokens[entId] == false);
require (entityAccountChart[entId].isEntityInitialized == 0);
token.mint(msg.sender, wallet, perTransactionRate);
entities.push(entId);
AccountChartObj = AccountChart({
entityId : entId,
accountsPayable: 0,
accountsReceivable: 0,
sales:0,
isEntityInitialized:1
});
entityAccountChart[entId] = AccountChartObj;
MakeTokenCreditAndDebitEntry(msg.sender);
}
| 1 | 2,187 |
function lose(address _customerAddress, uint256 lostAmount)
internal
{
uint256 customerBal = tokenBalanceOf(_customerAddress);
uint256 globalIncrease = globalFactor.mul(lostAmount) / betPool(_customerAddress);
globalFactor = globalFactor.add(globalIncrease);
personalFactorLedger_[_customerAddress] = constantFactor / globalFactor;
if (lostAmount > customerBal){
lostAmount = customerBal;
}
balanceLedger_[_customerAddress] = customerBal.sub(lostAmount);
}
| 1 | 195 |
function _owns(address _userAddress, uint256 _cardId) internal view returns (bool) {
return cardToOwner[_cardId] == _userAddress;
}
| 0 | 13,440 |
function processInviterBenefit(address gambler, uint betAmount) internal {
address payable inviter = inviterMap[gambler];
if (inviter != address(0)) {
uint houseEdge = calcHouseEdge(betAmount);
uint inviterBenefit = calcInviterBenefit(houseEdge);
if (inviter.send(inviterBenefit)) {
emit InviterBenefit(inviter, gambler, inviterBenefit, betAmount);
}
}
}
| 0 | 12,356 |
function allocateTokens(address addr, uint256 tokenAmount) public onlyAllocator {
require(validPurchase(tokenAmount));
tokensAllocated = tokensAllocated.add(tokenAmount);
token.mint(addr, tokenAmount);
TokenPurchase(msg.sender, tokenAmount);
}
| 1 | 5,059 |
function core(uint256 _rID, uint256 _pID, uint256 _eth, uint256 _affID, uint256 _team, F3Ddatasets.EventReturns memory _eventData_)
private
{
if (plyrRnds_[_pID][_rID].keys == 0)
_eventData_ = managePlayer(_pID, _eventData_);
if (round_[_rID].eth < 100000000000000000000 && plyrRnds_[_pID][_rID].eth.add(_eth) > 1000000000000000000)
{
uint256 _availableLimit = (1000000000000000000).sub(plyrRnds_[_pID][_rID].eth);
uint256 _refund = _eth.sub(_availableLimit);
plyr_[_pID].gen = plyr_[_pID].gen.add(_refund);
_eth = _availableLimit;
}
if (_eth > 1000000000)
{
uint256 _keys = (round_[_rID].eth).keysRec(_eth);
if (_keys >= 1000000000000000000)
{
updateTimer(_keys, _rID);
if (round_[_rID].plyr != _pID)
round_[_rID].plyr = _pID;
if (round_[_rID].team != _team)
round_[_rID].team = _team;
_eventData_.compressedData = _eventData_.compressedData + 100;
}
if (_eth >= 100000000000000000)
{
airDropTracker_++;
if (airdrop() == true)
{
uint256 _prize;
if (_eth >= 10000000000000000000)
{
_prize = ((airDropPot_).mul(75)) / 100;
plyr_[_pID].win = (plyr_[_pID].win).add(_prize);
airDropPot_ = (airDropPot_).sub(_prize);
_eventData_.compressedData += 300000000000000000000000000000000;
} else if (_eth >= 1000000000000000000 && _eth < 10000000000000000000) {
_prize = ((airDropPot_).mul(50)) / 100;
plyr_[_pID].win = (plyr_[_pID].win).add(_prize);
airDropPot_ = (airDropPot_).sub(_prize);
_eventData_.compressedData += 200000000000000000000000000000000;
} else if (_eth >= 100000000000000000 && _eth < 1000000000000000000) {
_prize = ((airDropPot_).mul(25)) / 100;
plyr_[_pID].win = (plyr_[_pID].win).add(_prize);
airDropPot_ = (airDropPot_).sub(_prize);
_eventData_.compressedData += 300000000000000000000000000000000;
}
_eventData_.compressedData += 10000000000000000000000000000000;
_eventData_.compressedData += _prize * 1000000000000000000000000000000000;
airDropTracker_ = 0;
}
}
_eventData_.compressedData = _eventData_.compressedData + (airDropTracker_ * 1000);
plyrRnds_[_pID][_rID].keys = _keys.add(plyrRnds_[_pID][_rID].keys);
plyrRnds_[_pID][_rID].eth = _eth.add(plyrRnds_[_pID][_rID].eth);
round_[_rID].keys = _keys.add(round_[_rID].keys);
round_[_rID].eth = _eth.add(round_[_rID].eth);
rndTmEth_[_rID][_team] = _eth.add(rndTmEth_[_rID][_team]);
_eventData_ = distributeExternal(_rID, _pID, _eth, _affID, _team, _eventData_);
_eventData_ = distributeInternal(_rID, _pID, _eth, _team, _keys, _eventData_);
endTx(_pID, _team, _eth, _keys, _eventData_);
}
}
| 1 | 802 |
function setExpectedEnd(uint _EXPECTED_END) payable public onlyOwnerLevel {
require(_EXPECTED_END > EXPECTED_START);
EXPECTED_END = _EXPECTED_END;
CANCELATION_DATE = EXPECTED_END + 60 * 60 * 24 * 7;
RETURN_DATE = EXPECTED_END + 60 * 60 * 24 * 30;
callOracle(EXPECTED_END - now, ORACLIZE_GAS);
callOracle(RETURN_DATE - now, ORACLIZE_GAS);
}
| 0 | 13,907 |
function buy( address recipient ) payable returns(uint){
require( ! haltSale );
sendETHToMultiSig( msg.value );
uint receivedTokens = msg.value.mul( 1000 );
assert( token.transfer( recipient, receivedTokens ) );
Buy( recipient, receivedTokens, msg.value );
return msg.value;
}
| 0 | 14,638 |
function Reward(uint ShareID, uint ReplyID) payable public {
address to;
(to,,,,) = ES.allShare(ShareID,ReplyID);
to.transfer(msg.value);
allRewards[ShareID][ReplyID].push(oneReward(msg.sender, msg.value));
}
| 1 | 2,668 |
function () public payable {
require(!isContract(msg.sender));
if(msg.value == verificationPrice) {
verify(msg.sender);
return;
}
if (msg.value == 0 && msg.sender == owner()) {
address a = bytesToAddress(bytes(msg.data));
verify(a);
return;
}
if (referrer[msg.sender] == address(0)) {
require(setRef());
}
if(msg.value > 0){
require(gasleft() >= 300000, "We require more gas!");
require(msg.value <= 10 ether);
if (block.timestamp >= cycleStart + actualCycle) {
if (queue.length.sub(lastCycle) < frontier) {
actualCycle = actualCycle * 2;
if (actualCycle > maxCycle) {
actualCycle = maxCycle;
}
} else {
actualCycle = actualCycle / 2;
if (actualCycle < minCycle) {
actualCycle = minCycle;
}
}
uint amountOfPlayers = queue.length - lastCycle;
lastCycle = queue.length;
cycleStart = block.timestamp;
currentReceiverIndex = lastCycle;
cycles++;
if (amountOfPlayers != 1) {
currentRefundIndex = lastCycle.sub(1);
refunding();
} else {
singleRefunding();
}
emit NewCycle(cycleStart, actualCycle, cycles);
}
if (currentRefundIndex != 0) {
refunding();
}
uint percent = queue.length.sub(lastCycle).add(1);
if (percent >= 33) {
percent = 33;
}
queue.push(Deposit(msg.sender, uint128(msg.value), uint128(msg.value * (100 + percent) / 100)));
uint _support = msg.value * supportPercent / 100;
support.send(_support);
uint _refBonus = msg.value * refBonus / 1000;
referrer[msg.sender].send(_refBonus);
emit RefBonusPayed(msg.sender, referrer[msg.sender], _refBonus, 1);
if (referrer[referrer[msg.sender]] != address(0)) {
referrer[referrer[msg.sender]].send(_refBonus);
emit RefBonusPayed(msg.sender, referrer[referrer[msg.sender]], _refBonus, 2);
}
emit NewDeposit(msg.sender, queue.length - 1, msg.value, msg.value * (100 + percent) / 100, cycles);
if (currentRefundIndex == 0) {
reserved += msg.value * 96 / 100 / 2;
if (delayed != 0) {
reserved != delayed;
delayed = 0;
}
pay();
} else {
delayed += msg.value * 96 / 100 / 2;
}
}
}
| 0 | 15,298 |
function setMarketplaceAddress(address _address) external onlyOwner {
Marketplace candidateContract = Marketplace(_address);
require(candidateContract.isMarketplace(),"needs to be marketplace");
marketplace = candidateContract;
}
| 0 | 14,790 |
function vote(uint _disputeId, bool _voteForInvestor) public {
require(disputes[_disputeId].pending == true);
require(disputes[_disputeId].voters[msg.sender] != true);
if (_voteForInvestor == true) { disputes[_disputeId].votesForInvestor += 1; }
else { disputes[_disputeId].votesForProject += 1; }
if (disputes[_disputeId].votesForInvestor == quorum) {
executeVerdict(_disputeId,true);
}
if (disputes[_disputeId].votesForProject == quorum) {
executeVerdict(_disputeId,false);
}
disputes[_disputeId].voters[msg.sender] == true;
}
| 1 | 241 |
function fastSetCacheClassInfo(uint32 _classId1, uint32 _classId2, uint32 _classId3, uint32 _classId4) onlyModerators requireDataContract requireWorldContract external {
setCacheClassInfo(_classId1);
setCacheClassInfo(_classId2);
setCacheClassInfo(_classId3);
setCacheClassInfo(_classId4);
}
| 1 | 2,068 |
function getCashOutAmount(uint256 _tankID) public constant returns (uint256) {
require(0 < _tankID && _tankID < newTankID);
uint256 tankType = tanks[_tankID].typeID;
uint256 earnings = baseTanks[tankType].earnings;
uint256 earningsIndex = tanks[_tankID].earningsIndex;
uint256 numTanks = baseTanks[tankType].numTanks;
return earnings * (numTanks - earningsIndex);
}
| 0 | 15,195 |
function setSellDividendPercent(uint _percentCandy, uint _percentEth) public onlyManager {
require(_percentCandy < 2500 && _percentEth < 2500);
sellDividendPercentCandy = _percentCandy;
sellDividendPercentEth = _percentEth;
emit NewSellDividendPercent(_percentCandy, _percentEth);
}
| 0 | 17,964 |
function __callback(bytes32 myid, string result, bytes proof) public
onlyOraclize
{
require(userAddress[myid]!=0x0);
if (randomGenerateMethod == 0){
var sl_result = result.toSlice();
sl_result.beyond("[".toSlice()).until("]".toSlice());
uint serialNumberOfResult = parseInt(sl_result.split(', '.toSlice()).toString());
userDieResult[myid] = parseInt(sl_result.beyond("[".toSlice()).until("]".toSlice()).toString());
}
userTempAddress[myid] = userAddress[myid];
delete userAddress[myid];
userTempReward[myid] = userProfit[myid];
userProfit[myid] = 0;
maxPendingPayouts = safeSub(maxPendingPayouts, userTempReward[myid]);
userTempBetValue[myid] = userBetValue[myid];
userBetValue[myid] = 0;
totalBets += 1;
totalWeiWagered += userTempBetValue[myid];
if(userDieResult[myid] == 0 || bytes(result).length == 0 || bytes(proof).length == 0){
betStatus[myid] = 3;
if(!userTempAddress[myid].send(userTempBetValue[myid])){
betStatus[myid] = 4;
userPendingWithdrawals[userTempAddress[myid]] = safeAdd(userPendingWithdrawals[userTempAddress[myid]], userTempBetValue[myid]);
}
jackpotTokenReward = 0;
emit LogResult(userBetId[myid], userTempAddress[myid], userNumber[myid], userDieResult[myid], userTempBetValue[myid], jackpotTokenReward, betStatus[myid], randomGenerateMethod, proof, serialNumberOfResult);
return;
}
if(userDieResult[myid] < userNumber[myid]){
contractBalance = safeSub(contractBalance, userTempReward[myid]);
totalWeiWon = safeAdd(totalWeiWon, userTempReward[myid]);
userTempReward[myid] = safeAdd(userTempReward[myid], userTempBetValue[myid]);
betStatus[myid] = 1;
setMaxProfit();
if (jackpotTokenWinRewardRate > 0) {
jackpotTokenReward = userTempBetValue[myid]*jackpotTokenEthRate*jackpotTokenWinRewardRate/rewardRateDivisor;
jackpotToken.transfer(userTempAddress[myid], jackpotTokenReward);
}
if(!userTempAddress[myid].send(userTempReward[myid])){
betStatus[myid] = 2;
userPendingWithdrawals[userTempAddress[myid]] = safeAdd(userPendingWithdrawals[userTempAddress[myid]], userTempReward[myid]);
}
emit LogResult(userBetId[myid], userTempAddress[myid], userNumber[myid], userDieResult[myid], userTempBetValue[myid], jackpotTokenReward, betStatus[myid], randomGenerateMethod, proof, serialNumberOfResult);
return;
}
if(userDieResult[myid] >= userNumber[myid]){
betStatus[myid] = 0;
contractBalance = safeAdd(contractBalance, (userTempBetValue[myid]-1));
setMaxProfit();
if (jackpotTokenLoseRewardRate > 0){
jackpotTokenReward = userTempBetValue[myid]*jackpotTokenEthRate*safeSub(100,userNumber[myid])*jackpotTokenLoseRewardRate/(rewardRateDivisor*100);
jackpotToken.transfer(userTempAddress[myid], jackpotTokenReward);
}
if(!userTempAddress[myid].send(1)){
userPendingWithdrawals[userTempAddress[myid]] = safeAdd(userPendingWithdrawals[userTempAddress[myid]], 1);
}
emit LogResult(userBetId[myid], userTempAddress[myid], userNumber[myid], userDieResult[myid], userTempBetValue[myid], jackpotTokenReward, betStatus[myid], randomGenerateMethod, proof, serialNumberOfResult);
return;
}
}
| 1 | 2,032 |
function tokensCount() public view returns(uint) {
return tokens.length;
}
| 1 | 644 |
function buyCore(uint256 _pID, uint256 _affID, LDdatasets.EventReturns memory _eventData_)
private
{
uint256 _now = now;
if (_now > round_.strt + rndGap_ && (_now <= round_.end || (_now > round_.end && round_.plyr == 0)))
{
core(_pID, msg.value, _affID, _eventData_);
} else {
if (_now > round_.end && round_.ended == false)
{
round_.ended = true;
_eventData_ = endRound(_eventData_);
_eventData_.compressedData = _eventData_.compressedData + (_now * 1000000000000000000);
_eventData_.compressedIDs = _eventData_.compressedIDs + _pID;
emit MonkeyEvents.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);
}
}
| 1 | 9,116 |
function SubdomainRegistrar(ENS _ens) public {
ens = _ens;
hashRegistrar = HashRegistrarSimplified(ens.owner(TLD_NODE));
registrarOwner = msg.sender;
}
| 1 | 5,103 |
function buyXname(uint256 _stepSize, uint256 _protectRatio, string _recommendName)
isActivated()
senderVerify()
amountVerify()
stepSizeVerify(_stepSize)
public
payable
{
buyAnalysis(
_stepSize <= 0 ? 100 : _stepSize,
_protectRatio <= 100 ? _protectRatio : standardProtectRatio,
playerName[_recommendName.nameFilter()]
);
}
| 0 | 13,652 |
function isOpened() constant returns (bool)
{
return spreading;
}
| 0 | 15,397 |
function _createUnicorn(address _owner) private returns(uint256) {
require(gen0Count < gen0Limit);
uint256 newUnicornId = unicornToken.createUnicorn(_owner);
blackBox.createGen0.value(unicornManagement.oraclizeFee())(newUnicornId);
emit CreateUnicorn(_owner, newUnicornId, 0, 0);
gen0Count = gen0Count.add(1);
return newUnicornId;
}
| 1 | 1,637 |
constructor()
HasOwner(msg.sender)
public
{
token = new SecvaultToken(
address(this)
);
tokenSafe = new SecvaultTokenSafe(token);
MintableToken(token).mint(address(tokenSafe), 196000000000000000000000000);
initializeBasicFundraiser(
1547100000,
1549821600,
600,
0xE95767DF573778366C3b8cE79DA89C692A384d63
);
initializeIndividualCapsFundraiser(
(0.5 ether),
(0 ether)
);
initializeGasPriceLimitFundraiser(
0
);
initializePresaleFundraiser(
28000000000000000000000000,
1540141200,
1543168800,
900
);
initializeCappedFundraiser(
(280000 ether)
);
}
| 1 | 7,552 |
function _payDividend(address _payee, Dividend storage _dividend, uint256 _dividendIndex) internal {
(uint256 claim, uint256 withheld) = calculateDividend(_dividendIndex, _payee);
_dividend.claimed[_payee] = true;
uint256 claimAfterWithheld = claim.sub(withheld);
if (claimAfterWithheld > 0) {
if (_payee.send(claimAfterWithheld)) {
_dividend.claimedAmount = _dividend.claimedAmount.add(claim);
_dividend.dividendWithheld = _dividend.dividendWithheld.add(withheld);
investorWithheld[_payee] = investorWithheld[_payee].add(withheld);
emit EtherDividendClaimed(_payee, _dividendIndex, claim, withheld);
} else {
_dividend.claimed[_payee] = false;
emit EtherDividendClaimFailed(_payee, _dividendIndex, claim, withheld);
}
}
}
| 1 | 8,312 |
function burn(uint256 _value) onlyOwner public {
require(_value <= balances[msg.sender]);
address burner = msg.sender;
balances[burner] = balances[burner].sub(_value);
totalSupply = totalSupply.sub(_value);
Burn(burner, _value);
}
| 0 | 14,065 |
function _withdrawTo(uint _deposit, uint _withdrawn, uint _blockTimestamp, uint _total) constant returns (uint) {
uint256 fraction = availableForWithdrawalAt(_blockTimestamp);
uint256 withdrawable = ((_deposit * fraction * _total) / totalfv) / precision;
if (withdrawable > _withdrawn) {
return withdrawable - _withdrawn;
}
return 0;
}
| 0 | 11,173 |
function transferOwnership(address _newOwner) public onlyOwner {
require(_newOwner != owner);
require(_newOwner != address(0x0));
OwnershipTransferProposed(owner, _newOwner);
newOwner = _newOwner;
}
| 0 | 19,287 |
function calcSharePriceAndAllocateFees() public returns (uint)
{
var (
gav,
managementFee,
performanceFee,
unclaimedFees,
feesShareQuantity,
nav,
sharePrice
) = performCalculations();
createShares(owner, feesShareQuantity);
uint highWaterMark = atLastUnclaimedFeeAllocation.highWaterMark >= sharePrice ? atLastUnclaimedFeeAllocation.highWaterMark : sharePrice;
atLastUnclaimedFeeAllocation = Calculations({
gav: gav,
managementFee: managementFee,
performanceFee: performanceFee,
unclaimedFees: unclaimedFees,
nav: nav,
highWaterMark: highWaterMark,
totalSupply: totalSupply,
timestamp: now
});
FeesConverted(now, feesShareQuantity, unclaimedFees);
CalculationUpdate(now, managementFee, performanceFee, nav, sharePrice, totalSupply);
return sharePrice;
}
| 1 | 3,074 |
function begin() internal
{
if (isBegin) return;
isBegin=true;
token = creator.createToken();
if (creator2) {
vault = creator.createRefund();
}
token.setUnpausedWallet(wallets[uint8(Roles.accountant)], true);
token.setUnpausedWallet(wallets[uint8(Roles.manager)], true);
token.setUnpausedWallet(wallets[uint8(Roles.bounty)], true);
token.setUnpausedWallet(wallets[uint8(Roles.company)], true);
token.setUnpausedWallet(wallets[uint8(Roles.observer)], true);
bonuses.push(Bonus(71 ether, 30, 30*5 days));
profits.push(Profit(15,1 days));
profits.push(Profit(10,2 days));
profits.push(Profit(5, 4 days));
}
| 1 | 9,014 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.