ERC-721
Overview
Max Total Supply
1,080 LDNFT
Holders
473
Market
Volume (24H)
N/A
Min Price (24H)
N/A
Max Price (24H)
N/A
Other Info
Token Contract
Balance
1 LDNFTLoading...
Loading
Loading...
Loading
Loading...
Loading
# | Exchange | Pair | Price | 24H Volume | % Volume |
---|
This contract may be a proxy contract. Click on More Options and select Is this a proxy? to confirm and enable the "Read as Proxy" & "Write as Proxy" tabs.
Contract Source Code Verified (Exact Match)
Contract Name:
LockDealNFT
Compiler Version
v0.8.24+commit.e11b9ed9
Optimization Enabled:
Yes with 200 runs
Other Settings:
istanbul EvmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "./LockDealNFTInternal.sol"; import "@openzeppelin/contracts/token/ERC721/IERC721Receiver.sol"; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; /// @title LockDealNFT contract /// @notice Implements a non-fungible token (NFT) contract for locking deals contract LockDealNFT is LockDealNFTInternal, IERC721Receiver { constructor(address _vaultManager, string memory _baseURI) ERC721("LockDealNFT", "LDNFT") { _notZeroAddress(_vaultManager); vaultManager = IVaultManager(_vaultManager); approvedContracts[address(this)] = true; baseURI = _baseURI; } function mintForProvider( address owner, IProvider provider ) external firewallProtected onlyApprovedContract(address(provider)) notZeroAddress(owner) returns (uint256 poolId) { poolId = _mint(owner, provider); } function mintAndTransfer( address owner, address token, uint256 amount, IProvider provider ) external firewallProtected onlyApprovedContract(address(provider)) notZeroAddress(owner) notZeroAddress(token) notZeroAmount(amount) returns (uint256 poolId) { poolId = _mint(owner, provider); IERC20(token).approve(address(vaultManager), amount); poolIdToVaultId[poolId] = vaultManager.depositByToken(token, amount); } function safeMintAndTransfer( address owner, address token, address from, uint256 amount, IProvider provider, bytes calldata data ) external firewallProtected onlyApprovedContract(address(provider)) notZeroAddress(owner) notZeroAddress(token) notZeroAmount(amount) returns (uint256 poolId) { poolId = _mint(owner, provider); poolIdToVaultId[poolId] = vaultManager.safeDeposit(token, amount, from, data); } function cloneVaultId( uint256 destinationPoolId, uint256 sourcePoolId ) external firewallProtected onlyApprovedContract(msg.sender) validPoolId(destinationPoolId) validPoolId(sourcePoolId) { poolIdToVaultId[destinationPoolId] = poolIdToVaultId[sourcePoolId]; } /// @dev Sets the approved status of a contract /// @param contractAddress The address of the contract /// @param status The new approved status (true or false) function setApprovedContract(address contractAddress, bool status) external onlyOwner onlyContract(contractAddress) { approvedContracts[contractAddress] = status; emit ContractApproved(contractAddress, status); } function approvePoolTransfers(bool status) external { require(approvedPoolUserTransfers[msg.sender] != status, "status is the same as before"); approvedPoolUserTransfers[msg.sender] = status; } ///@dev withdraw implementation function onERC721Received( address, address from, uint256 poolId, bytes calldata data ) external override firewallProtected returns (bytes4) { require(msg.sender == address(this), "invalid nft contract"); _handleReturn(poolId, from, data.length > 0 ? _split(poolId, from, data) : _withdraw(from, poolId)); return IERC721Receiver.onERC721Received.selector; } function updateAllMetadata() external onlyOwner { emit MetadataUpdate(type(uint256).max); } function transferFrom(address from, address to, uint256 tokenId) public override(ERC721, IERC721) { require(_isApprovedOrOwner(_msgSender(), tokenId), "ERC721: transfer caller is not owner nor approved"); _safeTransfer(from, to, tokenId, ""); } function setBaseURI(string memory newBaseURI) external onlyOwner { require( keccak256(abi.encodePacked(baseURI)) != keccak256(abi.encodePacked(newBaseURI)), "can't set the same baseURI" ); string memory oldBaseURI = baseURI; baseURI = newBaseURI; emit BaseURIChanged(oldBaseURI, newBaseURI); } }
// SPDX-License-Identifier: UNLICENSED // See LICENSE file for full license text. // Copyright (c) Ironblocks 2024 pragma solidity ^0.8; import {FirewallConsumerBase} from "./FirewallConsumerBase.sol"; /** * @title Firewall Consumer * @author David Benchimol @ Ironblocks * @dev This contract is a parent contract that can be used to add firewall protection to any contract. * * The contract must initializes with the firewall contract disabled, and the deployer * as the firewall admin. * */ contract FirewallConsumer is FirewallConsumerBase(address(0), msg.sender) { }
// SPDX-License-Identifier: UNLICENSED // See LICENSE file for full license text. // Copyright (c) Ironblocks 2024 pragma solidity ^0.8; import {ERC165Checker} from "@openzeppelin/contracts/utils/introspection/ERC165Checker.sol"; import {Address} from "@openzeppelin/contracts/utils/Address.sol"; import {Context} from "@openzeppelin/contracts/utils/Context.sol"; import {IFirewall} from "./interfaces/IFirewall.sol"; import {IFirewallConsumer} from "./interfaces/IFirewallConsumer.sol"; /** * @title Firewall Consumer Base Contract * @author David Benchimol @ Ironblocks * @dev This contract is a parent contract that can be used to add firewall protection to any contract. * * The contract must define a firewall contract which will manage the policies that are applied to the contract. * It also must define a firewall admin which will be able to add and remove policies. * */ contract FirewallConsumerBase is IFirewallConsumer, Context { // This slot is used to store the firewall address bytes32 private constant FIREWALL_STORAGE_SLOT = bytes32(uint256(keccak256("eip1967.firewall")) - 1); // This slot is used to store the firewall admin address bytes32 private constant FIREWALL_ADMIN_STORAGE_SLOT = bytes32(uint256(keccak256("eip1967.firewall.admin")) - 1); // This slot is used to store the new firewall admin address (when changing admin) bytes32 private constant NEW_FIREWALL_ADMIN_STORAGE_SLOT = bytes32(uint256(keccak256("eip1967.new.firewall.admin")) - 1); bytes4 private constant SUPPORTS_APPROVE_VIA_SIGNATURE_INTERFACE_ID = bytes4(0x0c908cff); // sighash of approveCallsViaSignature // This slot is special since it's used for mappings and not a single value bytes32 private constant APPROVED_TARGETS_MAPPING_SLOT = bytes32(uint256(keccak256("eip1967.approved.targets")) - 1); event FirewallAdminUpdated(address newAdmin); event FirewallUpdated(address newFirewall); /** * @dev modifier that will run the preExecution and postExecution hooks of the firewall, applying each of * the subscribed policies. * * NOTE: Applying this modifier on functions that exit execution flow by an inline assmebly "return" call will * prevent the postExecution hook from running - breaking the protection provided by the firewall. * If you have any questions, please refer to the Firewall's documentation and/or contact our support. */ modifier firewallProtected() { address firewall = _getAddressBySlot(FIREWALL_STORAGE_SLOT); if (firewall == address(0)) { _; return; } uint256 value = _msgValue(); IFirewall(firewall).preExecution(_msgSender(), _msgData(), value); _; IFirewall(firewall).postExecution(_msgSender(), _msgData(), value); } /** * @dev modifier that will run the preExecution and postExecution hooks of the firewall, applying each of * the subscribed policies. Allows passing custom data to the firewall, not necessarily msg.data. * Useful for checking internal function calls * * @param data custom data to be passed to the firewall * NOTE: Using this modifier affects the data that is passed to the firewall, and as such it is mainly meant * to be used by internal functions, and only in conjuction with policies that whose protection strategy * requires this data. * * Using this modifier incorrectly may result in unexpected behavior. * * If you have any questions on how or when to use this modifier, please refer to the Firewall's documentation * and/or contact our support. * * NOTE: Applying this modifier on functions that exit execution flow by an inline assmebly "return" call will * prevent the postExecution hook from running - breaking the protection provided by the firewall. * If you have any questions, please refer to the Firewall's documentation and/or contact our support. */ modifier firewallProtectedCustom(bytes memory data) { address firewall = _getAddressBySlot(FIREWALL_STORAGE_SLOT); if (firewall == address(0)) { _; return; } uint256 value = _msgValue(); IFirewall(firewall).preExecution(_msgSender(), data, value); _; IFirewall(firewall).postExecution(_msgSender(), data, value); } /** * @dev identical to the rest of the modifiers in terms of logic, but makes it more * aesthetic when all you want to pass are signatures/unique identifiers. * * @param selector unique identifier for the function * * NOTE: Using this modifier affects the data that is passed to the firewall, and as such it is mainly to * be used by policies that whose protection strategy relies on the function's signature hahs. * * Using this modifier incorrectly may result in unexpected behavior. * * If you have any questions on how or when to use this modifier, please refer to the Firewall's documentation * and/or contact our support. * * NOTE: Applying this modifier on functions that exit execution flow by an inline assmebly "return" call will * prevent the postExecution hook from running - breaking the protection provided by the firewall. * If you have any questions, please refer to the Firewall's documentation and/or contact our support. */ modifier firewallProtectedSig(bytes4 selector) { address firewall = _getAddressBySlot(FIREWALL_STORAGE_SLOT); if (firewall == address(0)) { _; return; } uint256 value = _msgValue(); IFirewall(firewall).preExecution(_msgSender(), abi.encodePacked(selector), value); _; IFirewall(firewall).postExecution(_msgSender(), abi.encodePacked(selector), value); } /** * @dev modifier that will run the preExecution and postExecution hooks of the firewall invariant policy, * applying the subscribed invariant policy * * NOTE: Applying this modifier on functions that exit execution flow by an inline assmebly "return" call will * prevent the postExecution hook from running - breaking the protection provided by the firewall. * If you have any questions, please refer to the Firewall's documentation and/or contact our support. */ modifier invariantProtected() { address firewall = _getAddressBySlot(FIREWALL_STORAGE_SLOT); if (firewall == address(0)) { _; return; } uint256 value = _msgValue(); bytes32[] memory storageSlots = IFirewall(firewall).preExecutionPrivateInvariants(_msgSender(), _msgData(), value); bytes32[] memory preValues = _readStorage(storageSlots); _; bytes32[] memory postValues = _readStorage(storageSlots); IFirewall(firewall).postExecutionPrivateInvariants(_msgSender(), _msgData(), value, preValues, postValues); } /** * @dev modifier asserting that the target is approved * @param target address of the target */ modifier onlyApprovedTarget(address target) { // We use the same logic that solidity uses for mapping locations, but we add a pseudorandom // constant "salt" instead of a constant placeholder so that there are no storage collisions // if adding this to an upgradeable contract implementation bytes32 _slot = keccak256(abi.encode(APPROVED_TARGETS_MAPPING_SLOT, target)); bool isApprovedTarget = _getValueBySlot(_slot) != bytes32(0); require(isApprovedTarget, "FirewallConsumer: Not approved target"); require(ERC165Checker.supportsERC165InterfaceUnchecked(target, SUPPORTS_APPROVE_VIA_SIGNATURE_INTERFACE_ID)); _; } /** * @dev modifier similar to onlyOwner, but for the firewall admin. */ modifier onlyFirewallAdmin() { require(msg.sender == _getAddressBySlot(FIREWALL_ADMIN_STORAGE_SLOT), "FirewallConsumer: not firewall admin"); _; } /** * @dev Initializes a contract protected by a firewall, with a firewall address and a firewall admin. */ constructor( address _firewall, address _firewallAdmin ) { _setAddressBySlot(FIREWALL_STORAGE_SLOT, _firewall); _setAddressBySlot(FIREWALL_ADMIN_STORAGE_SLOT, _firewallAdmin); } /** * @dev Allows calling an approved external target before executing a method. * * This can be used for multiple purposes, but the initial one is to call `approveCallsViaSignature` before * executing a function, allowing synchronous transaction approvals. * * @param target address of the target * @param targetPayload payload to be sent to the target * @param data data to be executed after the target call */ function safeFunctionCall( address target, bytes calldata targetPayload, bytes calldata data ) external payable onlyApprovedTarget(target) { (bool success, ) = target.call(targetPayload); require(success); require(msg.sender == _msgSender(), "FirewallConsumer: No meta transactions"); Address.functionDelegateCall(address(this), data); } /** * @dev Allows firewall admin to set approved targets. * IMPORTANT: Only set approved target if you know what you're doing. Anyone can cause this contract * to send any data to an approved target. * * @param target address of the target * @param status status of the target */ function setApprovedTarget(address target, bool status) external onlyFirewallAdmin { bytes32 _slot = keccak256(abi.encode(APPROVED_TARGETS_MAPPING_SLOT, target)); assembly { sstore(_slot, status) } } /** * @dev View function for the firewall admin */ function firewallAdmin() external override view returns (address) { return _getAddressBySlot(FIREWALL_ADMIN_STORAGE_SLOT); } /** * @dev Admin only function allowing the consumers admin to set the firewall address. * @param _firewall address of the firewall */ function setFirewall(address _firewall) external onlyFirewallAdmin { _setAddressBySlot(FIREWALL_STORAGE_SLOT, _firewall); emit FirewallUpdated(_firewall); } /** * @dev Admin only function, sets new firewall admin. New admin must accept. * @param _firewallAdmin address of the new firewall admin */ function setFirewallAdmin(address _firewallAdmin) external onlyFirewallAdmin { require(_firewallAdmin != address(0), "FirewallConsumer: zero address"); _setAddressBySlot(NEW_FIREWALL_ADMIN_STORAGE_SLOT, _firewallAdmin); } /** * @dev Accept the role as firewall admin. */ function acceptFirewallAdmin() external { require(msg.sender == _getAddressBySlot(NEW_FIREWALL_ADMIN_STORAGE_SLOT), "FirewallConsumer: not new admin"); _setAddressBySlot(FIREWALL_ADMIN_STORAGE_SLOT, msg.sender); emit FirewallAdminUpdated(msg.sender); } /** * @dev Internal helper funtion to get the msg.value * @return value of the msg.value */ function _msgValue() internal view returns (uint256 value) { // We do this because msg.value can only be accessed in payable functions. assembly { value := callvalue() } } /** * @dev Internal helper function to read storage slots * @param storageSlots array of storage slots */ function _readStorage(bytes32[] memory storageSlots) internal view returns (bytes32[] memory) { uint256 slotsLength = storageSlots.length; bytes32[] memory values = new bytes32[](slotsLength); for (uint256 i = 0; i < slotsLength; i++) { bytes32 slotValue = _getValueBySlot(storageSlots[i]); values[i] = slotValue; } return values; } /** * @dev Internal helper function to set an address in a storage slot * @param _slot storage slot * @param _address address to be set */ function _setAddressBySlot(bytes32 _slot, address _address) internal { assembly { sstore(_slot, _address) } } /** * @dev Internal helper function to get an address from a storage slot * @param _slot storage slot * @return _address from the storage slot */ function _getAddressBySlot(bytes32 _slot) internal view returns (address _address) { assembly { _address := sload(_slot) } } /** * @dev Internal helper function to get a value from a storage slot * @param _slot storage slot * @return _value from the storage slot */ function _getValueBySlot(bytes32 _slot) internal view returns (bytes32 _value) { assembly { _value := sload(_slot) } } }
// SPDX-License-Identifier: UNLICENSED // See LICENSE file for full license text. // Copyright (c) Ironblocks 2024 pragma solidity ^0.8; interface IFirewall { function preExecution(address sender, bytes memory data, uint256 value) external; function postExecution(address sender, bytes memory data, uint256 value) external; function preExecutionPrivateInvariants(address sender, bytes memory data, uint256 value) external returns (bytes32[] calldata); function postExecutionPrivateInvariants( address sender, bytes memory data, uint256 value, bytes32[] calldata preValues, bytes32[] calldata postValues ) external; }
// SPDX-License-Identifier: UNLICENSED // See LICENSE file for full license text. // Copyright (c) Ironblocks 2024 pragma solidity ^0.8; interface IFirewallConsumer { function firewallAdmin() external returns (address); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.9.0) (access/Ownable.sol) pragma solidity ^0.8.0; import "../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. * * By default, the owner account will be the one that deploys the contract. 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; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev Initializes the contract setting the deployer as the initial owner. */ constructor() { _transferOwnership(_msgSender()); } /** * @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 { require(owner() == _msgSender(), "Ownable: caller is not the owner"); } /** * @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 { require(newOwner != address(0), "Ownable: new owner is the zero address"); _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 v4.4.1 (interfaces/IERC165.sol) pragma solidity ^0.8.0; import "../utils/introspection/IERC165.sol";
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.9.0) (interfaces/IERC2981.sol) pragma solidity ^0.8.0; import "../utils/introspection/IERC165.sol"; /** * @dev Interface for the NFT Royalty Standard. * * A standardized way to retrieve royalty payment information for non-fungible tokens (NFTs) to enable universal * support for royalty payments across all NFT marketplaces and ecosystem participants. * * _Available since v4.5._ */ interface IERC2981 is IERC165 { /** * @dev Returns how much royalty is owed and to whom, based on a sale price that may be denominated in any unit of * exchange. The royalty amount is denominated and should be paid in that same unit of exchange. */ function royaltyInfo( uint256 tokenId, uint256 salePrice ) external view returns (address receiver, uint256 royaltyAmount); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.9.0) (interfaces/IERC4906.sol) pragma solidity ^0.8.0; import "./IERC165.sol"; import "./IERC721.sol"; /// @title EIP-721 Metadata Update Extension interface IERC4906 is IERC165, IERC721 { /// @dev This event emits when the metadata of a token is changed. /// So that the third-party platforms such as NFT market could /// timely update the images and related attributes of the NFT. event MetadataUpdate(uint256 _tokenId); /// @dev This event emits when the metadata of a range of tokens is changed. /// So that the third-party platforms such as NFT market could /// timely update the images and related attributes of the NFTs. event BatchMetadataUpdate(uint256 _fromTokenId, uint256 _toTokenId); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (interfaces/IERC721.sol) pragma solidity ^0.8.0; import "../token/ERC721/IERC721.sol";
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.9.0) (token/ERC20/IERC20.sol) pragma solidity ^0.8.0; /** * @dev Interface of the ERC20 standard as defined in the EIP. */ interface IERC20 { /** * @dev Emitted when `value` tokens are moved from one account (`from`) to * another (`to`). * * Note that `value` may be zero. */ event Transfer(address indexed from, address indexed to, uint256 value); /** * @dev Emitted when the allowance of a `spender` for an `owner` is set by * a call to {approve}. `value` is the new allowance. */ event Approval(address indexed owner, address indexed spender, uint256 value); /** * @dev Returns the amount of tokens in existence. */ function totalSupply() external view returns (uint256); /** * @dev Returns the amount of tokens owned by `account`. */ function balanceOf(address account) external view returns (uint256); /** * @dev Moves `amount` tokens from the caller's account to `to`. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transfer(address to, uint256 amount) external returns (bool); /** * @dev Returns the remaining number of tokens that `spender` will be * allowed to spend on behalf of `owner` through {transferFrom}. This is * zero by default. * * This value changes when {approve} or {transferFrom} are called. */ function allowance(address owner, address spender) external view returns (uint256); /** * @dev Sets `amount` as the allowance of `spender` over the caller's tokens. * * Returns a boolean value indicating whether the operation succeeded. * * IMPORTANT: Beware that changing an allowance with this method brings the risk * that someone may use both the old and the new allowance by unfortunate * transaction ordering. One possible solution to mitigate this race * condition is to first reduce the spender's allowance to 0 and set the * desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * * Emits an {Approval} event. */ function approve(address spender, uint256 amount) external returns (bool); /** * @dev Moves `amount` tokens from `from` to `to` using the * allowance mechanism. `amount` is then deducted from the caller's * allowance. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transferFrom(address from, address to, uint256 amount) external returns (bool); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.9.0) (token/ERC721/ERC721.sol) pragma solidity ^0.8.0; import "./IERC721.sol"; import "./IERC721Receiver.sol"; import "./extensions/IERC721Metadata.sol"; import "../../utils/Address.sol"; import "../../utils/Context.sol"; import "../../utils/Strings.sol"; import "../../utils/introspection/ERC165.sol"; /** * @dev Implementation of https://eips.ethereum.org/EIPS/eip-721[ERC721] Non-Fungible Token Standard, including * the Metadata extension, but not including the Enumerable extension, which is available separately as * {ERC721Enumerable}. */ contract ERC721 is Context, ERC165, IERC721, IERC721Metadata { using Address for address; using Strings for uint256; // Token name string private _name; // Token symbol string private _symbol; // Mapping from token ID to owner address mapping(uint256 => address) private _owners; // Mapping owner address to token count mapping(address => uint256) private _balances; // Mapping from token ID to approved address mapping(uint256 => address) private _tokenApprovals; // Mapping from owner to operator approvals mapping(address => mapping(address => bool)) private _operatorApprovals; /** * @dev Initializes the contract by setting a `name` and a `symbol` to the token collection. */ constructor(string memory name_, string memory symbol_) { _name = name_; _symbol = symbol_; } /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165, IERC165) returns (bool) { return interfaceId == type(IERC721).interfaceId || interfaceId == type(IERC721Metadata).interfaceId || super.supportsInterface(interfaceId); } /** * @dev See {IERC721-balanceOf}. */ function balanceOf(address owner) public view virtual override returns (uint256) { require(owner != address(0), "ERC721: address zero is not a valid owner"); return _balances[owner]; } /** * @dev See {IERC721-ownerOf}. */ function ownerOf(uint256 tokenId) public view virtual override returns (address) { address owner = _ownerOf(tokenId); require(owner != address(0), "ERC721: invalid token ID"); return owner; } /** * @dev See {IERC721Metadata-name}. */ function name() public view virtual override returns (string memory) { return _name; } /** * @dev See {IERC721Metadata-symbol}. */ function symbol() public view virtual override returns (string memory) { return _symbol; } /** * @dev See {IERC721Metadata-tokenURI}. */ function tokenURI(uint256 tokenId) public view virtual override returns (string memory) { _requireMinted(tokenId); string memory baseURI = _baseURI(); return bytes(baseURI).length > 0 ? string(abi.encodePacked(baseURI, tokenId.toString())) : ""; } /** * @dev Base URI for computing {tokenURI}. If set, the resulting URI for each * token will be the concatenation of the `baseURI` and the `tokenId`. Empty * by default, can be overridden in child contracts. */ function _baseURI() internal view virtual returns (string memory) { return ""; } /** * @dev See {IERC721-approve}. */ function approve(address to, uint256 tokenId) public virtual override { address owner = ERC721.ownerOf(tokenId); require(to != owner, "ERC721: approval to current owner"); require( _msgSender() == owner || isApprovedForAll(owner, _msgSender()), "ERC721: approve caller is not token owner or approved for all" ); _approve(to, tokenId); } /** * @dev See {IERC721-getApproved}. */ function getApproved(uint256 tokenId) public view virtual override returns (address) { _requireMinted(tokenId); return _tokenApprovals[tokenId]; } /** * @dev See {IERC721-setApprovalForAll}. */ function setApprovalForAll(address operator, bool approved) public virtual override { _setApprovalForAll(_msgSender(), operator, approved); } /** * @dev See {IERC721-isApprovedForAll}. */ function isApprovedForAll(address owner, address operator) public view virtual override returns (bool) { return _operatorApprovals[owner][operator]; } /** * @dev See {IERC721-transferFrom}. */ function transferFrom(address from, address to, uint256 tokenId) public virtual override { //solhint-disable-next-line max-line-length require(_isApprovedOrOwner(_msgSender(), tokenId), "ERC721: caller is not token owner or approved"); _transfer(from, to, tokenId); } /** * @dev See {IERC721-safeTransferFrom}. */ function safeTransferFrom(address from, address to, uint256 tokenId) public virtual override { safeTransferFrom(from, to, tokenId, ""); } /** * @dev See {IERC721-safeTransferFrom}. */ function safeTransferFrom(address from, address to, uint256 tokenId, bytes memory data) public virtual override { require(_isApprovedOrOwner(_msgSender(), tokenId), "ERC721: caller is not token owner or approved"); _safeTransfer(from, to, tokenId, data); } /** * @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients * are aware of the ERC721 protocol to prevent tokens from being forever locked. * * `data` is additional data, it has no specified format and it is sent in call to `to`. * * This internal function is equivalent to {safeTransferFrom}, and can be used to e.g. * implement alternative mechanisms to perform token transfer, such as signature-based. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `tokenId` token must exist and be owned by `from`. * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer. * * Emits a {Transfer} event. */ function _safeTransfer(address from, address to, uint256 tokenId, bytes memory data) internal virtual { _transfer(from, to, tokenId); require(_checkOnERC721Received(from, to, tokenId, data), "ERC721: transfer to non ERC721Receiver implementer"); } /** * @dev Returns the owner of the `tokenId`. Does NOT revert if token doesn't exist */ function _ownerOf(uint256 tokenId) internal view virtual returns (address) { return _owners[tokenId]; } /** * @dev Returns whether `tokenId` exists. * * Tokens can be managed by their owner or approved accounts via {approve} or {setApprovalForAll}. * * Tokens start existing when they are minted (`_mint`), * and stop existing when they are burned (`_burn`). */ function _exists(uint256 tokenId) internal view virtual returns (bool) { return _ownerOf(tokenId) != address(0); } /** * @dev Returns whether `spender` is allowed to manage `tokenId`. * * Requirements: * * - `tokenId` must exist. */ function _isApprovedOrOwner(address spender, uint256 tokenId) internal view virtual returns (bool) { address owner = ERC721.ownerOf(tokenId); return (spender == owner || isApprovedForAll(owner, spender) || getApproved(tokenId) == spender); } /** * @dev Safely mints `tokenId` and transfers it to `to`. * * Requirements: * * - `tokenId` must not exist. * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer. * * Emits a {Transfer} event. */ function _safeMint(address to, uint256 tokenId) internal virtual { _safeMint(to, tokenId, ""); } /** * @dev Same as {xref-ERC721-_safeMint-address-uint256-}[`_safeMint`], with an additional `data` parameter which is * forwarded in {IERC721Receiver-onERC721Received} to contract recipients. */ function _safeMint(address to, uint256 tokenId, bytes memory data) internal virtual { _mint(to, tokenId); require( _checkOnERC721Received(address(0), to, tokenId, data), "ERC721: transfer to non ERC721Receiver implementer" ); } /** * @dev Mints `tokenId` and transfers it to `to`. * * WARNING: Usage of this method is discouraged, use {_safeMint} whenever possible * * Requirements: * * - `tokenId` must not exist. * - `to` cannot be the zero address. * * Emits a {Transfer} event. */ function _mint(address to, uint256 tokenId) internal virtual { require(to != address(0), "ERC721: mint to the zero address"); require(!_exists(tokenId), "ERC721: token already minted"); _beforeTokenTransfer(address(0), to, tokenId, 1); // Check that tokenId was not minted by `_beforeTokenTransfer` hook require(!_exists(tokenId), "ERC721: token already minted"); unchecked { // Will not overflow unless all 2**256 token ids are minted to the same owner. // Given that tokens are minted one by one, it is impossible in practice that // this ever happens. Might change if we allow batch minting. // The ERC fails to describe this case. _balances[to] += 1; } _owners[tokenId] = to; emit Transfer(address(0), to, tokenId); _afterTokenTransfer(address(0), to, tokenId, 1); } /** * @dev Destroys `tokenId`. * The approval is cleared when the token is burned. * This is an internal function that does not check if the sender is authorized to operate on the token. * * Requirements: * * - `tokenId` must exist. * * Emits a {Transfer} event. */ function _burn(uint256 tokenId) internal virtual { address owner = ERC721.ownerOf(tokenId); _beforeTokenTransfer(owner, address(0), tokenId, 1); // Update ownership in case tokenId was transferred by `_beforeTokenTransfer` hook owner = ERC721.ownerOf(tokenId); // Clear approvals delete _tokenApprovals[tokenId]; unchecked { // Cannot overflow, as that would require more tokens to be burned/transferred // out than the owner initially received through minting and transferring in. _balances[owner] -= 1; } delete _owners[tokenId]; emit Transfer(owner, address(0), tokenId); _afterTokenTransfer(owner, address(0), tokenId, 1); } /** * @dev Transfers `tokenId` from `from` to `to`. * As opposed to {transferFrom}, this imposes no restrictions on msg.sender. * * Requirements: * * - `to` cannot be the zero address. * - `tokenId` token must be owned by `from`. * * Emits a {Transfer} event. */ function _transfer(address from, address to, uint256 tokenId) internal virtual { require(ERC721.ownerOf(tokenId) == from, "ERC721: transfer from incorrect owner"); require(to != address(0), "ERC721: transfer to the zero address"); _beforeTokenTransfer(from, to, tokenId, 1); // Check that tokenId was not transferred by `_beforeTokenTransfer` hook require(ERC721.ownerOf(tokenId) == from, "ERC721: transfer from incorrect owner"); // Clear approvals from the previous owner delete _tokenApprovals[tokenId]; unchecked { // `_balances[from]` cannot overflow for the same reason as described in `_burn`: // `from`'s balance is the number of token held, which is at least one before the current // transfer. // `_balances[to]` could overflow in the conditions described in `_mint`. That would require // all 2**256 token ids to be minted, which in practice is impossible. _balances[from] -= 1; _balances[to] += 1; } _owners[tokenId] = to; emit Transfer(from, to, tokenId); _afterTokenTransfer(from, to, tokenId, 1); } /** * @dev Approve `to` to operate on `tokenId` * * Emits an {Approval} event. */ function _approve(address to, uint256 tokenId) internal virtual { _tokenApprovals[tokenId] = to; emit Approval(ERC721.ownerOf(tokenId), to, tokenId); } /** * @dev Approve `operator` to operate on all of `owner` tokens * * Emits an {ApprovalForAll} event. */ function _setApprovalForAll(address owner, address operator, bool approved) internal virtual { require(owner != operator, "ERC721: approve to caller"); _operatorApprovals[owner][operator] = approved; emit ApprovalForAll(owner, operator, approved); } /** * @dev Reverts if the `tokenId` has not been minted yet. */ function _requireMinted(uint256 tokenId) internal view virtual { require(_exists(tokenId), "ERC721: invalid token ID"); } /** * @dev Internal function to invoke {IERC721Receiver-onERC721Received} on a target address. * The call is not executed if the target address is not a contract. * * @param from address representing the previous owner of the given token ID * @param to target address that will receive the tokens * @param tokenId uint256 ID of the token to be transferred * @param data bytes optional data to send along with the call * @return bool whether the call correctly returned the expected magic value */ function _checkOnERC721Received( address from, address to, uint256 tokenId, bytes memory data ) private returns (bool) { if (to.isContract()) { try IERC721Receiver(to).onERC721Received(_msgSender(), from, tokenId, data) returns (bytes4 retval) { return retval == IERC721Receiver.onERC721Received.selector; } catch (bytes memory reason) { if (reason.length == 0) { revert("ERC721: transfer to non ERC721Receiver implementer"); } else { /// @solidity memory-safe-assembly assembly { revert(add(32, reason), mload(reason)) } } } } else { return true; } } /** * @dev Hook that is called before any token transfer. This includes minting and burning. If {ERC721Consecutive} is * used, the hook may be called as part of a consecutive (batch) mint, as indicated by `batchSize` greater than 1. * * Calling conditions: * * - When `from` and `to` are both non-zero, ``from``'s tokens will be transferred to `to`. * - When `from` is zero, the tokens will be minted for `to`. * - When `to` is zero, ``from``'s tokens will be burned. * - `from` and `to` are never both zero. * - `batchSize` is non-zero. * * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks]. */ function _beforeTokenTransfer(address from, address to, uint256 firstTokenId, uint256 batchSize) internal virtual {} /** * @dev Hook that is called after any token transfer. This includes minting and burning. If {ERC721Consecutive} is * used, the hook may be called as part of a consecutive (batch) mint, as indicated by `batchSize` greater than 1. * * Calling conditions: * * - When `from` and `to` are both non-zero, ``from``'s tokens were transferred to `to`. * - When `from` is zero, the tokens were minted for `to`. * - When `to` is zero, ``from``'s tokens were burned. * - `from` and `to` are never both zero. * - `batchSize` is non-zero. * * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks]. */ function _afterTokenTransfer(address from, address to, uint256 firstTokenId, uint256 batchSize) internal virtual {} /** * @dev Unsafe write access to the balances, used by extensions that "mint" tokens using an {ownerOf} override. * * WARNING: Anyone calling this MUST ensure that the balances remain consistent with the ownership. The invariant * being that for any address `a` the value returned by `balanceOf(a)` must be equal to the number of tokens such * that `ownerOf(tokenId)` is `a`. */ // solhint-disable-next-line func-name-mixedcase function __unsafe_increaseBalance(address account, uint256 amount) internal { _balances[account] += amount; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.8.0) (token/ERC721/extensions/ERC721Enumerable.sol) pragma solidity ^0.8.0; import "../ERC721.sol"; import "./IERC721Enumerable.sol"; /** * @dev This implements an optional extension of {ERC721} defined in the EIP that adds * enumerability of all the token ids in the contract as well as all token ids owned by each * account. */ abstract contract ERC721Enumerable is ERC721, IERC721Enumerable { // Mapping from owner to list of owned token IDs mapping(address => mapping(uint256 => uint256)) private _ownedTokens; // Mapping from token ID to index of the owner tokens list mapping(uint256 => uint256) private _ownedTokensIndex; // Array with all token ids, used for enumeration uint256[] private _allTokens; // Mapping from token id to position in the allTokens array mapping(uint256 => uint256) private _allTokensIndex; /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override(IERC165, ERC721) returns (bool) { return interfaceId == type(IERC721Enumerable).interfaceId || super.supportsInterface(interfaceId); } /** * @dev See {IERC721Enumerable-tokenOfOwnerByIndex}. */ function tokenOfOwnerByIndex(address owner, uint256 index) public view virtual override returns (uint256) { require(index < ERC721.balanceOf(owner), "ERC721Enumerable: owner index out of bounds"); return _ownedTokens[owner][index]; } /** * @dev See {IERC721Enumerable-totalSupply}. */ function totalSupply() public view virtual override returns (uint256) { return _allTokens.length; } /** * @dev See {IERC721Enumerable-tokenByIndex}. */ function tokenByIndex(uint256 index) public view virtual override returns (uint256) { require(index < ERC721Enumerable.totalSupply(), "ERC721Enumerable: global index out of bounds"); return _allTokens[index]; } /** * @dev See {ERC721-_beforeTokenTransfer}. */ function _beforeTokenTransfer( address from, address to, uint256 firstTokenId, uint256 batchSize ) internal virtual override { super._beforeTokenTransfer(from, to, firstTokenId, batchSize); if (batchSize > 1) { // Will only trigger during construction. Batch transferring (minting) is not available afterwards. revert("ERC721Enumerable: consecutive transfers not supported"); } uint256 tokenId = firstTokenId; if (from == address(0)) { _addTokenToAllTokensEnumeration(tokenId); } else if (from != to) { _removeTokenFromOwnerEnumeration(from, tokenId); } if (to == address(0)) { _removeTokenFromAllTokensEnumeration(tokenId); } else if (to != from) { _addTokenToOwnerEnumeration(to, tokenId); } } /** * @dev Private function to add a token to this extension's ownership-tracking data structures. * @param to address representing the new owner of the given token ID * @param tokenId uint256 ID of the token to be added to the tokens list of the given address */ function _addTokenToOwnerEnumeration(address to, uint256 tokenId) private { uint256 length = ERC721.balanceOf(to); _ownedTokens[to][length] = tokenId; _ownedTokensIndex[tokenId] = length; } /** * @dev Private function to add a token to this extension's token tracking data structures. * @param tokenId uint256 ID of the token to be added to the tokens list */ function _addTokenToAllTokensEnumeration(uint256 tokenId) private { _allTokensIndex[tokenId] = _allTokens.length; _allTokens.push(tokenId); } /** * @dev Private function to remove a token from this extension's ownership-tracking data structures. Note that * while the token is not assigned a new owner, the `_ownedTokensIndex` mapping is _not_ updated: this allows for * gas optimizations e.g. when performing a transfer operation (avoiding double writes). * This has O(1) time complexity, but alters the order of the _ownedTokens array. * @param from address representing the previous owner of the given token ID * @param tokenId uint256 ID of the token to be removed from the tokens list of the given address */ function _removeTokenFromOwnerEnumeration(address from, uint256 tokenId) private { // To prevent a gap in from's tokens array, we store the last token in the index of the token to delete, and // then delete the last slot (swap and pop). uint256 lastTokenIndex = ERC721.balanceOf(from) - 1; uint256 tokenIndex = _ownedTokensIndex[tokenId]; // When the token to delete is the last token, the swap operation is unnecessary if (tokenIndex != lastTokenIndex) { uint256 lastTokenId = _ownedTokens[from][lastTokenIndex]; _ownedTokens[from][tokenIndex] = lastTokenId; // Move the last token to the slot of the to-delete token _ownedTokensIndex[lastTokenId] = tokenIndex; // Update the moved token's index } // This also deletes the contents at the last position of the array delete _ownedTokensIndex[tokenId]; delete _ownedTokens[from][lastTokenIndex]; } /** * @dev Private function to remove a token from this extension's token tracking data structures. * This has O(1) time complexity, but alters the order of the _allTokens array. * @param tokenId uint256 ID of the token to be removed from the tokens list */ function _removeTokenFromAllTokensEnumeration(uint256 tokenId) private { // To prevent a gap in the tokens array, we store the last token in the index of the token to delete, and // then delete the last slot (swap and pop). uint256 lastTokenIndex = _allTokens.length - 1; uint256 tokenIndex = _allTokensIndex[tokenId]; // When the token to delete is the last token, the swap operation is unnecessary. However, since this occurs so // rarely (when the last minted token is burnt) that we still do the swap here to avoid the gas cost of adding // an 'if' statement (like in _removeTokenFromOwnerEnumeration) uint256 lastTokenId = _allTokens[lastTokenIndex]; _allTokens[tokenIndex] = lastTokenId; // Move the last token to the slot of the to-delete token _allTokensIndex[lastTokenId] = tokenIndex; // Update the moved token's index // This also deletes the contents at the last position of the array delete _allTokensIndex[tokenId]; _allTokens.pop(); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.5.0) (token/ERC721/extensions/IERC721Enumerable.sol) pragma solidity ^0.8.0; import "../IERC721.sol"; /** * @title ERC-721 Non-Fungible Token Standard, optional enumeration extension * @dev See https://eips.ethereum.org/EIPS/eip-721 */ interface IERC721Enumerable is IERC721 { /** * @dev Returns the total amount of tokens stored by the contract. */ function totalSupply() external view returns (uint256); /** * @dev Returns a token ID owned by `owner` at a given `index` of its token list. * Use along with {balanceOf} to enumerate all of ``owner``'s tokens. */ function tokenOfOwnerByIndex(address owner, uint256 index) external view returns (uint256); /** * @dev Returns a token ID at a given `index` of all the tokens stored by the contract. * Use along with {totalSupply} to enumerate all tokens. */ function tokenByIndex(uint256 index) external view returns (uint256); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (token/ERC721/extensions/IERC721Metadata.sol) pragma solidity ^0.8.0; import "../IERC721.sol"; /** * @title ERC-721 Non-Fungible Token Standard, optional metadata extension * @dev See https://eips.ethereum.org/EIPS/eip-721 */ interface IERC721Metadata is IERC721 { /** * @dev Returns the token collection name. */ function name() external view returns (string memory); /** * @dev Returns the token collection symbol. */ function symbol() external view returns (string memory); /** * @dev Returns the Uniform Resource Identifier (URI) for `tokenId` token. */ function tokenURI(uint256 tokenId) external view returns (string memory); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.9.0) (token/ERC721/IERC721.sol) pragma solidity ^0.8.0; import "../../utils/introspection/IERC165.sol"; /** * @dev Required interface of an ERC721 compliant contract. */ interface IERC721 is IERC165 { /** * @dev Emitted when `tokenId` token is transferred from `from` to `to`. */ event Transfer(address indexed from, address indexed to, uint256 indexed tokenId); /** * @dev Emitted when `owner` enables `approved` to manage the `tokenId` token. */ event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId); /** * @dev Emitted when `owner` enables or disables (`approved`) `operator` to manage all of its assets. */ event ApprovalForAll(address indexed owner, address indexed operator, bool approved); /** * @dev Returns the number of tokens in ``owner``'s account. */ function balanceOf(address owner) external view returns (uint256 balance); /** * @dev Returns the owner of the `tokenId` token. * * Requirements: * * - `tokenId` must exist. */ function ownerOf(uint256 tokenId) external view returns (address owner); /** * @dev Safely transfers `tokenId` token from `from` to `to`. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `tokenId` token must exist and be owned by `from`. * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}. * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer. * * Emits a {Transfer} event. */ function safeTransferFrom(address from, address to, uint256 tokenId, bytes calldata data) external; /** * @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients * are aware of the ERC721 protocol to prevent tokens from being forever locked. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `tokenId` token must exist and be owned by `from`. * - If the caller is not `from`, it must have been allowed to move this token by either {approve} or {setApprovalForAll}. * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer. * * Emits a {Transfer} event. */ function safeTransferFrom(address from, address to, uint256 tokenId) external; /** * @dev Transfers `tokenId` token from `from` to `to`. * * WARNING: Note that the caller is responsible to confirm that the recipient is capable of receiving ERC721 * or else they may be permanently lost. Usage of {safeTransferFrom} prevents loss, though the caller must * understand this adds an external call which potentially creates a reentrancy vulnerability. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `tokenId` token must be owned by `from`. * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}. * * Emits a {Transfer} event. */ function transferFrom(address from, address to, uint256 tokenId) external; /** * @dev Gives permission to `to` to transfer `tokenId` token to another account. * The approval is cleared when the token is transferred. * * Only a single account can be approved at a time, so approving the zero address clears previous approvals. * * Requirements: * * - The caller must own the token or be an approved operator. * - `tokenId` must exist. * * Emits an {Approval} event. */ function approve(address to, uint256 tokenId) external; /** * @dev Approve or remove `operator` as an operator for the caller. * Operators can call {transferFrom} or {safeTransferFrom} for any token owned by the caller. * * Requirements: * * - The `operator` cannot be the caller. * * Emits an {ApprovalForAll} event. */ function setApprovalForAll(address operator, bool approved) external; /** * @dev Returns the account approved for `tokenId` token. * * Requirements: * * - `tokenId` must exist. */ function getApproved(uint256 tokenId) external view returns (address operator); /** * @dev Returns if the `operator` is allowed to manage all of the assets of `owner`. * * See {setApprovalForAll} */ function isApprovedForAll(address owner, address operator) external view returns (bool); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.6.0) (token/ERC721/IERC721Receiver.sol) pragma solidity ^0.8.0; /** * @title ERC721 token receiver interface * @dev Interface for any contract that wants to support safeTransfers * from ERC721 asset contracts. */ interface IERC721Receiver { /** * @dev Whenever an {IERC721} `tokenId` token is transferred to this contract via {IERC721-safeTransferFrom} * by `operator` from `from`, this function is called. * * It must return its Solidity selector to confirm the token transfer. * If any other value is returned or the interface is not implemented by the recipient, the transfer will be reverted. * * The selector can be obtained in Solidity with `IERC721Receiver.onERC721Received.selector`. */ function onERC721Received( address operator, address from, uint256 tokenId, bytes calldata data ) external returns (bytes4); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.9.0) (utils/Address.sol) pragma solidity ^0.8.1; /** * @dev Collection of functions related to the address type */ library Address { /** * @dev Returns true if `account` is a contract. * * [IMPORTANT] * ==== * It is unsafe to assume that an address for which this function returns * false is an externally-owned account (EOA) and not a contract. * * Among others, `isContract` will return false for the following * types of addresses: * * - an externally-owned account * - a contract in construction * - an address where a contract will be created * - an address where a contract lived, but was destroyed * * Furthermore, `isContract` will also return true if the target contract within * the same transaction is already scheduled for destruction by `SELFDESTRUCT`, * which only has an effect at the end of a transaction. * ==== * * [IMPORTANT] * ==== * You shouldn't rely on `isContract` to protect against flash loan attacks! * * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract * constructor. * ==== */ function isContract(address account) internal view returns (bool) { // This method relies on extcodesize/address.code.length, which returns 0 // for contracts in construction, since the code is only stored at the end // of the constructor execution. return account.code.length > 0; } /** * @dev Replacement for Solidity's `transfer`: sends `amount` wei to * `recipient`, forwarding all available gas and reverting on errors. * * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost * of certain opcodes, possibly making contracts go over the 2300 gas limit * imposed by `transfer`, making them unable to receive funds via * `transfer`. {sendValue} removes this limitation. * * https://consensys.net/diligence/blog/2019/09/stop-using-soliditys-transfer-now/[Learn more]. * * IMPORTANT: because control is transferred to `recipient`, care must be * taken to not create reentrancy vulnerabilities. Consider using * {ReentrancyGuard} or the * https://solidity.readthedocs.io/en/v0.8.0/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern]. */ function sendValue(address payable recipient, uint256 amount) internal { require(address(this).balance >= amount, "Address: insufficient balance"); (bool success, ) = recipient.call{value: amount}(""); require(success, "Address: unable to send value, recipient may have reverted"); } /** * @dev Performs a Solidity function call using a low level `call`. A * plain `call` is an unsafe replacement for a function call: use this * function instead. * * If `target` reverts with a revert reason, it is bubbled up by this * function (like regular Solidity function calls). * * Returns the raw returned data. To convert to the expected return value, * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`]. * * Requirements: * * - `target` must be a contract. * - calling `target` with `data` must not revert. * * _Available since v3.1._ */ function functionCall(address target, bytes memory data) internal returns (bytes memory) { return functionCallWithValue(target, data, 0, "Address: low-level call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with * `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCall( address target, bytes memory data, string memory errorMessage ) internal returns (bytes memory) { return functionCallWithValue(target, data, 0, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but also transferring `value` wei to `target`. * * Requirements: * * - the calling contract must have an ETH balance of at least `value`. * - the called Solidity function must be `payable`. * * _Available since v3.1._ */ function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) { return functionCallWithValue(target, data, value, "Address: low-level call with value failed"); } /** * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but * with `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCallWithValue( address target, bytes memory data, uint256 value, string memory errorMessage ) internal returns (bytes memory) { require(address(this).balance >= value, "Address: insufficient balance for call"); (bool success, bytes memory returndata) = target.call{value: value}(data); return verifyCallResultFromTarget(target, success, returndata, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but performing a static call. * * _Available since v3.3._ */ function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) { return functionStaticCall(target, data, "Address: low-level static call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`], * but performing a static call. * * _Available since v3.3._ */ function functionStaticCall( address target, bytes memory data, string memory errorMessage ) internal view returns (bytes memory) { (bool success, bytes memory returndata) = target.staticcall(data); return verifyCallResultFromTarget(target, success, returndata, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but performing a delegate call. * * _Available since v3.4._ */ function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) { return functionDelegateCall(target, data, "Address: low-level delegate call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`], * but performing a delegate call. * * _Available since v3.4._ */ function functionDelegateCall( address target, bytes memory data, string memory errorMessage ) internal returns (bytes memory) { (bool success, bytes memory returndata) = target.delegatecall(data); return verifyCallResultFromTarget(target, success, returndata, errorMessage); } /** * @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling * the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract. * * _Available since v4.8._ */ function verifyCallResultFromTarget( address target, bool success, bytes memory returndata, string memory errorMessage ) internal view returns (bytes memory) { if (success) { if (returndata.length == 0) { // only check isContract if the call was successful and the return data is empty // otherwise we already know that it was a contract require(isContract(target), "Address: call to non-contract"); } return returndata; } else { _revert(returndata, errorMessage); } } /** * @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the * revert reason or using the provided one. * * _Available since v4.3._ */ function verifyCallResult( bool success, bytes memory returndata, string memory errorMessage ) internal pure returns (bytes memory) { if (success) { return returndata; } else { _revert(returndata, errorMessage); } } function _revert(bytes memory returndata, string memory errorMessage) private pure { // Look for revert reason and bubble it up if present if (returndata.length > 0) { // The easiest way to bubble the revert reason is using memory via assembly /// @solidity memory-safe-assembly assembly { let returndata_size := mload(returndata) revert(add(32, returndata), returndata_size) } } else { revert(errorMessage); } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.9.4) (utils/Context.sol) pragma solidity ^0.8.0; /** * @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 v4.4.1 (utils/introspection/ERC165.sol) pragma solidity ^0.8.0; import "./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); * } * ``` * * Alternatively, {ERC165Storage} provides an easier to use but more expensive implementation. */ abstract contract ERC165 is IERC165 { /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { return interfaceId == type(IERC165).interfaceId; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.9.0) (utils/introspection/ERC165Checker.sol) pragma solidity ^0.8.0; import "./IERC165.sol"; /** * @dev Library used to query support of an interface declared via {IERC165}. * * Note that these functions return the actual result of the query: they do not * `revert` if an interface is not supported. It is up to the caller to decide * what to do in these cases. */ library ERC165Checker { // As per the EIP-165 spec, no interface should ever match 0xffffffff bytes4 private constant _INTERFACE_ID_INVALID = 0xffffffff; /** * @dev Returns true if `account` supports the {IERC165} interface. */ function supportsERC165(address account) internal view returns (bool) { // Any contract that implements ERC165 must explicitly indicate support of // InterfaceId_ERC165 and explicitly indicate non-support of InterfaceId_Invalid return supportsERC165InterfaceUnchecked(account, type(IERC165).interfaceId) && !supportsERC165InterfaceUnchecked(account, _INTERFACE_ID_INVALID); } /** * @dev Returns true if `account` supports the interface defined by * `interfaceId`. Support for {IERC165} itself is queried automatically. * * See {IERC165-supportsInterface}. */ function supportsInterface(address account, bytes4 interfaceId) internal view returns (bool) { // query support of both ERC165 as per the spec and support of _interfaceId return supportsERC165(account) && supportsERC165InterfaceUnchecked(account, interfaceId); } /** * @dev Returns a boolean array where each value corresponds to the * interfaces passed in and whether they're supported or not. This allows * you to batch check interfaces for a contract where your expectation * is that some interfaces may not be supported. * * See {IERC165-supportsInterface}. * * _Available since v3.4._ */ function getSupportedInterfaces( address account, bytes4[] memory interfaceIds ) internal view returns (bool[] memory) { // an array of booleans corresponding to interfaceIds and whether they're supported or not bool[] memory interfaceIdsSupported = new bool[](interfaceIds.length); // query support of ERC165 itself if (supportsERC165(account)) { // query support of each interface in interfaceIds for (uint256 i = 0; i < interfaceIds.length; i++) { interfaceIdsSupported[i] = supportsERC165InterfaceUnchecked(account, interfaceIds[i]); } } return interfaceIdsSupported; } /** * @dev Returns true if `account` supports all the interfaces defined in * `interfaceIds`. Support for {IERC165} itself is queried automatically. * * Batch-querying can lead to gas savings by skipping repeated checks for * {IERC165} support. * * See {IERC165-supportsInterface}. */ function supportsAllInterfaces(address account, bytes4[] memory interfaceIds) internal view returns (bool) { // query support of ERC165 itself if (!supportsERC165(account)) { return false; } // query support of each interface in interfaceIds for (uint256 i = 0; i < interfaceIds.length; i++) { if (!supportsERC165InterfaceUnchecked(account, interfaceIds[i])) { return false; } } // all interfaces supported return true; } /** * @notice Query if a contract implements an interface, does not check ERC165 support * @param account The address of the contract to query for support of an interface * @param interfaceId The interface identifier, as specified in ERC-165 * @return true if the contract at account indicates support of the interface with * identifier interfaceId, false otherwise * @dev Assumes that account contains a contract that supports ERC165, otherwise * the behavior of this method is undefined. This precondition can be checked * with {supportsERC165}. * * Some precompiled contracts will falsely indicate support for a given interface, so caution * should be exercised when using this function. * * Interface identification is specified in ERC-165. */ function supportsERC165InterfaceUnchecked(address account, bytes4 interfaceId) internal view returns (bool) { // prepare call bytes memory encodedParams = abi.encodeWithSelector(IERC165.supportsInterface.selector, interfaceId); // perform static call bool success; uint256 returnSize; uint256 returnValue; assembly { success := staticcall(30000, account, add(encodedParams, 0x20), mload(encodedParams), 0x00, 0x20) returnSize := returndatasize() returnValue := mload(0x00) } return success && returnSize >= 0x20 && returnValue > 0; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC165.sol) pragma solidity ^0.8.0; /** * @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 v4.9.0) (utils/math/Math.sol) pragma solidity ^0.8.0; /** * @dev Standard math utilities missing in the Solidity language. */ library Math { enum Rounding { Down, // Toward negative infinity Up, // Toward infinity Zero // Toward zero } /** * @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 up instead * of rounding down. */ function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) { // (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; // Least significant 256 bits of the product uint256 prod1; // Most significant 256 bits of the product assembly { let mm := mulmod(x, y, not(0)) prod0 := mul(x, y) 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. require(denominator > prod1, "Math: mulDiv overflow"); /////////////////////////////////////////////// // 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. // Does not overflow because the denominator cannot be zero at this stage in the function. uint256 twos = denominator & (~denominator + 1); 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 (rounding == Rounding.Up && 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 down. * * 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 + (rounding == Rounding.Up && result * result < a ? 1 : 0); } } /** * @dev Return the log in base 2, rounded down, of a positive value. * 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 + (rounding == Rounding.Up && 1 << result < value ? 1 : 0); } } /** * @dev Return the log in base 10, rounded down, of a positive value. * 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 + (rounding == Rounding.Up && 10 ** result < value ? 1 : 0); } } /** * @dev Return the log in base 256, rounded down, of a positive value. * 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 + (rounding == Rounding.Up && 1 << (result << 3) < value ? 1 : 0); } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.8.0) (utils/math/SignedMath.sol) pragma solidity ^0.8.0; /** * @dev Standard signed math utilities missing in the Solidity language. */ library SignedMath { /** * @dev Returns the largest of two signed numbers. */ function max(int256 a, int256 b) internal pure returns (int256) { return a > b ? a : b; } /** * @dev Returns the smallest of two signed numbers. */ function min(int256 a, int256 b) internal pure returns (int256) { return a < b ? a : b; } /** * @dev Returns the average of two signed numbers without overflow. * The result is rounded towards zero. */ function average(int256 a, int256 b) internal pure returns (int256) { // Formula from the book "Hacker's Delight" int256 x = (a & b) + ((a ^ b) >> 1); return x + (int256(uint256(x) >> 255) & (a ^ b)); } /** * @dev Returns the absolute unsigned value of a signed value. */ function abs(int256 n) internal pure returns (uint256) { unchecked { // must be unchecked in order to support `n = type(int256).min` return uint256(n >= 0 ? n : -n); } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.9.0) (utils/Strings.sol) pragma solidity ^0.8.0; import "./math/Math.sol"; import "./math/SignedMath.sol"; /** * @dev String operations. */ library Strings { bytes16 private constant _SYMBOLS = "0123456789abcdef"; uint8 private constant _ADDRESS_LENGTH = 20; /** * @dev Converts a `uint256` to its ASCII `string` decimal representation. */ function toString(uint256 value) internal pure returns (string memory) { unchecked { uint256 length = Math.log10(value) + 1; string memory buffer = new string(length); uint256 ptr; /// @solidity memory-safe-assembly assembly { ptr := add(buffer, add(32, length)) } while (true) { ptr--; /// @solidity memory-safe-assembly assembly { mstore8(ptr, byte(mod(value, 10), _SYMBOLS)) } value /= 10; if (value == 0) break; } return buffer; } } /** * @dev Converts a `int256` to its ASCII `string` decimal representation. */ function toString(int256 value) internal pure returns (string memory) { return string(abi.encodePacked(value < 0 ? "-" : "", toString(SignedMath.abs(value)))); } /** * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation. */ function toHexString(uint256 value) internal pure returns (string memory) { unchecked { return toHexString(value, Math.log256(value) + 1); } } /** * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length. */ function toHexString(uint256 value, uint256 length) internal pure returns (string memory) { bytes memory buffer = new bytes(2 * length + 2); buffer[0] = "0"; buffer[1] = "x"; for (uint256 i = 2 * length + 1; i > 1; --i) { buffer[i] = _SYMBOLS[value & 0xf]; value >>= 4; } require(value == 0, "Strings: hex length insufficient"); return string(buffer); } /** * @dev Converts an `address` with fixed length of 20 bytes to its not checksummed ASCII `string` hexadecimal representation. */ function toHexString(address addr) internal pure returns (string memory) { return toHexString(uint256(uint160(addr)), _ADDRESS_LENGTH); } /** * @dev Returns true if the two strings are equal. */ function equal(string memory a, string memory b) internal pure returns (bool) { return keccak256(bytes(a)) == keccak256(bytes(b)); } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; /// @title contains array utility functions library Array { /// @dev returns a new slice of the array function KeepNElementsInArray(uint256[] memory _arr, uint256 _n) internal pure returns (uint256[] memory newArray) { if (_arr.length == _n) return _arr; require(_arr.length > _n, "can't cut more then got"); newArray = new uint256[](_n); for (uint256 i = 0; i < _n; ++i) { newArray[i] = _arr[i]; } return newArray; } function KeepNElementsInArray(address[] memory _arr, uint256 _n) internal pure returns (address[] memory newArray) { if (_arr.length == _n) return _arr; require(_arr.length > _n, "can't cut more then got"); newArray = new address[](_n); for (uint256 i = 0; i < _n; ++i) { newArray[i] = _arr[i]; } return newArray; } /// @return true if the array is ordered function isArrayOrdered(uint256[] memory _arr) internal pure returns (bool) { require(_arr.length > 0, "array should be greater than zero"); uint256 temp = _arr[0]; for (uint256 i = 1; i < _arr.length; ++i) { if (temp > _arr[i]) { return false; } temp = _arr[i]; } return true; } /// @return sum of the array elements function getArraySum(uint256[] memory _array) internal pure returns (uint256) { uint256 sum = 0; for (uint256 i = 0; i < _array.length; ++i) { sum = sum + _array[i]; } return sum; } /// @return true if the element exists in the array function isInArray(address[] memory _arr, address _elem) internal pure returns (bool) { for (uint256 i = 0; i < _arr.length; ++i) { if (_arr[i] == _elem) return true; } return false; } function addIfNotExsist(address[] storage _arr, address _elem) internal { if (!Array.isInArray(_arr, _elem)) { _arr.push(_elem); } } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; interface IBeforeTransfer { function beforeTransfer(address from, address to, uint256 poolId) external; }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; interface IInnerWithdraw { function getInnerIdsArray(uint256 poolId) external returns (uint256[] calldata ids); }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "@openzeppelin/contracts/token/ERC721/extensions/IERC721Enumerable.sol"; import "./IProvider.sol"; import "./IVaultManager.sol"; interface ILockDealNFT is IERC721Enumerable { function approvedContracts(address contractAddress) external view returns (bool); function mintAndTransfer( address owner, address token, uint256 amount, IProvider provider ) external returns (uint256 poolId); function safeMintAndTransfer( address owner, address token, address from, uint256 amount, IProvider provider, bytes calldata data ) external returns (uint256 poolId); function cloneVaultId(uint256 destinationPoolId, uint256 sourcePoolId) external; function mintForProvider(address owner, IProvider provider) external returns (uint256 poolId); function getData(uint256 poolId) external view returns (BasePoolInfo memory poolInfo); function getFullData(uint256 poolId) external view returns (BasePoolInfo[] memory poolInfo); function tokenOf(uint256 poolId) external view returns (address token); function vaultManager() external view returns (IVaultManager); function poolIdToProvider(uint256 poolId) external view returns (IProvider provider); function getWithdrawableAmount(uint256 poolId) external view returns (uint256 withdrawalAmount); struct BasePoolInfo { IProvider provider; string name; uint256 poolId; uint256 vaultId; address owner; address token; uint256[] params; } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; ///@dev Interface for the provider contract ///@notice This interface is used by the NFT contract to call the provider contract interface IProvider { event UpdateParams(uint256 indexed poolId, uint256[] params); function withdraw(uint256 tokenId) external returns (uint256 withdrawnAmount, bool isFinal); function split(uint256 oldPoolId, uint256 newPoolId, uint256 ratio) external; function registerPool(uint256 poolId, uint256[] calldata params) external; function getParams(uint256 poolId) external view returns (uint256[] memory params); function getWithdrawableAmount(uint256 poolId) external view returns (uint256 withdrawalAmount); function currentParamsTargetLength() external view returns (uint256); function name() external view returns (string memory); function getSubProvidersPoolIds(uint256 poolID) external view returns (uint256[] memory poolIds); }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "@openzeppelin/contracts/interfaces/IERC2981.sol"; interface IVaultManager is IERC2981 { function depositByToken(address _tokenAddress, uint _amount) external returns (uint vaultId); function safeDeposit( address _tokenAddress, uint _amount, address _from, bytes memory _signature ) external returns (uint vaultId); function withdrawByVaultId(uint _vaultId, address to, uint _amount) external; function vaultIdToTokenAddress(uint _vaultId) external view returns (address token); function vaultIdToTradeStartTime(uint256 _vaultId) external view returns (uint256 startTime); }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "@poolzfinance/poolz-helper-v2/contracts/interfaces/IProvider.sol"; /// @title ILockDealNFTEvents interface /// @notice Contains all events emitted by the LockDealNFT interface ILockDealNFTEvents { event ContractApproved(address indexed contractAddress, bool status); event BaseURIChanged(string oldBaseURI, string newBaseURI); event TokenWithdrawn(uint256 poolId, address indexed owner, uint256 withdrawnAmount, uint256 leftAmount); event PoolSplit( uint256 poolId, address indexed owner, uint256 newPoolId, address indexed newOwner, uint256 splitLeftAmount, uint256 newSplitLeftAmount ); }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "./LockDealNFTModifiers.sol"; import "@openzeppelin/contracts/utils/introspection/ERC165Checker.sol"; import "@poolzfinance/poolz-helper-v2/contracts/interfaces/IBeforeTransfer.sol"; import "@poolzfinance/poolz-helper-v2/contracts/interfaces/IInnerWithdraw.sol"; import "@ironblocks/firewall-consumer/contracts/FirewallConsumer.sol"; abstract contract LockDealNFTInternal is LockDealNFTModifiers, FirewallConsumer { function _transfer(address from, address to, uint256 poolId) internal override firewallProtectedSig(0x30e0789e) { if ( from != address(0) && ERC165Checker.supportsInterface(address(poolIdToProvider[poolId]), type(IBeforeTransfer).interfaceId) ) { IBeforeTransfer(address(poolIdToProvider[poolId])).beforeTransfer(from, to, poolId); } // check for split and withdraw transfers if (!(approvedContracts[to] || approvedContracts[from])) { require(approvedPoolUserTransfers[from], "Pool transfer not approved by user"); require( vaultManager.vaultIdToTradeStartTime(poolIdToVaultId[poolId]) < block.timestamp, "Can't transfer before trade start time" ); } super._transfer(from, to, poolId); } /// @param owner The address to assign the token to /// @param provider The address of the provider assigning the token /// @return newPoolId The ID of the pool function _mint(address owner, IProvider provider) internal firewallProtectedSig(0x3c99ae44) returns (uint256 newPoolId) { newPoolId = totalSupply(); _safeMint(owner, newPoolId); poolIdToProvider[newPoolId] = provider; } function _parseData(bytes calldata data, address from) internal pure returns (uint256 ratio, address newOwner) { (ratio, newOwner) = data.length == 32 ? (abi.decode(data, (uint256)), from) : abi.decode(data, (uint256, address)); } function _baseURI() internal view override returns (string memory) { return baseURI; } function _handleReturn(uint256 poolId, address from, bool isFinal) internal firewallProtectedSig(0x1d50d0db) { if (!isFinal) { _transfer(address(this), from, poolId); } } function _withdrawFromVault(uint256 poolId, uint256 withdrawnAmount, address from) internal firewallProtectedSig(0x05d6a92f) { if (withdrawnAmount > 0) { vaultManager.withdrawByVaultId(poolIdToVaultId[poolId], from, withdrawnAmount); emit MetadataUpdate(poolId); emit TokenWithdrawn(poolId, from, withdrawnAmount, _getData(poolId).params[0]); } } function _withdraw(address from, uint256 poolId) internal firewallProtectedSig(0xb790a77b) returns (bool isFinal) { uint256 withdrawnAmount; IProvider provider = poolIdToProvider[poolId]; (withdrawnAmount, isFinal) = provider.withdraw(poolId); if (ERC165Checker.supportsInterface(address(provider), type(IInnerWithdraw).interfaceId)) { withdrawnAmount = 0; uint256[] memory ids = IInnerWithdraw(address(provider)).getInnerIdsArray(poolId); for (uint256 i = 0; i < ids.length; ++i) { uint256 id = ids[i]; require(ownerOf(id) == address(poolIdToProvider[poolId]), "invalid inner id"); _withdraw(from, id); } } _withdrawFromVault(poolId, withdrawnAmount, from); } /// @dev Splits a pool into two pools with adjusted amounts /// @param poolId The ID of the pool to split function _split(uint256 poolId, address from, bytes calldata data) internal firewallProtectedSig(0x1746b892) returns (bool isFinal) { (uint256 ratio, address newOwner) = _parseData(data, from); isFinal = _split(poolId, from, ratio, newOwner); } struct SplitLocals { IProvider provider; uint256 newPoolId; } function _split( uint256 poolId, address from, uint256 ratio, address newOwner ) private notZeroAddress(newOwner) notZeroAmount(ratio) returns (bool isFinal) { require(ratio <= 1e21, "split amount exceeded"); SplitLocals memory locals; locals.provider = poolIdToProvider[poolId]; locals.newPoolId = _mint(newOwner, locals.provider); poolIdToVaultId[locals.newPoolId] = poolIdToVaultId[poolId]; locals.provider.split(poolId, locals.newPoolId, ratio); isFinal = locals.provider.getParams(poolId)[0] == 0; uint256 splitLeftAmount = _getData(poolId).params[0]; emit PoolSplit(poolId, from, locals.newPoolId, newOwner, splitLeftAmount, _getData(locals.newPoolId).params[0]); emit MetadataUpdate(poolId); } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "./LockDealNFTState.sol"; abstract contract LockDealNFTModifiers is LockDealNFTState { modifier onlyApprovedContract(address contractAddress) { _onlyApprovedContract(contractAddress); if (contractAddress != msg.sender) { _onlyApprovedContract(msg.sender); } _; } modifier onlyContract(address contractAddress) { _onlyContract(contractAddress); _; } modifier notZeroAddress(address _address) { _notZeroAddress(_address); _; } modifier notZeroAmount(uint256 amount) { _notZeroAmount(amount); _; } modifier validPoolId(uint256 poolId) { _validPoolId(poolId); _; } function _notZeroAddress(address _address) internal pure { require(_address != address(0x0), "Zero Address is not allowed"); } function _onlyContract(address contractAddress) private view { require(Address.isContract(contractAddress), "Invalid contract address"); } function _onlyApprovedContract(address contractAddress) internal view { require(approvedContracts[contractAddress], "Contract not approved"); } function _notZeroAmount(uint256 amount) private pure { require(amount > 0, "amount must be greater than 0"); } function _validPoolId(uint256 poolId) internal view { require(_exists(poolId), "Pool does not exist"); } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol"; import "@openzeppelin/contracts/interfaces/IERC4906.sol"; import "@poolzfinance/poolz-helper-v2/contracts/interfaces/IVaultManager.sol"; import "@poolzfinance/poolz-helper-v2/contracts/interfaces/ILockDealNFT.sol"; import "@poolzfinance/poolz-helper-v2/contracts/Array.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; import "./ILockDealNFTEvents.sol"; /** * @title LockDealNFTState * @dev An abstract contract that defines the state variables and mappings for the LockDealNFT contract. */ abstract contract LockDealNFTState is ERC721Enumerable, ILockDealNFTEvents, Ownable, IERC4906, ILockDealNFT, IERC2981 { string public baseURI; IVaultManager public vaultManager; mapping(uint256 => IProvider) public poolIdToProvider; mapping(uint256 => uint256) public poolIdToVaultId; mapping(address => bool) public approvedPoolUserTransfers; mapping(address => bool) public approvedContracts; function getData(uint256 poolId) public view returns (BasePoolInfo memory poolInfo) { if (_exists(poolId)) { poolInfo = _getData(poolId); } } function getFullData(uint256 poolId) public view returns (BasePoolInfo[] memory poolInfo) { if (_exists(poolId)) { uint256[] memory poolIds = poolIdToProvider[poolId].getSubProvidersPoolIds(poolId); uint256 length = poolIds.length + 1; poolInfo = new BasePoolInfo[](length); poolInfo[0] = _getData(poolId); for (uint256 i = 1; i < length; ++i) { poolInfo[i] = _getData(poolIds[i - 1]); } } } function _getData(uint256 poolId) internal view returns (BasePoolInfo memory poolInfo) { IProvider provider = poolIdToProvider[poolId]; poolInfo = BasePoolInfo( provider, provider.name(), poolId, poolIdToVaultId[poolId], ownerOf(poolId), tokenOf(poolId), provider.getParams(poolId) ); } /// @dev Retrieves user data by tokens between a specified index range. /// This is used by the front-end to fetch NFTs linked to a predefined set of supported tokens. /// It's primarily queried off-chain, so gas costs are not a concern here. /// @param user The address of the user. /// @param tokens The list of supported tokens. /// @param from Starting index for the query. /// @param to Ending index for the query. /// @return userPoolInfo An array containing pool information for the user's NFTs within the specified range. function getUserDataByTokens( address user, address[] calldata tokens, uint256 from, uint256 to ) public view returns (BasePoolInfo[] memory userPoolInfo) { require(from <= to, "Invalid range"); require(to < balanceOf(user, tokens), "Range greater than user pool count"); userPoolInfo = new BasePoolInfo[](to - from + 1); uint256 userPoolIndex = 0; for (uint256 i = from; i <= to; ++i) { uint256 poolId = tokenOfOwnerByIndex(user, tokens, i); userPoolInfo[userPoolIndex++] = getData(poolId); } } function tokenOf(uint256 poolId) public view returns (address token) { token = vaultManager.vaultIdToTokenAddress(poolIdToVaultId[poolId]); } function getWithdrawableAmount(uint256 poolId) external view returns (uint256 withdrawalAmount) { if (_exists(poolId)) { withdrawalAmount = poolIdToProvider[poolId].getWithdrawableAmount(poolId); } } function royaltyInfo( uint256 tokenId, uint256 salePrice ) external view override returns (address receiver, uint256 royaltyAmount) { (receiver, royaltyAmount) = vaultManager.royaltyInfo(poolIdToVaultId[tokenId], salePrice); } function supportsInterface( bytes4 interfaceId ) public view virtual override(ERC721Enumerable, IERC165) returns (bool) { return interfaceId == type(IERC2981).interfaceId || interfaceId == type(ILockDealNFT).interfaceId || super.supportsInterface(interfaceId); } /// @dev Returns the balance of NFTs owned by an address, which are also in the provided tokens list. /// @param owner The address of the owner. /// @param tokens List of supported tokens to filter by. /// @return balance The number of NFTs owned by the address and present in the tokens list. function balanceOf(address owner, address[] calldata tokens) public view returns (uint256 balance) { uint256 fullBalanceOf = balanceOf(owner); for (uint256 i = 0; i < fullBalanceOf; ++i) { if (Array.isInArray(tokens, tokenOf(tokenOfOwnerByIndex(owner, i)))) { ++balance; } } } /// @dev Retrieves a token ID owned by an address at a specific index, which is also in the provided tokens list. /// @param owner The address of the owner. /// @param tokens List of supported tokens to filter by. /// @param index The index to retrieve the token ID from. /// @return poolId The token ID owned by the address at the specified index. function tokenOfOwnerByIndex( address owner, address[] calldata tokens, uint256 index ) public view returns (uint256 poolId) { uint256 length = balanceOf(owner, tokens); require(index < length, "invalid poolId index by token association"); uint256 fullBalanceOf = balanceOf(owner); uint256 j = 0; for (uint256 i = 0; i < fullBalanceOf; ++i) { poolId = tokenOfOwnerByIndex(owner, i); if (Array.isInArray(tokens, tokenOf(poolId)) && j++ == index) { return poolId; } } } }
{ "evmVersion": "istanbul", "optimizer": { "enabled": true, "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":"_vaultManager","type":"address"},{"internalType":"string","name":"_baseURI","type":"string"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"approved","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","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":false,"internalType":"string","name":"oldBaseURI","type":"string"},{"indexed":false,"internalType":"string","name":"newBaseURI","type":"string"}],"name":"BaseURIChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"_fromTokenId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"_toTokenId","type":"uint256"}],"name":"BatchMetadataUpdate","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"contractAddress","type":"address"},{"indexed":false,"internalType":"bool","name":"status","type":"bool"}],"name":"ContractApproved","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"newAdmin","type":"address"}],"name":"FirewallAdminUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"newFirewall","type":"address"}],"name":"FirewallUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"_tokenId","type":"uint256"}],"name":"MetadataUpdate","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":false,"internalType":"uint256","name":"poolId","type":"uint256"},{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":false,"internalType":"uint256","name":"newPoolId","type":"uint256"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"},{"indexed":false,"internalType":"uint256","name":"splitLeftAmount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"newSplitLeftAmount","type":"uint256"}],"name":"PoolSplit","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"poolId","type":"uint256"},{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":false,"internalType":"uint256","name":"withdrawnAmount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"leftAmount","type":"uint256"}],"name":"TokenWithdrawn","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Transfer","type":"event"},{"inputs":[],"name":"acceptFirewallAdmin","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"approve","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bool","name":"status","type":"bool"}],"name":"approvePoolTransfers","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"approvedContracts","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"approvedPoolUserTransfers","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address[]","name":"tokens","type":"address[]"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"balance","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"baseURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"destinationPoolId","type":"uint256"},{"internalType":"uint256","name":"sourcePoolId","type":"uint256"}],"name":"cloneVaultId","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"firewallAdmin","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"getApproved","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"poolId","type":"uint256"}],"name":"getData","outputs":[{"components":[{"internalType":"contract IProvider","name":"provider","type":"address"},{"internalType":"string","name":"name","type":"string"},{"internalType":"uint256","name":"poolId","type":"uint256"},{"internalType":"uint256","name":"vaultId","type":"uint256"},{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"token","type":"address"},{"internalType":"uint256[]","name":"params","type":"uint256[]"}],"internalType":"struct ILockDealNFT.BasePoolInfo","name":"poolInfo","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"poolId","type":"uint256"}],"name":"getFullData","outputs":[{"components":[{"internalType":"contract IProvider","name":"provider","type":"address"},{"internalType":"string","name":"name","type":"string"},{"internalType":"uint256","name":"poolId","type":"uint256"},{"internalType":"uint256","name":"vaultId","type":"uint256"},{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"token","type":"address"},{"internalType":"uint256[]","name":"params","type":"uint256[]"}],"internalType":"struct ILockDealNFT.BasePoolInfo[]","name":"poolInfo","type":"tuple[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"user","type":"address"},{"internalType":"address[]","name":"tokens","type":"address[]"},{"internalType":"uint256","name":"from","type":"uint256"},{"internalType":"uint256","name":"to","type":"uint256"}],"name":"getUserDataByTokens","outputs":[{"components":[{"internalType":"contract IProvider","name":"provider","type":"address"},{"internalType":"string","name":"name","type":"string"},{"internalType":"uint256","name":"poolId","type":"uint256"},{"internalType":"uint256","name":"vaultId","type":"uint256"},{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"token","type":"address"},{"internalType":"uint256[]","name":"params","type":"uint256[]"}],"internalType":"struct ILockDealNFT.BasePoolInfo[]","name":"userPoolInfo","type":"tuple[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"poolId","type":"uint256"}],"name":"getWithdrawableAmount","outputs":[{"internalType":"uint256","name":"withdrawalAmount","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"operator","type":"address"}],"name":"isApprovedForAll","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"token","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"contract IProvider","name":"provider","type":"address"}],"name":"mintAndTransfer","outputs":[{"internalType":"uint256","name":"poolId","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"contract IProvider","name":"provider","type":"address"}],"name":"mintForProvider","outputs":[{"internalType":"uint256","name":"poolId","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"address","name":"from","type":"address"},{"internalType":"uint256","name":"poolId","type":"uint256"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"onERC721Received","outputs":[{"internalType":"bytes4","name":"","type":"bytes4"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"ownerOf","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"poolIdToProvider","outputs":[{"internalType":"contract IProvider","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"poolIdToVaultId","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"uint256","name":"salePrice","type":"uint256"}],"name":"royaltyInfo","outputs":[{"internalType":"address","name":"receiver","type":"address"},{"internalType":"uint256","name":"royaltyAmount","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"target","type":"address"},{"internalType":"bytes","name":"targetPayload","type":"bytes"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"safeFunctionCall","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"token","type":"address"},{"internalType":"address","name":"from","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"contract IProvider","name":"provider","type":"address"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"safeMintAndTransfer","outputs":[{"internalType":"uint256","name":"poolId","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","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":"address","name":"contractAddress","type":"address"},{"internalType":"bool","name":"status","type":"bool"}],"name":"setApprovedContract","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"target","type":"address"},{"internalType":"bool","name":"status","type":"bool"}],"name":"setApprovedTarget","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"newBaseURI","type":"string"}],"name":"setBaseURI","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_firewall","type":"address"}],"name":"setFirewall","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_firewallAdmin","type":"address"}],"name":"setFirewallAdmin","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":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"index","type":"uint256"}],"name":"tokenByIndex","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"poolId","type":"uint256"}],"name":"tokenOf","outputs":[{"internalType":"address","name":"token","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"uint256","name":"index","type":"uint256"}],"name":"tokenOfOwnerByIndex","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address[]","name":"tokens","type":"address[]"},{"internalType":"uint256","name":"index","type":"uint256"}],"name":"tokenOfOwnerByIndex","outputs":[{"internalType":"uint256","name":"poolId","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"tokenURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"transferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"updateAllMetadata","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"vaultManager","outputs":[{"internalType":"contract IVaultManager","name":"","type":"address"}],"stateMutability":"view","type":"function"}]
Contract Creation Code
60806040523480156200001157600080fd5b50604051620063b9380380620063b9833981016040819052620000349162000246565b6000336040518060400160405280600b81526020016a131bd8dad119585b13919560aa1b81525060405180604001604052806005815260200164131113919560da1b81525081600090816200008a9190620003cd565b506001620000998282620003cd565b505050620000b6620000b06200017c60201b60201c565b62000180565b620000ec620000e760017f5dd2e3b890564a8f99f7f203f226a27a8aa59aee19a4ece5cf5eaa77ab91f66262000499565b839055565b620001226200011d60017f29982a6ac507a2a707ced6dee5d76285dd49725db977de83d9702c628c97413662000499565b829055565b5062000130905082620001d2565b600c80546001600160a01b0319166001600160a01b038416179055306000908152601060205260409020805460ff19166001179055600b620001738282620003cd565b505050620004c1565b3390565b600a80546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b6001600160a01b0381166200022d5760405162461bcd60e51b815260206004820152601b60248201527f5a65726f2041646472657373206973206e6f7420616c6c6f7765640000000000604482015260640160405180910390fd5b50565b634e487b7160e01b600052604160045260246000fd5b600080604083850312156200025a57600080fd5b82516001600160a01b03811681146200027257600080fd5b602084810151919350906001600160401b03808211156200029257600080fd5b818601915086601f830112620002a757600080fd5b815181811115620002bc57620002bc62000230565b604051601f8201601f19908116603f01168101908382118183101715620002e757620002e762000230565b8160405282815289868487010111156200030057600080fd5b600093505b8284101562000324578484018601518185018701529285019262000305565b60008684830101528096505050505050509250929050565b600181811c908216806200035157607f821691505b6020821081036200037257634e487b7160e01b600052602260045260246000fd5b50919050565b601f821115620003c8576000816000526020600020601f850160051c81016020861015620003a35750805b601f850160051c820191505b81811015620003c457828155600101620003af565b5050505b505050565b81516001600160401b03811115620003e957620003e962000230565b6200040181620003fa84546200033c565b8462000378565b602080601f831160018114620004395760008415620004205750858301515b600019600386901b1c1916600185901b178555620003c4565b600085815260208120601f198616915b828110156200046a5788860151825594840194600190910190840162000449565b5085821015620004895787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b81810381811115620004bb57634e487b7160e01b600052601160045260246000fd5b92915050565b615ee880620004d16000396000f3fe6080604052600436106102935760003560e01c8063665579381161015a578063a22cb465116100c1578063c87b56dd1161007a578063c87b56dd1461085b578063e985e9c51461087b578063ea78803f146108c4578063f05c8582146108e4578063f2fde38b146108f9578063fde914b41461091957600080fd5b8063a22cb4651461079b578063afa7688d146107bb578063b27abb06146107db578063b7f9a748146107fb578063b88d4fde1461081b578063bfbed3501461083b57600080fd5b8063875f438411610113578063875f4384146106db5780638a4adf24146106fb5780638c36d02d1461071b5780638da5cb5b1461073b57806395d89b41146107595780639bd51bfd1461076e57600080fd5b806366557938146106265780636c0360eb1461065c57806370a0823114610671578063715018a614610691578063734b7198146106a65780637c65c38b146106c657600080fd5b80632f745c59116101fe5780634f6ccce7116101b75780634f6ccce71461056657806355f804b3146105865780635c2bd9de146105a65780635ffd993b146105c6578063604e38ed146105e65780636352211e1461060657600080fd5b80632f745c591461049457806338c52df0146104b457806340a4376e146104c957806342842e0e146104f65780634aa3ab93146105165780634e17f2971461053657600080fd5b806318160ddd1161025057806318160ddd146103b35780631a8828f4146103d257806323b872dd146103e557806326749ad71461040557806327608c36146104355780632a55205a1461045557600080fd5b80630178fe3f1461029857806301ffc9a7146102ce57806306fdde03146102fe578063081812fc14610320578063095ea7b314610358578063150b7a021461037a575b600080fd5b3480156102a457600080fd5b506102b86102b3366004614f01565b610939565b6040516102c5919061500f565b60405180910390f35b3480156102da57600080fd5b506102ee6102e9366004615038565b610960565b60405190151581526020016102c5565b34801561030a57600080fd5b506103136109a0565b6040516102c59190615055565b34801561032c57600080fd5b5061034061033b366004614f01565b610a32565b6040516001600160a01b0390911681526020016102c5565b34801561036457600080fd5b5061037861037336600461507d565b610a59565b005b34801561038657600080fd5b5061039a6103953660046150f1565b610b73565b6040516001600160e01b031990911681526020016102c5565b3480156103bf57600080fd5b506008545b6040519081526020016102c5565b6103786103e0366004615163565b610d6b565b3480156103f157600080fd5b506103786104003660046151d4565b610f0d565b34801561041157600080fd5b506102ee610420366004615215565b60106020526000908152604090205460ff1681565b34801561044157600080fd5b506103c4610450366004615232565b610f98565b34801561046157600080fd5b50610475610470366004615285565b611343565b604080516001600160a01b0390931683526020830191909152016102c5565b3480156104a057600080fd5b506103c46104af36600461507d565b6113d5565b3480156104c057600080fd5b5061037861146e565b3480156104d557600080fd5b506104e96104e43660046152eb565b61149c565b6040516102c59190615351565b34801561050257600080fd5b506103786105113660046151d4565b611613565b34801561052257600080fd5b506103c46105313660046153b5565b61162e565b34801561054257600080fd5b506102ee610551366004615215565b600f6020526000908152604090205460ff1681565b34801561057257600080fd5b506103c4610581366004614f01565b6116b4565b34801561059257600080fd5b506103786105a13660046154b4565b611747565b3480156105b257600080fd5b506103c46105c13660046154fc565b6118c7565b3480156105d257600080fd5b506103786105e1366004615565565b6119d7565b3480156105f257600080fd5b506103c461060136600461559e565b611a49565b34801561061257600080fd5b50610340610621366004614f01565b611d31565b34801561063257600080fd5b50610340610641366004614f01565b600d602052600090815260409020546001600160a01b031681565b34801561066857600080fd5b50610313611d91565b34801561067d57600080fd5b506103c461068c366004615215565b611e1f565b34801561069d57600080fd5b50610378611ea5565b3480156106b257600080fd5b506103786106c1366004615215565b611eb9565b3480156106d257600080fd5b50610378611f91565b3480156106e757600080fd5b506103c46106f6366004614f01565b612070565b34801561070757600080fd5b50600c54610340906001600160a01b031681565b34801561072757600080fd5b50610378610736366004615215565b6120fa565b34801561074757600080fd5b50600a546001600160a01b0316610340565b34801561076557600080fd5b506103136121a1565b34801561077a57600080fd5b506103c4610789366004614f01565b600e6020526000908152604090205481565b3480156107a757600080fd5b506103786107b6366004615565565b6121b0565b3480156107c757600080fd5b506103786107d6366004615635565b6121bf565b3480156107e757600080fd5b506104e96107f6366004614f01565b612246565b34801561080757600080fd5b50610378610816366004615565565b6123c6565b34801561082757600080fd5b50610378610836366004615652565b61247c565b34801561084757600080fd5b506103c46108563660046156d1565b6124fa565b34801561086757600080fd5b50610313610876366004614f01565b61267f565b34801561088757600080fd5b506102ee6108963660046156d1565b6001600160a01b03918216600090815260056020908152604080832093909416825291909152205460ff1690565b3480156108d057600080fd5b506103406108df366004614f01565b6126e6565b3480156108f057600080fd5b50610340612768565b34801561090557600080fd5b50610378610914366004615215565b61278b565b34801561092557600080fd5b50610378610934366004615285565b612801565b610941614ea9565b61094a826129a0565b1561095b57610958826129bd565b90505b919050565b60006001600160e01b0319821663152a902d60e11b148061099157506001600160e01b0319821663089be4bb60e11b145b80610958575061095882612b1f565b6060600080546109af906156ff565b80601f01602080910402602001604051908101604052809291908181526020018280546109db906156ff565b8015610a285780601f106109fd57610100808354040283529160200191610a28565b820191906000526020600020905b815481529060010190602001808311610a0b57829003601f168201915b5050505050905090565b6000610a3d82612b44565b506000908152600460205260409020546001600160a01b031690565b6000610a6482611d31565b9050806001600160a01b0316836001600160a01b031603610ad65760405162461bcd60e51b815260206004820152602160248201527f4552433732313a20617070726f76616c20746f2063757272656e74206f776e656044820152603960f91b60648201526084015b60405180910390fd5b336001600160a01b0382161480610af25750610af28133610896565b610b645760405162461bcd60e51b815260206004820152603d60248201527f4552433732313a20617070726f76652063616c6c6572206973206e6f7420746f60448201527f6b656e206f776e6572206f7220617070726f76656420666f7220616c6c0000006064820152608401610acd565b610b6e8383612b94565b505050565b600080610b96610b926001600080516020615e2c83398151915261574f565b5490565b90506001600160a01b038116610c2157333014610bec5760405162461bcd60e51b81526020600482015260146024820152731a5b9d985b1a59081b999d0818dbdb9d1c9858dd60621b6044820152606401610acd565b610c11858785610c0557610c008989612c02565b613281565b610c00888a89896130e7565b630a85bd0160e11b915050610d62565b604051631bf8659f60e21b815234906001600160a01b03831690636fe1967c90610c569033906000903690879060040161578b565b600060405180830381600087803b158015610c7057600080fd5b505af1158015610c84573d6000803e3d6000fd5b50503330149150610cd090505760405162461bcd60e51b81526020600482015260146024820152731a5b9d985b1a59081b999d0818dbdb9d1c9858dd60621b6044820152606401610acd565b610cf0868886610ce457610c008a8a612c02565b610c00898b8a8a6130e7565b6040516393163a9160e01b8152630a85bd0160e11b93506001600160a01b038316906393163a9190610d2d9033906000903690879060040161578b565b600060405180830381600087803b158015610d4757600080fd5b505af1158015610d5b573d6000803e3d6000fd5b5050505050505b95945050505050565b846000610d9960017fbee718c342db2a725c831b0c655757cef911f31a4454aacc1b8b75f39bda09a961574f565b6040805160208101929092526001600160a01b0384169082015260600160405160208183030381529060405280519060200120905060008060001b610ddc835490565b1415905080610e3b5760405162461bcd60e51b815260206004820152602560248201527f4669726577616c6c436f6e73756d65723a204e6f7420617070726f7665642074604482015264185c99d95d60da1b6064820152608401610acd565b610e4c83630c908cff60e01b6133e1565b610e5557600080fd5b6000886001600160a01b03168888604051610e719291906157c1565b6000604051808303816000865af19150503d8060008114610eae576040519150601f19603f3d011682016040523d82523d6000602084013e610eb3565b606091505b5050905080610ec157600080fd5b610f013087878080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061346692505050565b50505050505050505050565b610f17338261348b565b610f7d5760405162461bcd60e51b815260206004820152603160248201527f4552433732313a207472616e736665722063616c6c6572206973206e6f74206f6044820152701ddb995c881b9bdc88185c1c1c9bdd9959607a1b6064820152608401610acd565b610b6e83838360405180602001604052806000815250613509565b600080610fb7610b926001600080516020615e2c83398151915261574f565b90506001600160a01b03811661111d5782610fd18161353c565b6001600160a01b0381163314610fea57610fea3361353c565b86610ff48161359c565b86610ffe8161359c565b86611008816135f2565b6110128a88613642565b600c5460405163095ea7b360e01b81526001600160a01b039182166004820152602481018b90529197508a169063095ea7b3906044016020604051808303816000875af1158015611067573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061108b91906157d1565b50600c546040516305a131fb60e41b81526001600160a01b038b81166004830152602482018b905290911690635a131fb0906044016020604051808303816000875af11580156110df573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061110391906157ee565b6000878152600e60205260409020555061133b9350505050565b604051631bf8659f60e21b815234906001600160a01b03831690636fe1967c906111529033906000903690879060040161578b565b600060405180830381600087803b15801561116c57600080fd5b505af1158015611180573d6000803e3d6000fd5b505050508361118e8161353c565b6001600160a01b03811633146111a7576111a73361353c565b876111b18161359c565b876111bb8161359c565b876111c5816135f2565b6111cf8b89613642565b600c5460405163095ea7b360e01b81526001600160a01b039182166004820152602481018c90529198508b169063095ea7b3906044016020604051808303816000875af1158015611224573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061124891906157d1565b50600c546040516305a131fb60e41b81526001600160a01b038c81166004830152602482018c905290911690635a131fb0906044016020604051808303816000875af115801561129c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112c091906157ee565b6000888152600e60205260408082209290925590516393163a9160e01b81526001600160a01b03881695506393163a91945061130693503392503690879060040161578b565b600060405180830381600087803b15801561132057600080fd5b505af1158015611334573d6000803e3d6000fd5b5050505050505b949350505050565b600c546000838152600e602052604080822054905163152a902d60e11b8152600481019190915260248101849052909182916001600160a01b0390911690632a55205a906044016040805180830381865afa1580156113a6573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113ca9190615807565b909590945092505050565b60006113e083611e1f565b82106114425760405162461bcd60e51b815260206004820152602b60248201527f455243373231456e756d657261626c653a206f776e657220696e646578206f7560448201526a74206f6620626f756e647360a81b6064820152608401610acd565b506001600160a01b03821660009081526006602090815260408083208484529091529020545b92915050565b611476613789565b6040516000198152600080516020615e93833981519152906020015b60405180910390a1565b6060818311156114de5760405162461bcd60e51b815260206004820152600d60248201526c496e76616c69642072616e676560981b6044820152606401610acd565b6114e986868661162e565b82106115425760405162461bcd60e51b815260206004820152602260248201527f52616e67652067726561746572207468616e207573657220706f6f6c20636f756044820152611b9d60f21b6064820152608401610acd565b61154c838361574f565b611557906001615835565b6001600160401b0381111561156e5761156e615409565b6040519080825280602002602001820160405280156115a757816020015b611594614ea9565b81526020019060019003908161158c5790505b5090506000835b8381116116085760006115c3898989856118c7565b90506115ce81610939565b84846115d981615848565b9550815181106115eb576115eb615861565b6020026020010181905250508061160190615848565b90506115ae565b505095945050505050565b610b6e8383836040518060200160405280600081525061247c565b60008061163a85611e1f565b905060005b818110156116ab5761169285858080602002602001604051908101604052809392919081815260200183836020028082843760009201919091525061168d92506108df91508a9050856113d5565b6137e3565b156116a3576116a083615848565b92505b60010161163f565b50509392505050565b60006116bf60085490565b82106117225760405162461bcd60e51b815260206004820152602c60248201527f455243373231456e756d657261626c653a20676c6f62616c20696e646578206f60448201526b7574206f6620626f756e647360a01b6064820152608401610acd565b6008828154811061173557611735615861565b90600052602060002001549050919050565b61174f613789565b806040516020016117609190615877565b60405160208183030381529060405280519060200120600b6040516020016117889190615893565b60405160208183030381529060405280519060200120036117eb5760405162461bcd60e51b815260206004820152601a60248201527f63616e277420736574207468652073616d6520626173655552490000000000006044820152606401610acd565b6000600b80546117fa906156ff565b80601f0160208091040260200160405190810160405280929190818152602001828054611826906156ff565b80156118735780601f1061184857610100808354040283529160200191611873565b820191906000526020600020905b81548152906001019060200180831161185657829003601f168201915b5050505050905081600b90816118899190615959565b507fc41b7cb64e5be01af4afc2641afc861432136270f4206b7773f229b658b9669981836040516118bb929190615a18565b60405180910390a15050565b6000806118d586868661162e565b90508083106119385760405162461bcd60e51b815260206004820152602960248201527f696e76616c696420706f6f6c496420696e64657820627920746f6b656e20617360448201526839b7b1b4b0ba34b7b760b91b6064820152608401610acd565b600061194387611e1f565b90506000805b828110156119cb5761195b89826113d5565b945061199f88888080602002602001604051908101604052809392919081815260200183836020028082843760009201919091525061168d92508991506126e69050565b80156119b5575085826119b181615848565b9350145b156119c3575050505061133b565b600101611949565b50505050949350505050565b6119df613789565b816119e98161383e565b6001600160a01b038316600081815260106020908152604091829020805460ff191686151590811790915591519182527f2f5b19bb75097659707b1df69ba629ec7e5acfe3f775e362b8750d854037de02910160405180910390a2505050565b600080611a68610b926001600080516020615e2c83398151915261574f565b90506001600160a01b038116611b6b5784611a828161353c565b6001600160a01b0381163314611a9b57611a9b3361353c565b89611aa58161359c565b89611aaf8161359c565b88611ab9816135f2565b611ac38d8a613642565b9550600c60009054906101000a90046001600160a01b03166001600160a01b031663285ee3388d8c8e8c8c6040518663ffffffff1660e01b8152600401611b0e959493929190615a3d565b6020604051808303816000875af1158015611b2d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611b5191906157ee565b6000878152600e602052604090205550611d269350505050565b604051631bf8659f60e21b815234906001600160a01b03831690636fe1967c90611ba09033906000903690879060040161578b565b600060405180830381600087803b158015611bba57600080fd5b505af1158015611bce573d6000803e3d6000fd5b5050505085611bdc8161353c565b6001600160a01b0381163314611bf557611bf53361353c565b8a611bff8161359c565b8a611c098161359c565b89611c13816135f2565b611c1d8e8b613642565b9650600c60009054906101000a90046001600160a01b03166001600160a01b031663285ee3388e8d8f8d8d6040518663ffffffff1660e01b8152600401611c68959493929190615a3d565b6020604051808303816000875af1158015611c87573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611cab91906157ee565b6000888152600e60205260408082209290925590516393163a9160e01b81526001600160a01b03881695506393163a919450611cf193503392503690879060040161578b565b600060405180830381600087803b158015611d0b57600080fd5b505af1158015611d1f573d6000803e3d6000fd5b5050505050505b979650505050505050565b6000818152600260205260408120546001600160a01b0316806114685760405162461bcd60e51b8152602060048201526018602482015277115490cdcc8c4e881a5b9d985b1a59081d1bdad95b88125160421b6044820152606401610acd565b600b8054611d9e906156ff565b80601f0160208091040260200160405190810160405280929190818152602001828054611dca906156ff565b8015611e175780601f10611dec57610100808354040283529160200191611e17565b820191906000526020600020905b815481529060010190602001808311611dfa57829003601f168201915b505050505081565b60006001600160a01b038216611e895760405162461bcd60e51b815260206004820152602960248201527f4552433732313a2061646472657373207a65726f206973206e6f7420612076616044820152683634b21037bbb732b960b91b6064820152608401610acd565b506001600160a01b031660009081526003602052604090205490565b611ead613789565b611eb76000613895565b565b611ed5610b926001600080516020615e7383398151915261574f565b6001600160a01b0316336001600160a01b031614611f055760405162461bcd60e51b8152600401610acd90615a71565b6001600160a01b038116611f5b5760405162461bcd60e51b815260206004820152601e60248201527f4669726577616c6c436f6e73756d65723a207a65726f206164647265737300006044820152606401610acd565b611f8e611f8960017f8583d637b7eb6415d11ef26648cf0702cf161a357dfe51b6ff7a332110d4bdd361574f565b829055565b50565b611fbf610b9260017f8583d637b7eb6415d11ef26648cf0702cf161a357dfe51b6ff7a332110d4bdd361574f565b6001600160a01b0316336001600160a01b03161461201f5760405162461bcd60e51b815260206004820152601f60248201527f4669726577616c6c436f6e73756d65723a206e6f74206e65772061646d696e006044820152606401610acd565b61204061203b6001600080516020615e7383398151915261574f565b339055565b6040513381527f2763a008a9a724a5da2f35346041f5c552001ab556d786252e1ff4ff798dfc1b90602001611492565b600061207b826129a0565b1561095b576000828152600d6020526040908190205490516321d7d0e160e21b8152600481018490526001600160a01b039091169063875f438490602401602060405180830381865afa1580156120d6573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061095891906157ee565b612116610b926001600080516020615e7383398151915261574f565b6001600160a01b0316336001600160a01b0316146121465760405162461bcd60e51b8152600401610acd90615a71565b612162611f896001600080516020615e2c83398151915261574f565b6040516001600160a01b03821681527f60c1452966d777aab347837b9ceeaa613af32925b5aab43918e878fd036086709060200160405180910390a150565b6060600180546109af906156ff565b6121bb3383836138e7565b5050565b336000908152600f602052604090205481151560ff9091161515036122265760405162461bcd60e51b815260206004820152601c60248201527f737461747573206973207468652073616d65206173206265666f7265000000006044820152606401610acd565b336000908152600f60205260409020805460ff1916911515919091179055565b6060612251826129a0565b1561095b576000828152600d602052604080822054905163d1438c3f60e01b8152600481018590526001600160a01b039091169063d1438c3f90602401600060405180830381865afa1580156122ab573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526122d39190810190615ab5565b90506000815160016122e59190615835565b9050806001600160401b038111156122ff576122ff615409565b60405190808252806020026020018201604052801561233857816020015b612325614ea9565b81526020019060019003908161231d5790505b509250612344846129bd565b8360008151811061235757612357615861565b602090810291909101015260015b818110156123be576123998361237c60018461574f565b8151811061238c5761238c615861565b60200260200101516129bd565b8482815181106123ab576123ab615861565b6020908102919091010152600101612365565b505050919050565b6123e2610b926001600080516020615e7383398151915261574f565b6001600160a01b0316336001600160a01b0316146124125760405162461bcd60e51b8152600401610acd90615a71565b600061243f60017fbee718c342db2a725c831b0c655757cef911f31a4454aacc1b8b75f39bda09a961574f565b6040805160208101929092526001600160a01b03851690820152606001604051602081830303815290604052805190602001209050818155505050565b612486338361348b565b6124e85760405162461bcd60e51b815260206004820152602d60248201527f4552433732313a2063616c6c6572206973206e6f7420746f6b656e206f776e6560448201526c1c881bdc88185c1c1c9bdd9959609a1b6064820152608401610acd565b6124f484848484613509565b50505050565b600080612519610b926001600080516020615e2c83398151915261574f565b90506001600160a01b03811661256a57826125338161353c565b6001600160a01b038116331461254c5761254c3361353c565b846125568161359c565b6125608686613642565b9350505050611468565b604051631bf8659f60e21b815234906001600160a01b03831690636fe1967c9061259f9033906000903690879060040161578b565b600060405180830381600087803b1580156125b957600080fd5b505af11580156125cd573d6000803e3d6000fd5b50505050836125db8161353c565b6001600160a01b03811633146125f4576125f43361353c565b856125fe8161359c565b6126088787613642565b94505050816001600160a01b03166393163a916126223390565b600036856040518563ffffffff1660e01b8152600401612645949392919061578b565b600060405180830381600087803b15801561265f57600080fd5b505af1158015612673573d6000803e3d6000fd5b50505050505092915050565b606061268a82612b44565b60006126946139b5565b905060008151116126b457604051806020016040528060008152506126df565b806126be846139c4565b6040516020016126cf929190615b5a565b6040516020818303038152906040525b9392505050565b600c546000828152600e6020526040808220549051633378358b60e01b815291926001600160a01b031691633378358b916127279160040190815260200190565b602060405180830381865afa158015612744573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109589190615b89565b6000612786610b926001600080516020615e7383398151915261574f565b905090565b612793613789565b6001600160a01b0381166127f85760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610acd565b611f8e81613895565b600061281f610b926001600080516020615e2c83398151915261574f565b90506001600160a01b03811661288257336128398161353c565b6001600160a01b0381163314612852576128523361353c565b8361285c81613a56565b8361286681613a56565b505050600091825250600e602052604080822054928252902055565b604051631bf8659f60e21b815234906001600160a01b03831690636fe1967c906128b79033906000903690879060040161578b565b600060405180830381600087803b1580156128d157600080fd5b505af11580156128e5573d6000803e3d6000fd5b50505050336128f38161353c565b6001600160a01b038116331461290c5761290c3361353c565b8461291681613a56565b8461292081613a56565b5050506000838152600e60205260408082205486835281832055516393163a9160e01b81526001600160a01b038416916393163a91916129689133913690879060040161578b565b600060405180830381600087803b15801561298257600080fd5b505af1158015612996573d6000803e3d6000fd5b5050505050505050565b6000908152600260205260409020546001600160a01b0316151590565b6129c5614ea9565b6000828152600d6020908152604080832054815160e0810183526001600160a01b0390911680825282516306fdde0360e01b815292519094919384019285926306fdde03926004808401938290030181865afa158015612a29573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052612a519190810190615ba6565b8152602001848152602001600e6000868152602001908152602001600020548152602001612a7e85611d31565b6001600160a01b03168152602001612a95856126e6565b6001600160a01b03168152602001826001600160a01b03166308a4f072866040518263ffffffff1660e01b8152600401612ad191815260200190565b600060405180830381865afa158015612aee573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052612b169190810190615ab5565b90529392505050565b60006001600160e01b0319821663780e9d6360e01b1480610958575061095882613aa1565b612b4d816129a0565b611f8e5760405162461bcd60e51b8152602060048201526018602482015277115490cdcc8c4e881a5b9d985b1a59081d1bdad95b88125160421b6044820152606401610acd565b600081815260046020526040902080546001600160a01b0319166001600160a01b0384169081179091558190612bc982611d31565b6001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b600063b790a77b60e01b81612c29610b926001600080516020615e2c83398151915261574f565b90506001600160a01b038116612e0a576000848152600d6020526040808220549051632e1a7d4d60e01b8152600481018790526001600160a01b03909116908190632e1a7d4d9060240160408051808303816000875af1158015612c91573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612cb59190615c13565b95509150612cca816326f2a43f60e01b613af1565b15612df7576040516326f2a43f60e01b8152600481018790526000925082906001600160a01b038316906326f2a43f906024016000604051808303816000875af1158015612d1c573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052612d449190810190615ab5565b905060005b8151811015612df4576000828281518110612d6657612d66615861565b60209081029190910181015160008b8152600d9092526040909120549091506001600160a01b0316612d9782611d31565b6001600160a01b031614612de05760405162461bcd60e51b815260206004820152601060248201526f1a5b9d985b1a59081a5b9b995c881a5960821b6044820152606401610acd565b612dea8a82612c02565b5050600101612d49565b50505b612e02868389613b0d565b5050506130e0565b60003490506001600160a01b038216636fe1967c3385604051602001612e309190615c38565b604051602081830303815290604052846040518463ffffffff1660e01b8152600401612e5e93929190615c4d565b600060405180830381600087803b158015612e7857600080fd5b505af1158015612e8c573d6000803e3d6000fd5b5050506000868152600d6020526040808220549051632e1a7d4d60e01b8152600481018990529192506001600160a01b0316908190632e1a7d4d9060240160408051808303816000875af1158015612ee8573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612f0c9190615c13565b96509150612f21816326f2a43f60e01b613af1565b1561304e576040516326f2a43f60e01b8152600481018890526000925082906001600160a01b038316906326f2a43f906024016000604051808303816000875af1158015612f73573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052612f9b9190810190615ab5565b905060005b815181101561304b576000828281518110612fbd57612fbd615861565b60209081029190910181015160008c8152600d9092526040909120549091506001600160a01b0316612fee82611d31565b6001600160a01b0316146130375760405162461bcd60e51b815260206004820152601060248201526f1a5b9d985b1a59081a5b9b995c881a5960821b6044820152606401610acd565b6130418b82612c02565b5050600101612fa0565b50505b61305987838a613b0d565b50506001600160a01b0382166393163a91335b8560405160200161307d9190615c38565b604051602081830303815290604052846040518463ffffffff1660e01b81526004016130ab93929190615c4d565b600060405180830381600087803b1580156130c557600080fd5b505af11580156130d9573d6000803e3d6000fd5b5050505050505b5092915050565b6000630ba35c4960e11b8161310e610b926001600080516020615e2c83398151915261574f565b90506001600160a01b0381166131465760008061312c87878a613e35565b9150915061313c89898484613e6b565b9450505050613278565b60003490506001600160a01b038216636fe1967c338560405160200161316c9190615c38565b604051602081830303815290604052846040518463ffffffff1660e01b815260040161319a93929190615c4d565b600060405180830381600087803b1580156131b457600080fd5b505af11580156131c8573d6000803e3d6000fd5b505050506000806131da88888b613e35565b915091506131ea8a8a8484613e6b565b95505050816001600160a01b03166393163a916132043390565b856040516020016132159190615c38565b604051602081830303815290604052846040518463ffffffff1660e01b815260040161324393929190615c4d565b600060405180830381600087803b15801561325d57600080fd5b505af1158015613271573d6000803e3d6000fd5b5050505050505b50949350505050565b631d50d0db60e01b60006132a7610b926001600080516020615e2c83398151915261574f565b90506001600160a01b0381166132cd57826132c7576132c7308587614110565b506124f4565b60003490506001600160a01b038216636fe1967c33856040516020016132f39190615c38565b604051602081830303815290604052846040518463ffffffff1660e01b815260040161332193929190615c4d565b600060405180830381600087803b15801561333b57600080fd5b505af115801561334f573d6000803e3d6000fd5b505050508361336357613363308688614110565b6001600160a01b0382166393163a91335b856040516020016133859190615c38565b604051602081830303815290604052846040518463ffffffff1660e01b81526004016133b393929190615c4d565b600060405180830381600087803b1580156133cd57600080fd5b505af1158015610f01573d6000803e3d6000fd5b604080516001600160e01b03198316602480830191909152825180830390910181526044909101909152602080820180516001600160e01b03166301ffc9a760e01b178152825160009392849283928392918391908a617530fa92503d91506000519050828015613453575060208210155b8015611d26575015159695505050505050565b60606126df8383604051806060016040528060278152602001615e4c60279139614588565b60008061349783611d31565b9050806001600160a01b0316846001600160a01b031614806134de57506001600160a01b0380821660009081526005602090815260408083209388168352929052205460ff165b8061133b5750836001600160a01b03166134f784610a32565b6001600160a01b031614949350505050565b613514848484614110565b61352084848484614600565b6124f45760405162461bcd60e51b8152600401610acd90615c81565b6001600160a01b03811660009081526010602052604090205460ff16611f8e5760405162461bcd60e51b815260206004820152601560248201527410dbdb9d1c9858dd081b9bdd08185c1c1c9bdd9959605a1b6044820152606401610acd565b6001600160a01b038116611f8e5760405162461bcd60e51b815260206004820152601b60248201527f5a65726f2041646472657373206973206e6f7420616c6c6f77656400000000006044820152606401610acd565b60008111611f8e5760405162461bcd60e51b815260206004820152601d60248201527f616d6f756e74206d7573742062652067726561746572207468616e20300000006044820152606401610acd565b6000630f266b9160e21b81613669610b926001600080516020615e2c83398151915261574f565b90506001600160a01b0381166136b557600854925061368885846146fe565b506000828152600d6020526040902080546001600160a01b0319166001600160a01b0385161790556130e0565b60003490506001600160a01b038216636fe1967c33856040516020016136db9190615c38565b604051602081830303815290604052846040518463ffffffff1660e01b815260040161370993929190615c4d565b600060405180830381600087803b15801561372357600080fd5b505af1158015613737573d6000803e3d6000fd5b5050505061374460085490565b935061375086856146fe565b6000848152600d6020526040902080546001600160a01b0319166001600160a01b038781169190911790915582166393163a913361306c565b600a546001600160a01b03163314611eb75760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610acd565b6000805b835181101561383457826001600160a01b031684828151811061380c5761380c615861565b60200260200101516001600160a01b03160361382c576001915050611468565b6001016137e7565b5060009392505050565b6001600160a01b0381163b611f8e5760405162461bcd60e51b815260206004820152601860248201527f496e76616c696420636f6e7472616374206164647265737300000000000000006044820152606401610acd565b600a80546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b816001600160a01b0316836001600160a01b0316036139485760405162461bcd60e51b815260206004820152601960248201527f4552433732313a20617070726f766520746f2063616c6c6572000000000000006044820152606401610acd565b6001600160a01b03838116600081815260056020908152604080832094871680845294825291829020805460ff191686151590811790915591519182527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a3505050565b6060600b80546109af906156ff565b606060006139d183614718565b60010190506000816001600160401b038111156139f0576139f0615409565b6040519080825280601f01601f191660200182016040528015613a1a576020820181803683370190505b5090508181016020015b600019016f181899199a1a9b1b9c1cb0b131b232b360811b600a86061a8153600a8504945084613a2457509392505050565b613a5f816129a0565b611f8e5760405162461bcd60e51b8152602060048201526013602482015272141bdbdb08191bd95cc81b9bdd08195e1a5cdd606a1b6044820152606401610acd565b60006001600160e01b031982166380ac58cd60e01b1480613ad257506001600160e01b03198216635b5e139f60e01b145b8061095857506301ffc9a760e01b6001600160e01b0319831614610958565b6000613afc836147f0565b80156126df57506126df83836133e1565b6305d6a92f60e01b6000613b33610b926001600080516020615e2c83398151915261574f565b90506001600160a01b038116613c705783156132c757600c546000868152600e602052604090819020549051631f62fca760e21b815260048101919091526001600160a01b0385811660248301526044820187905290911690637d8bf29c90606401600060405180830381600087803b158015613baf57600080fd5b505af1158015613bc3573d6000803e3d6000fd5b50505050600080516020615e9383398151915285604051613be691815260200190565b60405180910390a1826001600160a01b03167faa7132423a39dd83fa4078bd4d7b7d0d0d614b9837f0fd5d23e1afd9aa9bc29d8686613c24896129bd565b60c00151600081518110613c3a57613c3a615861565b6020026020010151604051613c62939291909283526020830191909152604082015260600190565b60405180910390a2506124f4565b60003490506001600160a01b038216636fe1967c3385604051602001613c969190615c38565b604051602081830303815290604052846040518463ffffffff1660e01b8152600401613cc493929190615c4d565b600060405180830381600087803b158015613cde57600080fd5b505af1158015613cf2573d6000803e3d6000fd5b50505050600085111561336357600c546000878152600e602052604090819020549051631f62fca760e21b815260048101919091526001600160a01b0386811660248301526044820188905290911690637d8bf29c90606401600060405180830381600087803b158015613d6557600080fd5b505af1158015613d79573d6000803e3d6000fd5b50505050600080516020615e9383398151915286604051613d9c91815260200190565b60405180910390a1836001600160a01b03167faa7132423a39dd83fa4078bd4d7b7d0d0d614b9837f0fd5d23e1afd9aa9bc29d8787613dda8a6129bd565b60c00151600081518110613df057613df0615861565b6020026020010151604051613e18939291909283526020830191909152604082015260600190565b60405180910390a26001600160a01b0382166393163a9133613374565b60008060208414613e5157613e4c84860186615cd3565b613e5f565b613e5d84860186614f01565b835b90969095509350505050565b600081613e778161359c565b83613e81816135f2565b683635c9adc5dea00000851115613ed25760405162461bcd60e51b81526020600482015260156024820152741cdc1b1a5d08185b5bdd5b9d08195e18d959591959605a1b6044820152606401610acd565b60408051808201909152600080825260208201526000888152600d60205260409020546001600160a01b0316808252613f0c908690613642565b602082810191825260008a8152600e90915260408082205483518352918190209190915582519151905163caf0887d60e01b8152600481018b90526024810191909152604481018890526001600160a01b039091169063caf0887d90606401600060405180830381600087803b158015613f8557600080fd5b505af1158015613f99573d6000803e3d6000fd5b50508251604051630452783960e11b8152600481018c90526001600160a01b0390911692506308a4f0729150602401600060405180830381865afa158015613fe5573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405261400d9190810190615ab5565b60008151811061401f5761401f615861565b602002602001015160001493506000614037896129bd565b60c0015160008151811061404d5761404d615861565b60200260200101519050856001600160a01b0316886001600160a01b03167ffdcb522eed2b51337da9525342f1aba4b128316db8c3d89a3c8095b88a35ec598b8560200151856140a088602001516129bd565b60c001516000815181106140b6576140b6615861565b6020908102919091018101516040805195865291850193909352830152606082015260800160405180910390a3604051898152600080516020615e938339815191529060200160405180910390a150505050949350505050565b6318703c4f60e11b6000614136610b926001600080516020615e2c83398151915261574f565b90506001600160a01b038116614324576001600160a01b0385161580159061418257506000838152600d6020526040902054614182906001600160a01b0316631ffb811f60e01b613af1565b15614203576000838152600d602052604090819020549051631ffb811f60e01b81526001600160a01b03878116600483015286811660248301526044820186905290911690631ffb811f90606401600060405180830381600087803b1580156141ea57600080fd5b505af11580156141fe573d6000803e3d6000fd5b505050505b6001600160a01b03841660009081526010602052604090205460ff168061424257506001600160a01b03851660009081526010602052604090205460ff165b614319576001600160a01b0385166000908152600f602052604090205460ff1661427e5760405162461bcd60e51b8152600401610acd90615cf8565b600c546000848152600e602052604090819020549051632b2b4da960e21b8152600481019190915242916001600160a01b03169063acad36a490602401602060405180830381865afa1580156142d8573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906142fc91906157ee565b106143195760405162461bcd60e51b8152600401610acd90615d3a565b6132c7858585614823565b60003490506001600160a01b038216636fe1967c338560405160200161434a9190615c38565b604051602081830303815290604052846040518463ffffffff1660e01b815260040161437893929190615c4d565b600060405180830381600087803b15801561439257600080fd5b505af11580156143a6573d6000803e3d6000fd5b505050506001600160a01b038616158015906143e657506000848152600d60205260409020546143e6906001600160a01b0316631ffb811f60e01b613af1565b15614467576000848152600d602052604090819020549051631ffb811f60e01b81526001600160a01b03888116600483015287811660248301526044820187905290911690631ffb811f90606401600060405180830381600087803b15801561444e57600080fd5b505af1158015614462573d6000803e3d6000fd5b505050505b6001600160a01b03851660009081526010602052604090205460ff16806144a657506001600160a01b03861660009081526010602052604090205460ff165b61457d576001600160a01b0386166000908152600f602052604090205460ff166144e25760405162461bcd60e51b8152600401610acd90615cf8565b600c546000858152600e602052604090819020549051632b2b4da960e21b8152600481019190915242916001600160a01b03169063acad36a490602401602060405180830381865afa15801561453c573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061456091906157ee565b1061457d5760405162461bcd60e51b8152600401610acd90615d3a565b613363868686614823565b6060600080856001600160a01b0316856040516145a59190615877565b600060405180830381855af49150503d80600081146145e0576040519150601f19603f3d011682016040523d82523d6000602084013e6145e5565b606091505b50915091506145f686838387614994565b9695505050505050565b60006001600160a01b0384163b156146f657604051630a85bd0160e11b81526001600160a01b0385169063150b7a0290614644903390899088908890600401615d80565b6020604051808303816000875af192505050801561467f575060408051601f3d908101601f1916820190925261467c91810190615db3565b60015b6146dc573d8080156146ad576040519150601f19603f3d011682016040523d82523d6000602084013e6146b2565b606091505b5080516000036146d45760405162461bcd60e51b8152600401610acd90615c81565b805181602001fd5b6001600160e01b031916630a85bd0160e11b14905061133b565b50600161133b565b6121bb828260405180602001604052806000815250614a0d565b60008072184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b83106147575772184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b830492506040015b6d04ee2d6d415b85acef81000000008310614783576d04ee2d6d415b85acef8100000000830492506020015b662386f26fc1000083106147a157662386f26fc10000830492506010015b6305f5e10083106147b9576305f5e100830492506008015b61271083106147cd57612710830492506004015b606483106147df576064830492506002015b600a83106114685760010192915050565b6000614803826301ffc9a760e01b6133e1565b8015610958575061481c826001600160e01b03196133e1565b1592915050565b826001600160a01b031661483682611d31565b6001600160a01b03161461485c5760405162461bcd60e51b8152600401610acd90615dd0565b6001600160a01b0382166148be5760405162461bcd60e51b8152602060048201526024808201527f4552433732313a207472616e7366657220746f20746865207a65726f206164646044820152637265737360e01b6064820152608401610acd565b6148cb8383836001614a40565b826001600160a01b03166148de82611d31565b6001600160a01b0316146149045760405162461bcd60e51b8152600401610acd90615dd0565b600081815260046020908152604080832080546001600160a01b03199081169091556001600160a01b0387811680865260038552838620805460001901905590871680865283862080546001019055868652600290945282852080549092168417909155905184937fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef91a4505050565b60608315614a035782516000036149fc576001600160a01b0385163b6149fc5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610acd565b508161133b565b61133b8383614b74565b614a178383614b9e565b614a246000848484614600565b610b6e5760405162461bcd60e51b8152600401610acd90615c81565b6001811115614aaf5760405162461bcd60e51b815260206004820152603560248201527f455243373231456e756d657261626c653a20636f6e7365637574697665207472604482015274185b9cd9995c9cc81b9bdd081cdd5c1c1bdc9d1959605a1b6064820152608401610acd565b816001600160a01b038516614b0b57614b0681600880546000838152600960205260408120829055600182018355919091527ff3f7a9fe364faab93b216da50a3214154f22a0a2b415b23a84c8169e8b636ee30155565b614b2e565b836001600160a01b0316856001600160a01b031614614b2e57614b2e8582614d19565b6001600160a01b038416614b4a57614b4581614db6565b614b6d565b846001600160a01b0316846001600160a01b031614614b6d57614b6d8482614e65565b5050505050565b815115614b845781518083602001fd5b8060405162461bcd60e51b8152600401610acd9190615055565b6001600160a01b038216614bf45760405162461bcd60e51b815260206004820181905260248201527f4552433732313a206d696e7420746f20746865207a65726f20616464726573736044820152606401610acd565b614bfd816129a0565b15614c4a5760405162461bcd60e51b815260206004820152601c60248201527f4552433732313a20746f6b656e20616c7265616479206d696e746564000000006044820152606401610acd565b614c58600083836001614a40565b614c61816129a0565b15614cae5760405162461bcd60e51b815260206004820152601c60248201527f4552433732313a20746f6b656e20616c7265616479206d696e746564000000006044820152606401610acd565b6001600160a01b038216600081815260036020908152604080832080546001019055848352600290915280822080546001600160a01b0319168417905551839291907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a45050565b60006001614d2684611e1f565b614d30919061574f565b600083815260076020526040902054909150808214614d83576001600160a01b03841660009081526006602090815260408083208584528252808320548484528184208190558352600790915290208190555b5060009182526007602090815260408084208490556001600160a01b039094168352600681528383209183525290812055565b600854600090614dc89060019061574f565b60008381526009602052604081205460088054939450909284908110614df057614df0615861565b906000526020600020015490508060088381548110614e1157614e11615861565b6000918252602080832090910192909255828152600990915260408082208490558582528120556008805480614e4957614e49615e15565b6001900381819060005260206000200160009055905550505050565b6000614e7083611e1f565b6001600160a01b039093166000908152600660209081526040808320868452825280832085905593825260079052919091209190915550565b6040518060e0016040528060006001600160a01b0316815260200160608152602001600081526020016000815260200160006001600160a01b0316815260200160006001600160a01b03168152602001606081525090565b600060208284031215614f1357600080fd5b5035919050565b60005b83811015614f35578181015183820152602001614f1d565b50506000910152565b60008151808452614f56816020860160208601614f1a565b601f01601f19169290920160200192915050565b600060018060a01b0380835116845260208084015160e082870152614f9260e0870182614f3e565b905060408501516040870152606085015160608701528260808601511660808701528260a08601511660a087015260c0850151925085810360c087015280835180835283830191508385019450600092505b808310156150045784518252938301936001929092019190830190614fe4565b509695505050505050565b6020815260006126df6020830184614f6a565b6001600160e01b031981168114611f8e57600080fd5b60006020828403121561504a57600080fd5b81356126df81615022565b6020815260006126df6020830184614f3e565b6001600160a01b0381168114611f8e57600080fd5b6000806040838503121561509057600080fd5b823561509b81615068565b946020939093013593505050565b60008083601f8401126150bb57600080fd5b5081356001600160401b038111156150d257600080fd5b6020830191508360208285010111156150ea57600080fd5b9250929050565b60008060008060006080868803121561510957600080fd5b853561511481615068565b9450602086013561512481615068565b93506040860135925060608601356001600160401b0381111561514657600080fd5b615152888289016150a9565b969995985093965092949392505050565b60008060008060006060868803121561517b57600080fd5b853561518681615068565b945060208601356001600160401b03808211156151a257600080fd5b6151ae89838a016150a9565b909650945060408801359150808211156151c757600080fd5b50615152888289016150a9565b6000806000606084860312156151e957600080fd5b83356151f481615068565b9250602084013561520481615068565b929592945050506040919091013590565b60006020828403121561522757600080fd5b81356126df81615068565b6000806000806080858703121561524857600080fd5b843561525381615068565b9350602085013561526381615068565b925060408501359150606085013561527a81615068565b939692955090935050565b6000806040838503121561529857600080fd5b50508035926020909101359150565b60008083601f8401126152b957600080fd5b5081356001600160401b038111156152d057600080fd5b6020830191508360208260051b85010111156150ea57600080fd5b60008060008060006080868803121561530357600080fd5b853561530e81615068565b945060208601356001600160401b0381111561532957600080fd5b615335888289016152a7565b9699909850959660408101359660609091013595509350505050565b600060208083016020845280855180835260408601915060408160051b87010192506020870160005b828110156153a857603f19888603018452615396858351614f6a565b9450928501929085019060010161537a565b5092979650505050505050565b6000806000604084860312156153ca57600080fd5b83356153d581615068565b925060208401356001600160401b038111156153f057600080fd5b6153fc868287016152a7565b9497909650939450505050565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f191681016001600160401b038111828210171561544757615447615409565b604052919050565b60006001600160401b0382111561546857615468615409565b50601f01601f191660200190565b60006154896154848461544f565b61541f565b905082815283838301111561549d57600080fd5b828260208301376000602084830101529392505050565b6000602082840312156154c657600080fd5b81356001600160401b038111156154dc57600080fd5b8201601f810184136154ed57600080fd5b61133b84823560208401615476565b6000806000806060858703121561551257600080fd5b843561551d81615068565b935060208501356001600160401b0381111561553857600080fd5b615544878288016152a7565b9598909750949560400135949350505050565b8015158114611f8e57600080fd5b6000806040838503121561557857600080fd5b823561558381615068565b9150602083013561559381615557565b809150509250929050565b600080600080600080600060c0888a0312156155b957600080fd5b87356155c481615068565b965060208801356155d481615068565b955060408801356155e481615068565b94506060880135935060808801356155fb81615068565b925060a08801356001600160401b0381111561561657600080fd5b6156228a828b016150a9565b989b979a50959850939692959293505050565b60006020828403121561564757600080fd5b81356126df81615557565b6000806000806080858703121561566857600080fd5b843561567381615068565b9350602085013561568381615068565b92506040850135915060608501356001600160401b038111156156a557600080fd5b8501601f810187136156b657600080fd5b6156c587823560208401615476565b91505092959194509250565b600080604083850312156156e457600080fd5b82356156ef81615068565b9150602083013561559381615068565b600181811c9082168061571357607f821691505b60208210810361573357634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052601160045260246000fd5b8181038181111561146857611468615739565b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b6001600160a01b03851681526060602082018190526000906157b09083018587615762565b905082604083015295945050505050565b8183823760009101908152919050565b6000602082840312156157e357600080fd5b81516126df81615557565b60006020828403121561580057600080fd5b5051919050565b6000806040838503121561581a57600080fd5b825161582581615068565b6020939093015192949293505050565b8082018082111561146857611468615739565b60006001820161585a5761585a615739565b5060010190565b634e487b7160e01b600052603260045260246000fd5b60008251615889818460208701614f1a565b9190910192915050565b60008083546158a1816156ff565b600182811680156158b957600181146158ce576158fd565b60ff19841687528215158302870194506158fd565b8760005260208060002060005b858110156158f45781548a8201529084019082016158db565b50505082870194505b50929695505050505050565b601f821115610b6e576000816000526020600020601f850160051c810160208610156159325750805b601f850160051c820191505b818110156159515782815560010161593e565b505050505050565b81516001600160401b0381111561597257615972615409565b6159868161598084546156ff565b84615909565b602080601f8311600181146159bb57600084156159a35750858301515b600019600386901b1c1916600185901b178555615951565b600085815260208120601f198616915b828110156159ea578886015182559484019460019091019084016159cb565b5085821015615a085787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b604081526000615a2b6040830185614f3e565b8281036020840152610d628185614f3e565b6001600160a01b0386811682526020820186905284166040820152608060608201819052600090611d269083018486615762565b60208082526024908201527f4669726577616c6c436f6e73756d65723a206e6f74206669726577616c6c20616040820152633236b4b760e11b606082015260800190565b60006020808385031215615ac857600080fd5b82516001600160401b0380821115615adf57600080fd5b818501915085601f830112615af357600080fd5b815181811115615b0557615b05615409565b8060051b9150615b1684830161541f565b8181529183018401918481019088841115615b3057600080fd5b938501935b83851015615b4e57845182529385019390850190615b35565b98975050505050505050565b60008351615b6c818460208801614f1a565b835190830190615b80818360208801614f1a565b01949350505050565b600060208284031215615b9b57600080fd5b81516126df81615068565b600060208284031215615bb857600080fd5b81516001600160401b03811115615bce57600080fd5b8201601f81018413615bdf57600080fd5b8051615bed6154848261544f565b818152856020838501011115615c0257600080fd5b610d62826020830160208601614f1a565b60008060408385031215615c2657600080fd5b82519150602083015161559381615557565b6001600160e01b031991909116815260040190565b6001600160a01b0384168152606060208201819052600090615c7190830185614f3e565b9050826040830152949350505050565b60208082526032908201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560408201527131b2b4bb32b91034b6b83632b6b2b73a32b960711b606082015260800190565b60008060408385031215615ce657600080fd5b82359150602083013561559381615068565b60208082526022908201527f506f6f6c207472616e73666572206e6f7420617070726f76656420627920757360408201526132b960f11b606082015260800190565b60208082526026908201527f43616e2774207472616e73666572206265666f72652074726164652073746172604082015265742074696d6560d01b606082015260800190565b6001600160a01b03858116825284166020820152604081018390526080606082018190526000906145f690830184614f3e565b600060208284031215615dc557600080fd5b81516126df81615022565b60208082526025908201527f4552433732313a207472616e736665722066726f6d20696e636f72726563742060408201526437bbb732b960d91b606082015260800190565b634e487b7160e01b600052603160045260246000fdfe5dd2e3b890564a8f99f7f203f226a27a8aa59aee19a4ece5cf5eaa77ab91f662416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c656429982a6ac507a2a707ced6dee5d76285dd49725db977de83d9702c628c974136f8e1a15aba9398e019f0b49df1a4fde98ee17ae345cb5f6b5e2c27f5033e8ce7a2646970667358221220d91a3418ae526cb2e7dd32fc099fdf7619f3de84f2caec6463ce8dece29c133064736f6c634300081800330000000000000000000000009ff1db30c66cd9d3311b4b22da49791610922b1300000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000000
Deployed Bytecode
0x6080604052600436106102935760003560e01c8063665579381161015a578063a22cb465116100c1578063c87b56dd1161007a578063c87b56dd1461085b578063e985e9c51461087b578063ea78803f146108c4578063f05c8582146108e4578063f2fde38b146108f9578063fde914b41461091957600080fd5b8063a22cb4651461079b578063afa7688d146107bb578063b27abb06146107db578063b7f9a748146107fb578063b88d4fde1461081b578063bfbed3501461083b57600080fd5b8063875f438411610113578063875f4384146106db5780638a4adf24146106fb5780638c36d02d1461071b5780638da5cb5b1461073b57806395d89b41146107595780639bd51bfd1461076e57600080fd5b806366557938146106265780636c0360eb1461065c57806370a0823114610671578063715018a614610691578063734b7198146106a65780637c65c38b146106c657600080fd5b80632f745c59116101fe5780634f6ccce7116101b75780634f6ccce71461056657806355f804b3146105865780635c2bd9de146105a65780635ffd993b146105c6578063604e38ed146105e65780636352211e1461060657600080fd5b80632f745c591461049457806338c52df0146104b457806340a4376e146104c957806342842e0e146104f65780634aa3ab93146105165780634e17f2971461053657600080fd5b806318160ddd1161025057806318160ddd146103b35780631a8828f4146103d257806323b872dd146103e557806326749ad71461040557806327608c36146104355780632a55205a1461045557600080fd5b80630178fe3f1461029857806301ffc9a7146102ce57806306fdde03146102fe578063081812fc14610320578063095ea7b314610358578063150b7a021461037a575b600080fd5b3480156102a457600080fd5b506102b86102b3366004614f01565b610939565b6040516102c5919061500f565b60405180910390f35b3480156102da57600080fd5b506102ee6102e9366004615038565b610960565b60405190151581526020016102c5565b34801561030a57600080fd5b506103136109a0565b6040516102c59190615055565b34801561032c57600080fd5b5061034061033b366004614f01565b610a32565b6040516001600160a01b0390911681526020016102c5565b34801561036457600080fd5b5061037861037336600461507d565b610a59565b005b34801561038657600080fd5b5061039a6103953660046150f1565b610b73565b6040516001600160e01b031990911681526020016102c5565b3480156103bf57600080fd5b506008545b6040519081526020016102c5565b6103786103e0366004615163565b610d6b565b3480156103f157600080fd5b506103786104003660046151d4565b610f0d565b34801561041157600080fd5b506102ee610420366004615215565b60106020526000908152604090205460ff1681565b34801561044157600080fd5b506103c4610450366004615232565b610f98565b34801561046157600080fd5b50610475610470366004615285565b611343565b604080516001600160a01b0390931683526020830191909152016102c5565b3480156104a057600080fd5b506103c46104af36600461507d565b6113d5565b3480156104c057600080fd5b5061037861146e565b3480156104d557600080fd5b506104e96104e43660046152eb565b61149c565b6040516102c59190615351565b34801561050257600080fd5b506103786105113660046151d4565b611613565b34801561052257600080fd5b506103c46105313660046153b5565b61162e565b34801561054257600080fd5b506102ee610551366004615215565b600f6020526000908152604090205460ff1681565b34801561057257600080fd5b506103c4610581366004614f01565b6116b4565b34801561059257600080fd5b506103786105a13660046154b4565b611747565b3480156105b257600080fd5b506103c46105c13660046154fc565b6118c7565b3480156105d257600080fd5b506103786105e1366004615565565b6119d7565b3480156105f257600080fd5b506103c461060136600461559e565b611a49565b34801561061257600080fd5b50610340610621366004614f01565b611d31565b34801561063257600080fd5b50610340610641366004614f01565b600d602052600090815260409020546001600160a01b031681565b34801561066857600080fd5b50610313611d91565b34801561067d57600080fd5b506103c461068c366004615215565b611e1f565b34801561069d57600080fd5b50610378611ea5565b3480156106b257600080fd5b506103786106c1366004615215565b611eb9565b3480156106d257600080fd5b50610378611f91565b3480156106e757600080fd5b506103c46106f6366004614f01565b612070565b34801561070757600080fd5b50600c54610340906001600160a01b031681565b34801561072757600080fd5b50610378610736366004615215565b6120fa565b34801561074757600080fd5b50600a546001600160a01b0316610340565b34801561076557600080fd5b506103136121a1565b34801561077a57600080fd5b506103c4610789366004614f01565b600e6020526000908152604090205481565b3480156107a757600080fd5b506103786107b6366004615565565b6121b0565b3480156107c757600080fd5b506103786107d6366004615635565b6121bf565b3480156107e757600080fd5b506104e96107f6366004614f01565b612246565b34801561080757600080fd5b50610378610816366004615565565b6123c6565b34801561082757600080fd5b50610378610836366004615652565b61247c565b34801561084757600080fd5b506103c46108563660046156d1565b6124fa565b34801561086757600080fd5b50610313610876366004614f01565b61267f565b34801561088757600080fd5b506102ee6108963660046156d1565b6001600160a01b03918216600090815260056020908152604080832093909416825291909152205460ff1690565b3480156108d057600080fd5b506103406108df366004614f01565b6126e6565b3480156108f057600080fd5b50610340612768565b34801561090557600080fd5b50610378610914366004615215565b61278b565b34801561092557600080fd5b50610378610934366004615285565b612801565b610941614ea9565b61094a826129a0565b1561095b57610958826129bd565b90505b919050565b60006001600160e01b0319821663152a902d60e11b148061099157506001600160e01b0319821663089be4bb60e11b145b80610958575061095882612b1f565b6060600080546109af906156ff565b80601f01602080910402602001604051908101604052809291908181526020018280546109db906156ff565b8015610a285780601f106109fd57610100808354040283529160200191610a28565b820191906000526020600020905b815481529060010190602001808311610a0b57829003601f168201915b5050505050905090565b6000610a3d82612b44565b506000908152600460205260409020546001600160a01b031690565b6000610a6482611d31565b9050806001600160a01b0316836001600160a01b031603610ad65760405162461bcd60e51b815260206004820152602160248201527f4552433732313a20617070726f76616c20746f2063757272656e74206f776e656044820152603960f91b60648201526084015b60405180910390fd5b336001600160a01b0382161480610af25750610af28133610896565b610b645760405162461bcd60e51b815260206004820152603d60248201527f4552433732313a20617070726f76652063616c6c6572206973206e6f7420746f60448201527f6b656e206f776e6572206f7220617070726f76656420666f7220616c6c0000006064820152608401610acd565b610b6e8383612b94565b505050565b600080610b96610b926001600080516020615e2c83398151915261574f565b5490565b90506001600160a01b038116610c2157333014610bec5760405162461bcd60e51b81526020600482015260146024820152731a5b9d985b1a59081b999d0818dbdb9d1c9858dd60621b6044820152606401610acd565b610c11858785610c0557610c008989612c02565b613281565b610c00888a89896130e7565b630a85bd0160e11b915050610d62565b604051631bf8659f60e21b815234906001600160a01b03831690636fe1967c90610c569033906000903690879060040161578b565b600060405180830381600087803b158015610c7057600080fd5b505af1158015610c84573d6000803e3d6000fd5b50503330149150610cd090505760405162461bcd60e51b81526020600482015260146024820152731a5b9d985b1a59081b999d0818dbdb9d1c9858dd60621b6044820152606401610acd565b610cf0868886610ce457610c008a8a612c02565b610c00898b8a8a6130e7565b6040516393163a9160e01b8152630a85bd0160e11b93506001600160a01b038316906393163a9190610d2d9033906000903690879060040161578b565b600060405180830381600087803b158015610d4757600080fd5b505af1158015610d5b573d6000803e3d6000fd5b5050505050505b95945050505050565b846000610d9960017fbee718c342db2a725c831b0c655757cef911f31a4454aacc1b8b75f39bda09a961574f565b6040805160208101929092526001600160a01b0384169082015260600160405160208183030381529060405280519060200120905060008060001b610ddc835490565b1415905080610e3b5760405162461bcd60e51b815260206004820152602560248201527f4669726577616c6c436f6e73756d65723a204e6f7420617070726f7665642074604482015264185c99d95d60da1b6064820152608401610acd565b610e4c83630c908cff60e01b6133e1565b610e5557600080fd5b6000886001600160a01b03168888604051610e719291906157c1565b6000604051808303816000865af19150503d8060008114610eae576040519150601f19603f3d011682016040523d82523d6000602084013e610eb3565b606091505b5050905080610ec157600080fd5b610f013087878080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061346692505050565b50505050505050505050565b610f17338261348b565b610f7d5760405162461bcd60e51b815260206004820152603160248201527f4552433732313a207472616e736665722063616c6c6572206973206e6f74206f6044820152701ddb995c881b9bdc88185c1c1c9bdd9959607a1b6064820152608401610acd565b610b6e83838360405180602001604052806000815250613509565b600080610fb7610b926001600080516020615e2c83398151915261574f565b90506001600160a01b03811661111d5782610fd18161353c565b6001600160a01b0381163314610fea57610fea3361353c565b86610ff48161359c565b86610ffe8161359c565b86611008816135f2565b6110128a88613642565b600c5460405163095ea7b360e01b81526001600160a01b039182166004820152602481018b90529197508a169063095ea7b3906044016020604051808303816000875af1158015611067573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061108b91906157d1565b50600c546040516305a131fb60e41b81526001600160a01b038b81166004830152602482018b905290911690635a131fb0906044016020604051808303816000875af11580156110df573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061110391906157ee565b6000878152600e60205260409020555061133b9350505050565b604051631bf8659f60e21b815234906001600160a01b03831690636fe1967c906111529033906000903690879060040161578b565b600060405180830381600087803b15801561116c57600080fd5b505af1158015611180573d6000803e3d6000fd5b505050508361118e8161353c565b6001600160a01b03811633146111a7576111a73361353c565b876111b18161359c565b876111bb8161359c565b876111c5816135f2565b6111cf8b89613642565b600c5460405163095ea7b360e01b81526001600160a01b039182166004820152602481018c90529198508b169063095ea7b3906044016020604051808303816000875af1158015611224573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061124891906157d1565b50600c546040516305a131fb60e41b81526001600160a01b038c81166004830152602482018c905290911690635a131fb0906044016020604051808303816000875af115801561129c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112c091906157ee565b6000888152600e60205260408082209290925590516393163a9160e01b81526001600160a01b03881695506393163a91945061130693503392503690879060040161578b565b600060405180830381600087803b15801561132057600080fd5b505af1158015611334573d6000803e3d6000fd5b5050505050505b949350505050565b600c546000838152600e602052604080822054905163152a902d60e11b8152600481019190915260248101849052909182916001600160a01b0390911690632a55205a906044016040805180830381865afa1580156113a6573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113ca9190615807565b909590945092505050565b60006113e083611e1f565b82106114425760405162461bcd60e51b815260206004820152602b60248201527f455243373231456e756d657261626c653a206f776e657220696e646578206f7560448201526a74206f6620626f756e647360a81b6064820152608401610acd565b506001600160a01b03821660009081526006602090815260408083208484529091529020545b92915050565b611476613789565b6040516000198152600080516020615e93833981519152906020015b60405180910390a1565b6060818311156114de5760405162461bcd60e51b815260206004820152600d60248201526c496e76616c69642072616e676560981b6044820152606401610acd565b6114e986868661162e565b82106115425760405162461bcd60e51b815260206004820152602260248201527f52616e67652067726561746572207468616e207573657220706f6f6c20636f756044820152611b9d60f21b6064820152608401610acd565b61154c838361574f565b611557906001615835565b6001600160401b0381111561156e5761156e615409565b6040519080825280602002602001820160405280156115a757816020015b611594614ea9565b81526020019060019003908161158c5790505b5090506000835b8381116116085760006115c3898989856118c7565b90506115ce81610939565b84846115d981615848565b9550815181106115eb576115eb615861565b6020026020010181905250508061160190615848565b90506115ae565b505095945050505050565b610b6e8383836040518060200160405280600081525061247c565b60008061163a85611e1f565b905060005b818110156116ab5761169285858080602002602001604051908101604052809392919081815260200183836020028082843760009201919091525061168d92506108df91508a9050856113d5565b6137e3565b156116a3576116a083615848565b92505b60010161163f565b50509392505050565b60006116bf60085490565b82106117225760405162461bcd60e51b815260206004820152602c60248201527f455243373231456e756d657261626c653a20676c6f62616c20696e646578206f60448201526b7574206f6620626f756e647360a01b6064820152608401610acd565b6008828154811061173557611735615861565b90600052602060002001549050919050565b61174f613789565b806040516020016117609190615877565b60405160208183030381529060405280519060200120600b6040516020016117889190615893565b60405160208183030381529060405280519060200120036117eb5760405162461bcd60e51b815260206004820152601a60248201527f63616e277420736574207468652073616d6520626173655552490000000000006044820152606401610acd565b6000600b80546117fa906156ff565b80601f0160208091040260200160405190810160405280929190818152602001828054611826906156ff565b80156118735780601f1061184857610100808354040283529160200191611873565b820191906000526020600020905b81548152906001019060200180831161185657829003601f168201915b5050505050905081600b90816118899190615959565b507fc41b7cb64e5be01af4afc2641afc861432136270f4206b7773f229b658b9669981836040516118bb929190615a18565b60405180910390a15050565b6000806118d586868661162e565b90508083106119385760405162461bcd60e51b815260206004820152602960248201527f696e76616c696420706f6f6c496420696e64657820627920746f6b656e20617360448201526839b7b1b4b0ba34b7b760b91b6064820152608401610acd565b600061194387611e1f565b90506000805b828110156119cb5761195b89826113d5565b945061199f88888080602002602001604051908101604052809392919081815260200183836020028082843760009201919091525061168d92508991506126e69050565b80156119b5575085826119b181615848565b9350145b156119c3575050505061133b565b600101611949565b50505050949350505050565b6119df613789565b816119e98161383e565b6001600160a01b038316600081815260106020908152604091829020805460ff191686151590811790915591519182527f2f5b19bb75097659707b1df69ba629ec7e5acfe3f775e362b8750d854037de02910160405180910390a2505050565b600080611a68610b926001600080516020615e2c83398151915261574f565b90506001600160a01b038116611b6b5784611a828161353c565b6001600160a01b0381163314611a9b57611a9b3361353c565b89611aa58161359c565b89611aaf8161359c565b88611ab9816135f2565b611ac38d8a613642565b9550600c60009054906101000a90046001600160a01b03166001600160a01b031663285ee3388d8c8e8c8c6040518663ffffffff1660e01b8152600401611b0e959493929190615a3d565b6020604051808303816000875af1158015611b2d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611b5191906157ee565b6000878152600e602052604090205550611d269350505050565b604051631bf8659f60e21b815234906001600160a01b03831690636fe1967c90611ba09033906000903690879060040161578b565b600060405180830381600087803b158015611bba57600080fd5b505af1158015611bce573d6000803e3d6000fd5b5050505085611bdc8161353c565b6001600160a01b0381163314611bf557611bf53361353c565b8a611bff8161359c565b8a611c098161359c565b89611c13816135f2565b611c1d8e8b613642565b9650600c60009054906101000a90046001600160a01b03166001600160a01b031663285ee3388e8d8f8d8d6040518663ffffffff1660e01b8152600401611c68959493929190615a3d565b6020604051808303816000875af1158015611c87573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611cab91906157ee565b6000888152600e60205260408082209290925590516393163a9160e01b81526001600160a01b03881695506393163a919450611cf193503392503690879060040161578b565b600060405180830381600087803b158015611d0b57600080fd5b505af1158015611d1f573d6000803e3d6000fd5b5050505050505b979650505050505050565b6000818152600260205260408120546001600160a01b0316806114685760405162461bcd60e51b8152602060048201526018602482015277115490cdcc8c4e881a5b9d985b1a59081d1bdad95b88125160421b6044820152606401610acd565b600b8054611d9e906156ff565b80601f0160208091040260200160405190810160405280929190818152602001828054611dca906156ff565b8015611e175780601f10611dec57610100808354040283529160200191611e17565b820191906000526020600020905b815481529060010190602001808311611dfa57829003601f168201915b505050505081565b60006001600160a01b038216611e895760405162461bcd60e51b815260206004820152602960248201527f4552433732313a2061646472657373207a65726f206973206e6f7420612076616044820152683634b21037bbb732b960b91b6064820152608401610acd565b506001600160a01b031660009081526003602052604090205490565b611ead613789565b611eb76000613895565b565b611ed5610b926001600080516020615e7383398151915261574f565b6001600160a01b0316336001600160a01b031614611f055760405162461bcd60e51b8152600401610acd90615a71565b6001600160a01b038116611f5b5760405162461bcd60e51b815260206004820152601e60248201527f4669726577616c6c436f6e73756d65723a207a65726f206164647265737300006044820152606401610acd565b611f8e611f8960017f8583d637b7eb6415d11ef26648cf0702cf161a357dfe51b6ff7a332110d4bdd361574f565b829055565b50565b611fbf610b9260017f8583d637b7eb6415d11ef26648cf0702cf161a357dfe51b6ff7a332110d4bdd361574f565b6001600160a01b0316336001600160a01b03161461201f5760405162461bcd60e51b815260206004820152601f60248201527f4669726577616c6c436f6e73756d65723a206e6f74206e65772061646d696e006044820152606401610acd565b61204061203b6001600080516020615e7383398151915261574f565b339055565b6040513381527f2763a008a9a724a5da2f35346041f5c552001ab556d786252e1ff4ff798dfc1b90602001611492565b600061207b826129a0565b1561095b576000828152600d6020526040908190205490516321d7d0e160e21b8152600481018490526001600160a01b039091169063875f438490602401602060405180830381865afa1580156120d6573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061095891906157ee565b612116610b926001600080516020615e7383398151915261574f565b6001600160a01b0316336001600160a01b0316146121465760405162461bcd60e51b8152600401610acd90615a71565b612162611f896001600080516020615e2c83398151915261574f565b6040516001600160a01b03821681527f60c1452966d777aab347837b9ceeaa613af32925b5aab43918e878fd036086709060200160405180910390a150565b6060600180546109af906156ff565b6121bb3383836138e7565b5050565b336000908152600f602052604090205481151560ff9091161515036122265760405162461bcd60e51b815260206004820152601c60248201527f737461747573206973207468652073616d65206173206265666f7265000000006044820152606401610acd565b336000908152600f60205260409020805460ff1916911515919091179055565b6060612251826129a0565b1561095b576000828152600d602052604080822054905163d1438c3f60e01b8152600481018590526001600160a01b039091169063d1438c3f90602401600060405180830381865afa1580156122ab573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526122d39190810190615ab5565b90506000815160016122e59190615835565b9050806001600160401b038111156122ff576122ff615409565b60405190808252806020026020018201604052801561233857816020015b612325614ea9565b81526020019060019003908161231d5790505b509250612344846129bd565b8360008151811061235757612357615861565b602090810291909101015260015b818110156123be576123998361237c60018461574f565b8151811061238c5761238c615861565b60200260200101516129bd565b8482815181106123ab576123ab615861565b6020908102919091010152600101612365565b505050919050565b6123e2610b926001600080516020615e7383398151915261574f565b6001600160a01b0316336001600160a01b0316146124125760405162461bcd60e51b8152600401610acd90615a71565b600061243f60017fbee718c342db2a725c831b0c655757cef911f31a4454aacc1b8b75f39bda09a961574f565b6040805160208101929092526001600160a01b03851690820152606001604051602081830303815290604052805190602001209050818155505050565b612486338361348b565b6124e85760405162461bcd60e51b815260206004820152602d60248201527f4552433732313a2063616c6c6572206973206e6f7420746f6b656e206f776e6560448201526c1c881bdc88185c1c1c9bdd9959609a1b6064820152608401610acd565b6124f484848484613509565b50505050565b600080612519610b926001600080516020615e2c83398151915261574f565b90506001600160a01b03811661256a57826125338161353c565b6001600160a01b038116331461254c5761254c3361353c565b846125568161359c565b6125608686613642565b9350505050611468565b604051631bf8659f60e21b815234906001600160a01b03831690636fe1967c9061259f9033906000903690879060040161578b565b600060405180830381600087803b1580156125b957600080fd5b505af11580156125cd573d6000803e3d6000fd5b50505050836125db8161353c565b6001600160a01b03811633146125f4576125f43361353c565b856125fe8161359c565b6126088787613642565b94505050816001600160a01b03166393163a916126223390565b600036856040518563ffffffff1660e01b8152600401612645949392919061578b565b600060405180830381600087803b15801561265f57600080fd5b505af1158015612673573d6000803e3d6000fd5b50505050505092915050565b606061268a82612b44565b60006126946139b5565b905060008151116126b457604051806020016040528060008152506126df565b806126be846139c4565b6040516020016126cf929190615b5a565b6040516020818303038152906040525b9392505050565b600c546000828152600e6020526040808220549051633378358b60e01b815291926001600160a01b031691633378358b916127279160040190815260200190565b602060405180830381865afa158015612744573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109589190615b89565b6000612786610b926001600080516020615e7383398151915261574f565b905090565b612793613789565b6001600160a01b0381166127f85760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610acd565b611f8e81613895565b600061281f610b926001600080516020615e2c83398151915261574f565b90506001600160a01b03811661288257336128398161353c565b6001600160a01b0381163314612852576128523361353c565b8361285c81613a56565b8361286681613a56565b505050600091825250600e602052604080822054928252902055565b604051631bf8659f60e21b815234906001600160a01b03831690636fe1967c906128b79033906000903690879060040161578b565b600060405180830381600087803b1580156128d157600080fd5b505af11580156128e5573d6000803e3d6000fd5b50505050336128f38161353c565b6001600160a01b038116331461290c5761290c3361353c565b8461291681613a56565b8461292081613a56565b5050506000838152600e60205260408082205486835281832055516393163a9160e01b81526001600160a01b038416916393163a91916129689133913690879060040161578b565b600060405180830381600087803b15801561298257600080fd5b505af1158015612996573d6000803e3d6000fd5b5050505050505050565b6000908152600260205260409020546001600160a01b0316151590565b6129c5614ea9565b6000828152600d6020908152604080832054815160e0810183526001600160a01b0390911680825282516306fdde0360e01b815292519094919384019285926306fdde03926004808401938290030181865afa158015612a29573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052612a519190810190615ba6565b8152602001848152602001600e6000868152602001908152602001600020548152602001612a7e85611d31565b6001600160a01b03168152602001612a95856126e6565b6001600160a01b03168152602001826001600160a01b03166308a4f072866040518263ffffffff1660e01b8152600401612ad191815260200190565b600060405180830381865afa158015612aee573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052612b169190810190615ab5565b90529392505050565b60006001600160e01b0319821663780e9d6360e01b1480610958575061095882613aa1565b612b4d816129a0565b611f8e5760405162461bcd60e51b8152602060048201526018602482015277115490cdcc8c4e881a5b9d985b1a59081d1bdad95b88125160421b6044820152606401610acd565b600081815260046020526040902080546001600160a01b0319166001600160a01b0384169081179091558190612bc982611d31565b6001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b600063b790a77b60e01b81612c29610b926001600080516020615e2c83398151915261574f565b90506001600160a01b038116612e0a576000848152600d6020526040808220549051632e1a7d4d60e01b8152600481018790526001600160a01b03909116908190632e1a7d4d9060240160408051808303816000875af1158015612c91573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612cb59190615c13565b95509150612cca816326f2a43f60e01b613af1565b15612df7576040516326f2a43f60e01b8152600481018790526000925082906001600160a01b038316906326f2a43f906024016000604051808303816000875af1158015612d1c573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052612d449190810190615ab5565b905060005b8151811015612df4576000828281518110612d6657612d66615861565b60209081029190910181015160008b8152600d9092526040909120549091506001600160a01b0316612d9782611d31565b6001600160a01b031614612de05760405162461bcd60e51b815260206004820152601060248201526f1a5b9d985b1a59081a5b9b995c881a5960821b6044820152606401610acd565b612dea8a82612c02565b5050600101612d49565b50505b612e02868389613b0d565b5050506130e0565b60003490506001600160a01b038216636fe1967c3385604051602001612e309190615c38565b604051602081830303815290604052846040518463ffffffff1660e01b8152600401612e5e93929190615c4d565b600060405180830381600087803b158015612e7857600080fd5b505af1158015612e8c573d6000803e3d6000fd5b5050506000868152600d6020526040808220549051632e1a7d4d60e01b8152600481018990529192506001600160a01b0316908190632e1a7d4d9060240160408051808303816000875af1158015612ee8573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612f0c9190615c13565b96509150612f21816326f2a43f60e01b613af1565b1561304e576040516326f2a43f60e01b8152600481018890526000925082906001600160a01b038316906326f2a43f906024016000604051808303816000875af1158015612f73573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052612f9b9190810190615ab5565b905060005b815181101561304b576000828281518110612fbd57612fbd615861565b60209081029190910181015160008c8152600d9092526040909120549091506001600160a01b0316612fee82611d31565b6001600160a01b0316146130375760405162461bcd60e51b815260206004820152601060248201526f1a5b9d985b1a59081a5b9b995c881a5960821b6044820152606401610acd565b6130418b82612c02565b5050600101612fa0565b50505b61305987838a613b0d565b50506001600160a01b0382166393163a91335b8560405160200161307d9190615c38565b604051602081830303815290604052846040518463ffffffff1660e01b81526004016130ab93929190615c4d565b600060405180830381600087803b1580156130c557600080fd5b505af11580156130d9573d6000803e3d6000fd5b5050505050505b5092915050565b6000630ba35c4960e11b8161310e610b926001600080516020615e2c83398151915261574f565b90506001600160a01b0381166131465760008061312c87878a613e35565b9150915061313c89898484613e6b565b9450505050613278565b60003490506001600160a01b038216636fe1967c338560405160200161316c9190615c38565b604051602081830303815290604052846040518463ffffffff1660e01b815260040161319a93929190615c4d565b600060405180830381600087803b1580156131b457600080fd5b505af11580156131c8573d6000803e3d6000fd5b505050506000806131da88888b613e35565b915091506131ea8a8a8484613e6b565b95505050816001600160a01b03166393163a916132043390565b856040516020016132159190615c38565b604051602081830303815290604052846040518463ffffffff1660e01b815260040161324393929190615c4d565b600060405180830381600087803b15801561325d57600080fd5b505af1158015613271573d6000803e3d6000fd5b5050505050505b50949350505050565b631d50d0db60e01b60006132a7610b926001600080516020615e2c83398151915261574f565b90506001600160a01b0381166132cd57826132c7576132c7308587614110565b506124f4565b60003490506001600160a01b038216636fe1967c33856040516020016132f39190615c38565b604051602081830303815290604052846040518463ffffffff1660e01b815260040161332193929190615c4d565b600060405180830381600087803b15801561333b57600080fd5b505af115801561334f573d6000803e3d6000fd5b505050508361336357613363308688614110565b6001600160a01b0382166393163a91335b856040516020016133859190615c38565b604051602081830303815290604052846040518463ffffffff1660e01b81526004016133b393929190615c4d565b600060405180830381600087803b1580156133cd57600080fd5b505af1158015610f01573d6000803e3d6000fd5b604080516001600160e01b03198316602480830191909152825180830390910181526044909101909152602080820180516001600160e01b03166301ffc9a760e01b178152825160009392849283928392918391908a617530fa92503d91506000519050828015613453575060208210155b8015611d26575015159695505050505050565b60606126df8383604051806060016040528060278152602001615e4c60279139614588565b60008061349783611d31565b9050806001600160a01b0316846001600160a01b031614806134de57506001600160a01b0380821660009081526005602090815260408083209388168352929052205460ff165b8061133b5750836001600160a01b03166134f784610a32565b6001600160a01b031614949350505050565b613514848484614110565b61352084848484614600565b6124f45760405162461bcd60e51b8152600401610acd90615c81565b6001600160a01b03811660009081526010602052604090205460ff16611f8e5760405162461bcd60e51b815260206004820152601560248201527410dbdb9d1c9858dd081b9bdd08185c1c1c9bdd9959605a1b6044820152606401610acd565b6001600160a01b038116611f8e5760405162461bcd60e51b815260206004820152601b60248201527f5a65726f2041646472657373206973206e6f7420616c6c6f77656400000000006044820152606401610acd565b60008111611f8e5760405162461bcd60e51b815260206004820152601d60248201527f616d6f756e74206d7573742062652067726561746572207468616e20300000006044820152606401610acd565b6000630f266b9160e21b81613669610b926001600080516020615e2c83398151915261574f565b90506001600160a01b0381166136b557600854925061368885846146fe565b506000828152600d6020526040902080546001600160a01b0319166001600160a01b0385161790556130e0565b60003490506001600160a01b038216636fe1967c33856040516020016136db9190615c38565b604051602081830303815290604052846040518463ffffffff1660e01b815260040161370993929190615c4d565b600060405180830381600087803b15801561372357600080fd5b505af1158015613737573d6000803e3d6000fd5b5050505061374460085490565b935061375086856146fe565b6000848152600d6020526040902080546001600160a01b0319166001600160a01b038781169190911790915582166393163a913361306c565b600a546001600160a01b03163314611eb75760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610acd565b6000805b835181101561383457826001600160a01b031684828151811061380c5761380c615861565b60200260200101516001600160a01b03160361382c576001915050611468565b6001016137e7565b5060009392505050565b6001600160a01b0381163b611f8e5760405162461bcd60e51b815260206004820152601860248201527f496e76616c696420636f6e7472616374206164647265737300000000000000006044820152606401610acd565b600a80546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b816001600160a01b0316836001600160a01b0316036139485760405162461bcd60e51b815260206004820152601960248201527f4552433732313a20617070726f766520746f2063616c6c6572000000000000006044820152606401610acd565b6001600160a01b03838116600081815260056020908152604080832094871680845294825291829020805460ff191686151590811790915591519182527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a3505050565b6060600b80546109af906156ff565b606060006139d183614718565b60010190506000816001600160401b038111156139f0576139f0615409565b6040519080825280601f01601f191660200182016040528015613a1a576020820181803683370190505b5090508181016020015b600019016f181899199a1a9b1b9c1cb0b131b232b360811b600a86061a8153600a8504945084613a2457509392505050565b613a5f816129a0565b611f8e5760405162461bcd60e51b8152602060048201526013602482015272141bdbdb08191bd95cc81b9bdd08195e1a5cdd606a1b6044820152606401610acd565b60006001600160e01b031982166380ac58cd60e01b1480613ad257506001600160e01b03198216635b5e139f60e01b145b8061095857506301ffc9a760e01b6001600160e01b0319831614610958565b6000613afc836147f0565b80156126df57506126df83836133e1565b6305d6a92f60e01b6000613b33610b926001600080516020615e2c83398151915261574f565b90506001600160a01b038116613c705783156132c757600c546000868152600e602052604090819020549051631f62fca760e21b815260048101919091526001600160a01b0385811660248301526044820187905290911690637d8bf29c90606401600060405180830381600087803b158015613baf57600080fd5b505af1158015613bc3573d6000803e3d6000fd5b50505050600080516020615e9383398151915285604051613be691815260200190565b60405180910390a1826001600160a01b03167faa7132423a39dd83fa4078bd4d7b7d0d0d614b9837f0fd5d23e1afd9aa9bc29d8686613c24896129bd565b60c00151600081518110613c3a57613c3a615861565b6020026020010151604051613c62939291909283526020830191909152604082015260600190565b60405180910390a2506124f4565b60003490506001600160a01b038216636fe1967c3385604051602001613c969190615c38565b604051602081830303815290604052846040518463ffffffff1660e01b8152600401613cc493929190615c4d565b600060405180830381600087803b158015613cde57600080fd5b505af1158015613cf2573d6000803e3d6000fd5b50505050600085111561336357600c546000878152600e602052604090819020549051631f62fca760e21b815260048101919091526001600160a01b0386811660248301526044820188905290911690637d8bf29c90606401600060405180830381600087803b158015613d6557600080fd5b505af1158015613d79573d6000803e3d6000fd5b50505050600080516020615e9383398151915286604051613d9c91815260200190565b60405180910390a1836001600160a01b03167faa7132423a39dd83fa4078bd4d7b7d0d0d614b9837f0fd5d23e1afd9aa9bc29d8787613dda8a6129bd565b60c00151600081518110613df057613df0615861565b6020026020010151604051613e18939291909283526020830191909152604082015260600190565b60405180910390a26001600160a01b0382166393163a9133613374565b60008060208414613e5157613e4c84860186615cd3565b613e5f565b613e5d84860186614f01565b835b90969095509350505050565b600081613e778161359c565b83613e81816135f2565b683635c9adc5dea00000851115613ed25760405162461bcd60e51b81526020600482015260156024820152741cdc1b1a5d08185b5bdd5b9d08195e18d959591959605a1b6044820152606401610acd565b60408051808201909152600080825260208201526000888152600d60205260409020546001600160a01b0316808252613f0c908690613642565b602082810191825260008a8152600e90915260408082205483518352918190209190915582519151905163caf0887d60e01b8152600481018b90526024810191909152604481018890526001600160a01b039091169063caf0887d90606401600060405180830381600087803b158015613f8557600080fd5b505af1158015613f99573d6000803e3d6000fd5b50508251604051630452783960e11b8152600481018c90526001600160a01b0390911692506308a4f0729150602401600060405180830381865afa158015613fe5573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405261400d9190810190615ab5565b60008151811061401f5761401f615861565b602002602001015160001493506000614037896129bd565b60c0015160008151811061404d5761404d615861565b60200260200101519050856001600160a01b0316886001600160a01b03167ffdcb522eed2b51337da9525342f1aba4b128316db8c3d89a3c8095b88a35ec598b8560200151856140a088602001516129bd565b60c001516000815181106140b6576140b6615861565b6020908102919091018101516040805195865291850193909352830152606082015260800160405180910390a3604051898152600080516020615e938339815191529060200160405180910390a150505050949350505050565b6318703c4f60e11b6000614136610b926001600080516020615e2c83398151915261574f565b90506001600160a01b038116614324576001600160a01b0385161580159061418257506000838152600d6020526040902054614182906001600160a01b0316631ffb811f60e01b613af1565b15614203576000838152600d602052604090819020549051631ffb811f60e01b81526001600160a01b03878116600483015286811660248301526044820186905290911690631ffb811f90606401600060405180830381600087803b1580156141ea57600080fd5b505af11580156141fe573d6000803e3d6000fd5b505050505b6001600160a01b03841660009081526010602052604090205460ff168061424257506001600160a01b03851660009081526010602052604090205460ff165b614319576001600160a01b0385166000908152600f602052604090205460ff1661427e5760405162461bcd60e51b8152600401610acd90615cf8565b600c546000848152600e602052604090819020549051632b2b4da960e21b8152600481019190915242916001600160a01b03169063acad36a490602401602060405180830381865afa1580156142d8573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906142fc91906157ee565b106143195760405162461bcd60e51b8152600401610acd90615d3a565b6132c7858585614823565b60003490506001600160a01b038216636fe1967c338560405160200161434a9190615c38565b604051602081830303815290604052846040518463ffffffff1660e01b815260040161437893929190615c4d565b600060405180830381600087803b15801561439257600080fd5b505af11580156143a6573d6000803e3d6000fd5b505050506001600160a01b038616158015906143e657506000848152600d60205260409020546143e6906001600160a01b0316631ffb811f60e01b613af1565b15614467576000848152600d602052604090819020549051631ffb811f60e01b81526001600160a01b03888116600483015287811660248301526044820187905290911690631ffb811f90606401600060405180830381600087803b15801561444e57600080fd5b505af1158015614462573d6000803e3d6000fd5b505050505b6001600160a01b03851660009081526010602052604090205460ff16806144a657506001600160a01b03861660009081526010602052604090205460ff165b61457d576001600160a01b0386166000908152600f602052604090205460ff166144e25760405162461bcd60e51b8152600401610acd90615cf8565b600c546000858152600e602052604090819020549051632b2b4da960e21b8152600481019190915242916001600160a01b03169063acad36a490602401602060405180830381865afa15801561453c573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061456091906157ee565b1061457d5760405162461bcd60e51b8152600401610acd90615d3a565b613363868686614823565b6060600080856001600160a01b0316856040516145a59190615877565b600060405180830381855af49150503d80600081146145e0576040519150601f19603f3d011682016040523d82523d6000602084013e6145e5565b606091505b50915091506145f686838387614994565b9695505050505050565b60006001600160a01b0384163b156146f657604051630a85bd0160e11b81526001600160a01b0385169063150b7a0290614644903390899088908890600401615d80565b6020604051808303816000875af192505050801561467f575060408051601f3d908101601f1916820190925261467c91810190615db3565b60015b6146dc573d8080156146ad576040519150601f19603f3d011682016040523d82523d6000602084013e6146b2565b606091505b5080516000036146d45760405162461bcd60e51b8152600401610acd90615c81565b805181602001fd5b6001600160e01b031916630a85bd0160e11b14905061133b565b50600161133b565b6121bb828260405180602001604052806000815250614a0d565b60008072184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b83106147575772184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b830492506040015b6d04ee2d6d415b85acef81000000008310614783576d04ee2d6d415b85acef8100000000830492506020015b662386f26fc1000083106147a157662386f26fc10000830492506010015b6305f5e10083106147b9576305f5e100830492506008015b61271083106147cd57612710830492506004015b606483106147df576064830492506002015b600a83106114685760010192915050565b6000614803826301ffc9a760e01b6133e1565b8015610958575061481c826001600160e01b03196133e1565b1592915050565b826001600160a01b031661483682611d31565b6001600160a01b03161461485c5760405162461bcd60e51b8152600401610acd90615dd0565b6001600160a01b0382166148be5760405162461bcd60e51b8152602060048201526024808201527f4552433732313a207472616e7366657220746f20746865207a65726f206164646044820152637265737360e01b6064820152608401610acd565b6148cb8383836001614a40565b826001600160a01b03166148de82611d31565b6001600160a01b0316146149045760405162461bcd60e51b8152600401610acd90615dd0565b600081815260046020908152604080832080546001600160a01b03199081169091556001600160a01b0387811680865260038552838620805460001901905590871680865283862080546001019055868652600290945282852080549092168417909155905184937fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef91a4505050565b60608315614a035782516000036149fc576001600160a01b0385163b6149fc5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610acd565b508161133b565b61133b8383614b74565b614a178383614b9e565b614a246000848484614600565b610b6e5760405162461bcd60e51b8152600401610acd90615c81565b6001811115614aaf5760405162461bcd60e51b815260206004820152603560248201527f455243373231456e756d657261626c653a20636f6e7365637574697665207472604482015274185b9cd9995c9cc81b9bdd081cdd5c1c1bdc9d1959605a1b6064820152608401610acd565b816001600160a01b038516614b0b57614b0681600880546000838152600960205260408120829055600182018355919091527ff3f7a9fe364faab93b216da50a3214154f22a0a2b415b23a84c8169e8b636ee30155565b614b2e565b836001600160a01b0316856001600160a01b031614614b2e57614b2e8582614d19565b6001600160a01b038416614b4a57614b4581614db6565b614b6d565b846001600160a01b0316846001600160a01b031614614b6d57614b6d8482614e65565b5050505050565b815115614b845781518083602001fd5b8060405162461bcd60e51b8152600401610acd9190615055565b6001600160a01b038216614bf45760405162461bcd60e51b815260206004820181905260248201527f4552433732313a206d696e7420746f20746865207a65726f20616464726573736044820152606401610acd565b614bfd816129a0565b15614c4a5760405162461bcd60e51b815260206004820152601c60248201527f4552433732313a20746f6b656e20616c7265616479206d696e746564000000006044820152606401610acd565b614c58600083836001614a40565b614c61816129a0565b15614cae5760405162461bcd60e51b815260206004820152601c60248201527f4552433732313a20746f6b656e20616c7265616479206d696e746564000000006044820152606401610acd565b6001600160a01b038216600081815260036020908152604080832080546001019055848352600290915280822080546001600160a01b0319168417905551839291907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a45050565b60006001614d2684611e1f565b614d30919061574f565b600083815260076020526040902054909150808214614d83576001600160a01b03841660009081526006602090815260408083208584528252808320548484528184208190558352600790915290208190555b5060009182526007602090815260408084208490556001600160a01b039094168352600681528383209183525290812055565b600854600090614dc89060019061574f565b60008381526009602052604081205460088054939450909284908110614df057614df0615861565b906000526020600020015490508060088381548110614e1157614e11615861565b6000918252602080832090910192909255828152600990915260408082208490558582528120556008805480614e4957614e49615e15565b6001900381819060005260206000200160009055905550505050565b6000614e7083611e1f565b6001600160a01b039093166000908152600660209081526040808320868452825280832085905593825260079052919091209190915550565b6040518060e0016040528060006001600160a01b0316815260200160608152602001600081526020016000815260200160006001600160a01b0316815260200160006001600160a01b03168152602001606081525090565b600060208284031215614f1357600080fd5b5035919050565b60005b83811015614f35578181015183820152602001614f1d565b50506000910152565b60008151808452614f56816020860160208601614f1a565b601f01601f19169290920160200192915050565b600060018060a01b0380835116845260208084015160e082870152614f9260e0870182614f3e565b905060408501516040870152606085015160608701528260808601511660808701528260a08601511660a087015260c0850151925085810360c087015280835180835283830191508385019450600092505b808310156150045784518252938301936001929092019190830190614fe4565b509695505050505050565b6020815260006126df6020830184614f6a565b6001600160e01b031981168114611f8e57600080fd5b60006020828403121561504a57600080fd5b81356126df81615022565b6020815260006126df6020830184614f3e565b6001600160a01b0381168114611f8e57600080fd5b6000806040838503121561509057600080fd5b823561509b81615068565b946020939093013593505050565b60008083601f8401126150bb57600080fd5b5081356001600160401b038111156150d257600080fd5b6020830191508360208285010111156150ea57600080fd5b9250929050565b60008060008060006080868803121561510957600080fd5b853561511481615068565b9450602086013561512481615068565b93506040860135925060608601356001600160401b0381111561514657600080fd5b615152888289016150a9565b969995985093965092949392505050565b60008060008060006060868803121561517b57600080fd5b853561518681615068565b945060208601356001600160401b03808211156151a257600080fd5b6151ae89838a016150a9565b909650945060408801359150808211156151c757600080fd5b50615152888289016150a9565b6000806000606084860312156151e957600080fd5b83356151f481615068565b9250602084013561520481615068565b929592945050506040919091013590565b60006020828403121561522757600080fd5b81356126df81615068565b6000806000806080858703121561524857600080fd5b843561525381615068565b9350602085013561526381615068565b925060408501359150606085013561527a81615068565b939692955090935050565b6000806040838503121561529857600080fd5b50508035926020909101359150565b60008083601f8401126152b957600080fd5b5081356001600160401b038111156152d057600080fd5b6020830191508360208260051b85010111156150ea57600080fd5b60008060008060006080868803121561530357600080fd5b853561530e81615068565b945060208601356001600160401b0381111561532957600080fd5b615335888289016152a7565b9699909850959660408101359660609091013595509350505050565b600060208083016020845280855180835260408601915060408160051b87010192506020870160005b828110156153a857603f19888603018452615396858351614f6a565b9450928501929085019060010161537a565b5092979650505050505050565b6000806000604084860312156153ca57600080fd5b83356153d581615068565b925060208401356001600160401b038111156153f057600080fd5b6153fc868287016152a7565b9497909650939450505050565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f191681016001600160401b038111828210171561544757615447615409565b604052919050565b60006001600160401b0382111561546857615468615409565b50601f01601f191660200190565b60006154896154848461544f565b61541f565b905082815283838301111561549d57600080fd5b828260208301376000602084830101529392505050565b6000602082840312156154c657600080fd5b81356001600160401b038111156154dc57600080fd5b8201601f810184136154ed57600080fd5b61133b84823560208401615476565b6000806000806060858703121561551257600080fd5b843561551d81615068565b935060208501356001600160401b0381111561553857600080fd5b615544878288016152a7565b9598909750949560400135949350505050565b8015158114611f8e57600080fd5b6000806040838503121561557857600080fd5b823561558381615068565b9150602083013561559381615557565b809150509250929050565b600080600080600080600060c0888a0312156155b957600080fd5b87356155c481615068565b965060208801356155d481615068565b955060408801356155e481615068565b94506060880135935060808801356155fb81615068565b925060a08801356001600160401b0381111561561657600080fd5b6156228a828b016150a9565b989b979a50959850939692959293505050565b60006020828403121561564757600080fd5b81356126df81615557565b6000806000806080858703121561566857600080fd5b843561567381615068565b9350602085013561568381615068565b92506040850135915060608501356001600160401b038111156156a557600080fd5b8501601f810187136156b657600080fd5b6156c587823560208401615476565b91505092959194509250565b600080604083850312156156e457600080fd5b82356156ef81615068565b9150602083013561559381615068565b600181811c9082168061571357607f821691505b60208210810361573357634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052601160045260246000fd5b8181038181111561146857611468615739565b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b6001600160a01b03851681526060602082018190526000906157b09083018587615762565b905082604083015295945050505050565b8183823760009101908152919050565b6000602082840312156157e357600080fd5b81516126df81615557565b60006020828403121561580057600080fd5b5051919050565b6000806040838503121561581a57600080fd5b825161582581615068565b6020939093015192949293505050565b8082018082111561146857611468615739565b60006001820161585a5761585a615739565b5060010190565b634e487b7160e01b600052603260045260246000fd5b60008251615889818460208701614f1a565b9190910192915050565b60008083546158a1816156ff565b600182811680156158b957600181146158ce576158fd565b60ff19841687528215158302870194506158fd565b8760005260208060002060005b858110156158f45781548a8201529084019082016158db565b50505082870194505b50929695505050505050565b601f821115610b6e576000816000526020600020601f850160051c810160208610156159325750805b601f850160051c820191505b818110156159515782815560010161593e565b505050505050565b81516001600160401b0381111561597257615972615409565b6159868161598084546156ff565b84615909565b602080601f8311600181146159bb57600084156159a35750858301515b600019600386901b1c1916600185901b178555615951565b600085815260208120601f198616915b828110156159ea578886015182559484019460019091019084016159cb565b5085821015615a085787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b604081526000615a2b6040830185614f3e565b8281036020840152610d628185614f3e565b6001600160a01b0386811682526020820186905284166040820152608060608201819052600090611d269083018486615762565b60208082526024908201527f4669726577616c6c436f6e73756d65723a206e6f74206669726577616c6c20616040820152633236b4b760e11b606082015260800190565b60006020808385031215615ac857600080fd5b82516001600160401b0380821115615adf57600080fd5b818501915085601f830112615af357600080fd5b815181811115615b0557615b05615409565b8060051b9150615b1684830161541f565b8181529183018401918481019088841115615b3057600080fd5b938501935b83851015615b4e57845182529385019390850190615b35565b98975050505050505050565b60008351615b6c818460208801614f1a565b835190830190615b80818360208801614f1a565b01949350505050565b600060208284031215615b9b57600080fd5b81516126df81615068565b600060208284031215615bb857600080fd5b81516001600160401b03811115615bce57600080fd5b8201601f81018413615bdf57600080fd5b8051615bed6154848261544f565b818152856020838501011115615c0257600080fd5b610d62826020830160208601614f1a565b60008060408385031215615c2657600080fd5b82519150602083015161559381615557565b6001600160e01b031991909116815260040190565b6001600160a01b0384168152606060208201819052600090615c7190830185614f3e565b9050826040830152949350505050565b60208082526032908201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560408201527131b2b4bb32b91034b6b83632b6b2b73a32b960711b606082015260800190565b60008060408385031215615ce657600080fd5b82359150602083013561559381615068565b60208082526022908201527f506f6f6c207472616e73666572206e6f7420617070726f76656420627920757360408201526132b960f11b606082015260800190565b60208082526026908201527f43616e2774207472616e73666572206265666f72652074726164652073746172604082015265742074696d6560d01b606082015260800190565b6001600160a01b03858116825284166020820152604081018390526080606082018190526000906145f690830184614f3e565b600060208284031215615dc557600080fd5b81516126df81615022565b60208082526025908201527f4552433732313a207472616e736665722066726f6d20696e636f72726563742060408201526437bbb732b960d91b606082015260800190565b634e487b7160e01b600052603160045260246000fdfe5dd2e3b890564a8f99f7f203f226a27a8aa59aee19a4ece5cf5eaa77ab91f662416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c656429982a6ac507a2a707ced6dee5d76285dd49725db977de83d9702c628c974136f8e1a15aba9398e019f0b49df1a4fde98ee17ae345cb5f6b5e2c27f5033e8ce7a2646970667358221220d91a3418ae526cb2e7dd32fc099fdf7619f3de84f2caec6463ce8dece29c133064736f6c63430008180033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
0000000000000000000000009ff1db30c66cd9d3311b4b22da49791610922b1300000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000000
-----Decoded View---------------
Arg [0] : _vaultManager (address): 0x9ff1dB30C66cD9d3311b4B22da49791610922b13
Arg [1] : _baseURI (string):
-----Encoded View---------------
3 Constructor Arguments found :
Arg [0] : 0000000000000000000000009ff1db30c66cd9d3311b4b22da49791610922b13
Arg [1] : 0000000000000000000000000000000000000000000000000000000000000040
Arg [2] : 0000000000000000000000000000000000000000000000000000000000000000
Loading...
Loading
Loading...
Loading
[ Download: CSV Export ]
[ Download: CSV Export ]
A token is a representation of an on-chain or off-chain asset. The token page shows information such as price, total supply, holders, transfers and social links. Learn more about this page in our Knowledge Base.