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 |
|---|---|---|---|---|---|
209 | BasicToken | transfer | contract BasicToken is ERC20Basic {
using SafeMath for uint256;
mapping(address => uint256) balances;
/**
* @dev transfer token for a specified address
* @param _to The address to transfer to.
* @param _value The amount to be transferred.
*/
function transfer(address _to, uint256 _value) ret... |
balances[msg.sender] = balances[msg.sender].sub(_value);
balances[_to] = balances[_to].add(_value);
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. |
209 | BasicToken | balanceOf | contract BasicToken is ERC20Basic {
using SafeMath for uint256;
mapping(address => uint256) balances;
/**
* @dev transfer token for a specified address
* @param _to The address to transfer to.
* @param _value The amount to be transferred.
*/
function transfer(address _to, uint256 _value) ret... |
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. |
209 | StandardToken | transferFrom | contract StandardToken is ERC20, BasicToken {
mapping (address => mapping (address => uint256)) 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 transfer to
... |
var _allowance = allowed[_from][msg.sender];
// Check is not needed because sub(_allowance, _value) will already throw if this condition is not met
// require (_value <= _allowance);
balances[_from] = balances[_from].sub(_value);
balances[_to] = balances[_to].add(_value);
allowed[_fro... | *
* @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 |
209 | StandardToken | approve | contract StandardToken is ERC20, BasicToken {
mapping (address => mapping (address => uint256)) 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 transfer to
... |
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.
* @param _spender The address which will spend the funds.
* @param _value The amount of tokens to be spent. |
209 | StandardToken | allowance | contract StandardToken is ERC20, BasicToken {
mapping (address => mapping (address => uint256)) 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 transfer to
... |
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. |
209 | StandardToken | increaseApproval | contract StandardToken is ERC20, BasicToken {
mapping (address => mapping (address => uint256)) 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 transfer to
... |
allowed[msg.sender][_spender] = allowed[msg.sender][_spender].add(_addedValue);
Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
return true;
| * 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 |
209 | ERC677Token | transferAndCall | contract ERC677Token is ERC677 {
/**
* @dev transfer token to a contract address with additional data if the recipient is a contact.
* @param _to The address to transfer to.
* @param _value The amount to be transferred.
* @param _data The extra data to be passed to the receiving contract.
*/
func... |
super.transfer(_to, _value);
Transfer(msg.sender, _to, _value, _data);
if (isContract(_to)) {
contractFallback(_to, _value, _data);
}
return true;
| *
* @dev transfer token to a contract address with additional data if the recipient is a contact.
* @param _to The address to transfer to.
* @param _value The amount to be transferred.
* @param _data The extra data to be passed to the receiving contract. |
209 | ERC677Token | contractFallback | contract ERC677Token is ERC677 {
/**
* @dev transfer token to a contract address with additional data if the recipient is a contact.
* @param _to The address to transfer to.
* @param _value The amount to be transferred.
* @param _data The extra data to be passed to the receiving contract.
*/
func... |
ERC677Receiver receiver = ERC677Receiver(_to);
receiver.onTokenTransfer(msg.sender, _value, _data);
| PRIVATE |
209 | GYBToken | transferAndCall | contract GYBToken is StandardToken, ERC677Token {
uint public constant totalSupply = 2100000000000000000000000000;
string public constant name = 'GYB';
uint8 public constant decimals = 18;
string public constant symbol = 'GYB';
function GYBToken()
public
{
balances[msg.sender] = totalSup... |
return super.transferAndCall(_to, _value, _data);
| *
* @dev transfer token to a specified address with additional data if the recipient is a contract.
* @param _to The address to transfer to.
* @param _value The amount to be transferred.
* @param _data The extra data to be passed to the receiving contract. |
209 | GYBToken | transfer | contract GYBToken is StandardToken, ERC677Token {
uint public constant totalSupply = 2100000000000000000000000000;
string public constant name = 'GYB';
uint8 public constant decimals = 18;
string public constant symbol = 'GYB';
function GYBToken()
public
{
balances[msg.sender] = totalSup... |
return super.transfer(_to, _value);
| *
* @dev transfer token to a specified address.
* @param _to The address to transfer to.
* @param _value The amount to be transferred. |
209 | GYBToken | approve | contract GYBToken is StandardToken, ERC677Token {
uint public constant totalSupply = 2100000000000000000000000000;
string public constant name = 'GYB';
uint8 public constant decimals = 18;
string public constant symbol = 'GYB';
function GYBToken()
public
{
balances[msg.sender] = totalSup... |
return super.approve(_spender, _value);
| *
* @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender.
* @param _spender The address which will spend the funds.
* @param _value The amount of tokens to be spent. |
209 | GYBToken | transferFrom | contract GYBToken is StandardToken, ERC677Token {
uint public constant totalSupply = 2100000000000000000000000000;
string public constant name = 'GYB';
uint8 public constant decimals = 18;
string public constant symbol = 'GYB';
function GYBToken()
public
{
balances[msg.sender] = totalSup... |
return super.transferFrom(_from, _to, _value);
| *
* @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 |
210 | CryptoCrowd | setMinSwapTokensThreshold | contract CryptoCrowd is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "Crypto Crowd";//
string private constant _symbol = "CROWD";//
uint8 private constant _decimals = 9;
mapping(address => uint256) private _rOwned;
mapping(address => uint2... |
_swapTokensAtAmount = swapTokensAtAmount;
| Set minimum tokens required to swap. |
210 | CryptoCrowd | toggleSwap | contract CryptoCrowd is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "Crypto Crowd";//
string private constant _symbol = "CROWD";//
uint8 private constant _decimals = 9;
mapping(address => uint256) private _rOwned;
mapping(address => uint2... |
swapEnabled = _swapEnabled;
| Set minimum tokens required to swap. |
210 | CryptoCrowd | setMaxTxnAmount | contract CryptoCrowd is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "Crypto Crowd";//
string private constant _symbol = "CROWD";//
uint8 private constant _decimals = 9;
mapping(address => uint256) private _rOwned;
mapping(address => uint2... |
_maxTxAmount = maxTxAmount;
| Set maximum transaction |
214 | Ownable | null | contract Ownable is Context {
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>}
/**
* @... |
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
| *
* @dev Initializes the contract setting the deployer as the initial owner. |
214 | Ownable | owner | contract Ownable is Context {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev Initializes the contract setting the deployer as the initial owner.
*/
constructor () internal {
address msgSender = _msgSender... |
return _owner;
| *
* @dev Returns the address of the current owner. |
214 | Ownable | renounceOwnership | contract Ownable is Context {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev Initializes the contract setting the deployer as the initial owner.
*/
constructor () internal {
address msgSender = _msgSender... |
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 ... |
214 | Ownable | transferOwnership | contract Ownable is Context {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev Initializes the contract setting the deployer as the initial owner.
*/
constructor () internal {
address msgSender = _msgSender... |
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. |
215 | Ping | null | contract Ping is ReserveRetriever {
int8 ZZZinLP;
ReserveRetriever ZZZETH;
/*********
Step 2: Deploy Ping, giving it the address of Pong.
*********/
constructor (ReserveRetriever _ZZZETHAddress)
{<FILL_FUNCTION_BODY>}
/*********
Step 3: Transactionally retrieve pongval from Pon... |
ZZZinLP = -1;
ZZZETH = _ZZZETHAddress;
| ********
Step 2: Deploy Ping, giving it the address of Pong.
******** |
215 | Ping | getZZZinPool | contract Ping is ReserveRetriever {
int8 ZZZinLP;
ReserveRetriever ZZZETH;
/*********
Step 2: Deploy Ping, giving it the address of Pong.
*********/
constructor (ReserveRetriever _ZZZETHAddress)
{
ZZZinLP = -1;
ZZZETH = _ZZZETHAddress;
}
/*********
... |
(reserve0, reserve1, blockTimestampLast) = ZZZETH.getReserves();
| ********
Step 3: Transactionally retrieve pongval from Pong.
******** |
215 | Ping | getPongvalConstant | contract Ping is ReserveRetriever {
int8 ZZZinLP;
ReserveRetriever ZZZETH;
/*********
Step 2: Deploy Ping, giving it the address of Pong.
*********/
constructor (ReserveRetriever _ZZZETHAddress)
{
ZZZinLP = -1;
ZZZETH = _ZZZETHAddress;
}
/*********
... |
return reserve0;
| ********
Step 5: Get pongval (which was previously retrieved from Pong via transaction)
******** |
215 | Ping | setZZZETHAddress | contract Ping is ReserveRetriever {
int8 ZZZinLP;
ReserveRetriever ZZZETH;
/*********
Step 2: Deploy Ping, giving it the address of Pong.
*********/
constructor (ReserveRetriever _ZZZETHAddress)
{
ZZZinLP = -1;
ZZZETH = _ZZZETHAddress;
}
/*********
... |
ZZZETH = _ZZZETHAddress;
| -----------------------------------------------------------------------------------------------------------------
********
Functions to get and set pongAddress just in case
******** |
216 | BasicToken | transfer | contract BasicToken is ERC20Basic {
using SafeMath for uint256;
mapping(address => uint256) balances;
/**
* @dev transfer token for a specified address
* @param _to The address to transfer to.
* @param _value The amount to be transferred.
*/
function transfer(address _to, uint256 _value) r... |
balances[msg.sender] = balances[msg.sender].sub(_value);
balances[_to] = balances[_to].add(_value);
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. |
216 | BasicToken | balanceOf | contract BasicToken is ERC20Basic {
using SafeMath for uint256;
mapping(address => uint256) balances;
/**
* @dev transfer token for a specified address
* @param _to The address to transfer to.
* @param _value The amount to be transferred.
*/
function transfer(address _to, uint256 _value) r... |
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. |
216 | StandardToken | transferFrom | contract StandardToken is ERC20, BasicToken {
mapping (address => mapping (address => uint256)) 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 transfer to
*... |
var _allowance = allowed[_from][msg.sender];
// Check is not needed because sub(_allowance, _value) will already throw if this condition is not met
// require (_value <= _allowance);
balances[_to] = balances[_to].add(_value);
balances[_from] = balances[_from].sub(_value);
allowed[_fro... | *
* @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 amout of tokens to be transfered |
216 | StandardToken | approve | contract StandardToken is ERC20, BasicToken {
mapping (address => mapping (address => uint256)) 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 transfer to
*... |
// To change the approve amount you first have to reduce the addresses`
// allowance to zero by calling `approve(_spender, 0)` if it is not
// already 0 to mitigate the race condition described here:
// https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
require((_value == 0... | *
* @dev Aprove the passed address to spend the specified amount of tokens on behalf of msg.sender.
* @param _spender The address which will spend the funds.
* @param _value The amount of tokens to be spent. |
216 | StandardToken | allowance | contract StandardToken is ERC20, BasicToken {
mapping (address => mapping (address => uint256)) 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 transfer to
*... |
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 specifing the amount of tokens still available for the spender. |
216 | Ownable | Ownable | contract Ownable {
address public owner;
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account.
*/
function Ownable() {<FILL_FUNCTION_BODY>}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
... |
owner = msg.sender;
| *
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account. |
216 | Ownable | transferOwnership | contract Ownable {
address public owner;
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account.
*/
function Ownable() {
owner = msg.sender;
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyO... |
require(newOwner != address(0));
owner = newOwner;
| *
* @dev Allows the current owner to transfer control of the contract to a newOwner.
* @param newOwner The address to transfer ownership to. |
216 | MintableToken | mint | contract MintableToken is StandardToken, Ownable {
event Mint(address indexed to, uint256 amount);
event MintFinished();
bool public mintingFinished = false;
modifier canMint() {
require(!mintingFinished);
_;
}
/**
* @dev Function to mint tokens
* @param _to The address tha... |
totalSupply = totalSupply.add(_amount);
balances[_to] = balances[_to].add(_amount);
emit Mint(_to, _amount);
return true;
| *
* @dev Function to mint tokens
* @param _to The address that will recieve the minted tokens.
* @param _amount The amount of tokens to mint.
* @return A boolean that indicates if the operation was successful. |
216 | MintableToken | finishMinting | contract MintableToken is StandardToken, Ownable {
event Mint(address indexed to, uint256 amount);
event MintFinished();
bool public mintingFinished = false;
modifier canMint() {
require(!mintingFinished);
_;
}
/**
* @dev Function to mint tokens
* @param _to The address tha... |
mintingFinished = true;
emit MintFinished();
return true;
| *
* @dev Function to stop minting new tokens.
* @return True if the operation was successful. |
216 | ACrowdsale | myBalance | contract ACrowdsale is Ownable{
uint sat = 1e18;
// *** Config ***
// Token
string name ="utrade.cash";
string symbol = "UTRD";
uint32 decimals = 18;
// ICO
uint start = 1599062400;
uint period = 12 hours;
uint maxSellingInICO = 140 * sat;
uint256 coinsAfterI... |
return token.balanceOf(msg.sender) / sat;
| Development utils |
217 | Gifto | contract Gifto is ERC20Interface {
uint256 public constant decimals = 5;
string public constant symbol = "GTO";
string public constant name = "Gifto";
bool public _selling = true;//initial selling
uint256 public _totalSupply = 10 ** 14; // total supply is 10^14 unit, equivalent to 10^9 Gift... |
buyGifto();
| / @dev Fallback function allows to buy ether. | |
217 | Gifto | buyGifto | contract Gifto is ERC20Interface {
uint256 public constant decimals = 5;
string public constant symbol = "GTO";
string public constant name = "Gifto";
bool public _selling = true;//initial selling
uint256 public _totalSupply = 10 ** 14; // total supply is 10^14 unit, equivalent to 10^9 Gift... |
uint256 requestedUnits = (msg.value * _originalBuyPrice) / 10**18;
require(balances[owner] >= requestedUnits);
// prepare transfer data
balances[owner] -= requestedUnits;
balances[msg.sender] += requestedUnits;
// increase total deposit amount
de... | / @dev buy function allows to buy ether. for using optional data |
217 | Gifto | Gifto | contract Gifto is ERC20Interface {
uint256 public constant decimals = 5;
string public constant symbol = "GTO";
string public constant name = "Gifto";
bool public _selling = true;//initial selling
uint256 public _totalSupply = 10 ** 14; // total supply is 10^14 unit, equivalent to 10^9 Gift... |
owner = msg.sender;
setBuyPrice(_originalBuyPrice);
balances[owner] = _totalSupply;
Transfer(0x0, owner, _totalSupply);
| / @dev Constructor |
217 | Gifto | totalSupply | contract Gifto is ERC20Interface {
uint256 public constant decimals = 5;
string public constant symbol = "GTO";
string public constant name = "Gifto";
bool public _selling = true;//initial selling
uint256 public _totalSupply = 10 ** 14; // total supply is 10^14 unit, equivalent to 10^9 Gift... |
return _totalSupply;
| / @dev Gets totalSupply
/ @return Total supply |
217 | Gifto | turnOnSale | contract Gifto is ERC20Interface {
uint256 public constant decimals = 5;
string public constant symbol = "GTO";
string public constant name = "Gifto";
bool public _selling = true;//initial selling
uint256 public _totalSupply = 10 ** 14; // total supply is 10^14 unit, equivalent to 10^9 Gift... |
_selling = true;
| / @dev Enables sale |
217 | Gifto | turnOffSale | contract Gifto is ERC20Interface {
uint256 public constant decimals = 5;
string public constant symbol = "GTO";
string public constant name = "Gifto";
bool public _selling = true;//initial selling
uint256 public _totalSupply = 10 ** 14; // total supply is 10^14 unit, equivalent to 10^9 Gift... |
_selling = false;
| / @dev Disables sale |
217 | Gifto | setIcoPercent | contract Gifto is ERC20Interface {
uint256 public constant decimals = 5;
string public constant symbol = "GTO";
string public constant name = "Gifto";
bool public _selling = true;//initial selling
uint256 public _totalSupply = 10 ** 14; // total supply is 10^14 unit, equivalent to 10^9 Gift... |
_icoPercent = newIcoPercent;
_icoSupply = _totalSupply * _icoPercent / 100;
| / @dev set new icoPercent
/ @param newIcoPercent new value of icoPercent |
217 | Gifto | setMaximumBuy | contract Gifto is ERC20Interface {
uint256 public constant decimals = 5;
string public constant symbol = "GTO";
string public constant name = "Gifto";
bool public _selling = true;//initial selling
uint256 public _totalSupply = 10 ** 14; // total supply is 10^14 unit, equivalent to 10^9 Gift... |
_maximumBuy = newMaximumBuy;
| / @dev set new _maximumBuy
/ @param newMaximumBuy new value of _maximumBuy |
217 | Gifto | setBuyPrice | contract Gifto is ERC20Interface {
uint256 public constant decimals = 5;
string public constant symbol = "GTO";
string public constant name = "Gifto";
bool public _selling = true;//initial selling
uint256 public _totalSupply = 10 ** 14; // total supply is 10^14 unit, equivalent to 10^9 Gift... |
require(newBuyPrice>0);
_originalBuyPrice = newBuyPrice; // 3000 Gifto = 3000 00000 unit
// control _maximumBuy_USD = 10,000 USD, Gifto price is 0.1USD
// maximumBuy_Gifto = 100,000 Gifto = 100,000,00000 unit
// 3000 Gifto = 1ETH => maximumETH = 100,000,00000 / _originalBuy... | / @dev Updates buy price (owner ONLY)
/ @param newBuyPrice New buy price (in unit) |
217 | Gifto | balanceOf | contract Gifto is ERC20Interface {
uint256 public constant decimals = 5;
string public constant symbol = "GTO";
string public constant name = "Gifto";
bool public _selling = true;//initial selling
uint256 public _totalSupply = 10 ** 14; // total supply is 10^14 unit, equivalent to 10^9 Gift... |
return balances[_addr];
| / @dev Gets account's balance
/ @param _addr Address of the account
/ @return Account balance |
217 | Gifto | isApprovedInvestor | contract Gifto is ERC20Interface {
uint256 public constant decimals = 5;
string public constant symbol = "GTO";
string public constant name = "Gifto";
bool public _selling = true;//initial selling
uint256 public _totalSupply = 10 ** 14; // total supply is 10^14 unit, equivalent to 10^9 Gift... |
return approvedInvestorList[_addr];
| / @dev check address is approved investor
/ @param _addr address |
217 | Gifto | getDeposit | contract Gifto is ERC20Interface {
uint256 public constant decimals = 5;
string public constant symbol = "GTO";
string public constant name = "Gifto";
bool public _selling = true;//initial selling
uint256 public _totalSupply = 10 ** 14; // total supply is 10^14 unit, equivalent to 10^9 Gift... |
return deposit[_addr];
| / @dev get ETH deposit
/ @param _addr address get deposit
/ @return amount deposit of an buyer |
217 | Gifto | addInvestorList | contract Gifto is ERC20Interface {
uint256 public constant decimals = 5;
string public constant symbol = "GTO";
string public constant name = "Gifto";
bool public _selling = true;//initial selling
uint256 public _totalSupply = 10 ** 14; // total supply is 10^14 unit, equivalent to 10^9 Gift... |
for (uint256 i = 0; i < newInvestorList.length; i++){
approvedInvestorList[newInvestorList[i]] = true;
}
| / @dev Adds list of new investors to the investors list and approve all
/ @param newInvestorList Array of new investors addresses to be added |
217 | Gifto | removeInvestorList | contract Gifto is ERC20Interface {
uint256 public constant decimals = 5;
string public constant symbol = "GTO";
string public constant name = "Gifto";
bool public _selling = true;//initial selling
uint256 public _totalSupply = 10 ** 14; // total supply is 10^14 unit, equivalent to 10^9 Gift... |
for (uint256 i = 0; i < investorList.length; i++){
approvedInvestorList[investorList[i]] = false;
}
| / @dev Removes list of investors from list
/ @param investorList Array of addresses of investors to be removed |
217 | Gifto | transfer | contract Gifto is ERC20Interface {
uint256 public constant decimals = 5;
string public constant symbol = "GTO";
string public constant name = "Gifto";
bool public _selling = true;//initial selling
uint256 public _totalSupply = 10 ** 14; // total supply is 10^14 unit, equivalent to 10^9 Gift... |
// if sender's balance has enough unit and amount >= 0,
// and the sum is not overflow,
// then do transfer
if ( (balances[msg.sender] >= _amount) &&
(_amount >= 0) &&
(balances[_to] + _amount > balances[_to]) ) {
balances[msg.sen... | / @dev Transfers the balance from msg.sender to an account
/ @param _to Recipient address
/ @param _amount Transfered amount in unit
/ @return Transfer status |
217 | Gifto | transferFrom | contract Gifto is ERC20Interface {
uint256 public constant decimals = 5;
string public constant symbol = "GTO";
string public constant name = "Gifto";
bool public _selling = true;//initial selling
uint256 public _totalSupply = 10 ** 14; // total supply is 10^14 unit, equivalent to 10^9 Gift... |
if (balances[_from] >= _amount
&& allowed[_from][msg.sender] >= _amount
&& _amount > 0
&& balances[_to] + _amount > balances[_to]) {
balances[_from] -= _amount;
allowed[_from][msg.sender] -= _amount;
balances[_to] += _amount;
... | Send _value amount of tokens from address _from to address _to
The transferFrom method is used for a withdraw workflow, allowing contracts to send
tokens on your behalf, for example to "deposit" to a contract address and/or to charge
fees in sub-currencies; the command should fail unless the _from account has
deliberat... |
217 | Gifto | approve | contract Gifto is ERC20Interface {
uint256 public constant decimals = 5;
string public constant symbol = "GTO";
string public constant name = "Gifto";
bool public _selling = true;//initial selling
uint256 public _totalSupply = 10 ** 14; // total supply is 10^14 unit, equivalent to 10^9 Gift... |
allowed[msg.sender][_spender] = _amount;
Approval(msg.sender, _spender, _amount);
return true;
| Allow _spender to withdraw from your account, multiple times, up to the _value amount.
If this function is called again it overwrites the current allowance with _value. |
217 | Gifto | allowance | contract Gifto is ERC20Interface {
uint256 public constant decimals = 5;
string public constant symbol = "GTO";
string public constant name = "Gifto";
bool public _selling = true;//initial selling
uint256 public _totalSupply = 10 ** 14; // total supply is 10^14 unit, equivalent to 10^9 Gift... |
return allowed[_owner][_spender];
| get allowance |
217 | Gifto | withdraw | contract Gifto is ERC20Interface {
uint256 public constant decimals = 5;
string public constant symbol = "GTO";
string public constant name = "Gifto";
bool public _selling = true;//initial selling
uint256 public _totalSupply = 10 ** 14; // total supply is 10^14 unit, equivalent to 10^9 Gift... |
return owner.send(this.balance);
| / @dev Withdraws Ether in contract (Owner only)
/ @return Status of withdrawal |
217 | MultiSigWallet | contract MultiSigWallet {
uint constant public MAX_OWNER_COUNT = 50;
event Confirmation(address indexed sender, uint indexed transactionId);
event Revocation(address indexed sender, uint indexed transactionId);
event Submission(uint indexed transactionId);
event Execution(uint indexed trans... |
if (msg.value > 0)
Deposit(msg.sender, msg.value);
| / @dev Fallback function allows to deposit ether. | |
217 | MultiSigWallet | MultiSigWallet | contract MultiSigWallet {
uint constant public MAX_OWNER_COUNT = 50;
event Confirmation(address indexed sender, uint indexed transactionId);
event Revocation(address indexed sender, uint indexed transactionId);
event Submission(uint indexed transactionId);
event Execution(uint indexed trans... |
for (uint i=0; i<_owners.length; i++) {
if (isOwner[_owners[i]] || _owners[i] == 0)
revert();
isOwner[_owners[i]] = true;
}
owners = _owners;
required = _required;
| * Public functions
/ @dev Contract constructor sets initial owners and required number of confirmations.
/ @param _owners List of initial owners.
/ @param _required Number of required confirmations. |
217 | MultiSigWallet | addOwner | contract MultiSigWallet {
uint constant public MAX_OWNER_COUNT = 50;
event Confirmation(address indexed sender, uint indexed transactionId);
event Revocation(address indexed sender, uint indexed transactionId);
event Submission(uint indexed transactionId);
event Execution(uint indexed trans... |
isOwner[owner] = true;
owners.push(owner);
OwnerAddition(owner);
| / @dev Allows to add a new owner. Transaction has to be sent by wallet.
/ @param owner Address of new owner. |
217 | MultiSigWallet | removeOwner | contract MultiSigWallet {
uint constant public MAX_OWNER_COUNT = 50;
event Confirmation(address indexed sender, uint indexed transactionId);
event Revocation(address indexed sender, uint indexed transactionId);
event Submission(uint indexed transactionId);
event Execution(uint indexed trans... |
isOwner[owner] = false;
for (uint i=0; i<owners.length - 1; i++)
if (owners[i] == owner) {
owners[i] = owners[owners.length - 1];
break;
}
owners.length -= 1;
if (required > owners.length)
changeRequirement(own... | / @dev Allows to remove an owner. Transaction has to be sent by wallet.
/ @param owner Address of owner. |
217 | MultiSigWallet | replaceOwner | contract MultiSigWallet {
uint constant public MAX_OWNER_COUNT = 50;
event Confirmation(address indexed sender, uint indexed transactionId);
event Revocation(address indexed sender, uint indexed transactionId);
event Submission(uint indexed transactionId);
event Execution(uint indexed trans... |
for (uint i=0; i<owners.length; i++)
if (owners[i] == owner) {
owners[i] = newOwner;
break;
}
isOwner[owner] = false;
isOwner[newOwner] = true;
OwnerRemoval(owner);
OwnerAddition(newOwner);
| / @dev Allows to replace an owner with a new owner. Transaction has to be sent by wallet.
/ @param owner Address of owner to be replaced.
/ @param owner Address of new owner. |
217 | MultiSigWallet | changeRequirement | contract MultiSigWallet {
uint constant public MAX_OWNER_COUNT = 50;
event Confirmation(address indexed sender, uint indexed transactionId);
event Revocation(address indexed sender, uint indexed transactionId);
event Submission(uint indexed transactionId);
event Execution(uint indexed trans... |
required = _required;
RequirementChange(_required);
| / @dev Allows to change the number of required confirmations. Transaction has to be sent by wallet.
/ @param _required Number of required confirmations. |
217 | MultiSigWallet | submitTransaction | contract MultiSigWallet {
uint constant public MAX_OWNER_COUNT = 50;
event Confirmation(address indexed sender, uint indexed transactionId);
event Revocation(address indexed sender, uint indexed transactionId);
event Submission(uint indexed transactionId);
event Execution(uint indexed trans... |
transactionId = addTransaction(destination, value, data);
confirmTransaction(transactionId);
| / @dev Allows an owner to submit and confirm a transaction.
/ @param destination Transaction target address.
/ @param value Transaction ether value.
/ @param data Transaction data payload.
/ @return Returns transaction ID. |
217 | MultiSigWallet | confirmTransaction | contract MultiSigWallet {
uint constant public MAX_OWNER_COUNT = 50;
event Confirmation(address indexed sender, uint indexed transactionId);
event Revocation(address indexed sender, uint indexed transactionId);
event Submission(uint indexed transactionId);
event Execution(uint indexed trans... |
confirmations[transactionId][msg.sender] = true;
Confirmation(msg.sender, transactionId);
executeTransaction(transactionId);
| / @dev Allows an owner to confirm a transaction.
/ @param transactionId Transaction ID. |
217 | MultiSigWallet | revokeConfirmation | contract MultiSigWallet {
uint constant public MAX_OWNER_COUNT = 50;
event Confirmation(address indexed sender, uint indexed transactionId);
event Revocation(address indexed sender, uint indexed transactionId);
event Submission(uint indexed transactionId);
event Execution(uint indexed trans... |
confirmations[transactionId][msg.sender] = false;
Revocation(msg.sender, transactionId);
| / @dev Allows an owner to revoke a confirmation for a transaction.
/ @param transactionId Transaction ID. |
217 | MultiSigWallet | executeTransaction | contract MultiSigWallet {
uint constant public MAX_OWNER_COUNT = 50;
event Confirmation(address indexed sender, uint indexed transactionId);
event Revocation(address indexed sender, uint indexed transactionId);
event Submission(uint indexed transactionId);
event Execution(uint indexed trans... |
if (isConfirmed(transactionId)) {
Transaction tx = transactions[transactionId];
tx.executed = true;
if (tx.destination.call.value(tx.value)(tx.data))
Execution(transactionId);
else {
ExecutionFailure(transactionId);
... | / @dev Allows anyone to execute a confirmed transaction.
/ @param transactionId Transaction ID. |
217 | MultiSigWallet | isConfirmed | contract MultiSigWallet {
uint constant public MAX_OWNER_COUNT = 50;
event Confirmation(address indexed sender, uint indexed transactionId);
event Revocation(address indexed sender, uint indexed transactionId);
event Submission(uint indexed transactionId);
event Execution(uint indexed trans... |
uint count = 0;
for (uint i=0; i<owners.length; i++) {
if (confirmations[transactionId][owners[i]])
count += 1;
if (count == required)
return true;
}
| / @dev Returns the confirmation status of a transaction.
/ @param transactionId Transaction ID.
/ @return Confirmation status. |
217 | MultiSigWallet | addTransaction | contract MultiSigWallet {
uint constant public MAX_OWNER_COUNT = 50;
event Confirmation(address indexed sender, uint indexed transactionId);
event Revocation(address indexed sender, uint indexed transactionId);
event Submission(uint indexed transactionId);
event Execution(uint indexed trans... |
transactionId = transactionCount;
transactions[transactionId] = Transaction({
destination: destination,
value: value,
data: data,
executed: false
});
transactionCount += 1;
Submission(transactionId);
| * Internal functions
/ @dev Adds a new transaction to the transaction mapping, if transaction does not exist yet.
/ @param destination Transaction target address.
/ @param value Transaction ether value.
/ @param data Transaction data payload.
/ @return Returns transaction ID. |
217 | MultiSigWallet | getConfirmationCount | contract MultiSigWallet {
uint constant public MAX_OWNER_COUNT = 50;
event Confirmation(address indexed sender, uint indexed transactionId);
event Revocation(address indexed sender, uint indexed transactionId);
event Submission(uint indexed transactionId);
event Execution(uint indexed trans... |
for (uint i=0; i<owners.length; i++)
if (confirmations[transactionId][owners[i]])
count += 1;
| * Web3 call functions
/ @dev Returns number of confirmations of a transaction.
/ @param transactionId Transaction ID.
/ @return Number of confirmations. |
217 | MultiSigWallet | getTransactionCount | contract MultiSigWallet {
uint constant public MAX_OWNER_COUNT = 50;
event Confirmation(address indexed sender, uint indexed transactionId);
event Revocation(address indexed sender, uint indexed transactionId);
event Submission(uint indexed transactionId);
event Execution(uint indexed trans... |
for (uint i=0; i<transactionCount; i++)
if ( pending && !transactions[i].executed
|| executed && transactions[i].executed)
count += 1;
| / @dev Returns total number of transactions after filers are applied.
/ @param pending Include pending transactions.
/ @param executed Include executed transactions.
/ @return Total number of transactions after filters are applied. |
217 | MultiSigWallet | getOwners | contract MultiSigWallet {
uint constant public MAX_OWNER_COUNT = 50;
event Confirmation(address indexed sender, uint indexed transactionId);
event Revocation(address indexed sender, uint indexed transactionId);
event Submission(uint indexed transactionId);
event Execution(uint indexed trans... |
return owners;
| / @dev Returns list of owners.
/ @return List of owner addresses. |
217 | MultiSigWallet | getConfirmations | contract MultiSigWallet {
uint constant public MAX_OWNER_COUNT = 50;
event Confirmation(address indexed sender, uint indexed transactionId);
event Revocation(address indexed sender, uint indexed transactionId);
event Submission(uint indexed transactionId);
event Execution(uint indexed trans... |
address[] memory confirmationsTemp = new address[](owners.length);
uint count = 0;
uint i;
for (i=0; i<owners.length; i++)
if (confirmations[transactionId][owners[i]]) {
confirmationsTemp[count] = owners[i];
count += 1;
}
... | / @dev Returns array with owner addresses, which confirmed transaction.
/ @param transactionId Transaction ID.
/ @return Returns array of owner addresses. |
217 | MultiSigWallet | getTransactionIds | contract MultiSigWallet {
uint constant public MAX_OWNER_COUNT = 50;
event Confirmation(address indexed sender, uint indexed transactionId);
event Revocation(address indexed sender, uint indexed transactionId);
event Submission(uint indexed transactionId);
event Execution(uint indexed trans... |
uint[] memory transactionIdsTemp = new uint[](transactionCount);
uint count = 0;
uint i;
for (i=0; i<transactionCount; i++)
if ( pending && !transactions[i].executed
|| executed && transactions[i].executed)
{
transactionI... | / @dev Returns list of transaction IDs in defined range.
/ @param from Index start position of transaction array.
/ @param to Index end position of transaction array.
/ @param pending Include pending transactions.
/ @param executed Include executed transactions.
/ @return Returns array of transaction IDs. |
217 | MultiSigWallet | createCoin | contract MultiSigWallet {
uint constant public MAX_OWNER_COUNT = 50;
event Confirmation(address indexed sender, uint indexed transactionId);
event Revocation(address indexed sender, uint indexed transactionId);
event Submission(uint indexed transactionId);
event Execution(uint indexed trans... |
require(flag == true);
CoinCreation(new Gifto());
flag = false;
| / @dev Create new coin. |
219 | 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 |
219 | 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. |
219 | 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. |
219 | 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 transfer... |
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 |
219 | 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 transfer... |
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... |
219 | 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 transfer... |
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. |
219 | 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 transfer... |
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
* @... |
219 | 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 transfer... |
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
* @... |
219 | Ownable | null | contract Ownable {
address public owner;
event OwnershipRenounced(address indexed previousOwner);
event OwnershipTransferred(
address indexed previousOwner,
address indexed newOwner
);
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* a... |
owner = msg.sender;
| *
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account. |
219 | Ownable | renounceOwnership | contract Ownable {
address public owner;
event OwnershipRenounced(address indexed previousOwner);
event OwnershipTransferred(
address indexed previousOwner,
address indexed newOwner
);
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* a... |
emit OwnershipRenounced(owner);
owner = address(0);
| *
* @dev Allows the current owner to relinquish control of the contract.
* @notice Renouncing to ownership will leave the contract without an owner.
* It will not be possible to call the functions with the `onlyOwner`
* modifier anymore. |
219 | Ownable | transferOwnership | contract Ownable {
address public owner;
event OwnershipRenounced(address indexed previousOwner);
event OwnershipTransferred(
address indexed previousOwner,
address indexed newOwner
);
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* a... |
_transferOwnership(_newOwner);
| *
* @dev Allows the current owner to transfer control of the contract to a newOwner.
* @param _newOwner The address to transfer ownership to. |
219 | Ownable | _transferOwnership | contract Ownable {
address public owner;
event OwnershipRenounced(address indexed previousOwner);
event OwnershipTransferred(
address indexed previousOwner,
address indexed newOwner
);
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* a... |
require(_newOwner != address(0));
emit OwnershipTransferred(owner, _newOwner);
owner = _newOwner;
| *
* @dev Transfers control of the contract to a newOwner.
* @param _newOwner The address to transfer ownership to. |
219 | MintableToken | mint | contract MintableToken is StandardToken, Ownable {
event Mint(address indexed to, uint256 amount);
event MintFinished();
bool public mintingFinished = false;
modifier canMint() {
require(!mintingFinished);
_;
}
modifier hasMintPermission() {
require(msg.sender == owner);
_;... |
totalSupply_ = totalSupply_.add(_amount);
balances[_to] = balances[_to].add(_amount);
emit Mint(_to, _amount);
emit Transfer(address(0), _to, _amount);
return true;
| *
* @dev Function to mint tokens
* @param _to The address that will receive the minted tokens.
* @param _amount The amount of tokens to mint.
* @return A boolean that indicates if the operation was successful. |
219 | MintableToken | finishMinting | contract MintableToken is StandardToken, Ownable {
event Mint(address indexed to, uint256 amount);
event MintFinished();
bool public mintingFinished = false;
modifier canMint() {
require(!mintingFinished);
_;
}
modifier hasMintPermission() {
require(msg.sender == owner);
_;... |
mintingFinished = true;
emit MintFinished();
return true;
| *
* @dev Function to stop minting new tokens.
* @return True if the operation was successful. |
220 | Ownable | null | contract Ownable {
address public owner;
event OwnershipRenounced(address indexed previousOwner);
event OwnershipTransferred(
address indexed previousOwner,
address indexed newOwner
);
/**
* @dev The Ownable constructor sets the original `owner` of the contract to th... |
owner = msg.sender;
| *
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account. |
220 | Ownable | renounceOwnership | contract Ownable {
address public owner;
event OwnershipRenounced(address indexed previousOwner);
event OwnershipTransferred(
address indexed previousOwner,
address indexed newOwner
);
/**
* @dev The Ownable constructor sets the original `owner` of the contract to th... |
emit OwnershipRenounced(owner);
owner = address(0);
| *
* @dev Allows the current owner to relinquish control of the contract.
* @notice Renouncing to ownership will leave the contract without an owner.
* It will not be possible to call the functions with the `onlyOwner`
* modifier anymore. |
220 | Ownable | transferOwnership | contract Ownable {
address public owner;
event OwnershipRenounced(address indexed previousOwner);
event OwnershipTransferred(
address indexed previousOwner,
address indexed newOwner
);
/**
* @dev The Ownable constructor sets the original `owner` of the contract to th... |
_transferOwnership(_newOwner);
| *
* @dev Allows the current owner to transfer control of the contract to a newOwner.
* @param _newOwner The address to transfer ownership to. |
220 | Ownable | _transferOwnership | contract Ownable {
address public owner;
event OwnershipRenounced(address indexed previousOwner);
event OwnershipTransferred(
address indexed previousOwner,
address indexed newOwner
);
/**
* @dev The Ownable constructor sets the original `owner` of the contract to th... |
require(_newOwner != address(0));
emit OwnershipTransferred(owner, _newOwner);
owner = _newOwner;
| *
* @dev Transfers control of the contract to a newOwner.
* @param _newOwner The address to transfer ownership to. |
220 | StandardToken | totalSupply | contract StandardToken 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 T... |
return totalSupply_;
| *
* @dev Total number of tokens in existence |
220 | StandardToken | transfer | contract StandardToken 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(_value <= balances[msg.sender]);
require(_to != address(0));
balances[msg.sender] = balances[msg.sender].sub(_value);
balances[_to] = balances[_to].add(_value);
emit Transfer(msg.sender, _to, _value);
return true;
| *
* @dev Transfer token for a specified address
* @param _to The address to transfer to.
* @param _value The amount to be transferred. |
220 | StandardToken | balanceOf | contract StandardToken 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. |
220 | StandardToken | transferFrom | contract StandardToken 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(_value <= balances[_from]);
require(_value <= allowed[_from][msg.sender]);
require(_to != address(0));
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 |
220 | StandardToken | approve | contract StandardToken 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_;
}
/... |
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 this
... |
220 | StandardToken | allowance | contract StandardToken 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 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. |
220 | StandardToken | increaseApproval | contract StandardToken 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_;
}
/... |
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
* @... |
220 | StandardToken | decreaseApproval | contract StandardToken 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_;
}
/... |
uint256 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.send... | *
* @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
* @... |
220 | BurnableToken | burn | contract BurnableToken is StandardToken {
event Burn(address indexed burner, uint256 value);
/**
* @dev Burns a specific amount of tokens.
* @param _value The amount of token to be burned.
*/
function burn(uint256 _value) public {<FILL_FUNCTION_BODY>}
function _burn(address _who... |
_burn(msg.sender, _value);
| *
* @dev Burns a specific amount of tokens.
* @param _value The amount of token to be burned. |
220 | MintableToken | mint | contract MintableToken is StandardToken, Ownable {
event Mint(address indexed to, uint256 amount);
event MintFinished();
bool public mintingFinished = false;
modifier canMint() {
require(!mintingFinished);
_;
}
modifier hasMintPermission() {
require(msg.s... |
totalSupply_ = totalSupply_.add(_amount);
balances[_to] = balances[_to].add(_amount);
emit Mint(_to, _amount);
emit Transfer(address(0), _to, _amount);
return true;
| *
* @dev Function to mint tokens
* @param _to The address that will receive the minted tokens.
* @param _amount The amount of tokens to mint.
* @return A boolean that indicates if the operation was successful. |
220 | MintableToken | finishMinting | contract MintableToken is StandardToken, Ownable {
event Mint(address indexed to, uint256 amount);
event MintFinished();
bool public mintingFinished = false;
modifier canMint() {
require(!mintingFinished);
_;
}
modifier hasMintPermission() {
require(msg.s... |
mintingFinished = true;
emit MintFinished();
return true;
| *
* @dev Function to stop minting new tokens.
* @return True if the operation was successful. |
220 | Controlled | enableTransfer | contract Controlled is Ownable{
constructor() public {
setExclude(msg.sender);
}
// Flag that determines if the token is transferable or not.
bool public transferEnabled = false;
// flag that makes locked address effect
bool public plockFlag=true;
mapping(address => boo... |
transferEnabled = _enable;
| 控制全局全局锁 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.