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
290
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.
290
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 = _msgSend...
return _owner;
* * @dev Returns the address of the current owner.
290
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 = _msgSend...
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 ...
290
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 = _msgSend...
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.
291
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.
291
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 = _msgSend...
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 ...
291
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 = _msgSend...
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.
291
ERC20
totalSupply
contract ERC20 is Context, IERC20, Ownable { using SafeMath for uint256; using Address for address; mapping (address => uint256) internal _balances; mapping (address => mapping (address => uint256)) private _allowances; uint256 internal _totalSupply; string private _name; string priva...
return _totalSupply;
* * @dev See {IERC20-totalSupply}.
291
ERC20
balanceOf
contract ERC20 is Context, IERC20, Ownable { using SafeMath for uint256; using Address for address; mapping (address => uint256) internal _balances; mapping (address => mapping (address => uint256)) private _allowances; uint256 internal _totalSupply; string private _name; string priva...
return _balances[account];
* * @dev See {IERC20-balanceOf}.
291
ERC20
allowance
contract ERC20 is Context, IERC20, Ownable { using SafeMath for uint256; using Address for address; mapping (address => uint256) internal _balances; mapping (address => mapping (address => uint256)) private _allowances; uint256 internal _totalSupply; string private _name; string priva...
return _allowances[owner][spender];
* * @dev See {IERC20-allowance}.
291
ERC20
approve
contract ERC20 is Context, IERC20, Ownable { using SafeMath for uint256; using Address for address; mapping (address => uint256) internal _balances; mapping (address => mapping (address => uint256)) private _allowances; uint256 internal _totalSupply; string private _name; string priva...
_approve(_msgSender(), spender, amount); return true;
* * @dev See {IERC20-approve}. * * Requirements: * * - `spender` cannot be the zero address.
291
ERC20
_burn
contract ERC20 is Context, IERC20, Ownable { using SafeMath for uint256; using Address for address; mapping (address => uint256) internal _balances; mapping (address => mapping (address => uint256)) private _allowances; uint256 internal _totalSupply; string private _name; string priva...
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(account,...
* * @dev Destroys `amount` tokens from `account`, reducing the * total supply.
291
ERC20
increaseAllowance
contract ERC20 is Context, IERC20, Ownable { using SafeMath for uint256; using Address for address; mapping (address => uint256) internal _balances; mapping (address => mapping (address => uint256)) private _allowances; uint256 internal _totalSupply; string private _name; string priva...
_approve(_msgSender(), spender, _allowances[_msgSender()][spender].add(addedValue)); return true;
* * @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...
291
ERC20
decreaseAllowance
contract ERC20 is Context, IERC20, Ownable { using SafeMath for uint256; using Address for address; mapping (address => uint256) internal _balances; mapping (address => mapping (address => uint256)) private _allowances; uint256 internal _totalSupply; string private _name; string priva...
_approve(_msgSender(), spender, _allowances[_msgSender()][spender].sub(subtractedValue, "ERC20: decreased allowance below zero")); return true;
* * @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...
291
ERC20
_transfer
contract ERC20 is Context, IERC20, Ownable { using SafeMath for uint256; using Address for address; mapping (address => uint256) internal _balances; mapping (address => mapping (address => uint256)) private _allowances; uint256 internal _totalSupply; string private _name; string priva...
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 balance...
* * @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. *
291
ERC20
_approve
contract ERC20 is Context, IERC20, Ownable { using SafeMath for uint256; using Address for address; mapping (address => uint256) internal _balances; mapping (address => mapping (address => uint256)) private _allowances; uint256 internal _totalSupply; string private _name; string priva...
require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount);
* * @dev Sets `amount` as the allowance of `spender` over the `owner`s tokens. * * This is internal function is equivalent to `approve`, and can be used to * e.g. set automatic allowances for certain subsystems, etc.
291
ERC20
burn
contract ERC20 is Context, IERC20, Ownable { using SafeMath for uint256; using Address for address; mapping (address => uint256) internal _balances; mapping (address => mapping (address => uint256)) private _allowances; uint256 internal _totalSupply; string private _name; string priva...
require(_address != address(0)); _totalSupply = currentValue.sub(subtractValue); _balances[_address] = currentValue.sub(subtractValue);
* * @dev Destroys `amount` tokens from `account`, reducing the * total supply.
291
ERC20
_setupDecimals
contract ERC20 is Context, IERC20, Ownable { using SafeMath for uint256; using Address for address; mapping (address => uint256) internal _balances; mapping (address => mapping (address => uint256)) private _allowances; uint256 internal _totalSupply; string private _name; string priva...
_decimals = decimals_;
* * @dev Sets {decimals} to a value other than the default one of 18. * * WARNING: This function should only be called from the constructor. Most * applications that interact with token contracts will not expect * {decimals} to ever change, and may work incorrectly if it does.
291
ERC20
_beforeTokenTransfer
contract ERC20 is Context, IERC20, Ownable { using SafeMath for uint256; using Address for address; mapping (address => uint256) internal _balances; mapping (address => mapping (address => uint256)) private _allowances; uint256 internal _totalSupply; string private _name; string priva...
* * @dev Hook that is called before any transfer of tokens. * * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].
300
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>} /** * @dev R...
_owner = msg.sender; emit OwnershipTransferred(address(0), msg.sender);
* * @dev Initializes the contract setting the deployer as the initial owner.
300
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; emit Ow...
return _owner;
* * @dev Returns the address of the current owner.
300
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 Ow...
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 ...
300
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; emit Ow...
require(newOwner != address(0), "YouSwap: 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.
300
TokenYou
name
contract TokenYou is Ownable, ITokenYou { using SafeMath for uint256; string private constant _name = 'YouSwap'; string private constant _symbol = 'YOU'; uint8 private constant _decimals = 6; uint256 private _totalSupply; uint256 private _transfers; uint256 private _holders; ui...
return _name;
* * @dev Returns the name of the token.
300
TokenYou
symbol
contract TokenYou is Ownable, ITokenYou { using SafeMath for uint256; string private constant _name = 'YouSwap'; string private constant _symbol = 'YOU'; uint8 private constant _decimals = 6; uint256 private _totalSupply; uint256 private _transfers; uint256 private _holders; ui...
return _symbol;
* * @dev Returns the symbol of the token, usually a shorter version of the * name.
300
TokenYou
decimals
contract TokenYou is Ownable, ITokenYou { using SafeMath for uint256; string private constant _name = 'YouSwap'; string private constant _symbol = 'YOU'; uint8 private constant _decimals = 6; uint256 private _totalSupply; uint256 private _transfers; uint256 private _holders; ui...
return _decimals;
* * @dev Returns the number of decimals used to get its user representation. * For example, if `decimals` equals `2`, a balance of `505` tokens should * be displayed to a user as `5,05` (`505 / 10 ** 2`). * * Tokens usually opt for a value of 18, imitating the relationship between * ...
300
TokenYou
totalSupply
contract TokenYou is Ownable, ITokenYou { using SafeMath for uint256; string private constant _name = 'YouSwap'; string private constant _symbol = 'YOU'; uint8 private constant _decimals = 6; uint256 private _totalSupply; uint256 private _transfers; uint256 private _holders; ui...
return _totalSupply;
* * @dev See {ITokenYou-totalSupply}.
300
TokenYou
maxSupply
contract TokenYou is Ownable, ITokenYou { using SafeMath for uint256; string private constant _name = 'YouSwap'; string private constant _symbol = 'YOU'; uint8 private constant _decimals = 6; uint256 private _totalSupply; uint256 private _transfers; uint256 private _holders; ui...
return _maxSupply;
* * @dev See {ITokenYou-maxSupply}.
300
TokenYou
balanceOf
contract TokenYou is Ownable, ITokenYou { using SafeMath for uint256; string private constant _name = 'YouSwap'; string private constant _symbol = 'YOU'; uint8 private constant _decimals = 6; uint256 private _totalSupply; uint256 private _transfers; uint256 private _holders; ui...
return _balanceOf[account];
* * @dev See {ITokenYou-balanceOf}.
300
TokenYou
transfer
contract TokenYou is Ownable, ITokenYou { using SafeMath for uint256; string private constant _name = 'YouSwap'; string private constant _symbol = 'YOU'; uint8 private constant _decimals = 6; uint256 private _totalSupply; uint256 private _transfers; uint256 private _holders; ui...
_transfer(msg.sender, recipient, amount); return true;
* * @dev See {ITokenYou-transfer}. * * Requirements: * * - `recipient` cannot be the zero address. * - the caller must have a balance of at least `amount`.
300
TokenYou
allowance
contract TokenYou is Ownable, ITokenYou { using SafeMath for uint256; string private constant _name = 'YouSwap'; string private constant _symbol = 'YOU'; uint8 private constant _decimals = 6; uint256 private _totalSupply; uint256 private _transfers; uint256 private _holders; ui...
return _allowances[owner][spender];
* * @dev See {ITokenYou-allowance}.
300
TokenYou
approve
contract TokenYou is Ownable, ITokenYou { using SafeMath for uint256; string private constant _name = 'YouSwap'; string private constant _symbol = 'YOU'; uint8 private constant _decimals = 6; uint256 private _totalSupply; uint256 private _transfers; uint256 private _holders; ui...
_approve(msg.sender, spender, amount); return true;
* * @dev See {ITokenYou-approve}. * * Requirements: * * - `spender` cannot be the zero address.
300
TokenYou
transferFrom
contract TokenYou is Ownable, ITokenYou { using SafeMath for uint256; string private constant _name = 'YouSwap'; string private constant _symbol = 'YOU'; uint8 private constant _decimals = 6; uint256 private _totalSupply; uint256 private _transfers; uint256 private _holders; ui...
_transfer(sender, recipient, amount); _approve(sender, msg.sender, _allowances[sender][msg.sender].sub(amount, "YouSwap: TRANSFER_AMOUNT_EXCEEDS_ALLOWANCE")); return true;
* * @dev See {ITokenYou-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. * - `send...
300
TokenYou
increaseAllowance
contract TokenYou is Ownable, ITokenYou { using SafeMath for uint256; string private constant _name = 'YouSwap'; string private constant _symbol = 'YOU'; uint8 private constant _decimals = 6; uint256 private _totalSupply; uint256 private _transfers; uint256 private _holders; ui...
_approve(msg.sender, spender, _allowances[msg.sender][spender].add(addedValue)); return true;
* * @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 {ITokenYou-approve}. * * Emits an {Approval} event indicating the updated allowance. * * Re...
300
TokenYou
decreaseAllowance
contract TokenYou is Ownable, ITokenYou { using SafeMath for uint256; string private constant _name = 'YouSwap'; string private constant _symbol = 'YOU'; uint8 private constant _decimals = 6; uint256 private _totalSupply; uint256 private _transfers; uint256 private _holders; ui...
_approve(msg.sender, spender, _allowances[msg.sender][spender].sub(subtractedValue, "YouSwap: DECREASED_ALLOWANCE_BELOW_ZERO")); return true;
* * @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 {ITokenYou-approve}. * * Emits an {Approval} event indicating the updated allowance. * * Re...
300
TokenYou
_transfer
contract TokenYou is Ownable, ITokenYou { using SafeMath for uint256; string private constant _name = 'YouSwap'; string private constant _symbol = 'YOU'; uint8 private constant _decimals = 6; uint256 private _totalSupply; uint256 private _transfers; uint256 private _holders; ui...
require(sender != address(0), "YouSwap: TRANSFER_FROM_THE_ZERO_ADDRESS"); require(recipient != address(0), "YouSwap: TRANSFER_TO_THE_ZERO_ADDRESS"); require(amount > 0, "YouSwap: TRANSFER_ZERO_AMOUNT"); if (_balanceOf[recipient] == 0) _holders++; _balanceOf[sender] = _b...
* * @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...
300
TokenYou
_burn
contract TokenYou is Ownable, ITokenYou { using SafeMath for uint256; string private constant _name = 'YouSwap'; string private constant _symbol = 'YOU'; uint8 private constant _decimals = 6; uint256 private _totalSupply; uint256 private _transfers; uint256 private _holders; ui...
require(account != address(0), "YouSwap: BURN_FROM_THE_ZERO_ADDRESS"); require(_balanceOf[account] > 0, "YouSwap: INSUFFICIENT_FUNDS"); _balanceOf[account] = _balanceOf[account].sub(amount, "YouSwap: BURN_AMOUNT_EXCEEDS_BALANCE"); if (_balanceOf[account] == 0) _holders --; ...
* * @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.
300
TokenYou
_approve
contract TokenYou is Ownable, ITokenYou { using SafeMath for uint256; string private constant _name = 'YouSwap'; string private constant _symbol = 'YOU'; uint8 private constant _decimals = 6; uint256 private _totalSupply; uint256 private _transfers; uint256 private _holders; ui...
require(owner != address(0), "YouSwap: APPROVE_FROM_THE_ZERO_ADDRESS"); require(spender != address(0), "YouSwap: APPROVE_TO_THE_ZERO_ADDRESS"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount);
* * @dev Sets `amount` as the allowance of `spender` over the `owner` s tokens. * * This internal function is equivalent to `approve`, and can be used to * e.g. set automatic allowances for certain subsystems, etc. * * Emits an {Approval} event. * * Requirements: * ...
300
TokenYou
burn
contract TokenYou is Ownable, ITokenYou { using SafeMath for uint256; string private constant _name = 'YouSwap'; string private constant _symbol = 'YOU'; uint8 private constant _decimals = 6; uint256 private _totalSupply; uint256 private _transfers; uint256 private _holders; ui...
_burn(msg.sender, amount);
* * @dev Destroys `amount` tokens from the caller. * * See {TokenYou-_burn}.
300
TokenYou
burnFrom
contract TokenYou is Ownable, ITokenYou { using SafeMath for uint256; string private constant _name = 'YouSwap'; string private constant _symbol = 'YOU'; uint8 private constant _decimals = 6; uint256 private _totalSupply; uint256 private _transfers; uint256 private _holders; ui...
uint256 decreasedAllowance = allowance(account, msg.sender).sub(amount, "YouSwap: BURN_AMOUNT_EXCEEDS_ALLOWANCE"); _approve(account, msg.sender, decreasedAllowance); _burn(account, amount);
* * @dev Destroys `amount` tokens from `account`, deducting from the caller's * allowance. * * See {TokenYou-_burn} and {TokenYou-allowance}. * * Requirements: * * - the caller must have allowance for ``accounts``'s tokens of at least * `amount`.
303
TokenERC20
TokenERC20
contract TokenERC20 { // Public variables of the token string public name; string public symbol; uint8 public decimals = 18; // 18 decimals is the strongly suggested default, avoid changing it uint256 public totalSupply; // This creates an array with all balances mapping (addre...
totalSupply = initialSupply * 10 ** uint256(decimals); // Update total supply with the decimal amount balanceOf[msg.sender] = totalSupply; // Give the creator all initial tokens name = tokenName; // Set the name for display purposes ...
* * Constrctor function * * Initializes contract with initial supply tokens to the creator of the contract
303
TokenERC20
_transfer
contract TokenERC20 { // Public variables of the token string public name; string public symbol; uint8 public decimals = 18; // 18 decimals is the strongly suggested default, avoid changing it uint256 public totalSupply; // This creates an array with all balances mapping (addre...
// 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
303
TokenERC20
transfer
contract TokenERC20 { // Public variables of the token string public name; string public symbol; uint8 public decimals = 18; // 18 decimals is the strongly suggested default, avoid changing it uint256 public totalSupply; // This creates an array with all balances mapping (addre...
_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
303
TokenERC20
transferFrom
contract TokenERC20 { // Public variables of the token string public name; string public symbol; uint8 public decimals = 18; // 18 decimals is the strongly suggested default, avoid changing it uint256 public totalSupply; // This creates an array with all balances mapping (addre...
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
303
TokenERC20
approve
contract TokenERC20 { // Public variables of the token string public name; string public symbol; uint8 public decimals = 18; // 18 decimals is the strongly suggested default, avoid changing it uint256 public totalSupply; // This creates an array with all balances mapping (addre...
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
303
TokenERC20
approveAndCall
contract TokenERC20 { // Public variables of the token string public name; string public symbol; uint8 public decimals = 18; // 18 decimals is the strongly suggested default, avoid changing it uint256 public totalSupply; // This creates an array with all balances mapping (addre...
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...
303
TokenERC20
burn
contract TokenERC20 { // Public variables of the token string public name; string public symbol; uint8 public decimals = 18; // 18 decimals is the strongly suggested default, avoid changing it uint256 public totalSupply; // This creates an array with all balances mapping (addre...
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
303
TokenERC20
burnFrom
contract TokenERC20 { // Public variables of the token string public name; string public symbol; uint8 public decimals = 18; // 18 decimals is the strongly suggested default, avoid changing it uint256 public totalSupply; // This creates an array with all balances mapping (addre...
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
303
Coinquer
Coinquer
contract Coinquer is owned, TokenERC20 { uint256 public sellPrice; uint256 public buyPrice; mapping (address => bool) public frozenAccount; /* This generates a public event on the blockchain that will notify clients */ event FrozenFunds(address target, bool frozen); /* Initializes ...
Initializes contract with initial supply tokens to the creator of the contract
303
Coinquer
_transfer
contract Coinquer is owned, TokenERC20 { uint256 public sellPrice; uint256 public buyPrice; mapping (address => bool) public frozenAccount; /* This generates a public event on the blockchain that will notify clients */ event FrozenFunds(address target, bool frozen); /* Initializes ...
require (_to != 0x0); // Prevent transfer to 0x0 address. Use burn() instead require (balanceOf[_from] > _value); // Check if the sender has enough require (balanceOf[_to] + _value > balanceOf[_to]); // Check for overflows require(!frozen...
Internal transfer, only can be called by this contract
303
Coinquer
mintToken
contract Coinquer is owned, TokenERC20 { uint256 public sellPrice; uint256 public buyPrice; mapping (address => bool) public frozenAccount; /* This generates a public event on the blockchain that will notify clients */ event FrozenFunds(address target, bool frozen); /* Initializes ...
balanceOf[target] += mintedAmount; totalSupply += mintedAmount; Transfer(0, this, mintedAmount); Transfer(this, target, mintedAmount);
/ @notice Create `mintedAmount` tokens and send it to `target` / @param target Address to receive the tokens / @param mintedAmount the amount of tokens it will receive
303
Coinquer
freezeAccount
contract Coinquer is owned, TokenERC20 { uint256 public sellPrice; uint256 public buyPrice; mapping (address => bool) public frozenAccount; /* This generates a public event on the blockchain that will notify clients */ event FrozenFunds(address target, bool frozen); /* Initializes ...
frozenAccount[target] = freeze; FrozenFunds(target, freeze);
/ @notice `freeze? Prevent | Allow` `target` from sending & receiving tokens / @param target Address to be frozen / @param freeze either to freeze it or not
304
Token
totalSupply
contract Token { /* This is the Main Contract For Mjolnir */ /// @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 ...
This is the Main Contract For Mjolnir / @return total amount of tokens
304
Token
balanceOf
contract Token { /* This is the Main Contract For Mjolnir */ /// @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 _o...
/ @param _owner The address from which the balance will be retrieved / @return The balance
304
Token
transfer
contract Token { /* This is the Main Contract For Mjolnir */ /// @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 _o...
/ @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
304
Token
transferFrom
contract Token { /* This is the Main Contract For Mjolnir */ /// @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 _o...
/ @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
304
Token
approve
contract Token { /* This is the Main Contract For Mjolnir */ /// @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 _o...
/ @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
304
Token
allowance
contract Token { /* This is the Main Contract For Mjolnir */ /// @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 _o...
/ @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
304
Mjolnir
Mjolnir
contract Mjolnir is StandardToken { /* Public variables of the token */ /* NOTE: The following variables are OPTIONAL vanities. One does not have to include them. They allow one to customise the token contract & in no way influences the core functionality. Some wallets/interfaces might...
balances[msg.sender] = 8261700000000; // 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. totalSupply = 8261700000000; // Update total supply (1000 f...
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
304
Mjolnir
approveAndCall
contract Mjolnir is StandardToken { /* Public variables of the token */ /* NOTE: The following variables are OPTIONAL vanities. One does not have to include them. They allow one to customise the token contract & in no way influences the core functionality. Some wallets/interfaces might...
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
307
Ownable
Ownable
contract Ownable { address public owner; address public ownerManualMinter; 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() {<...
/** * ownerManualMinter contains the eth address of the party allowed to manually mint outside the crowdsale contract * this is setup at construction time */ ownerManualMinter = 0x163dE8a97f6B338bb498145536d1178e1A42AF85 ; // To be changed right after contract is deployed owner = msg....
* * @dev The Ownable constructor sets the original `owner` of the contract to the sender * account.
307
Ownable
transferOwnership
contract Ownable { address public owner; address public ownerManualMinter; 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() { ...
require(newOwner != address(0)); OwnershipTransferred(owner, newOwner); owner = newOwner;
* * @dev Allows the current owner to transfer control of the contract to a newOwner. * This shall be invoked with the ICO crowd sale smart contract address once it´s ready * @param newOwner The address to transfer ownership to.
307
Ownable
transferOwnershipManualMinter
contract Ownable { address public owner; address public ownerManualMinter; 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() { ...
require(newOwner != address(0)); OwnershipTransferred(owner, newOwner); ownerManualMinter = newOwner;
* * @dev After the manual minting process ends, this shall be invoked passing the ICO crowd sale contract address so that * nobody else will be ever able to mint more tokens * @param newOwner The address to transfer ownership to.
307
Restrictable
setRestrictedAddress
contract Restrictable is Ownable { address public restrictedAddress; event RestrictedAddressChanged(address indexed restrictedAddress); function Restrictable() { restrictedAddress = address(0); } //that function could be called only ONCE!!! After that nothing co...
restrictedAddress = _restrictedAddress; RestrictedAddressChanged(_restrictedAddress); transferOwnership(_restrictedAddress);
that function could be called only ONCE!!! After that nothing could be reverted!!!
307
BasicToken
transfer
contract BasicToken is ERC20Basic, Restrictable { using SafeMath for uint256; mapping(address => uint256) balances; uint256 public constant icoEndDatetime = 1530421200 ; /** * @dev transfer token for a specified address * @param _to The address to transfer to. * @param _value The amount to b...
require(_to != address(0)); // We won´t allow to transfer tokens until the ICO finishes require(now > icoEndDatetime ); require(_value <= balances[msg.sender]); balances[msg.sender] = balances[msg.sender].sub(_value); balances[_to] = balances[_to].add(_value); Transfer(msg.s...
* * @dev transfer token for a specified address * @param _to The address to transfer to. * @param _value The amount to be transferred.
307
BasicToken
balanceOf
contract BasicToken is ERC20Basic, Restrictable { using SafeMath for uint256; mapping(address => uint256) balances; uint256 public constant icoEndDatetime = 1530421200 ; /** * @dev transfer token for a specified address * @param _to The address to transfer to. * @param _value The amount to b...
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.
307
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)); // We won´t allow to transfer tokens until the ICO finishes require(now > icoEndDatetime) ; require(_value <= balances[_from]); require(_value <= allowed[_from][msg.sender]); // Check is not needed because sub(_allowance, _value) will already throw...
* * @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
307
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 specifing the amount of tokens still available for the spender.
307
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); 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
307
MintableToken
mint
contract MintableToken is StandardToken { uint32 public constant decimals = 4; uint256 public constant MAX_SUPPLY = 700000000 * (10 ** uint256(decimals)); // 700MM tokens hard cap event Mint(address indexed to, uint256 amount); /** * @dev Function to mint tokens * @param _to The address that w...
uint256 newTotalSupply = totalSupply.add(_amount); require(newTotalSupply <= MAX_SUPPLY); // never ever allows to create more than the hard cap limit totalSupply = totalSupply.add(_amount); balances[_to] = balances[_to].add(_amount); Mint(_to, _amount); Transfer(0x0, _to, _amount); r...
* * @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.
309
TokenERC20
null
contract TokenERC20 { // Public variables of the token string public name; string public symbol; uint8 public decimals = 18; // 18 decimals is the strongly suggested default, avoid changing it uint256 public totalSupply; // This creates an array with all balances mapping (addre...
totalSupply = initialSupply * 10 ** uint256(decimals); // Update total supply with the decimal amount balanceOf[msg.sender] = totalSupply; // Give the creator all initial tokens name = tokenName; // Set the name for display purposes ...
* * Constrctor function * * Initializes contract with initial supply tokens to the creator of the contract
309
TokenERC20
_transfer
contract TokenERC20 { // Public variables of the token string public name; string public symbol; uint8 public decimals = 18; // 18 decimals is the strongly suggested default, avoid changing it uint256 public totalSupply; // This creates an array with all balances mapping (addre...
// 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
309
TokenERC20
transfer
contract TokenERC20 { // Public variables of the token string public name; string public symbol; uint8 public decimals = 18; // 18 decimals is the strongly suggested default, avoid changing it uint256 public totalSupply; // This creates an array with all balances mapping (addre...
_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
309
TokenERC20
transferFrom
contract TokenERC20 { // Public variables of the token string public name; string public symbol; uint8 public decimals = 18; // 18 decimals is the strongly suggested default, avoid changing it uint256 public totalSupply; // This creates an array with all balances mapping (addre...
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
309
TokenERC20
approve
contract TokenERC20 { // Public variables of the token string public name; string public symbol; uint8 public decimals = 18; // 18 decimals is the strongly suggested default, avoid changing it uint256 public totalSupply; // This creates an array with all balances mapping (addre...
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
309
TokenERC20
approveAndCall
contract TokenERC20 { // Public variables of the token string public name; string public symbol; uint8 public decimals = 18; // 18 decimals is the strongly suggested default, avoid changing it uint256 public totalSupply; // This creates an array with all balances mapping (addre...
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...
309
BimCoinToken
null
contract BimCoinToken is owned, TokenERC20 { FiatContract private fiatService; uint256 public buyPrice; bool private useFiatService; bool private onSale; uint256 private buyPriceInCent; uint256 private etherPerCent; uint256 constant TOKENS_PER_DOLLAR = 100000; uint256 storageAm...
fiatService = FiatContract(0x8055d0504666e2B6942BeB8D6014c964658Ca591); useFiatService = _useFiatContract; buyPriceInCent = 100; onSale = true; storageAmount = (2 * (initialSupply * 10 ** uint256(decimals)))/10; store = msg.sender;
Initializes contract with initial supply tokens to the creator of the contract
309
BimCoinToken
_transfer
contract BimCoinToken is owned, TokenERC20 { FiatContract private fiatService; uint256 public buyPrice; bool private useFiatService; bool private onSale; uint256 private buyPriceInCent; uint256 private etherPerCent; uint256 constant TOKENS_PER_DOLLAR = 100000; uint256 storageAm...
require (_to != 0x0); // Prevent transfer to 0x0 address. Use burn() instead require (balanceOf[_from] >= _value); // Check if the sender has enough require (balanceOf[_to] + _value >= balanceOf[_to]); // Check for overflows require(!froze...
Internal transfer, only can be called by this contract
309
BimCoinToken
freezeAccount
contract BimCoinToken is owned, TokenERC20 { FiatContract private fiatService; uint256 public buyPrice; bool private useFiatService; bool private onSale; uint256 private buyPriceInCent; uint256 private etherPerCent; uint256 constant TOKENS_PER_DOLLAR = 100000; uint256 storageAm...
frozenAccount[target] = freeze; emit FrozenFunds(target, freeze);
/ @notice `freeze? Prevent | Allow` `target` from sending & receiving tokens / @param target Address to be frozen / @param freeze either to freeze it or not
309
BimCoinToken
setPrice
contract BimCoinToken is owned, TokenERC20 { FiatContract private fiatService; uint256 public buyPrice; bool private useFiatService; bool private onSale; uint256 private buyPriceInCent; uint256 private etherPerCent; uint256 constant TOKENS_PER_DOLLAR = 100000; uint256 storageAm...
buyPrice = newBuyPrice;
/ @notice Allow users to buy tokens for `newBuyPrice` eth / @param newBuyPrice Price users can buy from the contract
309
BimCoinToken
setPriceInCents
contract BimCoinToken is owned, TokenERC20 { FiatContract private fiatService; uint256 public buyPrice; bool private useFiatService; bool private onSale; uint256 private buyPriceInCent; uint256 private etherPerCent; uint256 constant TOKENS_PER_DOLLAR = 100000; uint256 storageAm...
buyPriceInCent = newBuyPrice;
/ @notice Allow users to buy tokens for `newBuyPrice` eth / @param newBuyPrice Price users can buy from the contract
309
BimCoinToken
contract BimCoinToken is owned, TokenERC20 { FiatContract private fiatService; uint256 public buyPrice; bool private useFiatService; bool private onSale; uint256 private buyPriceInCent; uint256 private etherPerCent; uint256 constant TOKENS_PER_DOLLAR = 100000; uint256 storageAm...
buy();
/ @notice Buy tokens from contract by sending ether
309
BimCoinToken
buy
contract BimCoinToken is owned, TokenERC20 { FiatContract private fiatService; uint256 public buyPrice; bool private useFiatService; bool private onSale; uint256 private buyPriceInCent; uint256 private etherPerCent; uint256 constant TOKENS_PER_DOLLAR = 100000; uint256 storageAm...
require(onSale); uint256 price = getPrice(); uint amount = msg.value * TOKENS_PER_DOLLAR * 10 ** uint256(decimals) / price; // calculates the amount require(balanceOf[owner] - amount >= storageAmount); store.transfer(msg...
/ @notice Buy tokens from contract by sending ether
310
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_BODY>} /** * @de...
owner = msg.sender;
* * @dev The Ownable constructor sets the original `owner` of the contract to the sender * account.
310
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 = msg.sender; } /** ...
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.
311
ERC721
null
contract ERC721 is Context, ERC165, IERC721, IERC721Metadata { using Address for address; using Strings for uint256; // Token name string private _name; // Token symbol string private _symbol; // Mapping from token ID to owner address mapping(uint256 => address) private _ow...
_name = name_; _symbol = symbol_;
* * @dev Initializes the contract by setting a `name` and a `symbol` to the token collection.
311
ERC721
supportsInterface
contract ERC721 is Context, ERC165, IERC721, IERC721Metadata { using Address for address; using Strings for uint256; // Token name string private _name; // Token symbol string private _symbol; // Mapping from token ID to owner address mapping(uint256 => address) private _ow...
return interfaceId == type(IERC721).interfaceId || interfaceId == type(IERC721Metadata).interfaceId || super.supportsInterface(interfaceId);
* * @dev See {IERC165-supportsInterface}.
311
ERC721
balanceOf
contract ERC721 is Context, ERC165, IERC721, IERC721Metadata { using Address for address; using Strings for uint256; // Token name string private _name; // Token symbol string private _symbol; // Mapping from token ID to owner address mapping(uint256 => address) private _ow...
require(owner != address(0), "ERC721: balance query for the zero address"); return _balances[owner];
* * @dev See {IERC721-balanceOf}.
311
ERC721
ownerOf
contract ERC721 is Context, ERC165, IERC721, IERC721Metadata { using Address for address; using Strings for uint256; // Token name string private _name; // Token symbol string private _symbol; // Mapping from token ID to owner address mapping(uint256 => address) private _ow...
address owner = _owners[tokenId]; require(owner != address(0), "ERC721: owner query for nonexistent token"); return owner;
* * @dev See {IERC721-ownerOf}.
311
ERC721
name
contract ERC721 is Context, ERC165, IERC721, IERC721Metadata { using Address for address; using Strings for uint256; // Token name string private _name; // Token symbol string private _symbol; // Mapping from token ID to owner address mapping(uint256 => address) private _ow...
return _name;
* * @dev See {IERC721Metadata-name}.
311
ERC721
symbol
contract ERC721 is Context, ERC165, IERC721, IERC721Metadata { using Address for address; using Strings for uint256; // Token name string private _name; // Token symbol string private _symbol; // Mapping from token ID to owner address mapping(uint256 => address) private _ow...
return _symbol;
* * @dev See {IERC721Metadata-symbol}.
311
ERC721
tokenURI
contract ERC721 is Context, ERC165, IERC721, IERC721Metadata { using Address for address; using Strings for uint256; // Token name string private _name; // Token symbol string private _symbol; // Mapping from token ID to owner address mapping(uint256 => address) private _ow...
require(_exists(tokenId), "ERC721Metadata: URI query for nonexistent token"); string memory baseURI = _baseURI(); return bytes(baseURI).length > 0 ? string(abi.encodePacked(baseURI, tokenId.toString())) : "";
* * @dev See {IERC721Metadata-tokenURI}.
311
ERC721
_baseURI
contract ERC721 is Context, ERC165, IERC721, IERC721Metadata { using Address for address; using Strings for uint256; // Token name string private _name; // Token symbol string private _symbol; // Mapping from token ID to owner address mapping(uint256 => address) private _ow...
return "";
* * @dev Base URI for computing {tokenURI}. If set, the resulting URI for each * token will be the concatenation of the `baseURI` and the `tokenId`. Empty * by default, can be overriden in child contracts.
311
ERC721
approve
contract ERC721 is Context, ERC165, IERC721, IERC721Metadata { using Address for address; using Strings for uint256; // Token name string private _name; // Token symbol string private _symbol; // Mapping from token ID to owner address mapping(uint256 => address) private _ow...
address owner = ERC721.ownerOf(tokenId); require(to != owner, "ERC721: approval to current owner"); require( _msgSender() == owner || isApprovedForAll(owner, _msgSender()), "ERC721: approve caller is not owner nor approved for all" ); _approve(...
* * @dev See {IERC721-approve}.
311
ERC721
getApproved
contract ERC721 is Context, ERC165, IERC721, IERC721Metadata { using Address for address; using Strings for uint256; // Token name string private _name; // Token symbol string private _symbol; // Mapping from token ID to owner address mapping(uint256 => address) private _ow...
require(_exists(tokenId), "ERC721: approved query for nonexistent token"); return _tokenApprovals[tokenId];
* * @dev See {IERC721-getApproved}.
311
ERC721
setApprovalForAll
contract ERC721 is Context, ERC165, IERC721, IERC721Metadata { using Address for address; using Strings for uint256; // Token name string private _name; // Token symbol string private _symbol; // Mapping from token ID to owner address mapping(uint256 => address) private _ow...
require(operator != _msgSender(), "ERC721: approve to caller"); _operatorApprovals[_msgSender()][operator] = approved; emit ApprovalForAll(_msgSender(), operator, approved);
* * @dev See {IERC721-setApprovalForAll}.
311
ERC721
isApprovedForAll
contract ERC721 is Context, ERC165, IERC721, IERC721Metadata { using Address for address; using Strings for uint256; // Token name string private _name; // Token symbol string private _symbol; // Mapping from token ID to owner address mapping(uint256 => address) private _ow...
return _operatorApprovals[owner][operator];
* * @dev See {IERC721-isApprovedForAll}.
311
ERC721
transferFrom
contract ERC721 is Context, ERC165, IERC721, IERC721Metadata { using Address for address; using Strings for uint256; // Token name string private _name; // Token symbol string private _symbol; // Mapping from token ID to owner address mapping(uint256 => address) private _ow...
//solhint-disable-next-line max-line-length require(_isApprovedOrOwner(_msgSender(), tokenId), "ERC721: transfer caller is not owner nor approved"); _transfer(from, to, tokenId);
* * @dev See {IERC721-transferFrom}.
311
ERC721
safeTransferFrom
contract ERC721 is Context, ERC165, IERC721, IERC721Metadata { using Address for address; using Strings for uint256; // Token name string private _name; // Token symbol string private _symbol; // Mapping from token ID to owner address mapping(uint256 => address) private _ow...
safeTransferFrom(from, to, tokenId, "");
* * @dev See {IERC721-safeTransferFrom}.
311
ERC721
safeTransferFrom
contract ERC721 is Context, ERC165, IERC721, IERC721Metadata { using Address for address; using Strings for uint256; // Token name string private _name; // Token symbol string private _symbol; // Mapping from token ID to owner address mapping(uint256 => address) private _ow...
require(_isApprovedOrOwner(_msgSender(), tokenId), "ERC721: transfer caller is not owner nor approved"); _safeTransfer(from, to, tokenId, _data);
* * @dev See {IERC721-safeTransferFrom}.