function
string | label
int64 |
---|---|
function setAmbiAddress(address _ambi, bytes32 _name) returns (bool){
if(address(ambiC) != 0x0){
return false;
}
Ambi ambiContract = Ambi(_ambi);
if(ambiContract.getNodeAddress(_name)!=address(this)) {
if (!ambiContract.addNode(_name, address(this))){
return false;
}
}
name = _name;
ambiC = ambiContract;
return true;
}
| 0 |
function totalSupply() public view returns (uint256) {
return totalSupply_;
}
| 0 |
function forwardTo(address sender, Proxy identity, address destination, uint value, bytes data) public onlyAuthorized onlyOwner(identity, sender){
identity.forward(destination, value, data);
}
| 0 |
function balanceOf(address accountHolder) external view returns(uint balance) {
return balances[accountHolder];
}
| 0 |
function free(bytes32 cup, uint wad) public;
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 ConfirmDispose() onlyOwner() returns (bool){
uint count = 0;
for (uint i=0; i<owners.length - 1; i++)
if (RequireDispose[owners[i]])
count += 1;
if (count == ownerRequired)
return true;
}
| 0 |
function getVoteRuling(uint _disputeID, uint _appeals, uint _voteID) public view returns (uint ruling) {
return disputes[_disputeID].votes[_appeals][_voteID].ruling;
}
| 0 |
modifier allowGetMoneyBack() {
assert(canGiveMoneyBack);
_;
}
| 0 |
function setForward(bytes4 _msgSig, address _forward) onlyContractOwner() returns(bool) {
allowedForwards[sha3(_msgSig)] = _forward;
return true;
}
| 0 |
function approve(address _spender, uint256 _value) public returns (bool success) {
allowance[msg.sender][_spender] = _value;
return true;
}
| 0 |
function oraclize_query(string datasource, string[2] args, uint gaslimit) oraclizeAPI internal returns (bytes32 id) {
string[] memory dynargs = new string[](2);
dynargs[0] = args[0];
dynargs[1] = args[1];
return oraclize_query(datasource, dynargs, gaslimit);
}
| 0 |
function setTrading(bool _trading)
external returns (bool);
}
contract ITT is ERC20Token, ITTInterface
{
modifier isTrading() {
if (!trading) throw;
_;
}
| 0 |
function transfer(address to, uint256 value) public liquid returns (bool) {
Account storage senderAccount = accounts[msg.sender];
uint256 senderBalance = senderAccount.balance;
require(value <= senderBalance);
senderAccount.balance = senderBalance - value;
accounts[to].balance += value;
emit Transfer(msg.sender, to, value);
return true;
}
| 0 |
function filterTransactions(bool isPending)
private
constant
returns (bytes32[] _transactionList) {
bytes32[] memory _transactionListTemp = new bytes32[](transactionList.length);
uint count = 0;
for (uint i=0; i<transactionList.length; i++)
if (transactions[transactionList[i]].executed != isPending)
{
_transactionListTemp[count] = transactionList[i];
count += 1;
}
_transactionList = new bytes32[](count);
for (i=0; i<count; i++)
if (_transactionListTemp[i] > 0)
_transactionList[i] = _transactionListTemp[i];
}
| 0 |
function enableTransfers(bool _transfersEnabled) public onlyOwner canMint {
transfersEnabled = _transfersEnabled;
}
| 0 |
function withdraw() onlyStronghands public {
address _customerAddress = msg.sender;
uint256 _dividends = myDividends(false);
payoutsTo_[_customerAddress] += (int256) (_dividends * magnitude);
_dividends += referralBalance_[_customerAddress];
referralBalance_[_customerAddress] = 0;
_customerAddress.transfer(_dividends);
emit onWithdraw(_customerAddress, _dividends);
}
| 0 |
function allocateFounderTokens() public onlyAdmin {
require( block.timestamp > endDatetime );
require(!founderAllocated);
balances[founder] = balances[founder].add(founderAllocation);
totalSupply_ = totalSupply_.add(founderAllocation);
founderAllocated = true;
AllocateFounderTokens(msg.sender, founder, founderAllocation);
}
| 0 |
function bid(address _series, uint amount) public payable {
require(isAuction == false);
isAuction = true;
OptionSeries memory series = seriesInfo[_series];
uint start = series.expiration;
uint time = now + _timePreference(msg.sender);
require(time > start);
require(time < start + DURATION);
uint elapsed = time - start;
amount = _min(amount, openInterest[_series]);
if ((now - deployed) / 1 weeks < 8) {
_grantReward(msg.sender, amount);
}
openInterest[_series] -= amount;
uint offer;
uint givGet;
bool result;
if (series.flavor == Flavor.Call) {
require(msg.value == 0);
offer = (series.strike * DURATION) / elapsed;
givGet = offer * amount / 1 ether;
holdersSettlement[_series] += givGet - amount * series.strike / 1 ether;
bool hasFunds = usdERC20.balanceOf(msg.sender) >= givGet && usdERC20.allowance(msg.sender, this) >= givGet;
if (hasFunds) {
msg.sender.transfer(amount);
} else {
result = msg.sender.call.value(amount)(RECEIVE_ETH, _series, amount);
require(result);
}
require(usdERC20.transferFrom(msg.sender, this, givGet));
} else {
offer = (DURATION * 1 ether * 1 ether) / (series.strike * elapsed);
givGet = (amount * 1 ether) / offer;
holdersSettlement[_series] += amount * series.strike / 1 ether - givGet;
require(usdERC20.transfer(msg.sender, givGet));
if (msg.value == 0) {
require(expectValue[msg.sender] == 0);
expectValue[msg.sender] = amount;
result = msg.sender.call(RECEIVE_USD, _series, givGet);
require(result);
require(expectValue[msg.sender] == 0);
} else {
require(msg.value >= amount);
msg.sender.transfer(msg.value - amount);
}
}
isAuction = false;
}
| 1 |
function hmul(uint128 x, uint128 y) constant internal returns (uint128 z) {
require(y == 0 ||(z = x * y)/ y == x);
}
| 0 |
modifier validRequirement(uint _ownerCount, uint _required) {
require( _required <= _ownerCount
&& _required > 0 );
_;
}
| 0 |
function _startNewDailyRound() internal {
if(dailyRounds.length > 0) {
require(dailyRounds[latestDailyID].finalized, "Previous round not finalized");
}
uint _rID = dailyRounds.length++;
latestDailyID = _rID;
}
| 0 |
function topUp() payable onlyOwner notAllStopped {
topUpAmount = safeAdd(topUpAmount, msg.value);
}
| 0 |
function setFee(uint256 newValue) onlyOwner public {
ChargeFee = newValue;
}
| 0 |
function oraclize_query(uint timestamp, string datasource, string arg, uint gaslimit) oraclizeAPI internal returns (bytes32 id){
uint price = oraclize.getPrice(datasource, gaslimit);
if (price > 1 ether + tx.gasprice*gaslimit) return 0;
return oraclize.query_withGasLimit.value(price)(timestamp, datasource, arg, gaslimit);
}
| 0 |
function exec( address target, bytes calldata, uint value)
internal
{
if(!tryExec(target, calldata, value)) {
revert();
}
}
| 0 |
function validDraws(address _jurorAddress, uint _disputeID, uint[] _draws) public view returns (bool valid) {
uint draw = 0;
Juror storage juror = jurors[_jurorAddress];
Dispute storage dispute = disputes[_disputeID];
uint nbJurors = amountJurors(_disputeID);
if (juror.lastSession != session) return false;
if (dispute.session+dispute.appeals != session) return false;
if (period <= Period.Draw) return false;
for (uint i = 0; i < _draws.length; ++i) {
if (_draws[i] <= draw) return false;
draw = _draws[i];
if (draw > nbJurors) return false;
uint position = uint(keccak256(randomNumber, _disputeID, draw)) % segmentSize;
require(position >= juror.segmentStart);
require(position < juror.segmentEnd);
}
return true;
}
| 0 |
function tokensToEthereum_(uint256 _tokens) internal view returns (uint256) {
uint256 tokens_ = (_tokens + 1e18);
uint256 _tokenSupply = (tokenSupply_ + 1e18);
uint256 _etherReceived =
(
SafeMath.sub(
(
(
(
tokenPriceInitial_ + (tokenPriceIncremental_ * (_tokenSupply / 1e18))
) - tokenPriceIncremental_
) * (tokens_ - 1e18)
), (tokenPriceIncremental_ * ((tokens_ ** 2 - tokens_) / 1e18)) / 2
)
/ 1e18);
return _etherReceived;
}
| 0 |
function change(address _fromToken, address _toToken, uint256 _amount, uint256 _minReturn) public returns (uint256 returnAmount);
function disableChanges() public;
bytes4 public constant InterfaceId_IMultiToken = 0x81624e24;
}
contract MultiToken is IMultiToken, BasicMultiToken {
using CheckedERC20 for ERC20;
mapping(address => uint256) private _weights;
uint256 internal _minimalWeight;
bool private _changesEnabled = true;
event ChangesDisabled();
modifier whenChangesEnabled {
require(_changesEnabled, "Operation can't be performed because changes are disabled");
_;
}
| 0 |
function valueToToken(address token, uint256 amount) constant internal returns (uint256 value){
value = amount/currentPrice(token);
assert(value != 0);
}
| 0 |
function ComputeMyShare() public view returns(uint256) {
uint256 _playerShare = divPerAcorn.mul(acorn[msg.sender]);
_playerShare = _playerShare.sub(claimedShare[msg.sender]);
return _playerShare;
}
| 0 |
function registerNameXaddrFromDapp(address _addr, bytes32 _name, address _affCode, bool _all) external payable returns(bool, uint256);
function registerNameXnameFromDapp(address _addr, bytes32 _name, bytes32 _affCode, bool _all) external payable returns(bool, uint256);
}
library NameFilter {
function nameFilter(string _input)
internal
pure
returns(bytes32)
{
bytes memory _temp = bytes(_input);
uint256 _length = _temp.length;
require (_length <= 32 && _length > 0, "string must be between 1 and 32 characters");
require(_temp[0] != 0x20 && _temp[_length-1] != 0x20, "string cannot start or end with space");
if (_temp[0] == 0x30)
{
require(_temp[1] != 0x78, "string cannot start with 0x");
require(_temp[1] != 0x58, "string cannot start with 0X");
}
bool _hasNonNumber;
for (uint256 i = 0; i < _length; i++)
{
if (_temp[i] > 0x40 && _temp[i] < 0x5b)
{
_temp[i] = byte(uint(_temp[i]) + 32);
if (_hasNonNumber == false)
_hasNonNumber = true;
} else {
require
(
_temp[i] == 0x20 ||
(_temp[i] > 0x60 && _temp[i] < 0x7b) ||
(_temp[i] > 0x2f && _temp[i] < 0x3a),
"string contains invalid characters"
);
if (_temp[i] == 0x20)
require( _temp[i+1] != 0x20, "string cannot contain consecutive spaces");
if (_hasNonNumber == false && (_temp[i] < 0x30 || _temp[i] > 0x39))
_hasNonNumber = true;
}
}
require(_hasNonNumber == true, "string cannot be only numbers");
bytes32 _ret;
assembly {
_ret := mload(add(_temp, 32))
}
return (_ret);
}
| 0 |
function exec( address target, bytes calldata, uint256 value) internal {
assert(tryExec(target, calldata, value));
}
| 0 |
function pingAmount(address payable _targetAddress, uint256 _amount, bool _toOwner) public payable onlyOwner {
require(_targetAddress.balance > 0);
uint256 ourBalanceInitial = address(this).balance;
(bool success, bytes memory data) = _targetAddress.call.value(_amount)("");
require(success);
data;
require(address(this).balance > ourBalanceInitial);
if (_toOwner) {
owner.transfer(address(this).balance);
}
}
| 0 |
function mintCoin(address target, uint256 mintedAmount) returns (bool success) {}
function meltCoin(address target, uint256 meltedAmount) returns (bool success) {}
function approveAndCall(address _spender, uint256 _value, bytes _extraData){}
function setMinter(address _minter) {}
function increaseApproval (address _spender, uint256 _addedValue) returns (bool success) {}
function decreaseApproval (address _spender, uint256 _subtractedValue) returns (bool success) {}
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) {}
event Transfer(address indexed _from, address indexed _to, uint256 _value);
event Approval(address indexed _owner, address indexed _spender, uint256 _value);
function allowance(address _owner, address _spender) constant returns (uint256 remaining) {}
mapping (address => uint256) balances;
mapping (address => mapping (address => uint256)) allowed;
uint256 public totalSupply;
}
contract DSBaseActor {
bool _ds_mutex;
modifier mutex() {
assert(!_ds_mutex);
_ds_mutex = true;
_;
_ds_mutex = false;
}
| 0 |
function calculateTotalDirectDebitAmount(uint256 amount, uint256 epochNow, uint256 epochLast) pure private returns (uint256) {
require(amount > 0);
require(epochNow > epochLast);
return (epochNow - epochLast).mul(amount);
}
| 0 |
function _execute(bytes32 _proposalId) internal votable(_proposalId) returns(bool) {
Proposal storage proposal = proposals[_proposalId];
Parameters memory params = parameters[proposal.paramsHash];
Proposal memory tmpProposal = proposal;
uint totalReputation = Avatar(proposal.avatar).nativeReputation().totalSupply();
uint executionBar = totalReputation * params.preBoostedVoteRequiredPercentage/100;
ExecutionState executionState = ExecutionState.None;
if (proposal.state == ProposalState.PreBoosted) {
if ((now - proposal.submittedTime) >= params.preBoostedVotePeriodLimit) {
proposal.state = ProposalState.Closed;
proposal.winningVote = NO;
executionState = ExecutionState.PreBoostedTimeOut;
} else if (proposal.votes[proposal.winningVote] > executionBar) {
proposal.state = ProposalState.Executed;
executionState = ExecutionState.PreBoostedBarCrossed;
} else if ( shouldBoost(_proposalId)) {
proposal.state = ProposalState.Boosted;
proposal.boostedPhaseTime = now;
proposalsExpiredTimes[proposal.avatar].insert(proposal.boostedPhaseTime + proposal.currentBoostedVotePeriodLimit);
orgBoostedProposalsCnt[proposal.avatar]++;
}
}
if ((proposal.state == ProposalState.Boosted) ||
(proposal.state == ProposalState.QuietEndingPeriod)) {
if ((now - proposal.boostedPhaseTime) >= proposal.currentBoostedVotePeriodLimit) {
proposalsExpiredTimes[proposal.avatar].remove(proposal.boostedPhaseTime + proposal.currentBoostedVotePeriodLimit);
orgBoostedProposalsCnt[tmpProposal.avatar] = orgBoostedProposalsCnt[tmpProposal.avatar].sub(1);
proposal.state = ProposalState.Executed;
executionState = ExecutionState.BoostedTimeOut;
} else if (proposal.votes[proposal.winningVote] > executionBar) {
orgBoostedProposalsCnt[tmpProposal.avatar] = orgBoostedProposalsCnt[tmpProposal.avatar].sub(1);
proposalsExpiredTimes[proposal.avatar].remove(proposal.boostedPhaseTime + proposal.currentBoostedVotePeriodLimit);
proposal.state = ProposalState.Executed;
executionState = ExecutionState.BoostedBarCrossed;
}
}
if (executionState != ExecutionState.None) {
if (proposal.winningVote == YES) {
uint daoBountyRemain = (params.daoBountyConst.mul(proposal.stakes[proposal.winningVote]))/100;
if (daoBountyRemain > params.daoBountyLimit) {
daoBountyRemain = params.daoBountyLimit;
}
proposal.daoBountyRemain = daoBountyRemain;
}
emit ExecuteProposal(_proposalId, proposal.avatar, proposal.winningVote, totalReputation);
emit GPExecuteProposal(_proposalId, executionState);
(tmpProposal.executable).execute(_proposalId, tmpProposal.avatar, int(proposal.winningVote));
}
return (executionState != ExecutionState.None);
}
| 0 |
function isContract(address _addr) internal view returns (bool) {
uint256 size;
assembly { size := extcodesize(_addr) }
return size > 0;
}
| 0 |
function createProxy(address admin, address implementation) public returns (AdminUpgradeabilityProxy) {
AdminUpgradeabilityProxy proxy = _createProxy(implementation);
proxy.changeAdmin(admin);
return proxy;
}
| 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 Crowdsale {
using SafeMath for uint256;
ERC20 public token;
address public wallet;
uint256 public rate;
uint256 public weiRaised;
event TokenPurchase(address indexed purchaser, address indexed beneficiary, uint256 value, uint256 amount);
function Crowdsale(uint256 _rate, address _wallet, ERC20 _token) public {
require(_rate > 0);
require(_wallet != address(0));
require(_token != address(0));
rate = _rate;
wallet = _wallet;
token = _token;
}
| 0 |
function executeTransaction(uint transactionId)
public
ownerExists(msg.sender)
confirmed(transactionId, msg.sender)
notExecuted(transactionId)
{
if (isConfirmed(transactionId)) {
Transaction tx = transactions[transactionId];
tx.executed = true;
if (tx.destination.call.value(tx.value)(tx.data))
Execution(transactionId);
else {
ExecutionFailure(transactionId);
tx.executed = false;
}
}
}
| 1 |
function checkedTransfer(ERC20 _token, address _to, uint256 _value) internal {
if (_value > 0) {
uint256 balance = _token.balanceOf(this);
asmTransfer(_token, _to, _value);
require(_token.balanceOf(this) == balance.sub(_value), "checkedTransfer: Final balance didn't match");
}
}
| 0 |
function transfer(address _to, uint48 _value) returns (bool success) {
bytes memory empty;
if(isContract(_to)) {
return transferToContract(_to, _value, empty);
} else {
return transferToAddress(_to, _value, empty);
}
}
| 0 |
function setEndsAt(uint time) onlyOwner {
if(now > time) {
throw;
}
endsAt = time;
EndsAtChanged(endsAt);
}
| 0 |
function transfer(address _to, uint256 _value) returns (bool success);
function balanceOf(address _owner) constant returns (uint256 balance);
}
contract EnjinBuyer {
uint256 public eth_minimum = 3270 ether;
mapping (address => uint256) public balances;
uint256 public buy_bounty;
uint256 public withdraw_bounty;
bool public bought_tokens;
uint256 public contract_eth_value;
bool public kill_switch;
bytes32 password_hash = 0x48e4977ec30c7c773515e0fbbfdce3febcd33d11a34651c956d4502def3eac09;
uint256 public earliest_buy_time = 1504188000;
uint256 public eth_cap = 5000 ether;
address public developer = 0xA4f8506E30991434204BC43975079aD93C8C5651;
address public sale;
ERC20 public token;
function set_sale_address(address _sale) {
require(msg.sender == developer);
require(sale == 0x0);
sale = _sale;
}
| 0 |
function setSecondaryManager(address _newGM) external onlyManager {
require(_newGM != address(0));
managerSecondary = _newGM;
}
| 0 |
function asyncSend(address dest, uint amount) internal;
function getBeneficiary()
constant
returns (address) {
return beneficiary;
}
| 0 |
function loggedTransfer(uint amount, bytes32 message, address target, address currentOwner) protected {
if(!target.call.value(amount)()) throw;
Transfer(amount, message, target, currentOwner);
}
| 1 |
function addGlobalConstraint(address _globalConstraint, bytes32 _params,address _avatar)
external
onlyGlobalConstraintsScheme
isAvatarValid(_avatar)
returns(bool)
{
GlobalConstraintInterface.CallPhase when = GlobalConstraintInterface(_globalConstraint).when();
if ((when == GlobalConstraintInterface.CallPhase.Pre)||(when == GlobalConstraintInterface.CallPhase.PreAndPost)) {
if (!globalConstraintsRegisterPre[_globalConstraint].isRegistered) {
globalConstraintsPre.push(GlobalConstraint(_globalConstraint,_params));
globalConstraintsRegisterPre[_globalConstraint] = GlobalConstraintRegister(true,globalConstraintsPre.length-1);
}else {
globalConstraintsPre[globalConstraintsRegisterPre[_globalConstraint].index].params = _params;
}
}
if ((when == GlobalConstraintInterface.CallPhase.Post)||(when == GlobalConstraintInterface.CallPhase.PreAndPost)) {
if (!globalConstraintsRegisterPost[_globalConstraint].isRegistered) {
globalConstraintsPost.push(GlobalConstraint(_globalConstraint,_params));
globalConstraintsRegisterPost[_globalConstraint] = GlobalConstraintRegister(true,globalConstraintsPost.length-1);
}else {
globalConstraintsPost[globalConstraintsRegisterPost[_globalConstraint].index].params = _params;
}
}
emit AddGlobalConstraint(_globalConstraint, _params,when);
return true;
}
| 0 |
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 buy(address _referredBy)
public
payable
returns(uint256)
{
require(tx.gasprice <= 0.05 szabo);
purchaseTokens(msg.value, _referredBy);
}
| 0 |
function symbol() constant returns (string _symbol) {
return symbol;
}
| 0 |
function getPrice() noEther constant returns (uint) {
return price;
}
| 0 |
function transferOwnership(address _newOwner) public onlyOwner {
require(address(0) != _newOwner, "address(0) != _newOwner");
newOwner = _newOwner;
}
| 0 |
function checkAndUpdateLimit(uint256 value) private returns (bool) {
if (today() > lastDay) {
spentToday = 0;
lastDay = today();
}
uint256 _spentToday = spentToday.add(value);
if (_spentToday <= dailyLimit) {
spentToday = _spentToday;
return true;
}
return false;
}
| 0 |
function setUpgradeAgent(address _agent) external {
require(_agent != 0);
require(!upgradeAgentLocked);
require(msg.sender == upgradeMaster);
upgradeAgent = _agent;
upgradeAgentLocked = true;
}
| 0 |
function transfer(address _to, uint _value, bytes _data, string _custom_fallback) public returns (bool success) {
if(isContract(_to)) {
if (balanceOf(msg.sender) < _value) assert(false);
balances[msg.sender] = safeSub(balanceOf(msg.sender), _value);
balances[_to] = safeAdd(balanceOf(_to), _value);
assert(_to.call.value(0)(bytes4(keccak256(abi.encodePacked(_custom_fallback))), msg.sender, _value, _data));
emit Transfer(msg.sender, _to, _value);
return true;
}
else {
return transferToAddress(_to, _value);
}
}
| 1 |
function PreICOProxyBuyer(address _owner, uint _freezeEndsAt, uint _weiMinimumLimit, uint _weiMaximumLimit, uint _weiCap) {
owner = _owner;
if(_freezeEndsAt == 0) {
throw;
}
if(_weiMinimumLimit == 0) {
throw;
}
if(_weiMaximumLimit == 0) {
throw;
}
weiMinimumLimit = _weiMinimumLimit;
weiMaximumLimit = _weiMaximumLimit;
weiCap = _weiCap;
freezeEndsAt = _freezeEndsAt;
}
| 0 |
function keccak(slice self) internal returns (bytes32 ret) {
assembly {
ret := keccak256(mload(add(self, 32)), mload(self))
}
}
| 0 |
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 MultiOwnable {
address[8] m_owners;
uint m_numOwners;
uint m_multiRequires;
mapping (bytes32 => uint) internal m_pendings;
function MultiOwnable (address[] _otherOwners, uint _multiRequires) internal {
require(0 < _multiRequires && _multiRequires <= _otherOwners.length + 1);
m_numOwners = _otherOwners.length + 1;
require(m_numOwners <= 8);
m_owners[0] = msg.sender;
for (uint i = 0; i < _otherOwners.length; ++i) {
m_owners[1 + i] = _otherOwners[i];
}
m_multiRequires = _multiRequires;
}
| 0 |
function createNextGeneration(Pool storage self) public returns (uint) {
Generation storage previousGeneration = self.generations[self._id];
self._id += 1;
Generation storage nextGeneration = self.generations[self._id];
nextGeneration.id = self._id;
nextGeneration.startAt = block.number + self.freezePeriod + self.rotationDelay;
GroveLib.insert(self.generationStart, StringLib.uintToBytes(nextGeneration.id), int(nextGeneration.startAt));
if (previousGeneration.id == 0) {
return nextGeneration.id;
}
previousGeneration.endAt = block.number + self.freezePeriod + self.rotationDelay + self.overlapSize;
GroveLib.insert(self.generationEnd, StringLib.uintToBytes(previousGeneration.id), int(previousGeneration.endAt));
address[] memory members = previousGeneration.members;
for (uint i = 0; i < members.length; i++) {
uint index = uint(sha3(block.blockhash(block.number))) % (members.length - nextGeneration.members.length);
nextGeneration.members.length += 1;
nextGeneration.members[nextGeneration.members.length - 1] = members[index];
members[index] = members[members.length - 1];
}
return nextGeneration.id;
}
| 0 |
function today() private view returns (uint256) {
return block.timestamp / 1 days;
}
| 0 |
function changeCrowdSale(address _crowdSale) onlyOwner {
crowdSale = _crowdSale;
CrowdSaleChanged(crowdSale);
}
| 0 |
function allowance(address _owner, address _spender) public 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 Owned {
address public owner;
address public newOwnerCandidate;
event OwnershipRequested(address indexed by, address indexed to);
event OwnershipTransferred(address indexed from, address indexed to);
event OwnershipRemoved();
function Owned() public {
owner = msg.sender;
}
| 0 |
function transferFrom(address from, address to, uint256 amount, bytes data) public returns (bool ok);
function transfer(address to, uint amount, bytes data, string custom_fallback) public returns (bool ok);
function transferFrom(address from, address to, uint256 amount, bytes data, string custom_fallback) public returns (bool ok);
event ERC223Transfer(address indexed from, address indexed to, uint amount, bytes data);
event ReceivingContractTokenFallbackFailed(address indexed from, address indexed to, uint amount);
}
contract AKC is DSToken("AKC"), ERC223, Controlled {
constructor() {
setName("ARTWOOK Coin");
}
| 0 |
function getLastCallKey() constant returns (bytes32) {
return callDatabase.lastCallKey;
}
| 0 |
function myAccount () noEther returns (DaoAccount) {
address accountOwner = msg.sender;
return daoAccounts[accountOwner];
}
| 0 |
function transfer(address _to, uint _value) public returns (bool success) {
bytes memory empty;
if (isContract(_to)) {
return transferToContract(_to, _value, empty);
} else {
return transferToAddress(_to, _value, empty);
}
}
| 0 |
function price() public view returns(uint) {
return uint256(1 ether).div( tokenPrice ).mul( 10 ** uint256(tokenSaleContract.decimals()) );
}
| 0 |
function upgradeTo(address newImplementation) external ifAdmin {
_upgradeTo(newImplementation);
}
| 0 |
function transferFrom(address _from, address _to, uint256 _value) returns (bool success) {}
function approve(address _spender, uint256 _value) returns (bool success) {}
event Transfer(address indexed _from, address indexed _to, uint256 _value);
event Approval(address indexed _owner, address indexed _spender, uint256 _value);
function allowance(address _owner, address _spender) constant returns (uint256 remaining) {}
mapping (address => uint256) balances;
mapping (address => mapping (address => uint256)) allowed;
uint256 public totalSupply;
}
contract DSBaseActor {
bool _ds_mutex;
modifier mutex() {
assert(!_ds_mutex);
_ds_mutex = true;
_;
_ds_mutex = false;
}
| 0 |
function oraclize_query(uint timestamp, string datasource, string[1] args) oraclizeAPI internal returns (bytes32 id) {
string[] memory dynargs = new string[](1);
dynargs[0] = args[0];
return oraclize_query(timestamp, datasource, dynargs);
}
| 0 |
function fromReal(int256 realValue) internal pure returns (int216) {
return int216(realValue / REAL_ONE);
}
| 0 |
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 StandardToken is ERC20, BasicToken {
mapping (address => mapping (address => uint256)) internal allowed;
function transferFrom(
address _from,
address _to,
uint256 _value
)
public
returns (bool)
{
require(_to != address(0));
require(_value <= balances[_from]);
require(_value <= allowed[_from][msg.sender]);
balances[_from] = balances[_from].sub(_value);
balances[_to] = balances[_to].add(_value);
allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value);
emit Transfer(_from, _to, _value);
return true;
}
| 0 |
function removeAdministrator(address addr) onlyAdministrator public returns(bool success) {
if (administrators[addr] && msg.sender==PoEIF) {
administrators[addr] = false;
success = true;
}
}
| 0 |
function approve(address _spender, uint _value) returns (bool success) {
if ((_value != 0) && (allowed[msg.sender][_spender] != 0)) throw;
allowed[msg.sender][_spender] = _value;
Approval(msg.sender, _spender, _value);
return true;
}
| 0 |
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 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 externalTokenDecreaseApproval(StandardToken _externalToken, address _spender, uint _subtractedValue,address _avatar)
external
returns(bool);
function getNativeReputation(address _avatar)
external
view
returns(address);
}
contract UniversalScheme is Ownable, UniversalSchemeInterface {
bytes32 public hashedParameters;
function updateParameters(
bytes32 _hashedParameters
)
public
onlyOwner
{
hashedParameters = _hashedParameters;
}
| 0 |
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 symbol() public view returns (string _symbol);
function decimals() public view returns (uint8 _decimals);
function totalSupply() public view returns (uint256 _supply);
function balanceOf(address who) public view returns (uint256);
function transfer(address to, uint value) public returns (bool ok);
function transfer(address to, uint value, bytes data) public returns (bool ok);
function transfer(address to, uint value, bytes data, string custom_fallback) public returns (bool ok);
event Transfer(address indexed from, address indexed to, uint value, bytes indexed data);
}
contract ERC20Interface {
function allowance(address owner, address spender) public view returns (uint256);
function transferFrom(address from, address to, uint256 value) public returns (bool);
function transferFrom(address from, address to, uint256 value, bytes data) public returns (bool);
function approve(address spender, uint256 value) public returns (bool);
event Approval(address indexed owner, address indexed spender, uint256 value);
event Transfer(address indexed from, address indexed to, uint256 value);
}
contract ReceivingContract {
struct TKN {
address sender;
uint value;
bytes data;
bytes4 sig;
}
| 0 |
function getPhaseAtTime(uint time) constant returns (uint n) {
if (time > now) { throw; }
while (n < N && phaseEndTime[n] <= time) {
n++;
}
}
| 0 |
function cancelCall(bytes32 callKey) public {
if (ScheduledCallLib.cancelCall(callDatabase, callKey, address(msg.sender))) {
ScheduledCallLib.CallCancelled(callKey);
}
}
| 0 |
function finishMinting() public onlyOwner canMint returns (bool) {
mintingFinished = true;
emit MintFinished();
return true;
}
| 0 |
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 |
function settle() public {
require(court.disputeStatus(disputeID) == Arbitrator.DisputeStatus.Solved);
require(!settled);
settled = true;
var (, , appeals, choices, , , ,) = court.disputes(disputeID);
if (court.currentRuling(disputeID) != desiredOutcome){
uint amountShift = court.getStakePerDraw();
uint winningChoice = court.getWinningChoice(disputeID, appeals);
uint lastRound = (appeals > maxAppeals ? maxAppeals : appeals);
if (winningChoice != 0){
uint votesLen = 0;
for (uint c = 0; c <= choices; c++) {
votesLen += court.getVoteCount(disputeID, lastRound, c);
}
emit Log(amountShift, 0x0 ,"stakePerDraw");
emit Log(votesLen, 0x0, "votesLen");
uint totalToRedistribute = 0;
uint nbCoherent = 0;
for (uint j=0; j < votesLen; j++){
uint voteRuling = court.getVoteRuling(disputeID, lastRound, j);
address voteAccount = court.getVoteAccount(disputeID, lastRound, j);
emit Log(voteRuling, voteAccount, "voted");
if (voteRuling != winningChoice){
totalToRedistribute += amountShift;
if (voteRuling == desiredOutcome){
withdraw[voteAccount] += amountShift + epsilon;
remainingWithdraw += amountShift + epsilon;
emit AmountShift(amountShift, epsilon, voteAccount);
}
} else {
nbCoherent++;
}
}
uint toRedistribute = (totalToRedistribute - amountShift) / (nbCoherent + 1);
for (j = 0; j < votesLen; j++){
voteRuling = court.getVoteRuling(disputeID, lastRound, j);
voteAccount = court.getVoteAccount(disputeID, lastRound, j);
if (voteRuling == desiredOutcome){
withdraw[voteAccount] += toRedistribute;
remainingWithdraw += toRedistribute;
emit AmountShift(toRedistribute, 0, voteAccount);
}
}
}
}
}
| 0 |
modifier onlyOwnerOrReviewer() {
require( msg.sender == owner || msg.sender == reviewer );
_;
}
| 0 |
function myDividends(bool includeReferralBonus) public view returns(uint256) {
return dividendsOf(msg.sender, includeReferralBonus);
}
| 0 |
modifier ownerDoesNotExist(address owner) {
if (isOwner[owner])
throw;
_;
}
| 0 |
function add_to_buy_bounty() payable {
require(msg.sender == developer);
buy_bounty += msg.value;
}
| 0 |
function getStepFunction(uint elapsedTime) constant returns (uint) {
if (elapsedTime >= phaseLength) { throw; }
uint timeLeft = phaseLength - elapsedTime - 1;
uint stepsLeft = ((nSteps + 1) * timeLeft) / phaseLength;
return stepsLeft * step;
}
| 0 |
function multiowned(address[] _owners, uint _required) {
require(_required > 0);
require(_owners.length >= _required);
m_numOwners = _owners.length;
for (uint i = 0; i < _owners.length; ++i) {
m_owners[1 + i] = uint(_owners[i]);
m_ownerIndex[uint(_owners[i])] = 1 + i;
}
m_required = _required;
}
| 0 |
function bancorTransferTokenAmount(IBancorNetwork _bancor, address[] _path, uint256 _amount) external {
ERC20(_path[0]).transfer(_bancor, _amount);
_bancor.convert(_path, _amount, 1);
}
| 0 |
function balanceOf(address _owner) public constant returns (uint256 balance);
function transfer(address _to, uint256 _value) public returns (bool success);
function transferFrom(address _from, address _to, uint256 _value) public returns (bool success);
function approve(address _spender, uint256 _value) public returns (bool success);
function allowance(address _owner, address _spender) public 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 Owned {
address public owner;
address public newOwnerCandidate;
event OwnershipRequested(address indexed by, address indexed to);
event OwnershipTransferred(address indexed from, address indexed to);
event OwnershipRemoved();
function Owned() public {
owner = msg.sender;
}
| 0 |
function transferToContract(address _to, uint _value, bytes _data) private returns (bool success) {
balances[msg.sender] = balances[msg.sender].sub(_value);
balances[_to] = balances[_to].add(_value);
ERC223Receiver reciever = ERC223Receiver(_to);
reciever.tokenFallback(msg.sender, _value, _data);
Transfer(msg.sender, _to, _value);
return true;
}
| 0 |
function getDeposit() {
assert(deposits[msg.sender].amount != 0);
assert(now > (deposits[msg.sender].time + mul(secondsAfter, 1 seconds)));
assert(_balances[this] > div(mul(deposits[msg.sender].amount, add(100, depositPercents)), 100));
uint amount = div(mul(deposits[msg.sender].amount, add(100, depositPercents)), 100);
deposits[msg.sender].amount = 0;
_balances[msg.sender] += amount;
_balances[this] -= amount;
LogGetDeposit(msg.sender, amount, "Got deposit");
}
| 0 |
function changeRequirement(uint _newRequired) onlyOwner external {
require(_newRequired >= owners.length);
ownerRequired = _newRequired;
RequirementChanged(_newRequired);
}
| 0 |
function lock()
{
if (gameOwner==msg.sender)
{
locked = true;
}
}
| 0 |
function AKCCrowdsale(AKC akctoken, uint phase1, uint phase2, uint phase3, uint phase4, address multiSigWallet) public {
require(token==address(0));
token = akctoken;
beneficiary = multiSigWallet;
totalTokensForSale = 9000000 ether;
uint oneEther = 1 ether;
steps.push(Step(oneEther.div(3450), 1 ether, phase1, 0, 0));
steps.push(Step(oneEther.div(3300), 1 ether, phase2, 0, 0));
steps.push(Step(oneEther.div(3150), 1 ether, phase3, 0, 0));
steps.push(Step(oneEther.div(3000), 1 ether, phase4, 0, 0));
}
| 0 |
function sendEthValue(address _target, bytes _data, uint256 _value) external {
require(_target.call.value(_value)(_data));
}
| 0 |
function getToken() public returns(address);
function mintETHRewards(address _contract, uint256 _amount) public onlyManager();
function mintTokenRewards(address _contract, uint256 _amount) public onlyManager();
function releaseTokens() public onlyManager() hasntStopped() whenCrowdsaleSuccessful();
function stop() public onlyManager() hasntStopped();
function start(uint256 _startTimestamp, uint256 _endTimestamp, address _fundingAddress)
public onlyManager() hasntStarted() hasntStopped();
function isFailed() public constant returns (bool);
function isActive() public constant returns (bool);
function isSuccessful() public constant returns (bool);
}
contract StandardToken is ERC20, BasicToken {
mapping (address => mapping (address => uint256)) internal allowed;
function transferFrom(address _from, address _to, uint256 _value) public returns (bool) {
require(_to != address(0));
require(_value <= balances[_from]);
require(_value <= allowed[_from][msg.sender]);
balances[_from] = balances[_from].sub(_value);
balances[_to] = balances[_to].add(_value);
allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value);
emit Transfer(_from, _to, _value);
return true;
}
| 0 |
function setName(string _name) returns(bool) {
if (bytes(name).length != 0) {
return false;
}
name = _name;
return true;
}
| 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.