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
85132
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>} /** * @dev Ret...
address msgSender = _msgSender(); _owner = msgSender; emit OwnershipTransferred(address(0), msgSender);
* * @dev Initializes the contract setting the deployer as the initial owner.
85132
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.
85132
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 owner...
85132
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.
85133
ERC165
supportsInterface
contract ERC165 is IERC165 { /* * bytes4(keccak256('supportsInterface(bytes4)')) == 0x01ffc9a7 */ bytes4 private constant _INTERFACE_ID_ERC165 = 0x01ffc9a7; /** * @dev Mapping of interface ids to whether or not it's supported. */ mapping(bytes4 => bool) private _supportedIn...
return _supportedInterfaces[interfaceId];
* * @dev See `IERC165.supportsInterface`. * * Time complexity O(1), guaranteed to always use less than 30 000 gas.
85133
ERC165
_registerInterface
contract ERC165 is IERC165 { /* * bytes4(keccak256('supportsInterface(bytes4)')) == 0x01ffc9a7 */ bytes4 private constant _INTERFACE_ID_ERC165 = 0x01ffc9a7; /** * @dev Mapping of interface ids to whether or not it's supported. */ mapping(bytes4 => bool) private _supportedIn...
require(interfaceId != 0xffffffff, "ERC165: invalid interface id"); _supportedInterfaces[interfaceId] = true;
* * @dev Registers the contract as an implementer of the interface defined by * `interfaceId`. Support of the actual ERC165 interface is automatic and * registering its interface id is not required. * * See `IERC165.supportsInterface`. * * Requirements: * * - `inter...
85133
ERC721
balanceOf
contract ERC721 is ERC165, IERC721 { using SafeMath for uint256; using Address for address; using Counters for Counters.Counter; // Equals to `bytes4(keccak256("onERC721Received(address,address,uint256,bytes)"))` // which can be also obtained as `IERC721Receiver(0).onERC721Received.selector` ...
require(owner != address(0), "ERC721: balance query for the zero address"); return _ownedTokensCount[owner].current();
* * @dev Gets the balance of the specified address. * @param owner address to query the balance of * @return uint256 representing the amount owned by the passed address
85133
ERC721
ownerOf
contract ERC721 is ERC165, IERC721 { using SafeMath for uint256; using Address for address; using Counters for Counters.Counter; // Equals to `bytes4(keccak256("onERC721Received(address,address,uint256,bytes)"))` // which can be also obtained as `IERC721Receiver(0).onERC721Received.selector` ...
address owner = _tokenOwner[tokenId]; require(owner != address(0), "ERC721: owner query for nonexistent token"); return owner;
* * @dev Gets the owner of the specified token ID. * @param tokenId uint256 ID of the token to query the owner of * @return address currently marked as the owner of the given token ID
85133
ERC721
approve
contract ERC721 is ERC165, IERC721 { using SafeMath for uint256; using Address for address; using Counters for Counters.Counter; // Equals to `bytes4(keccak256("onERC721Received(address,address,uint256,bytes)"))` // which can be also obtained as `IERC721Receiver(0).onERC721Received.selector` ...
address owner = ownerOf(tokenId); require(to != owner, "ERC721: approval to current owner"); require(msg.sender == owner || isApprovedForAll(owner, msg.sender), "ERC721: approve caller is not owner nor approved for all" ); _tokenApprovals[tokenId] = to; ...
* * @dev Approves another address to transfer the given token ID * The zero address indicates there is no approved address. * There can only be one approved address per token at a given time. * Can only be called by the token owner or an approved operator. * @param to address to be approve...
85133
ERC721
getApproved
contract ERC721 is ERC165, IERC721 { using SafeMath for uint256; using Address for address; using Counters for Counters.Counter; // Equals to `bytes4(keccak256("onERC721Received(address,address,uint256,bytes)"))` // which can be also obtained as `IERC721Receiver(0).onERC721Received.selector` ...
require(_exists(tokenId), "ERC721: approved query for nonexistent token"); return _tokenApprovals[tokenId];
* * @dev Gets the approved address for a token ID, or zero if no address set * Reverts if the token ID does not exist. * @param tokenId uint256 ID of the token to query the approval of * @return address currently approved for the given token ID
85133
ERC721
setApprovalForAll
contract ERC721 is ERC165, IERC721 { using SafeMath for uint256; using Address for address; using Counters for Counters.Counter; // Equals to `bytes4(keccak256("onERC721Received(address,address,uint256,bytes)"))` // which can be also obtained as `IERC721Receiver(0).onERC721Received.selector` ...
require(to != msg.sender, "ERC721: approve to caller"); _operatorApprovals[msg.sender][to] = approved; emit ApprovalForAll(msg.sender, to, approved);
* * @dev Sets or unsets the approval of a given operator * An operator is allowed to transfer all tokens of the sender on their behalf. * @param to operator address to set the approval * @param approved representing the status of the approval to be set
85133
ERC721
isApprovedForAll
contract ERC721 is ERC165, IERC721 { using SafeMath for uint256; using Address for address; using Counters for Counters.Counter; // Equals to `bytes4(keccak256("onERC721Received(address,address,uint256,bytes)"))` // which can be also obtained as `IERC721Receiver(0).onERC721Received.selector` ...
return _operatorApprovals[owner][operator];
* * @dev Tells whether an operator is approved by a given owner. * @param owner owner address which you want to query the approval of * @param operator operator address which you want to query the approval of * @return bool whether the given operator is approved by the given owner
85133
ERC721
transferFrom
contract ERC721 is ERC165, IERC721 { using SafeMath for uint256; using Address for address; using Counters for Counters.Counter; // Equals to `bytes4(keccak256("onERC721Received(address,address,uint256,bytes)"))` // which can be also obtained as `IERC721Receiver(0).onERC721Received.selector` ...
//solhint-disable-next-line max-line-length require(_isApprovedOrOwner(msg.sender, tokenId), "ERC721: transfer caller is not owner nor approved"); _transferFrom(from, to, tokenId);
* * @dev Transfers the ownership of a given token ID to another address. * Usage of this method is discouraged, use `safeTransferFrom` whenever possible. * Requires the msg.sender to be the owner, approved, or operator. * @param from current owner of the token * @param to address to receiv...
85133
ERC721
safeTransferFrom
contract ERC721 is ERC165, IERC721 { using SafeMath for uint256; using Address for address; using Counters for Counters.Counter; // Equals to `bytes4(keccak256("onERC721Received(address,address,uint256,bytes)"))` // which can be also obtained as `IERC721Receiver(0).onERC721Received.selector` ...
safeTransferFrom(from, to, tokenId, "");
* * @dev Safely transfers the ownership of a given token ID to another address * If the target address is a contract, it must implement `onERC721Received`, * which is called upon a safe transfer, and return the magic value * `bytes4(keccak256("onERC721Received(address,address,uint256,bytes)"))`;...
85133
ERC721
safeTransferFrom
contract ERC721 is ERC165, IERC721 { using SafeMath for uint256; using Address for address; using Counters for Counters.Counter; // Equals to `bytes4(keccak256("onERC721Received(address,address,uint256,bytes)"))` // which can be also obtained as `IERC721Receiver(0).onERC721Received.selector` ...
transferFrom(from, to, tokenId); require(_checkOnERC721Received(from, to, tokenId, _data), "ERC721: transfer to non ERC721Receiver implementer");
* * @dev Safely transfers the ownership of a given token ID to another address * If the target address is a contract, it must implement `onERC721Received`, * which is called upon a safe transfer, and return the magic value * `bytes4(keccak256("onERC721Received(address,address,uint256,bytes)"))`;...
85133
ERC721
_exists
contract ERC721 is ERC165, IERC721 { using SafeMath for uint256; using Address for address; using Counters for Counters.Counter; // Equals to `bytes4(keccak256("onERC721Received(address,address,uint256,bytes)"))` // which can be also obtained as `IERC721Receiver(0).onERC721Received.selector` ...
address owner = _tokenOwner[tokenId]; return owner != address(0);
* * @dev Returns whether the specified token exists. * @param tokenId uint256 ID of the token to query the existence of * @return bool whether the token exists
85133
ERC721
_isApprovedOrOwner
contract ERC721 is ERC165, IERC721 { using SafeMath for uint256; using Address for address; using Counters for Counters.Counter; // Equals to `bytes4(keccak256("onERC721Received(address,address,uint256,bytes)"))` // which can be also obtained as `IERC721Receiver(0).onERC721Received.selector` ...
require(_exists(tokenId), "ERC721: operator query for nonexistent token"); address owner = ownerOf(tokenId); return (spender == owner || getApproved(tokenId) == spender || isApprovedForAll(owner, spender));
* * @dev Returns whether the given spender can transfer a given token ID. * @param spender address of the spender to query * @param tokenId uint256 ID of the token to be transferred * @return bool whether the msg.sender is approved for the given token ID, * is an operator of the owner, or ...
85133
ERC721
_mint
contract ERC721 is ERC165, IERC721 { using SafeMath for uint256; using Address for address; using Counters for Counters.Counter; // Equals to `bytes4(keccak256("onERC721Received(address,address,uint256,bytes)"))` // which can be also obtained as `IERC721Receiver(0).onERC721Received.selector` ...
require(to != address(0), "ERC721: mint to the zero address"); require(!_exists(tokenId), "ERC721: token already minted"); _tokenOwner[tokenId] = to; _ownedTokensCount[to].increment(); emit Transfer(address(0), to, tokenId);
* * @dev Internal function to mint a new token. * Reverts if the given token ID already exists. * @param to The address that will own the minted token * @param tokenId uint256 ID of the token to be minted
85133
ERC721
_burn
contract ERC721 is ERC165, IERC721 { using SafeMath for uint256; using Address for address; using Counters for Counters.Counter; // Equals to `bytes4(keccak256("onERC721Received(address,address,uint256,bytes)"))` // which can be also obtained as `IERC721Receiver(0).onERC721Received.selector` ...
require(ownerOf(tokenId) == owner, "ERC721: burn of token that is not own"); _clearApproval(tokenId); _ownedTokensCount[owner].decrement(); _tokenOwner[tokenId] = address(0); emit Transfer(owner, address(0), tokenId);
* * @dev Internal function to burn a specific token. * Reverts if the token does not exist. * Deprecated, use _burn(uint256) instead. * @param owner owner of the token to burn * @param tokenId uint256 ID of the token being burned
85133
ERC721
_burn
contract ERC721 is ERC165, IERC721 { using SafeMath for uint256; using Address for address; using Counters for Counters.Counter; // Equals to `bytes4(keccak256("onERC721Received(address,address,uint256,bytes)"))` // which can be also obtained as `IERC721Receiver(0).onERC721Received.selector` ...
_burn(ownerOf(tokenId), tokenId);
* * @dev Internal function to burn a specific token. * Reverts if the token does not exist. * @param tokenId uint256 ID of the token being burned
85133
ERC721
_transferFrom
contract ERC721 is ERC165, IERC721 { using SafeMath for uint256; using Address for address; using Counters for Counters.Counter; // Equals to `bytes4(keccak256("onERC721Received(address,address,uint256,bytes)"))` // which can be also obtained as `IERC721Receiver(0).onERC721Received.selector` ...
require(ownerOf(tokenId) == from, "ERC721: transfer of token that is not own"); require(to != address(0), "ERC721: transfer to the zero address"); _clearApproval(tokenId); _ownedTokensCount[from].decrement(); _ownedTokensCount[to].increment(); _tokenOwner[tok...
* * @dev Internal function to transfer ownership of a given token ID to another address. * As opposed to transferFrom, this imposes no restrictions on msg.sender. * @param from current owner of the token * @param to address to receive the ownership of the given token ID * @param tokenId ui...
85133
ERC721
_checkOnERC721Received
contract ERC721 is ERC165, IERC721 { using SafeMath for uint256; using Address for address; using Counters for Counters.Counter; // Equals to `bytes4(keccak256("onERC721Received(address,address,uint256,bytes)"))` // which can be also obtained as `IERC721Receiver(0).onERC721Received.selector` ...
if (!to.isContract()) { return true; } bytes4 retval = IERC721Receiver(to).onERC721Received(msg.sender, from, tokenId, _data); return (retval == _ERC721_RECEIVED);
* * @dev Internal function to invoke `onERC721Received` on a target address. * The call is not executed if the target address is not a contract. * * This function is deprecated. * @param from address representing the previous owner of the given token ID * @param to target address tha...
85133
ERC721
_clearApproval
contract ERC721 is ERC165, IERC721 { using SafeMath for uint256; using Address for address; using Counters for Counters.Counter; // Equals to `bytes4(keccak256("onERC721Received(address,address,uint256,bytes)"))` // which can be also obtained as `IERC721Receiver(0).onERC721Received.selector` ...
if (_tokenApprovals[tokenId] != address(0)) { _tokenApprovals[tokenId] = address(0); }
* * @dev Private function to clear current approval of a given token ID. * @param tokenId uint256 ID of the token to be transferred
85133
ERC721Burnable
burn
contract ERC721Burnable is ERC721 { /** * @dev Burns a specific ERC721 token. * @param tokenId uint256 id of the ERC721 token to be burned. */ function burn(uint256 tokenId) public {<FILL_FUNCTION_BODY>} }
//solhint-disable-next-line max-line-length require(_isApprovedOrOwner(msg.sender, tokenId), "ERC721Burnable: caller is not owner nor approved"); _burn(tokenId);
* * @dev Burns a specific ERC721 token. * @param tokenId uint256 id of the ERC721 token to be burned.
85133
Registry
name
contract Registry is IRegistry, ControllerRole, ERC721Burnable { // Optional mapping for token URIs mapping(uint256 => string) internal _tokenURIs; string internal _prefix; // Mapping from token ID to resolver address mapping (uint256 => address) internal _tokenResolvers; // uint25...
return ".crypto";
/ ERC721 Metadata extension
85133
Registry
isApprovedOrOwner
contract Registry is IRegistry, ControllerRole, ERC721Burnable { // Optional mapping for token URIs mapping(uint256 => string) internal _tokenURIs; string internal _prefix; // Mapping from token ID to resolver address mapping (uint256 => address) internal _tokenResolvers; // uint25...
return _isApprovedOrOwner(spender, tokenId);
/ Ownership
85133
Registry
root
contract Registry is IRegistry, ControllerRole, ERC721Burnable { // Optional mapping for token URIs mapping(uint256 => string) internal _tokenURIs; string internal _prefix; // Mapping from token ID to resolver address mapping (uint256 => address) internal _tokenResolvers; // uint25...
return _CRYPTO_HASH;
/ Registry Constants
85133
Registry
mintChild
contract Registry is IRegistry, ControllerRole, ERC721Burnable { // Optional mapping for token URIs mapping(uint256 => string) internal _tokenURIs; string internal _prefix; // Mapping from token ID to resolver address mapping (uint256 => address) internal _tokenResolvers; // uint25...
_mintChild(to, tokenId, label);
/ Minting
85133
Registry
setOwner
contract Registry is IRegistry, ControllerRole, ERC721Burnable { // Optional mapping for token URIs mapping(uint256 => string) internal _tokenURIs; string internal _prefix; // Mapping from token ID to resolver address mapping (uint256 => address) internal _tokenResolvers; // uint25...
super._transferFrom(ownerOf(tokenId), to, tokenId);
/ Transfering
85133
Registry
burnChild
contract Registry is IRegistry, ControllerRole, ERC721Burnable { // Optional mapping for token URIs mapping(uint256 => string) internal _tokenURIs; string internal _prefix; // Mapping from token ID to resolver address mapping (uint256 => address) internal _tokenResolvers; // uint25...
_burn(_childId(tokenId, label));
/ Burning
85133
Registry
resolverOf
contract Registry is IRegistry, ControllerRole, ERC721Burnable { // Optional mapping for token URIs mapping(uint256 => string) internal _tokenURIs; string internal _prefix; // Mapping from token ID to resolver address mapping (uint256 => address) internal _tokenResolvers; // uint25...
address resolver = _tokenResolvers[tokenId]; require(resolver != address(0)); return resolver;
/ Resolution
85133
Registry
_childId
contract Registry is IRegistry, ControllerRole, ERC721Burnable { // Optional mapping for token URIs mapping(uint256 => string) internal _tokenURIs; string internal _prefix; // Mapping from token ID to resolver address mapping (uint256 => address) internal _tokenResolvers; // uint25...
require(bytes(label).length != 0); return uint256(keccak256(abi.encodePacked(tokenId, keccak256(abi.encodePacked(label)))));
/ Internal
85133
SignatureUtil
nonceOf
contract SignatureUtil { using ECDSA for bytes32; // Mapping from owner to a nonce mapping (uint256 => uint256) internal _nonces; Registry internal _registry; constructor(Registry registry) public { _registry = registry; } function registry() external view returns (ad...
return _nonces[tokenId];
* * @dev Gets the nonce of the specified address. * @param tokenId token ID for nonce query * @return nonce of the given address
85133
Resolver
get
contract Resolver is IResolverReader, SignatureUtil, IResolver { event Set(uint256 indexed tokenId, string indexed keyIndex, string indexed valueIndex, string key, string value); event NewKey(uint256 indexed tokenId, string indexed keyIndex, string key); event ResetRecords(uint256 indexed tokenId); ...
return _records[tokenId][_tokenPresets[tokenId]][key];
* * @dev Function to get record. * @param key The key to query the value of. * @param tokenId The token id to fetch. * @return The value string.
85133
Resolver
hashToKey
contract Resolver is IResolverReader, SignatureUtil, IResolver { event Set(uint256 indexed tokenId, string indexed keyIndex, string indexed valueIndex, string key, string value); event NewKey(uint256 indexed tokenId, string indexed keyIndex, string key); event ResetRecords(uint256 indexed tokenId); ...
return _hashedKeys[keyHash];
* * @dev Function to get key by provided hash. Keys hashes can be found in Sync event emitted by Registry.sol contract. * @param keyHash The key to query the value of. * @return The key string.
85133
Resolver
hashesToKeys
contract Resolver is IResolverReader, SignatureUtil, IResolver { event Set(uint256 indexed tokenId, string indexed keyIndex, string indexed valueIndex, string key, string value); event NewKey(uint256 indexed tokenId, string indexed keyIndex, string key); event ResetRecords(uint256 indexed tokenId); ...
uint256 keyCount = hashes.length; string[] memory values = new string[](keyCount); for (uint256 i = 0; i < keyCount; i++) { values[i] = hashToKey(hashes[i]); } return values;
* * @dev Function to get keys by provided key hashes. Keys hashes can be found in Sync event emitted by Registry.sol contract. * @param hashes The key to query the value of. * @return Keys
85133
Resolver
getByHash
contract Resolver is IResolverReader, SignatureUtil, IResolver { event Set(uint256 indexed tokenId, string indexed keyIndex, string indexed valueIndex, string key, string value); event NewKey(uint256 indexed tokenId, string indexed keyIndex, string key); event ResetRecords(uint256 indexed tokenId); ...
key = hashToKey(keyHash); value = get(key, tokenId);
* * @dev Function get value by provied key hash. Keys hashes can be found in Sync event emitted by Registry.sol contract. * @param keyHash The key to query the value of. * @param tokenId The token id to set. * @return Key and value.
85133
Resolver
getManyByHash
contract Resolver is IResolverReader, SignatureUtil, IResolver { event Set(uint256 indexed tokenId, string indexed keyIndex, string indexed valueIndex, string key, string value); event NewKey(uint256 indexed tokenId, string indexed keyIndex, string key); event ResetRecords(uint256 indexed tokenId); ...
uint256 keyCount = keyHashes.length; keys = new string[](keyCount); values = new string[](keyCount); for (uint256 i = 0; i < keyCount; i++) { (keys[i], values[i]) = getByHash(keyHashes[i], tokenId); }
* * @dev Function get values by provied key hashes. Keys hashes can be found in Sync event emitted by Registry.sol contract. * @param keyHashes The key to query the value of. * @param tokenId The token id to set. * @return Keys and values.
85133
Resolver
set
contract Resolver is IResolverReader, SignatureUtil, IResolver { event Set(uint256 indexed tokenId, string indexed keyIndex, string indexed valueIndex, string key, string value); event NewKey(uint256 indexed tokenId, string indexed keyIndex, string key); event ResetRecords(uint256 indexed tokenId); ...
_set(_tokenPresets[tokenId], key, value, tokenId);
* * @dev Function to set record. * @param key The key set the value of. * @param value The value to set key to. * @param tokenId The token id to set.
85133
Resolver
setFor
contract Resolver is IResolverReader, SignatureUtil, IResolver { event Set(uint256 indexed tokenId, string indexed keyIndex, string indexed valueIndex, string key, string value); event NewKey(uint256 indexed tokenId, string indexed keyIndex, string key); event ResetRecords(uint256 indexed tokenId); ...
_validate(keccak256(abi.encodeWithSelector(this.set.selector, key, value, tokenId)), tokenId, signature); _set(_tokenPresets[tokenId], key, value, tokenId);
* * @dev Function to set record on behalf of an address. * @param key The key set the value of. * @param value The value to set key to. * @param tokenId The token id to set. * @param signature The signature to verify the transaction with.
85133
Resolver
getMany
contract Resolver is IResolverReader, SignatureUtil, IResolver { event Set(uint256 indexed tokenId, string indexed keyIndex, string indexed valueIndex, string key, string value); event NewKey(uint256 indexed tokenId, string indexed keyIndex, string key); event ResetRecords(uint256 indexed tokenId); ...
uint256 keyCount = keys.length; string[] memory values = new string[](keyCount); uint256 preset = _tokenPresets[tokenId]; for (uint256 i = 0; i < keyCount; i++) { values[i] = _records[tokenId][preset][keys[i]]; } return values;
* * @dev Function to get multiple record. * @param keys The keys to query the value of. * @param tokenId The token id to fetch. * @return The values.
85133
Resolver
setManyFor
contract Resolver is IResolverReader, SignatureUtil, IResolver { event Set(uint256 indexed tokenId, string indexed keyIndex, string indexed valueIndex, string key, string value); event NewKey(uint256 indexed tokenId, string indexed keyIndex, string key); event ResetRecords(uint256 indexed tokenId); ...
_validate(keccak256(abi.encodeWithSelector(this.setMany.selector, keys, values, tokenId)), tokenId, signature); _setMany(_tokenPresets[tokenId], keys, values, tokenId);
* * @dev Function to set record on behalf of an address. * @param keys The keys set the values of. * @param values The values to set keys to. * @param tokenId The token id to set. * @param signature The signature to verify the transaction with.
85133
Resolver
reconfigure
contract Resolver is IResolverReader, SignatureUtil, IResolver { event Set(uint256 indexed tokenId, string indexed keyIndex, string indexed valueIndex, string key, string value); event NewKey(uint256 indexed tokenId, string indexed keyIndex, string key); event ResetRecords(uint256 indexed tokenId); ...
_reconfigure(keys, values, tokenId);
* * @dev Function to reset all domain records and set new ones. * @param keys records keys. * @param values records values. * @param tokenId domain token id.
85133
Resolver
reconfigureFor
contract Resolver is IResolverReader, SignatureUtil, IResolver { event Set(uint256 indexed tokenId, string indexed keyIndex, string indexed valueIndex, string key, string value); event NewKey(uint256 indexed tokenId, string indexed keyIndex, string key); event ResetRecords(uint256 indexed tokenId); ...
_validate(keccak256(abi.encodeWithSelector(this.reconfigure.selector, keys, values, tokenId)), tokenId, signature); _reconfigure(keys, values, tokenId);
* * @dev Delegated version of reconfigure() function. * @param keys records keys. * @param values records values. * @param tokenId domain token id. * @param signature user signature.
85133
Resolver
_setPreset
contract Resolver is IResolverReader, SignatureUtil, IResolver { event Set(uint256 indexed tokenId, string indexed keyIndex, string indexed valueIndex, string key, string value); event NewKey(uint256 indexed tokenId, string indexed keyIndex, string key); event ResetRecords(uint256 indexed tokenId); ...
_tokenPresets[tokenId] = presetId; _registry.sync(tokenId, 0); // notify registry that domain records were reset emit ResetRecords(tokenId);
reset records
85133
Resolver
_set
contract Resolver is IResolverReader, SignatureUtil, IResolver { event Set(uint256 indexed tokenId, string indexed keyIndex, string indexed valueIndex, string key, string value); event NewKey(uint256 indexed tokenId, string indexed keyIndex, string key); event ResetRecords(uint256 indexed tokenId); ...
uint256 keyHash = uint256(keccak256(bytes(key))); bool isNewKey = bytes(_records[tokenId][preset][key]).length == 0; _registry.sync(tokenId, keyHash); _records[tokenId][preset][key] = value; if (bytes(_hashedKeys[keyHash]).length == 0) { _hashedKeys[keyHash] ...
* * @dev Internal function to to set record. As opposed to set, this imposes no restrictions on msg.sender. * @param preset preset to set key/values on * @param key key of record to be set * @param value value of record to be set * @param tokenId uint256 ID of the token
85133
Resolver
_setMany
contract Resolver is IResolverReader, SignatureUtil, IResolver { event Set(uint256 indexed tokenId, string indexed keyIndex, string indexed valueIndex, string key, string value); event NewKey(uint256 indexed tokenId, string indexed keyIndex, string key); event ResetRecords(uint256 indexed tokenId); ...
uint256 keyCount = keys.length; for (uint256 i = 0; i < keyCount; i++) { _set(preset, keys[i], values[i], tokenId); }
* * @dev Internal function to to set multiple records. As opposed to setMany, this imposes * no restrictions on msg.sender. * @param preset preset to set key/values on * @param keys keys of record to be set * @param values values of record to be set * @param tokenId uint256 ID of the...
85133
Resolver
_reconfigure
contract Resolver is IResolverReader, SignatureUtil, IResolver { event Set(uint256 indexed tokenId, string indexed keyIndex, string indexed valueIndex, string key, string value); event NewKey(uint256 indexed tokenId, string indexed keyIndex, string key); event ResetRecords(uint256 indexed tokenId); ...
_setPreset(now, tokenId); _setMany(_tokenPresets[tokenId], keys, values, tokenId);
* * @dev Internal function to reset all domain records and set new ones. * @param keys records keys. * @param values records values. * @param tokenId domain token id.
85133
WhitelistedMinter
closeWhitelisted
contract WhitelistedMinter is IMintingController, BulkWhitelistedRole { using ECDSA for bytes32; event Relayed(address indexed sender, address indexed signer, bytes4 indexed funcSig, bytes32 dataHash); string public constant NAME = 'Unstoppable Whitelisted Minter'; string public constant VERSION...
require(receiver != address(0x0), "WhitelistedMinter: RECEIVER_IS_EMPTY"); renounceWhitelisted(); receiver.transfer(msg.value);
* * Renounce whitelisted account with funds' forwarding
85133
WhitelistedMinter
rotateWhitelisted
contract WhitelistedMinter is IMintingController, BulkWhitelistedRole { using ECDSA for bytes32; event Relayed(address indexed sender, address indexed signer, bytes4 indexed funcSig, bytes32 dataHash); string public constant NAME = 'Unstoppable Whitelisted Minter'; string public constant VERSION...
require(receiver != address(0x0), "WhitelistedMinter: RECEIVER_IS_EMPTY"); _addWhitelisted(receiver); renounceWhitelisted(); receiver.transfer(msg.value);
* * Replace whitelisted account by new account with funds' forwarding
85133
WhitelistedMinter
relay
contract WhitelistedMinter is IMintingController, BulkWhitelistedRole { using ECDSA for bytes32; event Relayed(address indexed sender, address indexed signer, bytes4 indexed funcSig, bytes32 dataHash); string public constant NAME = 'Unstoppable Whitelisted Minter'; string public constant VERSION...
bytes32 dataHash = keccak256(data); address signer = verifySigner(dataHash, signature); bytes memory _data = data; bytes4 funcSig = verifyCall(_data); /* solium-disable-next-line security/no-low-level-calls */ (bool success, bytes memory result) = address(this).c...
* * Relay allows execute transaction on behalf of whitelisted minter. * The function verify signature of call data parameter before execution. * It allows anybody send transaction on-chain when minter has provided proper parameters. * The function allows to relaying calls of fixed functions. The...
85134
SenbitTokenExchangeCoin
SenbitTokenExchangeCoin
contract SenbitTokenExchangeCoin{ /* Public variables of the token */ string public name; string public symbol; uint8 public decimals; uint256 public totalSupply; /* This creates an array with all balances */ mapping (address => uint256) public balanceOf; mapping (address => ma...
balanceOf[msg.sender] = 300000000 * (10**18); // Give the creator all initial tokens totalSupply = 300000000 * (10**18); // Update total supply name = "Senbit Token Exchange Coin"; // Set the name for display purposes symbol = "STEC"; ...
Initializes contract with initial supply tokens to the creator of the contract
85134
SenbitTokenExchangeCoin
_transfer
contract SenbitTokenExchangeCoin{ /* Public variables of the token */ string public name; string public symbol; uint8 public decimals; uint256 public totalSupply; /* This creates an array with all balances */ mapping (address => uint256) public balanceOf; mapping (address => ma...
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 balanceOf[_fro...
Internal transfer, only can be called by this contract
85134
SenbitTokenExchangeCoin
transfer
contract SenbitTokenExchangeCoin{ /* Public variables of the token */ string public name; string public symbol; uint8 public decimals; uint256 public totalSupply; /* This creates an array with all balances */ mapping (address => uint256) public balanceOf; mapping (address => ma...
_transfer(msg.sender, _to, _value);
/ @notice Send `_value` tokens to `_to` from your account / @param _to The address of the recipient / @param _value the amount to send
85134
SenbitTokenExchangeCoin
transferFrom
contract SenbitTokenExchangeCoin{ /* Public variables of the token */ string public name; string public symbol; uint8 public decimals; uint256 public totalSupply; /* This creates an array with all balances */ mapping (address => uint256) public balanceOf; mapping (address => ma...
require (_value <= allowance[_from][msg.sender]); // Check allowance allowance[_from][msg.sender] -= _value; _transfer(_from, _to, _value); return true;
/ @notice 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
85134
SenbitTokenExchangeCoin
approve
contract SenbitTokenExchangeCoin{ /* Public variables of the token */ string public name; string public symbol; uint8 public decimals; uint256 public totalSupply; /* This creates an array with all balances */ mapping (address => uint256) public balanceOf; mapping (address => ma...
allowance[msg.sender][_spender] = _value; Approval(msg.sender, _spender, _value); return true;
/ @notice 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
85134
SenbitTokenExchangeCoin
burn
contract SenbitTokenExchangeCoin{ /* Public variables of the token */ string public name; string public symbol; uint8 public decimals; uint256 public totalSupply; /* This creates an array with all balances */ mapping (address => uint256) public balanceOf; mapping (address => ma...
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); r...
/ @notice Remove `_value` tokens from the system irreversibly / @param _value the amount of money to burn
85135
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.
85135
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.
85135
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.
85136
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.
85136
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.
85136
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.
85136
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.
85136
MenloTokenTimelock
release
contract MenloTokenTimelock is Ownable { using SafeERC20 for ERC20Basic; // ERC20 basic token contract being held ERC20Basic public token; mapping (address => uint256) public balance; // timestamp when token release is enabled uint256 public releaseTime; constructor(ERC20Basic _token, uint2...
require(getBlockTimestamp() >= releaseTime, "Release time should be now or in the past"); uint256 _amount = token.balanceOf(this); require(_amount > 0, "Contract balance should be greater than zero"); require(balance[msg.sender] > 0, "Sender balance should be greater than zero"); require(_...
* * @notice Transfers tokens held by timelock to beneficiary.
85137
CGSToken
CGSToken
contract CGSToken is StandardToken { /* Public variables of the token */ string public name; //名称: eg Simon Bucks uint8 public decimals; //最多的小数位数,How many decimals to show. ie. There could 1000 base units with 3 decimals. Meaning 0.980 SBX = 980 base units. It's like c...
balances[msg.sender] = _initialAmount; // 初始token数量给予消息发送者 totalSupply = _initialAmount; // 设置初始总量 name = _tokenName; // token名称 decimals = _decimalUnits; // 小数位数 symbol = _tokenSymbol; // token简称
版本
85137
CGSToken
approveAndCall
contract CGSToken is StandardToken { /* Public variables of the token */ string public name; //名称: eg Simon Bucks uint8 public decimals; //最多的小数位数,How many decimals to show. ie. There could 1000 base units with 3 decimals. Meaning 0.980 SBX = 980 base units. It's like c...
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. //receiveApproval...
Approves and then calls the receiving contract
85138
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.
85138
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.
85138
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 ...
85138
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.
85138
ERC20
null
contract ERC20 is Context, IERC20 { using SafeMath for uint256; using Address for address; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _totalSupply; string private _name; string private ...
_name = name; _symbol = symbol; _decimals = 18;
* * @dev Sets the values for {name} and {symbol}, initializes {decimals} with * a default value of 18. * * To select a different value for {decimals}, use {_setupDecimals}. * * All three of these values are immutable: they can only be set once during * construction.
85138
ERC20
name
contract ERC20 is Context, IERC20 { using SafeMath for uint256; using Address for address; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _totalSupply; string private _name; string private ...
return _name;
* * @dev Returns the name of the token.
85138
ERC20
symbol
contract ERC20 is Context, IERC20 { using SafeMath for uint256; using Address for address; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _totalSupply; string private _name; string private ...
return _symbol;
* * @dev Returns the symbol of the token, usually a shorter version of the * name.
85138
ERC20
decimals
contract ERC20 is Context, IERC20 { using SafeMath for uint256; using Address for address; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _totalSupply; string private _name; string private ...
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 * ...
85138
ERC20
totalSupply
contract ERC20 is Context, IERC20 { using SafeMath for uint256; using Address for address; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _totalSupply; string private _name; string private ...
return _totalSupply;
* * @dev See {IERC20-totalSupply}.
85138
ERC20
balanceOf
contract ERC20 is Context, IERC20 { using SafeMath for uint256; using Address for address; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _totalSupply; string private _name; string private ...
return _balances[account];
* * @dev See {IERC20-balanceOf}.
85138
ERC20
transfer
contract ERC20 is Context, IERC20 { using SafeMath for uint256; using Address for address; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _totalSupply; string private _name; string private ...
_transfer(_msgSender(), recipient, amount); return true;
* * @dev See {IERC20-transfer}. * * Requirements: * * - `recipient` cannot be the zero address. * - the caller must have a balance of at least `amount`.
85138
ERC20
allowance
contract ERC20 is Context, IERC20 { using SafeMath for uint256; using Address for address; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _totalSupply; string private _name; string private ...
return _allowances[owner][spender];
* * @dev See {IERC20-allowance}.
85138
ERC20
approve
contract ERC20 is Context, IERC20 { using SafeMath for uint256; using Address for address; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _totalSupply; string private _name; string private ...
_approve(_msgSender(), spender, amount); return true;
* * @dev See {IERC20-approve}. * * Requirements: * * - `spender` cannot be the zero address.
85138
ERC20
transferFrom
contract ERC20 is Context, IERC20 { using SafeMath for uint256; using Address for address; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _totalSupply; string private _name; string private ...
_transfer(sender, recipient, amount); _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance")); return true;
* * @dev See {IERC20-transferFrom}. * * Emits an {Approval} event indicating the updated allowance. This is not * required by the EIP. See the note at the beginning of {ERC20}; * * Requirements: * - `sender` and `recipient` cannot be the zero address. * - `sender` must ha...
85138
ERC20
increaseAllowance
contract ERC20 is Context, IERC20 { using SafeMath for uint256; using Address for address; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _totalSupply; string private _name; string private ...
_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...
85138
ERC20
decreaseAllowance
contract ERC20 is Context, IERC20 { using SafeMath for uint256; using Address for address; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _totalSupply; string private _name; string private ...
_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...
85138
ERC20
_transfer
contract ERC20 is Context, IERC20 { using SafeMath for uint256; using Address for address; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _totalSupply; string private _name; string private ...
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 bal...
* * @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...
85138
ERC20
_mint
contract ERC20 is Context, IERC20 { using SafeMath for uint256; using Address for address; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _totalSupply; string private _name; string private ...
require(account != address(0), "ERC20: mint to the zero address"); _beforeTokenTransfer(address(0), account, amount); _totalSupply = _totalSupply.add(amount); _balances[account] = _balances[account].add(amount); emit Transfer(address(0), account, amount);
* @dev Creates `amount` tokens and assigns them to `account`, increasing * the total supply. * * Emits a {Transfer} event with `from` set to the zero address. * * Requirements * * - `to` cannot be the zero address.
85138
ERC20
_burn
contract ERC20 is Context, IERC20 { using SafeMath for uint256; using Address for address; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _totalSupply; string private _name; string private ...
require(account != address(0), "ERC20: burn from the zero address"); _beforeTokenTransfer(account, address(0), amount); _balances[account] = _balances[account].sub(amount, "ERC20: burn amount exceeds balance"); _totalSupply = _totalSupply.sub(amount); emit Transfer(acco...
* * @dev Destroys `amount` tokens from `account`, reducing the * total supply. * * Emits a {Transfer} event with `to` set to the zero address. * * Requirements * * - `account` cannot be the zero address. * - `account` must have at least `amount` tokens.
85138
ERC20
_approve
contract ERC20 is Context, IERC20 { using SafeMath for uint256; using Address for address; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _totalSupply; string private _name; string private ...
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. * * Emits an {Approval} event. * * Requirements: ...
85138
ERC20
_setupDecimals
contract ERC20 is Context, IERC20 { using SafeMath for uint256; using Address for address; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _totalSupply; string private _name; string private ...
_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.
85138
ERC20
_beforeTokenTransfer
contract ERC20 is Context, IERC20 { using SafeMath for uint256; using Address for address; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _totalSupply; string private _name; string private ...
* * @dev Hook that is called before any transfer of tokens. This includes * minting and burning. * * Calling conditions: * * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens * will be to transferred to `to`. * - when `from` is zero, `amount` tokens ...
85138
RomeCityToken
mint
contract RomeCityToken is ERC20("ROME.cityswap.io", "ROME"), Ownable { uint256 public constant MAX_SUPPLY = 2724000 * 10**18; /** * @notice Creates `_amount` token to `_to`. Must only be called by the owner (TravelAgency). */ function mint(address _to, uint256 _amount) public...
uint256 _totalSupply = totalSupply(); if(_totalSupply.add(_amount) > MAX_SUPPLY) { _amount = MAX_SUPPLY.sub(_totalSupply); } require(_totalSupply.add(_amount) <= MAX_SUPPLY); _mint(_to, _amount);
* * @notice Creates `_amount` token to `_to`. Must only be called by the owner (TravelAgency).
85139
OpsCoin
close
contract OpsCoin is ERC20Interface { /** @notice © Copyright 2018 EYGS LLP and/or other members of the global Ernst & Young/EY network; pat. pending. */ using SafeMath for uint256; string public symbol; string public name; address public owner; uint256 public totalSupply; ...
selfdestruct(owner);
* self destruct added by westlad
85139
OpsCoin
balanceOf
contract OpsCoin is ERC20Interface { /** @notice © Copyright 2018 EYGS LLP and/or other members of the global Ernst & Young/EY network; pat. pending. */ using SafeMath for uint256; string public symbol; string public name; address public owner; uint256 public totalSupply; ...
return balances[_address];
* * @dev Gets the balance of the specified address. * @param _address The address to query the balance of. * @return An uint256 representing the amount owned by the passed address.
85139
OpsCoin
allowance
contract OpsCoin is ERC20Interface { /** @notice © Copyright 2018 EYGS LLP and/or other members of the global Ernst & Young/EY network; pat. pending. */ using SafeMath for uint256; string public symbol; string public name; address public owner; uint256 public 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.
85139
OpsCoin
totalSupply
contract OpsCoin is ERC20Interface { /** @notice © Copyright 2018 EYGS LLP and/or other members of the global Ernst & Young/EY network; pat. pending. */ using SafeMath for uint256; string public symbol; string public name; address public owner; uint256 public totalSupply; ...
return totalSupply;
* * @dev Total number of tokens in existence
85139
OpsCoin
mint
contract OpsCoin is ERC20Interface { /** @notice © Copyright 2018 EYGS LLP and/or other members of the global Ernst & Young/EY network; pat. pending. */ using SafeMath for uint256; string public symbol; string public name; address public owner; uint256 public totalSupply; ...
require(_account != 0); require(_amount > 0); totalSupply = totalSupply.add(_amount); balances[_account] = balances[_account].add(_amount); emit Transfer(address(0), _account, _amount);
* * @dev Internal function that mints an amount of the token and assigns it to * an account. This encapsulates the modification of balances such that the * proper events are emitted. * @param _account The account that will receive the created tokens. * @param _amount The amount that will be created.
85139
OpsCoin
burn
contract OpsCoin is ERC20Interface { /** @notice © Copyright 2018 EYGS LLP and/or other members of the global Ernst & Young/EY network; pat. pending. */ using SafeMath for uint256; string public symbol; string public name; address public owner; uint256 public totalSupply; ...
require(_account != 0); require(_amount <= balances[_account]); totalSupply = totalSupply.sub(_amount); balances[_account] = balances[_account].sub(_amount); emit Transfer(_account, address(0), _amount);
* * @dev Internal function that burns an amount of the token of a given * account. * @param _account The account whose tokens will be burnt. * @param _amount The amount that will be burnt.
85139
OpsCoin
burnFrom
contract OpsCoin is ERC20Interface { /** @notice © Copyright 2018 EYGS LLP and/or other members of the global Ernst & Young/EY network; pat. pending. */ using SafeMath for uint256; string public symbol; string public name; address public owner; uint256 public totalSupply; ...
require(_amount <= allowed[_account][msg.sender]); allowed[_account][msg.sender] = allowed[_account][msg.sender].sub(_amount); emit Approval(_account, msg.sender, allowed[_account][msg.sender]); burn(_account, _amount);
* * @dev Internal function that burns an amount of the token of a given * account, deducting from the sender's allowance for said account. Uses the * internal burn function. * @param _account The account whose tokens will be burnt. * @param _amount The amount that will be burnt.
85139
OpsCoin
transfer
contract OpsCoin is ERC20Interface { /** @notice © Copyright 2018 EYGS LLP and/or other members of the global Ernst & Young/EY network; pat. pending. */ using SafeMath for uint256; string public symbol; string public name; address public owner; uint256 public 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.
85139
OpsCoin
approve
contract OpsCoin is ERC20Interface { /** @notice © Copyright 2018 EYGS LLP and/or other members of the global Ernst & Young/EY network; pat. pending. */ using SafeMath for uint256; string public symbol; string public name; address public owner; uint256 public totalSupply; ...
require(_spender != address(0)); 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 * race condi...
85139
OpsCoin
approveAt
contract OpsCoin is ERC20Interface { /** @notice © Copyright 2018 EYGS LLP and/or other members of the global Ernst & Young/EY network; pat. pending. */ using SafeMath for uint256; string public symbol; string public name; address public owner; uint256 public totalSupply; ...
require(_spender != address(0)); allowed[msg.sender][_spender] = _value; timeLock[msg.sender][_spender] = _timeLockTill; emit Approval(msg.sender, _spender, _value); return true;
* * @dev Approve the passed address to spend the specified amount of tokens after a specfied amount of time 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 solutio...