Warning! Contract bytecode has been changed and doesn't match the verified one. Therefore, interaction with this smart contract may be risky.
- Contract name:
- BNS
- Optimization enabled
- false
- Compiler version
- v0.8.17+commit.8df45f5f
- Verified at
- 2023-07-05T02:30:41.575139Z
contracts/BNS.sol
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "@openzeppelin/contracts-upgradeable/token/ERC721/ERC721Upgradeable.sol"; import "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol"; import "@openzeppelin/contracts/utils/Counters.sol"; // import "./interfaces/IBNS.sol"; // import "./interfaces/IStorage.sol"; error InsufficientRegistrationFee(); error NameAlreadyRegistered(); error AlreadyUpgraded(); error NotOwner(); error PfpTooLarge(); interface IBNS { event NameRegistered(bytes name, uint256 indexed id); event ResolverUpdated(uint256 indexed id, address indexed addr); function register(address owner, bytes memory name) external payable returns (uint256); function registerBatch(address owner, bytes[] memory names) external; function map(uint256 tokenId, address to) external; function minRegistrationFee() external view returns (uint256); function registry(bytes memory name) external view returns (uint256); function registered(bytes memory name) external view returns (bool); function resolver(uint256 tokenId) external view returns (address); } interface IBFS { event FileStored(address indexed addr, string filename, uint256 chunkIndex, uint256 indexed bfsId, string uri); function store(string memory filename, uint256 chunkIndex, bytes memory _data) external; function load(address addr, string memory filename, uint256 chunkIndex) external view returns (bytes memory, int256); function count(address addr, string memory filename) external view returns (uint256); function getId(address addr, string memory filename) external view returns (uint256); function filenames(address addr, uint256 i) external view returns (string memory); function getAllAddresses() external view returns (address[] memory); function getAllFilenames(address addr) external view returns (string[] memory); function loadWithUri(string memory uri, uint256 chunkIndex) external view returns (bytes memory, int256); } contract BNS is IBNS, ERC721Upgradeable, OwnableUpgradeable { using Counters for Counters.Counter; Counters.Counter private _tokenIds; mapping(bytes => uint256) public registry; mapping(bytes => bool) public registered; mapping(uint256 => address) public resolver; uint256 public minRegistrationFee; bytes[] public names; uint256 _version; // v0.3 storage variables uint256 public minPfpFee; IBFS pfpStorage; mapping(uint256 => string) pfps; uint256 constant MAX_PFP_SIZE = 380_000; // event NameRegistered(bytes name, uint256 indexed id); // event ResolverUpdated(uint256 indexed id, address indexed addr); event PfpUpdated(uint256 indexed id, string filename); function initialize() public initializer { __ERC721_init("Bitcoin Name System", "BNS"); __Ownable_init(); } function afterUpgrade() public { if (_version == 4) { _version = 5; } else { revert AlreadyUpgraded(); } } function toLower(bytes memory s) internal pure returns (bytes memory) { bytes memory result = new bytes(s.length); for (uint256 i = 0; i < s.length; i++) { if (uint8(s[i]) >= 65 && uint8(s[i]) <= 90) { // replace A-Z with a-z; will not affect non-ascii characters result[i] = bytes1(uint8(s[i]) + 32); } else { result[i] = s[i]; } } return result; } function register(address owner, bytes memory name) public payable returns (uint256) { name = toLower(name); if (msg.value < minRegistrationFee) revert InsufficientRegistrationFee(); if (registered[name]) revert NameAlreadyRegistered(); uint256 id = _tokenIds.current(); _mint(owner, id); registry[name] = id; registered[name] = true; resolver[id] = owner; names.push(name); emit NameRegistered(name, id); emit ResolverUpdated(id, owner); _tokenIds.increment(); return id; } function registerBatch(address owner, bytes[] memory _names) public { // will revert if any of the names are already registered for (uint256 i = 0; i < _names.length; i++) { register(owner, _names[i]); } } function map(uint256 tokenId, address to) public { require(msg.sender == ownerOf(tokenId)); resolver[tokenId] = to; emit ResolverUpdated(tokenId, to); } function setMinRegistrationFee(uint256 fee) public onlyOwner { minRegistrationFee = fee; } function getAllNames() public view returns (bytes[] memory) { return names; } function namesLen() public view returns (uint256) { return names.length; } function currentId() public view returns (uint256) { return _tokenIds.current(); } function _baseURI() internal view override returns (string memory) { return "https://trustless.domains/"; } function setPfp(uint256 tokenId, bytes memory b, string memory _filename) external payable { if (b.length > MAX_PFP_SIZE) revert PfpTooLarge(); if (msg.sender != ownerOf(tokenId)) revert NotOwner(); if (msg.value < minPfpFee) revert InsufficientRegistrationFee(); string memory filename; if (bytes(_filename).length > 0) { filename = string(abi.encodePacked(tokenURI(tokenId), "/", _filename)); } else { filename = tokenURI(tokenId); } pfps[tokenId] = filename; emit PfpUpdated(tokenId, filename); pfpStorage.store(filename, 0, b); } function getPfp(uint256 tokenId) public view returns (bytes memory) { string memory filename = pfps[tokenId]; if (bytes(filename).length == 0) filename = tokenURI(tokenId); (bytes memory result, int256 nextChunk) = pfpStorage.load(address(this), filename, 0); if (nextChunk != -1) revert PfpTooLarge(); return result; } }
@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.9.0) (access/Ownable.sol) pragma solidity ^0.8.0; import "../utils/ContextUpgradeable.sol"; import "../proxy/utils/Initializable.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 OwnableUpgradeable is Initializable, ContextUpgradeable { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev Initializes the contract setting the deployer as the initial owner. */ function __Ownable_init() internal onlyInitializing { __Ownable_init_unchained(); } function __Ownable_init_unchained() internal onlyInitializing { _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); } /** * @dev This empty reserved space is put in place to allow future versions to add new * variables without shifting down storage in the inheritance chain. * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps */ uint256[49] private __gap; }
@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.9.0) (proxy/utils/Initializable.sol) pragma solidity ^0.8.2; import "../../utils/AddressUpgradeable.sol"; /** * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed * behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect. * * The initialization functions use a version number. Once a version number is used, it is consumed and cannot be * reused. This mechanism prevents re-execution of each "step" but allows the creation of new initialization steps in * case an upgrade adds a module that needs to be initialized. * * For example: * * [.hljs-theme-light.nopadding] * ```solidity * contract MyToken is ERC20Upgradeable { * function initialize() initializer public { * __ERC20_init("MyToken", "MTK"); * } * } * * contract MyTokenV2 is MyToken, ERC20PermitUpgradeable { * function initializeV2() reinitializer(2) public { * __ERC20Permit_init("MyToken"); * } * } * ``` * * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as * possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}. * * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity. * * [CAUTION] * ==== * Avoid leaving a contract uninitialized. * * An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation * contract, which may impact the proxy. To prevent the implementation contract from being used, you should invoke * the {_disableInitializers} function in the constructor to automatically lock it when it is deployed: * * [.hljs-theme-light.nopadding] * ``` * /// @custom:oz-upgrades-unsafe-allow constructor * constructor() { * _disableInitializers(); * } * ``` * ==== */ abstract contract Initializable { /** * @dev Indicates that the contract has been initialized. * @custom:oz-retyped-from bool */ uint8 private _initialized; /** * @dev Indicates that the contract is in the process of being initialized. */ bool private _initializing; /** * @dev Triggered when the contract has been initialized or reinitialized. */ event Initialized(uint8 version); /** * @dev A modifier that defines a protected initializer function that can be invoked at most once. In its scope, * `onlyInitializing` functions can be used to initialize parent contracts. * * Similar to `reinitializer(1)`, except that functions marked with `initializer` can be nested in the context of a * constructor. * * Emits an {Initialized} event. */ modifier initializer() { bool isTopLevelCall = !_initializing; require( (isTopLevelCall && _initialized < 1) || (!AddressUpgradeable.isContract(address(this)) && _initialized == 1), "Initializable: contract is already initialized" ); _initialized = 1; if (isTopLevelCall) { _initializing = true; } _; if (isTopLevelCall) { _initializing = false; emit Initialized(1); } } /** * @dev A modifier that defines a protected reinitializer function that can be invoked at most once, and only if the * contract hasn't been initialized to a greater version before. In its scope, `onlyInitializing` functions can be * used to initialize parent contracts. * * A reinitializer may be used after the original initialization step. This is essential to configure modules that * are added through upgrades and that require initialization. * * When `version` is 1, this modifier is similar to `initializer`, except that functions marked with `reinitializer` * cannot be nested. If one is invoked in the context of another, execution will revert. * * Note that versions can jump in increments greater than 1; this implies that if multiple reinitializers coexist in * a contract, executing them in the right order is up to the developer or operator. * * WARNING: setting the version to 255 will prevent any future reinitialization. * * Emits an {Initialized} event. */ modifier reinitializer(uint8 version) { require(!_initializing && _initialized < version, "Initializable: contract is already initialized"); _initialized = version; _initializing = true; _; _initializing = false; emit Initialized(version); } /** * @dev Modifier to protect an initialization function so that it can only be invoked by functions with the * {initializer} and {reinitializer} modifiers, directly or indirectly. */ modifier onlyInitializing() { require(_initializing, "Initializable: contract is not initializing"); _; } /** * @dev Locks the contract, preventing any future reinitialization. This cannot be part of an initializer call. * Calling this in the constructor of a contract will prevent that contract from being initialized or reinitialized * to any version. It is recommended to use this to lock implementation contracts that are designed to be called * through proxies. * * Emits an {Initialized} event the first time it is successfully executed. */ function _disableInitializers() internal virtual { require(!_initializing, "Initializable: contract is initializing"); if (_initialized != type(uint8).max) { _initialized = type(uint8).max; emit Initialized(type(uint8).max); } } /** * @dev Returns the highest version that has been initialized. See {reinitializer}. */ function _getInitializedVersion() internal view returns (uint8) { return _initialized; } /** * @dev Returns `true` if the contract is currently initializing. See {onlyInitializing}. */ function _isInitializing() internal view returns (bool) { return _initializing; } }
@openzeppelin/contracts-upgradeable/token/ERC721/ERC721Upgradeable.sol
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.9.0) (token/ERC721/ERC721.sol) pragma solidity ^0.8.0; import "./IERC721Upgradeable.sol"; import "./IERC721ReceiverUpgradeable.sol"; import "./extensions/IERC721MetadataUpgradeable.sol"; import "../../utils/AddressUpgradeable.sol"; import "../../utils/ContextUpgradeable.sol"; import "../../utils/StringsUpgradeable.sol"; import "../../utils/introspection/ERC165Upgradeable.sol"; import "../../proxy/utils/Initializable.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 ERC721Upgradeable is Initializable, ContextUpgradeable, ERC165Upgradeable, IERC721Upgradeable, IERC721MetadataUpgradeable { using AddressUpgradeable for address; using StringsUpgradeable 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. */ function __ERC721_init(string memory name_, string memory symbol_) internal onlyInitializing { __ERC721_init_unchained(name_, symbol_); } function __ERC721_init_unchained(string memory name_, string memory symbol_) internal onlyInitializing { _name = name_; _symbol = symbol_; } /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165Upgradeable, IERC165Upgradeable) returns (bool) { return interfaceId == type(IERC721Upgradeable).interfaceId || interfaceId == type(IERC721MetadataUpgradeable).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 = ERC721Upgradeable.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 = ERC721Upgradeable.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 = ERC721Upgradeable.ownerOf(tokenId); _beforeTokenTransfer(owner, address(0), tokenId, 1); // Update ownership in case tokenId was transferred by `_beforeTokenTransfer` hook owner = ERC721Upgradeable.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(ERC721Upgradeable.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(ERC721Upgradeable.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(ERC721Upgradeable.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 IERC721ReceiverUpgradeable(to).onERC721Received(_msgSender(), from, tokenId, data) returns (bytes4 retval) { return retval == IERC721ReceiverUpgradeable.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; } /** * @dev This empty reserved space is put in place to allow future versions to add new * variables without shifting down storage in the inheritance chain. * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps */ uint256[44] private __gap; }
@openzeppelin/contracts-upgradeable/token/ERC721/IERC721ReceiverUpgradeable.sol
// 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 IERC721ReceiverUpgradeable { /** * @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); }
@openzeppelin/contracts-upgradeable/token/ERC721/IERC721Upgradeable.sol
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.9.0) (token/ERC721/IERC721.sol) pragma solidity ^0.8.0; import "../../utils/introspection/IERC165Upgradeable.sol"; /** * @dev Required interface of an ERC721 compliant contract. */ interface IERC721Upgradeable is IERC165Upgradeable { /** * @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); }
@openzeppelin/contracts-upgradeable/token/ERC721/extensions/IERC721MetadataUpgradeable.sol
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (token/ERC721/extensions/IERC721Metadata.sol) pragma solidity ^0.8.0; import "../IERC721Upgradeable.sol"; /** * @title ERC-721 Non-Fungible Token Standard, optional metadata extension * @dev See https://eips.ethereum.org/EIPS/eip-721 */ interface IERC721MetadataUpgradeable is IERC721Upgradeable { /** * @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); }
@openzeppelin/contracts-upgradeable/utils/AddressUpgradeable.sol
// 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 AddressUpgradeable { /** * @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); } } }
@openzeppelin/contracts-upgradeable/utils/ContextUpgradeable.sol
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/Context.sol) pragma solidity ^0.8.0; import "../proxy/utils/Initializable.sol"; /** * @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 ContextUpgradeable is Initializable { function __Context_init() internal onlyInitializing { } function __Context_init_unchained() internal onlyInitializing { } function _msgSender() internal view virtual returns (address) { return msg.sender; } function _msgData() internal view virtual returns (bytes calldata) { return msg.data; } /** * @dev This empty reserved space is put in place to allow future versions to add new * variables without shifting down storage in the inheritance chain. * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps */ uint256[50] private __gap; }
@openzeppelin/contracts-upgradeable/utils/StringsUpgradeable.sol
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.9.0) (utils/Strings.sol) pragma solidity ^0.8.0; import "./math/MathUpgradeable.sol"; import "./math/SignedMathUpgradeable.sol"; /** * @dev String operations. */ library StringsUpgradeable { 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 = MathUpgradeable.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(SignedMathUpgradeable.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, MathUpgradeable.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)); } }
@openzeppelin/contracts-upgradeable/utils/introspection/ERC165Upgradeable.sol
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/introspection/ERC165.sol) pragma solidity ^0.8.0; import "./IERC165Upgradeable.sol"; import "../../proxy/utils/Initializable.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 ERC165Upgradeable is Initializable, IERC165Upgradeable { function __ERC165_init() internal onlyInitializing { } function __ERC165_init_unchained() internal onlyInitializing { } /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { return interfaceId == type(IERC165Upgradeable).interfaceId; } /** * @dev This empty reserved space is put in place to allow future versions to add new * variables without shifting down storage in the inheritance chain. * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps */ uint256[50] private __gap; }
@openzeppelin/contracts-upgradeable/utils/introspection/IERC165Upgradeable.sol
// 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 IERC165Upgradeable { /** * @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); }
@openzeppelin/contracts-upgradeable/utils/math/MathUpgradeable.sol
// 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 MathUpgradeable { 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); } } }
@openzeppelin/contracts-upgradeable/utils/math/SignedMathUpgradeable.sol
// 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 SignedMathUpgradeable { /** * @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); } } }
@openzeppelin/contracts/utils/Counters.sol
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/Counters.sol) pragma solidity ^0.8.0; /** * @title Counters * @author Matt Condon (@shrugs) * @dev Provides counters that can only be incremented, decremented or reset. This can be used e.g. to track the number * of elements in a mapping, issuing ERC721 ids, or counting request ids. * * Include with `using Counters for Counters.Counter;` */ library Counters { struct Counter { // This variable should never be directly accessed by users of the library: interactions must be restricted to // the library's function. As of Solidity v0.5.2, this cannot be enforced, though there is a proposal to add // this feature: see https://github.com/ethereum/solidity/issues/4637 uint256 _value; // default: 0 } function current(Counter storage counter) internal view returns (uint256) { return counter._value; } function increment(Counter storage counter) internal { unchecked { counter._value += 1; } } function decrement(Counter storage counter) internal { uint256 value = counter._value; require(value > 0, "Counter: decrement overflow"); unchecked { counter._value = value - 1; } } function reset(Counter storage counter) internal { counter._value = 0; } }
Compiler Settings
{"remappings":[],"optimizer":{"runs":200,"enabled":false},"metadata":{"useLiteralContent":true,"bytecodeHash":"ipfs"},"libraries":{},"evmVersion":"london"}
Contract ABI
[{"type":"error","name":"AlreadyUpgraded","inputs":[]},{"type":"error","name":"InsufficientRegistrationFee","inputs":[]},{"type":"error","name":"NameAlreadyRegistered","inputs":[]},{"type":"error","name":"NotOwner","inputs":[]},{"type":"error","name":"PfpTooLarge","inputs":[]},{"type":"event","name":"Approval","inputs":[{"type":"address","name":"owner","internalType":"address","indexed":true},{"type":"address","name":"approved","internalType":"address","indexed":true},{"type":"uint256","name":"tokenId","internalType":"uint256","indexed":true}],"anonymous":false},{"type":"event","name":"ApprovalForAll","inputs":[{"type":"address","name":"owner","internalType":"address","indexed":true},{"type":"address","name":"operator","internalType":"address","indexed":true},{"type":"bool","name":"approved","internalType":"bool","indexed":false}],"anonymous":false},{"type":"event","name":"Initialized","inputs":[{"type":"uint8","name":"version","internalType":"uint8","indexed":false}],"anonymous":false},{"type":"event","name":"NameRegistered","inputs":[{"type":"bytes","name":"name","internalType":"bytes","indexed":false},{"type":"uint256","name":"id","internalType":"uint256","indexed":true}],"anonymous":false},{"type":"event","name":"OwnershipTransferred","inputs":[{"type":"address","name":"previousOwner","internalType":"address","indexed":true},{"type":"address","name":"newOwner","internalType":"address","indexed":true}],"anonymous":false},{"type":"event","name":"PfpUpdated","inputs":[{"type":"uint256","name":"id","internalType":"uint256","indexed":true},{"type":"string","name":"filename","internalType":"string","indexed":false}],"anonymous":false},{"type":"event","name":"ResolverUpdated","inputs":[{"type":"uint256","name":"id","internalType":"uint256","indexed":true},{"type":"address","name":"addr","internalType":"address","indexed":true}],"anonymous":false},{"type":"event","name":"Transfer","inputs":[{"type":"address","name":"from","internalType":"address","indexed":true},{"type":"address","name":"to","internalType":"address","indexed":true},{"type":"uint256","name":"tokenId","internalType":"uint256","indexed":true}],"anonymous":false},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"afterUpgrade","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"approve","inputs":[{"type":"address","name":"to","internalType":"address"},{"type":"uint256","name":"tokenId","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"balanceOf","inputs":[{"type":"address","name":"owner","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"currentId","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"bytes[]","name":"","internalType":"bytes[]"}],"name":"getAllNames","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"getApproved","inputs":[{"type":"uint256","name":"tokenId","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"bytes","name":"","internalType":"bytes"}],"name":"getPfp","inputs":[{"type":"uint256","name":"tokenId","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"initialize","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"isApprovedForAll","inputs":[{"type":"address","name":"owner","internalType":"address"},{"type":"address","name":"operator","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"map","inputs":[{"type":"uint256","name":"tokenId","internalType":"uint256"},{"type":"address","name":"to","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"minPfpFee","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"minRegistrationFee","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"string","name":"","internalType":"string"}],"name":"name","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"bytes","name":"","internalType":"bytes"}],"name":"names","inputs":[{"type":"uint256","name":"","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"namesLen","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"owner","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"ownerOf","inputs":[{"type":"uint256","name":"tokenId","internalType":"uint256"}]},{"type":"function","stateMutability":"payable","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"register","inputs":[{"type":"address","name":"owner","internalType":"address"},{"type":"bytes","name":"name","internalType":"bytes"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"registerBatch","inputs":[{"type":"address","name":"owner","internalType":"address"},{"type":"bytes[]","name":"_names","internalType":"bytes[]"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"registered","inputs":[{"type":"bytes","name":"","internalType":"bytes"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"registry","inputs":[{"type":"bytes","name":"","internalType":"bytes"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"renounceOwnership","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"resolver","inputs":[{"type":"uint256","name":"","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"safeTransferFrom","inputs":[{"type":"address","name":"from","internalType":"address"},{"type":"address","name":"to","internalType":"address"},{"type":"uint256","name":"tokenId","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"safeTransferFrom","inputs":[{"type":"address","name":"from","internalType":"address"},{"type":"address","name":"to","internalType":"address"},{"type":"uint256","name":"tokenId","internalType":"uint256"},{"type":"bytes","name":"data","internalType":"bytes"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"setApprovalForAll","inputs":[{"type":"address","name":"operator","internalType":"address"},{"type":"bool","name":"approved","internalType":"bool"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"setMinRegistrationFee","inputs":[{"type":"uint256","name":"fee","internalType":"uint256"}]},{"type":"function","stateMutability":"payable","outputs":[],"name":"setPfp","inputs":[{"type":"uint256","name":"tokenId","internalType":"uint256"},{"type":"bytes","name":"b","internalType":"bytes"},{"type":"string","name":"_filename","internalType":"string"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"supportsInterface","inputs":[{"type":"bytes4","name":"interfaceId","internalType":"bytes4"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"string","name":"","internalType":"string"}],"name":"symbol","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"string","name":"","internalType":"string"}],"name":"tokenURI","inputs":[{"type":"uint256","name":"tokenId","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"transferFrom","inputs":[{"type":"address","name":"from","internalType":"address"},{"type":"address","name":"to","internalType":"address"},{"type":"uint256","name":"tokenId","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"transferOwnership","inputs":[{"type":"address","name":"newOwner","internalType":"address"}]}]
Contract Creation Code
0x608060405234801561001057600080fd5b506148a2806100206000396000f3fe6080604052600436106101ee5760003560e01c806370a082311161010d578063b88d4fde116100a0578063e00dd1611161006f578063e00dd161146106f3578063e985e9c51461071e578063ed4b9ff51461075b578063f2fde38b14610798578063fb825e5f146107c1576101ee565b8063b88d4fde1461065a578063c83cae6a14610683578063c87b56dd1461069f578063ce184325146106dc576101ee565b806395d89b41116100dc57806395d89b411461059e5780639706828a146105c9578063a15d581c146105f4578063a22cb46514610631576101ee565b806370a0823114610508578063715018a6146105455780638129fc1c1461055c5780638da5cb5b14610573576101ee565b806327201c97116101855780635aca952e116101545780635aca952e146104385780635cc3cd11146104755780636352211e146104a057806368ba7004146104dd576101ee565b806327201c9714610380578063376a2b69146103a957806342842e0e146103d25780634622ab03146103fb576101ee565b8063095ea7b3116101c1578063095ea7b3146102c1578063108eaa4e146102ea57806323b872dd1461032757806324b8fbf614610350576101ee565b806301ffc9a7146101f357806306301a9d1461023057806306fdde0314610259578063081812fc14610284575b600080fd5b3480156101ff57600080fd5b5061021a60048036038101906102159190612d62565b6107ec565b6040516102279190612daa565b60405180910390f35b34801561023c57600080fd5b5061025760048036038101906102529190612dfb565b6108ce565b005b34801561026557600080fd5b5061026e6108e0565b60405161027b9190612eb8565b60405180910390f35b34801561029057600080fd5b506102ab60048036038101906102a69190612dfb565b610972565b6040516102b89190612f1b565b60405180910390f35b3480156102cd57600080fd5b506102e860048036038101906102e39190612f62565b6109b8565b005b3480156102f657600080fd5b50610311600480360381019061030c9190612dfb565b610acf565b60405161031e9190612f1b565b60405180910390f35b34801561033357600080fd5b5061034e60048036038101906103499190612fa2565b610b02565b005b61036a6004803603810190610365919061312a565b610b62565b6040516103779190613195565b60405180910390f35b34801561038c57600080fd5b506103a760048036038101906103a29190613296565b610d97565b005b3480156103b557600080fd5b506103d060048036038101906103cb91906132f2565b610de0565b005b3480156103de57600080fd5b506103f960048036038101906103f49190612fa2565b610eba565b005b34801561040757600080fd5b50610422600480360381019061041d9190612dfb565b610eda565b60405161042f9190613387565b60405180910390f35b34801561044457600080fd5b5061045f600480360381019061045a91906133a9565b610f86565b60405161046c9190612daa565b60405180910390f35b34801561048157600080fd5b5061048a610fbc565b6040516104979190613195565b60405180910390f35b3480156104ac57600080fd5b506104c760048036038101906104c29190612dfb565b610fc9565b6040516104d49190612f1b565b60405180910390f35b3480156104e957600080fd5b506104f261104f565b6040516104ff9190613195565b60405180910390f35b34801561051457600080fd5b5061052f600480360381019061052a91906133f2565b611055565b60405161053c9190613195565b60405180910390f35b34801561055157600080fd5b5061055a61110c565b005b34801561056857600080fd5b50610571611120565b005b34801561057f57600080fd5b506105886112d2565b6040516105959190612f1b565b60405180910390f35b3480156105aa57600080fd5b506105b36112fc565b6040516105c09190612eb8565b60405180910390f35b3480156105d557600080fd5b506105de61138e565b6040516105eb9190613195565b60405180910390f35b34801561060057600080fd5b5061061b600480360381019061061691906133a9565b611394565b6040516106289190613195565b60405180910390f35b34801561063d57600080fd5b506106586004803603810190610653919061344b565b6113c2565b005b34801561066657600080fd5b50610681600480360381019061067c919061348b565b6113d8565b005b61069d600480360381019061069891906135af565b61143a565b005b3480156106ab57600080fd5b506106c660048036038101906106c19190612dfb565b61165b565b6040516106d39190612eb8565b60405180910390f35b3480156106e857600080fd5b506106f16116c3565b005b3480156106ff57600080fd5b5061070861170e565b6040516107159190613195565b60405180910390f35b34801561072a57600080fd5b506107456004803603810190610740919061363a565b61171f565b6040516107529190612daa565b60405180910390f35b34801561076757600080fd5b50610782600480360381019061077d9190612dfb565b6117b3565b60405161078f9190613387565b60405180910390f35b3480156107a457600080fd5b506107bf60048036038101906107ba91906133f2565b61197b565b005b3480156107cd57600080fd5b506107d66119fe565b6040516107e39190613786565b60405180910390f35b60007f80ac58cd000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191614806108b757507f5b5e139f000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916145b806108c757506108c682611ad7565b5b9050919050565b6108d6611b41565b8060cd8190555050565b6060606580546108ef906137d7565b80601f016020809104026020016040519081016040528092919081815260200182805461091b906137d7565b80156109685780601f1061093d57610100808354040283529160200191610968565b820191906000526020600020905b81548152906001019060200180831161094b57829003601f168201915b5050505050905090565b600061097d82611bbf565b6069600083815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050919050565b60006109c382610fc9565b90508073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1603610a33576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a2a9061387a565b60405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff16610a52611c0a565b73ffffffffffffffffffffffffffffffffffffffff161480610a815750610a8081610a7b611c0a565b61171f565b5b610ac0576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ab79061390c565b60405180910390fd5b610aca8383611c12565b505050565b60cc6020528060005260406000206000915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b610b13610b0d611c0a565b82611ccb565b610b52576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b499061399e565b60405180910390fd5b610b5d838383611d60565b505050565b6000610b6d82612059565b915060cd54341015610bab576040517fef1452c100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60cb82604051610bbb91906139fa565b908152602001604051809103902060009054906101000a900460ff1615610c0e576040517f024494de00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6000610c1a60c961220b565b9050610c268482612219565b8060ca84604051610c3791906139fa565b908152602001604051809103902081905550600160cb84604051610c5b91906139fa565b908152602001604051809103902060006101000a81548160ff0219169083151502179055508360cc600083815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060ce83908060018154018082558091505060019003906000526020600020016000909190919091509081610d069190613bbd565b50807f804e89f7acfccaf194f6757b177acb1ab1828a7c01ef308f9f8e4bbd2fb6387384604051610d379190613387565b60405180910390a28373ffffffffffffffffffffffffffffffffffffffff16817f3c055b8ebff34805cc0c0216cfd96bfe2613c75002ce000f6268324952541d0660405160405180910390a3610d8d60c9612436565b8091505092915050565b60005b8151811015610ddb57610dc783838381518110610dba57610db9613c8f565b5b6020026020010151610b62565b508080610dd390613ced565b915050610d9a565b505050565b610de982610fc9565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610e2057600080fd5b8060cc600084815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508073ffffffffffffffffffffffffffffffffffffffff16827f3c055b8ebff34805cc0c0216cfd96bfe2613c75002ce000f6268324952541d0660405160405180910390a35050565b610ed5838383604051806020016040528060008152506113d8565b505050565b60ce8181548110610eea57600080fd5b906000526020600020016000915090508054610f05906137d7565b80601f0160208091040260200160405190810160405280929190818152602001828054610f31906137d7565b8015610f7e5780601f10610f5357610100808354040283529160200191610f7e565b820191906000526020600020905b815481529060010190602001808311610f6157829003601f168201915b505050505081565b60cb818051602081018201805184825260208301602085012081835280955050505050506000915054906101000a900460ff1681565b600060ce80549050905090565b600080610fd58361244c565b9050600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1603611046576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161103d90613d81565b60405180910390fd5b80915050919050565b60d05481565b60008073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16036110c5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016110bc90613e13565b60405180910390fd5b606860008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b611114611b41565b61111e6000612489565b565b60008060019054906101000a900460ff161590508080156111515750600160008054906101000a900460ff1660ff16105b8061117e57506111603061254f565b15801561117d5750600160008054906101000a900460ff1660ff16145b5b6111bd576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111b490613ea5565b60405180910390fd5b60016000806101000a81548160ff021916908360ff16021790555080156111fa576001600060016101000a81548160ff0219169083151502179055505b61126e6040518060400160405280601381526020017f426974636f696e204e616d652053797374656d000000000000000000000000008152506040518060400160405280600381526020017f424e530000000000000000000000000000000000000000000000000000000000815250612572565b6112766125cf565b80156112cf5760008060016101000a81548160ff0219169083151502179055507f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb384740249860016040516112c69190613f0d565b60405180910390a15b50565b6000609760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606066805461130b906137d7565b80601f0160208091040260200160405190810160405280929190818152602001828054611337906137d7565b80156113845780601f1061135957610100808354040283529160200191611384565b820191906000526020600020905b81548152906001019060200180831161136757829003601f168201915b5050505050905090565b60cd5481565b60ca818051602081018201805184825260208301602085012081835280955050505050506000915090505481565b6113d46113cd611c0a565b8383612628565b5050565b6113e96113e3611c0a565b83611ccb565b611428576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161141f9061399e565b60405180910390fd5b61143484848484612794565b50505050565b6205cc6082511115611478576040517f2166614700000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b61148183610fc9565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146114e5576040517f30cd747100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60d054341015611521576040517fef1452c100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b606060008251111561155e576115368461165b565b82604051602001611548929190613fb0565b604051602081830303815290604052905061156a565b6115678461165b565b90505b8060d26000868152602001908152602001600020908161158a919061403a565b50837f03b5cd0dc45f63f640f448d0037b63cc9b7e0ed566c7cf1a29fc44d18ad9e931826040516115bb9190612eb8565b60405180910390a260d160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663928a4b3e826000866040518463ffffffff1660e01b815260040161162393929190614147565b600060405180830381600087803b15801561163d57600080fd5b505af1158015611651573d6000803e3d6000fd5b5050505050505050565b606061166682611bbf565b60006116706127f0565b9050600081511161169057604051806020016040528060008152506116bb565b8061169a8461282d565b6040516020016116ab92919061418c565b6040516020818303038152906040525b915050919050565b600460cf54036116da57600560cf8190555061170c565b6040517f42088f8400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b565b600061171a60c961220b565b905090565b6000606a60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16905092915050565b6060600060d2600084815260200190815260200160002080546117d5906137d7565b80601f0160208091040260200160405190810160405280929190818152602001828054611801906137d7565b801561184e5780601f106118235761010080835404028352916020019161184e565b820191906000526020600020905b81548152906001019060200180831161183157829003601f168201915b50505050509050600081510361186a576118678361165b565b90505b60008060d160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a0e56764308560006040518463ffffffff1660e01b81526004016118cd939291906141b0565b600060405180830381865afa1580156118ea573d6000803e3d6000fd5b505050506040513d6000823e3d601f19601f820116820180604052508101906119139190614294565b915091507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8114611970576040517f2166614700000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b819350505050919050565b611983611b41565b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16036119f2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016119e990614362565b60405180910390fd5b6119fb81612489565b50565b606060ce805480602002602001604051908101604052809291908181526020016000905b82821015611ace578382906000526020600020018054611a41906137d7565b80601f0160208091040260200160405190810160405280929190818152602001828054611a6d906137d7565b8015611aba5780601f10611a8f57610100808354040283529160200191611aba565b820191906000526020600020905b815481529060010190602001808311611a9d57829003601f168201915b505050505081526020019060010190611a22565b50505050905090565b60007f01ffc9a7000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916149050919050565b611b49611c0a565b73ffffffffffffffffffffffffffffffffffffffff16611b676112d2565b73ffffffffffffffffffffffffffffffffffffffff1614611bbd576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611bb4906143ce565b60405180910390fd5b565b611bc8816128fb565b611c07576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611bfe90613d81565b60405180910390fd5b50565b600033905090565b816069600083815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550808273ffffffffffffffffffffffffffffffffffffffff16611c8583610fc9565b73ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b600080611cd783610fc9565b90508073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff161480611d195750611d18818561171f565b5b80611d5757508373ffffffffffffffffffffffffffffffffffffffff16611d3f84610972565b73ffffffffffffffffffffffffffffffffffffffff16145b91505092915050565b8273ffffffffffffffffffffffffffffffffffffffff16611d8082610fc9565b73ffffffffffffffffffffffffffffffffffffffff1614611dd6576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611dcd90614460565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1603611e45576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611e3c906144f2565b60405180910390fd5b611e52838383600161293c565b8273ffffffffffffffffffffffffffffffffffffffff16611e7282610fc9565b73ffffffffffffffffffffffffffffffffffffffff1614611ec8576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611ebf90614460565b60405180910390fd5b6069600082815260200190815260200160002060006101000a81549073ffffffffffffffffffffffffffffffffffffffff02191690556001606860008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825403925050819055506001606860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282540192505081905550816067600083815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550808273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60405160405180910390a46120548383836001612942565b505050565b60606000825167ffffffffffffffff81111561207857612077612fff565b5b6040519080825280601f01601f1916602001820160405280156120aa5781602001600182028036833780820191505090505b50905060005b83518110156122015760418482815181106120ce576120cd613c8f565b5b602001015160f81c60f81b60f81c60ff16101580156121115750605a8482815181106120fd576120fc613c8f565b5b602001015160f81c60f81b60f81c60ff1611155b1561218d57602084828151811061212b5761212a613c8f565b5b602001015160f81c60f81b60f81c6121439190614512565b60f81b82828151811061215957612158613c8f565b5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053506121ee565b8381815181106121a05761219f613c8f565b5b602001015160f81c60f81b8282815181106121be576121bd613c8f565b5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053505b80806121f990613ced565b9150506120b0565b5080915050919050565b600081600001549050919050565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1603612288576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161227f90614593565b60405180910390fd5b612291816128fb565b156122d1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016122c8906145ff565b60405180910390fd5b6122df60008383600161293c565b6122e8816128fb565b15612328576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161231f906145ff565b60405180910390fd5b6001606860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282540192505081905550816067600083815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550808273ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60405160405180910390a4612432600083836001612942565b5050565b6001816000016000828254019250508190555050565b60006067600083815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050919050565b6000609760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905081609760006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b6000808273ffffffffffffffffffffffffffffffffffffffff163b119050919050565b600060019054906101000a900460ff166125c1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016125b890614691565b60405180910390fd5b6125cb8282612948565b5050565b600060019054906101000a900460ff1661261e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161261590614691565b60405180910390fd5b6126266129bb565b565b8173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1603612696576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161268d906146fd565b60405180910390fd5b80606a60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31836040516127879190612daa565b60405180910390a3505050565b61279f848484611d60565b6127ab84848484612a1c565b6127ea576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016127e19061478f565b60405180910390fd5b50505050565b60606040518060400160405280601a81526020017f68747470733a2f2f74727573746c6573732e646f6d61696e732f000000000000815250905090565b60606000600161283c84612ba3565b01905060008167ffffffffffffffff81111561285b5761285a612fff565b5b6040519080825280601f01601f19166020018201604052801561288d5781602001600182028036833780820191505090505b509050600082602001820190505b6001156128f0578080600190039150507f3031323334353637383961626364656600000000000000000000000000000000600a86061a8153600a85816128e4576128e36147af565b5b0494506000850361289b575b819350505050919050565b60008073ffffffffffffffffffffffffffffffffffffffff1661291d8361244c565b73ffffffffffffffffffffffffffffffffffffffff1614159050919050565b50505050565b50505050565b600060019054906101000a900460ff16612997576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161298e90614691565b60405180910390fd5b81606590816129a6919061403a565b5080606690816129b6919061403a565b505050565b600060019054906101000a900460ff16612a0a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612a0190614691565b60405180910390fd5b612a1a612a15611c0a565b612489565b565b6000612a3d8473ffffffffffffffffffffffffffffffffffffffff1661254f565b15612b96578373ffffffffffffffffffffffffffffffffffffffff1663150b7a02612a66611c0a565b8786866040518563ffffffff1660e01b8152600401612a8894939291906147de565b6020604051808303816000875af1925050508015612ac457506040513d601f19601f82011682018060405250810190612ac1919061483f565b60015b612b46573d8060008114612af4576040519150601f19603f3d011682016040523d82523d6000602084013e612af9565b606091505b506000815103612b3e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612b359061478f565b60405180910390fd5b805181602001fd5b63150b7a0260e01b7bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916817bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191614915050612b9b565b600190505b949350505050565b600080600090507a184f03e93ff9f4daa797ed6e38ed64bf6a1f0100000000000000008310612c01577a184f03e93ff9f4daa797ed6e38ed64bf6a1f0100000000000000008381612bf757612bf66147af565b5b0492506040810190505b6d04ee2d6d415b85acef81000000008310612c3e576d04ee2d6d415b85acef81000000008381612c3457612c336147af565b5b0492506020810190505b662386f26fc100008310612c6d57662386f26fc100008381612c6357612c626147af565b5b0492506010810190505b6305f5e1008310612c96576305f5e1008381612c8c57612c8b6147af565b5b0492506008810190505b6127108310612cbb576127108381612cb157612cb06147af565b5b0492506004810190505b60648310612cde5760648381612cd457612cd36147af565b5b0492506002810190505b600a8310612ced576001810190505b80915050919050565b6000604051905090565b600080fd5b600080fd5b60007fffffffff0000000000000000000000000000000000000000000000000000000082169050919050565b612d3f81612d0a565b8114612d4a57600080fd5b50565b600081359050612d5c81612d36565b92915050565b600060208284031215612d7857612d77612d00565b5b6000612d8684828501612d4d565b91505092915050565b60008115159050919050565b612da481612d8f565b82525050565b6000602082019050612dbf6000830184612d9b565b92915050565b6000819050919050565b612dd881612dc5565b8114612de357600080fd5b50565b600081359050612df581612dcf565b92915050565b600060208284031215612e1157612e10612d00565b5b6000612e1f84828501612de6565b91505092915050565b600081519050919050565b600082825260208201905092915050565b60005b83811015612e62578082015181840152602081019050612e47565b60008484015250505050565b6000601f19601f8301169050919050565b6000612e8a82612e28565b612e948185612e33565b9350612ea4818560208601612e44565b612ead81612e6e565b840191505092915050565b60006020820190508181036000830152612ed28184612e7f565b905092915050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000612f0582612eda565b9050919050565b612f1581612efa565b82525050565b6000602082019050612f306000830184612f0c565b92915050565b612f3f81612efa565b8114612f4a57600080fd5b50565b600081359050612f5c81612f36565b92915050565b60008060408385031215612f7957612f78612d00565b5b6000612f8785828601612f4d565b9250506020612f9885828601612de6565b9150509250929050565b600080600060608486031215612fbb57612fba612d00565b5b6000612fc986828701612f4d565b9350506020612fda86828701612f4d565b9250506040612feb86828701612de6565b9150509250925092565b600080fd5b600080fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b61303782612e6e565b810181811067ffffffffffffffff8211171561305657613055612fff565b5b80604052505050565b6000613069612cf6565b9050613075828261302e565b919050565b600067ffffffffffffffff82111561309557613094612fff565b5b61309e82612e6e565b9050602081019050919050565b82818337600083830152505050565b60006130cd6130c88461307a565b61305f565b9050828152602081018484840111156130e9576130e8612ffa565b5b6130f48482856130ab565b509392505050565b600082601f83011261311157613110612ff5565b5b81356131218482602086016130ba565b91505092915050565b6000806040838503121561314157613140612d00565b5b600061314f85828601612f4d565b925050602083013567ffffffffffffffff8111156131705761316f612d05565b5b61317c858286016130fc565b9150509250929050565b61318f81612dc5565b82525050565b60006020820190506131aa6000830184613186565b92915050565b600067ffffffffffffffff8211156131cb576131ca612fff565b5b602082029050602081019050919050565b600080fd5b60006131f46131ef846131b0565b61305f565b90508083825260208201905060208402830185811115613217576132166131dc565b5b835b8181101561325e57803567ffffffffffffffff81111561323c5761323b612ff5565b5b80860161324989826130fc565b85526020850194505050602081019050613219565b5050509392505050565b600082601f83011261327d5761327c612ff5565b5b813561328d8482602086016131e1565b91505092915050565b600080604083850312156132ad576132ac612d00565b5b60006132bb85828601612f4d565b925050602083013567ffffffffffffffff8111156132dc576132db612d05565b5b6132e885828601613268565b9150509250929050565b6000806040838503121561330957613308612d00565b5b600061331785828601612de6565b925050602061332885828601612f4d565b9150509250929050565b600081519050919050565b600082825260208201905092915050565b600061335982613332565b613363818561333d565b9350613373818560208601612e44565b61337c81612e6e565b840191505092915050565b600060208201905081810360008301526133a1818461334e565b905092915050565b6000602082840312156133bf576133be612d00565b5b600082013567ffffffffffffffff8111156133dd576133dc612d05565b5b6133e9848285016130fc565b91505092915050565b60006020828403121561340857613407612d00565b5b600061341684828501612f4d565b91505092915050565b61342881612d8f565b811461343357600080fd5b50565b6000813590506134458161341f565b92915050565b6000806040838503121561346257613461612d00565b5b600061347085828601612f4d565b925050602061348185828601613436565b9150509250929050565b600080600080608085870312156134a5576134a4612d00565b5b60006134b387828801612f4d565b94505060206134c487828801612f4d565b93505060406134d587828801612de6565b925050606085013567ffffffffffffffff8111156134f6576134f5612d05565b5b613502878288016130fc565b91505092959194509250565b600067ffffffffffffffff82111561352957613528612fff565b5b61353282612e6e565b9050602081019050919050565b600061355261354d8461350e565b61305f565b90508281526020810184848401111561356e5761356d612ffa565b5b6135798482856130ab565b509392505050565b600082601f83011261359657613595612ff5565b5b81356135a684826020860161353f565b91505092915050565b6000806000606084860312156135c8576135c7612d00565b5b60006135d686828701612de6565b935050602084013567ffffffffffffffff8111156135f7576135f6612d05565b5b613603868287016130fc565b925050604084013567ffffffffffffffff81111561362457613623612d05565b5b61363086828701613581565b9150509250925092565b6000806040838503121561365157613650612d00565b5b600061365f85828601612f4d565b925050602061367085828601612f4d565b9150509250929050565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b600082825260208201905092915050565b60006136c282613332565b6136cc81856136a6565b93506136dc818560208601612e44565b6136e581612e6e565b840191505092915050565b60006136fc83836136b7565b905092915050565b6000602082019050919050565b600061371c8261367a565b6137268185613685565b93508360208202850161373885613696565b8060005b85811015613774578484038952815161375585826136f0565b945061376083613704565b925060208a0199505060018101905061373c565b50829750879550505050505092915050565b600060208201905081810360008301526137a08184613711565b905092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b600060028204905060018216806137ef57607f821691505b602082108103613802576138016137a8565b5b50919050565b7f4552433732313a20617070726f76616c20746f2063757272656e74206f776e6560008201527f7200000000000000000000000000000000000000000000000000000000000000602082015250565b6000613864602183612e33565b915061386f82613808565b604082019050919050565b6000602082019050818103600083015261389381613857565b9050919050565b7f4552433732313a20617070726f76652063616c6c6572206973206e6f7420746f60008201527f6b656e206f776e6572206f7220617070726f76656420666f7220616c6c000000602082015250565b60006138f6603d83612e33565b91506139018261389a565b604082019050919050565b60006020820190508181036000830152613925816138e9565b9050919050565b7f4552433732313a2063616c6c6572206973206e6f7420746f6b656e206f776e6560008201527f72206f7220617070726f76656400000000000000000000000000000000000000602082015250565b6000613988602d83612e33565b91506139938261392c565b604082019050919050565b600060208201905081810360008301526139b78161397b565b9050919050565b600081905092915050565b60006139d482613332565b6139de81856139be565b93506139ee818560208601612e44565b80840191505092915050565b6000613a0682846139c9565b915081905092915050565b60008190508160005260206000209050919050565b60006020601f8301049050919050565b600082821b905092915050565b600060088302613a737fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82613a36565b613a7d8683613a36565b95508019841693508086168417925050509392505050565b6000819050919050565b6000613aba613ab5613ab084612dc5565b613a95565b612dc5565b9050919050565b6000819050919050565b613ad483613a9f565b613ae8613ae082613ac1565b848454613a43565b825550505050565b600090565b613afd613af0565b613b08818484613acb565b505050565b5b81811015613b2c57613b21600082613af5565b600181019050613b0e565b5050565b601f821115613b7157613b4281613a11565b613b4b84613a26565b81016020851015613b5a578190505b613b6e613b6685613a26565b830182613b0d565b50505b505050565b600082821c905092915050565b6000613b9460001984600802613b76565b1980831691505092915050565b6000613bad8383613b83565b9150826002028217905092915050565b613bc682613332565b67ffffffffffffffff811115613bdf57613bde612fff565b5b613be982546137d7565b613bf4828285613b30565b600060209050601f831160018114613c275760008415613c15578287015190505b613c1f8582613ba1565b865550613c87565b601f198416613c3586613a11565b60005b82811015613c5d57848901518255600182019150602085019450602081019050613c38565b86831015613c7a5784890151613c76601f891682613b83565b8355505b6001600288020188555050505b505050505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b6000613cf882612dc5565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8203613d2a57613d29613cbe565b5b600182019050919050565b7f4552433732313a20696e76616c696420746f6b656e2049440000000000000000600082015250565b6000613d6b601883612e33565b9150613d7682613d35565b602082019050919050565b60006020820190508181036000830152613d9a81613d5e565b9050919050565b7f4552433732313a2061646472657373207a65726f206973206e6f74206120766160008201527f6c6964206f776e65720000000000000000000000000000000000000000000000602082015250565b6000613dfd602983612e33565b9150613e0882613da1565b604082019050919050565b60006020820190508181036000830152613e2c81613df0565b9050919050565b7f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160008201527f647920696e697469616c697a6564000000000000000000000000000000000000602082015250565b6000613e8f602e83612e33565b9150613e9a82613e33565b604082019050919050565b60006020820190508181036000830152613ebe81613e82565b9050919050565b6000819050919050565b600060ff82169050919050565b6000613ef7613ef2613eed84613ec5565b613a95565b613ecf565b9050919050565b613f0781613edc565b82525050565b6000602082019050613f226000830184613efe565b92915050565b600081905092915050565b6000613f3e82612e28565b613f488185613f28565b9350613f58818560208601612e44565b80840191505092915050565b7f2f00000000000000000000000000000000000000000000000000000000000000600082015250565b6000613f9a600183613f28565b9150613fa582613f64565b600182019050919050565b6000613fbc8285613f33565b9150613fc782613f8d565b9150613fd38284613f33565b91508190509392505050565b60008190508160005260206000209050919050565b601f8211156140355761400681613fdf565b61400f84613a26565b8101602085101561401e578190505b61403261402a85613a26565b830182613b0d565b50505b505050565b61404382612e28565b67ffffffffffffffff81111561405c5761405b612fff565b5b61406682546137d7565b614071828285613ff4565b600060209050601f8311600181146140a45760008415614092578287015190505b61409c8582613ba1565b865550614104565b601f1984166140b286613fdf565b60005b828110156140da578489015182556001820191506020850194506020810190506140b5565b868310156140f757848901516140f3601f891682613b83565b8355505b6001600288020188555050505b505050505050565b6000819050919050565b600061413161412c6141278461410c565b613a95565b612dc5565b9050919050565b61414181614116565b82525050565b600060608201905081810360008301526141618186612e7f565b90506141706020830185614138565b8181036040830152614182818461334e565b9050949350505050565b60006141988285613f33565b91506141a48284613f33565b91508190509392505050565b60006060820190506141c56000830186612f0c565b81810360208301526141d78185612e7f565b90506141e66040830184614138565b949350505050565b60006142016141fc8461307a565b61305f565b90508281526020810184848401111561421d5761421c612ffa565b5b614228848285612e44565b509392505050565b600082601f83011261424557614244612ff5565b5b81516142558482602086016141ee565b91505092915050565b6000819050919050565b6142718161425e565b811461427c57600080fd5b50565b60008151905061428e81614268565b92915050565b600080604083850312156142ab576142aa612d00565b5b600083015167ffffffffffffffff8111156142c9576142c8612d05565b5b6142d585828601614230565b92505060206142e68582860161427f565b9150509250929050565b7f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008201527f6464726573730000000000000000000000000000000000000000000000000000602082015250565b600061434c602683612e33565b9150614357826142f0565b604082019050919050565b6000602082019050818103600083015261437b8161433f565b9050919050565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b60006143b8602083612e33565b91506143c382614382565b602082019050919050565b600060208201905081810360008301526143e7816143ab565b9050919050565b7f4552433732313a207472616e736665722066726f6d20696e636f72726563742060008201527f6f776e6572000000000000000000000000000000000000000000000000000000602082015250565b600061444a602583612e33565b9150614455826143ee565b604082019050919050565b600060208201905081810360008301526144798161443d565b9050919050565b7f4552433732313a207472616e7366657220746f20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b60006144dc602483612e33565b91506144e782614480565b604082019050919050565b6000602082019050818103600083015261450b816144cf565b9050919050565b600061451d82613ecf565b915061452883613ecf565b9250828201905060ff81111561454157614540613cbe565b5b92915050565b7f4552433732313a206d696e7420746f20746865207a65726f2061646472657373600082015250565b600061457d602083612e33565b915061458882614547565b602082019050919050565b600060208201905081810360008301526145ac81614570565b9050919050565b7f4552433732313a20746f6b656e20616c7265616479206d696e74656400000000600082015250565b60006145e9601c83612e33565b91506145f4826145b3565b602082019050919050565b60006020820190508181036000830152614618816145dc565b9050919050565b7f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960008201527f6e697469616c697a696e67000000000000000000000000000000000000000000602082015250565b600061467b602b83612e33565b91506146868261461f565b604082019050919050565b600060208201905081810360008301526146aa8161466e565b9050919050565b7f4552433732313a20617070726f766520746f2063616c6c657200000000000000600082015250565b60006146e7601983612e33565b91506146f2826146b1565b602082019050919050565b60006020820190508181036000830152614716816146da565b9050919050565b7f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560008201527f63656976657220696d706c656d656e7465720000000000000000000000000000602082015250565b6000614779603283612e33565b91506147848261471d565b604082019050919050565b600060208201905081810360008301526147a88161476c565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b60006080820190506147f36000830187612f0c565b6148006020830186612f0c565b61480d6040830185613186565b818103606083015261481f818461334e565b905095945050505050565b60008151905061483981612d36565b92915050565b60006020828403121561485557614854612d00565b5b60006148638482850161482a565b9150509291505056fea264697066735822122098a50583ca4c4a94a0c1b7eec96740f222ba2a9d14e964408687313170285afb64736f6c63430008110033
Deployed ByteCode
0x6080604052600436106101ee5760003560e01c806370a082311161010d578063b88d4fde116100a0578063e00dd1611161006f578063e00dd161146106f3578063e985e9c51461071e578063ed4b9ff51461075b578063f2fde38b14610798578063fb825e5f146107c1576101ee565b8063b88d4fde1461065a578063c83cae6a14610683578063c87b56dd1461069f578063ce184325146106dc576101ee565b806395d89b41116100dc57806395d89b411461059e5780639706828a146105c9578063a15d581c146105f4578063a22cb46514610631576101ee565b806370a0823114610508578063715018a6146105455780638129fc1c1461055c5780638da5cb5b14610573576101ee565b806327201c97116101855780635aca952e116101545780635aca952e146104385780635cc3cd11146104755780636352211e146104a057806368ba7004146104dd576101ee565b806327201c9714610380578063376a2b69146103a957806342842e0e146103d25780634622ab03146103fb576101ee565b8063095ea7b3116101c1578063095ea7b3146102c1578063108eaa4e146102ea57806323b872dd1461032757806324b8fbf614610350576101ee565b806301ffc9a7146101f357806306301a9d1461023057806306fdde0314610259578063081812fc14610284575b600080fd5b3480156101ff57600080fd5b5061021a60048036038101906102159190612d62565b6107ec565b6040516102279190612daa565b60405180910390f35b34801561023c57600080fd5b5061025760048036038101906102529190612dfb565b6108ce565b005b34801561026557600080fd5b5061026e6108e0565b60405161027b9190612eb8565b60405180910390f35b34801561029057600080fd5b506102ab60048036038101906102a69190612dfb565b610972565b6040516102b89190612f1b565b60405180910390f35b3480156102cd57600080fd5b506102e860048036038101906102e39190612f62565b6109b8565b005b3480156102f657600080fd5b50610311600480360381019061030c9190612dfb565b610acf565b60405161031e9190612f1b565b60405180910390f35b34801561033357600080fd5b5061034e60048036038101906103499190612fa2565b610b02565b005b61036a6004803603810190610365919061312a565b610b62565b6040516103779190613195565b60405180910390f35b34801561038c57600080fd5b506103a760048036038101906103a29190613296565b610d97565b005b3480156103b557600080fd5b506103d060048036038101906103cb91906132f2565b610de0565b005b3480156103de57600080fd5b506103f960048036038101906103f49190612fa2565b610eba565b005b34801561040757600080fd5b50610422600480360381019061041d9190612dfb565b610eda565b60405161042f9190613387565b60405180910390f35b34801561044457600080fd5b5061045f600480360381019061045a91906133a9565b610f86565b60405161046c9190612daa565b60405180910390f35b34801561048157600080fd5b5061048a610fbc565b6040516104979190613195565b60405180910390f35b3480156104ac57600080fd5b506104c760048036038101906104c29190612dfb565b610fc9565b6040516104d49190612f1b565b60405180910390f35b3480156104e957600080fd5b506104f261104f565b6040516104ff9190613195565b60405180910390f35b34801561051457600080fd5b5061052f600480360381019061052a91906133f2565b611055565b60405161053c9190613195565b60405180910390f35b34801561055157600080fd5b5061055a61110c565b005b34801561056857600080fd5b50610571611120565b005b34801561057f57600080fd5b506105886112d2565b6040516105959190612f1b565b60405180910390f35b3480156105aa57600080fd5b506105b36112fc565b6040516105c09190612eb8565b60405180910390f35b3480156105d557600080fd5b506105de61138e565b6040516105eb9190613195565b60405180910390f35b34801561060057600080fd5b5061061b600480360381019061061691906133a9565b611394565b6040516106289190613195565b60405180910390f35b34801561063d57600080fd5b506106586004803603810190610653919061344b565b6113c2565b005b34801561066657600080fd5b50610681600480360381019061067c919061348b565b6113d8565b005b61069d600480360381019061069891906135af565b61143a565b005b3480156106ab57600080fd5b506106c660048036038101906106c19190612dfb565b61165b565b6040516106d39190612eb8565b60405180910390f35b3480156106e857600080fd5b506106f16116c3565b005b3480156106ff57600080fd5b5061070861170e565b6040516107159190613195565b60405180910390f35b34801561072a57600080fd5b506107456004803603810190610740919061363a565b61171f565b6040516107529190612daa565b60405180910390f35b34801561076757600080fd5b50610782600480360381019061077d9190612dfb565b6117b3565b60405161078f9190613387565b60405180910390f35b3480156107a457600080fd5b506107bf60048036038101906107ba91906133f2565b61197b565b005b3480156107cd57600080fd5b506107d66119fe565b6040516107e39190613786565b60405180910390f35b60007f80ac58cd000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191614806108b757507f5b5e139f000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916145b806108c757506108c682611ad7565b5b9050919050565b6108d6611b41565b8060cd8190555050565b6060606580546108ef906137d7565b80601f016020809104026020016040519081016040528092919081815260200182805461091b906137d7565b80156109685780601f1061093d57610100808354040283529160200191610968565b820191906000526020600020905b81548152906001019060200180831161094b57829003601f168201915b5050505050905090565b600061097d82611bbf565b6069600083815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050919050565b60006109c382610fc9565b90508073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1603610a33576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a2a9061387a565b60405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff16610a52611c0a565b73ffffffffffffffffffffffffffffffffffffffff161480610a815750610a8081610a7b611c0a565b61171f565b5b610ac0576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ab79061390c565b60405180910390fd5b610aca8383611c12565b505050565b60cc6020528060005260406000206000915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b610b13610b0d611c0a565b82611ccb565b610b52576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b499061399e565b60405180910390fd5b610b5d838383611d60565b505050565b6000610b6d82612059565b915060cd54341015610bab576040517fef1452c100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60cb82604051610bbb91906139fa565b908152602001604051809103902060009054906101000a900460ff1615610c0e576040517f024494de00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6000610c1a60c961220b565b9050610c268482612219565b8060ca84604051610c3791906139fa565b908152602001604051809103902081905550600160cb84604051610c5b91906139fa565b908152602001604051809103902060006101000a81548160ff0219169083151502179055508360cc600083815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060ce83908060018154018082558091505060019003906000526020600020016000909190919091509081610d069190613bbd565b50807f804e89f7acfccaf194f6757b177acb1ab1828a7c01ef308f9f8e4bbd2fb6387384604051610d379190613387565b60405180910390a28373ffffffffffffffffffffffffffffffffffffffff16817f3c055b8ebff34805cc0c0216cfd96bfe2613c75002ce000f6268324952541d0660405160405180910390a3610d8d60c9612436565b8091505092915050565b60005b8151811015610ddb57610dc783838381518110610dba57610db9613c8f565b5b6020026020010151610b62565b508080610dd390613ced565b915050610d9a565b505050565b610de982610fc9565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610e2057600080fd5b8060cc600084815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508073ffffffffffffffffffffffffffffffffffffffff16827f3c055b8ebff34805cc0c0216cfd96bfe2613c75002ce000f6268324952541d0660405160405180910390a35050565b610ed5838383604051806020016040528060008152506113d8565b505050565b60ce8181548110610eea57600080fd5b906000526020600020016000915090508054610f05906137d7565b80601f0160208091040260200160405190810160405280929190818152602001828054610f31906137d7565b8015610f7e5780601f10610f5357610100808354040283529160200191610f7e565b820191906000526020600020905b815481529060010190602001808311610f6157829003601f168201915b505050505081565b60cb818051602081018201805184825260208301602085012081835280955050505050506000915054906101000a900460ff1681565b600060ce80549050905090565b600080610fd58361244c565b9050600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1603611046576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161103d90613d81565b60405180910390fd5b80915050919050565b60d05481565b60008073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16036110c5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016110bc90613e13565b60405180910390fd5b606860008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b611114611b41565b61111e6000612489565b565b60008060019054906101000a900460ff161590508080156111515750600160008054906101000a900460ff1660ff16105b8061117e57506111603061254f565b15801561117d5750600160008054906101000a900460ff1660ff16145b5b6111bd576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111b490613ea5565b60405180910390fd5b60016000806101000a81548160ff021916908360ff16021790555080156111fa576001600060016101000a81548160ff0219169083151502179055505b61126e6040518060400160405280601381526020017f426974636f696e204e616d652053797374656d000000000000000000000000008152506040518060400160405280600381526020017f424e530000000000000000000000000000000000000000000000000000000000815250612572565b6112766125cf565b80156112cf5760008060016101000a81548160ff0219169083151502179055507f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb384740249860016040516112c69190613f0d565b60405180910390a15b50565b6000609760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606066805461130b906137d7565b80601f0160208091040260200160405190810160405280929190818152602001828054611337906137d7565b80156113845780601f1061135957610100808354040283529160200191611384565b820191906000526020600020905b81548152906001019060200180831161136757829003601f168201915b5050505050905090565b60cd5481565b60ca818051602081018201805184825260208301602085012081835280955050505050506000915090505481565b6113d46113cd611c0a565b8383612628565b5050565b6113e96113e3611c0a565b83611ccb565b611428576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161141f9061399e565b60405180910390fd5b61143484848484612794565b50505050565b6205cc6082511115611478576040517f2166614700000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b61148183610fc9565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146114e5576040517f30cd747100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60d054341015611521576040517fef1452c100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b606060008251111561155e576115368461165b565b82604051602001611548929190613fb0565b604051602081830303815290604052905061156a565b6115678461165b565b90505b8060d26000868152602001908152602001600020908161158a919061403a565b50837f03b5cd0dc45f63f640f448d0037b63cc9b7e0ed566c7cf1a29fc44d18ad9e931826040516115bb9190612eb8565b60405180910390a260d160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663928a4b3e826000866040518463ffffffff1660e01b815260040161162393929190614147565b600060405180830381600087803b15801561163d57600080fd5b505af1158015611651573d6000803e3d6000fd5b5050505050505050565b606061166682611bbf565b60006116706127f0565b9050600081511161169057604051806020016040528060008152506116bb565b8061169a8461282d565b6040516020016116ab92919061418c565b6040516020818303038152906040525b915050919050565b600460cf54036116da57600560cf8190555061170c565b6040517f42088f8400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b565b600061171a60c961220b565b905090565b6000606a60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16905092915050565b6060600060d2600084815260200190815260200160002080546117d5906137d7565b80601f0160208091040260200160405190810160405280929190818152602001828054611801906137d7565b801561184e5780601f106118235761010080835404028352916020019161184e565b820191906000526020600020905b81548152906001019060200180831161183157829003601f168201915b50505050509050600081510361186a576118678361165b565b90505b60008060d160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a0e56764308560006040518463ffffffff1660e01b81526004016118cd939291906141b0565b600060405180830381865afa1580156118ea573d6000803e3d6000fd5b505050506040513d6000823e3d601f19601f820116820180604052508101906119139190614294565b915091507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8114611970576040517f2166614700000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b819350505050919050565b611983611b41565b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16036119f2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016119e990614362565b60405180910390fd5b6119fb81612489565b50565b606060ce805480602002602001604051908101604052809291908181526020016000905b82821015611ace578382906000526020600020018054611a41906137d7565b80601f0160208091040260200160405190810160405280929190818152602001828054611a6d906137d7565b8015611aba5780601f10611a8f57610100808354040283529160200191611aba565b820191906000526020600020905b815481529060010190602001808311611a9d57829003601f168201915b505050505081526020019060010190611a22565b50505050905090565b60007f01ffc9a7000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916149050919050565b611b49611c0a565b73ffffffffffffffffffffffffffffffffffffffff16611b676112d2565b73ffffffffffffffffffffffffffffffffffffffff1614611bbd576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611bb4906143ce565b60405180910390fd5b565b611bc8816128fb565b611c07576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611bfe90613d81565b60405180910390fd5b50565b600033905090565b816069600083815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550808273ffffffffffffffffffffffffffffffffffffffff16611c8583610fc9565b73ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b600080611cd783610fc9565b90508073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff161480611d195750611d18818561171f565b5b80611d5757508373ffffffffffffffffffffffffffffffffffffffff16611d3f84610972565b73ffffffffffffffffffffffffffffffffffffffff16145b91505092915050565b8273ffffffffffffffffffffffffffffffffffffffff16611d8082610fc9565b73ffffffffffffffffffffffffffffffffffffffff1614611dd6576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611dcd90614460565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1603611e45576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611e3c906144f2565b60405180910390fd5b611e52838383600161293c565b8273ffffffffffffffffffffffffffffffffffffffff16611e7282610fc9565b73ffffffffffffffffffffffffffffffffffffffff1614611ec8576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611ebf90614460565b60405180910390fd5b6069600082815260200190815260200160002060006101000a81549073ffffffffffffffffffffffffffffffffffffffff02191690556001606860008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825403925050819055506001606860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282540192505081905550816067600083815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550808273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60405160405180910390a46120548383836001612942565b505050565b60606000825167ffffffffffffffff81111561207857612077612fff565b5b6040519080825280601f01601f1916602001820160405280156120aa5781602001600182028036833780820191505090505b50905060005b83518110156122015760418482815181106120ce576120cd613c8f565b5b602001015160f81c60f81b60f81c60ff16101580156121115750605a8482815181106120fd576120fc613c8f565b5b602001015160f81c60f81b60f81c60ff1611155b1561218d57602084828151811061212b5761212a613c8f565b5b602001015160f81c60f81b60f81c6121439190614512565b60f81b82828151811061215957612158613c8f565b5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053506121ee565b8381815181106121a05761219f613c8f565b5b602001015160f81c60f81b8282815181106121be576121bd613c8f565b5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053505b80806121f990613ced565b9150506120b0565b5080915050919050565b600081600001549050919050565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1603612288576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161227f90614593565b60405180910390fd5b612291816128fb565b156122d1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016122c8906145ff565b60405180910390fd5b6122df60008383600161293c565b6122e8816128fb565b15612328576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161231f906145ff565b60405180910390fd5b6001606860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282540192505081905550816067600083815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550808273ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60405160405180910390a4612432600083836001612942565b5050565b6001816000016000828254019250508190555050565b60006067600083815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050919050565b6000609760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905081609760006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b6000808273ffffffffffffffffffffffffffffffffffffffff163b119050919050565b600060019054906101000a900460ff166125c1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016125b890614691565b60405180910390fd5b6125cb8282612948565b5050565b600060019054906101000a900460ff1661261e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161261590614691565b60405180910390fd5b6126266129bb565b565b8173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1603612696576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161268d906146fd565b60405180910390fd5b80606a60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31836040516127879190612daa565b60405180910390a3505050565b61279f848484611d60565b6127ab84848484612a1c565b6127ea576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016127e19061478f565b60405180910390fd5b50505050565b60606040518060400160405280601a81526020017f68747470733a2f2f74727573746c6573732e646f6d61696e732f000000000000815250905090565b60606000600161283c84612ba3565b01905060008167ffffffffffffffff81111561285b5761285a612fff565b5b6040519080825280601f01601f19166020018201604052801561288d5781602001600182028036833780820191505090505b509050600082602001820190505b6001156128f0578080600190039150507f3031323334353637383961626364656600000000000000000000000000000000600a86061a8153600a85816128e4576128e36147af565b5b0494506000850361289b575b819350505050919050565b60008073ffffffffffffffffffffffffffffffffffffffff1661291d8361244c565b73ffffffffffffffffffffffffffffffffffffffff1614159050919050565b50505050565b50505050565b600060019054906101000a900460ff16612997576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161298e90614691565b60405180910390fd5b81606590816129a6919061403a565b5080606690816129b6919061403a565b505050565b600060019054906101000a900460ff16612a0a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612a0190614691565b60405180910390fd5b612a1a612a15611c0a565b612489565b565b6000612a3d8473ffffffffffffffffffffffffffffffffffffffff1661254f565b15612b96578373ffffffffffffffffffffffffffffffffffffffff1663150b7a02612a66611c0a565b8786866040518563ffffffff1660e01b8152600401612a8894939291906147de565b6020604051808303816000875af1925050508015612ac457506040513d601f19601f82011682018060405250810190612ac1919061483f565b60015b612b46573d8060008114612af4576040519150601f19603f3d011682016040523d82523d6000602084013e612af9565b606091505b506000815103612b3e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612b359061478f565b60405180910390fd5b805181602001fd5b63150b7a0260e01b7bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916817bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191614915050612b9b565b600190505b949350505050565b600080600090507a184f03e93ff9f4daa797ed6e38ed64bf6a1f0100000000000000008310612c01577a184f03e93ff9f4daa797ed6e38ed64bf6a1f0100000000000000008381612bf757612bf66147af565b5b0492506040810190505b6d04ee2d6d415b85acef81000000008310612c3e576d04ee2d6d415b85acef81000000008381612c3457612c336147af565b5b0492506020810190505b662386f26fc100008310612c6d57662386f26fc100008381612c6357612c626147af565b5b0492506010810190505b6305f5e1008310612c96576305f5e1008381612c8c57612c8b6147af565b5b0492506008810190505b6127108310612cbb576127108381612cb157612cb06147af565b5b0492506004810190505b60648310612cde5760648381612cd457612cd36147af565b5b0492506002810190505b600a8310612ced576001810190505b80915050919050565b6000604051905090565b600080fd5b600080fd5b60007fffffffff0000000000000000000000000000000000000000000000000000000082169050919050565b612d3f81612d0a565b8114612d4a57600080fd5b50565b600081359050612d5c81612d36565b92915050565b600060208284031215612d7857612d77612d00565b5b6000612d8684828501612d4d565b91505092915050565b60008115159050919050565b612da481612d8f565b82525050565b6000602082019050612dbf6000830184612d9b565b92915050565b6000819050919050565b612dd881612dc5565b8114612de357600080fd5b50565b600081359050612df581612dcf565b92915050565b600060208284031215612e1157612e10612d00565b5b6000612e1f84828501612de6565b91505092915050565b600081519050919050565b600082825260208201905092915050565b60005b83811015612e62578082015181840152602081019050612e47565b60008484015250505050565b6000601f19601f8301169050919050565b6000612e8a82612e28565b612e948185612e33565b9350612ea4818560208601612e44565b612ead81612e6e565b840191505092915050565b60006020820190508181036000830152612ed28184612e7f565b905092915050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000612f0582612eda565b9050919050565b612f1581612efa565b82525050565b6000602082019050612f306000830184612f0c565b92915050565b612f3f81612efa565b8114612f4a57600080fd5b50565b600081359050612f5c81612f36565b92915050565b60008060408385031215612f7957612f78612d00565b5b6000612f8785828601612f4d565b9250506020612f9885828601612de6565b9150509250929050565b600080600060608486031215612fbb57612fba612d00565b5b6000612fc986828701612f4d565b9350506020612fda86828701612f4d565b9250506040612feb86828701612de6565b9150509250925092565b600080fd5b600080fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b61303782612e6e565b810181811067ffffffffffffffff8211171561305657613055612fff565b5b80604052505050565b6000613069612cf6565b9050613075828261302e565b919050565b600067ffffffffffffffff82111561309557613094612fff565b5b61309e82612e6e565b9050602081019050919050565b82818337600083830152505050565b60006130cd6130c88461307a565b61305f565b9050828152602081018484840111156130e9576130e8612ffa565b5b6130f48482856130ab565b509392505050565b600082601f83011261311157613110612ff5565b5b81356131218482602086016130ba565b91505092915050565b6000806040838503121561314157613140612d00565b5b600061314f85828601612f4d565b925050602083013567ffffffffffffffff8111156131705761316f612d05565b5b61317c858286016130fc565b9150509250929050565b61318f81612dc5565b82525050565b60006020820190506131aa6000830184613186565b92915050565b600067ffffffffffffffff8211156131cb576131ca612fff565b5b602082029050602081019050919050565b600080fd5b60006131f46131ef846131b0565b61305f565b90508083825260208201905060208402830185811115613217576132166131dc565b5b835b8181101561325e57803567ffffffffffffffff81111561323c5761323b612ff5565b5b80860161324989826130fc565b85526020850194505050602081019050613219565b5050509392505050565b600082601f83011261327d5761327c612ff5565b5b813561328d8482602086016131e1565b91505092915050565b600080604083850312156132ad576132ac612d00565b5b60006132bb85828601612f4d565b925050602083013567ffffffffffffffff8111156132dc576132db612d05565b5b6132e885828601613268565b9150509250929050565b6000806040838503121561330957613308612d00565b5b600061331785828601612de6565b925050602061332885828601612f4d565b9150509250929050565b600081519050919050565b600082825260208201905092915050565b600061335982613332565b613363818561333d565b9350613373818560208601612e44565b61337c81612e6e565b840191505092915050565b600060208201905081810360008301526133a1818461334e565b905092915050565b6000602082840312156133bf576133be612d00565b5b600082013567ffffffffffffffff8111156133dd576133dc612d05565b5b6133e9848285016130fc565b91505092915050565b60006020828403121561340857613407612d00565b5b600061341684828501612f4d565b91505092915050565b61342881612d8f565b811461343357600080fd5b50565b6000813590506134458161341f565b92915050565b6000806040838503121561346257613461612d00565b5b600061347085828601612f4d565b925050602061348185828601613436565b9150509250929050565b600080600080608085870312156134a5576134a4612d00565b5b60006134b387828801612f4d565b94505060206134c487828801612f4d565b93505060406134d587828801612de6565b925050606085013567ffffffffffffffff8111156134f6576134f5612d05565b5b613502878288016130fc565b91505092959194509250565b600067ffffffffffffffff82111561352957613528612fff565b5b61353282612e6e565b9050602081019050919050565b600061355261354d8461350e565b61305f565b90508281526020810184848401111561356e5761356d612ffa565b5b6135798482856130ab565b509392505050565b600082601f83011261359657613595612ff5565b5b81356135a684826020860161353f565b91505092915050565b6000806000606084860312156135c8576135c7612d00565b5b60006135d686828701612de6565b935050602084013567ffffffffffffffff8111156135f7576135f6612d05565b5b613603868287016130fc565b925050604084013567ffffffffffffffff81111561362457613623612d05565b5b61363086828701613581565b9150509250925092565b6000806040838503121561365157613650612d00565b5b600061365f85828601612f4d565b925050602061367085828601612f4d565b9150509250929050565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b600082825260208201905092915050565b60006136c282613332565b6136cc81856136a6565b93506136dc818560208601612e44565b6136e581612e6e565b840191505092915050565b60006136fc83836136b7565b905092915050565b6000602082019050919050565b600061371c8261367a565b6137268185613685565b93508360208202850161373885613696565b8060005b85811015613774578484038952815161375585826136f0565b945061376083613704565b925060208a0199505060018101905061373c565b50829750879550505050505092915050565b600060208201905081810360008301526137a08184613711565b905092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b600060028204905060018216806137ef57607f821691505b602082108103613802576138016137a8565b5b50919050565b7f4552433732313a20617070726f76616c20746f2063757272656e74206f776e6560008201527f7200000000000000000000000000000000000000000000000000000000000000602082015250565b6000613864602183612e33565b915061386f82613808565b604082019050919050565b6000602082019050818103600083015261389381613857565b9050919050565b7f4552433732313a20617070726f76652063616c6c6572206973206e6f7420746f60008201527f6b656e206f776e6572206f7220617070726f76656420666f7220616c6c000000602082015250565b60006138f6603d83612e33565b91506139018261389a565b604082019050919050565b60006020820190508181036000830152613925816138e9565b9050919050565b7f4552433732313a2063616c6c6572206973206e6f7420746f6b656e206f776e6560008201527f72206f7220617070726f76656400000000000000000000000000000000000000602082015250565b6000613988602d83612e33565b91506139938261392c565b604082019050919050565b600060208201905081810360008301526139b78161397b565b9050919050565b600081905092915050565b60006139d482613332565b6139de81856139be565b93506139ee818560208601612e44565b80840191505092915050565b6000613a0682846139c9565b915081905092915050565b60008190508160005260206000209050919050565b60006020601f8301049050919050565b600082821b905092915050565b600060088302613a737fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82613a36565b613a7d8683613a36565b95508019841693508086168417925050509392505050565b6000819050919050565b6000613aba613ab5613ab084612dc5565b613a95565b612dc5565b9050919050565b6000819050919050565b613ad483613a9f565b613ae8613ae082613ac1565b848454613a43565b825550505050565b600090565b613afd613af0565b613b08818484613acb565b505050565b5b81811015613b2c57613b21600082613af5565b600181019050613b0e565b5050565b601f821115613b7157613b4281613a11565b613b4b84613a26565b81016020851015613b5a578190505b613b6e613b6685613a26565b830182613b0d565b50505b505050565b600082821c905092915050565b6000613b9460001984600802613b76565b1980831691505092915050565b6000613bad8383613b83565b9150826002028217905092915050565b613bc682613332565b67ffffffffffffffff811115613bdf57613bde612fff565b5b613be982546137d7565b613bf4828285613b30565b600060209050601f831160018114613c275760008415613c15578287015190505b613c1f8582613ba1565b865550613c87565b601f198416613c3586613a11565b60005b82811015613c5d57848901518255600182019150602085019450602081019050613c38565b86831015613c7a5784890151613c76601f891682613b83565b8355505b6001600288020188555050505b505050505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b6000613cf882612dc5565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8203613d2a57613d29613cbe565b5b600182019050919050565b7f4552433732313a20696e76616c696420746f6b656e2049440000000000000000600082015250565b6000613d6b601883612e33565b9150613d7682613d35565b602082019050919050565b60006020820190508181036000830152613d9a81613d5e565b9050919050565b7f4552433732313a2061646472657373207a65726f206973206e6f74206120766160008201527f6c6964206f776e65720000000000000000000000000000000000000000000000602082015250565b6000613dfd602983612e33565b9150613e0882613da1565b604082019050919050565b60006020820190508181036000830152613e2c81613df0565b9050919050565b7f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160008201527f647920696e697469616c697a6564000000000000000000000000000000000000602082015250565b6000613e8f602e83612e33565b9150613e9a82613e33565b604082019050919050565b60006020820190508181036000830152613ebe81613e82565b9050919050565b6000819050919050565b600060ff82169050919050565b6000613ef7613ef2613eed84613ec5565b613a95565b613ecf565b9050919050565b613f0781613edc565b82525050565b6000602082019050613f226000830184613efe565b92915050565b600081905092915050565b6000613f3e82612e28565b613f488185613f28565b9350613f58818560208601612e44565b80840191505092915050565b7f2f00000000000000000000000000000000000000000000000000000000000000600082015250565b6000613f9a600183613f28565b9150613fa582613f64565b600182019050919050565b6000613fbc8285613f33565b9150613fc782613f8d565b9150613fd38284613f33565b91508190509392505050565b60008190508160005260206000209050919050565b601f8211156140355761400681613fdf565b61400f84613a26565b8101602085101561401e578190505b61403261402a85613a26565b830182613b0d565b50505b505050565b61404382612e28565b67ffffffffffffffff81111561405c5761405b612fff565b5b61406682546137d7565b614071828285613ff4565b600060209050601f8311600181146140a45760008415614092578287015190505b61409c8582613ba1565b865550614104565b601f1984166140b286613fdf565b60005b828110156140da578489015182556001820191506020850194506020810190506140b5565b868310156140f757848901516140f3601f891682613b83565b8355505b6001600288020188555050505b505050505050565b6000819050919050565b600061413161412c6141278461410c565b613a95565b612dc5565b9050919050565b61414181614116565b82525050565b600060608201905081810360008301526141618186612e7f565b90506141706020830185614138565b8181036040830152614182818461334e565b9050949350505050565b60006141988285613f33565b91506141a48284613f33565b91508190509392505050565b60006060820190506141c56000830186612f0c565b81810360208301526141d78185612e7f565b90506141e66040830184614138565b949350505050565b60006142016141fc8461307a565b61305f565b90508281526020810184848401111561421d5761421c612ffa565b5b614228848285612e44565b509392505050565b600082601f83011261424557614244612ff5565b5b81516142558482602086016141ee565b91505092915050565b6000819050919050565b6142718161425e565b811461427c57600080fd5b50565b60008151905061428e81614268565b92915050565b600080604083850312156142ab576142aa612d00565b5b600083015167ffffffffffffffff8111156142c9576142c8612d05565b5b6142d585828601614230565b92505060206142e68582860161427f565b9150509250929050565b7f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008201527f6464726573730000000000000000000000000000000000000000000000000000602082015250565b600061434c602683612e33565b9150614357826142f0565b604082019050919050565b6000602082019050818103600083015261437b8161433f565b9050919050565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b60006143b8602083612e33565b91506143c382614382565b602082019050919050565b600060208201905081810360008301526143e7816143ab565b9050919050565b7f4552433732313a207472616e736665722066726f6d20696e636f72726563742060008201527f6f776e6572000000000000000000000000000000000000000000000000000000602082015250565b600061444a602583612e33565b9150614455826143ee565b604082019050919050565b600060208201905081810360008301526144798161443d565b9050919050565b7f4552433732313a207472616e7366657220746f20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b60006144dc602483612e33565b91506144e782614480565b604082019050919050565b6000602082019050818103600083015261450b816144cf565b9050919050565b600061451d82613ecf565b915061452883613ecf565b9250828201905060ff81111561454157614540613cbe565b5b92915050565b7f4552433732313a206d696e7420746f20746865207a65726f2061646472657373600082015250565b600061457d602083612e33565b915061458882614547565b602082019050919050565b600060208201905081810360008301526145ac81614570565b9050919050565b7f4552433732313a20746f6b656e20616c7265616479206d696e74656400000000600082015250565b60006145e9601c83612e33565b91506145f4826145b3565b602082019050919050565b60006020820190508181036000830152614618816145dc565b9050919050565b7f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960008201527f6e697469616c697a696e67000000000000000000000000000000000000000000602082015250565b600061467b602b83612e33565b91506146868261461f565b604082019050919050565b600060208201905081810360008301526146aa8161466e565b9050919050565b7f4552433732313a20617070726f766520746f2063616c6c657200000000000000600082015250565b60006146e7601983612e33565b91506146f2826146b1565b602082019050919050565b60006020820190508181036000830152614716816146da565b9050919050565b7f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560008201527f63656976657220696d706c656d656e7465720000000000000000000000000000602082015250565b6000614779603283612e33565b91506147848261471d565b604082019050919050565b600060208201905081810360008301526147a88161476c565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b60006080820190506147f36000830187612f0c565b6148006020830186612f0c565b61480d6040830185613186565b818103606083015261481f818461334e565b905095945050505050565b60008151905061483981612d36565b92915050565b60006020828403121561485557614854612d00565b5b60006148638482850161482a565b9150509291505056fea264697066735822122098a50583ca4c4a94a0c1b7eec96740f222ba2a9d14e964408687313170285afb64736f6c63430008110033