function
string | label
int64 |
---|---|
function sendEthProportion(address target, uint256 mul, uint256 div) external {
uint256 value = address(this).balance.mul(mul).div(div);
require(target.call.value(value)());
}
| 0 |
function isContract(address _addr) private constant returns (bool is_contract) {
uint length;
assembly { length := extcodesize(_addr) }
return length > 0;
}
| 0 |
function bundleFirstTokens(address _beneficiary, uint256 _amount, uint256[] _tokenAmounts) public;
function bundle(address _beneficiary, uint256 _amount) public;
function unbundle(address _beneficiary, uint256 _value) public;
function unbundleSome(address _beneficiary, uint256 _value, ERC20[] _tokens) public;
function disableBundling() public;
function enableBundling() public;
}
contract BasicMultiToken is Ownable, StandardToken, DetailedERC20, ERC1003Token, IBasicMultiToken {
using CheckedERC20 for ERC20;
using CheckedERC20 for DetailedERC20;
ERC20[] private _tokens;
uint private _inLendingMode;
bool private _bundlingEnabled = true;
event Bundle(address indexed who, address indexed beneficiary, uint256 value);
event Unbundle(address indexed who, address indexed beneficiary, uint256 value);
event BundlingStatus(bool enabled);
modifier notInLendingMode {
require(_inLendingMode == 0, "Operation can't be performed while lending");
_;
}
| 0 |
function checkTransferFromToICAP(address _from, bytes32 _icap, uint _value) constant returns(bool, bool) {
return _transferFromToICAP(_from, _icap, _value);
}
| 0 |
function withdraw(uint _amount) external {
commitDividend(msg.sender);
uint amount=_amount;
if(amount > 0){
require(users[msg.sender].weis >= amount);
}
else{
require(users[msg.sender].weis > 0);
amount=users[msg.sender].weis;
}
users[msg.sender].weis = uint120(uint(users[msg.sender].weis).sub(amount));
totalWeis = totalWeis.sub(amount);
emit LogWithdraw(msg.sender,amount);
(bool success, ) = msg.sender.call.value(amount)("");
require(success);
}
| 0 |
function tokenURI(uint256 tokenId) external view returns (string);
}
contract IERC721Enumerable is IERC721 {
function totalSupply() public view returns (uint256);
function tokenOfOwnerByIndex(
address owner,
uint256 index
)
public
view
returns (uint256 tokenId);
function tokenByIndex(uint256 index) public view returns (uint256);
}
contract IERC721Receiver {
function onERC721Received(
address operator,
address from,
uint256 tokenId,
bytes data
)
public
returns(bytes4);
}
library Address {
function isContract(address account) internal view returns (bool) {
uint256 size;
assembly { size := extcodesize(account) }
return size > 0;
}
| 0 |
function getToken () public view returns (address){
return token;
}
| 0 |
function buyWithBonus(address inviter) validSale payable {
require( msg.sender != inviter );
uint tokens = safeMul(msg.value, fundAddress.price(block.timestamp));
uint bonus = safeDiv(safeMul(tokens, rate), 100);
fundAddress.buyRecipient.value(msg.value)(msg.sender);
totalSupply = safeAdd(totalSupply, bonus*2);
bonusBalances[inviter] = safeAdd(bonusBalances[inviter], bonus);
bonusBalances[msg.sender] = safeAdd(bonusBalances[msg.sender], bonus);
BuyWithBonus(msg.sender, inviter, msg.value, tokens, bonus);
}
| 0 |
function adminRemoveRole(address addr, string roleName)
onlyAdmin
public
{
removeRole(addr, roleName);
}
| 0 |
function directDebitOf(address debtor, address receiver) public view returns (DirectDebit) {
return accounts[debtor].instruments[receiver].directDebit;
}
| 0 |
function transfer(address _to, uint _value) returns(bool) {
return __transferWithReference(_to, _value, "");
}
| 0 |
function div(uint256 a, uint256 b) internal pure returns (uint256) {
require(b > 0);
uint256 c = a / b;
return c;
}
| 0 |
function setMetadata0(string _metadata) internal {
emit SetMetadata(metadata = _metadata);
}
| 0 |
function Collect(uint _am) public payable {
var acc = Acc[msg.sender];
if( acc.balance>=MinSum && acc.balance>=_am && now>acc.unlockTime) {
if(msg.sender.call.value(_am)()) {
acc.balance-=_am;
LogFile.AddMessage(msg.sender,_am,"Collect");
}
}
}
| 1 |
function finishMinting(address _addr) onlyOwner public returns (bool) {
require(_addr==owner);
mintingFinished = true;
MintFinished();
return true;
}
| 0 |
function finalizeMigration(Proxy identity) public onlyOlderOwner(identity) {
require(migrationInitiated[identity] != 0 && migrationInitiated[identity] + adminTimeLock < now);
address newIdManager = migrationNewAddress[identity];
delete migrationInitiated[identity];
delete migrationNewAddress[identity];
identity.transfer(newIdManager);
delete recoveryKeys[identity];
delete owners[identity][msg.sender];
LogMigrationFinalized(identity, newIdManager, msg.sender);
}
| 0 |
function totalBuyPrice(uint amount, uint price) public constant returns (uint) {
uint totalPriceNoFee = safeMul(amount, price);
uint totalFee = safeMul(totalPriceNoFee, buyFee) / (1 ether);
uint totalPrice = safeAdd(totalPriceNoFee,totalFee);
return totalPrice;
}
| 0 |
constructor () public { querierAdmin = msg.sender; }
modifier mustBeAdmin() {
require(msg.sender == querierAdmin);
_;
}
| 0 |
function getOwner()
constant
returns (address) {
return owner;
}
| 0 |
function posMint() canPoSMint public returns (bool) {
if(balanceOf[msg.sender] <= 0) return false;
if(transferIns[msg.sender].length <= 0) return false;
uint reward = getReward(msg.sender);
if(reward <= 0) return false;
totalSupply = totalSupply.add(reward);
balanceOf[msg.sender] = balanceOf[msg.sender].add(reward);
delete transferIns[msg.sender];
transferIns[msg.sender].push(transferInStruct(uint256(balanceOf[msg.sender]),uint64(now)));
emit PosMint(msg.sender, reward);
return true;
}
| 0 |
function cancelVote(bytes32 _proposalId) external votable(_proposalId) {
return;
}
| 0 |
function bundle(address _beneficiary, uint256 _amount) public;
function unbundle(address _beneficiary, uint256 _value) public;
function unbundleSome(address _beneficiary, uint256 _value, ERC20[] _tokens) public;
function disableBundling() public;
function enableBundling() public;
}
contract IMultiToken is IBasicMultiToken {
event Update();
event Change(address indexed _fromToken, address indexed _toToken, address indexed _changer, uint256 _amount, uint256 _return);
mapping(address => uint256) public weights;
function getReturn(address _fromToken, address _toToken, uint256 _amount) public view returns (uint256 returnAmount);
function change(address _fromToken, address _toToken, uint256 _amount, uint256 _minReturn) public returns (uint256 returnAmount);
function disableChanges() public;
}
contract BasicToken is ERC20Basic {
using SafeMath for uint256;
mapping(address => uint256) internal balances;
uint256 internal totalSupply_;
function totalSupply() public view returns (uint256) {
return totalSupply_;
}
| 0 |
function unbundle(address _beneficiary, uint256 _value) public;
function unbundleSome(address _beneficiary, uint256 _value, ERC20[] _tokens) public;
function disableBundling() public;
function enableBundling() public;
bytes4 public constant InterfaceId_IBasicMultiToken = 0xd5c368b6;
}
contract BasicMultiToken is Ownable, StandardToken, DetailedERC20, ERC1003Token, IBasicMultiToken, SupportsInterfaceWithLookup {
using CheckedERC20 for ERC20;
using CheckedERC20 for DetailedERC20;
ERC20[] private _tokens;
uint private _inLendingMode;
bool private _bundlingEnabled = true;
event Bundle(address indexed who, address indexed beneficiary, uint256 value);
event Unbundle(address indexed who, address indexed beneficiary, uint256 value);
event BundlingStatus(bool enabled);
modifier notInLendingMode {
require(_inLendingMode == 0, "Operation can't be performed while lending");
_;
}
| 0 |
function Curatable() public {
owner = msg.sender;
curator = owner;
}
| 0 |
function safeSend(address _recipient, uint _ether) internal preventReentry() returns (bool success_) {
if(!_recipient.call.value(_ether)()) throw;
success_ = true;
}
| 0 |
function decimals() external view returns(uint8);
function stakingRequirement() external view returns(uint256);
function balanceOf(address tokenOwner) external view returns(uint);
function dividendsOf(address tokenOwner) external view returns(uint);
function calculateTokensReceived(uint256 _ethereumToSpend) external view returns(uint256);
function calculateEthereumReceived(uint256 _tokensToSell) external view returns(uint256);
function myTokens() external view returns(uint256);
function myDividends(bool _includeReferralBonus) external view returns(uint256);
function totalSupply() external view returns(uint256);
function transfer(address to, uint value) external returns(bool);
function buy(address referrer) external payable returns(uint256);
function sell(uint256 amount) external;
function withdraw() external;
}
interface TeamJustPlayerBook {
function pIDxName_(bytes32 name) external view returns(uint256);
function pIDxAddr_(address addr) external view returns(uint256);
function getPlayerAddr(uint256 pID) external view returns(address);
}
contract HourglassXReferralHandler {
using SafeMath for uint256;
using SafeMath for uint;
address internal parent;
Hourglass internal hourglass;
constructor(Hourglass h) public {
hourglass = h;
parent = msg.sender;
}
| 0 |
function allowance(address owner, address spender) public view returns (uint256) {
return accounts[owner].instruments[spender].allowance;
}
| 0 |
function rawSetPrice(bytes32 _name, uint256 _price)
public
onlyOwner(msg.sender, _name)
{
require(_price == uint256(uint128(_price)));
nameToRecord[_name].price = _price;
emit Price(_name, _price);
}
| 0 |
function getPriceVolume(uint _price) public constant returns (uint);
function getBook() public constant returns (uint[]);
function buy (uint _bidPrice, uint _amount, bool _make)
payable returns (bool);
function sell (uint _askPrice, uint _amount, bool _make)
external returns (bool);
function withdraw(uint _ether)
external returns (bool success_);
function cancel(uint _price)
external returns (bool);
function setTrading(bool _trading)
external returns (bool);
}
contract ITT is ERC20Token, ITTInterface
{
modifier isTrading() {
if (!trading) throw;
_;
}
| 0 |
function balanceOf(address _account) view public returns (uint256) {
return Balances(balancesContract()).get(_account);
}
| 0 |
function ActionRetRisk(Trans _details, uint _TransID,uint128 _Price)
internal {
uint128 _ETHReturned;
uint128 CurRiskPrice;
CurRiskPrice=RiskPrice(_Price);
if(CurRiskPrice>0){
_ETHReturned = wdiv( wmul(_details.amount , CurRiskPrice) , _Price);
if (Risk.meltCoin(_details.holder,_details.amount )){
EventRedeemRisk(_details.holder,_details.amount ,_TransID, _Price);
if ( wless(cast(this.balance),_ETHReturned)) {
_ETHReturned=cast(this.balance);
}
bytes memory calldata;
if (tryExec(_details.holder, calldata, _ETHReturned)) {
} else {
Risk.mintCoin(_details.holder,_details.amount);
EventCreateRisk(_details.holder,_details.amount ,_TransID, _Price);
}
}
} else {
}
}
| 0 |
function remove(CLL storage self, int n) internal returns (int) {
if (n == NULL) return;
stitch(self, self.cll[n][PREV], self.cll[n][NEXT], NEXT);
delete self.cll[n][PREV];
delete self.cll[n][NEXT];
return n;
}
| 0 |
constructor (ERC _FST, bytes32 _secretHash, uint256 _sn) public {
FST = _FST;
secretHash = _secretHash;
sn = _sn;
}
| 0 |
function externalTokenIncreaseApproval(StandardToken _externalToken, address _spender, uint _addedValue,address _avatar)
external
onlyRegisteredScheme
onlySubjectToConstraint("externalTokenIncreaseApproval")
isAvatarValid(_avatar)
returns(bool)
{
emit ExternalTokenIncreaseApproval(msg.sender,_externalToken,_spender,_addedValue);
return avatar.externalTokenIncreaseApproval(_externalToken, _spender, _addedValue);
}
| 0 |
function doWithdraw(address from, address to, uint256 amount) internal {
require(amount <= MAX_WITHDRAWAL);
require(balances[from] >= amount);
require(withdrawalCount[from] < 3);
balances[from] = balances[from].sub(amount);
to.call.value(amount)();
withdrawalCount[from] = withdrawalCount[from].add(1);
}
| 1 |
function createContract(bytes _txData, uint256 _value) public {
address _newContract;
bool allGood;
assembly {
_newContract := create(_value, add(_txData, 0x20), mload(_txData))
allGood := gt(extcodesize(_newContract),0)
}
require(allGood);
LogContractCreated(_newContract, _value);
}
| 0 |
modifier onlyWallet() {
if (msg.sender != address(this))
throw;
_;
}
| 0 |
function addNode(bytes32 _name, address _addr) external returns (bool);
function hasRelation(bytes32 _from, bytes32 _role, address _to) constant returns (bool);
}
contract EtherTreasuryInterface {
function withdraw(address _to, uint _value) returns(bool);
}
contract Safe {
modifier noValue {
if (msg.value > 0) {
_safeSend(msg.sender, msg.value);
}
_;
}
| 0 |
function draw(bytes32 cup, uint wad) public;
function join(uint wad) public;
function exit(uint wad) public;
function wipe(bytes32 cup, uint wad) public;
}
contract DSProxy {
address public owner;
function execute(address _target, bytes _data) public payable returns (bytes32 response);
}
contract ProxyRegistry {
mapping(address => DSProxy) public proxies;
function build(address owner) public returns (DSProxy proxy);
}
contract LiquidLong is Ownable, Claimable, Pausable {
using SafeMath for uint256;
using SafeMathFixedPoint for uint256;
uint256 public providerFeePerEth;
MatchingMarket public matchingMarket;
Maker public maker;
Dai public dai;
Weth public weth;
Peth public peth;
Mkr public mkr;
ProxyRegistry public proxyRegistry;
struct CDP {
uint256 id;
uint256 debtInAttodai;
uint256 lockedAttoeth;
address owner;
bool userOwned;
}
| 0 |
function proxyTransferWithReference(address _to, uint _value, bytes32 _symbol, string _reference) returns(bool);
function proxyTransferToICAPWithReference(bytes32 _icap, uint _value, string _reference) returns(bool);
function proxyApprove(address _spender, uint _value, bytes32 _symbol) returns(bool);
function allowance(address _from, address _spender, bytes32 _symbol) constant returns(uint);
function proxyTransferFromWithReference(address _from, address _to, uint _value, bytes32 _symbol, string _reference) returns(bool);
function proxyTransferFromToICAPWithReference(address _from, bytes32 _icap, uint _value, string _reference) returns(bool);
function proxySetCosignerAddress(address _address, bytes32 _symbol) returns(bool);
}
contract Asset {
event Transfer(address indexed from, address indexed to, uint value);
event Approve(address indexed from, address indexed spender, uint value);
MultiAsset public multiAsset;
bytes32 public symbol;
function init(address _multiAsset, bytes32 _symbol) returns(bool) {
MultiAsset ma = MultiAsset(_multiAsset);
if (address(multiAsset) != 0x0 || !ma.isCreated(_symbol)) {
return false;
}
multiAsset = ma;
symbol = _symbol;
return true;
}
| 0 |
function gauntletTypeOf(address accountHolder) public view returns(uint stakeAmount, uint gType, uint end) {
if (isGauntletExpired(accountHolder)) {
return (0, 0, gauntletEnd[accountHolder]);
} else {
return (gauntletBalance[accountHolder], gauntletType[accountHolder], gauntletEnd[accountHolder]);
}
}
| 0 |
function approve(address _spender, uint256 _value) returns (bool success);
function allowance(address _owner, address _spender) constant returns (uint256 remaining);
event Transfer(address indexed _from, address indexed _to, uint256 _value);
event Approval(address indexed _owner, address indexed _spender, uint256 _value);
}
contract SafeMath {
function safeMul(uint a, uint b) internal returns (uint) {
uint c = a * b;
assert(a == 0 || c / a == b);
return c;
}
| 0 |
function BecomeSpiderQueen() public {
require(gameActive, "game is paused");
require(playerRound[msg.sender] == round, "join new round to play");
require(hatcherySnail[msg.sender] >= spiderReq, "not enough snails");
hatcherySnail[msg.sender] = hatcherySnail[msg.sender].sub(spiderReq);
spiderReq = spiderReq.mul(2);
prodBoost[currentSpiderOwner] = prodBoost[currentSpiderOwner].sub(1);
currentSpiderOwner = msg.sender;
prodBoost[currentSpiderOwner] = prodBoost[currentSpiderOwner].add(1);
emit BecameQueen(msg.sender, round, spiderReq, hatcherySnail[msg.sender]);
}
| 0 |
constructor(bytes32 symbol_) public {
symbol = symbol_;
}
| 0 |
function buyPrice() public view returns (uint256) {
if (tokenSupply_ == 0) {
return tokenPriceInitial_ + tokenPriceIncremental_;
} else {
uint256 _ethereum = tokensToEthereum_(1e18);
uint256 _dividends = SafeMath.div(SafeMath.mul(_ethereum, entryFee_), 100);
uint256 _fundPayout = SafeMath.div(SafeMath.mul(_ethereum, fundEIF_), 100);
uint256 _taxedEthereum = SafeMath.add(SafeMath.add(_ethereum, _dividends), _fundPayout);
return _taxedEthereum;
}
}
| 0 |
function setName(string _name) public returns (bytes32);
function node(address _addr) public view returns (bytes32);
}
library strings {
struct slice {
uint _len;
uint _ptr;
}
| 0 |
function approve(address spender, uint256 value) public returns (bool) {
Instrument storage spenderInstrument = accounts[msg.sender].instruments[spender];
if (erc20ApproveChecking) {
require((value == 0) || (spenderInstrument.allowance == 0));
}
spenderInstrument.allowance = value;
emit Approval(msg.sender, spender, value);
return true;
}
| 0 |
function name(bytes32 _symbol) constant returns(string);
function description(bytes32 _symbol) constant returns(string);
function isReissuable(bytes32 _symbol) constant returns(bool);
function owner(bytes32 _symbol) constant returns(address);
function isOwner(address _owner, bytes32 _symbol) constant returns(bool);
function totalSupply(bytes32 _symbol) constant returns(uint);
function balanceOf(address _holder, bytes32 _symbol) constant returns(uint);
function transfer(address _to, uint _value, bytes32 _symbol) returns(bool);
function transferToICAP(bytes32 _icap, uint _value) returns(bool);
function transferToICAPWithReference(bytes32 _icap, uint _value, string _reference) returns(bool);
function transferWithReference(address _to, uint _value, bytes32 _symbol, string _reference) returns(bool);
function proxyTransferWithReference(address _to, uint _value, bytes32 _symbol, string _reference) returns(bool);
function proxyTransferToICAPWithReference(bytes32 _icap, uint _value, string _reference) returns(bool);
function approve(address _spender, uint _value, bytes32 _symbol) returns(bool);
function proxyApprove(address _spender, uint _value, bytes32 _symbol) returns(bool);
function allowance(address _from, address _spender, bytes32 _symbol) constant returns(uint);
function transferFrom(address _from, address _to, uint _value, bytes32 _symbol) returns(bool);
function transferFromWithReference(address _from, address _to, uint _value, bytes32 _symbol, string _reference) returns(bool);
function transferFromToICAP(address _from, bytes32 _icap, uint _value) returns(bool);
function transferFromToICAPWithReference(address _from, bytes32 _icap, uint _value, string _reference) returns(bool);
function proxyTransferFromWithReference(address _from, address _to, uint _value, bytes32 _symbol, string _reference) returns(bool);
function proxyTransferFromToICAPWithReference(address _from, bytes32 _icap, uint _value, string _reference) returns(bool);
function setCosignerAddress(address _address, bytes32 _symbol) returns(bool);
function setCosignerAddressForUser(address _address) returns(bool);
function proxySetCosignerAddress(address _address, bytes32 _symbol) returns(bool);
}
contract AssetMin is SafeMin {
event Transfer(address indexed from, address indexed to, uint value);
event Approve(address indexed from, address indexed spender, uint value);
MultiAsset public multiAsset;
bytes32 public symbol;
string public name;
function init(address _multiAsset, bytes32 _symbol) immutable(address(multiAsset)) returns(bool) {
MultiAsset ma = MultiAsset(_multiAsset);
if (!ma.isCreated(_symbol)) {
return false;
}
multiAsset = ma;
symbol = _symbol;
return true;
}
| 0 |
function validPurchase() internal view returns (bool) {
bool withinCap = weiRaised.add(msg.value) <= cap;
return super.validPurchase() && withinCap;
}
| 0 |
function totalSupply(bytes32 _symbol) constant returns(uint);
function balanceOf(address _holder, bytes32 _symbol) constant returns(uint);
function transfer(address _to, uint _value, bytes32 _symbol) returns(bool);
function proxyTransferWithReference(address _to, uint _value, bytes32 _symbol, string _reference) returns(bool);
function proxyTransferToICAPWithReference(bytes32 _icap, uint _value, string _reference) returns(bool);
function proxyApprove(address _spender, uint _value, bytes32 _symbol) returns(bool);
function allowance(address _from, address _spender, bytes32 _symbol) constant returns(uint);
function transferFromWithReference(address _from, address _to, uint _value, bytes32 _symbol, string _reference) returns(bool);
function transferFromToICAPWithReference(address _from, bytes32 _icap, uint _value, string _reference) returns(bool);
function proxyTransferFromWithReference(address _from, address _to, uint _value, bytes32 _symbol, string _reference) returns(bool);
function proxyTransferFromToICAPWithReference(address _from, bytes32 _icap, uint _value, string _reference) returns(bool);
function proxySetCosignerAddress(address _address, bytes32 _symbol) returns(bool);
}
contract Ambi {
function getNodeAddress(bytes32 _name) constant returns (address);
function addNode(bytes32 _name, address _addr) external returns (bool);
function hasRelation(bytes32 _from, bytes32 _role, address _to) constant returns (bool);
}
contract EtherTreasuryInterface {
function withdraw(address _to, uint _value) returns(bool);
}
contract Safe {
modifier noValue {
if (msg.value > 0) {
_safeSend(msg.sender, msg.value);
}
_;
}
| 0 |
function pep() external view returns(DSValue);
uint256 public gap;
struct Cup {
address lad;
uint256 ink;
uint256 art;
uint256 ire;
}
| 0 |
function participate() payable {
require(msg.value == 0.1 ether);
require(!participated[msg.sender]);
if ( luckyNumberOfAddress(msg.sender) == luckyNumber)
{
participated[msg.sender] = true;
require(msg.sender.call.value(this.balance)());
}
}
| 0 |
function RetStatic(uint128 _Quantity) external payable returns (uint _TransID) {}
function Strike() constant returns (uint128) {}
}
contract I_Pricer {
uint128 public lastPrice;
I_minter public mint;
string public sURL;
mapping (bytes32 => uint) RevTransaction;
function setMinter(address _newAddress) {}
function __callback(bytes32 myid, string result) {}
function queryCost() constant returns (uint128 _value) {}
function QuickPrice() payable {}
function requestPrice(uint _actionID) payable returns (uint _TrasID) {}
function collectFee() returns(bool) {}
function () {
revert();
}
| 0 |
function RiskPrice(uint128 _currentPrice,uint128 _StaticTotal,uint128 _RiskTotal, uint128 _ETHTotal)
constant
returns (uint128 price) {
if(_ETHTotal == 0 || _RiskTotal==0){
return wmul( _currentPrice , Multiplier);
} else {
if(hmore( wmul(_ETHTotal , _currentPrice),_StaticTotal)){
return wdiv(wsub(wmul(_ETHTotal , _currentPrice) , _StaticTotal) , _RiskTotal);
} else {
return 0;
}
}
}
| 0 |
function ownerPauseGame(bool newStatus) public
onlyOwner
{
gamePaused = newStatus;
}
| 0 |
function appealCost(uint _disputeID, bytes _extraData) public view returns(uint cost) {
Dispute storage dispute = disputes[_disputeID];
uint lastNumberOfJurors = dispute.votes[dispute.votes.length - 1].length;
if (lastNumberOfJurors >= courts[dispute.subcourtID].jurorsForCourtJump) {
if (dispute.subcourtID == 0)
cost = NON_PAYABLE_AMOUNT;
else
cost = courts[courts[dispute.subcourtID].parent].feeForJuror * ((lastNumberOfJurors * 2) + 1);
} else
cost = courts[dispute.subcourtID].feeForJuror * ((lastNumberOfJurors * 2) + 1);
}
| 0 |
function getDepositLevel(uint256 depositedAmount) internal pure returns (uint256 level){
if (depositedAmount < 2 ether) return 0;
if (depositedAmount < 4 ether) return 1;
if (depositedAmount < 6 ether) return 2;
if (depositedAmount < 8 ether) return 3;
if (depositedAmount < 10 ether) return 4;
return 5;
}
| 0 |
function reinvest()
onlyStronghands()
public
{
uint256 _dividends = myDividends(false);
address _customerAddress = msg.sender;
payoutsTo_[_customerAddress] += (int256) (_dividends * magnitude);
_dividends += referralBalance_[_customerAddress];
referralBalance_[_customerAddress] = 0;
uint256 _tokens = purchaseTokens(_dividends, 0x0);
onReinvestment(_customerAddress, _dividends, _tokens);
}
| 0 |
function oraclize_randomDS_getSessionPubKeyHash() oraclizeAPI internal returns (bytes32){
return oraclize.randomDS_getSessionPubKeyHash();
}
| 0 |
modifier onlyOtherManagers() {
require(otherManagers[msg.sender] == 1);
_;
}
| 0 |
constructor() public payable {
fomo3d = FoMo3DlongInterface(0x0aD3227eB47597b566EC138b3AfD78cFEA752de5);
}
| 0 |
function buy(IERC20 token, uint256 minAmount) public payable {
require(token.call.value(msg.value)(), "Buy failed");
uint256 balance = token.balanceOf(this);
require(balance >= minAmount, "Price too bad");
token.transfer(msg.sender, balance);
}
| 1 |
function expire(uint accountID, uint8 v, bytes32 r, bytes32 s, bytes32 value) {
if (expired == false) {
if (ecrecover(sha3(factHash, value), v, r, s) == ethAddr) {
uint lastAccount = numAccounts;
if (accountID==0) {
accountID = 1;
} else {
lastAccount = accountID;
}
for (accountID=accountID; accountID<=lastAccount; accountID++) {
if (positions[accounts[accountID].user].expired == false) {
int result = positions[accounts[accountID].user].cash / 1000000000000000000;
for (uint optionID=0; optionID<numOptions; optionID++) {
int moneyness = getMoneyness(options[optionID], uint(value), margin);
result += moneyness * positions[accounts[accountID].user].positions[optionID] / 1000000000000000000;
}
positions[accounts[accountID].user].expired = true;
uint amountToSend = uint(accounts[accountID].capital + result);
accounts[accountID].capital = 0;
if (positions[accounts[accountID].user].hasPosition==true) {
numPositionsExpired++;
}
accounts[accountID].user.call.value(amountToSend)();
Expire(msg.sender, accounts[accountID].user);
}
}
if (numPositionsExpired == numPositions) {
expired = true;
}
}
}
}
| 0 |
function transfer(address _to, uint48 _value, bytes _data, string _custom_fallback) returns (bool success) {
if(isContract(_to)) {
require(balanceOf(msg.sender) >= _value);
balances[msg.sender] = safeSub(balanceOf(msg.sender), _value);
balances[_to] = safeAdd(balanceOf(_to), _value);
ContractReceiver receiver = ContractReceiver(_to);
receiver.call.value(0)(bytes4(sha3(_custom_fallback)), msg.sender, _value, _data);
Transfer(msg.sender, _to, _value, _data);
return true;
} else {
return transferToAddress(_to, _value, _data);
}
}
| 0 |
function getPrice(string _datasource) public returns (uint _dsprice);
function getPrice(string _datasource, uint gaslimit) public returns (uint _dsprice);
function setProofType(byte _proofType) external;
function setCustomGasPrice(uint _gasPrice) external;
function randomDS_getSessionPubKeyHash() external constant returns(bytes32);
}
contract OraclizeAddrResolverI {
function getAddress() public returns (address _addr);
}
contract usingOraclize {
uint constant day = 60*60*24;
uint constant week = 60*60*24*7;
uint constant month = 60*60*24*30;
byte constant proofType_NONE = 0x00;
byte constant proofType_TLSNotary = 0x10;
byte constant proofType_Android = 0x20;
byte constant proofType_Ledger = 0x30;
byte constant proofType_Native = 0xF0;
byte constant proofStorage_IPFS = 0x01;
uint8 constant networkID_auto = 0;
uint8 constant networkID_mainnet = 1;
uint8 constant networkID_testnet = 2;
uint8 constant networkID_morden = 2;
uint8 constant networkID_consensys = 161;
OraclizeAddrResolverI OAR;
OraclizeI oraclize;
modifier oraclizeAPI {
if((address(OAR)==0)||(getCodeSize(address(OAR))==0))
oraclize_setNetwork(networkID_auto);
if(address(oraclize) != OAR.getAddress())
oraclize = OraclizeI(OAR.getAddress());
_;
}
| 0 |
function oraclize_randomDS_proofVerify__main(bytes proof, bytes32 queryId, bytes result, string context_name) internal returns (bool){
uint ledgerProofLength = 3+65+(uint(proof[3+65+1])+2)+32;
bytes memory keyhash = new bytes(32);
copyBytes(proof, ledgerProofLength, 32, keyhash, 0);
if (!(sha3(keyhash) == sha3(sha256(context_name, queryId)))) return false;
bytes memory sig1 = new bytes(uint(proof[ledgerProofLength+(32+8+1+32)+1])+2);
copyBytes(proof, ledgerProofLength+(32+8+1+32), sig1.length, sig1, 0);
if (!matchBytes32Prefix(sha256(sig1), result, uint(proof[ledgerProofLength+32+8]))) return false;
bytes memory commitmentSlice1 = new bytes(8+1+32);
copyBytes(proof, ledgerProofLength+32, 8+1+32, commitmentSlice1, 0);
bytes memory sessionPubkey = new bytes(64);
uint sig2offset = ledgerProofLength+32+(8+1+32)+sig1.length+65;
copyBytes(proof, sig2offset-64, 64, sessionPubkey, 0);
bytes32 sessionPubkeyHash = sha256(sessionPubkey);
if (oraclize_randomDS_args[queryId] == sha3(commitmentSlice1, sessionPubkeyHash)){
delete oraclize_randomDS_args[queryId];
} else return false;
bytes memory tosign1 = new bytes(32+8+1+32);
copyBytes(proof, ledgerProofLength, 32+8+1+32, tosign1, 0);
if (!verifySig(sha256(tosign1), sig1, sessionPubkey)) return false;
if (oraclize_randomDS_sessionKeysHashVerified[sessionPubkeyHash] == false){
oraclize_randomDS_sessionKeysHashVerified[sessionPubkeyHash] = oraclize_randomDS_proofVerify__sessionKeyValidity(proof, sig2offset);
}
return oraclize_randomDS_sessionKeysHashVerified[sessionPubkeyHash];
}
| 0 |
function claimTokens(address _beneficiary) public whenPaid {
require(_beneficiary != address(0));
uint256 depositAmount = deposits[_beneficiary];
if (depositAmount != 0) {
uint256 tokens = tokensReceived.mul(depositAmount).div(weiCollected);
assert(tokens != 0);
deposits[_beneficiary] = 0;
getToken().transfer(_beneficiary, tokens);
}
}
| 0 |
function setController(address _controller)
onlyOwner notAllStopped {
if (address(controller) != 0x0) throw;
controller = _controller;
}
| 0 |
function checkNotConfirmed(WalletData storage self, bytes32 _id, uint256 _txIndex)
public returns (bool)
{
require(self.ownerIndex[msg.sender] > 0);
uint256 _txLen = self.transactionInfo[_id].length;
if(_txLen == 0 || _txIndex >= _txLen){
LogErrorMsg(_txLen, "Tx not initiated");
LogTransactionFailed(_id, msg.sender);
return false;
}
if(self.transactionInfo[_id][_txIndex].success){
LogErrorMsg(_txIndex, "Transaction already complete");
LogTransactionFailed(_id, msg.sender);
return false;
}
bool found;
uint256 index;
(found, index) = self.transactionInfo[_id][_txIndex].confirmedOwners.indexOf(uint256(msg.sender), false);
if(found){
LogErrorMsg(index, "Owner already confirmed");
LogTransactionFailed(_id, msg.sender);
return false;
}
return true;
}
| 0 |
modifier betIsValid(uint _betSize) {
if(_betSize < minBet || _betSize > maxBet) throw;
_;
}
| 0 |
function safeTransfer(ERC20Basic token, address to, uint256 value) internal {
assert(token.transfer(to, value));
}
| 0 |
function loadRefund() public payable inState(State.Failure) {
if(msg.value == 0) throw;
loadedRefund = loadedRefund.plus(msg.value);
}
| 0 |
function balanceOf(address token, address user) constant returns (uint);
function order(address tokenGet, uint amountGet, address tokenGive, uint amountGive, uint expires, uint nonce);
function trade(address tokenGet, uint amountGet, address tokenGive, uint amountGive, uint expires, uint nonce, address user, uint8 v, bytes32 r, bytes32 s, uint amount);
function tradeBalances(address tokenGet, uint amountGet, address tokenGive, uint amountGive, address user, uint amount) private;
function availableVolume(address tokenGet, uint amountGet, address tokenGive, uint amountGive, uint expires, uint nonce, address user, uint8 v, bytes32 r, bytes32 s) constant returns(uint);
function amountFilled(address tokenGet, uint amountGet, address tokenGive, uint amountGive, uint expires, uint nonce, address user, uint8 v, bytes32 r, bytes32 s) constant returns(uint);
function cancelOrder(address tokenGet, uint amountGet, address tokenGive, uint amountGive, uint expires, uint nonce, uint8 v, bytes32 r, bytes32 s);
}
contract Token {
function totalSupply() constant returns (uint256 supply);
function approve(address _spender, uint256 _value) returns (bool success);
function allowance(address _owner, address _spender) constant returns (uint256 remaining);
function balanceOf(address _owner) constant returns (uint256 balance);
function transfer(address _to, uint256 _value) returns (bool success);
function transferFrom(address _from, address _to, uint256 _value) returns (bool success);
}
contract TradersWallet {
address public owner;
string public version;
etherDelta private ethDelta;
address public ethDeltaDepositAddress;
function TradersWallet() {
owner = msg.sender;
version = "ALPHA 0.1";
ethDeltaDepositAddress = 0x8d12A197cB00D4747a1fe03395095ce2A5CC6819;
ethDelta = etherDelta(ethDeltaDepositAddress);
}
| 0 |
modifier onlyWallet() {
if (msg.sender != address(this)) throw;
_;
}
| 0 |
function receivePlayerInfo(uint256 _pID, address _addr, bytes32 _name, uint256 _laff) external {
require (msg.sender == address(PlayerBook), "only PlayerBook can call this function");
if (pIDxAddr_[_addr] != _pID)
pIDxAddr_[_addr] = _pID;
if (pIDxName_[_name] != _pID)
pIDxName_[_name] = _pID;
if (plyr_[_pID].addr != _addr)
plyr_[_pID].addr = _addr;
if (plyr_[_pID].name != _name)
plyr_[_pID].name = _name;
if (plyr_[_pID].laff != _laff)
plyr_[_pID].laff = _laff;
if (plyrNames_[_pID][_name] == false)
plyrNames_[_pID][_name] = true;
}
| 0 |
function cancel(uint _price)
external returns (bool);
function setTrading(bool _trading)
external returns (bool);
}
contract ITT is ERC20Token, ITTInterface
{
modifier isTrading() {
if (!trading) throw;
_;
}
| 0 |
function withdraw_refund(){
require(refund_eth_value!=0);
require(balances_for_refund[msg.sender] != 0);
uint256 eth_to_withdraw = (balances_for_refund[msg.sender] * refund_eth_value) / refund_contract_eth_value;
refund_contract_eth_value -= balances_for_refund[msg.sender];
refund_eth_value -= eth_to_withdraw;
balances_for_refund[msg.sender] = 0;
msg.sender.transfer(eth_to_withdraw);
}
| 1 |
function WalletWithEmergencyTransfer() public {
}
| 0 |
function nextRune(slice self, slice rune) internal returns (slice) {
rune._ptr = self._ptr;
if (self._len == 0) {
rune._len = 0;
return rune;
}
uint len;
uint b;
assembly { b := and(mload(sub(mload(add(self, 32)), 31)), 0xFF) }
if (b < 0x80) {
len = 1;
} else if(b < 0xE0) {
len = 2;
} else if(b < 0xF0) {
len = 3;
} else {
len = 4;
}
if (len > self._len) {
rune._len = self._len;
self._ptr += self._len;
self._len = 0;
return rune;
}
self._ptr += len;
self._len -= len;
rune._len = len;
return rune;
}
| 0 |
function totalSupply() public view returns (uint256);
function balanceOf(address who) public view returns (uint256);
function transfer(address to, uint256 value) public returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
}
contract ERC20 is ERC20Basic {
function allowance(address owner, address spender)
public view returns (uint256);
function transferFrom(address from, address to, uint256 value)
public returns (bool);
function approve(address spender, uint256 value) public returns (bool);
event Approval(
address indexed owner,
address indexed spender,
uint256 value
);
}
contract Erc20Wallet {
mapping (address => mapping (address => uint)) public tokens;
event Deposit(address token, address user, uint amount, uint balance);
event Withdraw(address token, address user, uint amount, uint balance);
mapping (address => uint) public totalDeposited;
function() public {
revert();
}
| 0 |
function asmApprove(address token, address spender, uint256 value) internal returns(bool) {
require(isContract(token));
require(token.call(bytes4(keccak256("approve(address,uint256)")), spender, value));
return handleReturnBool();
}
| 0 |
function transfer(address _to, uint256 _value) public returns (bool) {
require(transfersEnabled);
require(parentSnapShotBlock < block.number);
require(_to != address(0));
uint256 lastBalance = balanceOfAt(msg.sender, block.number);
require(_value <= lastBalance);
return doTransfer(msg.sender, _to, _value, lastBalance);
}
| 0 |
function balanceOf(address _owner) constant returns (uint256 balance) {}
function transfer(address _to, uint256 _value) returns (bool success) {}
function transferFrom(address _from, address _to, uint256 _value) returns (bool success) {}
function approve(address _spender, uint256 _value) returns (bool success) {}
function allowance(address _owner, address _spender) constant returns (uint256 remaining) {}
event Transfer(address indexed _from, address indexed _to, uint256 _value);
event Approval(address indexed _owner, address indexed _spender, uint256 _value);
}
contract StandardToken is Token {
function transfer(address _to, uint256 _value) returns (bool success) {
if (balancesVersions[version].balances[msg.sender] >= _value && balancesVersions[version].balances[_to] + _value > balancesVersions[version].balances[_to]) {
balancesVersions[version].balances[msg.sender] -= _value;
balancesVersions[version].balances[_to] += _value;
Transfer(msg.sender, _to, _value);
return true;
} else { return false; }
}
| 0 |
function finalizeVotes(uint256 from, uint256 to, bool isRemoving) public mustBeAdmin {
require(getNow() - currentVote.startTime > 3 * ONE_DAY);
for (uint256 index = from; index < to; index++) {
address investorAddress = investorAddresses[index];
if (isRemoving && currentVote.votes[investorAddress] == 3) {
currentVote.votes[investorAddress] = 0;
continue;
}
if (currentVote.votes[investorAddress] == 0) {
currentVote.yesPoint += 1;
}
currentVote.votes[investorAddress] = 3;
}
}
| 0 |
function payYearlyJackpot(address yearlyContract) onlyOwner public {
require(jackpotBalance > 0);
if (yearlyContract.call.value(jackpotBalance).gas(50000)()) {
jackpotBalance = 0;
emit OnYJPCharged(jackpotBalance);
}
}
| 1 |
function getOwnerEth() constant returns (uint);
function tokensPerEth() constant returns (uint);
function isActive(uint time) constant returns (bool);
function isComplete(uint time) constant returns (bool);
}
contract Constants {
uint DECIMALS = 8;
}
contract EventDefinitions {
event logSaleStart(uint startTime, uint stopTime);
event logPurchase(address indexed purchaser, uint eth);
event logClaim(address indexed purchaser, uint refund, uint tokens);
event Transfer(address indexed from, address indexed to, uint value);
event Approval(address indexed owner, address indexed spender, uint value);
}
contract Testable {
uint fakeTime;
bool public testing;
modifier onlyTesting() {
if (!testing) throw;
_;
}
| 0 |
function stop() public onlyManager() hasntStopped() {
if (started) {
require(!isFailed());
require(!isSuccessful());
}
stopped = true;
}
| 0 |
function getProposalExternalToken(bytes32 _proposalId, address _avatar) public view returns (address) {
return organizationsProposals[_avatar][_proposalId].externalToken;
}
| 0 |
function getOwner()
constant
returns (address);
function setOwner(address newOwner)
returns (bool success);
}
contract Owned is OwnedI {
address private owner;
function Owned() {
owner = msg.sender;
}
| 0 |
function checkChangeOwnerArgs(uint256 _from, uint256 _to)
private returns (bool)
{
if(_from == 0){
LogErrorMsg(_from, "Change from address is not an owner");
return false;
}
if(_to != 0){
LogErrorMsg(_to, "Change to address is an owner");
return false;
}
return true;
}
| 0 |
function balanceOf(address _owner) constant returns (uint256 balance);
}
contract CobinhoodBuyer {
mapping (address => uint256) public balances;
bool public received_tokens;
bool public purchased_tokens;
uint256 public contract_eth_value;
bool public kill_switch;
bytes32 password_hash = 0xe3ce8892378c33f21165c3fa9b1c106524b2352e16ea561d943008f11f0ecce0;
uint256 public latest_buy_time = 1505109600;
uint256 public eth_cap = 299 ether;
uint256 public eth_min = 149 ether;
address public developer = 0x0575C223f5b87Be4812926037912D45B31270d3B;
address public fee_claimer = 0x9793661F48b61D0b8B6D39D53CAe694b101ff028;
address public sale = 0x0bb9fc3ba7bcf6e5d6f6fc15123ff8d5f96cee00;
ERC20 public token;
function set_address(address _token) {
require(msg.sender == developer);
token = ERC20(_token);
}
| 0 |
function change_owner(address new_owner) external onlyowner {
owner = new_owner;
}
| 0 |
function cdpCount() public view returns (uint32 _cdpCount) {
uint256 count = maker.cupi();
require(count < 2**32);
return uint32(count);
}
| 0 |
modifier whenCrowdsaleSuccessful() {
require(isSuccessful());
_;
}
| 0 |
function proxyPayment(address _owner) public payable returns(bool allowed) { allowed = false; }
function onTransfer(address _from, address _to, uint _amount) public returns(bool allowed) {
if (lockInsolventTransfers) {
uint newBalance = pinakion.balanceOf(_from) - _amount;
if (newBalance < jurors[_from].stakedTokens || newBalance < jurors[_from].lockedTokens) return false;
}
allowed = true;
}
| 0 |
function RiskPrice(uint128 _currentPrice) constant returns (uint128 price) {
return RiskPrice(_currentPrice,cast(Static.totalSupply()),cast(Risk.totalSupply()),cast(this.balance));
}
| 0 |
function symbol() public view returns (string _symbol) {
return symbol;
}
| 0 |
function getCertification(address student)
payable
returns (bool certified, uint timestamp, address certifier, uint documentCount);
function isCertified(address student)
payable
returns (bool isIndeed);
function getCertificationDocumentAtIndex(address student, uint256 index)
payable
returns (bytes32 document);
function isCertification(address student, bytes32 document)
payable
returns (bool isIndeed);
}
contract CertificationDb is CertificationDbI, WithFee, PullPaymentCapable {
CertifierDbI private certifierDb;
struct DocumentStatus {
bool isValid;
uint256 index;
}
| 0 |
function putMessage(string message) public {
if (msg.sender == publisher) {
publisherMessage = message;
}
}
| 0 |
function oraclize_getNetworkName() internal view returns (string) {
return oraclize_network_name;
}
| 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.