{ "language": "Solidity", "sources": { "/workspace/access/Roles.sol": { "content": "pragma solidity ^0.5.0;\n\n/**\n * @title Roles\n * @dev Library for managing addresses assigned to a Role.\n */\nlibrary Roles {\n struct Role {\n mapping (address => bool) bearer;\n }\n\n /**\n * @dev Give an account access to this role.\n */\n function add(Role storage role, address account) internal {\n require(!has(role, account), \"Roles: account already has role\");\n role.bearer[account] = true;\n }\n\n /**\n * @dev Remove an account's access to this role.\n */\n function remove(Role storage role, address account) internal {\n require(has(role, account), \"Roles: account does not have role\");\n role.bearer[account] = false;\n }\n\n /**\n * @dev Check if an account has this role.\n * @return bool\n */\n function has(Role storage role, address account) internal view returns (bool) {\n require(account != address(0), \"Roles: account is the zero address\");\n return role.bearer[account];\n }\n}\n" }, "/workspace/access/roles/MinterRole.sol": { "content": "pragma solidity ^0.5.0;\n\nimport \"../Roles.sol\";\n\ncontract MinterRole {\n using Roles for Roles.Role;\n\n event MinterAdded(address indexed account);\n event MinterRemoved(address indexed account);\n\n Roles.Role private _minters;\n\n constructor () internal {\n _addMinter(msg.sender);\n }\n\n modifier onlyMinter() {\n require(isMinter(msg.sender), \"MinterRole: caller does not have the Minter role\");\n _;\n }\n\n function isMinter(address account) public view returns (bool) {\n return _minters.has(account);\n }\n\n function addMinter(address account) public onlyMinter {\n _addMinter(account);\n }\n\n function renounceMinter() public {\n _removeMinter(msg.sender);\n }\n\n function _addMinter(address account) internal {\n _minters.add(account);\n emit MinterAdded(account);\n }\n\n function _removeMinter(address account) internal {\n _minters.remove(account);\n emit MinterRemoved(account);\n }\n}\n" }, "/workspace/access/roles/PauserRole.sol": { "content": "pragma solidity ^0.5.0;\n\nimport \"../Roles.sol\";\n\ncontract PauserRole {\n using Roles for Roles.Role;\n\n event PauserAdded(address indexed account);\n event PauserRemoved(address indexed account);\n\n Roles.Role private _pausers;\n\n constructor () internal {\n _addPauser(msg.sender);\n }\n\n modifier onlyPauser() {\n require(isPauser(msg.sender), \"PauserRole: caller does not have the Pauser role\");\n _;\n }\n\n function isPauser(address account) public view returns (bool) {\n return _pausers.has(account);\n }\n\n function addPauser(address account) public onlyPauser {\n _addPauser(account);\n }\n\n function renouncePauser() public {\n _removePauser(msg.sender);\n }\n\n function _addPauser(address account) internal {\n _pausers.add(account);\n emit PauserAdded(account);\n }\n\n function _removePauser(address account) internal {\n _pausers.remove(account);\n emit PauserRemoved(account);\n }\n}\n" }, "/workspace/drafts/Counters.sol": { "content": "pragma solidity ^0.5.0;\n\nimport \"../math/SafeMath.sol\";\n\n/**\n * @title Counters\n * @author Matt Condon (@shrugs)\n * @dev Provides counters that can only be incremented or decremented by one. This can be used e.g. to track the number\n * of elements in a mapping, issuing ERC721 ids, or counting request ids.\n *\n * Include with `using Counters for Counters.Counter;`\n * Since it is not possible to overflow a 256 bit integer with increments of one, `increment` can skip the SafeMath\n * overflow check, thereby saving gas. This does assume however correct usage, in that the underlying `_value` is never\n * directly accessed.\n */\nlibrary Counters {\n using SafeMath for uint256;\n\n struct Counter {\n // This variable should never be directly accessed by users of the library: interactions must be restricted to\n // the library's function. As of Solidity v0.5.2, this cannot be enforced, though there is a proposal to add\n // this feature: see https://github.com/ethereum/solidity/issues/4637\n uint256 _value; // default: 0\n }\n\n function current(Counter storage counter) internal view returns (uint256) {\n return counter._value;\n }\n\n function increment(Counter storage counter) internal {\n counter._value += 1;\n }\n\n function decrement(Counter storage counter) internal {\n counter._value = counter._value.sub(1);\n }\n}\n" }, "/workspace/introspection/IKIP13.sol": { "content": "pragma solidity ^0.5.0;\n\n/**\n * @dev Interface of the KIP-13 standard, as defined in the\n * [KIP-13](http://kips.klaytn.com/KIPs/kip-13-interface_query_standard).\n *\n * Implementers can declare support of contract interfaces, which can then be\n * queried by others.\n *\n * For an implementation, see `KIP13`.\n */\ninterface IKIP13 {\n /**\n * @dev Returns true if this contract implements the interface defined by\n * `interfaceId`. See the corresponding\n * [KIP-13 section](http://kips.klaytn.com/KIPs/kip-13-interface_query_standard#how-interface-identifiers-are-defined)\n * to learn more about how these ids are created.\n *\n * This function call must use less than 30 000 gas.\n */\n function supportsInterface(bytes4 interfaceId) external view returns (bool);\n}\n" }, "/workspace/introspection/KIP13.sol": { "content": "pragma solidity ^0.5.0;\n\nimport \"./IKIP13.sol\";\n\n/**\n * @dev Implementation of the `IKIP13` interface.\n *\n * Contracts may inherit from this and call `_registerInterface` to declare\n * their support of an interface.\n */\ncontract KIP13 is IKIP13 {\n /*\n * bytes4(keccak256('supportsInterface(bytes4)')) == 0x01ffc9a7\n */\n bytes4 private constant _INTERFACE_ID_KIP13 = 0x01ffc9a7;\n\n /**\n * @dev Mapping of interface ids to whether or not it's supported.\n */\n mapping(bytes4 => bool) private _supportedInterfaces;\n\n constructor () internal {\n // Derived contracts need only register support for their own interfaces,\n // we register support for KIP13 itself here\n _registerInterface(_INTERFACE_ID_KIP13);\n }\n\n /**\n * @dev See `IKIP13.supportsInterface`.\n *\n * Time complexity O(1), guaranteed to always use less than 30 000 gas.\n */\n function supportsInterface(bytes4 interfaceId) external view returns (bool) {\n return _supportedInterfaces[interfaceId];\n }\n\n /**\n * @dev Registers the contract as an implementer of the interface defined by\n * `interfaceId`. Support of the actual KIP13 interface is automatic and\n * registering its interface id is not required.\n *\n * See `IKIP13.supportsInterface`.\n *\n * Requirements:\n *\n * - `interfaceId` cannot be the KIP13 invalid interface (`0xffffffff`).\n */\n function _registerInterface(bytes4 interfaceId) internal {\n require(interfaceId != 0xffffffff, \"KIP13: invalid interface id\");\n _supportedInterfaces[interfaceId] = true;\n }\n}\n" }, "/workspace/lifecycle/Pausable.sol": { "content": "pragma solidity ^0.5.0;\n\nimport \"../access/roles/PauserRole.sol\";\n\n/**\n * @dev Contract module which allows children to implement an emergency stop\n * mechanism that can be triggered by an authorized account.\n *\n * This module is used through inheritance. It will make available the\n * modifiers `whenNotPaused` and `whenPaused`, which can be applied to\n * the functions of your contract. Note that they will not be pausable by\n * simply including this module, only once the modifiers are put in place.\n */\ncontract Pausable is PauserRole {\n /**\n * @dev Emitted when the pause is triggered by a pauser (`account`).\n */\n event Paused(address account);\n\n /**\n * @dev Emitted when the pause is lifted by a pauser (`account`).\n */\n event Unpaused(address account);\n\n bool private _paused;\n\n /**\n * @dev Initializes the contract in unpaused state. Assigns the Pauser role\n * to the deployer.\n */\n constructor () internal {\n _paused = false;\n }\n\n /**\n * @dev Returns true if the contract is paused, and false otherwise.\n */\n function paused() public view returns (bool) {\n return _paused;\n }\n\n /**\n * @dev Modifier to make a function callable only when the contract is not paused.\n */\n modifier whenNotPaused() {\n require(!_paused, \"Pausable: paused\");\n _;\n }\n\n /**\n * @dev Modifier to make a function callable only when the contract is paused.\n */\n modifier whenPaused() {\n require(_paused, \"Pausable: not paused\");\n _;\n }\n\n /**\n * @dev Called by a pauser to pause, triggers stopped state.\n */\n function pause() public onlyPauser whenNotPaused {\n _paused = true;\n emit Paused(msg.sender);\n }\n\n /**\n * @dev Called by a pauser to unpause, returns to normal state.\n */\n function unpause() public onlyPauser whenPaused {\n _paused = false;\n emit Unpaused(msg.sender);\n }\n}\n" }, "/workspace/math/SafeMath.sol": { "content": "pragma solidity ^0.5.0;\n\n/**\n * @dev Wrappers over Solidity's arithmetic operations with added overflow\n * checks.\n *\n * Arithmetic operations in Solidity wrap on overflow. This can easily result\n * in bugs, because programmers usually assume that an overflow raises an\n * error, which is the standard behavior in high level programming languages.\n * `SafeMath` restores this intuition by reverting the transaction when an\n * operation overflows.\n *\n * Using this library instead of the unchecked operations eliminates an entire\n * class of bugs, so it's recommended to use it always.\n */\nlibrary SafeMath {\n /**\n * @dev Returns the addition of two unsigned integers, reverting on\n * overflow.\n *\n * Counterpart to Solidity's `+` operator.\n *\n * Requirements:\n * - Addition cannot overflow.\n */\n function add(uint256 a, uint256 b) internal pure returns (uint256) {\n uint256 c = a + b;\n require(c >= a, \"SafeMath: addition overflow\");\n\n return c;\n }\n\n /**\n * @dev Returns the subtraction of two unsigned integers, reverting on\n * overflow (when the result is negative).\n *\n * Counterpart to Solidity's `-` operator.\n *\n * Requirements:\n * - Subtraction cannot overflow.\n */\n function sub(uint256 a, uint256 b) internal pure returns (uint256) {\n require(b <= a, \"SafeMath: subtraction overflow\");\n uint256 c = a - b;\n\n return c;\n }\n\n /**\n * @dev Returns the multiplication of two unsigned integers, reverting on\n * overflow.\n *\n * Counterpart to Solidity's `*` operator.\n *\n * Requirements:\n * - Multiplication cannot overflow.\n */\n function mul(uint256 a, uint256 b) internal pure returns (uint256) {\n // Gas optimization: this is cheaper than requiring 'a' not being zero, but the\n // benefit is lost if 'b' is also tested.\n // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522\n if (a == 0) {\n return 0;\n }\n\n uint256 c = a * b;\n require(c / a == b, \"SafeMath: multiplication overflow\");\n\n return c;\n }\n\n /**\n * @dev Returns the integer division of two unsigned integers. Reverts on\n * division by zero. The result is rounded towards zero.\n *\n * Counterpart to Solidity's `/` operator. Note: this function uses a\n * `revert` opcode (which leaves remaining gas untouched) while Solidity\n * uses an invalid opcode to revert (consuming all remaining gas).\n *\n * Requirements:\n * - The divisor cannot be zero.\n */\n function div(uint256 a, uint256 b) internal pure returns (uint256) {\n // Solidity only automatically asserts when dividing by 0\n require(b > 0, \"SafeMath: division by zero\");\n uint256 c = a / b;\n // assert(a == b * c + a % b); // There is no case in which this doesn't hold\n\n return c;\n }\n\n /**\n * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),\n * Reverts when dividing by zero.\n *\n * Counterpart to Solidity's `%` operator. This function uses a `revert`\n * opcode (which leaves remaining gas untouched) while Solidity uses an\n * invalid opcode to revert (consuming all remaining gas).\n *\n * Requirements:\n * - The divisor cannot be zero.\n */\n function mod(uint256 a, uint256 b) internal pure returns (uint256) {\n require(b != 0, \"SafeMath: modulo by zero\");\n return a % b;\n }\n}\n" }, "/workspace/ownership/Ownable.sol": { "content": "pragma solidity ^0.5.0;\n\n/**\n * @dev Contract module which provides a basic access control mechanism, where\n * there is an account (an owner) that can be granted exclusive access to\n * specific functions.\n *\n * This module is used through inheritance. It will make available the modifier\n * `onlyOwner`, which can be aplied to your functions to restrict their use to\n * the owner.\n */\ncontract Ownable {\n address payable private _owner;\n\n event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\n\n /**\n * @dev Initializes the contract setting the deployer as the initial owner.\n */\n constructor () internal {\n _owner = msg.sender;\n emit OwnershipTransferred(address(0), _owner);\n }\n\n /**\n * @dev Returns the address of the current owner.\n */\n function owner() public view returns (address payable) {\n return _owner;\n }\n\n /**\n * @dev Throws if called by any account other than the owner.\n */\n modifier onlyOwner() {\n require(isOwner(), \"Ownable: caller is not the owner\");\n _;\n }\n\n /**\n * @dev Returns true if the caller is the current owner.\n */\n function isOwner() public view returns (bool) {\n return msg.sender == _owner;\n }\n\n /**\n * @dev Leaves the contract without owner. It will not be possible to call\n * `onlyOwner` functions anymore. Can only be called by the current owner.\n *\n * > Note: Renouncing ownership will leave the contract without an owner,\n * thereby removing any functionality that is only available to the owner.\n */\n function renounceOwnership() public onlyOwner {\n emit OwnershipTransferred(_owner, address(0));\n _owner = address(0);\n }\n\n /**\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\n * Can only be called by the current owner.\n */\n function transferOwnership(address payable newOwner) public onlyOwner {\n _transferOwnership(newOwner);\n }\n\n /**\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\n */\n function _transferOwnership(address payable newOwner) internal {\n require(newOwner != address(0), \"Ownable: new owner is the zero address\");\n emit OwnershipTransferred(_owner, newOwner);\n _owner = newOwner;\n }\n}\n" }, "/workspace/token/KIP17/IERC721Receiver.sol": { "content": "pragma solidity ^0.5.0;\n\n/**\n * @title ERC721 token receiver interface\n * @dev Interface for any contract that wants to support safeTransfers\n * from ERC721 asset contracts.\n */\ncontract IERC721Receiver {\n /**\n * @notice Handle the receipt of an NFT\n * @dev The ERC721 smart contract calls this function on the recipient\n * after a `safeTransfer`. This function MUST return the function selector,\n * otherwise the caller will revert the transaction. The selector to be\n * returned can be obtained as `this.onERC721Received.selector`. This\n * function MAY throw to revert and reject the transfer.\n * Note: the ERC721 contract address is always the message sender.\n * @param operator The address which called `safeTransferFrom` function\n * @param from The address which previously owned the token\n * @param tokenId The NFT identifier which is being transferred\n * @param data Additional data with no specified format\n * @return bytes4 `bytes4(keccak256(\"onERC721Received(address,address,uint256,bytes)\"))`\n */\n function onERC721Received(address operator, address from, uint256 tokenId, bytes memory data)\n public returns (bytes4);\n}\n" }, "/workspace/token/KIP17/IKIP17.sol": { "content": "pragma solidity ^0.5.0;\n\nimport \"../../introspection/IKIP13.sol\";\n\n/**\n * @dev Required interface of an KIP17 compliant contract.\n */\ncontract IKIP17 is IKIP13 {\n event Transfer(address indexed from, address indexed to, uint256 indexed tokenId);\n event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId);\n event ApprovalForAll(address indexed owner, address indexed operator, bool approved);\n\n /**\n * @dev Returns the number of NFTs in `owner`'s account.\n */\n function balanceOf(address owner) public view returns (uint256 balance);\n\n /**\n * @dev Returns the owner of the NFT specified by `tokenId`.\n */\n function ownerOf(uint256 tokenId) public view returns (address owner);\n\n /**\n * @dev Transfers a specific NFT (`tokenId`) from one account (`from`) to\n * another (`to`).\n *\n * Requirements:\n * - `from`, `to` cannot be zero.\n * - `tokenId` must be owned by `from`.\n * - If the caller is not `from`, it must be have been allowed to move this\n * NFT by either `approve` or `setApproveForAll`.\n */\n function safeTransferFrom(address from, address to, uint256 tokenId) public;\n\n /**\n * @dev Transfers a specific NFT (`tokenId`) from one account (`from`) to\n * another (`to`).\n *\n * Requirements:\n * - If the caller is not `from`, it must be approved to move this NFT by\n * either `approve` or `setApproveForAll`.\n */\n function transferFrom(address from, address to, uint256 tokenId) public;\n function approve(address to, uint256 tokenId) public;\n function getApproved(uint256 tokenId) public view returns (address operator);\n\n function setApprovalForAll(address operator, bool _approved) public;\n function isApprovedForAll(address owner, address operator) public view returns (bool);\n\n\n function safeTransferFrom(address from, address to, uint256 tokenId, bytes memory data) public;\n}\n" }, "/workspace/token/KIP17/IKIP17Enumerable.sol": { "content": "pragma solidity ^0.5.0;\n\nimport \"./IKIP17.sol\";\n\n/**\n * @title KIP-17 Non-Fungible Token Standard, optional enumeration extension\n * @dev See http://kips.klaytn.com/KIPs/kip-17-non_fungible_token\n */\ncontract IKIP17Enumerable is IKIP17 {\n function totalSupply() public view returns (uint256);\n function tokenOfOwnerByIndex(address owner, uint256 index) public view returns (uint256 tokenId);\n\n function tokenByIndex(uint256 index) public view returns (uint256);\n}\n" }, "/workspace/token/KIP17/IKIP17Metadata.sol": { "content": "pragma solidity ^0.5.0;\n\nimport \"./IKIP17.sol\";\n\n/**\n * @title KIP-17 Non-Fungible Token Standard, optional metadata extension\n * @dev See http://kips.klaytn.com/KIPs/kip-17-non_fungible_token\n */\ncontract IKIP17Metadata is IKIP17 {\n function name() external view returns (string memory);\n function symbol() external view returns (string memory);\n function tokenURI(uint256 tokenId) external view returns (string memory);\n}\n" }, "/workspace/token/KIP17/IKIP17Receiver.sol": { "content": "pragma solidity ^0.5.0;\n\n/**\n * @title KIP17 token receiver interface\n * @dev Interface for any contract that wants to support safeTransfers\n * from KIP17 asset contracts.\n * @dev see http://kips.klaytn.com/KIPs/kip-17-non_fungible_token\n */\ncontract IKIP17Receiver {\n /**\n * @notice Handle the receipt of an NFT\n * @dev The KIP17 smart contract calls this function on the recipient\n * after a `safeTransfer`. This function MUST return the function selector,\n * otherwise the caller will revert the transaction. The selector to be\n * returned can be obtained as `this.onKIP17Received.selector`. This\n * function MAY throw to revert and reject the transfer.\n * Note: the KIP17 contract address is always the message sender.\n * @param operator The address which called `safeTransferFrom` function\n * @param from The address which previously owned the token\n * @param tokenId The NFT identifier which is being transferred\n * @param data Additional data with no specified format\n * @return bytes4 `bytes4(keccak256(\"onKIP17Received(address,address,uint256,bytes)\"))`\n */\n function onKIP17Received(address operator, address from, uint256 tokenId, bytes memory data)\n public returns (bytes4);\n}\n" }, "/workspace/token/KIP17/KIP17.sol": { "content": "pragma solidity ^0.5.0;\n\nimport \"./IKIP17.sol\";\nimport \"./IERC721Receiver.sol\";\nimport \"./IKIP17Receiver.sol\";\nimport \"../../math/SafeMath.sol\";\nimport \"../../utils/Address.sol\";\nimport \"../../drafts/Counters.sol\";\nimport \"../../introspection/KIP13.sol\";\n\n/**\n * @title KIP17 Non-Fungible Token Standard basic implementation\n * @dev see http://kips.klaytn.com/KIPs/kip-17-non_fungible_token\n */\ncontract KIP17 is KIP13, IKIP17 {\n using SafeMath for uint256;\n using Address for address;\n using Counters for Counters.Counter;\n\n // Equals to `bytes4(keccak256(\"onKIP17Received(address,address,uint256,bytes)\"))`\n // which can be also obtained as `IKIP17Receiver(0).onKIP17Received.selector`\n bytes4 private constant _KIP17_RECEIVED = 0x6745782b;\n\n // Equals to `bytes4(keccak256(\"onERC721Received(address,address,uint256,bytes)\"))`\n // which can be also obtained as `IERC721Receiver(0).onERC721Received.selector`\n bytes4 private constant _ERC721_RECEIVED = 0x150b7a02;\n\n // Mapping from token ID to owner\n mapping (uint256 => address) private _tokenOwner;\n\n // Mapping from token ID to approved address\n mapping (uint256 => address) private _tokenApprovals;\n\n // Mapping from owner to number of owned token\n mapping (address => Counters.Counter) private _ownedTokensCount;\n\n // Mapping from owner to operator approvals\n mapping (address => mapping (address => bool)) private _operatorApprovals;\n\n /*\n * bytes4(keccak256('balanceOf(address)')) == 0x70a08231\n * bytes4(keccak256('ownerOf(uint256)')) == 0x6352211e\n * bytes4(keccak256('approve(address,uint256)')) == 0x095ea7b3\n * bytes4(keccak256('getApproved(uint256)')) == 0x081812fc\n * bytes4(keccak256('setApprovalForAll(address,bool)')) == 0xa22cb465\n * bytes4(keccak256('isApprovedForAll(address,address)')) == 0xe985e9c\n * bytes4(keccak256('transferFrom(address,address,uint256)')) == 0x23b872dd\n * bytes4(keccak256('safeTransferFrom(address,address,uint256)')) == 0x42842e0e\n * bytes4(keccak256('safeTransferFrom(address,address,uint256,bytes)')) == 0xb88d4fde\n *\n * => 0x70a08231 ^ 0x6352211e ^ 0x095ea7b3 ^ 0x081812fc ^\n * 0xa22cb465 ^ 0xe985e9c ^ 0x23b872dd ^ 0x42842e0e ^ 0xb88d4fde == 0x80ac58cd\n */\n bytes4 private constant _INTERFACE_ID_KIP17 = 0x80ac58cd;\n\n constructor () public {\n // register the supported interfaces to conform to KIP17 via KIP13\n _registerInterface(_INTERFACE_ID_KIP17);\n }\n\n /**\n * @dev Gets the balance of the specified address.\n * @param owner address to query the balance of\n * @return uint256 representing the amount owned by the passed address\n */\n function balanceOf(address owner) public view returns (uint256) {\n require(owner != address(0), \"KIP17: balance query for the zero address\");\n\n return _ownedTokensCount[owner].current();\n }\n\n /**\n * @dev Gets the owner of the specified token ID.\n * @param tokenId uint256 ID of the token to query the owner of\n * @return address currently marked as the owner of the given token ID\n */\n function ownerOf(uint256 tokenId) public view returns (address) {\n address owner = _tokenOwner[tokenId];\n require(owner != address(0), \"KIP17: owner query for nonexistent token\");\n\n return owner;\n }\n\n /**\n * @dev Approves another address to transfer the given token ID\n * The zero address indicates there is no approved address.\n * There can only be one approved address per token at a given time.\n * Can only be called by the token owner or an approved operator.\n * @param to address to be approved for the given token ID\n * @param tokenId uint256 ID of the token to be approved\n */\n function approve(address to, uint256 tokenId) public {\n address owner = ownerOf(tokenId);\n require(to != owner, \"KIP17: approval to current owner\");\n\n require(msg.sender == owner || isApprovedForAll(owner, msg.sender),\n \"KIP17: approve caller is not owner nor approved for all\"\n );\n\n _tokenApprovals[tokenId] = to;\n emit Approval(owner, to, tokenId);\n }\n\n /**\n * @dev Gets the approved address for a token ID, or zero if no address set\n * Reverts if the token ID does not exist.\n * @param tokenId uint256 ID of the token to query the approval of\n * @return address currently approved for the given token ID\n */\n function getApproved(uint256 tokenId) public view returns (address) {\n require(_exists(tokenId), \"KIP17: approved query for nonexistent token\");\n\n return _tokenApprovals[tokenId];\n }\n\n /**\n * @dev Sets or unsets the approval of a given operator\n * An operator is allowed to transfer all tokens of the sender on their behalf.\n * @param to operator address to set the approval\n * @param approved representing the status of the approval to be set\n */\n function setApprovalForAll(address to, bool approved) public {\n require(to != msg.sender, \"KIP17: approve to caller\");\n\n _operatorApprovals[msg.sender][to] = approved;\n emit ApprovalForAll(msg.sender, to, approved);\n }\n\n /**\n * @dev Tells whether an operator is approved by a given owner.\n * @param owner owner address which you want to query the approval of\n * @param operator operator address which you want to query the approval of\n * @return bool whether the given operator is approved by the given owner\n */\n function isApprovedForAll(address owner, address operator) public view returns (bool) {\n return _operatorApprovals[owner][operator];\n }\n\n /**\n * @dev Transfers the ownership of a given token ID to another address.\n * Usage of this method is discouraged, use `safeTransferFrom` whenever possible.\n * Requires the msg.sender to be the owner, approved, or operator.\n * @param from current owner of the token\n * @param to address to receive the ownership of the given token ID\n * @param tokenId uint256 ID of the token to be transferred\n */\n function transferFrom(address from, address to, uint256 tokenId) public {\n //solhint-disable-next-line max-line-length\n require(_isApprovedOrOwner(msg.sender, tokenId), \"KIP17: transfer caller is not owner nor approved\");\n\n _transferFrom(from, to, tokenId);\n }\n\n /**\n * @dev Safely transfers the ownership of a given token ID to another address\n * If the target address is a contract, it must implement `onKIP17Received`,\n * which is called upon a safe transfer, and return the magic value\n * `bytes4(keccak256(\"onKIP17Received(address,address,uint256,bytes)\"))`; otherwise,\n * the transfer is reverted.\n * Requires the msg.sender to be the owner, approved, or operator\n * @param from current owner of the token\n * @param to address to receive the ownership of the given token ID\n * @param tokenId uint256 ID of the token to be transferred\n */\n function safeTransferFrom(address from, address to, uint256 tokenId) public {\n safeTransferFrom(from, to, tokenId, \"\");\n }\n\n /**\n * @dev Safely transfers the ownership of a given token ID to another address\n * If the target address is a contract, it must implement `onKIP17Received`,\n * which is called upon a safe transfer, and return the magic value\n * `bytes4(keccak256(\"onKIP17Received(address,address,uint256,bytes)\"))`; otherwise,\n * the transfer is reverted.\n * Requires the msg.sender to be the owner, approved, or operator\n * @param from current owner of the token\n * @param to address to receive the ownership of the given token ID\n * @param tokenId uint256 ID of the token to be transferred\n * @param _data bytes data to send along with a safe transfer check\n */\n function safeTransferFrom(address from, address to, uint256 tokenId, bytes memory _data) public {\n transferFrom(from, to, tokenId);\n require(_checkOnKIP17Received(from, to, tokenId, _data), \"KIP17: transfer to non KIP17Receiver implementer\");\n }\n\n /**\n * @dev Returns whether the specified token exists.\n * @param tokenId uint256 ID of the token to query the existence of\n * @return bool whether the token exists\n */\n function _exists(uint256 tokenId) internal view returns (bool) {\n address owner = _tokenOwner[tokenId];\n return owner != address(0);\n }\n\n /**\n * @dev Returns whether the given spender can transfer a given token ID.\n * @param spender address of the spender to query\n * @param tokenId uint256 ID of the token to be transferred\n * @return bool whether the msg.sender is approved for the given token ID,\n * is an operator of the owner, or is the owner of the token\n */\n function _isApprovedOrOwner(address spender, uint256 tokenId) internal view returns (bool) {\n require(_exists(tokenId), \"KIP17: operator query for nonexistent token\");\n address owner = ownerOf(tokenId);\n return (spender == owner || getApproved(tokenId) == spender || isApprovedForAll(owner, spender));\n }\n\n /**\n * @dev Internal function to mint a new token.\n * Reverts if the given token ID already exists.\n * @param to The address that will own the minted token\n * @param tokenId uint256 ID of the token to be minted\n */\n function _mint(address to, uint256 tokenId) internal {\n require(to != address(0), \"KIP17: mint to the zero address\");\n require(!_exists(tokenId), \"KIP17: token already minted\");\n\n _tokenOwner[tokenId] = to;\n _ownedTokensCount[to].increment();\n\n emit Transfer(address(0), to, tokenId);\n }\n\n /**\n * @dev Internal function to burn a specific token.\n * Reverts if the token does not exist.\n * Deprecated, use _burn(uint256) instead.\n * @param owner owner of the token to burn\n * @param tokenId uint256 ID of the token being burned\n */\n function _burn(address owner, uint256 tokenId) internal {\n require(ownerOf(tokenId) == owner, \"KIP17: burn of token that is not own\");\n\n _clearApproval(tokenId);\n\n _ownedTokensCount[owner].decrement();\n _tokenOwner[tokenId] = address(0);\n\n emit Transfer(owner, address(0), tokenId);\n }\n\n /**\n * @dev Internal function to burn a specific token.\n * Reverts if the token does not exist.\n * @param tokenId uint256 ID of the token being burned\n */\n function _burn(uint256 tokenId) internal {\n _burn(ownerOf(tokenId), tokenId);\n }\n\n /**\n * @dev Internal function to transfer ownership of a given token ID to another address.\n * As opposed to transferFrom, this imposes no restrictions on msg.sender.\n * @param from current owner of the token\n * @param to address to receive the ownership of the given token ID\n * @param tokenId uint256 ID of the token to be transferred\n */\n function _transferFrom(address from, address to, uint256 tokenId) internal {\n require(ownerOf(tokenId) == from, \"KIP17: transfer of token that is not own\");\n require(to != address(0), \"KIP17: transfer to the zero address\");\n\n _clearApproval(tokenId);\n\n _ownedTokensCount[from].decrement();\n _ownedTokensCount[to].increment();\n\n _tokenOwner[tokenId] = to;\n\n emit Transfer(from, to, tokenId);\n }\n\n /**\n * @dev Internal function to invoke `onKIP17Received` on a target address.\n * The call is not executed if the target address is not a contract.\n *\n * This function is deprecated.\n * @param from address representing the previous owner of the given token ID\n * @param to target address that will receive the tokens\n * @param tokenId uint256 ID of the token to be transferred\n * @param _data bytes optional data to send along with the call\n * @return bool whether the call correctly returned the expected magic value\n */\n function _checkOnKIP17Received(address from, address to, uint256 tokenId, bytes memory _data)\n internal returns (bool)\n {\n if (!to.isContract()) {\n return true;\n }\n\n // Logic for compatibility with ERC721.\n bytes4 retval = IERC721Receiver(to).onERC721Received(msg.sender, from, tokenId, _data);\n if (retval == _ERC721_RECEIVED) {\n return true;\n }\n\n retval = IKIP17Receiver(to).onKIP17Received(msg.sender, from, tokenId, _data);\n return (retval == _KIP17_RECEIVED);\n }\n\n /**\n * @dev Private function to clear current approval of a given token ID.\n * @param tokenId uint256 ID of the token to be transferred\n */\n function _clearApproval(uint256 tokenId) private {\n if (_tokenApprovals[tokenId] != address(0)) {\n _tokenApprovals[tokenId] = address(0);\n }\n }\n}\n" }, "/workspace/token/KIP17/KIP17Burnable.sol": { "content": "pragma solidity ^0.5.0;\n\nimport \"./KIP17.sol\";\nimport \"../../introspection/KIP13.sol\";\n\n/**\n * @title KIP17 Burnable Token\n * @dev KIP17 Token that can be irreversibly burned (destroyed).\n * See http://kips.klaytn.com/KIPs/kip-17-non_fungible_token\n */\ncontract KIP17Burnable is KIP13, KIP17 {\n /*\n * bytes4(keccak256('burn(uint256)')) == 0x42966c68\n *\n * => 0x42966c68 == 0x42966c68\n */\n bytes4 private constant _INTERFACE_ID_KIP17_BURNABLE = 0x42966c68;\n\n /**\n * @dev Constructor function.\n */\n constructor () public {\n // register the supported interface to conform to KIP17Burnable via KIP13\n _registerInterface(_INTERFACE_ID_KIP17_BURNABLE);\n }\n\n /**\n * @dev Burns a specific KIP17 token.\n * @param tokenId uint256 id of the KIP17 token to be burned.\n */\n function burn(uint256 tokenId) public {\n //solhint-disable-next-line max-line-length\n require(_isApprovedOrOwner(msg.sender, tokenId), \"KIP17Burnable: caller is not owner nor approved\");\n _burn(tokenId);\n }\n}\n" }, "/workspace/token/KIP17/KIP17Enumerable.sol": { "content": "pragma solidity ^0.5.0;\n\nimport \"./IKIP17Enumerable.sol\";\nimport \"./KIP17.sol\";\nimport \"../../introspection/KIP13.sol\";\n\n/**\n * @title KIP-17 Non-Fungible Token with optional enumeration extension logic\n * @dev See http://kips.klaytn.com/KIPs/kip-17-non_fungible_token\n */\ncontract KIP17Enumerable is KIP13, KIP17, IKIP17Enumerable {\n // Mapping from owner to list of owned token IDs\n mapping(address => uint256[]) private _ownedTokens;\n\n // Mapping from token ID to index of the owner tokens list\n mapping(uint256 => uint256) private _ownedTokensIndex;\n\n // Array with all token ids, used for enumeration\n uint256[] private _allTokens;\n\n // Mapping from token id to position in the allTokens array\n mapping(uint256 => uint256) private _allTokensIndex;\n\n /*\n * bytes4(keccak256('totalSupply()')) == 0x18160ddd\n * bytes4(keccak256('tokenOfOwnerByIndex(address,uint256)')) == 0x2f745c59\n * bytes4(keccak256('tokenByIndex(uint256)')) == 0x4f6ccce7\n *\n * => 0x18160ddd ^ 0x2f745c59 ^ 0x4f6ccce7 == 0x780e9d63\n */\n bytes4 private constant _INTERFACE_ID_KIP17_ENUMERABLE = 0x780e9d63;\n\n /**\n * @dev Constructor function.\n */\n constructor () public {\n // register the supported interface to conform to KIP17Enumerable via KIP13\n _registerInterface(_INTERFACE_ID_KIP17_ENUMERABLE);\n }\n\n /**\n * @dev Gets the token ID at a given index of the tokens list of the requested owner.\n * @param owner address owning the tokens list to be accessed\n * @param index uint256 representing the index to be accessed of the requested tokens list\n * @return uint256 token ID at the given index of the tokens list owned by the requested address\n */\n function tokenOfOwnerByIndex(address owner, uint256 index) public view returns (uint256) {\n require(index < balanceOf(owner), \"KIP17Enumerable: owner index out of bounds\");\n return _ownedTokens[owner][index];\n }\n\n /**\n * @dev Gets the total amount of tokens stored by the contract.\n * @return uint256 representing the total amount of tokens\n */\n function totalSupply() public view returns (uint256) {\n return _allTokens.length;\n }\n\n /**\n * @dev Gets the token ID at a given index of all the tokens in this contract\n * Reverts if the index is greater or equal to the total number of tokens.\n * @param index uint256 representing the index to be accessed of the tokens list\n * @return uint256 token ID at the given index of the tokens list\n */\n function tokenByIndex(uint256 index) public view returns (uint256) {\n require(index < totalSupply(), \"KIP17Enumerable: global index out of bounds\");\n return _allTokens[index];\n }\n\n /**\n * @dev Internal function to transfer ownership of a given token ID to another address.\n * As opposed to transferFrom, this imposes no restrictions on msg.sender.\n * @param from current owner of the token\n * @param to address to receive the ownership of the given token ID\n * @param tokenId uint256 ID of the token to be transferred\n */\n function _transferFrom(address from, address to, uint256 tokenId) internal {\n super._transferFrom(from, to, tokenId);\n\n _removeTokenFromOwnerEnumeration(from, tokenId);\n\n _addTokenToOwnerEnumeration(to, tokenId);\n }\n\n /**\n * @dev Internal function to mint a new token.\n * Reverts if the given token ID already exists.\n * @param to address the beneficiary that will own the minted token\n * @param tokenId uint256 ID of the token to be minted\n */\n function _mint(address to, uint256 tokenId) internal {\n super._mint(to, tokenId);\n\n _addTokenToOwnerEnumeration(to, tokenId);\n\n _addTokenToAllTokensEnumeration(tokenId);\n }\n\n /**\n * @dev Internal function to burn a specific token.\n * Reverts if the token does not exist.\n * Deprecated, use _burn(uint256) instead.\n * @param owner owner of the token to burn\n * @param tokenId uint256 ID of the token being burned\n */\n function _burn(address owner, uint256 tokenId) internal {\n super._burn(owner, tokenId);\n\n _removeTokenFromOwnerEnumeration(owner, tokenId);\n // Since tokenId will be deleted, we can clear its slot in _ownedTokensIndex to trigger a gas refund\n _ownedTokensIndex[tokenId] = 0;\n\n _removeTokenFromAllTokensEnumeration(tokenId);\n }\n\n /**\n * @dev Gets the list of token IDs of the requested owner.\n * @param owner address owning the tokens\n * @return uint256[] List of token IDs owned by the requested address\n */\n function _tokensOfOwner(address owner) internal view returns (uint256[] storage) {\n return _ownedTokens[owner];\n }\n\n /**\n * @dev Private function to add a token to this extension's ownership-tracking data structures.\n * @param to address representing the new owner of the given token ID\n * @param tokenId uint256 ID of the token to be added to the tokens list of the given address\n */\n function _addTokenToOwnerEnumeration(address to, uint256 tokenId) private {\n _ownedTokensIndex[tokenId] = _ownedTokens[to].length;\n _ownedTokens[to].push(tokenId);\n }\n\n /**\n * @dev Private function to add a token to this extension's token tracking data structures.\n * @param tokenId uint256 ID of the token to be added to the tokens list\n */\n function _addTokenToAllTokensEnumeration(uint256 tokenId) private {\n _allTokensIndex[tokenId] = _allTokens.length;\n _allTokens.push(tokenId);\n }\n\n /**\n * @dev Private function to remove a token from this extension's ownership-tracking data structures. Note that\n * while the token is not assigned a new owner, the _ownedTokensIndex mapping is _not_ updated: this allows for\n * gas optimizations e.g. when performing a transfer operation (avoiding double writes).\n * This has O(1) time complexity, but alters the order of the _ownedTokens array.\n * @param from address representing the previous owner of the given token ID\n * @param tokenId uint256 ID of the token to be removed from the tokens list of the given address\n */\n function _removeTokenFromOwnerEnumeration(address from, uint256 tokenId) private {\n // To prevent a gap in from's tokens array, we store the last token in the index of the token to delete, and\n // then delete the last slot (swap and pop).\n\n uint256 lastTokenIndex = _ownedTokens[from].length.sub(1);\n uint256 tokenIndex = _ownedTokensIndex[tokenId];\n\n // When the token to delete is the last token, the swap operation is unnecessary\n if (tokenIndex != lastTokenIndex) {\n uint256 lastTokenId = _ownedTokens[from][lastTokenIndex];\n\n _ownedTokens[from][tokenIndex] = lastTokenId; // Move the last token to the slot of the to-delete token\n _ownedTokensIndex[lastTokenId] = tokenIndex; // Update the moved token's index\n }\n\n // This also deletes the contents at the last position of the array\n _ownedTokens[from].length--;\n\n // Note that _ownedTokensIndex[tokenId] hasn't been cleared: it still points to the old slot (now occupied by\n // lastTokenId, or just over the end of the array if the token was the last one).\n }\n\n /**\n * @dev Private function to remove a token from this extension's token tracking data structures.\n * This has O(1) time complexity, but alters the order of the _allTokens array.\n * @param tokenId uint256 ID of the token to be removed from the tokens list\n */\n function _removeTokenFromAllTokensEnumeration(uint256 tokenId) private {\n // To prevent a gap in the tokens array, we store the last token in the index of the token to delete, and\n // then delete the last slot (swap and pop).\n\n uint256 lastTokenIndex = _allTokens.length.sub(1);\n uint256 tokenIndex = _allTokensIndex[tokenId];\n\n // When the token to delete is the last token, the swap operation is unnecessary. However, since this occurs so\n // rarely (when the last minted token is burnt) that we still do the swap here to avoid the gas cost of adding\n // an 'if' statement (like in _removeTokenFromOwnerEnumeration)\n uint256 lastTokenId = _allTokens[lastTokenIndex];\n\n _allTokens[tokenIndex] = lastTokenId; // Move the last token to the slot of the to-delete token\n _allTokensIndex[lastTokenId] = tokenIndex; // Update the moved token's index\n\n // This also deletes the contents at the last position of the array\n _allTokens.length--;\n _allTokensIndex[tokenId] = 0;\n }\n}\n" }, "/workspace/token/KIP17/KIP17Full.sol": { "content": "pragma solidity ^0.5.0;\n\nimport \"./KIP17.sol\";\nimport \"./KIP17Enumerable.sol\";\nimport \"./KIP17Metadata.sol\";\n\n/**\n * @title Full KIP-17 Token\n * This implementation includes all the required and some optional functionality of the KIP-17 standard\n * Moreover, it includes approve all functionality using operator terminology\n * @dev see http://kips.klaytn.com/KIPs/kip-17-non_fungible_token\n */\ncontract KIP17Full is KIP17, KIP17Enumerable, KIP17Metadata {\n constructor (string memory name, string memory symbol) public KIP17Metadata(name, symbol) {\n // solhint-disable-previous-line no-empty-blocks\n }\n}\n" }, "/workspace/token/KIP17/KIP17Metadata.sol": { "content": "pragma solidity ^0.5.0;\n\nimport \"./KIP17.sol\";\nimport \"./IKIP17Metadata.sol\";\nimport \"../../introspection/KIP13.sol\";\n\ncontract KIP17Metadata is KIP13, KIP17, IKIP17Metadata {\n // Token name\n string private _name;\n\n // Token symbol\n string private _symbol;\n\n // Optional mapping for token URIs\n mapping(uint256 => string) private _tokenURIs;\n\n /*\n * bytes4(keccak256('name()')) == 0x06fdde03\n * bytes4(keccak256('symbol()')) == 0x95d89b41\n * bytes4(keccak256('tokenURI(uint256)')) == 0xc87b56dd\n *\n * => 0x06fdde03 ^ 0x95d89b41 ^ 0xc87b56dd == 0x5b5e139f\n */\n bytes4 private constant _INTERFACE_ID_KIP17_METADATA = 0x5b5e139f;\n\n /**\n * @dev Constructor function\n */\n constructor (string memory name, string memory symbol) public {\n _name = name;\n _symbol = symbol;\n\n // register the supported interfaces to conform to KIP17 via KIP13\n _registerInterface(_INTERFACE_ID_KIP17_METADATA);\n }\n\n /**\n * @dev Gets the token name.\n * @return string representing the token name\n */\n function name() external view returns (string memory) {\n return _name;\n }\n\n /**\n * @dev Gets the token symbol.\n * @return string representing the token symbol\n */\n function symbol() external view returns (string memory) {\n return _symbol;\n }\n\n /**\n * @dev Returns an URI for a given token ID.\n * Throws if the token ID does not exist. May return an empty string.\n * @param tokenId uint256 ID of the token to query\n */\n function tokenURI(uint256 tokenId) external view returns (string memory) {\n require(_exists(tokenId), \"KIP17Metadata: URI query for nonexistent token\");\n return _tokenURIs[tokenId];\n }\n\n /**\n * @dev Internal function to set the token URI for a given token.\n * Reverts if the token ID does not exist.\n * @param tokenId uint256 ID of the token to set its URI\n * @param uri string URI to assign\n */\n function _setTokenURI(uint256 tokenId, string memory uri) internal {\n require(_exists(tokenId), \"KIP17Metadata: URI set of nonexistent token\");\n _tokenURIs[tokenId] = uri;\n }\n\n /**\n * @dev Internal function to burn a specific token.\n * Reverts if the token does not exist.\n * Deprecated, use _burn(uint256) instead.\n * @param owner owner of the token to burn\n * @param tokenId uint256 ID of the token being burned by the msg.sender\n */\n function _burn(address owner, uint256 tokenId) internal {\n super._burn(owner, tokenId);\n\n // Clear metadata (if any)\n if (bytes(_tokenURIs[tokenId]).length != 0) {\n delete _tokenURIs[tokenId];\n }\n }\n}\n" }, "/workspace/token/KIP17/KIP17MetadataMintable.sol": { "content": "pragma solidity ^0.5.0;\n\nimport \"./KIP17Metadata.sol\";\nimport \"../../access/roles/MinterRole.sol\";\nimport \"../../introspection/KIP13.sol\";\n\n\n/**\n * @title KIP17MetadataMintable\n * @dev KIP17 minting logic with metadata.\n */\ncontract KIP17MetadataMintable is KIP13, KIP17, KIP17Metadata, MinterRole {\n /*\n * bytes4(keccak256('mintWithTokenURI(address,uint256,string)')) == 0x50bb4e7f\n * bytes4(keccak256('isMinter(address)')) == 0xaa271e1a\n * bytes4(keccak256('addMinter(address)')) == 0x983b2d56\n * bytes4(keccak256('renounceMinter()')) == 0x98650275\n *\n * => 0x50bb4e7f ^ 0xaa271e1a ^ 0x983b2d56 ^ 0x98650275 == 0xfac27f46\n */\n bytes4 private constant _INTERFACE_ID_KIP17_METADATA_MINTABLE = 0xfac27f46;\n\n /**\n * @dev Constructor function.\n */\n constructor () public {\n // register the supported interface to conform to KIP17Mintable via KIP13\n _registerInterface(_INTERFACE_ID_KIP17_METADATA_MINTABLE);\n }\n\n /**\n * @dev Function to mint tokens.\n * @param to The address that will receive the minted tokens.\n * @param tokenId The token id to mint.\n * @param tokenURI The token URI of the minted token.\n * @return A boolean that indicates if the operation was successful.\n */\n function mintWithTokenURI(address to, uint256 tokenId, string memory tokenURI) public onlyMinter returns (bool) {\n _mint(to, tokenId);\n _setTokenURI(tokenId, tokenURI);\n return true;\n }\n}\n" }, "/workspace/token/KIP17/KIP17Mintable.sol": { "content": "pragma solidity ^0.5.0;\n\nimport \"./KIP17.sol\";\nimport \"../../access/roles/MinterRole.sol\";\n\n/**\n * @title KIP17Mintable\n * @dev KIP17 minting logic.\n */\ncontract KIP17Mintable is KIP17, MinterRole {\n /*\n * bytes4(keccak256('isMinter(address)')) == 0xaa271e1a\n * bytes4(keccak256('addMinter(address)')) == 0x983b2d56\n * bytes4(keccak256('renounceMinter()')) == 0x98650275\n * bytes4(keccak256('mint(address,uint256)')) == 0x40c10f19\n *\n * => 0xaa271e1a ^ 0x983b2d56 ^ 0x98650275 ^ 0x40c10f19 == 0xeab83e20\n */\n bytes4 private constant _INTERFACE_ID_KIP17_MINTABLE = 0xeab83e20;\n\n /**\n * @dev Constructor function.\n */\n constructor () public {\n // register the supported interface to conform to KIP17Mintable via KIP13\n _registerInterface(_INTERFACE_ID_KIP17_MINTABLE);\n }\n\n /**\n * @dev Function to mint tokens.\n * @param to The address that will receive the minted tokens.\n * @param tokenId The token id to mint.\n * @return A boolean that indicates if the operation was successful.\n */\n function mint(address to, uint256 tokenId) public onlyMinter returns (bool) {\n _mint(to, tokenId);\n return true;\n }\n}" }, "/workspace/token/KIP17/KIP17Pausable.sol": { "content": "pragma solidity ^0.5.0;\n\nimport \"./KIP17.sol\";\nimport \"../../lifecycle/Pausable.sol\";\nimport \"../../introspection/KIP13.sol\";\n\n/**\n * @title KIP17 Non-Fungible Pausable token\n * @dev KIP17 modified with pausable transfers.\n */\ncontract KIP17Pausable is KIP13, KIP17, Pausable {\n /*\n * bytes4(keccak256('paused()')) == 0x5c975abb\n * bytes4(keccak256('pause()')) == 0x8456cb59\n * bytes4(keccak256('unpause()')) == 0x3f4ba83a\n * bytes4(keccak256('isPauser(address)')) == 0x46fbf68e\n * bytes4(keccak256('addPauser(address)')) == 0x82dc1ec4\n * bytes4(keccak256('renouncePauser()')) == 0x6ef8d66d\n *\n * => 0x5c975abb ^ 0x8456cb59 ^ 0x3f4ba83a ^ 0x46fbf68e ^ 0x82dc1ec4 ^ 0x6ef8d66d == 0x4d5507ff\n */\n bytes4 private constant _INTERFACE_ID_KIP17_PAUSABLE = 0x4d5507ff;\n\n /**\n * @dev Constructor function.\n */\n constructor () public {\n // register the supported interface to conform to KIP17Pausable via KIP13\n _registerInterface(_INTERFACE_ID_KIP17_PAUSABLE);\n }\n\n function approve(address to, uint256 tokenId) public whenNotPaused {\n super.approve(to, tokenId);\n }\n\n function setApprovalForAll(address to, bool approved) public whenNotPaused {\n super.setApprovalForAll(to, approved);\n }\n\n function transferFrom(address from, address to, uint256 tokenId) public whenNotPaused {\n super.transferFrom(from, to, tokenId);\n }\n}\n" }, "/workspace/token/KIP17/KIP17TokenOwnable.sol": { "content": "pragma solidity ^0.5.0;\n\nimport \"./KIP17Full.sol\";\nimport \"./KIP17MetadataMintable.sol\";\nimport \"./KIP17Mintable.sol\";\nimport \"./KIP17Burnable.sol\";\nimport \"./KIP17Pausable.sol\";\nimport \"../../ownership/Ownable.sol\";\n\ncontract KIP17TokenOwnable is\n KIP17Full,\n KIP17Mintable,\n KIP17MetadataMintable,\n KIP17Burnable,\n KIP17Pausable,\n Ownable\n{\n constructor(\n string memory name,\n string memory symbol,\n address payable newOwner\n ) public KIP17Full(name, symbol) {\n transferOwnership(newOwner);\n }\n}\n" }, "/workspace/utils/Address.sol": { "content": "pragma solidity ^0.5.0;\n\n/**\n * @dev Collection of functions related to the address type,\n */\nlibrary Address {\n /**\n * @dev Returns true if `account` is a contract.\n *\n * This test is non-exhaustive, and there may be false-negatives: during the\n * execution of a contract's constructor, its address will be reported as\n * not containing a contract.\n *\n * > It is unsafe to assume that an address for which this function returns\n * false is an externally-owned account (EOA) and not a contract.\n */\n function isContract(address account) internal view returns (bool) {\n // This method relies in extcodesize, which returns 0 for contracts in\n // construction, since the code is only stored at the end of the\n // constructor execution.\n\n uint256 size;\n // solhint-disable-next-line no-inline-assembly\n assembly { size := extcodesize(account) }\n return size > 0;\n }\n}\n" } }, "settings": { "evmVersion": "byzantium", "outputSelection": { "*": { "*": [ "metadata", "evm.bytecode", "evm.bytecode.sourceMap" ], "": [ "ast" ] }, "def": { "MyContract": [ "abi", "evm.bytecode.opcodes" ] } } } }