Transaction Hash:
Block:
14451270 at Mar-24-2022 09:00:34 PM +UTC
Transaction Fee:
0.002806967470075792 ETH
$5.53
Gas Used:
58,202 Gas / 48.228024296 Gwei
Emitted Events:
| 482 |
COS.TransferBatch( operator=[Sender] 0xcbc67056e781e719fb9ab3b6d6bdd2ff5bb9fa05, from=0x00000000...000000000, to=[Sender] 0xcbc67056e781e719fb9ab3b6d6bdd2ff5bb9fa05, ids=[237], amounts=[1] )
|
Account State Difference:
| Address | Before | After | State Difference | ||
|---|---|---|---|---|---|
|
0x03e75d7D...7780A8e29
Miner
| (GPUMINE Pool 1) | 1,383.911488096816587001 Eth | 1,383.911575399816587001 Eth | 0.000087303 | |
| 0x460452BA...B157E1d0a | 58.75 Eth | 59 Eth | 0.25 | ||
| 0xCBc67056...f5Bb9FA05 |
0.255112416911194755 Eth
Nonce: 8
|
0.002305449441118963 Eth
Nonce: 9
| 0.252806967470075792 |
Execution Trace
ETH 0.25
COS.mint_Several_nmW( count=1 )
{"Context.sol":{"content":"// SPDX-License-Identifier: MIT\r\n\r\npragma solidity ^0.8.0;\r\n\r\n/**\r\n * @dev Provides information about the current execution context, including the\r\n * sender of the transaction and its data. While these are generally available\r\n * via msg.sender and msg.data, they should not be accessed in such a direct\r\n * manner, since when dealing with meta-transactions the account sending and\r\n * paying for execution may not be the actual sender (as far as an application\r\n * is concerned).\r\n *\r\n * This contract is only required for intermediate, library-like contracts.\r\n */\r\nabstract contract Context {\r\n function _msgSender() internal view virtual returns (address) {\r\n return msg.sender;\r\n }\r\n\r\n function _msgData() internal view virtual returns (bytes calldata) {\r\n return msg.data;\r\n }\r\n}"},"COS.sol":{"content":"//SPDX-License-Identifier: Unlicense\r\npragma solidity ^0.8.9;\r\n\r\nimport \u0027./Ownable.sol\u0027;\r\nimport \u0027./IERC20.sol\u0027;\r\nimport \u0027./ERC1155U.sol\u0027;\r\nimport \"./SafeMath.sol\";\r\nimport \"./Strings.sol\";\r\n\r\n\r\n\r\ninterface ProxyRegistry {\r\n function proxies(address) external view returns (address);\r\n}\r\n\r\ninterface IERC2981 {\r\n function royaltyInfo(uint256 _tokenId, uint256 _salePrice)\r\n external\r\n view\r\n returns (address receiver, uint256 royaltyAmount);\r\n}\r\n\r\ncontract COS is ERC1155U, IERC2981, Ownable {\r\n using SafeMath for uint256;\r\n using Strings for uint256;\r\n\r\n uint256 _currentTokenId = 1;\r\n\r\n uint256 public constant MAX_TOKENS = 4999;\r\n uint256 constant TOKENS_GIFT = 80;\r\n uint256 public PRICE = 0.25 ether;\r\n \r\n uint256 public giftedAmount;\r\n uint256 public presalePurchaseLimit = 3;\r\n bool public presaleLive;\r\n bool public saleLive;\r\n bool public locked;\r\n bool public revealed = false; \r\n\r\n\r\n string private _tokenBaseURI = \u0027ipfs://QmQaZBeLfvrpfwuGCE7Q4iHrjzzngrminW8rgEdJUSoJgr/\u0027;\r\n\r\n bool private _gaslessTrading = true;\r\n uint256 private _royaltyPartsPerMillion = 50_000;\r\n\r\n string public constant name = \u0027Clash of Shiba\u0027;\r\n string public constant symbol = \u0027COS\u0027;\r\n\r\n mapping(address =\u003e bool) public presalerList;\r\n uint256 public currentWave;\r\n mapping(uint256 =\u003e mapping(address =\u003e uint256)) public presalerListPurchases;\r\n\r\n modifier notLocked {\r\n require(!locked, \"Contract metadata methods are locked\");\r\n _;\r\n }\r\n\r\n function send(address to) external onlyOwner {\r\n require(_currentTokenId \u003c= MAX_TOKENS, \u0027Sold out\u0027);\r\n require(giftedAmount \u003c= TOKENS_GIFT, \u0027Sold out\u0027);\r\n giftedAmount++;\r\n _mint(to, _currentTokenId, \u0027\u0027);\r\n\r\n unchecked {\r\n // Can\u0027t overflow\r\n _currentTokenId++;\r\n }\r\n }\r\n\r\n function send_Several(address[] calldata to) external onlyOwner {\r\n unchecked {\r\n // Can\u0027t overflow\r\n require(_currentTokenId - 1 + to.length \u003c= MAX_TOKENS, \u0027Sold out\u0027);\r\n require(giftedAmount + to.length \u003c= TOKENS_GIFT, \"Finito\");\r\n }\r\n\r\n for (uint256 i = 0; i \u003c to.length;) {\r\n giftedAmount++;\r\n _mint(to[i], _currentTokenId, \u0027\u0027);\r\n // An array can\u0027t have a total length\r\n // larger than the max uint256 value.\r\n unchecked {\r\n _currentTokenId++;\r\n i++;\r\n }\r\n }\r\n }\r\n\r\n function mint_Several_nmW(uint256 count) external payable {\r\n require(count \u003c 6, \u0027Max 5\u0027);\r\n require(saleLive);\r\n unchecked {\r\n // Can\u0027t overflow\r\n require(_currentTokenId - 1 + count \u003c= MAX_TOKENS, \u0027Sold out\u0027);\r\n require(count * PRICE == msg.value, \u0027Wrong price\u0027);\r\n }\r\n\r\n uint256[] memory ids = new uint256[](count);\r\n\r\n for (uint256 i = 0; i \u003c count; ) {\r\n ids[i] = _currentTokenId + i;\r\n // An array can\u0027t have a total length\r\n // larger than the max uint256 value.\r\n unchecked {\r\n i++;\r\n }\r\n }\r\n\r\n _batchMint(msg.sender, ids, \u0027\u0027);\r\n\r\n unchecked {\r\n // Can\u0027t overflow\r\n _currentTokenId += count;\r\n }\r\n }\r\n\r\n function addToPresaleList(address[] calldata entries) external onlyOwner {\r\n for(uint256 i = 0; i \u003c entries.length; i++) {\r\n address entry = entries[i];\r\n require(entry != address(0), \"NULL_ADDRESS\");\r\n require(!presalerList[entry], \"DUPLICATE_ENTRY\");\r\n\r\n presalerList[entry] = true;\r\n } \r\n }\r\n\r\n\r\n function removeFromPresaleList(address[] calldata entries) external onlyOwner {\r\n for(uint256 i = 0; i \u003c entries.length; i++) {\r\n address entry = entries[i];\r\n require(entry != address(0), \"NULL_ADDRESS\");\r\n \r\n presalerList[entry] = false;\r\n }\r\n }\r\n\r\n function mint_Presale(uint256 count) external payable {\r\n require(count \u003c= presalePurchaseLimit, \u0027Max \u003c\u0027);\r\n require(presaleLive, \"PRESALE_CLOSED\");\r\n require(presalerListPurchases[currentWave][msg.sender] + count \u003c= presalePurchaseLimit, \"EXCEED_ALLOC\");\r\n\r\n unchecked {\r\n // Can\u0027t overflow\r\n require(_currentTokenId + count \u003c MAX_TOKENS, \u0027Sold out\u0027);\r\n require(count * PRICE == msg.value, \u0027Wrong price\u0027);\r\n }\r\n\r\n uint256[] memory ids = new uint256[](count);\r\n\r\n for (uint256 i = 0; i \u003c count; ) {\r\n ids[i] = _currentTokenId + i;\r\n // An array can\u0027t have a total length\r\n // larger than the max uint256 value.\r\n unchecked {\r\n i++;\r\n }\r\n }\r\n\r\n _batchMint(msg.sender, ids, \u0027\u0027);\r\n\r\n unchecked {\r\n // Can\u0027t overflow\r\n _currentTokenId += count;\r\n }\r\n }\r\n\r\n function totalSupply() public view returns (uint256) {\r\n unchecked {\r\n // Starts with 1\r\n return _currentTokenId - 1;\r\n }\r\n }\r\n\r\n function uri(uint256 tokenId) public view override returns (string memory) {\r\n require(_currentTokenId \u003e= tokenId, \"Cannot query non-existent token\");\r\n if (revealed) {\r\n return string(abi.encodePacked(_tokenBaseURI, tokenId.toString()));\r\n }else {\r\n return _tokenBaseURI;\r\n }\r\n \r\n }\r\n\r\n function supportsInterface(bytes4 interfaceId) public pure virtual override returns (bool) {\r\n return interfaceId == type(IERC2981).interfaceId || super.supportsInterface(interfaceId);\r\n }\r\n\r\n function royaltyInfo(uint256, uint256 salePrice) external view returns (address receiver, uint256 royaltyAmount) {\r\n receiver = owner();\r\n royaltyAmount = (salePrice * _royaltyPartsPerMillion) / 1_000_000;\r\n }\r\n\r\n function isApprovedForAll(address owner, address operator) public view override returns (bool) {\r\n // Allow easier listing for sale on OpenSea. Based on\r\n // https://github.com/ProjectOpenSea/opensea-creatures/blob/f7257a043e82fae8251eec2bdde37a44fee474c4/migrations/2_deploy_contracts.js#L29\r\n if (_gaslessTrading) {\r\n if (block.chainid == 4) {\r\n if (ProxyRegistry(0xF57B2c51dED3A29e6891aba85459d600256Cf317).proxies(owner) == operator) {\r\n return true;\r\n }\r\n } else if (block.chainid == 1) {\r\n if (ProxyRegistry(0xa5409ec958C83C3f309868babACA7c86DCB077c1).proxies(owner) == operator) {\r\n return true;\r\n }\r\n }\r\n }\r\n\r\n return super.isApprovedForAll(owner, operator);\r\n }\r\n\r\n // Admin\r\n\r\n function setBaseURI(string calldata URI) external onlyOwner notLocked {\r\n _tokenBaseURI = URI;\r\n revealed = true;\r\n }\r\n\r\n function setAllowGaslessListing(bool allow) public onlyOwner {\r\n _gaslessTrading = allow;\r\n }\r\n\r\n function setRoyaltyPPM(uint256 newValue) public onlyOwner {\r\n require(newValue \u003c 1_000_000, \u0027Must be \u003c 1e6\u0027);\r\n _royaltyPartsPerMillion = newValue;\r\n }\r\n\r\n function setPrice(uint256 _price) public onlyOwner {\r\n PRICE = _price;\r\n }\r\n\r\n function toggleSaleStatus() public onlyOwner {\r\n saleLive = !saleLive;\r\n }\r\n\r\n function isPresaler(address addr) external view returns (bool) {\r\n return presalerList[addr];\r\n }\r\n \r\n function presalePurchasedCount(address addr) external view returns (uint256) {\r\n return presalerListPurchases[currentWave][addr];\r\n }\r\n\r\n function nextWave(uint256 newLimit) public onlyOwner {\r\n currentWave = currentWave + 1;\r\n presalePurchaseLimit = newLimit;\r\n }\r\n\r\n function lockMetadata() public onlyOwner {\r\n locked = true;\r\n }\r\n \r\n function togglePresaleStatus() public onlyOwner {\r\n presaleLive = !presaleLive;\r\n }\r\n \r\n\r\n function withdraw() external onlyOwner {\r\n _widthdraw(msg.sender, address(this).balance);\r\n }\r\n\r\n function _widthdraw(address _address, uint256 _amount) private {\r\n (bool success, ) = _address.call{value: _amount}(\"\");\r\n require(success, \"Transfer failed.\");\r\n }\r\n function widthrawERC20(IERC20 erc20Token) public onlyOwner {\r\n erc20Token.transfer(msg.sender, erc20Token.balanceOf(address(this)));\r\n }\r\n}"},"ERC1155U.sol":{"content":"// SPDX-License-Identifier: AGPL-3.0-only\r\npragma solidity \u003e=0.8.0;\r\n\r\n/// @notice Minimalist and gas efficient standard ERC1155 implementation.\r\n/// @author Solmate (https://github.com/Rari-Capital/solmate/blob/main/src/tokens/ERC1155.sol)\r\nabstract contract ERC1155U {\r\n /*///////////////////////////////////////////////////////////////\r\n EVENTS\r\n //////////////////////////////////////////////////////////////*/\r\n\r\n event TransferSingle(\r\n address indexed operator,\r\n address indexed from,\r\n address indexed to,\r\n uint256 id,\r\n uint256 amount\r\n );\r\n\r\n event TransferBatch(\r\n address indexed operator,\r\n address indexed from,\r\n address indexed to,\r\n uint256[] ids,\r\n uint256[] amounts\r\n );\r\n\r\n event ApprovalForAll(address indexed owner, address indexed operator, bool approved);\r\n\r\n event URI(string value, uint256 indexed id);\r\n\r\n /*///////////////////////////////////////////////////////////////\r\n ERC1155 STORAGE\r\n //////////////////////////////////////////////////////////////*/\r\n\r\n uint256[10001] private _attrs;\r\n\r\n mapping(address =\u003e mapping(address =\u003e bool)) private _isApprovedForAll;\r\n\r\n /*///////////////////////////////////////////////////////////////\r\n METADATA LOGIC\r\n //////////////////////////////////////////////////////////////*/\r\n\r\n function uri(uint256 id) public view virtual returns (string memory);\r\n\r\n /*///////////////////////////////////////////////////////////////\r\n Ownership \u0026 Data\r\n //////////////////////////////////////////////////////////////*/\r\n\r\n function ownerOf(uint256 id) public view returns (address) {\r\n return address(uint160(_attrs[id] \u0026 0x00ffffffffffffffffffffffffffffffffffffffff));\r\n }\r\n\r\n\r\n function _setOwner(uint256 id, address to) private {\r\n _attrs[id] = (_attrs[id] \u0026 (0xffffffffffffffffffffffff \u003c\u003c 160)) | uint160(to);\r\n }\r\n\r\n /*///////////////////////////////////////////////////////////////\r\n ERC1155 LOGIC\r\n //////////////////////////////////////////////////////////////*/\r\n\r\n function isApprovedForAll(address owner, address operator) public view virtual returns (bool) {\r\n return _isApprovedForAll[owner][operator];\r\n }\r\n\r\n function setApprovalForAll(address operator, bool approved) public virtual {\r\n _isApprovedForAll[msg.sender][operator] = approved;\r\n\r\n emit ApprovalForAll(msg.sender, operator, approved);\r\n }\r\n\r\n function safeTransferFrom(\r\n address from,\r\n address to,\r\n uint256 id,\r\n uint256 amount,\r\n bytes memory data\r\n ) public virtual {\r\n require(msg.sender == from || isApprovedForAll(from, msg.sender), \u0027NOT_AUTHORIZED\u0027);\r\n require(amount == 1, \u0027Can only transfer one\u0027);\r\n require(ownerOf(id) == from, \u0027Not owner\u0027);\r\n\r\n _setOwner(id, to);\r\n\r\n emit TransferSingle(msg.sender, from, to, id, amount);\r\n\r\n require(\r\n to.code.length == 0\r\n ? to != address(0)\r\n : ERC1155TokenReceiver(to).onERC1155Received(msg.sender, from, id, amount, data) ==\r\n ERC1155TokenReceiver.onERC1155Received.selector,\r\n \u0027UNSAFE_RECIPIENT\u0027\r\n );\r\n }\r\n\r\n function safeBatchTransferFrom(\r\n address from,\r\n address to,\r\n uint256[] memory ids,\r\n uint256[] memory amounts,\r\n bytes memory data\r\n ) public virtual {\r\n uint256 idsLength = ids.length; // Saves MLOADs.\r\n\r\n require(idsLength == amounts.length, \u0027LENGTH_MISMATCH\u0027);\r\n\r\n require(msg.sender == from || isApprovedForAll(from, msg.sender), \u0027NOT_AUTHORIZED\u0027);\r\n\r\n for (uint256 i = 0; i \u003c idsLength; ) {\r\n uint256 id = ids[i];\r\n uint256 amount = amounts[i];\r\n \r\n require(amount == 1, \u0027Can only transfer one\u0027);\r\n require(ownerOf(id) == from, \u0027Not owner\u0027);\r\n\r\n _setOwner(id, to);\r\n\r\n // An array can\u0027t have a total length\r\n // larger than the max uint256 value.\r\n unchecked {\r\n i++;\r\n }\r\n }\r\n\r\n emit TransferBatch(msg.sender, from, to, ids, amounts);\r\n\r\n require(\r\n to.code.length == 0\r\n ? to != address(0)\r\n : ERC1155TokenReceiver(to).onERC1155BatchReceived(msg.sender, from, ids, amounts, data) ==\r\n ERC1155TokenReceiver.onERC1155BatchReceived.selector,\r\n \u0027UNSAFE_RECIPIENT\u0027\r\n );\r\n }\r\n\r\n function balanceOf(address owner, uint256 id) public view virtual returns (uint256 balance) {\r\n if (ownerOf(id) == owner) {\r\n balance = 1;\r\n }\r\n }\r\n\r\n function balanceOfBatch(address[] memory owners, uint256[] memory ids)\r\n public\r\n view\r\n virtual\r\n returns (uint256[] memory balances)\r\n {\r\n uint256 ownersLength = owners.length; // Saves MLOADs.\r\n\r\n require(ownersLength == ids.length, \u0027LENGTH_MISMATCH\u0027);\r\n\r\n balances = new uint256[](owners.length);\r\n\r\n // Unchecked because the only math done is incrementing\r\n // the array index counter which cannot possibly overflow.\r\n unchecked {\r\n for (uint256 i = 0; i \u003c ownersLength; i++) {\r\n balances[i] = balanceOf(owners[i], ids[i]);\r\n }\r\n }\r\n }\r\n\r\n /*///////////////////////////////////////////////////////////////\r\n ERC165 LOGIC\r\n //////////////////////////////////////////////////////////////*/\r\n\r\n function supportsInterface(bytes4 interfaceId) public pure virtual returns (bool) {\r\n return\r\n interfaceId == 0x01ffc9a7 || // ERC165 Interface ID for ERC165\r\n interfaceId == 0xd9b67a26 || // ERC165 Interface ID for ERC1155\r\n interfaceId == 0x0e89341c; // ERC165 Interface ID for ERC1155MetadataURI\r\n }\r\n\r\n /*///////////////////////////////////////////////////////////////\r\n INTERNAL MINT/BURN LOGIC\r\n //////////////////////////////////////////////////////////////*/\r\n\r\n function _mint(\r\n address to,\r\n uint256 id,\r\n bytes memory data\r\n ) internal {\r\n _setOwner(id, to);\r\n emit TransferSingle(msg.sender, address(0), to, id, 1);\r\n\r\n require(\r\n to.code.length == 0\r\n ? to != address(0)\r\n : ERC1155TokenReceiver(to).onERC1155Received(msg.sender, address(0), id, 1, data) ==\r\n ERC1155TokenReceiver.onERC1155Received.selector,\r\n \u0027UNSAFE_RECIPIENT\u0027\r\n );\r\n }\r\n\r\n function _batchMint(\r\n address to,\r\n uint256[] memory ids,\r\n bytes memory data\r\n ) internal {\r\n uint256 idsLength = ids.length; // Saves MLOADs.\r\n uint256[] memory amounts = new uint256[](idsLength);\r\n\r\n for (uint256 i = 0; i \u003c idsLength; ) {\r\n amounts[i] = 1;\r\n _setOwner(ids[i], to);\r\n\r\n // An array can\u0027t have a total length\r\n // larger than the max uint256 value.\r\n unchecked {\r\n i++;\r\n }\r\n }\r\n\r\n emit TransferBatch(msg.sender, address(0), to, ids, amounts);\r\n\r\n require(\r\n to.code.length == 0\r\n ? to != address(0)\r\n : ERC1155TokenReceiver(to).onERC1155BatchReceived(msg.sender, address(0), ids, amounts, data) ==\r\n ERC1155TokenReceiver.onERC1155BatchReceived.selector,\r\n \u0027UNSAFE_RECIPIENT\u0027\r\n );\r\n }\r\n}\r\n\r\n/// @notice A generic interface for a contract which properly accepts ERC1155 tokens.\r\n/// @author Solmate (https://github.com/Rari-Capital/solmate/blob/main/src/tokens/ERC1155.sol)\r\ninterface ERC1155TokenReceiver {\r\n function onERC1155Received(\r\n address operator,\r\n address from,\r\n uint256 id,\r\n uint256 amount,\r\n bytes calldata data\r\n ) external returns (bytes4);\r\n\r\n function onERC1155BatchReceived(\r\n address operator,\r\n address from,\r\n uint256[] calldata ids,\r\n uint256[] calldata amounts,\r\n bytes calldata data\r\n ) external returns (bytes4);\r\n}"},"IERC20.sol":{"content":"// SPDX-License-Identifier: MIT\r\n\r\npragma solidity ^0.8.0;\r\n\r\n/**\r\n * @dev Interface of the ERC20 standard as defined in the EIP.\r\n */\r\ninterface IERC20 {\r\n /**\r\n * @dev Returns the amount of tokens in existence.\r\n */\r\n function totalSupply() external view returns (uint256);\r\n\r\n /**\r\n * @dev Returns the amount of tokens owned by `account`.\r\n */\r\n function balanceOf(address account) external view returns (uint256);\r\n\r\n /**\r\n * @dev Moves `amount` tokens from the caller\u0027s account to `recipient`.\r\n *\r\n * Returns a boolean value indicating whether the operation succeeded.\r\n *\r\n * Emits a {Transfer} event.\r\n */\r\n function transfer(address recipient, uint256 amount) external returns (bool);\r\n\r\n /**\r\n * @dev Returns the remaining number of tokens that `spender` will be\r\n * allowed to spend on behalf of `owner` through {transferFrom}. This is\r\n * zero by default.\r\n *\r\n * This value changes when {approve} or {transferFrom} are called.\r\n */\r\n function allowance(address owner, address spender) external view returns (uint256);\r\n\r\n /**\r\n * @dev Sets `amount` as the allowance of `spender` over the caller\u0027s tokens.\r\n *\r\n * Returns a boolean value indicating whether the operation succeeded.\r\n *\r\n * IMPORTANT: Beware that changing an allowance with this method brings the risk\r\n * that someone may use both the old and the new allowance by unfortunate\r\n * transaction ordering. One possible solution to mitigate this race\r\n * condition is to first reduce the spender\u0027s allowance to 0 and set the\r\n * desired value afterwards:\r\n * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729\r\n *\r\n * Emits an {Approval} event.\r\n */\r\n function approve(address spender, uint256 amount) external returns (bool);\r\n\r\n /**\r\n * @dev Moves `amount` tokens from `sender` to `recipient` using the\r\n * allowance mechanism. `amount` is then deducted from the caller\u0027s\r\n * allowance.\r\n *\r\n * Returns a boolean value indicating whether the operation succeeded.\r\n *\r\n * Emits a {Transfer} event.\r\n */\r\n function transferFrom(\r\n address sender,\r\n address recipient,\r\n uint256 amount\r\n ) external returns (bool);\r\n\r\n /**\r\n * @dev Emitted when `value` tokens are moved from one account (`from`) to\r\n * another (`to`).\r\n *\r\n * Note that `value` may be zero.\r\n */\r\n event Transfer(address indexed from, address indexed to, uint256 value);\r\n\r\n /**\r\n * @dev Emitted when the allowance of a `spender` for an `owner` is set by\r\n * a call to {approve}. `value` is the new allowance.\r\n */\r\n event Approval(address indexed owner, address indexed spender, uint256 value);\r\n}"},"Ownable.sol":{"content":"// SPDX-License-Identifier: MIT\r\n\r\npragma solidity ^0.8.0;\r\n\r\nimport \"./Context.sol\";\r\n\r\n/**\r\n * @dev Contract module which provides a basic access control mechanism, where\r\n * there is an account (an owner) that can be granted exclusive access to\r\n * specific functions.\r\n *\r\n * By default, the owner account will be the one that deploys the contract. This\r\n * can later be changed with {transferOwnership}.\r\n *\r\n * This module is used through inheritance. It will make available the modifier\r\n * `onlyOwner`, which can be applied to your functions to restrict their use to\r\n * the owner.\r\n */\r\nabstract contract Ownable is Context {\r\n address private _owner;\r\n\r\n event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\r\n\r\n /**\r\n * @dev Initializes the contract setting the deployer as the initial owner.\r\n */\r\n constructor() {\r\n _setOwner(_msgSender());\r\n }\r\n\r\n /**\r\n * @dev Returns the address of the current owner.\r\n */\r\n function owner() public view virtual returns (address) {\r\n return _owner;\r\n }\r\n\r\n /**\r\n * @dev Throws if called by any account other than the owner.\r\n */\r\n modifier onlyOwner() {\r\n require(owner() == _msgSender(), \"Ownable: caller is not the owner\");\r\n _;\r\n }\r\n\r\n /**\r\n * @dev Leaves the contract without owner. It will not be possible to call\r\n * `onlyOwner` functions anymore. Can only be called by the current owner.\r\n *\r\n * NOTE: Renouncing ownership will leave the contract without an owner,\r\n * thereby removing any functionality that is only available to the owner.\r\n */\r\n function renounceOwnership() public virtual onlyOwner {\r\n _setOwner(address(0));\r\n }\r\n\r\n /**\r\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\r\n * Can only be called by the current owner.\r\n */\r\n function transferOwnership(address newOwner) public virtual onlyOwner {\r\n require(newOwner != address(0), \"Ownable: new owner is the zero address\");\r\n _setOwner(newOwner);\r\n }\r\n\r\n function _setOwner(address newOwner) private {\r\n address oldOwner = _owner;\r\n _owner = newOwner;\r\n emit OwnershipTransferred(oldOwner, newOwner);\r\n }\r\n}"},"SafeMath.sol":{"content":"// SPDX-License-Identifier: MIT\r\n\r\npragma solidity ^0.8.0;\r\n\r\n// CAUTION\r\n// This version of SafeMath should only be used with Solidity 0.8 or later,\r\n// because it relies on the compiler\u0027s built in overflow checks.\r\n\r\n/**\r\n * @dev Wrappers over Solidity\u0027s arithmetic operations.\r\n *\r\n * NOTE: `SafeMath` is no longer needed starting with Solidity 0.8. The compiler\r\n * now has built in overflow checking.\r\n */\r\nlibrary SafeMath {\r\n /**\r\n * @dev Returns the addition of two unsigned integers, with an overflow flag.\r\n *\r\n * _Available since v3.4._\r\n */\r\n function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) {\r\n unchecked {\r\n uint256 c = a + b;\r\n if (c \u003c a) return (false, 0);\r\n return (true, c);\r\n }\r\n }\r\n\r\n /**\r\n * @dev Returns the substraction of two unsigned integers, with an overflow flag.\r\n *\r\n * _Available since v3.4._\r\n */\r\n function trySub(uint256 a, uint256 b) internal pure returns (bool, uint256) {\r\n unchecked {\r\n if (b \u003e a) return (false, 0);\r\n return (true, a - b);\r\n }\r\n }\r\n\r\n /**\r\n * @dev Returns the multiplication of two unsigned integers, with an overflow flag.\r\n *\r\n * _Available since v3.4._\r\n */\r\n function tryMul(uint256 a, uint256 b) internal pure returns (bool, uint256) {\r\n unchecked {\r\n // Gas optimization: this is cheaper than requiring \u0027a\u0027 not being zero, but the\r\n // benefit is lost if \u0027b\u0027 is also tested.\r\n // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522\r\n if (a == 0) return (true, 0);\r\n uint256 c = a * b;\r\n if (c / a != b) return (false, 0);\r\n return (true, c);\r\n }\r\n }\r\n\r\n /**\r\n * @dev Returns the division of two unsigned integers, with a division by zero flag.\r\n *\r\n * _Available since v3.4._\r\n */\r\n function tryDiv(uint256 a, uint256 b) internal pure returns (bool, uint256) {\r\n unchecked {\r\n if (b == 0) return (false, 0);\r\n return (true, a / b);\r\n }\r\n }\r\n\r\n /**\r\n * @dev Returns the remainder of dividing two unsigned integers, with a division by zero flag.\r\n *\r\n * _Available since v3.4._\r\n */\r\n function tryMod(uint256 a, uint256 b) internal pure returns (bool, uint256) {\r\n unchecked {\r\n if (b == 0) return (false, 0);\r\n return (true, a % b);\r\n }\r\n }\r\n\r\n /**\r\n * @dev Returns the addition of two unsigned integers, reverting on\r\n * overflow.\r\n *\r\n * Counterpart to Solidity\u0027s `+` operator.\r\n *\r\n * Requirements:\r\n *\r\n * - Addition cannot overflow.\r\n */\r\n function add(uint256 a, uint256 b) internal pure returns (uint256) {\r\n return a + b;\r\n }\r\n\r\n /**\r\n * @dev Returns the subtraction of two unsigned integers, reverting on\r\n * overflow (when the result is negative).\r\n *\r\n * Counterpart to Solidity\u0027s `-` operator.\r\n *\r\n * Requirements:\r\n *\r\n * - Subtraction cannot overflow.\r\n */\r\n function sub(uint256 a, uint256 b) internal pure returns (uint256) {\r\n return a - b;\r\n }\r\n\r\n /**\r\n * @dev Returns the multiplication of two unsigned integers, reverting on\r\n * overflow.\r\n *\r\n * Counterpart to Solidity\u0027s `*` operator.\r\n *\r\n * Requirements:\r\n *\r\n * - Multiplication cannot overflow.\r\n */\r\n function mul(uint256 a, uint256 b) internal pure returns (uint256) {\r\n return a * b;\r\n }\r\n\r\n /**\r\n * @dev Returns the integer division of two unsigned integers, reverting on\r\n * division by zero. The result is rounded towards zero.\r\n *\r\n * Counterpart to Solidity\u0027s `/` operator.\r\n *\r\n * Requirements:\r\n *\r\n * - The divisor cannot be zero.\r\n */\r\n function div(uint256 a, uint256 b) internal pure returns (uint256) {\r\n return a / b;\r\n }\r\n\r\n /**\r\n * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),\r\n * reverting when dividing by zero.\r\n *\r\n * Counterpart to Solidity\u0027s `%` operator. This function uses a `revert`\r\n * opcode (which leaves remaining gas untouched) while Solidity uses an\r\n * invalid opcode to revert (consuming all remaining gas).\r\n *\r\n * Requirements:\r\n *\r\n * - The divisor cannot be zero.\r\n */\r\n function mod(uint256 a, uint256 b) internal pure returns (uint256) {\r\n return a % b;\r\n }\r\n\r\n /**\r\n * @dev Returns the subtraction of two unsigned integers, reverting with custom message on\r\n * overflow (when the result is negative).\r\n *\r\n * CAUTION: This function is deprecated because it requires allocating memory for the error\r\n * message unnecessarily. For custom revert reasons use {trySub}.\r\n *\r\n * Counterpart to Solidity\u0027s `-` operator.\r\n *\r\n * Requirements:\r\n *\r\n * - Subtraction cannot overflow.\r\n */\r\n function sub(\r\n uint256 a,\r\n uint256 b,\r\n string memory errorMessage\r\n ) internal pure returns (uint256) {\r\n unchecked {\r\n require(b \u003c= a, errorMessage);\r\n return a - b;\r\n }\r\n }\r\n\r\n /**\r\n * @dev Returns the integer division of two unsigned integers, reverting with custom message on\r\n * division by zero. The result is rounded towards zero.\r\n *\r\n * Counterpart to Solidity\u0027s `/` operator. Note: this function uses a\r\n * `revert` opcode (which leaves remaining gas untouched) while Solidity\r\n * uses an invalid opcode to revert (consuming all remaining gas).\r\n *\r\n * Requirements:\r\n *\r\n * - The divisor cannot be zero.\r\n */\r\n function div(\r\n uint256 a,\r\n uint256 b,\r\n string memory errorMessage\r\n ) internal pure returns (uint256) {\r\n unchecked {\r\n require(b \u003e 0, errorMessage);\r\n return a / b;\r\n }\r\n }\r\n\r\n /**\r\n * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),\r\n * reverting with custom message when dividing by zero.\r\n *\r\n * CAUTION: This function is deprecated because it requires allocating memory for the error\r\n * message unnecessarily. For custom revert reasons use {tryMod}.\r\n *\r\n * Counterpart to Solidity\u0027s `%` operator. This function uses a `revert`\r\n * opcode (which leaves remaining gas untouched) while Solidity uses an\r\n * invalid opcode to revert (consuming all remaining gas).\r\n *\r\n * Requirements:\r\n *\r\n * - The divisor cannot be zero.\r\n */\r\n function mod(\r\n uint256 a,\r\n uint256 b,\r\n string memory errorMessage\r\n ) internal pure returns (uint256) {\r\n unchecked {\r\n require(b \u003e 0, errorMessage);\r\n return a % b;\r\n }\r\n }\r\n}"},"Strings.sol":{"content":"// SPDX-License-Identifier: MIT\r\n\r\npragma solidity ^0.8.0;\r\n\r\n/**\r\n * @dev String operations.\r\n */\r\nlibrary Strings {\r\n bytes16 private constant _HEX_SYMBOLS = \"0123456789abcdef\";\r\n\r\n /**\r\n * @dev Converts a `uint256` to its ASCII `string` decimal representation.\r\n */\r\n function toString(uint256 value) internal pure returns (string memory) {\r\n // Inspired by OraclizeAPI\u0027s implementation - MIT licence\r\n // https://github.com/oraclize/ethereum-api/blob/b42146b063c7d6ee1358846c198246239e9360e8/oraclizeAPI_0.4.25.sol\r\n\r\n if (value == 0) {\r\n return \"0\";\r\n }\r\n uint256 temp = value;\r\n uint256 digits;\r\n while (temp != 0) {\r\n digits++;\r\n temp /= 10;\r\n }\r\n bytes memory buffer = new bytes(digits);\r\n while (value != 0) {\r\n digits -= 1;\r\n buffer[digits] = bytes1(uint8(48 + uint256(value % 10)));\r\n value /= 10;\r\n }\r\n return string(buffer);\r\n }\r\n\r\n /**\r\n * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation.\r\n */\r\n function toHexString(uint256 value) internal pure returns (string memory) {\r\n if (value == 0) {\r\n return \"0x00\";\r\n }\r\n uint256 temp = value;\r\n uint256 length = 0;\r\n while (temp != 0) {\r\n length++;\r\n temp \u003e\u003e= 8;\r\n }\r\n return toHexString(value, length);\r\n }\r\n\r\n /**\r\n * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length.\r\n */\r\n function toHexString(uint256 value, uint256 length) internal pure returns (string memory) {\r\n bytes memory buffer = new bytes(2 * length + 2);\r\n buffer[0] = \"0\";\r\n buffer[1] = \"x\";\r\n for (uint256 i = 2 * length + 1; i \u003e 1; --i) {\r\n buffer[i] = _HEX_SYMBOLS[value \u0026 0xf];\r\n value \u003e\u003e= 4;\r\n }\r\n require(value == 0, \"Strings: hex length insufficient\");\r\n return string(buffer);\r\n }\r\n}"}}