Feature Tip: Add private address tag to any address under My Name Tag !
Overview
ETH Balance
0 ETH
Eth Value
$0.00More Info
Private Name Tags
ContractCreator
TokenTracker
Latest 1 internal transaction
Advanced mode:
Parent Transaction Hash | Block | From | To | |||
---|---|---|---|---|---|---|
18843241 | 321 days ago | 0.01 ETH |
Loading...
Loading
Contract Name:
Flappers
Compiler Version
v0.8.20+commit.a1b79de6
Optimization Enabled:
No with 200 runs
Other Settings:
paris EvmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: MIT pragma solidity ^0.8.20; import "@openzeppelin/contracts/token/ERC1155/ERC1155.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; // this is all we need from rlBTRFLY interface IERC20Decimals { function decimals() external view returns (uint8); function balanceOf(address account) external view returns (uint256); } contract Flappers is ERC1155, Ownable { IERC20Decimals public rlBTRFLY; uint public mintCost; uint[] public levels; mapping(uint => bool) public validLevels; mapping(address => mapping(uint => bool)) public hasMinted; constructor(address _owner, address _rlBTRFLY, uint _mintCost, uint[] memory _levels) ERC1155("https://flappers.sirsean.me/metadata/{id}.json") Ownable(_owner) { rlBTRFLY = IERC20Decimals(_rlBTRFLY); mintCost = _mintCost; for (uint i = 0; i < _levels.length; i++) { addLevel(_levels[i]); } } function addLevel(uint _level) public onlyOwner { if (!validLevels[_level]) { validLevels[_level] = true; levels.push(_level); } } function getLevels() public view returns (uint[] memory) { return levels; } function setMintCost(uint _newCost) public onlyOwner { mintCost = _newCost; } function hasAddressMinted(address addr, uint level) public view returns (bool) { return hasMinted[addr][level]; } function hasLockedEnough(address addr, uint level) public view returns (bool) { uint8 decimals = rlBTRFLY.decimals(); uint256 adjustedLevel = level * (10 ** uint256(decimals)); return rlBTRFLY.balanceOf(addr) >= adjustedLevel; } function addrCanMint(address addr, uint level) public view returns (bool) { // cannot mint if this level has already been minted if (hasAddressMinted(addr, level)) { return false; } // can mint if the rlBTRFLY balance is greater than or equal to the level if (!hasLockedEnough(addr, level)) { return false; } // can mint if this level is valid if (!validLevels[level]) { return false; } return true; } function canMint(uint level) public view returns (bool) { return addrCanMint(msg.sender, level); } function mint(uint level) public payable { require(!hasAddressMinted(msg.sender, level), "Already minted this level"); require(hasLockedEnough(msg.sender, level), "Insufficient rlBTRFLY balance"); require(canMint(level), "Cannot mint this level"); require(msg.value >= mintCost, "Insufficient ETH sent"); hasMinted[msg.sender][level] = true; _mint(msg.sender, level, 1, ""); payable(owner()).transfer(msg.value); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (access/Ownable.sol) pragma solidity ^0.8.20; import {Context} from "../utils/Context.sol"; /** * @dev Contract module which provides a basic access control mechanism, where * there is an account (an owner) that can be granted exclusive access to * specific functions. * * The initial owner is set to the address provided by the deployer. This can * later be changed with {transferOwnership}. * * This module is used through inheritance. It will make available the modifier * `onlyOwner`, which can be applied to your functions to restrict their use to * the owner. */ abstract contract Ownable is Context { address private _owner; /** * @dev The caller account is not authorized to perform an operation. */ error OwnableUnauthorizedAccount(address account); /** * @dev The owner is not a valid owner account. (eg. `address(0)`) */ error OwnableInvalidOwner(address owner); event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev Initializes the contract setting the address provided by the deployer as the initial owner. */ constructor(address initialOwner) { if (initialOwner == address(0)) { revert OwnableInvalidOwner(address(0)); } _transferOwnership(initialOwner); } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { _checkOwner(); _; } /** * @dev Returns the address of the current owner. */ function owner() public view virtual returns (address) { return _owner; } /** * @dev Throws if the sender is not the owner. */ function _checkOwner() internal view virtual { if (owner() != _msgSender()) { revert OwnableUnauthorizedAccount(_msgSender()); } } /** * @dev Leaves the contract without owner. It will not be possible to call * `onlyOwner` functions. Can only be called by the current owner. * * NOTE: Renouncing ownership will leave the contract without an owner, * thereby disabling any functionality that is only available to the owner. */ function renounceOwnership() public virtual onlyOwner { _transferOwnership(address(0)); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Can only be called by the current owner. */ function transferOwnership(address newOwner) public virtual onlyOwner { if (newOwner == address(0)) { revert OwnableInvalidOwner(address(0)); } _transferOwnership(newOwner); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Internal function without access restriction. */ function _transferOwnership(address newOwner) internal virtual { address oldOwner = _owner; _owner = newOwner; emit OwnershipTransferred(oldOwner, newOwner); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (interfaces/draft-IERC6093.sol) pragma solidity ^0.8.20; /** * @dev Standard ERC20 Errors * Interface of the https://eips.ethereum.org/EIPS/eip-6093[ERC-6093] custom errors for ERC20 tokens. */ interface IERC20Errors { /** * @dev Indicates an error related to the current `balance` of a `sender`. Used in transfers. * @param sender Address whose tokens are being transferred. * @param balance Current balance for the interacting account. * @param needed Minimum amount required to perform a transfer. */ error ERC20InsufficientBalance(address sender, uint256 balance, uint256 needed); /** * @dev Indicates a failure with the token `sender`. Used in transfers. * @param sender Address whose tokens are being transferred. */ error ERC20InvalidSender(address sender); /** * @dev Indicates a failure with the token `receiver`. Used in transfers. * @param receiver Address to which tokens are being transferred. */ error ERC20InvalidReceiver(address receiver); /** * @dev Indicates a failure with the `spender`’s `allowance`. Used in transfers. * @param spender Address that may be allowed to operate on tokens without being their owner. * @param allowance Amount of tokens a `spender` is allowed to operate with. * @param needed Minimum amount required to perform a transfer. */ error ERC20InsufficientAllowance(address spender, uint256 allowance, uint256 needed); /** * @dev Indicates a failure with the `approver` of a token to be approved. Used in approvals. * @param approver Address initiating an approval operation. */ error ERC20InvalidApprover(address approver); /** * @dev Indicates a failure with the `spender` to be approved. Used in approvals. * @param spender Address that may be allowed to operate on tokens without being their owner. */ error ERC20InvalidSpender(address spender); } /** * @dev Standard ERC721 Errors * Interface of the https://eips.ethereum.org/EIPS/eip-6093[ERC-6093] custom errors for ERC721 tokens. */ interface IERC721Errors { /** * @dev Indicates that an address can't be an owner. For example, `address(0)` is a forbidden owner in EIP-20. * Used in balance queries. * @param owner Address of the current owner of a token. */ error ERC721InvalidOwner(address owner); /** * @dev Indicates a `tokenId` whose `owner` is the zero address. * @param tokenId Identifier number of a token. */ error ERC721NonexistentToken(uint256 tokenId); /** * @dev Indicates an error related to the ownership over a particular token. Used in transfers. * @param sender Address whose tokens are being transferred. * @param tokenId Identifier number of a token. * @param owner Address of the current owner of a token. */ error ERC721IncorrectOwner(address sender, uint256 tokenId, address owner); /** * @dev Indicates a failure with the token `sender`. Used in transfers. * @param sender Address whose tokens are being transferred. */ error ERC721InvalidSender(address sender); /** * @dev Indicates a failure with the token `receiver`. Used in transfers. * @param receiver Address to which tokens are being transferred. */ error ERC721InvalidReceiver(address receiver); /** * @dev Indicates a failure with the `operator`’s approval. Used in transfers. * @param operator Address that may be allowed to operate on tokens without being their owner. * @param tokenId Identifier number of a token. */ error ERC721InsufficientApproval(address operator, uint256 tokenId); /** * @dev Indicates a failure with the `approver` of a token to be approved. Used in approvals. * @param approver Address initiating an approval operation. */ error ERC721InvalidApprover(address approver); /** * @dev Indicates a failure with the `operator` to be approved. Used in approvals. * @param operator Address that may be allowed to operate on tokens without being their owner. */ error ERC721InvalidOperator(address operator); } /** * @dev Standard ERC1155 Errors * Interface of the https://eips.ethereum.org/EIPS/eip-6093[ERC-6093] custom errors for ERC1155 tokens. */ interface IERC1155Errors { /** * @dev Indicates an error related to the current `balance` of a `sender`. Used in transfers. * @param sender Address whose tokens are being transferred. * @param balance Current balance for the interacting account. * @param needed Minimum amount required to perform a transfer. * @param tokenId Identifier number of a token. */ error ERC1155InsufficientBalance(address sender, uint256 balance, uint256 needed, uint256 tokenId); /** * @dev Indicates a failure with the token `sender`. Used in transfers. * @param sender Address whose tokens are being transferred. */ error ERC1155InvalidSender(address sender); /** * @dev Indicates a failure with the token `receiver`. Used in transfers. * @param receiver Address to which tokens are being transferred. */ error ERC1155InvalidReceiver(address receiver); /** * @dev Indicates a failure with the `operator`’s approval. Used in transfers. * @param operator Address that may be allowed to operate on tokens without being their owner. * @param owner Address of the current owner of a token. */ error ERC1155MissingApprovalForAll(address operator, address owner); /** * @dev Indicates a failure with the `approver` of a token to be approved. Used in approvals. * @param approver Address initiating an approval operation. */ error ERC1155InvalidApprover(address approver); /** * @dev Indicates a failure with the `operator` to be approved. Used in approvals. * @param operator Address that may be allowed to operate on tokens without being their owner. */ error ERC1155InvalidOperator(address operator); /** * @dev Indicates an array length mismatch between ids and values in a safeBatchTransferFrom operation. * Used in batch transfers. * @param idsLength Length of the array of token identifiers * @param valuesLength Length of the array of token amounts */ error ERC1155InvalidArrayLength(uint256 idsLength, uint256 valuesLength); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (token/ERC1155/ERC1155.sol) pragma solidity ^0.8.20; import {IERC1155} from "./IERC1155.sol"; import {IERC1155Receiver} from "./IERC1155Receiver.sol"; import {IERC1155MetadataURI} from "./extensions/IERC1155MetadataURI.sol"; import {Context} from "../../utils/Context.sol"; import {IERC165, ERC165} from "../../utils/introspection/ERC165.sol"; import {Arrays} from "../../utils/Arrays.sol"; import {IERC1155Errors} from "../../interfaces/draft-IERC6093.sol"; /** * @dev Implementation of the basic standard multi-token. * See https://eips.ethereum.org/EIPS/eip-1155 * Originally based on code by Enjin: https://github.com/enjin/erc-1155 */ abstract contract ERC1155 is Context, ERC165, IERC1155, IERC1155MetadataURI, IERC1155Errors { using Arrays for uint256[]; using Arrays for address[]; mapping(uint256 id => mapping(address account => uint256)) private _balances; mapping(address account => mapping(address operator => bool)) private _operatorApprovals; // Used as the URI for all token types by relying on ID substitution, e.g. https://token-cdn-domain/{id}.json string private _uri; /** * @dev See {_setURI}. */ constructor(string memory uri_) { _setURI(uri_); } /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165, IERC165) returns (bool) { return interfaceId == type(IERC1155).interfaceId || interfaceId == type(IERC1155MetadataURI).interfaceId || super.supportsInterface(interfaceId); } /** * @dev See {IERC1155MetadataURI-uri}. * * This implementation returns the same URI for *all* token types. It relies * on the token type ID substitution mechanism * https://eips.ethereum.org/EIPS/eip-1155#metadata[defined in the EIP]. * * Clients calling this function must replace the `\{id\}` substring with the * actual token type ID. */ function uri(uint256 /* id */) public view virtual returns (string memory) { return _uri; } /** * @dev See {IERC1155-balanceOf}. */ function balanceOf(address account, uint256 id) public view virtual returns (uint256) { return _balances[id][account]; } /** * @dev See {IERC1155-balanceOfBatch}. * * Requirements: * * - `accounts` and `ids` must have the same length. */ function balanceOfBatch( address[] memory accounts, uint256[] memory ids ) public view virtual returns (uint256[] memory) { if (accounts.length != ids.length) { revert ERC1155InvalidArrayLength(ids.length, accounts.length); } uint256[] memory batchBalances = new uint256[](accounts.length); for (uint256 i = 0; i < accounts.length; ++i) { batchBalances[i] = balanceOf(accounts.unsafeMemoryAccess(i), ids.unsafeMemoryAccess(i)); } return batchBalances; } /** * @dev See {IERC1155-setApprovalForAll}. */ function setApprovalForAll(address operator, bool approved) public virtual { _setApprovalForAll(_msgSender(), operator, approved); } /** * @dev See {IERC1155-isApprovedForAll}. */ function isApprovedForAll(address account, address operator) public view virtual returns (bool) { return _operatorApprovals[account][operator]; } /** * @dev See {IERC1155-safeTransferFrom}. */ function safeTransferFrom(address from, address to, uint256 id, uint256 value, bytes memory data) public virtual { address sender = _msgSender(); if (from != sender && !isApprovedForAll(from, sender)) { revert ERC1155MissingApprovalForAll(sender, from); } _safeTransferFrom(from, to, id, value, data); } /** * @dev See {IERC1155-safeBatchTransferFrom}. */ function safeBatchTransferFrom( address from, address to, uint256[] memory ids, uint256[] memory values, bytes memory data ) public virtual { address sender = _msgSender(); if (from != sender && !isApprovedForAll(from, sender)) { revert ERC1155MissingApprovalForAll(sender, from); } _safeBatchTransferFrom(from, to, ids, values, data); } /** * @dev Transfers a `value` amount of tokens of type `id` from `from` to `to`. Will mint (or burn) if `from` * (or `to`) is the zero address. * * Emits a {TransferSingle} event if the arrays contain one element, and {TransferBatch} otherwise. * * Requirements: * * - If `to` refers to a smart contract, it must implement either {IERC1155Receiver-onERC1155Received} * or {IERC1155Receiver-onERC1155BatchReceived} and return the acceptance magic value. * - `ids` and `values` must have the same length. * * NOTE: The ERC-1155 acceptance check is not performed in this function. See {_updateWithAcceptanceCheck} instead. */ function _update(address from, address to, uint256[] memory ids, uint256[] memory values) internal virtual { if (ids.length != values.length) { revert ERC1155InvalidArrayLength(ids.length, values.length); } address operator = _msgSender(); for (uint256 i = 0; i < ids.length; ++i) { uint256 id = ids.unsafeMemoryAccess(i); uint256 value = values.unsafeMemoryAccess(i); if (from != address(0)) { uint256 fromBalance = _balances[id][from]; if (fromBalance < value) { revert ERC1155InsufficientBalance(from, fromBalance, value, id); } unchecked { // Overflow not possible: value <= fromBalance _balances[id][from] = fromBalance - value; } } if (to != address(0)) { _balances[id][to] += value; } } if (ids.length == 1) { uint256 id = ids.unsafeMemoryAccess(0); uint256 value = values.unsafeMemoryAccess(0); emit TransferSingle(operator, from, to, id, value); } else { emit TransferBatch(operator, from, to, ids, values); } } /** * @dev Version of {_update} that performs the token acceptance check by calling * {IERC1155Receiver-onERC1155Received} or {IERC1155Receiver-onERC1155BatchReceived} on the receiver address if it * contains code (eg. is a smart contract at the moment of execution). * * IMPORTANT: Overriding this function is discouraged because it poses a reentrancy risk from the receiver. So any * update to the contract state after this function would break the check-effect-interaction pattern. Consider * overriding {_update} instead. */ function _updateWithAcceptanceCheck( address from, address to, uint256[] memory ids, uint256[] memory values, bytes memory data ) internal virtual { _update(from, to, ids, values); if (to != address(0)) { address operator = _msgSender(); if (ids.length == 1) { uint256 id = ids.unsafeMemoryAccess(0); uint256 value = values.unsafeMemoryAccess(0); _doSafeTransferAcceptanceCheck(operator, from, to, id, value, data); } else { _doSafeBatchTransferAcceptanceCheck(operator, from, to, ids, values, data); } } } /** * @dev Transfers a `value` tokens of token type `id` from `from` to `to`. * * Emits a {TransferSingle} event. * * Requirements: * * - `to` cannot be the zero address. * - `from` must have a balance of tokens of type `id` of at least `value` amount. * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155Received} and return the * acceptance magic value. */ function _safeTransferFrom(address from, address to, uint256 id, uint256 value, bytes memory data) internal { if (to == address(0)) { revert ERC1155InvalidReceiver(address(0)); } if (from == address(0)) { revert ERC1155InvalidSender(address(0)); } (uint256[] memory ids, uint256[] memory values) = _asSingletonArrays(id, value); _updateWithAcceptanceCheck(from, to, ids, values, data); } /** * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {_safeTransferFrom}. * * Emits a {TransferBatch} event. * * Requirements: * * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155BatchReceived} and return the * acceptance magic value. * - `ids` and `values` must have the same length. */ function _safeBatchTransferFrom( address from, address to, uint256[] memory ids, uint256[] memory values, bytes memory data ) internal { if (to == address(0)) { revert ERC1155InvalidReceiver(address(0)); } if (from == address(0)) { revert ERC1155InvalidSender(address(0)); } _updateWithAcceptanceCheck(from, to, ids, values, data); } /** * @dev Sets a new URI for all token types, by relying on the token type ID * substitution mechanism * https://eips.ethereum.org/EIPS/eip-1155#metadata[defined in the EIP]. * * By this mechanism, any occurrence of the `\{id\}` substring in either the * URI or any of the values in the JSON file at said URI will be replaced by * clients with the token type ID. * * For example, the `https://token-cdn-domain/\{id\}.json` URI would be * interpreted by clients as * `https://token-cdn-domain/000000000000000000000000000000000000000000000000000000000004cce0.json` * for token type ID 0x4cce0. * * See {uri}. * * Because these URIs cannot be meaningfully represented by the {URI} event, * this function emits no events. */ function _setURI(string memory newuri) internal virtual { _uri = newuri; } /** * @dev Creates a `value` amount of tokens of type `id`, and assigns them to `to`. * * Emits a {TransferSingle} event. * * Requirements: * * - `to` cannot be the zero address. * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155Received} and return the * acceptance magic value. */ function _mint(address to, uint256 id, uint256 value, bytes memory data) internal { if (to == address(0)) { revert ERC1155InvalidReceiver(address(0)); } (uint256[] memory ids, uint256[] memory values) = _asSingletonArrays(id, value); _updateWithAcceptanceCheck(address(0), to, ids, values, data); } /** * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {_mint}. * * Emits a {TransferBatch} event. * * Requirements: * * - `ids` and `values` must have the same length. * - `to` cannot be the zero address. * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155BatchReceived} and return the * acceptance magic value. */ function _mintBatch(address to, uint256[] memory ids, uint256[] memory values, bytes memory data) internal { if (to == address(0)) { revert ERC1155InvalidReceiver(address(0)); } _updateWithAcceptanceCheck(address(0), to, ids, values, data); } /** * @dev Destroys a `value` amount of tokens of type `id` from `from` * * Emits a {TransferSingle} event. * * Requirements: * * - `from` cannot be the zero address. * - `from` must have at least `value` amount of tokens of type `id`. */ function _burn(address from, uint256 id, uint256 value) internal { if (from == address(0)) { revert ERC1155InvalidSender(address(0)); } (uint256[] memory ids, uint256[] memory values) = _asSingletonArrays(id, value); _updateWithAcceptanceCheck(from, address(0), ids, values, ""); } /** * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {_burn}. * * Emits a {TransferBatch} event. * * Requirements: * * - `from` cannot be the zero address. * - `from` must have at least `value` amount of tokens of type `id`. * - `ids` and `values` must have the same length. */ function _burnBatch(address from, uint256[] memory ids, uint256[] memory values) internal { if (from == address(0)) { revert ERC1155InvalidSender(address(0)); } _updateWithAcceptanceCheck(from, address(0), ids, values, ""); } /** * @dev Approve `operator` to operate on all of `owner` tokens * * Emits an {ApprovalForAll} event. * * Requirements: * * - `operator` cannot be the zero address. */ function _setApprovalForAll(address owner, address operator, bool approved) internal virtual { if (operator == address(0)) { revert ERC1155InvalidOperator(address(0)); } _operatorApprovals[owner][operator] = approved; emit ApprovalForAll(owner, operator, approved); } /** * @dev Performs an acceptance check by calling {IERC1155-onERC1155Received} on the `to` address * if it contains code at the moment of execution. */ function _doSafeTransferAcceptanceCheck( address operator, address from, address to, uint256 id, uint256 value, bytes memory data ) private { if (to.code.length > 0) { try IERC1155Receiver(to).onERC1155Received(operator, from, id, value, data) returns (bytes4 response) { if (response != IERC1155Receiver.onERC1155Received.selector) { // Tokens rejected revert ERC1155InvalidReceiver(to); } } catch (bytes memory reason) { if (reason.length == 0) { // non-ERC1155Receiver implementer revert ERC1155InvalidReceiver(to); } else { /// @solidity memory-safe-assembly assembly { revert(add(32, reason), mload(reason)) } } } } } /** * @dev Performs a batch acceptance check by calling {IERC1155-onERC1155BatchReceived} on the `to` address * if it contains code at the moment of execution. */ function _doSafeBatchTransferAcceptanceCheck( address operator, address from, address to, uint256[] memory ids, uint256[] memory values, bytes memory data ) private { if (to.code.length > 0) { try IERC1155Receiver(to).onERC1155BatchReceived(operator, from, ids, values, data) returns ( bytes4 response ) { if (response != IERC1155Receiver.onERC1155BatchReceived.selector) { // Tokens rejected revert ERC1155InvalidReceiver(to); } } catch (bytes memory reason) { if (reason.length == 0) { // non-ERC1155Receiver implementer revert ERC1155InvalidReceiver(to); } else { /// @solidity memory-safe-assembly assembly { revert(add(32, reason), mload(reason)) } } } } } /** * @dev Creates an array in memory with only one value for each of the elements provided. */ function _asSingletonArrays( uint256 element1, uint256 element2 ) private pure returns (uint256[] memory array1, uint256[] memory array2) { /// @solidity memory-safe-assembly assembly { // Load the free memory pointer array1 := mload(0x40) // Set array length to 1 mstore(array1, 1) // Store the single element at the next word after the length (where content starts) mstore(add(array1, 0x20), element1) // Repeat for next array locating it right after the first array array2 := add(array1, 0x40) mstore(array2, 1) mstore(add(array2, 0x20), element2) // Update the free memory pointer by pointing after the second array mstore(0x40, add(array2, 0x40)) } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (token/ERC1155/extensions/IERC1155MetadataURI.sol) pragma solidity ^0.8.20; import {IERC1155} from "../IERC1155.sol"; /** * @dev Interface of the optional ERC1155MetadataExtension interface, as defined * in the https://eips.ethereum.org/EIPS/eip-1155#metadata-extensions[EIP]. */ interface IERC1155MetadataURI is IERC1155 { /** * @dev Returns the URI for token type `id`. * * If the `\{id\}` substring is present in the URI, it must be replaced by * clients with the actual token type ID. */ function uri(uint256 id) external view returns (string memory); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.1) (token/ERC1155/IERC1155.sol) pragma solidity ^0.8.20; import {IERC165} from "../../utils/introspection/IERC165.sol"; /** * @dev Required interface of an ERC1155 compliant contract, as defined in the * https://eips.ethereum.org/EIPS/eip-1155[EIP]. */ interface IERC1155 is IERC165 { /** * @dev Emitted when `value` amount of tokens of type `id` are transferred from `from` to `to` by `operator`. */ event TransferSingle(address indexed operator, address indexed from, address indexed to, uint256 id, uint256 value); /** * @dev Equivalent to multiple {TransferSingle} events, where `operator`, `from` and `to` are the same for all * transfers. */ event TransferBatch( address indexed operator, address indexed from, address indexed to, uint256[] ids, uint256[] values ); /** * @dev Emitted when `account` grants or revokes permission to `operator` to transfer their tokens, according to * `approved`. */ event ApprovalForAll(address indexed account, address indexed operator, bool approved); /** * @dev Emitted when the URI for token type `id` changes to `value`, if it is a non-programmatic URI. * * If an {URI} event was emitted for `id`, the standard * https://eips.ethereum.org/EIPS/eip-1155#metadata-extensions[guarantees] that `value` will equal the value * returned by {IERC1155MetadataURI-uri}. */ event URI(string value, uint256 indexed id); /** * @dev Returns the value of tokens of token type `id` owned by `account`. * * Requirements: * * - `account` cannot be the zero address. */ function balanceOf(address account, uint256 id) external view returns (uint256); /** * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {balanceOf}. * * Requirements: * * - `accounts` and `ids` must have the same length. */ function balanceOfBatch( address[] calldata accounts, uint256[] calldata ids ) external view returns (uint256[] memory); /** * @dev Grants or revokes permission to `operator` to transfer the caller's tokens, according to `approved`, * * Emits an {ApprovalForAll} event. * * Requirements: * * - `operator` cannot be the caller. */ function setApprovalForAll(address operator, bool approved) external; /** * @dev Returns true if `operator` is approved to transfer ``account``'s tokens. * * See {setApprovalForAll}. */ function isApprovedForAll(address account, address operator) external view returns (bool); /** * @dev Transfers a `value` amount of tokens of type `id` from `from` to `to`. * * WARNING: This function can potentially allow a reentrancy attack when transferring tokens * to an untrusted contract, when invoking {onERC1155Received} on the receiver. * Ensure to follow the checks-effects-interactions pattern and consider employing * reentrancy guards when interacting with untrusted contracts. * * Emits a {TransferSingle} event. * * Requirements: * * - `to` cannot be the zero address. * - If the caller is not `from`, it must have been approved to spend ``from``'s tokens via {setApprovalForAll}. * - `from` must have a balance of tokens of type `id` of at least `value` amount. * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155Received} and return the * acceptance magic value. */ function safeTransferFrom(address from, address to, uint256 id, uint256 value, bytes calldata data) external; /** * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {safeTransferFrom}. * * WARNING: This function can potentially allow a reentrancy attack when transferring tokens * to an untrusted contract, when invoking {onERC1155BatchReceived} on the receiver. * Ensure to follow the checks-effects-interactions pattern and consider employing * reentrancy guards when interacting with untrusted contracts. * * Emits either a {TransferSingle} or a {TransferBatch} event, depending on the length of the array arguments. * * Requirements: * * - `ids` and `values` must have the same length. * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155BatchReceived} and return the * acceptance magic value. */ function safeBatchTransferFrom( address from, address to, uint256[] calldata ids, uint256[] calldata values, bytes calldata data ) external; }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (token/ERC1155/IERC1155Receiver.sol) pragma solidity ^0.8.20; import {IERC165} from "../../utils/introspection/IERC165.sol"; /** * @dev Interface that must be implemented by smart contracts in order to receive * ERC-1155 token transfers. */ interface IERC1155Receiver is IERC165 { /** * @dev Handles the receipt of a single ERC1155 token type. This function is * called at the end of a `safeTransferFrom` after the balance has been updated. * * NOTE: To accept the transfer, this must return * `bytes4(keccak256("onERC1155Received(address,address,uint256,uint256,bytes)"))` * (i.e. 0xf23a6e61, or its own function selector). * * @param operator The address which initiated the transfer (i.e. msg.sender) * @param from The address which previously owned the token * @param id The ID of the token being transferred * @param value The amount of tokens being transferred * @param data Additional data with no specified format * @return `bytes4(keccak256("onERC1155Received(address,address,uint256,uint256,bytes)"))` if transfer is allowed */ function onERC1155Received( address operator, address from, uint256 id, uint256 value, bytes calldata data ) external returns (bytes4); /** * @dev Handles the receipt of a multiple ERC1155 token types. This function * is called at the end of a `safeBatchTransferFrom` after the balances have * been updated. * * NOTE: To accept the transfer(s), this must return * `bytes4(keccak256("onERC1155BatchReceived(address,address,uint256[],uint256[],bytes)"))` * (i.e. 0xbc197c81, or its own function selector). * * @param operator The address which initiated the batch transfer (i.e. msg.sender) * @param from The address which previously owned the token * @param ids An array containing ids of each token being transferred (order and length must match values array) * @param values An array containing amounts of each token being transferred (order and length must match ids array) * @param data Additional data with no specified format * @return `bytes4(keccak256("onERC1155BatchReceived(address,address,uint256[],uint256[],bytes)"))` if transfer is allowed */ function onERC1155BatchReceived( address operator, address from, uint256[] calldata ids, uint256[] calldata values, bytes calldata data ) external returns (bytes4); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (utils/Arrays.sol) pragma solidity ^0.8.20; import {StorageSlot} from "./StorageSlot.sol"; import {Math} from "./math/Math.sol"; /** * @dev Collection of functions related to array types. */ library Arrays { using StorageSlot for bytes32; /** * @dev Searches a sorted `array` and returns the first index that contains * a value greater or equal to `element`. If no such index exists (i.e. all * values in the array are strictly less than `element`), the array length is * returned. Time complexity O(log n). * * `array` is expected to be sorted in ascending order, and to contain no * repeated elements. */ function findUpperBound(uint256[] storage array, uint256 element) internal view returns (uint256) { uint256 low = 0; uint256 high = array.length; if (high == 0) { return 0; } while (low < high) { uint256 mid = Math.average(low, high); // Note that mid will always be strictly less than high (i.e. it will be a valid array index) // because Math.average rounds towards zero (it does integer division with truncation). if (unsafeAccess(array, mid).value > element) { high = mid; } else { low = mid + 1; } } // At this point `low` is the exclusive upper bound. We will return the inclusive upper bound. if (low > 0 && unsafeAccess(array, low - 1).value == element) { return low - 1; } else { return low; } } /** * @dev Access an array in an "unsafe" way. Skips solidity "index-out-of-range" check. * * WARNING: Only use if you are certain `pos` is lower than the array length. */ function unsafeAccess(address[] storage arr, uint256 pos) internal pure returns (StorageSlot.AddressSlot storage) { bytes32 slot; // We use assembly to calculate the storage slot of the element at index `pos` of the dynamic array `arr` // following https://docs.soliditylang.org/en/v0.8.20/internals/layout_in_storage.html#mappings-and-dynamic-arrays. /// @solidity memory-safe-assembly assembly { mstore(0, arr.slot) slot := add(keccak256(0, 0x20), pos) } return slot.getAddressSlot(); } /** * @dev Access an array in an "unsafe" way. Skips solidity "index-out-of-range" check. * * WARNING: Only use if you are certain `pos` is lower than the array length. */ function unsafeAccess(bytes32[] storage arr, uint256 pos) internal pure returns (StorageSlot.Bytes32Slot storage) { bytes32 slot; // We use assembly to calculate the storage slot of the element at index `pos` of the dynamic array `arr` // following https://docs.soliditylang.org/en/v0.8.20/internals/layout_in_storage.html#mappings-and-dynamic-arrays. /// @solidity memory-safe-assembly assembly { mstore(0, arr.slot) slot := add(keccak256(0, 0x20), pos) } return slot.getBytes32Slot(); } /** * @dev Access an array in an "unsafe" way. Skips solidity "index-out-of-range" check. * * WARNING: Only use if you are certain `pos` is lower than the array length. */ function unsafeAccess(uint256[] storage arr, uint256 pos) internal pure returns (StorageSlot.Uint256Slot storage) { bytes32 slot; // We use assembly to calculate the storage slot of the element at index `pos` of the dynamic array `arr` // following https://docs.soliditylang.org/en/v0.8.20/internals/layout_in_storage.html#mappings-and-dynamic-arrays. /// @solidity memory-safe-assembly assembly { mstore(0, arr.slot) slot := add(keccak256(0, 0x20), pos) } return slot.getUint256Slot(); } /** * @dev Access an array in an "unsafe" way. Skips solidity "index-out-of-range" check. * * WARNING: Only use if you are certain `pos` is lower than the array length. */ function unsafeMemoryAccess(uint256[] memory arr, uint256 pos) internal pure returns (uint256 res) { assembly { res := mload(add(add(arr, 0x20), mul(pos, 0x20))) } } /** * @dev Access an array in an "unsafe" way. Skips solidity "index-out-of-range" check. * * WARNING: Only use if you are certain `pos` is lower than the array length. */ function unsafeMemoryAccess(address[] memory arr, uint256 pos) internal pure returns (address res) { assembly { res := mload(add(add(arr, 0x20), mul(pos, 0x20))) } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.1) (utils/Context.sol) pragma solidity ^0.8.20; /** * @dev Provides information about the current execution context, including the * sender of the transaction and its data. While these are generally available * via msg.sender and msg.data, they should not be accessed in such a direct * manner, since when dealing with meta-transactions the account sending and * paying for execution may not be the actual sender (as far as an application * is concerned). * * This contract is only required for intermediate, library-like contracts. */ abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } function _msgData() internal view virtual returns (bytes calldata) { return msg.data; } function _contextSuffixLength() internal view virtual returns (uint256) { return 0; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (utils/introspection/ERC165.sol) pragma solidity ^0.8.20; import {IERC165} from "./IERC165.sol"; /** * @dev Implementation of the {IERC165} interface. * * Contracts that want to implement ERC165 should inherit from this contract and override {supportsInterface} to check * for the additional interface id that will be supported. For example: * * ```solidity * function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { * return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId); * } * ``` */ abstract contract ERC165 is IERC165 { /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual returns (bool) { return interfaceId == type(IERC165).interfaceId; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (utils/introspection/IERC165.sol) pragma solidity ^0.8.20; /** * @dev Interface of the ERC165 standard, as defined in the * https://eips.ethereum.org/EIPS/eip-165[EIP]. * * Implementers can declare support of contract interfaces, which can then be * queried by others ({ERC165Checker}). * * For an implementation, see {ERC165}. */ interface IERC165 { /** * @dev Returns true if this contract implements the interface defined by * `interfaceId`. See the corresponding * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section] * to learn more about how these ids are created. * * This function call must use less than 30 000 gas. */ function supportsInterface(bytes4 interfaceId) external view returns (bool); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (utils/math/Math.sol) pragma solidity ^0.8.20; /** * @dev Standard math utilities missing in the Solidity language. */ library Math { /** * @dev Muldiv operation overflow. */ error MathOverflowedMulDiv(); enum Rounding { Floor, // Toward negative infinity Ceil, // Toward positive infinity Trunc, // Toward zero Expand // Away from zero } /** * @dev Returns the addition of two unsigned integers, with an overflow flag. */ function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { uint256 c = a + b; if (c < a) return (false, 0); return (true, c); } } /** * @dev Returns the subtraction of two unsigned integers, with an overflow flag. */ function trySub(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { if (b > a) return (false, 0); return (true, a - b); } } /** * @dev Returns the multiplication of two unsigned integers, with an overflow flag. */ function tryMul(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { // Gas optimization: this is cheaper than requiring 'a' not being zero, but the // benefit is lost if 'b' is also tested. // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522 if (a == 0) return (true, 0); uint256 c = a * b; if (c / a != b) return (false, 0); return (true, c); } } /** * @dev Returns the division of two unsigned integers, with a division by zero flag. */ function tryDiv(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { if (b == 0) return (false, 0); return (true, a / b); } } /** * @dev Returns the remainder of dividing two unsigned integers, with a division by zero flag. */ function tryMod(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { if (b == 0) return (false, 0); return (true, a % b); } } /** * @dev Returns the largest of two numbers. */ function max(uint256 a, uint256 b) internal pure returns (uint256) { return a > b ? a : b; } /** * @dev Returns the smallest of two numbers. */ function min(uint256 a, uint256 b) internal pure returns (uint256) { return a < b ? a : b; } /** * @dev Returns the average of two numbers. The result is rounded towards * zero. */ function average(uint256 a, uint256 b) internal pure returns (uint256) { // (a + b) / 2 can overflow. return (a & b) + (a ^ b) / 2; } /** * @dev Returns the ceiling of the division of two numbers. * * This differs from standard division with `/` in that it rounds towards infinity instead * of rounding towards zero. */ function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) { if (b == 0) { // Guarantee the same behavior as in a regular Solidity division. return a / b; } // (a + b - 1) / b can overflow on addition, so we distribute. return a == 0 ? 0 : (a - 1) / b + 1; } /** * @notice Calculates floor(x * y / denominator) with full precision. Throws if result overflows a uint256 or * denominator == 0. * @dev Original credit to Remco Bloemen under MIT license (https://xn--2-umb.com/21/muldiv) with further edits by * Uniswap Labs also under MIT license. */ function mulDiv(uint256 x, uint256 y, uint256 denominator) internal pure returns (uint256 result) { unchecked { // 512-bit multiply [prod1 prod0] = x * y. Compute the product mod 2^256 and mod 2^256 - 1, then use // use the Chinese Remainder Theorem to reconstruct the 512 bit result. The result is stored in two 256 // variables such that product = prod1 * 2^256 + prod0. uint256 prod0 = x * y; // Least significant 256 bits of the product uint256 prod1; // Most significant 256 bits of the product assembly { let mm := mulmod(x, y, not(0)) prod1 := sub(sub(mm, prod0), lt(mm, prod0)) } // Handle non-overflow cases, 256 by 256 division. if (prod1 == 0) { // Solidity will revert if denominator == 0, unlike the div opcode on its own. // The surrounding unchecked block does not change this fact. // See https://docs.soliditylang.org/en/latest/control-structures.html#checked-or-unchecked-arithmetic. return prod0 / denominator; } // Make sure the result is less than 2^256. Also prevents denominator == 0. if (denominator <= prod1) { revert MathOverflowedMulDiv(); } /////////////////////////////////////////////// // 512 by 256 division. /////////////////////////////////////////////// // Make division exact by subtracting the remainder from [prod1 prod0]. uint256 remainder; assembly { // Compute remainder using mulmod. remainder := mulmod(x, y, denominator) // Subtract 256 bit number from 512 bit number. prod1 := sub(prod1, gt(remainder, prod0)) prod0 := sub(prod0, remainder) } // Factor powers of two out of denominator and compute largest power of two divisor of denominator. // Always >= 1. See https://cs.stackexchange.com/q/138556/92363. uint256 twos = denominator & (0 - denominator); assembly { // Divide denominator by twos. denominator := div(denominator, twos) // Divide [prod1 prod0] by twos. prod0 := div(prod0, twos) // Flip twos such that it is 2^256 / twos. If twos is zero, then it becomes one. twos := add(div(sub(0, twos), twos), 1) } // Shift in bits from prod1 into prod0. prod0 |= prod1 * twos; // Invert denominator mod 2^256. Now that denominator is an odd number, it has an inverse modulo 2^256 such // that denominator * inv = 1 mod 2^256. Compute the inverse by starting with a seed that is correct for // four bits. That is, denominator * inv = 1 mod 2^4. uint256 inverse = (3 * denominator) ^ 2; // Use the Newton-Raphson iteration to improve the precision. Thanks to Hensel's lifting lemma, this also // works in modular arithmetic, doubling the correct bits in each step. inverse *= 2 - denominator * inverse; // inverse mod 2^8 inverse *= 2 - denominator * inverse; // inverse mod 2^16 inverse *= 2 - denominator * inverse; // inverse mod 2^32 inverse *= 2 - denominator * inverse; // inverse mod 2^64 inverse *= 2 - denominator * inverse; // inverse mod 2^128 inverse *= 2 - denominator * inverse; // inverse mod 2^256 // Because the division is now exact we can divide by multiplying with the modular inverse of denominator. // This will give us the correct result modulo 2^256. Since the preconditions guarantee that the outcome is // less than 2^256, this is the final result. We don't need to compute the high bits of the result and prod1 // is no longer required. result = prod0 * inverse; return result; } } /** * @notice Calculates x * y / denominator with full precision, following the selected rounding direction. */ function mulDiv(uint256 x, uint256 y, uint256 denominator, Rounding rounding) internal pure returns (uint256) { uint256 result = mulDiv(x, y, denominator); if (unsignedRoundsUp(rounding) && mulmod(x, y, denominator) > 0) { result += 1; } return result; } /** * @dev Returns the square root of a number. If the number is not a perfect square, the value is rounded * towards zero. * * Inspired by Henry S. Warren, Jr.'s "Hacker's Delight" (Chapter 11). */ function sqrt(uint256 a) internal pure returns (uint256) { if (a == 0) { return 0; } // For our first guess, we get the biggest power of 2 which is smaller than the square root of the target. // // We know that the "msb" (most significant bit) of our target number `a` is a power of 2 such that we have // `msb(a) <= a < 2*msb(a)`. This value can be written `msb(a)=2**k` with `k=log2(a)`. // // This can be rewritten `2**log2(a) <= a < 2**(log2(a) + 1)` // → `sqrt(2**k) <= sqrt(a) < sqrt(2**(k+1))` // → `2**(k/2) <= sqrt(a) < 2**((k+1)/2) <= 2**(k/2 + 1)` // // Consequently, `2**(log2(a) / 2)` is a good first approximation of `sqrt(a)` with at least 1 correct bit. uint256 result = 1 << (log2(a) >> 1); // At this point `result` is an estimation with one bit of precision. We know the true value is a uint128, // since it is the square root of a uint256. Newton's method converges quadratically (precision doubles at // every iteration). We thus need at most 7 iteration to turn our partial result with one bit of precision // into the expected uint128 result. unchecked { result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; return min(result, a / result); } } /** * @notice Calculates sqrt(a), following the selected rounding direction. */ function sqrt(uint256 a, Rounding rounding) internal pure returns (uint256) { unchecked { uint256 result = sqrt(a); return result + (unsignedRoundsUp(rounding) && result * result < a ? 1 : 0); } } /** * @dev Return the log in base 2 of a positive value rounded towards zero. * Returns 0 if given 0. */ function log2(uint256 value) internal pure returns (uint256) { uint256 result = 0; unchecked { if (value >> 128 > 0) { value >>= 128; result += 128; } if (value >> 64 > 0) { value >>= 64; result += 64; } if (value >> 32 > 0) { value >>= 32; result += 32; } if (value >> 16 > 0) { value >>= 16; result += 16; } if (value >> 8 > 0) { value >>= 8; result += 8; } if (value >> 4 > 0) { value >>= 4; result += 4; } if (value >> 2 > 0) { value >>= 2; result += 2; } if (value >> 1 > 0) { result += 1; } } return result; } /** * @dev Return the log in base 2, following the selected rounding direction, of a positive value. * Returns 0 if given 0. */ function log2(uint256 value, Rounding rounding) internal pure returns (uint256) { unchecked { uint256 result = log2(value); return result + (unsignedRoundsUp(rounding) && 1 << result < value ? 1 : 0); } } /** * @dev Return the log in base 10 of a positive value rounded towards zero. * Returns 0 if given 0. */ function log10(uint256 value) internal pure returns (uint256) { uint256 result = 0; unchecked { if (value >= 10 ** 64) { value /= 10 ** 64; result += 64; } if (value >= 10 ** 32) { value /= 10 ** 32; result += 32; } if (value >= 10 ** 16) { value /= 10 ** 16; result += 16; } if (value >= 10 ** 8) { value /= 10 ** 8; result += 8; } if (value >= 10 ** 4) { value /= 10 ** 4; result += 4; } if (value >= 10 ** 2) { value /= 10 ** 2; result += 2; } if (value >= 10 ** 1) { result += 1; } } return result; } /** * @dev Return the log in base 10, following the selected rounding direction, of a positive value. * Returns 0 if given 0. */ function log10(uint256 value, Rounding rounding) internal pure returns (uint256) { unchecked { uint256 result = log10(value); return result + (unsignedRoundsUp(rounding) && 10 ** result < value ? 1 : 0); } } /** * @dev Return the log in base 256 of a positive value rounded towards zero. * Returns 0 if given 0. * * Adding one to the result gives the number of pairs of hex symbols needed to represent `value` as a hex string. */ function log256(uint256 value) internal pure returns (uint256) { uint256 result = 0; unchecked { if (value >> 128 > 0) { value >>= 128; result += 16; } if (value >> 64 > 0) { value >>= 64; result += 8; } if (value >> 32 > 0) { value >>= 32; result += 4; } if (value >> 16 > 0) { value >>= 16; result += 2; } if (value >> 8 > 0) { result += 1; } } return result; } /** * @dev Return the log in base 256, following the selected rounding direction, of a positive value. * Returns 0 if given 0. */ function log256(uint256 value, Rounding rounding) internal pure returns (uint256) { unchecked { uint256 result = log256(value); return result + (unsignedRoundsUp(rounding) && 1 << (result << 3) < value ? 1 : 0); } } /** * @dev Returns whether a provided rounding mode is considered rounding up for unsigned integers. */ function unsignedRoundsUp(Rounding rounding) internal pure returns (bool) { return uint8(rounding) % 2 == 1; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (utils/StorageSlot.sol) // This file was procedurally generated from scripts/generate/templates/StorageSlot.js. pragma solidity ^0.8.20; /** * @dev Library for reading and writing primitive types to specific storage slots. * * Storage slots are often used to avoid storage conflict when dealing with upgradeable contracts. * This library helps with reading and writing to such slots without the need for inline assembly. * * The functions in this library return Slot structs that contain a `value` member that can be used to read or write. * * Example usage to set ERC1967 implementation slot: * ```solidity * contract ERC1967 { * bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc; * * function _getImplementation() internal view returns (address) { * return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value; * } * * function _setImplementation(address newImplementation) internal { * require(newImplementation.code.length > 0); * StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation; * } * } * ``` */ library StorageSlot { struct AddressSlot { address value; } struct BooleanSlot { bool value; } struct Bytes32Slot { bytes32 value; } struct Uint256Slot { uint256 value; } struct StringSlot { string value; } struct BytesSlot { bytes value; } /** * @dev Returns an `AddressSlot` with member `value` located at `slot`. */ function getAddressSlot(bytes32 slot) internal pure returns (AddressSlot storage r) { /// @solidity memory-safe-assembly assembly { r.slot := slot } } /** * @dev Returns an `BooleanSlot` with member `value` located at `slot`. */ function getBooleanSlot(bytes32 slot) internal pure returns (BooleanSlot storage r) { /// @solidity memory-safe-assembly assembly { r.slot := slot } } /** * @dev Returns an `Bytes32Slot` with member `value` located at `slot`. */ function getBytes32Slot(bytes32 slot) internal pure returns (Bytes32Slot storage r) { /// @solidity memory-safe-assembly assembly { r.slot := slot } } /** * @dev Returns an `Uint256Slot` with member `value` located at `slot`. */ function getUint256Slot(bytes32 slot) internal pure returns (Uint256Slot storage r) { /// @solidity memory-safe-assembly assembly { r.slot := slot } } /** * @dev Returns an `StringSlot` with member `value` located at `slot`. */ function getStringSlot(bytes32 slot) internal pure returns (StringSlot storage r) { /// @solidity memory-safe-assembly assembly { r.slot := slot } } /** * @dev Returns an `StringSlot` representation of the string storage pointer `store`. */ function getStringSlot(string storage store) internal pure returns (StringSlot storage r) { /// @solidity memory-safe-assembly assembly { r.slot := store.slot } } /** * @dev Returns an `BytesSlot` with member `value` located at `slot`. */ function getBytesSlot(bytes32 slot) internal pure returns (BytesSlot storage r) { /// @solidity memory-safe-assembly assembly { r.slot := slot } } /** * @dev Returns an `BytesSlot` representation of the bytes storage pointer `store`. */ function getBytesSlot(bytes storage store) internal pure returns (BytesSlot storage r) { /// @solidity memory-safe-assembly assembly { r.slot := store.slot } } }
{ "evmVersion": "paris", "optimizer": { "enabled": false, "runs": 200 }, "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } }, "libraries": {} }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"inputs":[{"internalType":"address","name":"_owner","type":"address"},{"internalType":"address","name":"_rlBTRFLY","type":"address"},{"internalType":"uint256","name":"_mintCost","type":"uint256"},{"internalType":"uint256[]","name":"_levels","type":"uint256[]"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[{"internalType":"address","name":"sender","type":"address"},{"internalType":"uint256","name":"balance","type":"uint256"},{"internalType":"uint256","name":"needed","type":"uint256"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"ERC1155InsufficientBalance","type":"error"},{"inputs":[{"internalType":"address","name":"approver","type":"address"}],"name":"ERC1155InvalidApprover","type":"error"},{"inputs":[{"internalType":"uint256","name":"idsLength","type":"uint256"},{"internalType":"uint256","name":"valuesLength","type":"uint256"}],"name":"ERC1155InvalidArrayLength","type":"error"},{"inputs":[{"internalType":"address","name":"operator","type":"address"}],"name":"ERC1155InvalidOperator","type":"error"},{"inputs":[{"internalType":"address","name":"receiver","type":"address"}],"name":"ERC1155InvalidReceiver","type":"error"},{"inputs":[{"internalType":"address","name":"sender","type":"address"}],"name":"ERC1155InvalidSender","type":"error"},{"inputs":[{"internalType":"address","name":"operator","type":"address"},{"internalType":"address","name":"owner","type":"address"}],"name":"ERC1155MissingApprovalForAll","type":"error"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"OwnableInvalidOwner","type":"error"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"OwnableUnauthorizedAccount","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"operator","type":"address"},{"indexed":false,"internalType":"bool","name":"approved","type":"bool"}],"name":"ApprovalForAll","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"operator","type":"address"},{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256[]","name":"ids","type":"uint256[]"},{"indexed":false,"internalType":"uint256[]","name":"values","type":"uint256[]"}],"name":"TransferBatch","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"operator","type":"address"},{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"id","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"TransferSingle","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"string","name":"value","type":"string"},{"indexed":true,"internalType":"uint256","name":"id","type":"uint256"}],"name":"URI","type":"event"},{"inputs":[{"internalType":"uint256","name":"_level","type":"uint256"}],"name":"addLevel","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"addr","type":"address"},{"internalType":"uint256","name":"level","type":"uint256"}],"name":"addrCanMint","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"uint256","name":"id","type":"uint256"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address[]","name":"accounts","type":"address[]"},{"internalType":"uint256[]","name":"ids","type":"uint256[]"}],"name":"balanceOfBatch","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"level","type":"uint256"}],"name":"canMint","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getLevels","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"addr","type":"address"},{"internalType":"uint256","name":"level","type":"uint256"}],"name":"hasAddressMinted","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"addr","type":"address"},{"internalType":"uint256","name":"level","type":"uint256"}],"name":"hasLockedEnough","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"}],"name":"hasMinted","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"address","name":"operator","type":"address"}],"name":"isApprovedForAll","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"levels","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"level","type":"uint256"}],"name":"mint","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"mintCost","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"rlBTRFLY","outputs":[{"internalType":"contract IERC20Decimals","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256[]","name":"ids","type":"uint256[]"},{"internalType":"uint256[]","name":"values","type":"uint256[]"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"safeBatchTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"id","type":"uint256"},{"internalType":"uint256","name":"value","type":"uint256"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"operator","type":"address"},{"internalType":"bool","name":"approved","type":"bool"}],"name":"setApprovalForAll","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_newCost","type":"uint256"}],"name":"setMintCost","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"uri","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"validLevels","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"}]
Contract Creation Code
60806040523480156200001157600080fd5b5060405162003b6c38038062003b6c8339818101604052810190620000379190620005f6565b836040518060600160405280602e815260200162003b3e602e913962000063816200018f60201b60201c565b50600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1603620000d95760006040517f1e4fbdf7000000000000000000000000000000000000000000000000000000008152600401620000d0919062000698565b60405180910390fd5b620000ea81620001a460201b60201c565b5082600460006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508160058190555060005b815181101562000184576200016e8282815181106200015a5762000159620006b5565b5b60200260200101516200026a60201b60201c565b80806200017b9062000713565b91505062000136565b505050505062000a88565b8060029081620001a09190620009a1565b5050565b6000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905081600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b6200027a620002f960201b60201c565b6007600082815260200190815260200160002060009054906101000a900460ff16620002f65760016007600083815260200190815260200160002060006101000a81548160ff02191690831515021790555060068190806001815401808255809150506001900390600052602060002001600090919091909150555b50565b620003096200039b60201b60201c565b73ffffffffffffffffffffffffffffffffffffffff166200032f620003a360201b60201c565b73ffffffffffffffffffffffffffffffffffffffff161462000399576200035b6200039b60201b60201c565b6040517f118cdaa700000000000000000000000000000000000000000000000000000000815260040162000390919062000698565b60405180910390fd5b565b600033905090565b6000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b6000604051905090565b600080fd5b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b60006200040e82620003e1565b9050919050565b620004208162000401565b81146200042c57600080fd5b50565b600081519050620004408162000415565b92915050565b6000819050919050565b6200045b8162000446565b81146200046757600080fd5b50565b6000815190506200047b8162000450565b92915050565b600080fd5b6000601f19601f8301169050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b620004d18262000486565b810181811067ffffffffffffffff82111715620004f357620004f262000497565b5b80604052505050565b600062000508620003cd565b9050620005168282620004c6565b919050565b600067ffffffffffffffff82111562000539576200053862000497565b5b602082029050602081019050919050565b600080fd5b60006200056662000560846200051b565b620004fc565b905080838252602082019050602084028301858111156200058c576200058b6200054a565b5b835b81811015620005b95780620005a488826200046a565b8452602084019350506020810190506200058e565b5050509392505050565b600082601f830112620005db57620005da62000481565b5b8151620005ed8482602086016200054f565b91505092915050565b60008060008060808587031215620006135762000612620003d7565b5b600062000623878288016200042f565b945050602062000636878288016200042f565b935050604062000649878288016200046a565b925050606085015167ffffffffffffffff8111156200066d576200066c620003dc565b5b6200067b87828801620005c3565b91505092959194509250565b620006928162000401565b82525050565b6000602082019050620006af600083018462000687565b92915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b6000620007208262000446565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8203620007555762000754620006e4565b5b600182019050919050565b600081519050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b60006002820490506001821680620007b357607f821691505b602082108103620007c957620007c86200076b565b5b50919050565b60008190508160005260206000209050919050565b60006020601f8301049050919050565b600082821b905092915050565b600060088302620008337fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82620007f4565b6200083f8683620007f4565b95508019841693508086168417925050509392505050565b6000819050919050565b6000620008826200087c620008768462000446565b62000857565b62000446565b9050919050565b6000819050919050565b6200089e8362000861565b620008b6620008ad8262000889565b84845462000801565b825550505050565b600090565b620008cd620008be565b620008da81848462000893565b505050565b5b818110156200090257620008f6600082620008c3565b600181019050620008e0565b5050565b601f82111562000951576200091b81620007cf565b6200092684620007e4565b8101602085101562000936578190505b6200094e6200094585620007e4565b830182620008df565b50505b505050565b600082821c905092915050565b6000620009766000198460080262000956565b1980831691505092915050565b600062000991838362000963565b9150826002028217905092915050565b620009ac8262000760565b67ffffffffffffffff811115620009c857620009c762000497565b5b620009d482546200079a565b620009e182828562000906565b600060209050601f83116001811462000a19576000841562000a04578287015190505b62000a10858262000983565b86555062000a80565b601f19841662000a2986620007cf565b60005b8281101562000a535784890151825560018201915060208501945060208101905062000a2c565b8683101562000a73578489015162000a6f601f89168262000963565b8355505b6001600288020188555050505b505050505050565b6130a68062000a986000396000f3fe60806040526004361061014a5760003560e01c80638da5cb5b116100b6578063bdb4b8481161006f578063bdb4b848146104cc578063e985e9c5146104f7578063eeb385b214610534578063f242432a14610571578063f2fde38b1461059a578063f8f1147d146105c35761014a565b80638da5cb5b146103a55780639c496423146103d0578063a0712d681461040d578063a0db762314610429578063a22cb46514610466578063b2596a671461048f5761014a565b80634e1273f4116101085780634e1273f4146102835780634e916f2a146102c05780635dd871a3146102eb5780636d73464314610328578063715018a6146103655780638545f4ea1461037c5761014a565b8062fdd58e1461014f57806301ffc9a71461018c5780630c394a60146101c95780630e89341c146101f45780632eb2c2d6146102315780633a1ad0461461025a575b600080fd5b34801561015b57600080fd5b5061017660048036038101906101719190611ff8565b610600565b6040516101839190612047565b60405180910390f35b34801561019857600080fd5b506101b360048036038101906101ae91906120ba565b61065a565b6040516101c09190612102565b60405180910390f35b3480156101d557600080fd5b506101de61073c565b6040516101eb91906121db565b60405180910390f35b34801561020057600080fd5b5061021b600480360381019061021691906121fd565b610794565b60405161022891906122ba565b60405180910390f35b34801561023d57600080fd5b50610258600480360381019061025391906124d9565b610828565b005b34801561026657600080fd5b50610281600480360381019061027c91906121fd565b6108d0565b005b34801561028f57600080fd5b506102aa60048036038101906102a5919061266b565b610956565b6040516102b791906121db565b60405180910390f35b3480156102cc57600080fd5b506102d5610a65565b6040516102e29190612742565b60405180910390f35b3480156102f757600080fd5b50610312600480360381019061030d91906121fd565b610a8b565b60405161031f9190612102565b60405180910390f35b34801561033457600080fd5b5061034f600480360381019061034a91906121fd565b610a9e565b60405161035c9190612102565b60405180910390f35b34801561037157600080fd5b5061037a610abe565b005b34801561038857600080fd5b506103a3600480360381019061039e91906121fd565b610ad2565b005b3480156103b157600080fd5b506103ba610ae4565b6040516103c7919061276c565b60405180910390f35b3480156103dc57600080fd5b506103f760048036038101906103f29190611ff8565b610b0e565b6040516104049190612102565b60405180910390f35b610427600480360381019061042291906121fd565b610b76565b005b34801561043557600080fd5b50610450600480360381019061044b9190611ff8565b610d6c565b60405161045d9190612102565b60405180910390f35b34801561047257600080fd5b5061048d600480360381019061048891906127b3565b610eca565b005b34801561049b57600080fd5b506104b660048036038101906104b191906121fd565b610ee0565b6040516104c39190612047565b60405180910390f35b3480156104d857600080fd5b506104e1610f04565b6040516104ee9190612047565b60405180910390f35b34801561050357600080fd5b5061051e600480360381019061051991906127f3565b610f0a565b60405161052b9190612102565b60405180910390f35b34801561054057600080fd5b5061055b60048036038101906105569190611ff8565b610f9e565b6040516105689190612102565b60405180910390f35b34801561057d57600080fd5b5061059860048036038101906105939190612833565b611008565b005b3480156105a657600080fd5b506105c160048036038101906105bc91906128ca565b6110b0565b005b3480156105cf57600080fd5b506105ea60048036038101906105e59190611ff8565b611136565b6040516105f79190612102565b60405180910390f35b600080600083815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b60007fd9b67a26000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916148061072557507f0e89341c000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916145b80610735575061073482611165565b5b9050919050565b6060600680548060200260200160405190810160405280929190818152602001828054801561078a57602002820191906000526020600020905b815481526020019060010190808311610776575b5050505050905090565b6060600280546107a390612926565b80601f01602080910402602001604051908101604052809291908181526020018280546107cf90612926565b801561081c5780601f106107f15761010080835404028352916020019161081c565b820191906000526020600020905b8154815290600101906020018083116107ff57829003601f168201915b50505050509050919050565b60006108326111cf565b90508073ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff161415801561087757506108758682610f0a565b155b156108bb5780866040517fe237d9220000000000000000000000000000000000000000000000000000000081526004016108b2929190612957565b60405180910390fd5b6108c886868686866111d7565b505050505050565b6108d86112cf565b6007600082815260200190815260200160002060009054906101000a900460ff166109535760016007600083815260200190815260200160002060006101000a81548160ff02191690831515021790555060068190806001815401808255809150506001900390600052602060002001600090919091909150555b50565b606081518351146109a257815183516040517f5b059991000000000000000000000000000000000000000000000000000000008152600401610999929190612980565b60405180910390fd5b6000835167ffffffffffffffff8111156109bf576109be6122e1565b5b6040519080825280602002602001820160405280156109ed5781602001602082028036833780820191505090505b50905060005b8451811015610a5a57610a2a610a12828761135690919063ffffffff16565b610a25838761136a90919063ffffffff16565b610600565b828281518110610a3d57610a3c6129a9565b5b60200260200101818152505080610a5390612a07565b90506109f3565b508091505092915050565b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000610a973383610f9e565b9050919050565b60076020528060005260406000206000915054906101000a900460ff1681565b610ac66112cf565b610ad0600061137e565b565b610ada6112cf565b8060058190555050565b6000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b6000600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600083815260200190815260200160002060009054906101000a900460ff16905092915050565b610b803382610b0e565b15610bc0576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610bb790612a9b565b60405180910390fd5b610bca3382610d6c565b610c09576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c0090612b07565b60405180910390fd5b610c1281610a8b565b610c51576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c4890612b73565b60405180910390fd5b600554341015610c96576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c8d90612bdf565b60405180910390fd5b6001600860003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600083815260200190815260200160002060006101000a81548160ff021916908315150217905550610d1b3382600160405180602001604052806000815250611444565b610d23610ae4565b73ffffffffffffffffffffffffffffffffffffffff166108fc349081150290604051600060405180830381858888f19350505050158015610d68573d6000803e3d6000fd5b5050565b600080600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663313ce5676040518163ffffffff1660e01b8152600401602060405180830381865afa158015610ddc573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e009190612c38565b905060008160ff16600a610e149190612d98565b84610e1f9190612de3565b905080600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231876040518263ffffffff1660e01b8152600401610e7d919061276c565b602060405180830381865afa158015610e9a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ebe9190612e3a565b10159250505092915050565b610edc610ed56111cf565b83836114dd565b5050565b60068181548110610ef057600080fd5b906000526020600020016000915090505481565b60055481565b6000600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16905092915050565b6000610faa8383610b0e565b15610fb85760009050611002565b610fc28383610d6c565b610fcf5760009050611002565b6007600083815260200190815260200160002060009054906101000a900460ff16610ffd5760009050611002565b600190505b92915050565b60006110126111cf565b90508073ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff161415801561105757506110558682610f0a565b155b1561109b5780866040517fe237d922000000000000000000000000000000000000000000000000000000008152600401611092929190612957565b60405180910390fd5b6110a8868686868661164d565b505050505050565b6110b86112cf565b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff160361112a5760006040517f1e4fbdf7000000000000000000000000000000000000000000000000000000008152600401611121919061276c565b60405180910390fd5b6111338161137e565b50565b60086020528160005260406000206020528060005260406000206000915091509054906101000a900460ff1681565b60007f01ffc9a7000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916149050919050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff16036112495760006040517f57f447ce000000000000000000000000000000000000000000000000000000008152600401611240919061276c565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff16036112bb5760006040517f01a835140000000000000000000000000000000000000000000000000000000081526004016112b2919061276c565b60405180910390fd5b6112c88585858585611758565b5050505050565b6112d76111cf565b73ffffffffffffffffffffffffffffffffffffffff166112f5610ae4565b73ffffffffffffffffffffffffffffffffffffffff1614611354576113186111cf565b6040517f118cdaa700000000000000000000000000000000000000000000000000000000815260040161134b919061276c565b60405180910390fd5b565b600060208202602084010151905092915050565b600060208202602084010151905092915050565b6000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905081600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b600073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff16036114b65760006040517f57f447ce0000000000000000000000000000000000000000000000000000000081526004016114ad919061276c565b60405180910390fd5b6000806114c3858561180a565b915091506114d5600087848487611758565b505050505050565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff160361154f5760006040517fced3e100000000000000000000000000000000000000000000000000000000008152600401611546919061276c565b60405180910390fd5b80600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31836040516116409190612102565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff16036116bf5760006040517f57f447ce0000000000000000000000000000000000000000000000000000000081526004016116b6919061276c565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff16036117315760006040517f01a83514000000000000000000000000000000000000000000000000000000008152600401611728919061276c565b60405180910390fd5b60008061173e858561180a565b9150915061174f8787848487611758565b50505050505050565b6117648585858561183a565b600073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff16146118035760006117a26111cf565b905060018451036117f25760006117c360008661136a90919063ffffffff16565b905060006117db60008661136a90919063ffffffff16565b90506117eb838989858589611be8565b5050611801565b611800818787878787611d9c565b5b505b5050505050565b60608060405191506001825283602083015260408201905060018152826020820152604081016040529250929050565b805182511461188457815181516040517f5b05999100000000000000000000000000000000000000000000000000000000815260040161187b929190612980565b60405180910390fd5b600061188e6111cf565b905060005b8351811015611aa35760006118b1828661136a90919063ffffffff16565b905060006118c8838661136a90919063ffffffff16565b9050600073ffffffffffffffffffffffffffffffffffffffff168873ffffffffffffffffffffffffffffffffffffffff16146119f557600080600084815260200190815260200160002060008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205490508181101561199d57888183856040517f03dee4c50000000000000000000000000000000000000000000000000000000081526004016119949493929190612e67565b60405180910390fd5b81810360008085815260200190815260200160002060008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505b600073ffffffffffffffffffffffffffffffffffffffff168773ffffffffffffffffffffffffffffffffffffffff1614611a90578060008084815260200190815260200160002060008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254611a889190612eac565b925050819055505b505080611a9c90612a07565b9050611893565b506001835103611b62576000611ac360008561136a90919063ffffffff16565b90506000611adb60008561136a90919063ffffffff16565b90508573ffffffffffffffffffffffffffffffffffffffff168773ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f628585604051611b53929190612980565b60405180910390a45050611be1565b8373ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff167f4a39dc06d4c0dbc64b70af90fd698a233a518aa5d07e595d983b8c0526c8f7fb8686604051611bd8929190612ee0565b60405180910390a45b5050505050565b60008473ffffffffffffffffffffffffffffffffffffffff163b1115611d94578373ffffffffffffffffffffffffffffffffffffffff1663f23a6e6187878686866040518663ffffffff1660e01b8152600401611c49959493929190612f6c565b6020604051808303816000875af1925050508015611c8557506040513d601f19601f82011682018060405250810190611c829190612fdb565b60015b611d09573d8060008114611cb5576040519150601f19603f3d011682016040523d82523d6000602084013e611cba565b606091505b506000815103611d0157846040517f57f447ce000000000000000000000000000000000000000000000000000000008152600401611cf8919061276c565b60405180910390fd5b805181602001fd5b63f23a6e6160e01b7bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916817bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191614611d9257846040517f57f447ce000000000000000000000000000000000000000000000000000000008152600401611d89919061276c565b60405180910390fd5b505b505050505050565b60008473ffffffffffffffffffffffffffffffffffffffff163b1115611f48578373ffffffffffffffffffffffffffffffffffffffff1663bc197c8187878686866040518663ffffffff1660e01b8152600401611dfd959493929190613008565b6020604051808303816000875af1925050508015611e3957506040513d601f19601f82011682018060405250810190611e369190612fdb565b60015b611ebd573d8060008114611e69576040519150601f19603f3d011682016040523d82523d6000602084013e611e6e565b606091505b506000815103611eb557846040517f57f447ce000000000000000000000000000000000000000000000000000000008152600401611eac919061276c565b60405180910390fd5b805181602001fd5b63bc197c8160e01b7bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916817bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191614611f4657846040517f57f447ce000000000000000000000000000000000000000000000000000000008152600401611f3d919061276c565b60405180910390fd5b505b505050505050565b6000604051905090565b600080fd5b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000611f8f82611f64565b9050919050565b611f9f81611f84565b8114611faa57600080fd5b50565b600081359050611fbc81611f96565b92915050565b6000819050919050565b611fd581611fc2565b8114611fe057600080fd5b50565b600081359050611ff281611fcc565b92915050565b6000806040838503121561200f5761200e611f5a565b5b600061201d85828601611fad565b925050602061202e85828601611fe3565b9150509250929050565b61204181611fc2565b82525050565b600060208201905061205c6000830184612038565b92915050565b60007fffffffff0000000000000000000000000000000000000000000000000000000082169050919050565b61209781612062565b81146120a257600080fd5b50565b6000813590506120b48161208e565b92915050565b6000602082840312156120d0576120cf611f5a565b5b60006120de848285016120a5565b91505092915050565b60008115159050919050565b6120fc816120e7565b82525050565b600060208201905061211760008301846120f3565b92915050565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b61215281611fc2565b82525050565b60006121648383612149565b60208301905092915050565b6000602082019050919050565b60006121888261211d565b6121928185612128565b935061219d83612139565b8060005b838110156121ce5781516121b58882612158565b97506121c083612170565b9250506001810190506121a1565b5085935050505092915050565b600060208201905081810360008301526121f5818461217d565b905092915050565b60006020828403121561221357612212611f5a565b5b600061222184828501611fe3565b91505092915050565b600081519050919050565b600082825260208201905092915050565b60005b83811015612264578082015181840152602081019050612249565b60008484015250505050565b6000601f19601f8301169050919050565b600061228c8261222a565b6122968185612235565b93506122a6818560208601612246565b6122af81612270565b840191505092915050565b600060208201905081810360008301526122d48184612281565b905092915050565b600080fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b61231982612270565b810181811067ffffffffffffffff82111715612338576123376122e1565b5b80604052505050565b600061234b611f50565b90506123578282612310565b919050565b600067ffffffffffffffff821115612377576123766122e1565b5b602082029050602081019050919050565b600080fd5b60006123a061239b8461235c565b612341565b905080838252602082019050602084028301858111156123c3576123c2612388565b5b835b818110156123ec57806123d88882611fe3565b8452602084019350506020810190506123c5565b5050509392505050565b600082601f83011261240b5761240a6122dc565b5b813561241b84826020860161238d565b91505092915050565b600080fd5b600067ffffffffffffffff821115612444576124436122e1565b5b61244d82612270565b9050602081019050919050565b82818337600083830152505050565b600061247c61247784612429565b612341565b90508281526020810184848401111561249857612497612424565b5b6124a384828561245a565b509392505050565b600082601f8301126124c0576124bf6122dc565b5b81356124d0848260208601612469565b91505092915050565b600080600080600060a086880312156124f5576124f4611f5a565b5b600061250388828901611fad565b955050602061251488828901611fad565b945050604086013567ffffffffffffffff81111561253557612534611f5f565b5b612541888289016123f6565b935050606086013567ffffffffffffffff81111561256257612561611f5f565b5b61256e888289016123f6565b925050608086013567ffffffffffffffff81111561258f5761258e611f5f565b5b61259b888289016124ab565b9150509295509295909350565b600067ffffffffffffffff8211156125c3576125c26122e1565b5b602082029050602081019050919050565b60006125e76125e2846125a8565b612341565b9050808382526020820190506020840283018581111561260a57612609612388565b5b835b81811015612633578061261f8882611fad565b84526020840193505060208101905061260c565b5050509392505050565b600082601f830112612652576126516122dc565b5b81356126628482602086016125d4565b91505092915050565b6000806040838503121561268257612681611f5a565b5b600083013567ffffffffffffffff8111156126a05761269f611f5f565b5b6126ac8582860161263d565b925050602083013567ffffffffffffffff8111156126cd576126cc611f5f565b5b6126d9858286016123f6565b9150509250929050565b6000819050919050565b60006127086127036126fe84611f64565b6126e3565b611f64565b9050919050565b600061271a826126ed565b9050919050565b600061272c8261270f565b9050919050565b61273c81612721565b82525050565b60006020820190506127576000830184612733565b92915050565b61276681611f84565b82525050565b6000602082019050612781600083018461275d565b92915050565b612790816120e7565b811461279b57600080fd5b50565b6000813590506127ad81612787565b92915050565b600080604083850312156127ca576127c9611f5a565b5b60006127d885828601611fad565b92505060206127e98582860161279e565b9150509250929050565b6000806040838503121561280a57612809611f5a565b5b600061281885828601611fad565b925050602061282985828601611fad565b9150509250929050565b600080600080600060a0868803121561284f5761284e611f5a565b5b600061285d88828901611fad565b955050602061286e88828901611fad565b945050604061287f88828901611fe3565b935050606061289088828901611fe3565b925050608086013567ffffffffffffffff8111156128b1576128b0611f5f565b5b6128bd888289016124ab565b9150509295509295909350565b6000602082840312156128e0576128df611f5a565b5b60006128ee84828501611fad565b91505092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b6000600282049050600182168061293e57607f821691505b602082108103612951576129506128f7565b5b50919050565b600060408201905061296c600083018561275d565b612979602083018461275d565b9392505050565b60006040820190506129956000830185612038565b6129a26020830184612038565b9392505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b6000612a1282611fc2565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8203612a4457612a436129d8565b5b600182019050919050565b7f416c7265616479206d696e7465642074686973206c6576656c00000000000000600082015250565b6000612a85601983612235565b9150612a9082612a4f565b602082019050919050565b60006020820190508181036000830152612ab481612a78565b9050919050565b7f496e73756666696369656e7420726c425452464c592062616c616e6365000000600082015250565b6000612af1601d83612235565b9150612afc82612abb565b602082019050919050565b60006020820190508181036000830152612b2081612ae4565b9050919050565b7f43616e6e6f74206d696e742074686973206c6576656c00000000000000000000600082015250565b6000612b5d601683612235565b9150612b6882612b27565b602082019050919050565b60006020820190508181036000830152612b8c81612b50565b9050919050565b7f496e73756666696369656e74204554482073656e740000000000000000000000600082015250565b6000612bc9601583612235565b9150612bd482612b93565b602082019050919050565b60006020820190508181036000830152612bf881612bbc565b9050919050565b600060ff82169050919050565b612c1581612bff565b8114612c2057600080fd5b50565b600081519050612c3281612c0c565b92915050565b600060208284031215612c4e57612c4d611f5a565b5b6000612c5c84828501612c23565b91505092915050565b60008160011c9050919050565b6000808291508390505b6001851115612cbc57808604811115612c9857612c976129d8565b5b6001851615612ca75780820291505b8081029050612cb585612c65565b9450612c7c565b94509492505050565b600082612cd55760019050612d91565b81612ce35760009050612d91565b8160018114612cf95760028114612d0357612d32565b6001915050612d91565b60ff841115612d1557612d146129d8565b5b8360020a915084821115612d2c57612d2b6129d8565b5b50612d91565b5060208310610133831016604e8410600b8410161715612d675782820a905083811115612d6257612d616129d8565b5b612d91565b612d748484846001612c72565b92509050818404811115612d8b57612d8a6129d8565b5b81810290505b9392505050565b6000612da382611fc2565b9150612dae83611fc2565b9250612ddb7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8484612cc5565b905092915050565b6000612dee82611fc2565b9150612df983611fc2565b9250828202612e0781611fc2565b91508282048414831517612e1e57612e1d6129d8565b5b5092915050565b600081519050612e3481611fcc565b92915050565b600060208284031215612e5057612e4f611f5a565b5b6000612e5e84828501612e25565b91505092915050565b6000608082019050612e7c600083018761275d565b612e896020830186612038565b612e966040830185612038565b612ea36060830184612038565b95945050505050565b6000612eb782611fc2565b9150612ec283611fc2565b9250828201905080821115612eda57612ed96129d8565b5b92915050565b60006040820190508181036000830152612efa818561217d565b90508181036020830152612f0e818461217d565b90509392505050565b600081519050919050565b600082825260208201905092915050565b6000612f3e82612f17565b612f488185612f22565b9350612f58818560208601612246565b612f6181612270565b840191505092915050565b600060a082019050612f81600083018861275d565b612f8e602083018761275d565b612f9b6040830186612038565b612fa86060830185612038565b8181036080830152612fba8184612f33565b90509695505050505050565b600081519050612fd58161208e565b92915050565b600060208284031215612ff157612ff0611f5a565b5b6000612fff84828501612fc6565b91505092915050565b600060a08201905061301d600083018861275d565b61302a602083018761275d565b818103604083015261303c818661217d565b90508181036060830152613050818561217d565b905081810360808301526130648184612f33565b9050969550505050505056fea2646970667358221220c87608101456ee442c111d21683191b877bbf3125b1cc0ef9bade4b2a5a9749864736f6c6343000814003368747470733a2f2f666c6170706572732e7369727365616e2e6d652f6d657461646174612f7b69647d2e6a736f6e000000000000000000000000560ebafd8db62cbdb44b50539d65b48072b98277000000000000000000000000742b70151cd3bc7ab598aaff1d54b90c3ebc6027000000000000000000000000000000000000000000000000002386f26fc10000000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000000000000000000006400000000000000000000000000000000000000000000000000000000000003e8
Deployed Bytecode
0x60806040526004361061014a5760003560e01c80638da5cb5b116100b6578063bdb4b8481161006f578063bdb4b848146104cc578063e985e9c5146104f7578063eeb385b214610534578063f242432a14610571578063f2fde38b1461059a578063f8f1147d146105c35761014a565b80638da5cb5b146103a55780639c496423146103d0578063a0712d681461040d578063a0db762314610429578063a22cb46514610466578063b2596a671461048f5761014a565b80634e1273f4116101085780634e1273f4146102835780634e916f2a146102c05780635dd871a3146102eb5780636d73464314610328578063715018a6146103655780638545f4ea1461037c5761014a565b8062fdd58e1461014f57806301ffc9a71461018c5780630c394a60146101c95780630e89341c146101f45780632eb2c2d6146102315780633a1ad0461461025a575b600080fd5b34801561015b57600080fd5b5061017660048036038101906101719190611ff8565b610600565b6040516101839190612047565b60405180910390f35b34801561019857600080fd5b506101b360048036038101906101ae91906120ba565b61065a565b6040516101c09190612102565b60405180910390f35b3480156101d557600080fd5b506101de61073c565b6040516101eb91906121db565b60405180910390f35b34801561020057600080fd5b5061021b600480360381019061021691906121fd565b610794565b60405161022891906122ba565b60405180910390f35b34801561023d57600080fd5b50610258600480360381019061025391906124d9565b610828565b005b34801561026657600080fd5b50610281600480360381019061027c91906121fd565b6108d0565b005b34801561028f57600080fd5b506102aa60048036038101906102a5919061266b565b610956565b6040516102b791906121db565b60405180910390f35b3480156102cc57600080fd5b506102d5610a65565b6040516102e29190612742565b60405180910390f35b3480156102f757600080fd5b50610312600480360381019061030d91906121fd565b610a8b565b60405161031f9190612102565b60405180910390f35b34801561033457600080fd5b5061034f600480360381019061034a91906121fd565b610a9e565b60405161035c9190612102565b60405180910390f35b34801561037157600080fd5b5061037a610abe565b005b34801561038857600080fd5b506103a3600480360381019061039e91906121fd565b610ad2565b005b3480156103b157600080fd5b506103ba610ae4565b6040516103c7919061276c565b60405180910390f35b3480156103dc57600080fd5b506103f760048036038101906103f29190611ff8565b610b0e565b6040516104049190612102565b60405180910390f35b610427600480360381019061042291906121fd565b610b76565b005b34801561043557600080fd5b50610450600480360381019061044b9190611ff8565b610d6c565b60405161045d9190612102565b60405180910390f35b34801561047257600080fd5b5061048d600480360381019061048891906127b3565b610eca565b005b34801561049b57600080fd5b506104b660048036038101906104b191906121fd565b610ee0565b6040516104c39190612047565b60405180910390f35b3480156104d857600080fd5b506104e1610f04565b6040516104ee9190612047565b60405180910390f35b34801561050357600080fd5b5061051e600480360381019061051991906127f3565b610f0a565b60405161052b9190612102565b60405180910390f35b34801561054057600080fd5b5061055b60048036038101906105569190611ff8565b610f9e565b6040516105689190612102565b60405180910390f35b34801561057d57600080fd5b5061059860048036038101906105939190612833565b611008565b005b3480156105a657600080fd5b506105c160048036038101906105bc91906128ca565b6110b0565b005b3480156105cf57600080fd5b506105ea60048036038101906105e59190611ff8565b611136565b6040516105f79190612102565b60405180910390f35b600080600083815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b60007fd9b67a26000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916148061072557507f0e89341c000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916145b80610735575061073482611165565b5b9050919050565b6060600680548060200260200160405190810160405280929190818152602001828054801561078a57602002820191906000526020600020905b815481526020019060010190808311610776575b5050505050905090565b6060600280546107a390612926565b80601f01602080910402602001604051908101604052809291908181526020018280546107cf90612926565b801561081c5780601f106107f15761010080835404028352916020019161081c565b820191906000526020600020905b8154815290600101906020018083116107ff57829003601f168201915b50505050509050919050565b60006108326111cf565b90508073ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff161415801561087757506108758682610f0a565b155b156108bb5780866040517fe237d9220000000000000000000000000000000000000000000000000000000081526004016108b2929190612957565b60405180910390fd5b6108c886868686866111d7565b505050505050565b6108d86112cf565b6007600082815260200190815260200160002060009054906101000a900460ff166109535760016007600083815260200190815260200160002060006101000a81548160ff02191690831515021790555060068190806001815401808255809150506001900390600052602060002001600090919091909150555b50565b606081518351146109a257815183516040517f5b059991000000000000000000000000000000000000000000000000000000008152600401610999929190612980565b60405180910390fd5b6000835167ffffffffffffffff8111156109bf576109be6122e1565b5b6040519080825280602002602001820160405280156109ed5781602001602082028036833780820191505090505b50905060005b8451811015610a5a57610a2a610a12828761135690919063ffffffff16565b610a25838761136a90919063ffffffff16565b610600565b828281518110610a3d57610a3c6129a9565b5b60200260200101818152505080610a5390612a07565b90506109f3565b508091505092915050565b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000610a973383610f9e565b9050919050565b60076020528060005260406000206000915054906101000a900460ff1681565b610ac66112cf565b610ad0600061137e565b565b610ada6112cf565b8060058190555050565b6000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b6000600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600083815260200190815260200160002060009054906101000a900460ff16905092915050565b610b803382610b0e565b15610bc0576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610bb790612a9b565b60405180910390fd5b610bca3382610d6c565b610c09576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c0090612b07565b60405180910390fd5b610c1281610a8b565b610c51576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c4890612b73565b60405180910390fd5b600554341015610c96576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c8d90612bdf565b60405180910390fd5b6001600860003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600083815260200190815260200160002060006101000a81548160ff021916908315150217905550610d1b3382600160405180602001604052806000815250611444565b610d23610ae4565b73ffffffffffffffffffffffffffffffffffffffff166108fc349081150290604051600060405180830381858888f19350505050158015610d68573d6000803e3d6000fd5b5050565b600080600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663313ce5676040518163ffffffff1660e01b8152600401602060405180830381865afa158015610ddc573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e009190612c38565b905060008160ff16600a610e149190612d98565b84610e1f9190612de3565b905080600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231876040518263ffffffff1660e01b8152600401610e7d919061276c565b602060405180830381865afa158015610e9a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ebe9190612e3a565b10159250505092915050565b610edc610ed56111cf565b83836114dd565b5050565b60068181548110610ef057600080fd5b906000526020600020016000915090505481565b60055481565b6000600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16905092915050565b6000610faa8383610b0e565b15610fb85760009050611002565b610fc28383610d6c565b610fcf5760009050611002565b6007600083815260200190815260200160002060009054906101000a900460ff16610ffd5760009050611002565b600190505b92915050565b60006110126111cf565b90508073ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff161415801561105757506110558682610f0a565b155b1561109b5780866040517fe237d922000000000000000000000000000000000000000000000000000000008152600401611092929190612957565b60405180910390fd5b6110a8868686868661164d565b505050505050565b6110b86112cf565b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff160361112a5760006040517f1e4fbdf7000000000000000000000000000000000000000000000000000000008152600401611121919061276c565b60405180910390fd5b6111338161137e565b50565b60086020528160005260406000206020528060005260406000206000915091509054906101000a900460ff1681565b60007f01ffc9a7000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916149050919050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff16036112495760006040517f57f447ce000000000000000000000000000000000000000000000000000000008152600401611240919061276c565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff16036112bb5760006040517f01a835140000000000000000000000000000000000000000000000000000000081526004016112b2919061276c565b60405180910390fd5b6112c88585858585611758565b5050505050565b6112d76111cf565b73ffffffffffffffffffffffffffffffffffffffff166112f5610ae4565b73ffffffffffffffffffffffffffffffffffffffff1614611354576113186111cf565b6040517f118cdaa700000000000000000000000000000000000000000000000000000000815260040161134b919061276c565b60405180910390fd5b565b600060208202602084010151905092915050565b600060208202602084010151905092915050565b6000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905081600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b600073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff16036114b65760006040517f57f447ce0000000000000000000000000000000000000000000000000000000081526004016114ad919061276c565b60405180910390fd5b6000806114c3858561180a565b915091506114d5600087848487611758565b505050505050565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff160361154f5760006040517fced3e100000000000000000000000000000000000000000000000000000000008152600401611546919061276c565b60405180910390fd5b80600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31836040516116409190612102565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff16036116bf5760006040517f57f447ce0000000000000000000000000000000000000000000000000000000081526004016116b6919061276c565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff16036117315760006040517f01a83514000000000000000000000000000000000000000000000000000000008152600401611728919061276c565b60405180910390fd5b60008061173e858561180a565b9150915061174f8787848487611758565b50505050505050565b6117648585858561183a565b600073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff16146118035760006117a26111cf565b905060018451036117f25760006117c360008661136a90919063ffffffff16565b905060006117db60008661136a90919063ffffffff16565b90506117eb838989858589611be8565b5050611801565b611800818787878787611d9c565b5b505b5050505050565b60608060405191506001825283602083015260408201905060018152826020820152604081016040529250929050565b805182511461188457815181516040517f5b05999100000000000000000000000000000000000000000000000000000000815260040161187b929190612980565b60405180910390fd5b600061188e6111cf565b905060005b8351811015611aa35760006118b1828661136a90919063ffffffff16565b905060006118c8838661136a90919063ffffffff16565b9050600073ffffffffffffffffffffffffffffffffffffffff168873ffffffffffffffffffffffffffffffffffffffff16146119f557600080600084815260200190815260200160002060008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205490508181101561199d57888183856040517f03dee4c50000000000000000000000000000000000000000000000000000000081526004016119949493929190612e67565b60405180910390fd5b81810360008085815260200190815260200160002060008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505b600073ffffffffffffffffffffffffffffffffffffffff168773ffffffffffffffffffffffffffffffffffffffff1614611a90578060008084815260200190815260200160002060008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254611a889190612eac565b925050819055505b505080611a9c90612a07565b9050611893565b506001835103611b62576000611ac360008561136a90919063ffffffff16565b90506000611adb60008561136a90919063ffffffff16565b90508573ffffffffffffffffffffffffffffffffffffffff168773ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f628585604051611b53929190612980565b60405180910390a45050611be1565b8373ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff167f4a39dc06d4c0dbc64b70af90fd698a233a518aa5d07e595d983b8c0526c8f7fb8686604051611bd8929190612ee0565b60405180910390a45b5050505050565b60008473ffffffffffffffffffffffffffffffffffffffff163b1115611d94578373ffffffffffffffffffffffffffffffffffffffff1663f23a6e6187878686866040518663ffffffff1660e01b8152600401611c49959493929190612f6c565b6020604051808303816000875af1925050508015611c8557506040513d601f19601f82011682018060405250810190611c829190612fdb565b60015b611d09573d8060008114611cb5576040519150601f19603f3d011682016040523d82523d6000602084013e611cba565b606091505b506000815103611d0157846040517f57f447ce000000000000000000000000000000000000000000000000000000008152600401611cf8919061276c565b60405180910390fd5b805181602001fd5b63f23a6e6160e01b7bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916817bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191614611d9257846040517f57f447ce000000000000000000000000000000000000000000000000000000008152600401611d89919061276c565b60405180910390fd5b505b505050505050565b60008473ffffffffffffffffffffffffffffffffffffffff163b1115611f48578373ffffffffffffffffffffffffffffffffffffffff1663bc197c8187878686866040518663ffffffff1660e01b8152600401611dfd959493929190613008565b6020604051808303816000875af1925050508015611e3957506040513d601f19601f82011682018060405250810190611e369190612fdb565b60015b611ebd573d8060008114611e69576040519150601f19603f3d011682016040523d82523d6000602084013e611e6e565b606091505b506000815103611eb557846040517f57f447ce000000000000000000000000000000000000000000000000000000008152600401611eac919061276c565b60405180910390fd5b805181602001fd5b63bc197c8160e01b7bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916817bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191614611f4657846040517f57f447ce000000000000000000000000000000000000000000000000000000008152600401611f3d919061276c565b60405180910390fd5b505b505050505050565b6000604051905090565b600080fd5b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000611f8f82611f64565b9050919050565b611f9f81611f84565b8114611faa57600080fd5b50565b600081359050611fbc81611f96565b92915050565b6000819050919050565b611fd581611fc2565b8114611fe057600080fd5b50565b600081359050611ff281611fcc565b92915050565b6000806040838503121561200f5761200e611f5a565b5b600061201d85828601611fad565b925050602061202e85828601611fe3565b9150509250929050565b61204181611fc2565b82525050565b600060208201905061205c6000830184612038565b92915050565b60007fffffffff0000000000000000000000000000000000000000000000000000000082169050919050565b61209781612062565b81146120a257600080fd5b50565b6000813590506120b48161208e565b92915050565b6000602082840312156120d0576120cf611f5a565b5b60006120de848285016120a5565b91505092915050565b60008115159050919050565b6120fc816120e7565b82525050565b600060208201905061211760008301846120f3565b92915050565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b61215281611fc2565b82525050565b60006121648383612149565b60208301905092915050565b6000602082019050919050565b60006121888261211d565b6121928185612128565b935061219d83612139565b8060005b838110156121ce5781516121b58882612158565b97506121c083612170565b9250506001810190506121a1565b5085935050505092915050565b600060208201905081810360008301526121f5818461217d565b905092915050565b60006020828403121561221357612212611f5a565b5b600061222184828501611fe3565b91505092915050565b600081519050919050565b600082825260208201905092915050565b60005b83811015612264578082015181840152602081019050612249565b60008484015250505050565b6000601f19601f8301169050919050565b600061228c8261222a565b6122968185612235565b93506122a6818560208601612246565b6122af81612270565b840191505092915050565b600060208201905081810360008301526122d48184612281565b905092915050565b600080fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b61231982612270565b810181811067ffffffffffffffff82111715612338576123376122e1565b5b80604052505050565b600061234b611f50565b90506123578282612310565b919050565b600067ffffffffffffffff821115612377576123766122e1565b5b602082029050602081019050919050565b600080fd5b60006123a061239b8461235c565b612341565b905080838252602082019050602084028301858111156123c3576123c2612388565b5b835b818110156123ec57806123d88882611fe3565b8452602084019350506020810190506123c5565b5050509392505050565b600082601f83011261240b5761240a6122dc565b5b813561241b84826020860161238d565b91505092915050565b600080fd5b600067ffffffffffffffff821115612444576124436122e1565b5b61244d82612270565b9050602081019050919050565b82818337600083830152505050565b600061247c61247784612429565b612341565b90508281526020810184848401111561249857612497612424565b5b6124a384828561245a565b509392505050565b600082601f8301126124c0576124bf6122dc565b5b81356124d0848260208601612469565b91505092915050565b600080600080600060a086880312156124f5576124f4611f5a565b5b600061250388828901611fad565b955050602061251488828901611fad565b945050604086013567ffffffffffffffff81111561253557612534611f5f565b5b612541888289016123f6565b935050606086013567ffffffffffffffff81111561256257612561611f5f565b5b61256e888289016123f6565b925050608086013567ffffffffffffffff81111561258f5761258e611f5f565b5b61259b888289016124ab565b9150509295509295909350565b600067ffffffffffffffff8211156125c3576125c26122e1565b5b602082029050602081019050919050565b60006125e76125e2846125a8565b612341565b9050808382526020820190506020840283018581111561260a57612609612388565b5b835b81811015612633578061261f8882611fad565b84526020840193505060208101905061260c565b5050509392505050565b600082601f830112612652576126516122dc565b5b81356126628482602086016125d4565b91505092915050565b6000806040838503121561268257612681611f5a565b5b600083013567ffffffffffffffff8111156126a05761269f611f5f565b5b6126ac8582860161263d565b925050602083013567ffffffffffffffff8111156126cd576126cc611f5f565b5b6126d9858286016123f6565b9150509250929050565b6000819050919050565b60006127086127036126fe84611f64565b6126e3565b611f64565b9050919050565b600061271a826126ed565b9050919050565b600061272c8261270f565b9050919050565b61273c81612721565b82525050565b60006020820190506127576000830184612733565b92915050565b61276681611f84565b82525050565b6000602082019050612781600083018461275d565b92915050565b612790816120e7565b811461279b57600080fd5b50565b6000813590506127ad81612787565b92915050565b600080604083850312156127ca576127c9611f5a565b5b60006127d885828601611fad565b92505060206127e98582860161279e565b9150509250929050565b6000806040838503121561280a57612809611f5a565b5b600061281885828601611fad565b925050602061282985828601611fad565b9150509250929050565b600080600080600060a0868803121561284f5761284e611f5a565b5b600061285d88828901611fad565b955050602061286e88828901611fad565b945050604061287f88828901611fe3565b935050606061289088828901611fe3565b925050608086013567ffffffffffffffff8111156128b1576128b0611f5f565b5b6128bd888289016124ab565b9150509295509295909350565b6000602082840312156128e0576128df611f5a565b5b60006128ee84828501611fad565b91505092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b6000600282049050600182168061293e57607f821691505b602082108103612951576129506128f7565b5b50919050565b600060408201905061296c600083018561275d565b612979602083018461275d565b9392505050565b60006040820190506129956000830185612038565b6129a26020830184612038565b9392505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b6000612a1282611fc2565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8203612a4457612a436129d8565b5b600182019050919050565b7f416c7265616479206d696e7465642074686973206c6576656c00000000000000600082015250565b6000612a85601983612235565b9150612a9082612a4f565b602082019050919050565b60006020820190508181036000830152612ab481612a78565b9050919050565b7f496e73756666696369656e7420726c425452464c592062616c616e6365000000600082015250565b6000612af1601d83612235565b9150612afc82612abb565b602082019050919050565b60006020820190508181036000830152612b2081612ae4565b9050919050565b7f43616e6e6f74206d696e742074686973206c6576656c00000000000000000000600082015250565b6000612b5d601683612235565b9150612b6882612b27565b602082019050919050565b60006020820190508181036000830152612b8c81612b50565b9050919050565b7f496e73756666696369656e74204554482073656e740000000000000000000000600082015250565b6000612bc9601583612235565b9150612bd482612b93565b602082019050919050565b60006020820190508181036000830152612bf881612bbc565b9050919050565b600060ff82169050919050565b612c1581612bff565b8114612c2057600080fd5b50565b600081519050612c3281612c0c565b92915050565b600060208284031215612c4e57612c4d611f5a565b5b6000612c5c84828501612c23565b91505092915050565b60008160011c9050919050565b6000808291508390505b6001851115612cbc57808604811115612c9857612c976129d8565b5b6001851615612ca75780820291505b8081029050612cb585612c65565b9450612c7c565b94509492505050565b600082612cd55760019050612d91565b81612ce35760009050612d91565b8160018114612cf95760028114612d0357612d32565b6001915050612d91565b60ff841115612d1557612d146129d8565b5b8360020a915084821115612d2c57612d2b6129d8565b5b50612d91565b5060208310610133831016604e8410600b8410161715612d675782820a905083811115612d6257612d616129d8565b5b612d91565b612d748484846001612c72565b92509050818404811115612d8b57612d8a6129d8565b5b81810290505b9392505050565b6000612da382611fc2565b9150612dae83611fc2565b9250612ddb7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8484612cc5565b905092915050565b6000612dee82611fc2565b9150612df983611fc2565b9250828202612e0781611fc2565b91508282048414831517612e1e57612e1d6129d8565b5b5092915050565b600081519050612e3481611fcc565b92915050565b600060208284031215612e5057612e4f611f5a565b5b6000612e5e84828501612e25565b91505092915050565b6000608082019050612e7c600083018761275d565b612e896020830186612038565b612e966040830185612038565b612ea36060830184612038565b95945050505050565b6000612eb782611fc2565b9150612ec283611fc2565b9250828201905080821115612eda57612ed96129d8565b5b92915050565b60006040820190508181036000830152612efa818561217d565b90508181036020830152612f0e818461217d565b90509392505050565b600081519050919050565b600082825260208201905092915050565b6000612f3e82612f17565b612f488185612f22565b9350612f58818560208601612246565b612f6181612270565b840191505092915050565b600060a082019050612f81600083018861275d565b612f8e602083018761275d565b612f9b6040830186612038565b612fa86060830185612038565b8181036080830152612fba8184612f33565b90509695505050505050565b600081519050612fd58161208e565b92915050565b600060208284031215612ff157612ff0611f5a565b5b6000612fff84828501612fc6565b91505092915050565b600060a08201905061301d600083018861275d565b61302a602083018761275d565b818103604083015261303c818661217d565b90508181036060830152613050818561217d565b905081810360808301526130648184612f33565b9050969550505050505056fea2646970667358221220c87608101456ee442c111d21683191b877bbf3125b1cc0ef9bade4b2a5a9749864736f6c63430008140033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
000000000000000000000000560ebafd8db62cbdb44b50539d65b48072b98277000000000000000000000000742b70151cd3bc7ab598aaff1d54b90c3ebc6027000000000000000000000000000000000000000000000000002386f26fc10000000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000000000000000000006400000000000000000000000000000000000000000000000000000000000003e8
-----Decoded View---------------
Arg [0] : _owner (address): 0x560EBafD8dB62cbdB44B50539d65b48072b98277
Arg [1] : _rlBTRFLY (address): 0x742B70151cd3Bc7ab598aAFF1d54B90c3ebC6027
Arg [2] : _mintCost (uint256): 10000000000000000
Arg [3] : _levels (uint256[]): 1,10,100,1000
-----Encoded View---------------
9 Constructor Arguments found :
Arg [0] : 000000000000000000000000560ebafd8db62cbdb44b50539d65b48072b98277
Arg [1] : 000000000000000000000000742b70151cd3bc7ab598aaff1d54b90c3ebc6027
Arg [2] : 000000000000000000000000000000000000000000000000002386f26fc10000
Arg [3] : 0000000000000000000000000000000000000000000000000000000000000080
Arg [4] : 0000000000000000000000000000000000000000000000000000000000000004
Arg [5] : 0000000000000000000000000000000000000000000000000000000000000001
Arg [6] : 000000000000000000000000000000000000000000000000000000000000000a
Arg [7] : 0000000000000000000000000000000000000000000000000000000000000064
Arg [8] : 00000000000000000000000000000000000000000000000000000000000003e8
Loading...
Loading
Loading...
Loading
Multichain Portfolio | 30 Chains
Chain | Token | Portfolio % | Price | Amount | Value |
---|
Loading...
Loading
[ Download: CSV Export ]
[ Download: CSV Export ]
A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.