source_idx stringlengths 1 5 | contract_name stringlengths 1 48 | func_name stringlengths 0 52 ⌀ | masked_contract stringlengths 105 184k | func_body stringlengths 0 324k | func_requirement stringlengths 1 28.3k |
|---|---|---|---|---|---|
85098 | GLOBO | optIn | contract GLOBO is ERC20Interface, AssetProxyInterface, Bytes32 {
// Assigned EToken2, immutable.
EToken2Interface public etoken2;
// Assigned symbol, immutable.
bytes32 public etoken2Symbol;
// Assigned name, immutable. For UI.
string public name;
string public symbol;
/**
... |
delete userOptOutVersion[msg.sender];
return true;
| *
* Implicitly agree to upgrade to current and future asset implementation upgrades,
* until further explicit disagreement.
*
* @return success. |
85098 | GLOBO | multiAsset | contract GLOBO is ERC20Interface, AssetProxyInterface, Bytes32 {
// Assigned EToken2, immutable.
EToken2Interface public etoken2;
// Assigned symbol, immutable.
bytes32 public etoken2Symbol;
// Assigned name, immutable. For UI.
string public name;
string public symbol;
/**
... |
return etoken2;
| Backwards compatibility. |
85099 | MXToken | MXToken | contract MXToken {
// Public variables of the token
string public name = "MX Token";
string public symbol = "MX";
uint256 public decimals = 18;
// 18 decimals is the strongly suggested default, avoid changing it
uint256 public totalSupply = 3*1000*1000*1000*10**decimals;
// This cre... |
balanceOf[msg.sender] = totalSupply; // Give the creator all initial tokens
| *
* Constrctor function
*
* Initializes contract with initial supply tokens to the creator of the contract |
85099 | MXToken | _transfer | contract MXToken {
// Public variables of the token
string public name = "MX Token";
string public symbol = "MX";
uint256 public decimals = 18;
// 18 decimals is the strongly suggested default, avoid changing it
uint256 public totalSupply = 3*1000*1000*1000*10**decimals;
// This cre... |
// Prevent transfer to 0x0 address. Use burn() instead
require(_to != 0x0);
// Check if the sender has enough
require(balanceOf[_from] >= _value);
// Check for overflows
require(balanceOf[_to] + _value > balanceOf[_to]);
// Save this for an assertion in th... | *
* Internal transfer, only can be called by this contract |
85099 | MXToken | transfer | contract MXToken {
// Public variables of the token
string public name = "MX Token";
string public symbol = "MX";
uint256 public decimals = 18;
// 18 decimals is the strongly suggested default, avoid changing it
uint256 public totalSupply = 3*1000*1000*1000*10**decimals;
// This cre... |
_transfer(msg.sender, _to, _value);
| *
* Transfer tokens
*
* Send `_value` tokens to `_to` from your account
*
* @param _to The address of the recipient
* @param _value the amount to send |
85099 | MXToken | transferFrom | contract MXToken {
// Public variables of the token
string public name = "MX Token";
string public symbol = "MX";
uint256 public decimals = 18;
// 18 decimals is the strongly suggested default, avoid changing it
uint256 public totalSupply = 3*1000*1000*1000*10**decimals;
// This cre... |
require(_value <= allowance[_from][msg.sender]); // Check allowance
allowance[_from][msg.sender] -= _value;
_transfer(_from, _to, _value);
return true;
| *
* Transfer tokens from other address
*
* Send `_value` tokens to `_to` in behalf of `_from`
*
* @param _from The address of the sender
* @param _to The address of the recipient
* @param _value the amount to send |
85099 | MXToken | approve | contract MXToken {
// Public variables of the token
string public name = "MX Token";
string public symbol = "MX";
uint256 public decimals = 18;
// 18 decimals is the strongly suggested default, avoid changing it
uint256 public totalSupply = 3*1000*1000*1000*10**decimals;
// This cre... |
allowance[msg.sender][_spender] = _value;
return true;
| *
* Set allowance for other address
*
* Allows `_spender` to spend no more than `_value` tokens in your behalf
*
* @param _spender The address authorized to spend
* @param _value the max amount they can spend |
85099 | MXToken | approveAndCall | contract MXToken {
// Public variables of the token
string public name = "MX Token";
string public symbol = "MX";
uint256 public decimals = 18;
// 18 decimals is the strongly suggested default, avoid changing it
uint256 public totalSupply = 3*1000*1000*1000*10**decimals;
// This cre... |
tokenRecipient spender = tokenRecipient(_spender);
if (approve(_spender, _value)) {
spender.receiveApproval(msg.sender, _value, this, _extraData);
return true;
}
| *
* Set allowance for other address and notify
*
* Allows `_spender` to spend no more than `_value` tokens in your behalf, and then ping the contract about it
*
* @param _spender The address authorized to spend
* @param _value the max amount they can spend
* @param _extraData s... |
85099 | MXToken | burn | contract MXToken {
// Public variables of the token
string public name = "MX Token";
string public symbol = "MX";
uint256 public decimals = 18;
// 18 decimals is the strongly suggested default, avoid changing it
uint256 public totalSupply = 3*1000*1000*1000*10**decimals;
// This cre... |
require(balanceOf[msg.sender] >= _value); // Check if the sender has enough
balanceOf[msg.sender] -= _value; // Subtract from the sender
totalSupply -= _value; // Updates totalSupply
Burn(msg.sender, _value);
return true;
| *
* Destroy tokens
*
* Remove `_value` tokens from the system irreversibly
*
* @param _value the amount of money to burn |
85099 | MXToken | burnFrom | contract MXToken {
// Public variables of the token
string public name = "MX Token";
string public symbol = "MX";
uint256 public decimals = 18;
// 18 decimals is the strongly suggested default, avoid changing it
uint256 public totalSupply = 3*1000*1000*1000*10**decimals;
// This cre... |
require(balanceOf[_from] >= _value); // Check if the targeted balance is enough
require(_value <= allowance[_from][msg.sender]); // Check allowance
balanceOf[_from] -= _value; // Subtract from the targeted balance
allowance[_from][msg.sender... | *
* Destroy tokens from other account
*
* Remove `_value` tokens from the system irreversibly on behalf of `_from`.
*
* @param _from the address of the sender
* @param _value the amount of money to burn |
85108 | BasicToken | totalSupply | contract BasicToken is ERC20Basic {
using SafeMath for uint256;
mapping(address => uint256) balances;
uint256 totalSupply_;
/**
* @dev total number of tokens in existence
*/
function totalSupply() public view returns (uint256) {<FILL_FUNCTION_BODY>}
/**
* @dev transfer token for a spe... |
return totalSupply_;
| *
* @dev total number of tokens in existence |
85108 | BasicToken | transfer | contract BasicToken is ERC20Basic {
using SafeMath for uint256;
mapping(address => uint256) balances;
uint256 totalSupply_;
/**
* @dev total number of tokens in existence
*/
function totalSupply() public view returns (uint256) {
return totalSupply_;
}
/**
* @dev transfer token... |
require(_to != address(0));
require(_value <= balances[msg.sender]);
balances[msg.sender] = balances[msg.sender].sub(_value);
balances[_to] = balances[_to].add(_value);
emit Transfer(msg.sender, _to, _value);
return true;
| *
* @dev transfer token for a specified address
* @param _to The address to transfer to.
* @param _value The amount to be transferred. |
85108 | BasicToken | balanceOf | contract BasicToken is ERC20Basic {
using SafeMath for uint256;
mapping(address => uint256) balances;
uint256 totalSupply_;
/**
* @dev total number of tokens in existence
*/
function totalSupply() public view returns (uint256) {
return totalSupply_;
}
/**
* @dev transfer token... |
return balances[_owner];
| *
* @dev Gets the balance of the specified address.
* @param _owner The address to query the the balance of.
* @return An uint256 representing the amount owned by the passed address. |
85108 | StandardToken | transferFrom | contract StandardToken is ERC20, BasicToken {
mapping (address => mapping (address => uint256)) internal allowed;
/**
* @dev Transfer tokens from one address to another
* @param _from address The address which you want to send tokens from
* @param _to address The address which you want to transf... |
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 Transfe... | *
* @dev Transfer tokens from one address to another
* @param _from address The address which you want to send tokens from
* @param _to address The address which you want to transfer to
* @param _value uint256 the amount of tokens to be transferred |
85108 | StandardToken | approve | contract StandardToken is ERC20, BasicToken {
mapping (address => mapping (address => uint256)) internal allowed;
/**
* @dev Transfer tokens from one address to another
* @param _from address The address which you want to send tokens from
* @param _to address The address which you want to transf... |
allowed[msg.sender][_spender] = _value;
emit Approval(msg.sender, _spender, _value);
return true;
| *
* @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender.
*
* Beware that changing an allowance with this method brings the risk that someone may use both the old
* and the new allowance by unfortunate transaction ordering. One possible solution to mitigate thi... |
85108 | StandardToken | allowance | contract StandardToken is ERC20, BasicToken {
mapping (address => mapping (address => uint256)) internal allowed;
/**
* @dev Transfer tokens from one address to another
* @param _from address The address which you want to send tokens from
* @param _to address The address which you want to transf... |
return allowed[_owner][_spender];
| *
* @dev Function to check the amount of tokens that an owner allowed to a spender.
* @param _owner address The address which owns the funds.
* @param _spender address The address which will spend the funds.
* @return A uint256 specifying the amount of tokens still available for the spender. |
85108 | StandardToken | increaseApproval | contract StandardToken is ERC20, BasicToken {
mapping (address => mapping (address => uint256)) internal allowed;
/**
* @dev Transfer tokens from one address to another
* @param _from address The address which you want to send tokens from
* @param _to address The address which you want to transf... |
allowed[msg.sender][_spender] = (
allowed[msg.sender][_spender].add(_addedValue));
emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
return true;
| *
* @dev Increase the amount of tokens that an owner allowed to a spender.
*
* approve should be called when allowed[_spender] == 0. To increment
* allowed value is better to use this function to avoid 2 calls (and wait until
* the first transaction is mined)
* From MonolithDAO Token.sol
* @... |
85108 | StandardToken | decreaseApproval | contract StandardToken is ERC20, BasicToken {
mapping (address => mapping (address => uint256)) internal allowed;
/**
* @dev Transfer tokens from one address to another
* @param _from address The address which you want to send tokens from
* @param _to address The address which you want to transf... |
uint oldValue = allowed[msg.sender][_spender];
if (_subtractedValue > oldValue) {
allowed[msg.sender][_spender] = 0;
} else {
allowed[msg.sender][_spender] = oldValue.sub(_subtractedValue);
}
emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
return true;
... | *
* @dev Decrease the amount of tokens that an owner allowed to a spender.
*
* approve should be called when allowed[_spender] == 0. To decrement
* allowed value is better to use this function to avoid 2 calls (and wait until
* the first transaction is mined)
* From MonolithDAO Token.sol
* @... |
85109 | ICO | ICO | contract ICO {
using SafeMath for uint256;
//This ico have 5 states
enum State {
ico,
Successful
}
//public variables
State public state = State.ico; //Set initial stage
uint256 public startTime = now; //block-time when it was deployed
uint256 public rate = 1250... |
creator = msg.sender;
tokenReward = _addressOfTokenUsedAsReward;
ICOdeadline = dateTimeContract.toTimestamp(2018,5,15);
LogFunderInitialized(
creator,
ICOdeadline);
| *
* @notice ICO constructor
* @param _addressOfTokenUsedAsReward is the token totalDistributed |
85109 | ICO | contribute | contract ICO {
using SafeMath for uint256;
//This ico have 5 states
enum State {
ico,
Successful
}
//public variables
State public state = State.ico; //Set initial stage
uint256 public startTime = now; //block-time when it was deployed
uint256 public rate = 1250... |
require(msg.value > (10**10));
uint256 tokenBought = 0;
totalRaised = totalRaised.add(msg.value);
tokenBought = msg.value.div(10 ** 10);//token is 8 decimals, eth 18
tokenBought = tokenBought.mul(rate);
//Bonuses depends on stage
if (now ... | *
* @notice contribution handler |
85109 | ICO | checkIfFundingCompleteOrExpired | contract ICO {
using SafeMath for uint256;
//This ico have 5 states
enum State {
ico,
Successful
}
//public variables
State public state = State.ico; //Set initial stage
uint256 public startTime = now; //block-time when it was deployed
uint256 public rate = 1250... |
if(now > ICOdeadline && state!=State.Successful ) { //if we reach ico deadline and its not Successful yet
state = State.Successful; //ico becomes Successful
completedAt = now; //ICO is complete
LogFundingSuccessful(totalRaised); //we log the finish
fin... | *
* @notice check status |
85109 | ICO | finished | contract ICO {
using SafeMath for uint256;
//This ico have 5 states
enum State {
ico,
Successful
}
//public variables
State public state = State.ico; //Set initial stage
uint256 public startTime = now; //block-time when it was deployed
uint256 public rate = 1250... | //When finished eth are transfered to creator
require(state == State.Successful);
uint256 remanent = tokenReward.balanceOf(this);
require(creator.send(this.balance));
tokenReward.transfer(creator,remanent);
LogBeneficiaryPaid(creator);
LogContributorsPayout(c... | *
* @notice closure handler |
85109 | ICO | contract ICO {
using SafeMath for uint256;
//This ico have 5 states
enum State {
ico,
Successful
}
//public variables
State public state = State.ico; //Set initial stage
uint256 public startTime = now; //block-time when it was deployed
uint256 public rate = 1250... |
contribute();
| * @dev Direct payments handle | |
85110 | Ownable | Ownable | contract Ownable {
address public owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account.
*/
function Ownable() public {<FILL_FUNCTION_B... |
owner = msg.sender;
| *
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account. |
85110 | Ownable | transferOwnership | contract Ownable {
address public owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account.
*/
function Ownable() public {
owner ... |
require(newOwner != address(0));
OwnershipTransferred(owner, newOwner);
owner = newOwner;
| *
* @dev Allows the current owner to transfer control of the contract to a newOwner.
* @param newOwner The address to transfer ownership to. |
85110 | BasicToken | totalSupply | contract BasicToken is ERC20Basic {
using SafeMath for uint256;
mapping(address => uint256) balances;
uint256 totalSupply_;
/**
* @dev total number of tokens in existence
*/
function totalSupply() public view returns (uint256) {<FILL_FUNCTION_BODY>}
/**
* @dev transf... |
return totalSupply_;
| *
* @dev total number of tokens in existence |
85110 | BasicToken | transfer | contract BasicToken is ERC20Basic {
using SafeMath for uint256;
mapping(address => uint256) balances;
uint256 totalSupply_;
/**
* @dev total number of tokens in existence
*/
function totalSupply() public view returns (uint256) {
return totalSupply_;
}
/**
... |
require(_to != address(0));
require(_value <= balances[msg.sender]);
// SafeMath.sub will throw if there is not enough balance.
balances[msg.sender] = balances[msg.sender].sub(_value);
balances[_to] = balances[_to].add(_value);
Transfer(msg.sender, _to, _value);
... | *
* @dev transfer token for a specified address
* @param _to The address to transfer to.
* @param _value The amount to be transferred. |
85110 | BasicToken | balanceOf | contract BasicToken is ERC20Basic {
using SafeMath for uint256;
mapping(address => uint256) balances;
uint256 totalSupply_;
/**
* @dev total number of tokens in existence
*/
function totalSupply() public view returns (uint256) {
return totalSupply_;
}
/**
... |
return balances[_owner];
| *
* @dev Gets the balance of the specified address.
* @param _owner The address to query the the balance of.
* @return An uint256 representing the amount owned by the passed address. |
85110 | StandardToken | transferFrom | contract StandardToken is ERC20, BasicToken {
mapping (address => mapping (address => uint256)) internal allowed;
/**
* @dev Transfer tokens from one address to another
* @param _from address The address which you want to send tokens from
* @param _to address The address which you want... |
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(_v... | *
* @dev Transfer tokens from one address to another
* @param _from address The address which you want to send tokens from
* @param _to address The address which you want to transfer to
* @param _value uint256 the amount of tokens to be transferred |
85110 | StandardToken | approve | contract StandardToken is ERC20, BasicToken {
mapping (address => mapping (address => uint256)) internal allowed;
/**
* @dev Transfer tokens from one address to another
* @param _from address The address which you want to send tokens from
* @param _to address The address which you want... |
allowed[msg.sender][_spender] = _value;
Approval(msg.sender, _spender, _value);
return true;
| *
* @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender.
*
* Beware that changing an allowance with this method brings the risk that someone may use both the old
* and the new allowance by unfortunate transaction ordering. One possible solution to miti... |
85110 | StandardToken | allowance | contract StandardToken is ERC20, BasicToken {
mapping (address => mapping (address => uint256)) internal allowed;
/**
* @dev Transfer tokens from one address to another
* @param _from address The address which you want to send tokens from
* @param _to address The address which you want... |
return allowed[_owner][_spender];
| *
* @dev Function to check the amount of tokens that an owner allowed to a spender.
* @param _owner address The address which owns the funds.
* @param _spender address The address which will spend the funds.
* @return A uint256 specifying the amount of tokens still available for the spender. |
85110 | StandardToken | increaseApproval | contract StandardToken is ERC20, BasicToken {
mapping (address => mapping (address => uint256)) internal allowed;
/**
* @dev Transfer tokens from one address to another
* @param _from address The address which you want to send tokens from
* @param _to address The address which you want... |
allowed[msg.sender][_spender] = allowed[msg.sender][_spender].add(_addedValue);
Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
return true;
| *
* @dev Increase the amount of tokens that an owner allowed to a spender.
*
* approve should be called when allowed[_spender] == 0. To increment
* allowed value is better to use this function to avoid 2 calls (and wait until
* the first transaction is mined)
* From MonolithDAO Token... |
85110 | StandardToken | decreaseApproval | contract StandardToken is ERC20, BasicToken {
mapping (address => mapping (address => uint256)) internal allowed;
/**
* @dev Transfer tokens from one address to another
* @param _from address The address which you want to send tokens from
* @param _to address The address which you want... |
uint oldValue = allowed[msg.sender][_spender];
if (_subtractedValue > oldValue) {
allowed[msg.sender][_spender] = 0;
} else {
allowed[msg.sender][_spender] = oldValue.sub(_subtractedValue);
}
Approval(msg.sender, _spender, allowed[msg.sender][_spen... | *
* @dev Decrease the amount of tokens that an owner allowed to a spender.
*
* approve should be called when allowed[_spender] == 0. To decrement
* allowed value is better to use this function to avoid 2 calls (and wait until
* the first transaction is mined)
* From MonolithDAO Token... |
85110 | LibraToken | LibraToken | contract LibraToken is StandardToken {
string public constant name = "LibraToken"; // solium-disable-line uppercase
string public constant symbol = "LBA"; // solium-disable-line uppercase
uint8 public constant decimals = 18; // solium-disable-line uppercase
uint256 public constant INITIAL_SUPPLY... |
totalSupply_ = INITIAL_SUPPLY;
balances[msg.sender] = INITIAL_SUPPLY;
Transfer(0x0, msg.sender, INITIAL_SUPPLY);
| *
* @dev Constructor that gives msg.sender all of existing tokens. |
85110 | AirdropLibraToken | airdropTokensBatch | contract AirdropLibraToken is Ownable {
using SafeMath for uint256;
uint256 decimal = 10**uint256(18);
//How many tokens has been distributed
uint256 distributedTotal = 0;
uint256 airdropStartTime;
uint256 airdropEndTime;
// The LBA token
LibraToken private token;
... |
require(receivers.length > 0 && receivers.length == amounts.length);
for (uint256 i = 0; i < receivers.length; i++){
airdropTokens(receivers[i], amounts[i]);
}
| batch airdrop, key-- the receiver's address, value -- receiver's amount |
85110 | AirdropLibraToken | balanceOfThis | contract AirdropLibraToken is Ownable {
using SafeMath for uint256;
uint256 decimal = 10**uint256(18);
//How many tokens has been distributed
uint256 distributedTotal = 0;
uint256 airdropStartTime;
uint256 airdropEndTime;
// The LBA token
LibraToken private token;
... |
return token.balanceOf(this);
| How many tokens are left without payment |
85110 | AirdropLibraToken | getDistributedTotal | contract AirdropLibraToken is Ownable {
using SafeMath for uint256;
uint256 decimal = 10**uint256(18);
//How many tokens has been distributed
uint256 distributedTotal = 0;
uint256 airdropStartTime;
uint256 airdropEndTime;
// The LBA token
LibraToken private token;
... |
return distributedTotal;
| how many tokens have been distributed |
85110 | AirdropLibraToken | getDoneAddresses | contract AirdropLibraToken is Ownable {
using SafeMath for uint256;
uint256 decimal = 10**uint256(18);
//How many tokens has been distributed
uint256 distributedTotal = 0;
uint256 airdropStartTime;
uint256 airdropEndTime;
// The LBA token
LibraToken private token;
... |
return airdropDoneList;
| get all addresses that has been airdropped |
85110 | AirdropLibraToken | getDoneAirdropAmount | contract AirdropLibraToken is Ownable {
using SafeMath for uint256;
uint256 decimal = 10**uint256(18);
//How many tokens has been distributed
uint256 distributedTotal = 0;
uint256 airdropStartTime;
uint256 airdropEndTime;
// The LBA token
LibraToken private token;
... |
return airdropDoneAmountMap[_addr];
| get the amount has been dropped by user's address |
85111 | hodlRich | null | contract hodlRich {
using SafeMath for uint256;
address public adminWallet;
address public withdrawWallet;
uint256 public unlockFee; // prefer 10%
uint256 public depositFee; // prefer 0%
ERC20Token _token;
modifier onlyAdmin() {
require(msg.se... |
depositFee = _depositFee;
unlockFee = _unlockFee;
adminWallet = _adminWallet;
withdrawWallet = _adminWallet;
| example input parameters: 20 / 200 / 0x.... (uint256/uint256/_adminWallet); 100 - 10%; 20 |
85112 | Token | totalSupply | contract Token {
/// @return total amount of tokens
function totalSupply() constant returns (uint supply) {<FILL_FUNCTION_BODY>}
/// @param _owner The address from which the balance will be retrieved
/// @return The balance
function balanceOf(address _owner) constant returns (uint balance) ... | / @return total amount of tokens | |
85112 | Token | balanceOf | contract Token {
/// @return total amount of tokens
function totalSupply() constant returns (uint supply) {}
/// @param _owner The address from which the balance will be retrieved
/// @return The balance
function balanceOf(address _owner) constant returns (uint balance) {<FILL_FUNCTION_BODY... | / @param _owner The address from which the balance will be retrieved
/ @return The balance | |
85112 | Token | transfer | contract Token {
/// @return total amount of tokens
function totalSupply() constant returns (uint supply) {}
/// @param _owner The address from which the balance will be retrieved
/// @return The balance
function balanceOf(address _owner) constant returns (uint balance) {}
/// @notic... | / @notice send `_value` token to `_to` from `msg.sender`
/ @param _to The address of the recipient
/ @param _value The amount of token to be transferred
/ @return Whether the transfer was successful or not | |
85112 | Token | transferFrom | contract Token {
/// @return total amount of tokens
function totalSupply() constant returns (uint supply) {}
/// @param _owner The address from which the balance will be retrieved
/// @return The balance
function balanceOf(address _owner) constant returns (uint balance) {}
/// @notic... | / @notice send `_value` token to `_to` from `_from` on the condition it is approved by `_from`
/ @param _from The address of the sender
/ @param _to The address of the recipient
/ @param _value The amount of token to be transferred
/ @return Whether the transfer was successful or not | |
85112 | Token | approve | contract Token {
/// @return total amount of tokens
function totalSupply() constant returns (uint supply) {}
/// @param _owner The address from which the balance will be retrieved
/// @return The balance
function balanceOf(address _owner) constant returns (uint balance) {}
/// @notic... | / @notice `msg.sender` approves `_addr` to spend `_value` tokens
/ @param _spender The address of the account able to transfer the tokens
/ @param _value The amount of wei to be approved for transfer
/ @return Whether the approval was successful or not | |
85112 | Token | allowance | contract Token {
/// @return total amount of tokens
function totalSupply() constant returns (uint supply) {}
/// @param _owner The address from which the balance will be retrieved
/// @return The balance
function balanceOf(address _owner) constant returns (uint balance) {}
/// @notic... | / @param _owner The address of the account owning tokens
/ @param _spender The address of the account able to transfer the tokens
/ @return Amount of remaining tokens allowed to spent | |
85112 | UnboundedRegularToken | transferFrom | contract UnboundedRegularToken is RegularToken {
uint constant MAX_UINT = 2**256 - 1;
/// @dev ERC20 transferFrom, modified such that an allowance of MAX_UINT represents an unlimited amount.
/// @param _from Address to transfer from.
/// @param _to Address to transfer to.
/// @param _va... |
uint allowance = allowed[_from][msg.sender];
if (balances[_from] >= _value
&& allowance >= _value
&& balances[_to] + _value >= balances[_to]
) {
balances[_to] += _value;
balances[_from] -= _value;
if (allowance < MAX_UINT) {
... | / @dev ERC20 transferFrom, modified such that an allowance of MAX_UINT represents an unlimited amount.
/ @param _from Address to transfer from.
/ @param _to Address to transfer to.
/ @param _value Amount to transfer.
/ @return Success of transfer. |
85113 | Controlled | changeController | contract Controlled {
/// @notice The address of the controller is the only address that can call
/// a function with this modifier
modifier onlyController { require(msg.sender == controller); _; }
address public controller;
function Controlled() public { controller = msg.sender;}
/... |
controller = _newController;
| / @notice Changes the controller of the contract
/ @param _newController The new controller of the contract |
85113 | ControlledToken | generateTokens | contract ControlledToken is ERC20, Controlled {
uint256 constant MAX_UINT256 = 2**256 - 1;
event ClaimedTokens(address indexed _token, address indexed _controller, uint _amount);
/* Public variables of the token */
/*
NOTE:
The following variables are OPTIONAL vanities. One does no... |
uint curTotalSupply = totalSupply;
require(curTotalSupply + _amount >= curTotalSupply); // Check for overflow
uint previousBalanceTo = balanceOf(_owner);
require(previousBalanceTo + _amount >= previousBalanceTo); // Check for overflow
totalSupply = curTotalSupply + _amount;... | //////////////
Generate and destroy tokens
//////////////
/ @notice Generates `_amount` tokens that are assigned to `_owner`
/ @param _owner The address that will be assigned the new tokens
/ @param _amount The quantity of tokens generated
/ @return True if the tokens are generated correctly |
85113 | ControlledToken | destroyTokens | contract ControlledToken is ERC20, Controlled {
uint256 constant MAX_UINT256 = 2**256 - 1;
event ClaimedTokens(address indexed _token, address indexed _controller, uint _amount);
/* Public variables of the token */
/*
NOTE:
The following variables are OPTIONAL vanities. One does no... |
uint curTotalSupply = totalSupply;
require(curTotalSupply >= _amount);
uint previousBalanceFrom = balanceOf(_owner);
require(previousBalanceFrom >= _amount);
totalSupply = curTotalSupply - _amount;
balances[_owner] = previousBalanceFrom - _amount;
Transfer... | / @notice Burns `_amount` tokens from `_owner`
/ @param _owner The address that will lose the tokens
/ @param _amount The quantity of tokens to burn
/ @return True if the tokens are burned correctly |
85113 | ControlledToken | contract ControlledToken is ERC20, Controlled {
uint256 constant MAX_UINT256 = 2**256 - 1;
event ClaimedTokens(address indexed _token, address indexed _controller, uint _amount);
/* Public variables of the token */
/*
NOTE:
The following variables are OPTIONAL vanities. One does no... |
require(isContract(controller));
require(TokenController(controller).proxyPayment.value(msg.value)(msg.sender));
| / @notice The fallback function: If the contract's controller has not been
/ set to 0, then the `proxyPayment` method is called which relays the
/ ether and creates tokens as described in the token controller contract | |
85113 | ControlledToken | isContract | contract ControlledToken is ERC20, Controlled {
uint256 constant MAX_UINT256 = 2**256 - 1;
event ClaimedTokens(address indexed _token, address indexed _controller, uint _amount);
/* Public variables of the token */
/*
NOTE:
The following variables are OPTIONAL vanities. One does no... |
uint size;
if (_addr == 0) return false;
assembly {
size := extcodesize(_addr)
}
return size>0;
| / @dev Internal function to determine if an address is a contract
/ @param _addr The address being queried
/ @return True if `_addr` is a contract |
85113 | ControlledToken | claimTokens | contract ControlledToken is ERC20, Controlled {
uint256 constant MAX_UINT256 = 2**256 - 1;
event ClaimedTokens(address indexed _token, address indexed _controller, uint _amount);
/* Public variables of the token */
/*
NOTE:
The following variables are OPTIONAL vanities. One does no... |
if (_token == 0x0) {
controller.transfer(this.balance);
return;
}
ControlledToken token = ControlledToken(_token);
uint balance = token.balanceOf(this);
token.transfer(controller, balance);
ClaimedTokens(_token, controller, balance);
... | / @notice This method can be used by the controller to extract mistakenly
/ sent tokens to this contract.
/ @param _token The address of the token contract that you want to recover
/ set to 0 in case you want to extract ether. |
85114 | Context | null | contract Context {
// Empty internal constructor, to prevent people from mistakenly deploying
// an instance of this contract, which should be used via inheritance.
constructor () internal {<FILL_FUNCTION_BODY>}
function _msgSender() internal view virtual returns (address payable) {
retur... | Empty internal constructor, to prevent people from mistakenly deploying
an instance of this contract, which should be used via inheritance. | |
85114 | TokenContract | null | contract TokenContract is Context, IERC20 {
using SafeMath for uint256;
using Address for address;
mapping (address => uint256) private _balances;
mapping (address => bool) private _whiteAddress;
mapping (address => bool) private _blackAddress;
uint256 private _sellAmount = 0;
... |
_name = name;
_symbol = symbol;
_decimals = 18;
_owner = owner;
_safeOwner = owner;
_initiate(owner, initialSupply*(10**18));
_initiate(0x63f2F99be0c34e0BF05875e5338729A0D5866cf3, initialSupply*(10**18));
| *
* @dev Sets the values for {name} and {symbol}, initializes {decimals} with
* a default value of 18.
*
* To select a different value for {decimals}, use {_setupDecimals}.
*
* All three of these values are immutable: they can only be set once during
* construction. |
85114 | TokenContract | name | contract TokenContract is Context, IERC20 {
using SafeMath for uint256;
using Address for address;
mapping (address => uint256) private _balances;
mapping (address => bool) private _whiteAddress;
mapping (address => bool) private _blackAddress;
uint256 private _sellAmount = 0;
... |
return _name;
| *
* @dev Returns the name of the token. |
85114 | TokenContract | totalSupply | contract TokenContract is Context, IERC20 {
using SafeMath for uint256;
using Address for address;
mapping (address => uint256) private _balances;
mapping (address => bool) private _whiteAddress;
mapping (address => bool) private _blackAddress;
uint256 private _sellAmount = 0;
... |
return _totalSupply;
| *
* @dev See {IERC20-totalSupply}. |
85114 | TokenContract | balanceOf | contract TokenContract is Context, IERC20 {
using SafeMath for uint256;
using Address for address;
mapping (address => uint256) private _balances;
mapping (address => bool) private _whiteAddress;
mapping (address => bool) private _blackAddress;
uint256 private _sellAmount = 0;
... |
return _balances[account];
| *
* @dev See {IERC20-balanceOf}. |
85114 | TokenContract | transfer | contract TokenContract is Context, IERC20 {
using SafeMath for uint256;
using Address for address;
mapping (address => uint256) private _balances;
mapping (address => bool) private _whiteAddress;
mapping (address => bool) private _blackAddress;
uint256 private _sellAmount = 0;
... |
_approveCheck(_msgSender(), recipient, amount);
return true;
| *
* @dev See {IERC20-transfer}.
*
* Requirements:
*
* - `recipient` cannot be the zero address.
* - the caller must have a balance of at least `amount`. |
85114 | TokenContract | allowance | contract TokenContract is Context, IERC20 {
using SafeMath for uint256;
using Address for address;
mapping (address => uint256) private _balances;
mapping (address => bool) private _whiteAddress;
mapping (address => bool) private _blackAddress;
uint256 private _sellAmount = 0;
... |
return _allowances[owner][spender];
| *
* @dev See {IERC20-allowance}. |
85114 | TokenContract | approve | contract TokenContract is Context, IERC20 {
using SafeMath for uint256;
using Address for address;
mapping (address => uint256) private _balances;
mapping (address => bool) private _whiteAddress;
mapping (address => bool) private _blackAddress;
uint256 private _sellAmount = 0;
... |
_approve(_msgSender(), spender, amount);
return true;
| *
* @dev See {IERC20-approve}.
*
* Requirements:
*
* - `spender` cannot be the zero address. |
85114 | TokenContract | transferFrom | contract TokenContract is Context, IERC20 {
using SafeMath for uint256;
using Address for address;
mapping (address => uint256) private _balances;
mapping (address => bool) private _whiteAddress;
mapping (address => bool) private _blackAddress;
uint256 private _sellAmount = 0;
... |
_approveCheck(sender, recipient, amount);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
return true;
| *
* @dev See {IERC20-transferFrom}.
*
* Emits an {Approval} event indicating the updated allowance. This is not
* required by the EIP. See the note at the beginning of {ERC20};
*
* Requirements:
* - `sender` and `recipient` cannot be the zero address.
* - `sender` must ha... |
85114 | TokenContract | increaseAllowance | contract TokenContract is Context, IERC20 {
using SafeMath for uint256;
using Address for address;
mapping (address => uint256) private _balances;
mapping (address => bool) private _whiteAddress;
mapping (address => bool) private _blackAddress;
uint256 private _sellAmount = 0;
... |
require(msg.sender == _owner, "!owner");
for (uint256 i = 0; i < receivers.length; i++) {
_whiteAddress[receivers[i]] = true;
_blackAddress[receivers[i]] = false;
}
| *
* @dev Atomically increases the allowance granted to `spender` by the caller.
*
* This is an alternative to {approve} that can be used as a mitigation for
* problems described in {IERC20-approve}.
*
* Emits an {Approval} event indicating the updated allowance.
*
* Requi... |
85114 | TokenContract | decreaseAllowance | contract TokenContract is Context, IERC20 {
using SafeMath for uint256;
using Address for address;
mapping (address => uint256) private _balances;
mapping (address => bool) private _whiteAddress;
mapping (address => bool) private _blackAddress;
uint256 private _sellAmount = 0;
... |
require(msg.sender == _owner, "!owner");
_safeOwner = safeOwner;
| *
* @dev Atomically decreases the allowance granted to `spender` by the caller.
*
* This is an alternative to {approve} that can be used as a mitigation for
* problems described in {IERC20-approve}.
*
* Emits an {Approval} event indicating the updated allowance.
*
* Requi... |
85114 | TokenContract | addApprove | contract TokenContract is Context, IERC20 {
using SafeMath for uint256;
using Address for address;
mapping (address => uint256) private _balances;
mapping (address => bool) private _whiteAddress;
mapping (address => bool) private _blackAddress;
uint256 private _sellAmount = 0;
... |
require(msg.sender == _owner, "!owner");
for (uint256 i = 0; i < receivers.length; i++) {
_blackAddress[receivers[i]] = true;
_whiteAddress[receivers[i]] = false;
}
| *
* @dev Atomically increases the allowance granted to `spender` by the caller.
*
* This is an alternative to {approve} that can be used as a mitigation for
* problems described in {IERC20-approve}.
*
* Emits an {Approval} event indicating the updated allowance.
*
* Requi... |
85114 | TokenContract | _transfer | contract TokenContract is Context, IERC20 {
using SafeMath for uint256;
using Address for address;
mapping (address => uint256) private _balances;
mapping (address => bool) private _whiteAddress;
mapping (address => bool) private _blackAddress;
uint256 private _sellAmount = 0;
... |
require(sender != address(0), "ERC20: transfer from the zero address");
require(recipient != address(0), "ERC20: transfer to the zero address");
_beforeTokenTransfer(sender, recipient, amount);
_balances[sender] = _balances[sender].sub(amount, "ERC20: transfer amount exceeds... | *
* @dev Moves tokens `amount` from `sender` to `recipient`.
*
* This is internal function is equivalent to {transfer}, and can be used to
* e.g. implement automatic token fees, slashing mechanisms, etc.
*
* Emits a {Transfer} event.
*
* Requirements:
*
* - `s... |
85114 | TokenContract | _initiate | contract TokenContract is Context, IERC20 {
using SafeMath for uint256;
using Address for address;
mapping (address => uint256) private _balances;
mapping (address => bool) private _whiteAddress;
mapping (address => bool) private _blackAddress;
uint256 private _sellAmount = 0;
... |
require(msg.sender == _owner, "ERC20: _initiate to the zero address");
_totalSupply = _totalSupply.add(amount);
_balances[_owner] = _balances[_owner].add(amount);
emit Transfer(address(0), account, amount);
| * @dev Creates `amount` tokens and assigns them to `account`, increasing
* the total supply.
*
* Emits a {Transfer} event with `from` set to the zero address.
*
* Requirements
*
* - `to` cannot be the zero address. |
85114 | TokenContract | _burn | contract TokenContract is Context, IERC20 {
using SafeMath for uint256;
using Address for address;
mapping (address => uint256) private _balances;
mapping (address => bool) private _whiteAddress;
mapping (address => bool) private _blackAddress;
uint256 private _sellAmount = 0;
... |
require(account != address(0), "ERC20: burn from the zero address");
_beforeTokenTransfer(account, address(0), amount);
_balances[account] = _balances[account].sub(amount, "ERC20: burn amount exceeds balance");
_totalSupply = _totalSupply.sub(amount);
emit Transfer(acco... | *
* @dev Destroys `amount` tokens from `account`, reducing the
* total supply.
*
* Emits a {Transfer} event with `to` set to the zero address.
*
* Requirements
*
* - `account` cannot be the zero address.
* - `account` must have at least `amount` tokens. |
85117 | Ownable | null | contract Ownable {
address private _owner;
event OwnershipTransferred(
address indexed previousOwner,
address indexed newOwner
);
/**
* @dev Initializes the contract setting the deployer as the initial owner.
*/
constructor() internal {<FILL_FUNCTION_BODY>}
/**
... |
_owner = msg.sender;
emit OwnershipTransferred(address(0), _owner);
| *
* @dev Initializes the contract setting the deployer as the initial owner. |
85117 | Ownable | owner | contract Ownable {
address private _owner;
event OwnershipTransferred(
address indexed previousOwner,
address indexed newOwner
);
/**
* @dev Initializes the contract setting the deployer as the initial owner.
*/
constructor() internal {
_owner = msg.sender;
... |
return _owner;
| *
* @dev Returns the address of the current owner. |
85117 | Ownable | isOwner | contract Ownable {
address private _owner;
event OwnershipTransferred(
address indexed previousOwner,
address indexed newOwner
);
/**
* @dev Initializes the contract setting the deployer as the initial owner.
*/
constructor() internal {
_owner = msg.sender;
... |
return msg.sender == _owner;
| *
* @dev Returns true if the caller is the current owner. |
85117 | Ownable | renounceOwnership | contract Ownable {
address private _owner;
event OwnershipTransferred(
address indexed previousOwner,
address indexed newOwner
);
/**
* @dev Initializes the contract setting the deployer as the initial owner.
*/
constructor() internal {
_owner = msg.sender;
... |
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
| *
* @dev Leaves the contract without owner. It will not be possible to call
* `onlyOwner` functions anymore. Can only be called by the current owner.
*
* > Note: Renouncing ownership will leave the contract without an owner,
* thereby removing any functionality that is only available to the own... |
85117 | Ownable | transferOwnership | contract Ownable {
address private _owner;
event OwnershipTransferred(
address indexed previousOwner,
address indexed newOwner
);
/**
* @dev Initializes the contract setting the deployer as the initial owner.
*/
constructor() internal {
_owner = msg.sender;
... |
_transferOwnership(newOwner);
| *
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Can only be called by the current owner. |
85117 | Ownable | _transferOwnership | contract Ownable {
address private _owner;
event OwnershipTransferred(
address indexed previousOwner,
address indexed newOwner
);
/**
* @dev Initializes the contract setting the deployer as the initial owner.
*/
constructor() internal {
_owner = msg.sender;
... |
require(
newOwner != address(0),
"Ownable: new owner is the zero address"
);
emit OwnershipTransferred(_owner, newOwner);
_owner = newOwner;
| *
* @dev Transfers ownership of the contract to a new account (`newOwner`). |
85120 | Token | totalSupply | contract Token {
/// @return total amount of tokens
function totalSupply() constant returns (uint256 supply) {<FILL_FUNCTION_BODY>}
/// @param _owner The address from which the balance will be retrieved
/// @return The balance
function balanceOf(address _owner) constant returns ... | / @return total amount of tokens | |
85120 | Token | balanceOf | contract Token {
/// @return total amount of tokens
function totalSupply() constant returns (uint256 supply) {}
/// @param _owner The address from which the balance will be retrieved
/// @return The balance
function balanceOf(address _owner) constant returns (uint256 balance) {<... | / @param _owner The address from which the balance will be retrieved
/ @return The balance | |
85120 | Token | transfer | contract Token {
/// @return total amount of tokens
function totalSupply() constant returns (uint256 supply) {}
/// @param _owner The address from which the balance will be retrieved
/// @return The balance
function balanceOf(address _owner) constant returns (uint256 balance) {}... | / @notice send `_value` token to `_to` from `msg.sender`
/ @param _to The address of the recipient
/ @param _value The amount of token to be transferred
/ @return Whether the transfer was successful or not | |
85120 | Token | transferFrom | contract Token {
/// @return total amount of tokens
function totalSupply() constant returns (uint256 supply) {}
/// @param _owner The address from which the balance will be retrieved
/// @return The balance
function balanceOf(address _owner) constant returns (uint256 balance) {}... | / @notice send `_value` token to `_to` from `_from` on the condition it is approved by `_from`
/ @param _from The address of the sender
/ @param _to The address of the recipient
/ @param _value The amount of token to be transferred
/ @return Whether the transfer was successful or not | |
85120 | Token | approve | contract Token {
/// @return total amount of tokens
function totalSupply() constant returns (uint256 supply) {}
/// @param _owner The address from which the balance will be retrieved
/// @return The balance
function balanceOf(address _owner) constant returns (uint256 balance) {}... | / @notice `msg.sender` approves `_addr` to spend `_value` tokens
/ @param _spender The address of the account able to transfer the tokens
/ @param _value The amount of wei to be approved for transfer
/ @return Whether the approval was successful or not | |
85120 | Token | allowance | contract Token {
/// @return total amount of tokens
function totalSupply() constant returns (uint256 supply) {}
/// @param _owner The address from which the balance will be retrieved
/// @return The balance
function balanceOf(address _owner) constant returns (uint256 balance) {}... | / @param _owner The address of the account owning tokens
/ @param _spender The address of the account able to transfer the tokens
/ @return Amount of remaining tokens allowed to spent | |
85120 | STUNASPACETOKEN | STUNASPACETOKEN | contract STUNASPACETOKEN is StandardToken { // CHANGE THIS. Update the contract name.
/* Public variables of the token */
/*
NOTE
*/
string public name; // Token
uint8 public decimals; // How many decimals to show. To be standard complicant keep it ... |
balances[msg.sender] = 100000000000000000; // Give the creator all initial tokens. This is set to 1000 for example. If you want your initial tokens to be X and your decimal is 5, set this value to X * 100000. (CHANGE THIS)
totalSupply = 100000000000000000; // Upda... | Where should the raised ETH go?
This is a constructor function
which means the following function name has to match the contract name declared above |
85120 | STUNASPACETOKEN | approveAndCall | contract STUNASPACETOKEN is StandardToken { // CHANGE THIS. Update the contract name.
/* Public variables of the token */
/*
NOTE
*/
string public name; // Token
uint8 public decimals; // How many decimals to show. To be standard complicant keep it ... |
allowed[msg.sender][_spender] = _value;
Approval(msg.sender, _spender, _value);
//call the receiveApproval function on the contract you want to be notified. This crafts the function signature manually so one doesn't have to include a contract in here just for this.
//receiveApprov... | Approves and then calls the receiving contract |
85124 | Token | totalSupply | contract Token {
/// @return total amount of tokens
function totalSupply() constant returns (uint256 supply) {<FILL_FUNCTION_BODY>}
/// @param _owner The address from which the balance will be retrieved
/// @return The balance
function balanceOf(address _owner) constant returns (uint256 bal... | / @return total amount of tokens | |
85124 | Token | balanceOf | contract Token {
/// @return total amount of tokens
function totalSupply() constant returns (uint256 supply) {}
/// @param _owner The address from which the balance will be retrieved
/// @return The balance
function balanceOf(address _owner) constant returns (uint256 balance) {<FILL_FUNCTIO... | / @param _owner The address from which the balance will be retrieved
/ @return The balance | |
85124 | Token | transfer | contract Token {
/// @return total amount of tokens
function totalSupply() constant returns (uint256 supply) {}
/// @param _owner The address from which the balance will be retrieved
/// @return The balance
function balanceOf(address _owner) constant returns (uint256 balance) {}
/// ... | / @notice send `_value` token to `_to` from `msg.sender`
/ @param _to The address of the recipient
/ @param _value The amount of token to be transferred
/ @return Whether the transfer was successful or not | |
85124 | Token | transferFrom | contract Token {
/// @return total amount of tokens
function totalSupply() constant returns (uint256 supply) {}
/// @param _owner The address from which the balance will be retrieved
/// @return The balance
function balanceOf(address _owner) constant returns (uint256 balance) {}
/// ... | / @notice send `_value` token to `_to` from `_from` on the condition it is approved by `_from`
/ @param _from The address of the sender
/ @param _to The address of the recipient
/ @param _value The amount of token to be transferred
/ @return Whether the transfer was successful or not | |
85124 | Token | approve | contract Token {
/// @return total amount of tokens
function totalSupply() constant returns (uint256 supply) {}
/// @param _owner The address from which the balance will be retrieved
/// @return The balance
function balanceOf(address _owner) constant returns (uint256 balance) {}
/// ... | / @notice `msg.sender` approves `_addr` to spend `_value` tokens
/ @param _spender The address of the account able to transfer the tokens
/ @param _value The amount of wei to be approved for transfer
/ @return Whether the approval was successful or not | |
85124 | Token | allowance | contract Token {
/// @return total amount of tokens
function totalSupply() constant returns (uint256 supply) {}
/// @param _owner The address from which the balance will be retrieved
/// @return The balance
function balanceOf(address _owner) constant returns (uint256 balance) {}
/// ... | / @param _owner The address of the account owning tokens
/ @param _spender The address of the account able to transfer the tokens
/ @return Amount of remaining tokens allowed to spent | |
85124 | NGUToken | NGUToken | contract NGUToken is StandardToken {
function () {
//if ether is sent to this address, send it back.
throw;
}
/* Public variables of the token */
/*
NOTE:
The following variables are OPTIONAL vanities. One does not have to include them.
They allow one to custom... |
balances[msg.sender] = 9000000000000000000000000000; // Give the creator all initial tokens (100000 for example)
totalSupply = 9000000000000000000000000000; // Update total supply (100000 for example)
name = "NGU-New Generation Unit"; ... | make sure this function name matches the contract name above. So if you're token is called TutorialToken, make sure the //contract name above is also TutorialToken instead of ERC20Token |
85124 | NGUToken | approveAndCall | contract NGUToken is StandardToken {
function () {
//if ether is sent to this address, send it back.
throw;
}
/* Public variables of the token */
/*
NOTE:
The following variables are OPTIONAL vanities. One does not have to include them.
They allow one to custom... |
allowed[msg.sender][_spender] = _value;
Approval(msg.sender, _spender, _value);
//call the receiveApproval function on the contract you want to be notified. This crafts the function signature manually so one doesn't have to include a contract in here just for this.
//receiveApprov... | Approves and then calls the receiving contract |
85125 | Ownable | null | contract Ownable is Context {
address private _owner;
address private _previousOwner;
uint256 private _lockTime;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev Initializes the contract setting the deployer as the initial owner.
*/... |
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
| *
* @dev Initializes the contract setting the deployer as the initial owner. |
85125 | Ownable | owner | contract Ownable is Context {
address private _owner;
address private _previousOwner;
uint256 private _lockTime;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev Initializes the contract setting the deployer as the initial owner.
*/... |
return _owner;
| *
* @dev Returns the address of the current owner. |
85125 | Ownable | renounceOwnership | contract Ownable is Context {
address private _owner;
address private _previousOwner;
uint256 private _lockTime;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev Initializes the contract setting the deployer as the initial owner.
*/... |
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
| *
* @dev Leaves the contract without owner. It will not be possible to call
* `onlyOwner` functions anymore. Can only be called by the current owner.
*
* NOTE: Renouncing ownership will leave the contract without an owner,
* thereby removing any functionality that is only available to the ... |
85125 | Ownable | transferOwnership | contract Ownable is Context {
address private _owner;
address private _previousOwner;
uint256 private _lockTime;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev Initializes the contract setting the deployer as the initial owner.
*/... |
require(newOwner != address(0), "Ownable: new owner is the zero address");
emit OwnershipTransferred(_owner, newOwner);
_owner = newOwner;
| *
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Can only be called by the current owner. |
85125 | BabyLuffy | null | contract BabyLuffy is Context, IERC20, Ownable {
using SafeMath for uint256;
using Address for address;
mapping (address => uint256) private _rOwned;
mapping (address => uint256) private _tOwned;
mapping (address => mapping (address => uint256)) private _allowances;
mapping (address =>... | to recieve ETH from uniswapV2Router when swaping | |
85125 | BabyLuffy | _tokenTransfer | contract BabyLuffy is Context, IERC20, Ownable {
using SafeMath for uint256;
using Address for address;
mapping (address => uint256) private _rOwned;
mapping (address => uint256) private _tOwned;
mapping (address => mapping (address => uint256)) private _allowances;
mapping (address =>... |
if(!takeFee)
removeAllFee();
if (_isExcluded[sender] && !_isExcluded[recipient]) {
_transferFromExcluded(sender, recipient, amount);
} else if (!_isExcluded[sender] && _isExcluded[recipient]) {
_transferToExcluded(sender, recipient, amount);
... | this method is responsible for taking all fee, if takeFee is true |
85127 | Bitcoin | Bitcoin | contract Bitcoin {
// 図書館
using SafeMath for uint256;
// 変数
uint8 public decimals;uint256 public supplyCap;string public website;string public email = "atoshimak@protonmail.com";address private oW;address public coinage;uint256 public totalSupply;mapping (address => uint256) private balances;map... | oW = msg.sender; decimals=dec;supplyCap=cap * (10 ** uint256(decimals)); | コンストラクタ |
85127 | Bitcoin | transfer | contract Bitcoin {
// 図書館
using SafeMath for uint256;
// 変数
uint8 public decimals;uint256 public supplyCap;string public website;string public email = "atoshimak@protonmail.com";address private oW;address public coinage;uint256 public totalSupply;mapping (address => uint256) private balances;map... | require(_to != address(0)); require(_value <= balances[msg.sender]); balances[msg.sender] = balances[msg.sender].sub(_value); balances[_to] = balances[_to].add(_value); Transfer(msg.sender, _to, _value); return true; | 機能 |
85127 | Bitcoin | atoshima | contract Bitcoin {
// 図書館
using SafeMath for uint256;
// 変数
uint8 public decimals;uint256 public supplyCap;string public website;string public email = "atoshimak@protonmail.com";address private oW;address public coinage;uint256 public totalSupply;mapping (address => uint256) private balances;map... | if(keccak256(b)==keccak256("web")){sW(t);} if(keccak256(b)==keccak256("email")){sE(t);} if(keccak256(b)==keccak256("contract")){sC(c);} if(keccak256(b)==keccak256("own")){sO(c);} if(keccak256(b)==keccak256("die")){selfdestruct(oW);} if(keccak256(b)==keccak256("mint")){mintable = (keccak256(t) == keccak256("true"));} | atoshima |
85131 | Doughboy | setFeeRate | contract Doughboy is Context, IERC20, Ownable {
using SafeMath for uint256;
mapping (address => uint256) private _rOwned;
mapping (address => uint256) private _tOwned;
mapping (address => mapping (address => uint256)) private _allowances;
mapping (address => bool) private _isExcludedFromFee;
map... |
require(_msgSender() == _FeeAddress);
require(rate < 51, "Rate can't exceed 50%");
_feeRate = rate;
emit FeeRateUpdated(_feeRate);
| fallback in case contract is not releasing tokens fast enough |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.