Feature Tip: Add private address tag to any address under My Name Tag !
Overview
ETH Balance
0 ETH
Eth Value
$0.00Token Holdings
More Info
Private Name Tags
ContractCreator
TokenTracker
Latest 25 from a total of 1,037 transactions
Transaction Hash |
Method
|
Block
|
From
|
To
|
|||||
---|---|---|---|---|---|---|---|---|---|
Approve | 20001508 | 193 days ago | IN | 0 ETH | 0.00012537 | ||||
Approve | 19830661 | 216 days ago | IN | 0 ETH | 0.00012708 | ||||
Set Approval For... | 19796294 | 221 days ago | IN | 0 ETH | 0.00017625 | ||||
Approve | 19127746 | 315 days ago | IN | 0 ETH | 0.00081065 | ||||
Withdraw | 18170281 | 449 days ago | IN | 0 ETH | 0.00174726 | ||||
Deposit ERC721 | 17515261 | 541 days ago | IN | 0 ETH | 0.00082393 | ||||
Initialize Bundl... | 17515253 | 541 days ago | IN | 0 ETH | 0.00277647 | ||||
Approve | 16951314 | 621 days ago | IN | 0 ETH | 0.00058964 | ||||
Safe Transfer Fr... | 16842891 | 636 days ago | IN | 0 ETH | 0.00214359 | ||||
Set Approval For... | 16842815 | 636 days ago | IN | 0 ETH | 0.00130887 | ||||
Approve | 16830857 | 638 days ago | IN | 0 ETH | 0.00053814 | ||||
Withdraw | 16663316 | 661 days ago | IN | 0 ETH | 0.00284657 | ||||
Withdraw | 16596609 | 670 days ago | IN | 0 ETH | 0.00219985 | ||||
Approve | 16588719 | 672 days ago | IN | 0 ETH | 0.00072884 | ||||
Approve | 16425839 | 694 days ago | IN | 0 ETH | 0.00043215 | ||||
Withdraw | 15807184 | 781 days ago | IN | 0 ETH | 0.00140027 | ||||
Approve | 15732672 | 791 days ago | IN | 0 ETH | 0.00066295 | ||||
Approve | 15657489 | 802 days ago | IN | 0 ETH | 0.00018295 | ||||
Approve | 15657447 | 802 days ago | IN | 0 ETH | 0.00018202 | ||||
Withdraw | 15628253 | 806 days ago | IN | 0 ETH | 0.00107543 | ||||
Withdraw | 15628247 | 806 days ago | IN | 0 ETH | 0.00123064 | ||||
Withdraw | 15619486 | 807 days ago | IN | 0 ETH | 0.00168263 | ||||
Withdraw | 15616844 | 807 days ago | IN | 0 ETH | 0.00075364 | ||||
Withdraw | 15616684 | 807 days ago | IN | 0 ETH | 0.00081884 | ||||
Withdraw | 15611473 | 808 days ago | IN | 0 ETH | 0.00239406 |
View more zero value Internal Transactions in Advanced View mode
Advanced mode:
Loading...
Loading
Contract Name:
AssetWrapper
Compiler Version
v0.8.3+commit.8d00100c
Optimization Enabled:
Yes with 999999 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "@openzeppelin/contracts/token/ERC721/ERC721.sol"; import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol"; import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Burnable.sol"; import "@openzeppelin/contracts/token/ERC721/utils/ERC721Holder.sol"; import "@openzeppelin/contracts/token/ERC1155/utils/ERC1155Holder.sol"; import "@openzeppelin/contracts/token/ERC1155/IERC1155.sol"; import "@openzeppelin/contracts/utils/Context.sol"; import "@openzeppelin/contracts/utils/Counters.sol"; import "@openzeppelin/contracts/utils/math/SafeMath.sol"; import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol"; import "./interfaces/IAssetWrapper.sol"; import "./ERC721Permit.sol"; /** * @dev {ERC721} token allowing users to create bundles of assets. * * Users can create new bundles, which grants them an NFT to * reclaim all assets stored in the bundle. They can then * store various types of assets in that bundle. The bundle NFT * can then be used or traded as an asset in its own right. * At any time, the holder of the bundle NFT can redeem it for the * underlying assets. */ contract AssetWrapper is Context, ERC721Enumerable, ERC721Burnable, ERC1155Holder, ERC721Holder, ERC721Permit, IAssetWrapper { using Counters for Counters.Counter; using SafeMath for uint256; Counters.Counter private _tokenIdTracker; struct ERC20Holding { address tokenAddress; uint256 amount; } mapping(uint256 => ERC20Holding[]) public bundleERC20Holdings; struct ERC721Holding { address tokenAddress; uint256 tokenId; } mapping(uint256 => ERC721Holding[]) public bundleERC721Holdings; struct ERC1155Holding { address tokenAddress; uint256 tokenId; uint256 amount; } mapping(uint256 => ERC1155Holding[]) public bundleERC1155Holdings; mapping(uint256 => uint256) public bundleETHHoldings; /** * @dev Initializes the token with name and symbol parameters */ constructor(string memory name, string memory symbol) ERC721(name, symbol) ERC721Permit(name) {} /** * @inheritdoc IAssetWrapper */ function initializeBundle(address to) external override { _mint(to, _tokenIdTracker.current()); _tokenIdTracker.increment(); } /** * @inheritdoc IAssetWrapper */ function depositERC20( address tokenAddress, uint256 amount, uint256 bundleId ) external override { require(_exists(bundleId), "Bundle does not exist"); SafeERC20.safeTransferFrom(IERC20(tokenAddress), _msgSender(), address(this), amount); // Note: there can be multiple `ERC20Holding` objects for the same token contract // in a given bundle. We could deduplicate them here, though I don't think // it's worth the extra complexity - the end effect is the same in either case. bundleERC20Holdings[bundleId].push(ERC20Holding(tokenAddress, amount)); emit DepositERC20(_msgSender(), bundleId, tokenAddress, amount); } /** * @inheritdoc IAssetWrapper */ function depositERC721( address tokenAddress, uint256 tokenId, uint256 bundleId ) external override { require(_exists(bundleId), "Bundle does not exist"); IERC721(tokenAddress).transferFrom(_msgSender(), address(this), tokenId); bundleERC721Holdings[bundleId].push(ERC721Holding(tokenAddress, tokenId)); emit DepositERC721(_msgSender(), bundleId, tokenAddress, tokenId); } /** * @inheritdoc IAssetWrapper */ function depositERC1155( address tokenAddress, uint256 tokenId, uint256 amount, uint256 bundleId ) external override { require(_exists(bundleId), "Bundle does not exist"); IERC1155(tokenAddress).safeTransferFrom(_msgSender(), address(this), tokenId, amount, ""); bundleERC1155Holdings[bundleId].push(ERC1155Holding(tokenAddress, tokenId, amount)); emit DepositERC1155(_msgSender(), bundleId, tokenAddress, tokenId, amount); } /** * @inheritdoc IAssetWrapper */ function depositETH(uint256 bundleId) external payable override { require(_exists(bundleId), "Bundle does not exist"); uint256 amount = msg.value; bundleETHHoldings[bundleId] = bundleETHHoldings[bundleId].add(amount); emit DepositETH(_msgSender(), bundleId, amount); } /** * @inheritdoc IAssetWrapper */ function withdraw(uint256 bundleId) external override { require(_isApprovedOrOwner(_msgSender(), bundleId), "AssetWrapper: Non-owner withdrawal"); burn(bundleId); ERC20Holding[] memory erc20Holdings = bundleERC20Holdings[bundleId]; for (uint256 i = 0; i < erc20Holdings.length; i++) { SafeERC20.safeTransfer(IERC20(erc20Holdings[i].tokenAddress), _msgSender(), erc20Holdings[i].amount); } delete bundleERC20Holdings[bundleId]; ERC721Holding[] memory erc721Holdings = bundleERC721Holdings[bundleId]; for (uint256 i = 0; i < erc721Holdings.length; i++) { IERC721(erc721Holdings[i].tokenAddress).safeTransferFrom( address(this), _msgSender(), erc721Holdings[i].tokenId ); } delete bundleERC721Holdings[bundleId]; ERC1155Holding[] memory erc1155Holdings = bundleERC1155Holdings[bundleId]; for (uint256 i = 0; i < erc1155Holdings.length; i++) { IERC1155(erc1155Holdings[i].tokenAddress).safeTransferFrom( address(this), _msgSender(), erc1155Holdings[i].tokenId, erc1155Holdings[i].amount, "" ); } delete bundleERC1155Holdings[bundleId]; uint256 ethHoldings = bundleETHHoldings[bundleId]; // solhint-disable-next-line avoid-low-level-calls (bool success, ) = _msgSender().call{ value: ethHoldings }(""); require(success, "Failed to withdraw ETH"); delete bundleETHHoldings[bundleId]; emit Withdraw(_msgSender(), bundleId); } /** * @dev Hook that is called before any token transfer */ function _beforeTokenTransfer( address from, address to, uint256 tokenId ) internal virtual override(ERC721, ERC721Enumerable) { super._beforeTokenTransfer(from, to, tokenId); } /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override(ERC721, ERC721Enumerable, ERC1155Receiver) returns (bool) { return super.supportsInterface(interfaceId); } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "./IERC721.sol"; import "./IERC721Receiver.sol"; import "./extensions/IERC721Metadata.sol"; import "../../utils/Address.sol"; import "../../utils/Context.sol"; import "../../utils/Strings.sol"; import "../../utils/introspection/ERC165.sol"; /** * @dev Implementation of https://eips.ethereum.org/EIPS/eip-721[ERC721] Non-Fungible Token Standard, including * the Metadata extension, but not including the Enumerable extension, which is available separately as * {ERC721Enumerable}. */ contract ERC721 is Context, ERC165, IERC721, IERC721Metadata { using Address for address; using Strings for uint256; // Token name string private _name; // Token symbol string private _symbol; // Mapping from token ID to owner address mapping (uint256 => address) private _owners; // Mapping owner address to token count mapping (address => uint256) private _balances; // Mapping from token ID to approved address mapping (uint256 => address) private _tokenApprovals; // Mapping from owner to operator approvals mapping (address => mapping (address => bool)) private _operatorApprovals; /** * @dev Initializes the contract by setting a `name` and a `symbol` to the token collection. */ constructor (string memory name_, string memory symbol_) { _name = name_; _symbol = symbol_; } /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165, IERC165) returns (bool) { return interfaceId == type(IERC721).interfaceId || interfaceId == type(IERC721Metadata).interfaceId || super.supportsInterface(interfaceId); } /** * @dev See {IERC721-balanceOf}. */ function balanceOf(address owner) public view virtual override returns (uint256) { require(owner != address(0), "ERC721: balance query for the zero address"); return _balances[owner]; } /** * @dev See {IERC721-ownerOf}. */ function ownerOf(uint256 tokenId) public view virtual override returns (address) { address owner = _owners[tokenId]; require(owner != address(0), "ERC721: owner query for nonexistent token"); 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) { require(_exists(tokenId), "ERC721Metadata: URI query for nonexistent token"); string memory baseURI = _baseURI(); return bytes(baseURI).length > 0 ? string(abi.encodePacked(baseURI, tokenId.toString())) : ''; } /** * @dev Base URI for computing {tokenURI}. Empty by default, can be overriden * in child contracts. */ function _baseURI() internal view virtual returns (string memory) { return ""; } /** * @dev See {IERC721-approve}. */ function approve(address to, uint256 tokenId) public virtual override { address owner = ERC721.ownerOf(tokenId); require(to != owner, "ERC721: approval to current owner"); require(_msgSender() == owner || isApprovedForAll(owner, _msgSender()), "ERC721: approve caller is not owner nor approved for all" ); _approve(to, tokenId); } /** * @dev See {IERC721-getApproved}. */ function getApproved(uint256 tokenId) public view virtual override returns (address) { require(_exists(tokenId), "ERC721: approved query for nonexistent token"); return _tokenApprovals[tokenId]; } /** * @dev See {IERC721-setApprovalForAll}. */ function setApprovalForAll(address operator, bool approved) public virtual override { require(operator != _msgSender(), "ERC721: approve to caller"); _operatorApprovals[_msgSender()][operator] = approved; emit ApprovalForAll(_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: transfer caller is not owner nor 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: transfer caller is not owner nor 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 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 _owners[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) { require(_exists(tokenId), "ERC721: operator query for nonexistent token"); address owner = ERC721.ownerOf(tokenId); return (spender == owner || getApproved(tokenId) == spender || isApprovedForAll(owner, 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); _balances[to] += 1; _owners[tokenId] = to; emit Transfer(address(0), to, tokenId); } /** * @dev Destroys `tokenId`. * The approval is cleared when the token is burned. * * Requirements: * * - `tokenId` must exist. * * Emits a {Transfer} event. */ function _burn(uint256 tokenId) internal virtual { address owner = ERC721.ownerOf(tokenId); _beforeTokenTransfer(owner, address(0), tokenId); // Clear approvals _approve(address(0), tokenId); _balances[owner] -= 1; delete _owners[tokenId]; emit Transfer(owner, address(0), tokenId); } /** * @dev Transfers `tokenId` from `from` to `to`. * As opposed to {transferFrom}, this imposes no restrictions on msg.sender. * * Requirements: * * - `to` cannot be the zero address. * - `tokenId` token must be owned by `from`. * * Emits a {Transfer} event. */ function _transfer(address from, address to, uint256 tokenId) internal virtual { require(ERC721.ownerOf(tokenId) == from, "ERC721: transfer of token that is not own"); require(to != address(0), "ERC721: transfer to the zero address"); _beforeTokenTransfer(from, to, tokenId); // Clear approvals from the previous owner _approve(address(0), tokenId); _balances[from] -= 1; _balances[to] += 1; _owners[tokenId] = to; emit Transfer(from, to, tokenId); } /** * @dev Approve `to` to operate on `tokenId` * * Emits a {Approval} event. */ function _approve(address to, uint256 tokenId) internal virtual { _tokenApprovals[tokenId] = to; emit Approval(ERC721.ownerOf(tokenId), to, tokenId); } /** * @dev Internal function to invoke {IERC721Receiver-onERC721Received} on a target address. * The call is not executed if the target address is not a contract. * * @param from address representing the previous owner of the given token ID * @param to target address that will receive the tokens * @param tokenId uint256 ID of the token to be transferred * @param _data bytes optional data to send along with the call * @return bool whether the call correctly returned the expected magic value */ function _checkOnERC721Received(address from, address to, uint256 tokenId, bytes memory _data) private returns (bool) { if (to.isContract()) { try IERC721Receiver(to).onERC721Received(_msgSender(), from, tokenId, _data) returns (bytes4 retval) { return retval == IERC721Receiver(to).onERC721Received.selector; } catch (bytes memory reason) { if (reason.length == 0) { revert("ERC721: transfer to non ERC721Receiver implementer"); } else { // solhint-disable-next-line no-inline-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. * * Calling conditions: * * - When `from` and `to` are both non-zero, ``from``'s `tokenId` will be * transferred to `to`. * - When `from` is zero, `tokenId` will be minted for `to`. * - When `to` is zero, ``from``'s `tokenId` will be burned. * - `from` cannot be the zero address. * - `to` cannot be the zero address. * * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks]. */ function _beforeTokenTransfer(address from, address to, uint256 tokenId) internal virtual { } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "../ERC721.sol"; import "./IERC721Enumerable.sol"; /** * @dev This implements an optional extension of {ERC721} defined in the EIP that adds * enumerability of all the token ids in the contract as well as all token ids owned by each * account. */ abstract contract ERC721Enumerable is ERC721, IERC721Enumerable { // Mapping from owner to list of owned token IDs mapping(address => mapping(uint256 => uint256)) private _ownedTokens; // Mapping from token ID to index of the owner tokens list mapping(uint256 => uint256) private _ownedTokensIndex; // Array with all token ids, used for enumeration uint256[] private _allTokens; // Mapping from token id to position in the allTokens array mapping(uint256 => uint256) private _allTokensIndex; /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override(IERC165, ERC721) returns (bool) { return interfaceId == type(IERC721Enumerable).interfaceId || super.supportsInterface(interfaceId); } /** * @dev See {IERC721Enumerable-tokenOfOwnerByIndex}. */ function tokenOfOwnerByIndex(address owner, uint256 index) public view virtual override returns (uint256) { require(index < ERC721.balanceOf(owner), "ERC721Enumerable: owner index out of bounds"); return _ownedTokens[owner][index]; } /** * @dev See {IERC721Enumerable-totalSupply}. */ function totalSupply() public view virtual override returns (uint256) { return _allTokens.length; } /** * @dev See {IERC721Enumerable-tokenByIndex}. */ function tokenByIndex(uint256 index) public view virtual override returns (uint256) { require(index < ERC721Enumerable.totalSupply(), "ERC721Enumerable: global index out of bounds"); return _allTokens[index]; } /** * @dev Hook that is called before any token transfer. This includes minting * and burning. * * Calling conditions: * * - When `from` and `to` are both non-zero, ``from``'s `tokenId` will be * transferred to `to`. * - When `from` is zero, `tokenId` will be minted for `to`. * - When `to` is zero, ``from``'s `tokenId` will be burned. * - `from` cannot be the zero address. * - `to` cannot be the zero address. * * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks]. */ function _beforeTokenTransfer(address from, address to, uint256 tokenId) internal virtual override { super._beforeTokenTransfer(from, to, tokenId); if (from == address(0)) { _addTokenToAllTokensEnumeration(tokenId); } else if (from != to) { _removeTokenFromOwnerEnumeration(from, tokenId); } if (to == address(0)) { _removeTokenFromAllTokensEnumeration(tokenId); } else if (to != from) { _addTokenToOwnerEnumeration(to, tokenId); } } /** * @dev Private function to add a token to this extension's ownership-tracking data structures. * @param to address representing the new owner of the given token ID * @param tokenId uint256 ID of the token to be added to the tokens list of the given address */ function _addTokenToOwnerEnumeration(address to, uint256 tokenId) private { uint256 length = ERC721.balanceOf(to); _ownedTokens[to][length] = tokenId; _ownedTokensIndex[tokenId] = length; } /** * @dev Private function to add a token to this extension's token tracking data structures. * @param tokenId uint256 ID of the token to be added to the tokens list */ function _addTokenToAllTokensEnumeration(uint256 tokenId) private { _allTokensIndex[tokenId] = _allTokens.length; _allTokens.push(tokenId); } /** * @dev Private function to remove a token from this extension's ownership-tracking data structures. Note that * while the token is not assigned a new owner, the `_ownedTokensIndex` mapping is _not_ updated: this allows for * gas optimizations e.g. when performing a transfer operation (avoiding double writes). * This has O(1) time complexity, but alters the order of the _ownedTokens array. * @param from address representing the previous owner of the given token ID * @param tokenId uint256 ID of the token to be removed from the tokens list of the given address */ function _removeTokenFromOwnerEnumeration(address from, uint256 tokenId) private { // To prevent a gap in from's tokens array, we store the last token in the index of the token to delete, and // then delete the last slot (swap and pop). uint256 lastTokenIndex = ERC721.balanceOf(from) - 1; uint256 tokenIndex = _ownedTokensIndex[tokenId]; // When the token to delete is the last token, the swap operation is unnecessary if (tokenIndex != lastTokenIndex) { uint256 lastTokenId = _ownedTokens[from][lastTokenIndex]; _ownedTokens[from][tokenIndex] = lastTokenId; // Move the last token to the slot of the to-delete token _ownedTokensIndex[lastTokenId] = tokenIndex; // Update the moved token's index } // This also deletes the contents at the last position of the array delete _ownedTokensIndex[tokenId]; delete _ownedTokens[from][lastTokenIndex]; } /** * @dev Private function to remove a token from this extension's token tracking data structures. * This has O(1) time complexity, but alters the order of the _allTokens array. * @param tokenId uint256 ID of the token to be removed from the tokens list */ function _removeTokenFromAllTokensEnumeration(uint256 tokenId) private { // To prevent a gap in the tokens array, we store the last token in the index of the token to delete, and // then delete the last slot (swap and pop). uint256 lastTokenIndex = _allTokens.length - 1; uint256 tokenIndex = _allTokensIndex[tokenId]; // When the token to delete is the last token, the swap operation is unnecessary. However, since this occurs so // rarely (when the last minted token is burnt) that we still do the swap here to avoid the gas cost of adding // an 'if' statement (like in _removeTokenFromOwnerEnumeration) uint256 lastTokenId = _allTokens[lastTokenIndex]; _allTokens[tokenIndex] = lastTokenId; // Move the last token to the slot of the to-delete token _allTokensIndex[lastTokenId] = tokenIndex; // Update the moved token's index // This also deletes the contents at the last position of the array delete _allTokensIndex[tokenId]; _allTokens.pop(); } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "../ERC721.sol"; import "../../../utils/Context.sol"; /** * @title ERC721 Burnable Token * @dev ERC721 Token that can be irreversibly burned (destroyed). */ abstract contract ERC721Burnable is Context, ERC721 { /** * @dev Burns `tokenId`. See {ERC721-_burn}. * * Requirements: * * - The caller must own `tokenId` or be an approved operator. */ function burn(uint256 tokenId) public virtual { //solhint-disable-next-line max-line-length require(_isApprovedOrOwner(_msgSender(), tokenId), "ERC721Burnable: caller is not owner nor approved"); _burn(tokenId); } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "../IERC721Receiver.sol"; /** * @dev Implementation of the {IERC721Receiver} interface. * * Accepts all token transfers. * Make sure the contract is able to use its token with {IERC721-safeTransferFrom}, {IERC721-approve} or {IERC721-setApprovalForAll}. */ contract ERC721Holder is IERC721Receiver { /** * @dev See {IERC721Receiver-onERC721Received}. * * Always returns `IERC721Receiver.onERC721Received.selector`. */ function onERC721Received(address, address, uint256, bytes memory) public virtual override returns (bytes4) { return this.onERC721Received.selector; } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "./ERC1155Receiver.sol"; /** * @dev _Available since v3.1._ */ contract ERC1155Holder is ERC1155Receiver { function onERC1155Received(address, address, uint256, uint256, bytes memory) public virtual override returns (bytes4) { return this.onERC1155Received.selector; } function onERC1155BatchReceived(address, address, uint256[] memory, uint256[] memory, bytes memory) public virtual override returns (bytes4) { return this.onERC1155BatchReceived.selector; } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "../../utils/introspection/IERC165.sol"; /** * @dev Required interface of an ERC1155 compliant contract, as defined in the * https://eips.ethereum.org/EIPS/eip-1155[EIP]. * * _Available since v3.1._ */ interface IERC1155 is IERC165 { /** * @dev Emitted when `value` tokens of token type `id` are transferred from `from` to `to` by `operator`. */ event TransferSingle(address indexed operator, address indexed from, address indexed to, uint256 id, uint256 value); /** * @dev Equivalent to multiple {TransferSingle} events, where `operator`, `from` and `to` are the same for all * transfers. */ event TransferBatch(address indexed operator, address indexed from, address indexed to, uint256[] ids, uint256[] values); /** * @dev Emitted when `account` grants or revokes permission to `operator` to transfer their tokens, according to * `approved`. */ event ApprovalForAll(address indexed account, address indexed operator, bool approved); /** * @dev Emitted when the URI for token type `id` changes to `value`, if it is a non-programmatic URI. * * If an {URI} event was emitted for `id`, the standard * https://eips.ethereum.org/EIPS/eip-1155#metadata-extensions[guarantees] that `value` will equal the value * returned by {IERC1155MetadataURI-uri}. */ event URI(string value, uint256 indexed id); /** * @dev Returns the amount of tokens of token type `id` owned by `account`. * * Requirements: * * - `account` cannot be the zero address. */ function balanceOf(address account, uint256 id) external view returns (uint256); /** * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {balanceOf}. * * Requirements: * * - `accounts` and `ids` must have the same length. */ function balanceOfBatch(address[] calldata accounts, uint256[] calldata ids) external view returns (uint256[] memory); /** * @dev Grants or revokes permission to `operator` to transfer the caller's tokens, according to `approved`, * * Emits an {ApprovalForAll} event. * * Requirements: * * - `operator` cannot be the caller. */ function setApprovalForAll(address operator, bool approved) external; /** * @dev Returns true if `operator` is approved to transfer ``account``'s tokens. * * See {setApprovalForAll}. */ function isApprovedForAll(address account, address operator) external view returns (bool); /** * @dev Transfers `amount` tokens of token type `id` from `from` to `to`. * * Emits a {TransferSingle} event. * * Requirements: * * - `to` cannot be the zero address. * - If the caller is not `from`, it must be have been approved to spend ``from``'s tokens via {setApprovalForAll}. * - `from` must have a balance of tokens of type `id` of at least `amount`. * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155Received} and return the * acceptance magic value. */ function safeTransferFrom(address from, address to, uint256 id, uint256 amount, bytes calldata data) external; /** * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {safeTransferFrom}. * * Emits a {TransferBatch} event. * * Requirements: * * - `ids` and `amounts` must have the same length. * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155BatchReceived} and return the * acceptance magic value. */ function safeBatchTransferFrom(address from, address to, uint256[] calldata ids, uint256[] calldata amounts, bytes calldata data) external; }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; /* * @dev Provides information about the current execution context, including the * sender of the transaction and its data. While these are generally available * via msg.sender and msg.data, they should not be accessed in such a direct * manner, since when dealing with meta-transactions the account sending and * paying for execution may not be the actual sender (as far as an application * is concerned). * * This contract is only required for intermediate, library-like contracts. */ abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } function _msgData() internal view virtual returns (bytes calldata) { this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691 return msg.data; } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; /** * @title Counters * @author Matt Condon (@shrugs) * @dev Provides counters that can only be incremented or decremented by one. 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; } } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; // CAUTION // This version of SafeMath should only be used with Solidity 0.8 or later, // because it relies on the compiler's built in overflow checks. /** * @dev Wrappers over Solidity's arithmetic operations. * * NOTE: `SafeMath` is no longer needed starting with Solidity 0.8. The compiler * now has built in overflow checking. */ library SafeMath { /** * @dev Returns the addition of two unsigned integers, with an overflow flag. * * _Available since v3.4._ */ function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { uint256 c = a + b; if (c < a) return (false, 0); return (true, c); } } /** * @dev Returns the substraction of two unsigned integers, with an overflow flag. * * _Available since v3.4._ */ function trySub(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { if (b > a) return (false, 0); return (true, a - b); } } /** * @dev Returns the multiplication of two unsigned integers, with an overflow flag. * * _Available since v3.4._ */ function tryMul(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { // Gas optimization: this is cheaper than requiring 'a' not being zero, but the // benefit is lost if 'b' is also tested. // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522 if (a == 0) return (true, 0); uint256 c = a * b; if (c / a != b) return (false, 0); return (true, c); } } /** * @dev Returns the division of two unsigned integers, with a division by zero flag. * * _Available since v3.4._ */ function tryDiv(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { if (b == 0) return (false, 0); return (true, a / b); } } /** * @dev Returns the remainder of dividing two unsigned integers, with a division by zero flag. * * _Available since v3.4._ */ function tryMod(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { if (b == 0) return (false, 0); return (true, a % b); } } /** * @dev Returns the addition of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `+` operator. * * Requirements: * * - Addition cannot overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256) { return a + b; } /** * @dev Returns the subtraction of two unsigned integers, reverting on * overflow (when the result is negative). * * Counterpart to Solidity's `-` operator. * * Requirements: * * - Subtraction cannot overflow. */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { return a - b; } /** * @dev Returns the multiplication of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `*` operator. * * Requirements: * * - Multiplication cannot overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { return a * b; } /** * @dev Returns the integer division of two unsigned integers, reverting on * division by zero. The result is rounded towards zero. * * Counterpart to Solidity's `/` operator. * * Requirements: * * - The divisor cannot be zero. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { return a / b; } /** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * reverting when dividing by zero. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function mod(uint256 a, uint256 b) internal pure returns (uint256) { return a % b; } /** * @dev Returns the subtraction of two unsigned integers, reverting with custom message on * overflow (when the result is negative). * * CAUTION: This function is deprecated because it requires allocating memory for the error * message unnecessarily. For custom revert reasons use {trySub}. * * Counterpart to Solidity's `-` operator. * * Requirements: * * - Subtraction cannot overflow. */ function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { unchecked { require(b <= a, errorMessage); return a - b; } } /** * @dev Returns the integer division of two unsigned integers, reverting with custom message on * division by zero. The result is rounded towards zero. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Counterpart to Solidity's `/` operator. Note: this function uses a * `revert` opcode (which leaves remaining gas untouched) while Solidity * uses an invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { unchecked { require(b > 0, errorMessage); return a / b; } } /** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * reverting with custom message when dividing by zero. * * CAUTION: This function is deprecated because it requires allocating memory for the error * message unnecessarily. For custom revert reasons use {tryMod}. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { unchecked { require(b > 0, errorMessage); return a % b; } } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "../IERC20.sol"; import "../../../utils/Address.sol"; /** * @title SafeERC20 * @dev Wrappers around ERC20 operations that throw on failure (when the token * contract returns false). Tokens that return no value (and instead revert or * throw on failure) are also supported, non-reverting calls are assumed to be * successful. * To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract, * which allows you to call the safe operations as `token.safeTransfer(...)`, etc. */ library SafeERC20 { using Address for address; function safeTransfer(IERC20 token, address to, uint256 value) internal { _callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value)); } function safeTransferFrom(IERC20 token, address from, address to, uint256 value) internal { _callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value)); } /** * @dev Deprecated. This function has issues similar to the ones found in * {IERC20-approve}, and its usage is discouraged. * * Whenever possible, use {safeIncreaseAllowance} and * {safeDecreaseAllowance} instead. */ function safeApprove(IERC20 token, address spender, uint256 value) internal { // safeApprove should only be called when setting an initial allowance, // or when resetting it to zero. To increase and decrease it, use // 'safeIncreaseAllowance' and 'safeDecreaseAllowance' // solhint-disable-next-line max-line-length require((value == 0) || (token.allowance(address(this), spender) == 0), "SafeERC20: approve from non-zero to non-zero allowance" ); _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value)); } function safeIncreaseAllowance(IERC20 token, address spender, uint256 value) internal { uint256 newAllowance = token.allowance(address(this), spender) + value; _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance)); } function safeDecreaseAllowance(IERC20 token, address spender, uint256 value) internal { unchecked { uint256 oldAllowance = token.allowance(address(this), spender); require(oldAllowance >= value, "SafeERC20: decreased allowance below zero"); uint256 newAllowance = oldAllowance - value; _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance)); } } /** * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement * on the return value: the return value is optional (but if data is returned, it must not be false). * @param token The token targeted by the call. * @param data The call data (encoded using abi.encode or one of its variants). */ function _callOptionalReturn(IERC20 token, bytes memory data) private { // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since // we're implementing it ourselves. We use {Address.functionCall} to perform this call, which verifies that // the target address contains contract code and also asserts for success in the low-level call. bytes memory returndata = address(token).functionCall(data, "SafeERC20: low-level call failed"); if (returndata.length > 0) { // Return data is optional // solhint-disable-next-line max-line-length require(abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed"); } } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; /** * @dev Interface for an AssetWrapper contract */ interface IAssetWrapper { /** * @dev Emitted when an ERC20 token is deposited */ event DepositERC20(address indexed depositor, uint256 indexed bundleId, address tokenAddress, uint256 amount); /** * @dev Emitted when an ERC721 token is deposited */ event DepositERC721(address indexed depositor, uint256 indexed bundleId, address tokenAddress, uint256 tokenId); /** * @dev Emitted when an ERC1155 token is deposited */ event DepositERC1155( address indexed depositor, uint256 indexed bundleId, address tokenAddress, uint256 tokenId, uint256 amount ); /** * @dev Emitted when ETH is deposited */ event DepositETH(address indexed depositor, uint256 indexed bundleId, uint256 amount); /** * @dev Emitted when ETH is deposited */ event Withdraw(address indexed withdrawer, uint256 indexed bundleId); /** * @dev Creates a new bundle token for `to`. Its token ID will be * automatically assigned (and available on the emitted {IERC721-Transfer} event) * * See {ERC721-_mint}. */ function initializeBundle(address to) external; /** * @dev Deposit some ERC20 tokens into a given bundle * * Requirements: * * - The bundle with id `bundleId` must have been initialized with {initializeBundle} * - `amount` tokens from `msg.sender` on `tokenAddress` must have been approved to this contract */ function depositERC20( address tokenAddress, uint256 amount, uint256 bundleId ) external; /** * @dev Deposit an ERC721 token into a given bundle * * Requirements: * * - The bundle with id `bundleId` must have been initialized with {initializeBundle} * - The `tokenId` NFT from `msg.sender` on `tokenAddress` must have been approved to this contract */ function depositERC721( address tokenAddress, uint256 tokenId, uint256 bundleId ) external; /** * @dev Deposit an ERC1155 token into a given bundle * * Requirements: * * - The bundle with id `bundleId` must have been initialized with {initializeBundle} * - The `tokenId` from `msg.sender` on `tokenAddress` must have been approved for at least `amount`to this contract */ function depositERC1155( address tokenAddress, uint256 tokenId, uint256 amount, uint256 bundleId ) external; /** * @dev Deposit some ETH into a given bundle * * Requirements: * * - The bundle with id `bundleId` must have been initialized with {initializeBundle} */ function depositETH(uint256 bundleId) external payable; /** * @dev Withdraw all assets in the given bundle, returning them to the msg.sender * * Requirements: * * - The bundle with id `bundleId` must have been initialized with {initializeBundle} * - The bundle with id `bundleId` must be owned by or approved to msg.sender */ function withdraw(uint256 bundleId) external; }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "./interfaces/IERC721Permit.sol"; import "@openzeppelin/contracts/token/ERC721/ERC721.sol"; import "@openzeppelin/contracts/utils/cryptography/draft-EIP712.sol"; import "@openzeppelin/contracts/utils/cryptography/ECDSA.sol"; import "@openzeppelin/contracts/utils/Counters.sol"; /** * @dev Implementation of the ERC721 Permit extension allowing approvals to be made via signatures, as defined in * https://eips.ethereum.org/EIPS/eip-2612[EIP-2612]. * * See https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/utils/cryptography/draft-EIP712.sol * * Adds the {permit} method, which can be used to change an account's ERC721 allowance (see {IERC721-allowance}) by * presenting a message signed by the account. By not relying on `{IERC721-approve}`, the token holder account doesn't * need to send a transaction, and thus is not required to hold Ether at all. * * _Available since v3.4._ */ abstract contract ERC721Permit is ERC721, IERC721Permit, EIP712 { using Counters for Counters.Counter; mapping(address => Counters.Counter) private _nonces; // solhint-disable-next-line var-name-mixedcase bytes32 private immutable _PERMIT_TYPEHASH = keccak256("Permit(address owner,address spender,uint256 tokenId,uint256 nonce,uint256 deadline)"); /** * @dev Initializes the {EIP712} domain separator using the `name` parameter, and setting `version` to `"1"`. * * It's a good idea to use the same `name` that is defined as the ERC721 token name. */ constructor(string memory name) EIP712(name, "1") {} /** * @dev See {IERC721-permit}. */ function permit( address owner, address spender, uint256 tokenId, uint256 deadline, uint8 v, bytes32 r, bytes32 s ) public virtual override { require(block.timestamp <= deadline, "ERC721Permit: expired deadline"); require(owner == ERC721.ownerOf(tokenId), "ERC721Permit: not owner"); bytes32 structHash = keccak256(abi.encode(_PERMIT_TYPEHASH, owner, spender, tokenId, _useNonce(owner), deadline)); bytes32 hash = _hashTypedDataV4(structHash); address signer = ECDSA.recover(hash, v, r, s); require(signer == owner, "ERC721Permit: invalid signature"); _approve(spender, tokenId); } /** * @dev See {IERC721Permit-nonces}. */ function nonces(address owner) public view virtual override returns (uint256) { return _nonces[owner].current(); } /** * @dev See {IERC721Permit-DOMAIN_SEPARATOR}. */ // solhint-disable-next-line func-name-mixedcase function DOMAIN_SEPARATOR() external view override returns (bytes32) { return _domainSeparatorV4(); } /** * @dev "Consume a nonce": return the current value and increment. * * _Available since v4.1._ */ function _useNonce(address owner) internal virtual returns (uint256 current) { Counters.Counter storage nonce = _nonces[owner]; current = nonce.current(); nonce.increment(); } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "../../utils/introspection/IERC165.sol"; /** * @dev Required interface of an ERC721 compliant contract. */ interface IERC721 is IERC165 { /** * @dev Emitted when `tokenId` token is transferred from `from` to `to`. */ event Transfer(address indexed from, address indexed to, uint256 indexed tokenId); /** * @dev Emitted when `owner` enables `approved` to manage the `tokenId` token. */ event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId); /** * @dev Emitted when `owner` enables or disables (`approved`) `operator` to manage all of its assets. */ event ApprovalForAll(address indexed owner, address indexed operator, bool approved); /** * @dev Returns the number of tokens in ``owner``'s account. */ function balanceOf(address owner) external view returns (uint256 balance); /** * @dev Returns the owner of the `tokenId` token. * * Requirements: * * - `tokenId` must exist. */ function ownerOf(uint256 tokenId) external view returns (address owner); /** * @dev Safely transfers `tokenId` token from `from` to `to`, 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 be 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: Usage of this method is discouraged, use {safeTransferFrom} whenever possible. * * 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 Returns the account approved for `tokenId` token. * * Requirements: * * - `tokenId` must exist. */ function getApproved(uint256 tokenId) external view returns (address operator); /** * @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 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); /** * @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; }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; /** * @title ERC721 token receiver interface * @dev Interface for any contract that wants to support safeTransfers * from ERC721 asset contracts. */ interface IERC721Receiver { /** * @dev Whenever an {IERC721} `tokenId` token is transferred to this contract via {IERC721-safeTransferFrom} * by `operator` from `from`, this function is called. * * It must return its Solidity selector to confirm the token transfer. * If any other value is returned or the interface is not implemented by the recipient, the transfer will be reverted. * * The selector can be obtained in Solidity with `IERC721.onERC721Received.selector`. */ function onERC721Received(address operator, address from, uint256 tokenId, bytes calldata data) external returns (bytes4); }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "../IERC721.sol"; /** * @title ERC-721 Non-Fungible Token Standard, optional metadata extension * @dev See https://eips.ethereum.org/EIPS/eip-721 */ interface IERC721Metadata is IERC721 { /** * @dev Returns the token collection name. */ function name() external view returns (string memory); /** * @dev Returns the token collection symbol. */ function symbol() external view returns (string memory); /** * @dev Returns the Uniform Resource Identifier (URI) for `tokenId` token. */ function tokenURI(uint256 tokenId) external view returns (string memory); }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; /** * @dev Collection of functions related to the address type */ library Address { /** * @dev Returns true if `account` is a contract. * * [IMPORTANT] * ==== * It is unsafe to assume that an address for which this function returns * false is an externally-owned account (EOA) and not a contract. * * Among others, `isContract` will return false for the following * types of addresses: * * - an externally-owned account * - a contract in construction * - an address where a contract will be created * - an address where a contract lived, but was destroyed * ==== */ function isContract(address account) internal view returns (bool) { // This method relies on extcodesize, which returns 0 for contracts in // construction, since the code is only stored at the end of the // constructor execution. uint256 size; // solhint-disable-next-line no-inline-assembly assembly { size := extcodesize(account) } return size > 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://diligence.consensys.net/posts/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.5.11/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"); // solhint-disable-next-line avoid-low-level-calls, avoid-call-value (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 functionCall(target, data, "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"); require(isContract(target), "Address: call to non-contract"); // solhint-disable-next-line avoid-low-level-calls (bool success, bytes memory returndata) = target.call{ value: value }(data); return _verifyCallResult(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) { require(isContract(target), "Address: static call to non-contract"); // solhint-disable-next-line avoid-low-level-calls (bool success, bytes memory returndata) = target.staticcall(data); return _verifyCallResult(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) { require(isContract(target), "Address: delegate call to non-contract"); // solhint-disable-next-line avoid-low-level-calls (bool success, bytes memory returndata) = target.delegatecall(data); return _verifyCallResult(success, returndata, errorMessage); } function _verifyCallResult(bool success, bytes memory returndata, string memory errorMessage) private pure returns(bytes memory) { if (success) { return returndata; } else { // 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 // solhint-disable-next-line no-inline-assembly assembly { let returndata_size := mload(returndata) revert(add(32, returndata), returndata_size) } } else { revert(errorMessage); } } } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; /** * @dev String operations. */ library Strings { bytes16 private constant alphabet = "0123456789abcdef"; /** * @dev Converts a `uint256` to its ASCII `string` decimal representation. */ function toString(uint256 value) internal pure returns (string memory) { // Inspired by OraclizeAPI's implementation - MIT licence // https://github.com/oraclize/ethereum-api/blob/b42146b063c7d6ee1358846c198246239e9360e8/oraclizeAPI_0.4.25.sol if (value == 0) { return "0"; } uint256 temp = value; uint256 digits; while (temp != 0) { digits++; temp /= 10; } bytes memory buffer = new bytes(digits); while (value != 0) { digits -= 1; buffer[digits] = bytes1(uint8(48 + uint256(value % 10))); value /= 10; } return string(buffer); } /** * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation. */ function toHexString(uint256 value) internal pure returns (string memory) { if (value == 0) { return "0x00"; } uint256 temp = value; uint256 length = 0; while (temp != 0) { length++; temp >>= 8; } return toHexString(value, length); } /** * @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] = alphabet[value & 0xf]; value >>= 4; } require(value == 0, "Strings: hex length insufficient"); return string(buffer); } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "./IERC165.sol"; /** * @dev Implementation of the {IERC165} interface. * * Contracts that want to implement ERC165 should inherit from this contract and override {supportsInterface} to check * for the additional interface id that will be supported. For example: * * ```solidity * function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { * return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId); * } * ``` * * Alternatively, {ERC165Storage} provides an easier to use but more expensive implementation. */ abstract contract ERC165 is IERC165 { /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { return interfaceId == type(IERC165).interfaceId; } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; /** * @dev Interface of the ERC165 standard, as defined in the * https://eips.ethereum.org/EIPS/eip-165[EIP]. * * Implementers can declare support of contract interfaces, which can then be * queried by others ({ERC165Checker}). * * For an implementation, see {ERC165}. */ interface IERC165 { /** * @dev Returns true if this contract implements the interface defined by * `interfaceId`. See the corresponding * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section] * to learn more about how these ids are created. * * This function call must use less than 30 000 gas. */ function supportsInterface(bytes4 interfaceId) external view returns (bool); }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "../IERC721.sol"; /** * @title ERC-721 Non-Fungible Token Standard, optional enumeration extension * @dev See https://eips.ethereum.org/EIPS/eip-721 */ interface IERC721Enumerable is IERC721 { /** * @dev Returns the total amount of tokens stored by the contract. */ function totalSupply() external view returns (uint256); /** * @dev Returns a token ID owned by `owner` at a given `index` of its token list. * Use along with {balanceOf} to enumerate all of ``owner``'s tokens. */ function tokenOfOwnerByIndex(address owner, uint256 index) external view returns (uint256 tokenId); /** * @dev Returns a token ID at a given `index` of all the tokens stored by the contract. * Use along with {totalSupply} to enumerate all tokens. */ function tokenByIndex(uint256 index) external view returns (uint256); }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "../IERC1155Receiver.sol"; import "../../../utils/introspection/ERC165.sol"; /** * @dev _Available since v3.1._ */ abstract contract ERC1155Receiver is ERC165, IERC1155Receiver { /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165, IERC165) returns (bool) { return interfaceId == type(IERC1155Receiver).interfaceId || super.supportsInterface(interfaceId); } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "../../utils/introspection/IERC165.sol"; /** * @dev _Available since v3.1._ */ interface IERC1155Receiver is IERC165 { /** @dev Handles the receipt of a single ERC1155 token type. This function is called at the end of a `safeTransferFrom` after the balance has been updated. To accept the transfer, this must return `bytes4(keccak256("onERC1155Received(address,address,uint256,uint256,bytes)"))` (i.e. 0xf23a6e61, or its own function selector). @param operator The address which initiated the transfer (i.e. msg.sender) @param from The address which previously owned the token @param id The ID of the token being transferred @param value The amount of tokens being transferred @param data Additional data with no specified format @return `bytes4(keccak256("onERC1155Received(address,address,uint256,uint256,bytes)"))` if transfer is allowed */ function onERC1155Received( address operator, address from, uint256 id, uint256 value, bytes calldata data ) external returns(bytes4); /** @dev Handles the receipt of a multiple ERC1155 token types. This function is called at the end of a `safeBatchTransferFrom` after the balances have been updated. To accept the transfer(s), this must return `bytes4(keccak256("onERC1155BatchReceived(address,address,uint256[],uint256[],bytes)"))` (i.e. 0xbc197c81, or its own function selector). @param operator The address which initiated the batch transfer (i.e. msg.sender) @param from The address which previously owned the token @param ids An array containing ids of each token being transferred (order and length must match values array) @param values An array containing amounts of each token being transferred (order and length must match ids array) @param data Additional data with no specified format @return `bytes4(keccak256("onERC1155BatchReceived(address,address,uint256[],uint256[],bytes)"))` if transfer is allowed */ function onERC1155BatchReceived( address operator, address from, uint256[] calldata ids, uint256[] calldata values, bytes calldata data ) external returns(bytes4); }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; /** * @dev Interface of the ERC20 standard as defined in the EIP. */ interface IERC20 { /** * @dev Returns the amount of tokens in existence. */ function totalSupply() external view returns (uint256); /** * @dev Returns the amount of tokens owned by `account`. */ function balanceOf(address account) external view returns (uint256); /** * @dev Moves `amount` tokens from the caller's account to `recipient`. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transfer(address recipient, uint256 amount) external returns (bool); /** * @dev Returns the remaining number of tokens that `spender` will be * allowed to spend on behalf of `owner` through {transferFrom}. This is * zero by default. * * This value changes when {approve} or {transferFrom} are called. */ function allowance(address owner, address spender) external view returns (uint256); /** * @dev Sets `amount` as the allowance of `spender` over the caller's tokens. * * Returns a boolean value indicating whether the operation succeeded. * * IMPORTANT: Beware that changing an allowance with this method brings the risk * that someone may use both the old and the new allowance by unfortunate * transaction ordering. One possible solution to mitigate this race * condition is to first reduce the spender's allowance to 0 and set the * desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * * Emits an {Approval} event. */ function approve(address spender, uint256 amount) external returns (bool); /** * @dev Moves `amount` tokens from `sender` to `recipient` using the * allowance mechanism. `amount` is then deducted from the caller's * allowance. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); /** * @dev Emitted when `value` tokens are moved from one account (`from`) to * another (`to`). * * Note that `value` may be zero. */ event Transfer(address indexed from, address indexed to, uint256 value); /** * @dev Emitted when the allowance of a `spender` for an `owner` is set by * a call to {approve}. `value` is the new allowance. */ event Approval(address indexed owner, address indexed spender, uint256 value); }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "@openzeppelin/contracts/token/ERC721/IERC721.sol"; /** * @dev Interface for a permittable ERC721 contract * See https://eips.ethereum.org/EIPS/eip-2612[EIP-2612]. * * Adds the {permit} method, which can be used to change an account's ERC72 allowance (see {IERC721-allowance}) by * presenting a message signed by the account. By not relying on {IERC721-approve}, the token holder account doesn't * need to send a transaction, and thus is not required to hold Ether at all. */ interface IERC721Permit is IERC721 { /** * @dev Allows `spender` to spend `tokenID` which is owned by`owner`, * given ``owner``'s signed approval. * * Emits an {Approval} event. * * Requirements: * * - `spender` cannot be the zero address. * - `owner` must be the owner of `tokenId`. * - `deadline` must be a timestamp in the future. * - `v`, `r` and `s` must be a valid `secp256k1` signature from `owner` * over the EIP712-formatted function arguments. * - the signature must use ``owner``'s current nonce (see {nonces}). * * For more information on the signature format, see the * https://eips.ethereum.org/EIPS/eip-2612#specification[relevant EIP * section]. */ function permit( address owner, address spender, uint256 tokenId, uint256 deadline, uint8 v, bytes32 r, bytes32 s ) external; /** * @dev Returns the current nonce for `owner`. This value must be * included whenever a signature is generated for {permit}. * * Every successful call to {permit} increases ``owner``'s nonce by one. This * prevents a signature from being used multiple times. */ function nonces(address owner) external view returns (uint256); /** * @dev Returns the domain separator used in the encoding of the signature for {permit}, as defined by {EIP712}. */ // solhint-disable-next-line func-name-mixedcase function DOMAIN_SEPARATOR() external view returns (bytes32); }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "./ECDSA.sol"; /** * @dev https://eips.ethereum.org/EIPS/eip-712[EIP 712] is a standard for hashing and signing of typed structured data. * * The encoding specified in the EIP is very generic, and such a generic implementation in Solidity is not feasible, * thus this contract does not implement the encoding itself. Protocols need to implement the type-specific encoding * they need in their contracts using a combination of `abi.encode` and `keccak256`. * * This contract implements the EIP 712 domain separator ({_domainSeparatorV4}) that is used as part of the encoding * scheme, and the final step of the encoding to obtain the message digest that is then signed via ECDSA * ({_hashTypedDataV4}). * * The implementation of the domain separator was designed to be as efficient as possible while still properly updating * the chain id to protect against replay attacks on an eventual fork of the chain. * * NOTE: This contract implements the version of the encoding known as "v4", as implemented by the JSON RPC method * https://docs.metamask.io/guide/signing-data.html[`eth_signTypedDataV4` in MetaMask]. * * _Available since v3.4._ */ abstract contract EIP712 { /* solhint-disable var-name-mixedcase */ // Cache the domain separator as an immutable value, but also store the chain id that it corresponds to, in order to // invalidate the cached domain separator if the chain id changes. bytes32 private immutable _CACHED_DOMAIN_SEPARATOR; uint256 private immutable _CACHED_CHAIN_ID; bytes32 private immutable _HASHED_NAME; bytes32 private immutable _HASHED_VERSION; bytes32 private immutable _TYPE_HASH; /* solhint-enable var-name-mixedcase */ /** * @dev Initializes the domain separator and parameter caches. * * The meaning of `name` and `version` is specified in * https://eips.ethereum.org/EIPS/eip-712#definition-of-domainseparator[EIP 712]: * * - `name`: the user readable name of the signing domain, i.e. the name of the DApp or the protocol. * - `version`: the current major version of the signing domain. * * NOTE: These parameters cannot be changed except through a xref:learn::upgrading-smart-contracts.adoc[smart * contract upgrade]. */ constructor(string memory name, string memory version) { bytes32 hashedName = keccak256(bytes(name)); bytes32 hashedVersion = keccak256(bytes(version)); bytes32 typeHash = keccak256("EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)"); _HASHED_NAME = hashedName; _HASHED_VERSION = hashedVersion; _CACHED_CHAIN_ID = block.chainid; _CACHED_DOMAIN_SEPARATOR = _buildDomainSeparator(typeHash, hashedName, hashedVersion); _TYPE_HASH = typeHash; } /** * @dev Returns the domain separator for the current chain. */ function _domainSeparatorV4() internal view returns (bytes32) { if (block.chainid == _CACHED_CHAIN_ID) { return _CACHED_DOMAIN_SEPARATOR; } else { return _buildDomainSeparator(_TYPE_HASH, _HASHED_NAME, _HASHED_VERSION); } } function _buildDomainSeparator(bytes32 typeHash, bytes32 name, bytes32 version) private view returns (bytes32) { return keccak256( abi.encode( typeHash, name, version, block.chainid, address(this) ) ); } /** * @dev Given an already https://eips.ethereum.org/EIPS/eip-712#definition-of-hashstruct[hashed struct], this * function returns the hash of the fully encoded EIP712 message for this domain. * * This hash can be used together with {ECDSA-recover} to obtain the signer of a message. For example: * * ```solidity * bytes32 digest = _hashTypedDataV4(keccak256(abi.encode( * keccak256("Mail(address to,string contents)"), * mailTo, * keccak256(bytes(mailContents)) * ))); * address signer = ECDSA.recover(digest, signature); * ``` */ function _hashTypedDataV4(bytes32 structHash) internal view virtual returns (bytes32) { return ECDSA.toTypedDataHash(_domainSeparatorV4(), structHash); } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; /** * @dev Elliptic Curve Digital Signature Algorithm (ECDSA) operations. * * These functions can be used to verify that a message was signed by the holder * of the private keys of a given address. */ library ECDSA { /** * @dev Returns the address that signed a hashed message (`hash`) with * `signature`. This address can then be used for verification purposes. * * The `ecrecover` EVM opcode allows for malleable (non-unique) signatures: * this function rejects them by requiring the `s` value to be in the lower * half order, and the `v` value to be either 27 or 28. * * IMPORTANT: `hash` _must_ be the result of a hash operation for the * verification to be secure: it is possible to craft signatures that * recover to arbitrary addresses for non-hashed data. A safe way to ensure * this is by receiving a hash of the original message (which may otherwise * be too long), and then calling {toEthSignedMessageHash} on it. */ function recover(bytes32 hash, bytes memory signature) internal pure returns (address) { // Divide the signature in r, s and v variables bytes32 r; bytes32 s; uint8 v; // Check the signature length // - case 65: r,s,v signature (standard) // - case 64: r,vs signature (cf https://eips.ethereum.org/EIPS/eip-2098) _Available since v4.1._ if (signature.length == 65) { // ecrecover takes the signature parameters, and the only way to get them // currently is to use assembly. // solhint-disable-next-line no-inline-assembly assembly { r := mload(add(signature, 0x20)) s := mload(add(signature, 0x40)) v := byte(0, mload(add(signature, 0x60))) } } else if (signature.length == 64) { // ecrecover takes the signature parameters, and the only way to get them // currently is to use assembly. // solhint-disable-next-line no-inline-assembly assembly { let vs := mload(add(signature, 0x40)) r := mload(add(signature, 0x20)) s := and(vs, 0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff) v := add(shr(255, vs), 27) } } else { revert("ECDSA: invalid signature length"); } return recover(hash, v, r, s); } /** * @dev Overload of {ECDSA-recover} that receives the `v`, * `r` and `s` signature fields separately. */ function recover(bytes32 hash, uint8 v, bytes32 r, bytes32 s) internal pure returns (address) { // EIP-2 still allows signature malleability for ecrecover(). Remove this possibility and make the signature // unique. Appendix F in the Ethereum Yellow paper (https://ethereum.github.io/yellowpaper/paper.pdf), defines // the valid range for s in (281): 0 < s < secp256k1n ÷ 2 + 1, and for v in (282): v ∈ {27, 28}. Most // signatures from current libraries generate a unique signature with an s-value in the lower half order. // // If your library generates malleable signatures, such as s-values in the upper range, calculate a new s-value // with 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141 - s1 and flip v from 27 to 28 or // vice versa. If your library also generates signatures with 0/1 for v instead 27/28, add 27 to v to accept // these malleable signatures as well. require(uint256(s) <= 0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5D576E7357A4501DDFE92F46681B20A0, "ECDSA: invalid signature 's' value"); require(v == 27 || v == 28, "ECDSA: invalid signature 'v' value"); // If the signature is valid (and not malleable), return the signer address address signer = ecrecover(hash, v, r, s); require(signer != address(0), "ECDSA: invalid signature"); return signer; } /** * @dev Returns an Ethereum Signed Message, created from a `hash`. This * produces hash corresponding to the one signed with the * https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`] * JSON-RPC method as part of EIP-191. * * See {recover}. */ function toEthSignedMessageHash(bytes32 hash) internal pure returns (bytes32) { // 32 is the length in bytes of hash, // enforced by the type signature above return keccak256(abi.encodePacked("\x19Ethereum Signed Message:\n32", hash)); } /** * @dev Returns an Ethereum Signed Typed Data, created from a * `domainSeparator` and a `structHash`. This produces hash corresponding * to the one signed with the * https://eips.ethereum.org/EIPS/eip-712[`eth_signTypedData`] * JSON-RPC method as part of EIP-712. * * See {recover}. */ function toTypedDataHash(bytes32 domainSeparator, bytes32 structHash) internal pure returns (bytes32) { return keccak256(abi.encodePacked("\x19\x01", domainSeparator, structHash)); } }
{ "metadata": { "bytecodeHash": "none" }, "optimizer": { "enabled": true, "runs": 999999 }, "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "abi" ] } }, "libraries": {} }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"inputs":[{"internalType":"string","name":"name","type":"string"},{"internalType":"string","name":"symbol","type":"string"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"approved","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"operator","type":"address"},{"indexed":false,"internalType":"bool","name":"approved","type":"bool"}],"name":"ApprovalForAll","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"depositor","type":"address"},{"indexed":true,"internalType":"uint256","name":"bundleId","type":"uint256"},{"indexed":false,"internalType":"address","name":"tokenAddress","type":"address"},{"indexed":false,"internalType":"uint256","name":"tokenId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"DepositERC1155","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"depositor","type":"address"},{"indexed":true,"internalType":"uint256","name":"bundleId","type":"uint256"},{"indexed":false,"internalType":"address","name":"tokenAddress","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"DepositERC20","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"depositor","type":"address"},{"indexed":true,"internalType":"uint256","name":"bundleId","type":"uint256"},{"indexed":false,"internalType":"address","name":"tokenAddress","type":"address"},{"indexed":false,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"DepositERC721","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"depositor","type":"address"},{"indexed":true,"internalType":"uint256","name":"bundleId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"DepositETH","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Transfer","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"withdrawer","type":"address"},{"indexed":true,"internalType":"uint256","name":"bundleId","type":"uint256"}],"name":"Withdraw","type":"event"},{"inputs":[],"name":"DOMAIN_SEPARATOR","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"approve","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint256","name":"","type":"uint256"}],"name":"bundleERC1155Holdings","outputs":[{"internalType":"address","name":"tokenAddress","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"uint256","name":"amount","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint256","name":"","type":"uint256"}],"name":"bundleERC20Holdings","outputs":[{"internalType":"address","name":"tokenAddress","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint256","name":"","type":"uint256"}],"name":"bundleERC721Holdings","outputs":[{"internalType":"address","name":"tokenAddress","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"bundleETHHoldings","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"burn","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"tokenAddress","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"uint256","name":"bundleId","type":"uint256"}],"name":"depositERC1155","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"tokenAddress","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"uint256","name":"bundleId","type":"uint256"}],"name":"depositERC20","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"tokenAddress","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"uint256","name":"bundleId","type":"uint256"}],"name":"depositERC721","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"bundleId","type":"uint256"}],"name":"depositETH","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"getApproved","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"}],"name":"initializeBundle","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"operator","type":"address"}],"name":"isApprovedForAll","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"nonces","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"address","name":"","type":"address"},{"internalType":"uint256[]","name":"","type":"uint256[]"},{"internalType":"uint256[]","name":"","type":"uint256[]"},{"internalType":"bytes","name":"","type":"bytes"}],"name":"onERC1155BatchReceived","outputs":[{"internalType":"bytes4","name":"","type":"bytes4"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"bytes","name":"","type":"bytes"}],"name":"onERC1155Received","outputs":[{"internalType":"bytes4","name":"","type":"bytes4"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"bytes","name":"","type":"bytes"}],"name":"onERC721Received","outputs":[{"internalType":"bytes4","name":"","type":"bytes4"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"ownerOf","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"uint256","name":"deadline","type":"uint256"},{"internalType":"uint8","name":"v","type":"uint8"},{"internalType":"bytes32","name":"r","type":"bytes32"},{"internalType":"bytes32","name":"s","type":"bytes32"}],"name":"permit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"bytes","name":"_data","type":"bytes"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"operator","type":"address"},{"internalType":"bool","name":"approved","type":"bool"}],"name":"setApprovalForAll","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"index","type":"uint256"}],"name":"tokenByIndex","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"uint256","name":"index","type":"uint256"}],"name":"tokenOfOwnerByIndex","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"tokenURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"transferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"bundleId","type":"uint256"}],"name":"withdraw","outputs":[],"stateMutability":"nonpayable","type":"function"}]
Contract Creation Code
6101406040527f48d39b37a35214940203bbbd4f383519797769b13d936f387d89430afef27688610120523480156200003757600080fd5b506040516200488c3803806200488c8339810160408190526200005a9162000295565b8180604051806040016040528060018152602001603160f81b81525084848160009080519060200190620000909291906200013c565b508051620000a69060019060208401906200013c565b5050825160209384012082519284019290922060c083815260e08290524660a0818152604080517f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f818a0181905281830198909852606081019590955260808086019390935230858301528051808603909201825293909201909252805194019390932090925261010052506200034f92505050565b8280546200014a90620002fc565b90600052602060002090601f0160209004810192826200016e5760008555620001b9565b82601f106200018957805160ff1916838001178555620001b9565b82800160010185558215620001b9579182015b82811115620001b95782518255916020019190600101906200019c565b50620001c7929150620001cb565b5090565b5b80821115620001c75760008155600101620001cc565b600082601f830112620001f3578081fd5b81516001600160401b038082111562000210576200021062000339565b604051601f8301601f19908116603f011681019082821181831017156200023b576200023b62000339565b8160405283815260209250868385880101111562000257578485fd5b8491505b838210156200027a57858201830151818301840152908201906200025b565b838211156200028b57848385830101525b9695505050505050565b60008060408385031215620002a8578182fd5b82516001600160401b0380821115620002bf578384fd5b620002cd86838701620001e2565b93506020850151915080821115620002e3578283fd5b50620002f285828601620001e2565b9150509250929050565b600181811c908216806200031157607f821691505b602082108114156200033357634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052604160045260246000fd5b60805160a05160c05160e05161010051610120516144ed6200039f6000396000611fe301526000612a4601526000612a9501526000612a70015260006129f201526000612a1b01526144ed6000f3fe6080604052600436106101fe5760003560e01c8063631e1c6c1161011d578063b88d4fde116100b0578063dcca39601161007f578063f23a6e6111610064578063f23a6e61146106d4578063f998fe9d14610719578063fc6bf13314610739576101fe565b8063dcca396014610632578063e985e9c51461067e576101fe565b8063b88d4fde1461058d578063bc197c81146105ad578063c87b56dd146105f2578063d505accf14610612576101fe565b80637298c736116100ec5780637298c7361461050b5780637ecebe001461053857806395d89b4114610558578063a22cb4651461056d576101fe565b8063631e1c6c146104595780636352211e146104795780636d5442c21461049957806370a08231146104eb576101fe565b80632e1a7d4d1161019557806342966c681161016457806342966c68146103e657806345a4276b146104065780634f6ccce7146104265780635358fbda14610446576101fe565b80632e1a7d4d146103715780632f745c59146103915780633644e515146103b157806342842e0e146103c6576101fe565b8063150b7a02116101d1578063150b7a02146102c157806318160ddd1461031257806321425ee01461033157806323b872dd14610351576101fe565b806301ffc9a71461020357806306fdde0314610238578063081812fc1461025a578063095ea7b31461029f575b600080fd5b34801561020f57600080fd5b5061022361021e36600461415c565b610759565b60405190151581526020015b60405180910390f35b34801561024457600080fd5b5061024d61076c565b60405161022f91906142ab565b34801561026657600080fd5b5061027a610275366004614194565b6107ff565b60405173ffffffffffffffffffffffffffffffffffffffff909116815260200161022f565b3480156102ab57600080fd5b506102bf6102ba3660046140ad565b6108de565b005b3480156102cd57600080fd5b506102e16102dc366004613f3d565b610a6b565b6040517fffffffff00000000000000000000000000000000000000000000000000000000909116815260200161022f565b34801561031e57600080fd5b506008545b60405190815260200161022f565b34801561033d57600080fd5b506102bf61034c3660046140d6565b610a95565b34801561035d57600080fd5b506102bf61036c366004613f02565b610c15565b34801561037d57600080fd5b506102bf61038c366004614194565b610cb7565b34801561039d57600080fd5b506103236103ac3660046140ad565b61141f565b3480156103bd57600080fd5b506103236114ee565b3480156103d257600080fd5b506102bf6103e1366004613f02565b6114fd565b3480156103f257600080fd5b506102bf610401366004614194565b611518565b34801561041257600080fd5b506102bf6104213660046140d6565b6115b9565b34801561043257600080fd5b50610323610441366004614194565b6117cc565b6102bf610454366004614194565b6118b1565b34801561046557600080fd5b506102bf610474366004613e10565b6119bb565b34801561048557600080fd5b5061027a610494366004614194565b6119db565b3480156104a557600080fd5b506104b96104b43660046141ac565b611a8d565b6040805173ffffffffffffffffffffffffffffffffffffffff909416845260208401929092529082015260600161022f565b3480156104f757600080fd5b50610323610506366004613e10565b611ae6565b34801561051757600080fd5b50610323610526366004614194565b600f6020526000908152604090205481565b34801561054457600080fd5b50610323610553366004613e10565b611bb4565b34801561056457600080fd5b5061024d611bdf565b34801561057957600080fd5b506102bf610588366004614077565b611bee565b34801561059957600080fd5b506102bf6105a8366004613f3d565b611d13565b3480156105b957600080fd5b506102e16105c8366004613e5c565b7fbc197c810000000000000000000000000000000000000000000000000000000095945050505050565b3480156105fe57600080fd5b5061024d61060d366004614194565b611dbb565b34801561061e57600080fd5b506102bf61062d366004614006565b611ed8565b34801561063e57600080fd5b5061065261064d3660046141ac565b612133565b6040805173ffffffffffffffffffffffffffffffffffffffff909316835260208301919091520161022f565b34801561068a57600080fd5b50610223610699366004613e2a565b73ffffffffffffffffffffffffffffffffffffffff918216600090815260056020908152604080832093909416825291909152205460ff1690565b3480156106e057600080fd5b506102e16106ef366004613fa3565b7ff23a6e610000000000000000000000000000000000000000000000000000000095945050505050565b34801561072557600080fd5b506102bf610734366004614108565b612186565b34801561074557600080fd5b506106526107543660046141ac565b6123cc565b6000610764826123e8565b90505b919050565b60606000805461077b9061437c565b80601f01602080910402602001604051908101604052809291908181526020018280546107a79061437c565b80156107f45780601f106107c9576101008083540402835291602001916107f4565b820191906000526020600020905b8154815290600101906020018083116107d757829003601f168201915b505050505090505b90565b60008181526002602052604081205473ffffffffffffffffffffffffffffffffffffffff166108b5576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602c60248201527f4552433732313a20617070726f76656420717565727920666f72206e6f6e657860448201527f697374656e7420746f6b656e000000000000000000000000000000000000000060648201526084015b60405180910390fd5b5060009081526004602052604090205473ffffffffffffffffffffffffffffffffffffffff1690565b60006108e9826119db565b90508073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156109a7576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602160248201527f4552433732313a20617070726f76616c20746f2063757272656e74206f776e6560448201527f720000000000000000000000000000000000000000000000000000000000000060648201526084016108ac565b3373ffffffffffffffffffffffffffffffffffffffff821614806109d057506109d08133610699565b610a5c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603860248201527f4552433732313a20617070726f76652063616c6c6572206973206e6f74206f7760448201527f6e6572206e6f7220617070726f76656420666f7220616c6c000000000000000060648201526084016108ac565b610a66838361243e565b505050565b7f150b7a02000000000000000000000000000000000000000000000000000000005b949350505050565b60008181526002602052604090205473ffffffffffffffffffffffffffffffffffffffff16610b20576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601560248201527f42756e646c6520646f6573206e6f74206578697374000000000000000000000060448201526064016108ac565b610b2c833330856124de565b6000818152600c60209081526040808320815180830190925273ffffffffffffffffffffffffffffffffffffffff8781168352828401878152825460018082018555938752949095209251600290940290920180547fffffffffffffffffffffffff00000000000000000000000000000000000000001693909216929092178155915191015580610bba3390565b6040805173ffffffffffffffffffffffffffffffffffffffff87811682526020820187905292909216917feee1a9363c8cef3e5872690139669b46cb0b21d9c57d568d17b7b306d96694f791015b60405180910390a3505050565b610c20335b826125ba565b610cac576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603160248201527f4552433732313a207472616e736665722063616c6c6572206973206e6f74206f60448201527f776e6572206e6f7220617070726f76656400000000000000000000000000000060648201526084016108ac565b610a66838383612726565b610cc033610c1a565b610d4c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602260248201527f4173736574577261707065723a204e6f6e2d6f776e657220776974686472617760448201527f616c00000000000000000000000000000000000000000000000000000000000060648201526084016108ac565b610d5581611518565b6000818152600c6020908152604080832080548251818502810185019093528083529192909190849084015b82821015610dd65760008481526020908190206040805180820190915260028502909101805473ffffffffffffffffffffffffffffffffffffffff168252600190810154828401529083529092019101610d81565b50505050905060005b8151811015610e9357610e81828281518110610e24577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001015160000151610e373390565b848481518110610e70577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001015160200151612998565b80610e8b816143ca565b915050610ddf565b506000828152600c60205260408120610eab91613c17565b6000828152600d6020908152604080832080548251818502810185019093528083529192909190849084015b82821015610f2c5760008481526020908190206040805180820190915260028502909101805473ffffffffffffffffffffffffffffffffffffffff168252600190810154828401529083529092019101610ed7565b50505050905060005b815181101561108c57818181518110610f77577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60200260200101516000015173ffffffffffffffffffffffffffffffffffffffff166342842e0e30610fa63390565b858581518110610fdf577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60209081029190910181015101516040517fffffffff0000000000000000000000000000000000000000000000000000000060e086901b16815273ffffffffffffffffffffffffffffffffffffffff93841660048201529290911660248301526044820152606401600060405180830381600087803b15801561106157600080fd5b505af1158015611075573d6000803e3d6000fd5b505050508080611084906143ca565b915050610f35565b506000838152600d602052604081206110a491613c17565b6000838152600e6020908152604080832080548251818502810185019093528083529192909190849084015b828210156111325760008481526020908190206040805160608101825260038602909201805473ffffffffffffffffffffffffffffffffffffffff168352600180820154848601526002909101549183019190915290835290920191016110d0565b50505050905060005b81518110156112ec5781818151811061117d577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60200260200101516000015173ffffffffffffffffffffffffffffffffffffffff1663f242432a306111ac3390565b8585815181106111e5577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60200260200101516020015186868151811061122a577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602090810291909101015160409081015190517fffffffff0000000000000000000000000000000000000000000000000000000060e087901b16815273ffffffffffffffffffffffffffffffffffffffff94851660048201529390921660248401526044830152606482015260a06084820152600060a482015260c401600060405180830381600087803b1580156112c157600080fd5b505af11580156112d5573d6000803e3d6000fd5b5050505080806112e4906143ca565b91505061113b565b506000848152600e6020526040812061130491613c38565b6000848152600f6020526040812054903373ffffffffffffffffffffffffffffffffffffffff168260405160006040518083038185875af1925050503d806000811461136c576040519150601f19603f3d011682016040523d82523d6000602084013e611371565b606091505b50509050806113dc576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f4661696c656420746f207769746864726177204554480000000000000000000060448201526064016108ac565b6000868152600f602052604080822082905551879133917f884edad9ce6fa2440d8a54cc123490eb96d2768479d49ff9c7366125a94243649190a3505050505050565b600061142a83611ae6565b82106114b8576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602b60248201527f455243373231456e756d657261626c653a206f776e657220696e646578206f7560448201527f74206f6620626f756e647300000000000000000000000000000000000000000060648201526084016108ac565b5073ffffffffffffffffffffffffffffffffffffffff919091166000908152600660209081526040808320938352929052205490565b60006114f86129ee565b905090565b610a6683838360405180602001604052806000815250611d13565b61152133610c1a565b6115ad576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603060248201527f4552433732314275726e61626c653a2063616c6c6572206973206e6f74206f7760448201527f6e6572206e6f7220617070726f7665640000000000000000000000000000000060648201526084016108ac565b6115b681612ae5565b50565b60008181526002602052604090205473ffffffffffffffffffffffffffffffffffffffff16611644576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601560248201527f42756e646c6520646f6573206e6f74206578697374000000000000000000000060448201526064016108ac565b73ffffffffffffffffffffffffffffffffffffffff83166323b872dd336040517fffffffff0000000000000000000000000000000000000000000000000000000060e084901b16815273ffffffffffffffffffffffffffffffffffffffff909116600482015230602482015260448101859052606401600060405180830381600087803b1580156116d457600080fd5b505af11580156116e8573d6000803e3d6000fd5b5050506000828152600d60209081526040808320815180830190925273ffffffffffffffffffffffffffffffffffffffff8881168352828401888152825460018082018555938752949095209251600290940290920180547fffffffffffffffffffffffff000000000000000000000000000000000000000016939092169290921781559151910155508061177a3390565b6040805173ffffffffffffffffffffffffffffffffffffffff87811682526020820187905292909216917f7a47efb9b86e599a690793c40afb239c7e3c6e8cc11439a9a6287798d46399a49101610c08565b60006117d760085490565b8210611865576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602c60248201527f455243373231456e756d657261626c653a20676c6f62616c20696e646578206f60448201527f7574206f6620626f756e6473000000000000000000000000000000000000000060648201526084016108ac565b6008828154811061189f577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b90600052602060002001549050919050565b60008181526002602052604090205473ffffffffffffffffffffffffffffffffffffffff1661193c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601560248201527f42756e646c6520646f6573206e6f74206578697374000000000000000000000060448201526064016108ac565b6000818152600f602052604090205434906119579082612bbe565b6000838152600f6020526040902055813373ffffffffffffffffffffffffffffffffffffffff167f57e8e547a3ef8d890c570ca885b0a8c441be3070e36b7ad4c7d6b9d9316ff2ce836040516119af91815260200190565b60405180910390a35050565b6119cd816119c8600b5490565b612bca565b6115b6600b80546001019055565b60008181526002602052604081205473ffffffffffffffffffffffffffffffffffffffff1680610764576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602960248201527f4552433732313a206f776e657220717565727920666f72206e6f6e657869737460448201527f656e7420746f6b656e000000000000000000000000000000000000000000000060648201526084016108ac565b600e6020528160005260406000208181548110611aa957600080fd5b600091825260209091206003909102018054600182015460029092015473ffffffffffffffffffffffffffffffffffffffff909116935090915083565b600073ffffffffffffffffffffffffffffffffffffffff8216611b8b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602a60248201527f4552433732313a2062616c616e636520717565727920666f7220746865207a6560448201527f726f20616464726573730000000000000000000000000000000000000000000060648201526084016108ac565b5073ffffffffffffffffffffffffffffffffffffffff1660009081526003602052604090205490565b73ffffffffffffffffffffffffffffffffffffffff81166000908152600a6020526040812054610764565b60606001805461077b9061437c565b73ffffffffffffffffffffffffffffffffffffffff8216331415611c6e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601960248201527f4552433732313a20617070726f766520746f2063616c6c65720000000000000060448201526064016108ac565b33600081815260056020908152604080832073ffffffffffffffffffffffffffffffffffffffff8716808552925290912080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00168415151790559073ffffffffffffffffffffffffffffffffffffffff167f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31836040516119af911515815260200190565b611d1d33836125ba565b611da9576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603160248201527f4552433732313a207472616e736665722063616c6c6572206973206e6f74206f60448201527f776e6572206e6f7220617070726f76656400000000000000000000000000000060648201526084016108ac565b611db584848484612d98565b50505050565b60008181526002602052604090205460609073ffffffffffffffffffffffffffffffffffffffff16611e6f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602f60248201527f4552433732314d657461646174613a2055524920717565727920666f72206e6f60448201527f6e6578697374656e7420746f6b656e000000000000000000000000000000000060648201526084016108ac565b6000611e8660408051602081019091526000815290565b90506000815111611ea65760405180602001604052806000815250611ed1565b80611eb084612e3b565b604051602001611ec1929190614233565b6040516020818303038152906040525b9392505050565b83421115611f42576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601e60248201527f4552433732315065726d69743a206578706972656420646561646c696e65000060448201526064016108ac565b611f4b856119db565b73ffffffffffffffffffffffffffffffffffffffff168773ffffffffffffffffffffffffffffffffffffffff1614611fdf576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601760248201527f4552433732315065726d69743a206e6f74206f776e657200000000000000000060448201526064016108ac565b60007f000000000000000000000000000000000000000000000000000000000000000088888861200e8c612fbc565b60408051602081019690965273ffffffffffffffffffffffffffffffffffffffff94851690860152929091166060840152608083015260a082015260c0810186905260e001604051602081830303815290604052805190602001209050600061207682612ff1565b905060006120868287878761305a565b90508973ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161461211d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f4552433732315065726d69743a20696e76616c6964207369676e61747572650060448201526064016108ac565b612127898961243e565b50505050505050505050565b600d602052816000526040600020818154811061214f57600080fd5b60009182526020909120600290910201805460019091015473ffffffffffffffffffffffffffffffffffffffff9091169250905082565b60008181526002602052604090205473ffffffffffffffffffffffffffffffffffffffff16612211576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601560248201527f42756e646c6520646f6573206e6f74206578697374000000000000000000000060448201526064016108ac565b73ffffffffffffffffffffffffffffffffffffffff841663f242432a336040517fffffffff0000000000000000000000000000000000000000000000000000000060e084901b16815273ffffffffffffffffffffffffffffffffffffffff9091166004820152306024820152604481018690526064810185905260a06084820152600060a482015260c401600060405180830381600087803b1580156122b657600080fd5b505af11580156122ca573d6000803e3d6000fd5b5050506000828152600e60209081526040808320815160608101835273ffffffffffffffffffffffffffffffffffffffff8a811682528185018a8152938201898152835460018082018655948852959096209151600390950290910180547fffffffffffffffffffffffff000000000000000000000000000000000000000016949091169390931783559051908201559051600290910155508061236b3390565b6040805173ffffffffffffffffffffffffffffffffffffffff8881168252602082018890529181018690529116907fb498002f49085cb108177238b25fbdd698b687feee33f473f774476fe5f812339060600160405180910390a350505050565b600c602052816000526040600020818154811061214f57600080fd5b60007fffffffff0000000000000000000000000000000000000000000000000000000082167f4e2312e00000000000000000000000000000000000000000000000000000000014806107645750610764826132b2565b600081815260046020526040902080547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff84169081179091558190612498826119db565b73ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b60405173ffffffffffffffffffffffffffffffffffffffff80851660248301528316604482015260648101829052611db59085907f23b872dd00000000000000000000000000000000000000000000000000000000906084015b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181529190526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fffffffff0000000000000000000000000000000000000000000000000000000090931692909217909152613308565b60008181526002602052604081205473ffffffffffffffffffffffffffffffffffffffff1661266b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602c60248201527f4552433732313a206f70657261746f7220717565727920666f72206e6f6e657860448201527f697374656e7420746f6b656e000000000000000000000000000000000000000060648201526084016108ac565b6000612676836119db565b90508073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614806126e557508373ffffffffffffffffffffffffffffffffffffffff166126cd846107ff565b73ffffffffffffffffffffffffffffffffffffffff16145b80610a8d575073ffffffffffffffffffffffffffffffffffffffff80821660009081526005602090815260408083209388168352929052205460ff16610a8d565b8273ffffffffffffffffffffffffffffffffffffffff16612746826119db565b73ffffffffffffffffffffffffffffffffffffffff16146127e9576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602960248201527f4552433732313a207472616e73666572206f6620746f6b656e2074686174206960448201527f73206e6f74206f776e000000000000000000000000000000000000000000000060648201526084016108ac565b73ffffffffffffffffffffffffffffffffffffffff821661288b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152602060048201526024808201527f4552433732313a207472616e7366657220746f20746865207a65726f2061646460448201527f726573730000000000000000000000000000000000000000000000000000000060648201526084016108ac565b612896838383613414565b6128a160008261243e565b73ffffffffffffffffffffffffffffffffffffffff831660009081526003602052604081208054600192906128d7908490614339565b909155505073ffffffffffffffffffffffffffffffffffffffff8216600090815260036020526040812080546001929061291290849061430d565b909155505060008181526002602052604080822080547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff86811691821790925591518493918716917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef91a4505050565b60405173ffffffffffffffffffffffffffffffffffffffff8316602482015260448101829052610a669084907fa9059cbb0000000000000000000000000000000000000000000000000000000090606401612538565b60007f0000000000000000000000000000000000000000000000000000000000000000461415612a3f57507f00000000000000000000000000000000000000000000000000000000000000006107fc565b50604080517f00000000000000000000000000000000000000000000000000000000000000006020808301919091527f0000000000000000000000000000000000000000000000000000000000000000828401527f000000000000000000000000000000000000000000000000000000000000000060608301524660808301523060a0808401919091528351808403909101815260c090920190925280519101206107fc565b6000612af0826119db565b9050612afe81600084613414565b612b0960008361243e565b73ffffffffffffffffffffffffffffffffffffffff81166000908152600360205260408120805460019290612b3f908490614339565b909155505060008281526002602052604080822080547fffffffffffffffffffffffff00000000000000000000000000000000000000001690555183919073ffffffffffffffffffffffffffffffffffffffff8416907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908390a45050565b6000611ed1828461430d565b73ffffffffffffffffffffffffffffffffffffffff8216612c47576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4552433732313a206d696e7420746f20746865207a65726f206164647265737360448201526064016108ac565b60008181526002602052604090205473ffffffffffffffffffffffffffffffffffffffff1615612cd3576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601c60248201527f4552433732313a20746f6b656e20616c7265616479206d696e7465640000000060448201526064016108ac565b612cdf60008383613414565b73ffffffffffffffffffffffffffffffffffffffff82166000908152600360205260408120805460019290612d1590849061430d565b909155505060008181526002602052604080822080547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff861690811790915590518392907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a45050565b612da3848484612726565b612daf8484848461341f565b611db5576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603260248201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560448201527f63656976657220696d706c656d656e746572000000000000000000000000000060648201526084016108ac565b606081612e7c575060408051808201909152600181527f30000000000000000000000000000000000000000000000000000000000000006020820152610767565b8160005b8115612ea65780612e90816143ca565b9150612e9f9050600a83614325565b9150612e80565b60008167ffffffffffffffff811115612ee8577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6040519080825280601f01601f191660200182016040528015612f12576020820181803683370190505b5090505b8415610a8d57612f27600183614339565b9150612f34600a86614403565b612f3f90603061430d565b60f81b818381518110612f7b577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a905350612fb5600a86614325565b9450612f16565b73ffffffffffffffffffffffffffffffffffffffff81166000908152600a602052604090208054600181018255905b50919050565b6000610764612ffe6129ee565b836040517f19010000000000000000000000000000000000000000000000000000000000006020820152602281018390526042810182905260009060620160405160208183030381529060405280519060200120905092915050565b60007f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a082111561310c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c60448201527f756500000000000000000000000000000000000000000000000000000000000060648201526084016108ac565b8360ff16601b148061312157508360ff16601c145b6131ad576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202776272076616c60448201527f756500000000000000000000000000000000000000000000000000000000000060648201526084016108ac565b6040805160008082526020820180845288905260ff871692820192909252606081018590526080810184905260019060a0016020604051602081039080840390855afa158015613201573d6000803e3d6000fd5b50506040517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0015191505073ffffffffffffffffffffffffffffffffffffffff81166132a9576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601860248201527f45434453413a20696e76616c6964207369676e6174757265000000000000000060448201526064016108ac565b95945050505050565b60007fffffffff0000000000000000000000000000000000000000000000000000000082167f780e9d6300000000000000000000000000000000000000000000000000000000148061076457506107648261361b565b600061336a826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c65648152508573ffffffffffffffffffffffffffffffffffffffff166136fe9092919063ffffffff16565b805190915015610a6657808060200190518101906133889190614140565b610a66576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e60448201527f6f7420737563636565640000000000000000000000000000000000000000000060648201526084016108ac565b610a6683838361370d565b600073ffffffffffffffffffffffffffffffffffffffff84163b15613613576040517f150b7a0200000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff85169063150b7a0290613496903390899088908890600401614262565b602060405180830381600087803b1580156134b057600080fd5b505af19250505080156134fe575060408051601f3d9081017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe01682019092526134fb91810190614178565b60015b6135c8573d80801561352c576040519150601f19603f3d011682016040523d82523d6000602084013e613531565b606091505b5080516135c0576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603260248201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560448201527f63656976657220696d706c656d656e746572000000000000000000000000000060648201526084016108ac565b805181602001fd5b7fffffffff00000000000000000000000000000000000000000000000000000000167f150b7a0200000000000000000000000000000000000000000000000000000000149050610a8d565b506001610a8d565b60007fffffffff0000000000000000000000000000000000000000000000000000000082167f80ac58cd0000000000000000000000000000000000000000000000000000000014806136ae57507fffffffff0000000000000000000000000000000000000000000000000000000082167f5b5e139f00000000000000000000000000000000000000000000000000000000145b8061076457507f01ffc9a7000000000000000000000000000000000000000000000000000000007fffffffff00000000000000000000000000000000000000000000000000000000831614610764565b6060610a8d8484600085613818565b73ffffffffffffffffffffffffffffffffffffffff83166137755761377081600880546000838152600960205260408120829055600182018355919091527ff3f7a9fe364faab93b216da50a3214154f22a0a2b415b23a84c8169e8b636ee30155565b6137b2565b8173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16146137b2576137b28382613998565b73ffffffffffffffffffffffffffffffffffffffff82166137db576137d681613a4f565b610a66565b8273ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614610a6657610a668282613b73565b6060824710156138aa576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f60448201527f722063616c6c000000000000000000000000000000000000000000000000000060648201526084016108ac565b843b613912576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e747261637400000060448201526064016108ac565b6000808673ffffffffffffffffffffffffffffffffffffffff16858760405161393b9190614217565b60006040518083038185875af1925050503d8060008114613978576040519150601f19603f3d011682016040523d82523d6000602084013e61397d565b606091505b509150915061398d828286613bc4565b979650505050505050565b600060016139a584611ae6565b6139af9190614339565b600083815260076020526040902054909150808214613a0f5773ffffffffffffffffffffffffffffffffffffffff841660009081526006602090815260408083208584528252808320548484528184208190558352600790915290208190555b50600091825260076020908152604080842084905573ffffffffffffffffffffffffffffffffffffffff9094168352600681528383209183525290812055565b600854600090613a6190600190614339565b60008381526009602052604081205460088054939450909284908110613ab0577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b906000526020600020015490508060088381548110613af8577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b6000918252602080832090910192909255828152600990915260408082208490558582528120556008805480613b57577f4e487b7100000000000000000000000000000000000000000000000000000000600052603160045260246000fd5b6001900381819060005260206000200160009055905550505050565b6000613b7e83611ae6565b73ffffffffffffffffffffffffffffffffffffffff9093166000908152600660209081526040808320868452825280832085905593825260079052919091209190915550565b60608315613bd3575081611ed1565b825115613be35782518084602001fd5b816040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016108ac91906142ab565b50805460008255600202906000526020600020908101906115b69190613c59565b50805460008255600302906000526020600020908101906115b69190613c9b565b5b80821115613c975780547fffffffffffffffffffffffff000000000000000000000000000000000000000016815560006001820155600201613c5a565b5090565b5b80821115613c975780547fffffffffffffffffffffffff00000000000000000000000000000000000000001681556000600182018190556002820155600301613c9c565b803573ffffffffffffffffffffffffffffffffffffffff8116811461076757600080fd5b600082601f830112613d14578081fd5b8135602067ffffffffffffffff821115613d3057613d30614475565b8160051b613d3f8282016142be565b838152828101908684018388018501891015613d59578687fd5b8693505b85841015613d7b578035835260019390930192918401918401613d5d565b50979650505050505050565b600082601f830112613d97578081fd5b813567ffffffffffffffff811115613db157613db1614475565b613de260207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f840116016142be565b818152846020838601011115613df6578283fd5b816020850160208301379081016020019190915292915050565b600060208284031215613e21578081fd5b611ed182613ce0565b60008060408385031215613e3c578081fd5b613e4583613ce0565b9150613e5360208401613ce0565b90509250929050565b600080600080600060a08688031215613e73578081fd5b613e7c86613ce0565b9450613e8a60208701613ce0565b9350604086013567ffffffffffffffff80821115613ea6578283fd5b613eb289838a01613d04565b94506060880135915080821115613ec7578283fd5b613ed389838a01613d04565b93506080880135915080821115613ee8578283fd5b50613ef588828901613d87565b9150509295509295909350565b600080600060608486031215613f16578283fd5b613f1f84613ce0565b9250613f2d60208501613ce0565b9150604084013590509250925092565b60008060008060808587031215613f52578384fd5b613f5b85613ce0565b9350613f6960208601613ce0565b925060408501359150606085013567ffffffffffffffff811115613f8b578182fd5b613f9787828801613d87565b91505092959194509250565b600080600080600060a08688031215613fba578081fd5b613fc386613ce0565b9450613fd160208701613ce0565b93506040860135925060608601359150608086013567ffffffffffffffff811115613ffa578182fd5b613ef588828901613d87565b600080600080600080600060e0888a031215614020578182fd5b61402988613ce0565b965061403760208901613ce0565b95506040880135945060608801359350608088013560ff8116811461405a578283fd5b9699959850939692959460a0840135945060c09093013592915050565b60008060408385031215614089578182fd5b61409283613ce0565b915060208301356140a2816144a4565b809150509250929050565b600080604083850312156140bf578182fd5b6140c883613ce0565b946020939093013593505050565b6000806000606084860312156140ea578081fd5b6140f384613ce0565b95602085013595506040909401359392505050565b6000806000806080858703121561411d578182fd5b61412685613ce0565b966020860135965060408601359560600135945092505050565b600060208284031215614151578081fd5b8151611ed1816144a4565b60006020828403121561416d578081fd5b8135611ed1816144b2565b600060208284031215614189578081fd5b8151611ed1816144b2565b6000602082840312156141a5578081fd5b5035919050565b600080604083850312156141be578182fd5b50508035926020909101359150565b600081518084526141e5816020860160208601614350565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169290920160200192915050565b60008251614229818460208701614350565b9190910192915050565b60008351614245818460208801614350565b835190830190614259818360208801614350565b01949350505050565b600073ffffffffffffffffffffffffffffffffffffffff8087168352808616602084015250836040830152608060608301526142a160808301846141cd565b9695505050505050565b600060208252611ed160208301846141cd565b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016810167ffffffffffffffff8111828210171561430557614305614475565b604052919050565b6000821982111561432057614320614417565b500190565b60008261433457614334614446565b500490565b60008282101561434b5761434b614417565b500390565b60005b8381101561436b578181015183820152602001614353565b83811115611db55750506000910152565b600181811c9082168061439057607f821691505b60208210811415612feb577f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156143fc576143fc614417565b5060010190565b60008261441257614412614446565b500690565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b80151581146115b657600080fd5b7fffffffff00000000000000000000000000000000000000000000000000000000811681146115b657600080fdfea164736f6c6343000803000a00000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000000000000000c417373657457726170706572000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000024157000000000000000000000000000000000000000000000000000000000000
Deployed Bytecode
0x6080604052600436106101fe5760003560e01c8063631e1c6c1161011d578063b88d4fde116100b0578063dcca39601161007f578063f23a6e6111610064578063f23a6e61146106d4578063f998fe9d14610719578063fc6bf13314610739576101fe565b8063dcca396014610632578063e985e9c51461067e576101fe565b8063b88d4fde1461058d578063bc197c81146105ad578063c87b56dd146105f2578063d505accf14610612576101fe565b80637298c736116100ec5780637298c7361461050b5780637ecebe001461053857806395d89b4114610558578063a22cb4651461056d576101fe565b8063631e1c6c146104595780636352211e146104795780636d5442c21461049957806370a08231146104eb576101fe565b80632e1a7d4d1161019557806342966c681161016457806342966c68146103e657806345a4276b146104065780634f6ccce7146104265780635358fbda14610446576101fe565b80632e1a7d4d146103715780632f745c59146103915780633644e515146103b157806342842e0e146103c6576101fe565b8063150b7a02116101d1578063150b7a02146102c157806318160ddd1461031257806321425ee01461033157806323b872dd14610351576101fe565b806301ffc9a71461020357806306fdde0314610238578063081812fc1461025a578063095ea7b31461029f575b600080fd5b34801561020f57600080fd5b5061022361021e36600461415c565b610759565b60405190151581526020015b60405180910390f35b34801561024457600080fd5b5061024d61076c565b60405161022f91906142ab565b34801561026657600080fd5b5061027a610275366004614194565b6107ff565b60405173ffffffffffffffffffffffffffffffffffffffff909116815260200161022f565b3480156102ab57600080fd5b506102bf6102ba3660046140ad565b6108de565b005b3480156102cd57600080fd5b506102e16102dc366004613f3d565b610a6b565b6040517fffffffff00000000000000000000000000000000000000000000000000000000909116815260200161022f565b34801561031e57600080fd5b506008545b60405190815260200161022f565b34801561033d57600080fd5b506102bf61034c3660046140d6565b610a95565b34801561035d57600080fd5b506102bf61036c366004613f02565b610c15565b34801561037d57600080fd5b506102bf61038c366004614194565b610cb7565b34801561039d57600080fd5b506103236103ac3660046140ad565b61141f565b3480156103bd57600080fd5b506103236114ee565b3480156103d257600080fd5b506102bf6103e1366004613f02565b6114fd565b3480156103f257600080fd5b506102bf610401366004614194565b611518565b34801561041257600080fd5b506102bf6104213660046140d6565b6115b9565b34801561043257600080fd5b50610323610441366004614194565b6117cc565b6102bf610454366004614194565b6118b1565b34801561046557600080fd5b506102bf610474366004613e10565b6119bb565b34801561048557600080fd5b5061027a610494366004614194565b6119db565b3480156104a557600080fd5b506104b96104b43660046141ac565b611a8d565b6040805173ffffffffffffffffffffffffffffffffffffffff909416845260208401929092529082015260600161022f565b3480156104f757600080fd5b50610323610506366004613e10565b611ae6565b34801561051757600080fd5b50610323610526366004614194565b600f6020526000908152604090205481565b34801561054457600080fd5b50610323610553366004613e10565b611bb4565b34801561056457600080fd5b5061024d611bdf565b34801561057957600080fd5b506102bf610588366004614077565b611bee565b34801561059957600080fd5b506102bf6105a8366004613f3d565b611d13565b3480156105b957600080fd5b506102e16105c8366004613e5c565b7fbc197c810000000000000000000000000000000000000000000000000000000095945050505050565b3480156105fe57600080fd5b5061024d61060d366004614194565b611dbb565b34801561061e57600080fd5b506102bf61062d366004614006565b611ed8565b34801561063e57600080fd5b5061065261064d3660046141ac565b612133565b6040805173ffffffffffffffffffffffffffffffffffffffff909316835260208301919091520161022f565b34801561068a57600080fd5b50610223610699366004613e2a565b73ffffffffffffffffffffffffffffffffffffffff918216600090815260056020908152604080832093909416825291909152205460ff1690565b3480156106e057600080fd5b506102e16106ef366004613fa3565b7ff23a6e610000000000000000000000000000000000000000000000000000000095945050505050565b34801561072557600080fd5b506102bf610734366004614108565b612186565b34801561074557600080fd5b506106526107543660046141ac565b6123cc565b6000610764826123e8565b90505b919050565b60606000805461077b9061437c565b80601f01602080910402602001604051908101604052809291908181526020018280546107a79061437c565b80156107f45780601f106107c9576101008083540402835291602001916107f4565b820191906000526020600020905b8154815290600101906020018083116107d757829003601f168201915b505050505090505b90565b60008181526002602052604081205473ffffffffffffffffffffffffffffffffffffffff166108b5576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602c60248201527f4552433732313a20617070726f76656420717565727920666f72206e6f6e657860448201527f697374656e7420746f6b656e000000000000000000000000000000000000000060648201526084015b60405180910390fd5b5060009081526004602052604090205473ffffffffffffffffffffffffffffffffffffffff1690565b60006108e9826119db565b90508073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156109a7576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602160248201527f4552433732313a20617070726f76616c20746f2063757272656e74206f776e6560448201527f720000000000000000000000000000000000000000000000000000000000000060648201526084016108ac565b3373ffffffffffffffffffffffffffffffffffffffff821614806109d057506109d08133610699565b610a5c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603860248201527f4552433732313a20617070726f76652063616c6c6572206973206e6f74206f7760448201527f6e6572206e6f7220617070726f76656420666f7220616c6c000000000000000060648201526084016108ac565b610a66838361243e565b505050565b7f150b7a02000000000000000000000000000000000000000000000000000000005b949350505050565b60008181526002602052604090205473ffffffffffffffffffffffffffffffffffffffff16610b20576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601560248201527f42756e646c6520646f6573206e6f74206578697374000000000000000000000060448201526064016108ac565b610b2c833330856124de565b6000818152600c60209081526040808320815180830190925273ffffffffffffffffffffffffffffffffffffffff8781168352828401878152825460018082018555938752949095209251600290940290920180547fffffffffffffffffffffffff00000000000000000000000000000000000000001693909216929092178155915191015580610bba3390565b6040805173ffffffffffffffffffffffffffffffffffffffff87811682526020820187905292909216917feee1a9363c8cef3e5872690139669b46cb0b21d9c57d568d17b7b306d96694f791015b60405180910390a3505050565b610c20335b826125ba565b610cac576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603160248201527f4552433732313a207472616e736665722063616c6c6572206973206e6f74206f60448201527f776e6572206e6f7220617070726f76656400000000000000000000000000000060648201526084016108ac565b610a66838383612726565b610cc033610c1a565b610d4c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602260248201527f4173736574577261707065723a204e6f6e2d6f776e657220776974686472617760448201527f616c00000000000000000000000000000000000000000000000000000000000060648201526084016108ac565b610d5581611518565b6000818152600c6020908152604080832080548251818502810185019093528083529192909190849084015b82821015610dd65760008481526020908190206040805180820190915260028502909101805473ffffffffffffffffffffffffffffffffffffffff168252600190810154828401529083529092019101610d81565b50505050905060005b8151811015610e9357610e81828281518110610e24577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001015160000151610e373390565b848481518110610e70577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001015160200151612998565b80610e8b816143ca565b915050610ddf565b506000828152600c60205260408120610eab91613c17565b6000828152600d6020908152604080832080548251818502810185019093528083529192909190849084015b82821015610f2c5760008481526020908190206040805180820190915260028502909101805473ffffffffffffffffffffffffffffffffffffffff168252600190810154828401529083529092019101610ed7565b50505050905060005b815181101561108c57818181518110610f77577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60200260200101516000015173ffffffffffffffffffffffffffffffffffffffff166342842e0e30610fa63390565b858581518110610fdf577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60209081029190910181015101516040517fffffffff0000000000000000000000000000000000000000000000000000000060e086901b16815273ffffffffffffffffffffffffffffffffffffffff93841660048201529290911660248301526044820152606401600060405180830381600087803b15801561106157600080fd5b505af1158015611075573d6000803e3d6000fd5b505050508080611084906143ca565b915050610f35565b506000838152600d602052604081206110a491613c17565b6000838152600e6020908152604080832080548251818502810185019093528083529192909190849084015b828210156111325760008481526020908190206040805160608101825260038602909201805473ffffffffffffffffffffffffffffffffffffffff168352600180820154848601526002909101549183019190915290835290920191016110d0565b50505050905060005b81518110156112ec5781818151811061117d577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60200260200101516000015173ffffffffffffffffffffffffffffffffffffffff1663f242432a306111ac3390565b8585815181106111e5577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60200260200101516020015186868151811061122a577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602090810291909101015160409081015190517fffffffff0000000000000000000000000000000000000000000000000000000060e087901b16815273ffffffffffffffffffffffffffffffffffffffff94851660048201529390921660248401526044830152606482015260a06084820152600060a482015260c401600060405180830381600087803b1580156112c157600080fd5b505af11580156112d5573d6000803e3d6000fd5b5050505080806112e4906143ca565b91505061113b565b506000848152600e6020526040812061130491613c38565b6000848152600f6020526040812054903373ffffffffffffffffffffffffffffffffffffffff168260405160006040518083038185875af1925050503d806000811461136c576040519150601f19603f3d011682016040523d82523d6000602084013e611371565b606091505b50509050806113dc576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f4661696c656420746f207769746864726177204554480000000000000000000060448201526064016108ac565b6000868152600f602052604080822082905551879133917f884edad9ce6fa2440d8a54cc123490eb96d2768479d49ff9c7366125a94243649190a3505050505050565b600061142a83611ae6565b82106114b8576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602b60248201527f455243373231456e756d657261626c653a206f776e657220696e646578206f7560448201527f74206f6620626f756e647300000000000000000000000000000000000000000060648201526084016108ac565b5073ffffffffffffffffffffffffffffffffffffffff919091166000908152600660209081526040808320938352929052205490565b60006114f86129ee565b905090565b610a6683838360405180602001604052806000815250611d13565b61152133610c1a565b6115ad576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603060248201527f4552433732314275726e61626c653a2063616c6c6572206973206e6f74206f7760448201527f6e6572206e6f7220617070726f7665640000000000000000000000000000000060648201526084016108ac565b6115b681612ae5565b50565b60008181526002602052604090205473ffffffffffffffffffffffffffffffffffffffff16611644576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601560248201527f42756e646c6520646f6573206e6f74206578697374000000000000000000000060448201526064016108ac565b73ffffffffffffffffffffffffffffffffffffffff83166323b872dd336040517fffffffff0000000000000000000000000000000000000000000000000000000060e084901b16815273ffffffffffffffffffffffffffffffffffffffff909116600482015230602482015260448101859052606401600060405180830381600087803b1580156116d457600080fd5b505af11580156116e8573d6000803e3d6000fd5b5050506000828152600d60209081526040808320815180830190925273ffffffffffffffffffffffffffffffffffffffff8881168352828401888152825460018082018555938752949095209251600290940290920180547fffffffffffffffffffffffff000000000000000000000000000000000000000016939092169290921781559151910155508061177a3390565b6040805173ffffffffffffffffffffffffffffffffffffffff87811682526020820187905292909216917f7a47efb9b86e599a690793c40afb239c7e3c6e8cc11439a9a6287798d46399a49101610c08565b60006117d760085490565b8210611865576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602c60248201527f455243373231456e756d657261626c653a20676c6f62616c20696e646578206f60448201527f7574206f6620626f756e6473000000000000000000000000000000000000000060648201526084016108ac565b6008828154811061189f577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b90600052602060002001549050919050565b60008181526002602052604090205473ffffffffffffffffffffffffffffffffffffffff1661193c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601560248201527f42756e646c6520646f6573206e6f74206578697374000000000000000000000060448201526064016108ac565b6000818152600f602052604090205434906119579082612bbe565b6000838152600f6020526040902055813373ffffffffffffffffffffffffffffffffffffffff167f57e8e547a3ef8d890c570ca885b0a8c441be3070e36b7ad4c7d6b9d9316ff2ce836040516119af91815260200190565b60405180910390a35050565b6119cd816119c8600b5490565b612bca565b6115b6600b80546001019055565b60008181526002602052604081205473ffffffffffffffffffffffffffffffffffffffff1680610764576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602960248201527f4552433732313a206f776e657220717565727920666f72206e6f6e657869737460448201527f656e7420746f6b656e000000000000000000000000000000000000000000000060648201526084016108ac565b600e6020528160005260406000208181548110611aa957600080fd5b600091825260209091206003909102018054600182015460029092015473ffffffffffffffffffffffffffffffffffffffff909116935090915083565b600073ffffffffffffffffffffffffffffffffffffffff8216611b8b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602a60248201527f4552433732313a2062616c616e636520717565727920666f7220746865207a6560448201527f726f20616464726573730000000000000000000000000000000000000000000060648201526084016108ac565b5073ffffffffffffffffffffffffffffffffffffffff1660009081526003602052604090205490565b73ffffffffffffffffffffffffffffffffffffffff81166000908152600a6020526040812054610764565b60606001805461077b9061437c565b73ffffffffffffffffffffffffffffffffffffffff8216331415611c6e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601960248201527f4552433732313a20617070726f766520746f2063616c6c65720000000000000060448201526064016108ac565b33600081815260056020908152604080832073ffffffffffffffffffffffffffffffffffffffff8716808552925290912080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00168415151790559073ffffffffffffffffffffffffffffffffffffffff167f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31836040516119af911515815260200190565b611d1d33836125ba565b611da9576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603160248201527f4552433732313a207472616e736665722063616c6c6572206973206e6f74206f60448201527f776e6572206e6f7220617070726f76656400000000000000000000000000000060648201526084016108ac565b611db584848484612d98565b50505050565b60008181526002602052604090205460609073ffffffffffffffffffffffffffffffffffffffff16611e6f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602f60248201527f4552433732314d657461646174613a2055524920717565727920666f72206e6f60448201527f6e6578697374656e7420746f6b656e000000000000000000000000000000000060648201526084016108ac565b6000611e8660408051602081019091526000815290565b90506000815111611ea65760405180602001604052806000815250611ed1565b80611eb084612e3b565b604051602001611ec1929190614233565b6040516020818303038152906040525b9392505050565b83421115611f42576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601e60248201527f4552433732315065726d69743a206578706972656420646561646c696e65000060448201526064016108ac565b611f4b856119db565b73ffffffffffffffffffffffffffffffffffffffff168773ffffffffffffffffffffffffffffffffffffffff1614611fdf576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601760248201527f4552433732315065726d69743a206e6f74206f776e657200000000000000000060448201526064016108ac565b60007f48d39b37a35214940203bbbd4f383519797769b13d936f387d89430afef2768888888861200e8c612fbc565b60408051602081019690965273ffffffffffffffffffffffffffffffffffffffff94851690860152929091166060840152608083015260a082015260c0810186905260e001604051602081830303815290604052805190602001209050600061207682612ff1565b905060006120868287878761305a565b90508973ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161461211d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f4552433732315065726d69743a20696e76616c6964207369676e61747572650060448201526064016108ac565b612127898961243e565b50505050505050505050565b600d602052816000526040600020818154811061214f57600080fd5b60009182526020909120600290910201805460019091015473ffffffffffffffffffffffffffffffffffffffff9091169250905082565b60008181526002602052604090205473ffffffffffffffffffffffffffffffffffffffff16612211576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601560248201527f42756e646c6520646f6573206e6f74206578697374000000000000000000000060448201526064016108ac565b73ffffffffffffffffffffffffffffffffffffffff841663f242432a336040517fffffffff0000000000000000000000000000000000000000000000000000000060e084901b16815273ffffffffffffffffffffffffffffffffffffffff9091166004820152306024820152604481018690526064810185905260a06084820152600060a482015260c401600060405180830381600087803b1580156122b657600080fd5b505af11580156122ca573d6000803e3d6000fd5b5050506000828152600e60209081526040808320815160608101835273ffffffffffffffffffffffffffffffffffffffff8a811682528185018a8152938201898152835460018082018655948852959096209151600390950290910180547fffffffffffffffffffffffff000000000000000000000000000000000000000016949091169390931783559051908201559051600290910155508061236b3390565b6040805173ffffffffffffffffffffffffffffffffffffffff8881168252602082018890529181018690529116907fb498002f49085cb108177238b25fbdd698b687feee33f473f774476fe5f812339060600160405180910390a350505050565b600c602052816000526040600020818154811061214f57600080fd5b60007fffffffff0000000000000000000000000000000000000000000000000000000082167f4e2312e00000000000000000000000000000000000000000000000000000000014806107645750610764826132b2565b600081815260046020526040902080547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff84169081179091558190612498826119db565b73ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b60405173ffffffffffffffffffffffffffffffffffffffff80851660248301528316604482015260648101829052611db59085907f23b872dd00000000000000000000000000000000000000000000000000000000906084015b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181529190526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fffffffff0000000000000000000000000000000000000000000000000000000090931692909217909152613308565b60008181526002602052604081205473ffffffffffffffffffffffffffffffffffffffff1661266b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602c60248201527f4552433732313a206f70657261746f7220717565727920666f72206e6f6e657860448201527f697374656e7420746f6b656e000000000000000000000000000000000000000060648201526084016108ac565b6000612676836119db565b90508073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614806126e557508373ffffffffffffffffffffffffffffffffffffffff166126cd846107ff565b73ffffffffffffffffffffffffffffffffffffffff16145b80610a8d575073ffffffffffffffffffffffffffffffffffffffff80821660009081526005602090815260408083209388168352929052205460ff16610a8d565b8273ffffffffffffffffffffffffffffffffffffffff16612746826119db565b73ffffffffffffffffffffffffffffffffffffffff16146127e9576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602960248201527f4552433732313a207472616e73666572206f6620746f6b656e2074686174206960448201527f73206e6f74206f776e000000000000000000000000000000000000000000000060648201526084016108ac565b73ffffffffffffffffffffffffffffffffffffffff821661288b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152602060048201526024808201527f4552433732313a207472616e7366657220746f20746865207a65726f2061646460448201527f726573730000000000000000000000000000000000000000000000000000000060648201526084016108ac565b612896838383613414565b6128a160008261243e565b73ffffffffffffffffffffffffffffffffffffffff831660009081526003602052604081208054600192906128d7908490614339565b909155505073ffffffffffffffffffffffffffffffffffffffff8216600090815260036020526040812080546001929061291290849061430d565b909155505060008181526002602052604080822080547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff86811691821790925591518493918716917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef91a4505050565b60405173ffffffffffffffffffffffffffffffffffffffff8316602482015260448101829052610a669084907fa9059cbb0000000000000000000000000000000000000000000000000000000090606401612538565b60007f0000000000000000000000000000000000000000000000000000000000000001461415612a3f57507f512b3c87c23d0f2a95e2544d652dccc0a0b84049889d725451ca3b7889e6c4a36107fc565b50604080517f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f6020808301919091527f23fa28c7fbd07a9371f5dc8d0e0a6b90ec7b7bf4f8afd8b42ddf6ad751832444828401527fc89efdaa54c0f20c7adf612882df0950f5a951637e0307cdcb4c672f298b8bc660608301524660808301523060a0808401919091528351808403909101815260c090920190925280519101206107fc565b6000612af0826119db565b9050612afe81600084613414565b612b0960008361243e565b73ffffffffffffffffffffffffffffffffffffffff81166000908152600360205260408120805460019290612b3f908490614339565b909155505060008281526002602052604080822080547fffffffffffffffffffffffff00000000000000000000000000000000000000001690555183919073ffffffffffffffffffffffffffffffffffffffff8416907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908390a45050565b6000611ed1828461430d565b73ffffffffffffffffffffffffffffffffffffffff8216612c47576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4552433732313a206d696e7420746f20746865207a65726f206164647265737360448201526064016108ac565b60008181526002602052604090205473ffffffffffffffffffffffffffffffffffffffff1615612cd3576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601c60248201527f4552433732313a20746f6b656e20616c7265616479206d696e7465640000000060448201526064016108ac565b612cdf60008383613414565b73ffffffffffffffffffffffffffffffffffffffff82166000908152600360205260408120805460019290612d1590849061430d565b909155505060008181526002602052604080822080547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff861690811790915590518392907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a45050565b612da3848484612726565b612daf8484848461341f565b611db5576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603260248201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560448201527f63656976657220696d706c656d656e746572000000000000000000000000000060648201526084016108ac565b606081612e7c575060408051808201909152600181527f30000000000000000000000000000000000000000000000000000000000000006020820152610767565b8160005b8115612ea65780612e90816143ca565b9150612e9f9050600a83614325565b9150612e80565b60008167ffffffffffffffff811115612ee8577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6040519080825280601f01601f191660200182016040528015612f12576020820181803683370190505b5090505b8415610a8d57612f27600183614339565b9150612f34600a86614403565b612f3f90603061430d565b60f81b818381518110612f7b577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a905350612fb5600a86614325565b9450612f16565b73ffffffffffffffffffffffffffffffffffffffff81166000908152600a602052604090208054600181018255905b50919050565b6000610764612ffe6129ee565b836040517f19010000000000000000000000000000000000000000000000000000000000006020820152602281018390526042810182905260009060620160405160208183030381529060405280519060200120905092915050565b60007f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a082111561310c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c60448201527f756500000000000000000000000000000000000000000000000000000000000060648201526084016108ac565b8360ff16601b148061312157508360ff16601c145b6131ad576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202776272076616c60448201527f756500000000000000000000000000000000000000000000000000000000000060648201526084016108ac565b6040805160008082526020820180845288905260ff871692820192909252606081018590526080810184905260019060a0016020604051602081039080840390855afa158015613201573d6000803e3d6000fd5b50506040517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0015191505073ffffffffffffffffffffffffffffffffffffffff81166132a9576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601860248201527f45434453413a20696e76616c6964207369676e6174757265000000000000000060448201526064016108ac565b95945050505050565b60007fffffffff0000000000000000000000000000000000000000000000000000000082167f780e9d6300000000000000000000000000000000000000000000000000000000148061076457506107648261361b565b600061336a826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c65648152508573ffffffffffffffffffffffffffffffffffffffff166136fe9092919063ffffffff16565b805190915015610a6657808060200190518101906133889190614140565b610a66576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e60448201527f6f7420737563636565640000000000000000000000000000000000000000000060648201526084016108ac565b610a6683838361370d565b600073ffffffffffffffffffffffffffffffffffffffff84163b15613613576040517f150b7a0200000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff85169063150b7a0290613496903390899088908890600401614262565b602060405180830381600087803b1580156134b057600080fd5b505af19250505080156134fe575060408051601f3d9081017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe01682019092526134fb91810190614178565b60015b6135c8573d80801561352c576040519150601f19603f3d011682016040523d82523d6000602084013e613531565b606091505b5080516135c0576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603260248201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560448201527f63656976657220696d706c656d656e746572000000000000000000000000000060648201526084016108ac565b805181602001fd5b7fffffffff00000000000000000000000000000000000000000000000000000000167f150b7a0200000000000000000000000000000000000000000000000000000000149050610a8d565b506001610a8d565b60007fffffffff0000000000000000000000000000000000000000000000000000000082167f80ac58cd0000000000000000000000000000000000000000000000000000000014806136ae57507fffffffff0000000000000000000000000000000000000000000000000000000082167f5b5e139f00000000000000000000000000000000000000000000000000000000145b8061076457507f01ffc9a7000000000000000000000000000000000000000000000000000000007fffffffff00000000000000000000000000000000000000000000000000000000831614610764565b6060610a8d8484600085613818565b73ffffffffffffffffffffffffffffffffffffffff83166137755761377081600880546000838152600960205260408120829055600182018355919091527ff3f7a9fe364faab93b216da50a3214154f22a0a2b415b23a84c8169e8b636ee30155565b6137b2565b8173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16146137b2576137b28382613998565b73ffffffffffffffffffffffffffffffffffffffff82166137db576137d681613a4f565b610a66565b8273ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614610a6657610a668282613b73565b6060824710156138aa576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f60448201527f722063616c6c000000000000000000000000000000000000000000000000000060648201526084016108ac565b843b613912576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e747261637400000060448201526064016108ac565b6000808673ffffffffffffffffffffffffffffffffffffffff16858760405161393b9190614217565b60006040518083038185875af1925050503d8060008114613978576040519150601f19603f3d011682016040523d82523d6000602084013e61397d565b606091505b509150915061398d828286613bc4565b979650505050505050565b600060016139a584611ae6565b6139af9190614339565b600083815260076020526040902054909150808214613a0f5773ffffffffffffffffffffffffffffffffffffffff841660009081526006602090815260408083208584528252808320548484528184208190558352600790915290208190555b50600091825260076020908152604080842084905573ffffffffffffffffffffffffffffffffffffffff9094168352600681528383209183525290812055565b600854600090613a6190600190614339565b60008381526009602052604081205460088054939450909284908110613ab0577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b906000526020600020015490508060088381548110613af8577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b6000918252602080832090910192909255828152600990915260408082208490558582528120556008805480613b57577f4e487b7100000000000000000000000000000000000000000000000000000000600052603160045260246000fd5b6001900381819060005260206000200160009055905550505050565b6000613b7e83611ae6565b73ffffffffffffffffffffffffffffffffffffffff9093166000908152600660209081526040808320868452825280832085905593825260079052919091209190915550565b60608315613bd3575081611ed1565b825115613be35782518084602001fd5b816040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016108ac91906142ab565b50805460008255600202906000526020600020908101906115b69190613c59565b50805460008255600302906000526020600020908101906115b69190613c9b565b5b80821115613c975780547fffffffffffffffffffffffff000000000000000000000000000000000000000016815560006001820155600201613c5a565b5090565b5b80821115613c975780547fffffffffffffffffffffffff00000000000000000000000000000000000000001681556000600182018190556002820155600301613c9c565b803573ffffffffffffffffffffffffffffffffffffffff8116811461076757600080fd5b600082601f830112613d14578081fd5b8135602067ffffffffffffffff821115613d3057613d30614475565b8160051b613d3f8282016142be565b838152828101908684018388018501891015613d59578687fd5b8693505b85841015613d7b578035835260019390930192918401918401613d5d565b50979650505050505050565b600082601f830112613d97578081fd5b813567ffffffffffffffff811115613db157613db1614475565b613de260207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f840116016142be565b818152846020838601011115613df6578283fd5b816020850160208301379081016020019190915292915050565b600060208284031215613e21578081fd5b611ed182613ce0565b60008060408385031215613e3c578081fd5b613e4583613ce0565b9150613e5360208401613ce0565b90509250929050565b600080600080600060a08688031215613e73578081fd5b613e7c86613ce0565b9450613e8a60208701613ce0565b9350604086013567ffffffffffffffff80821115613ea6578283fd5b613eb289838a01613d04565b94506060880135915080821115613ec7578283fd5b613ed389838a01613d04565b93506080880135915080821115613ee8578283fd5b50613ef588828901613d87565b9150509295509295909350565b600080600060608486031215613f16578283fd5b613f1f84613ce0565b9250613f2d60208501613ce0565b9150604084013590509250925092565b60008060008060808587031215613f52578384fd5b613f5b85613ce0565b9350613f6960208601613ce0565b925060408501359150606085013567ffffffffffffffff811115613f8b578182fd5b613f9787828801613d87565b91505092959194509250565b600080600080600060a08688031215613fba578081fd5b613fc386613ce0565b9450613fd160208701613ce0565b93506040860135925060608601359150608086013567ffffffffffffffff811115613ffa578182fd5b613ef588828901613d87565b600080600080600080600060e0888a031215614020578182fd5b61402988613ce0565b965061403760208901613ce0565b95506040880135945060608801359350608088013560ff8116811461405a578283fd5b9699959850939692959460a0840135945060c09093013592915050565b60008060408385031215614089578182fd5b61409283613ce0565b915060208301356140a2816144a4565b809150509250929050565b600080604083850312156140bf578182fd5b6140c883613ce0565b946020939093013593505050565b6000806000606084860312156140ea578081fd5b6140f384613ce0565b95602085013595506040909401359392505050565b6000806000806080858703121561411d578182fd5b61412685613ce0565b966020860135965060408601359560600135945092505050565b600060208284031215614151578081fd5b8151611ed1816144a4565b60006020828403121561416d578081fd5b8135611ed1816144b2565b600060208284031215614189578081fd5b8151611ed1816144b2565b6000602082840312156141a5578081fd5b5035919050565b600080604083850312156141be578182fd5b50508035926020909101359150565b600081518084526141e5816020860160208601614350565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169290920160200192915050565b60008251614229818460208701614350565b9190910192915050565b60008351614245818460208801614350565b835190830190614259818360208801614350565b01949350505050565b600073ffffffffffffffffffffffffffffffffffffffff8087168352808616602084015250836040830152608060608301526142a160808301846141cd565b9695505050505050565b600060208252611ed160208301846141cd565b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016810167ffffffffffffffff8111828210171561430557614305614475565b604052919050565b6000821982111561432057614320614417565b500190565b60008261433457614334614446565b500490565b60008282101561434b5761434b614417565b500390565b60005b8381101561436b578181015183820152602001614353565b83811115611db55750506000910152565b600181811c9082168061439057607f821691505b60208210811415612feb577f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156143fc576143fc614417565b5060010190565b60008261441257614412614446565b500690565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b80151581146115b657600080fd5b7fffffffff00000000000000000000000000000000000000000000000000000000811681146115b657600080fdfea164736f6c6343000803000a
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
00000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000000000000000c417373657457726170706572000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000024157000000000000000000000000000000000000000000000000000000000000
-----Decoded View---------------
Arg [0] : name (string): AssetWrapper
Arg [1] : symbol (string): AW
-----Encoded View---------------
6 Constructor Arguments found :
Arg [0] : 0000000000000000000000000000000000000000000000000000000000000040
Arg [1] : 0000000000000000000000000000000000000000000000000000000000000080
Arg [2] : 000000000000000000000000000000000000000000000000000000000000000c
Arg [3] : 4173736574577261707065720000000000000000000000000000000000000000
Arg [4] : 0000000000000000000000000000000000000000000000000000000000000002
Arg [5] : 4157000000000000000000000000000000000000000000000000000000000000
Loading...
Loading
Loading...
Loading
Loading...
Loading
[ Download: CSV Export ]
A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.