ERC-721
Overview
Max Total Supply
44 AW
Holders
39
Market
Volume (24H)
N/A
Min Price (24H)
N/A
Max Price (24H)
N/A
Other Info
Token Contract
Balance
1 AWLoading...
Loading
Loading...
Loading
Loading...
Loading
# | Exchange | Pair | Price | 24H Volume | % Volume |
---|
Contract Name:
AssetWrapper
Compiler Version
v0.8.5+commit.a4f2e591
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/security/ReentrancyGuard.sol"; import "@openzeppelin/contracts/access/Ownable.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/math/SafeMath.sol"; import "@openzeppelin/contracts/utils/Address.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, Ownable, ReentrancyGuard { using SafeMath for uint256; using SafeERC20 for IERC20; using Address for address; uint256 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; mapping(uint256 => bool) private _usedTokenIds; // Start at 300 to prevent collisions with previous asset wrapper uint256 private immutable TOKEN_ID_START; address public rContract; /** * @dev Initializes the token with name and symbol parameters */ constructor(string memory name, string memory symbol, uint256 startNum) ERC721(name, symbol) ERC721Permit(name) { TOKEN_ID_START = startNum; _tokenIdTracker = startNum; } /** * @inheritdoc IAssetWrapper */ function initializeBundle(address to) external override { require(!_usedTokenIds[_tokenIdTracker], "Already used"); _mint(to, _tokenIdTracker); _usedTokenIds[_tokenIdTracker] = true; _tokenIdTracker += 1; } function initializeBundleWithId(address to, uint256 tokenId) external { require(msg.sender == rContract, "Not allowed"); require(tokenId < TOKEN_ID_START, "Invalid tokenId"); require(!_usedTokenIds[tokenId], "Already used"); _usedTokenIds[tokenId] = true; _mint(to, tokenId); } function setRContract(address _rContract) external onlyOwner { rContract = _rContract; } /** * @inheritdoc IAssetWrapper */ function depositERC20( address tokenAddress, uint256 amount, uint256 bundleId ) external override nonReentrant { require(_exists(bundleId), "Bundle does not exist"); require(_isApprovedOrOwner(_msgSender(), bundleId), "AssetWrapper: Non-owner deposit"); IERC20(tokenAddress).safeTransferFrom(_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 nonReentrant { require(_exists(bundleId), "Bundle does not exist"); require(_isApprovedOrOwner(_msgSender(), bundleId), "AssetWrapper: Non-owner deposit"); IERC721(tokenAddress).safeTransferFrom(_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 nonReentrant { require(_exists(bundleId), "Bundle does not exist"); require(_isApprovedOrOwner(_msgSender(), bundleId), "AssetWrapper: Non-owner deposit"); 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 nonReentrant { require(_isApprovedOrOwner(_msgSender(), bundleId), "AssetWrapper: Non-owner withdrawal"); burn(bundleId); ERC20Holding[] memory erc20Holdings = bundleERC20Holdings[bundleId]; for (uint256 i = 0; i < erc20Holdings.length; i++) { IERC20(erc20Holdings[i].tokenAddress).safeTransfer(_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); } function tryWithdraw(uint256 bundleId) external nonReentrant { require(_isApprovedOrOwner(_msgSender(), bundleId), "AssetWrapper: Non-owner deposit"); burn(bundleId); ERC20Holding[] memory erc20Holdings = bundleERC20Holdings[bundleId]; for (uint256 i = 0; i < erc20Holdings.length; i++) { try IERC20(erc20Holdings[i].tokenAddress).transfer( _msgSender(), erc20Holdings[i].amount ) {} catch {} } delete bundleERC20Holdings[bundleId]; ERC721Holding[] memory erc721Holdings = bundleERC721Holdings[bundleId]; for (uint256 i = 0; i < erc721Holdings.length; i++) { try IERC721(erc721Holdings[i].tokenAddress).safeTransferFrom( address(this), _msgSender(), erc721Holdings[i].tokenId ) {} catch {} } delete bundleERC721Holdings[bundleId]; ERC1155Holding[] memory erc1155Holdings = bundleERC1155Holdings[bundleId]; for (uint256 i = 0; i < erc1155Holdings.length; i++) { try IERC1155(erc1155Holdings[i].tokenAddress).safeTransferFrom( address(this), _msgSender(), erc1155Holdings[i].tokenId, erc1155Holdings[i].amount, "" ) {} catch {} } 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); } function numERC20Holdings(uint256 bundleId) external view returns (uint256) { return bundleERC20Holdings[bundleId].length; } function numERC721Holdings(uint256 bundleId) external view returns (uint256) { return bundleERC721Holdings[bundleId].length; } function numERC1155Holdings(uint256 bundleId) external view returns (uint256) { return bundleERC1155Holdings[bundleId].length; } /** * @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}. If set, the resulting URI for each * token will be the concatenation of the `baseURI` and the `tokenId`. 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.onERC721Received.selector; } catch (bytes memory reason) { if (reason.length == 0) { revert("ERC721: transfer to non ERC721Receiver implementer"); } else { 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` and `to` are never both zero. * * 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; /** * @dev Contract module that helps prevent reentrant calls to a function. * * Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier * available, which can be applied to functions to make sure there are no nested * (reentrant) calls to them. * * Note that because there is a single `nonReentrant` guard, functions marked as * `nonReentrant` may not call one another. This can be worked around by making * those functions `private`, and then adding `external` `nonReentrant` entry * points to them. * * TIP: If you would like to learn more about reentrancy and alternative ways * to protect against it, check out our blog post * https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul]. */ abstract contract ReentrancyGuard { // Booleans are more expensive than uint256 or any type that takes up a full // word because each write operation emits an extra SLOAD to first read the // slot's contents, replace the bits taken up by the boolean, and then write // back. This is the compiler's defense against contract upgrades and // pointer aliasing, and it cannot be disabled. // The values being non-zero value makes deployment a bit more expensive, // but in exchange the refund on every call to nonReentrant will be lower in // amount. Since refunds are capped to a percentage of the total // transaction's gas, it is best to keep them low in cases like this one, to // increase the likelihood of the full refund coming into effect. uint256 private constant _NOT_ENTERED = 1; uint256 private constant _ENTERED = 2; uint256 private _status; constructor() { _status = _NOT_ENTERED; } /** * @dev Prevents a contract from calling itself, directly or indirectly. * Calling a `nonReentrant` function from another `nonReentrant` * function is not supported. It is possible to prevent this from happening * by making the `nonReentrant` function external, and make it call a * `private` function that does the actual work. */ modifier nonReentrant() { // On the first call to nonReentrant, _notEntered will be true require(_status != _ENTERED, "ReentrancyGuard: reentrant call"); // Any calls to nonReentrant after this point will fail _status = _ENTERED; _; // By storing the original value once again, a refund is triggered (see // https://eips.ethereum.org/EIPS/eip-2200) _status = _NOT_ENTERED; } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "../utils/Context.sol"; /** * @dev Contract module which provides a basic access control mechanism, where * there is an account (an owner) that can be granted exclusive access to * specific functions. * * By default, the owner account will be the one that deploys the contract. This * can later be changed with {transferOwnership}. * * This module is used through inheritance. It will make available the modifier * `onlyOwner`, which can be applied to your functions to restrict their use to * the owner. */ abstract contract Ownable is Context { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev Initializes the contract setting the deployer as the initial owner. */ constructor() { _setOwner(_msgSender()); } /** * @dev Returns the address of the current owner. */ function owner() public view virtual returns (address) { return _owner; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(owner() == _msgSender(), "Ownable: caller is not the owner"); _; } /** * @dev Leaves the contract without owner. It will not be possible to call * `onlyOwner` functions anymore. Can only be called by the current owner. * * NOTE: Renouncing ownership will leave the contract without an owner, * thereby removing any functionality that is only available to the owner. */ function renounceOwnership() public virtual onlyOwner { _setOwner(address(0)); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Can only be called by the current owner. */ function transferOwnership(address newOwner) public virtual onlyOwner { require(newOwner != address(0), "Ownable: new owner is the zero address"); _setOwner(newOwner); } function _setOwner(address newOwner) private { address oldOwner = _owner; _owner = newOwner; emit OwnershipTransferred(oldOwner, newOwner); } }
// 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) { return msg.data; } }
// 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. 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; /** * @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; 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"); (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"); (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"); (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"); (bool success, bytes memory returndata) = target.delegatecall(data); return verifyCallResult(success, returndata, errorMessage); } /** * @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the * revert reason using the provided one. * * _Available since v4.3._ */ function verifyCallResult( bool success, bytes memory returndata, string memory errorMessage ) internal pure returns (bytes memory) { if (success) { return returndata; } else { // 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 assembly { let returndata_size := mload(returndata) revert(add(32, returndata), returndata_size) } } else { revert(errorMessage); } } } }
// 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' 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 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 a bundle is unwrapped. */ 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 String operations. */ library Strings { bytes16 private constant _HEX_SYMBOLS = "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] = _HEX_SYMBOLS[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 nameHash, bytes32 versionHash ) private view returns (bytes32) { return keccak256(abi.encode(typeHash, nameHash, versionHash, 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 { enum RecoverError { NoError, InvalidSignature, InvalidSignatureLength, InvalidSignatureS, InvalidSignatureV } function _throwError(RecoverError error) private pure { if (error == RecoverError.NoError) { return; // no error: do nothing } else if (error == RecoverError.InvalidSignature) { revert("ECDSA: invalid signature"); } else if (error == RecoverError.InvalidSignatureLength) { revert("ECDSA: invalid signature length"); } else if (error == RecoverError.InvalidSignatureS) { revert("ECDSA: invalid signature 's' value"); } else if (error == RecoverError.InvalidSignatureV) { revert("ECDSA: invalid signature 'v' value"); } } /** * @dev Returns the address that signed a hashed message (`hash`) with * `signature` or error string. 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. * * Documentation for signature generation: * - with https://web3js.readthedocs.io/en/v1.3.4/web3-eth-accounts.html#sign[Web3.js] * - with https://docs.ethers.io/v5/api/signer/#Signer-signMessage[ethers] * * _Available since v4.3._ */ function tryRecover(bytes32 hash, bytes memory signature) internal pure returns (address, RecoverError) { // 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) { bytes32 r; bytes32 s; uint8 v; // ecrecover takes the signature parameters, and the only way to get them // currently is to use assembly. assembly { r := mload(add(signature, 0x20)) s := mload(add(signature, 0x40)) v := byte(0, mload(add(signature, 0x60))) } return tryRecover(hash, v, r, s); } else if (signature.length == 64) { bytes32 r; bytes32 vs; // ecrecover takes the signature parameters, and the only way to get them // currently is to use assembly. assembly { r := mload(add(signature, 0x20)) vs := mload(add(signature, 0x40)) } return tryRecover(hash, r, vs); } else { return (address(0), RecoverError.InvalidSignatureLength); } } /** * @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) { (address recovered, RecoverError error) = tryRecover(hash, signature); _throwError(error); return recovered; } /** * @dev Overload of {ECDSA-tryRecover} that receives the `r` and `vs` short-signature fields separately. * * See https://eips.ethereum.org/EIPS/eip-2098[EIP-2098 short signatures] * * _Available since v4.3._ */ function tryRecover( bytes32 hash, bytes32 r, bytes32 vs ) internal pure returns (address, RecoverError) { bytes32 s; uint8 v; assembly { s := and(vs, 0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff) v := add(shr(255, vs), 27) } return tryRecover(hash, v, r, s); } /** * @dev Overload of {ECDSA-recover} that receives the `r and `vs` short-signature fields separately. * * _Available since v4.2._ */ function recover( bytes32 hash, bytes32 r, bytes32 vs ) internal pure returns (address) { (address recovered, RecoverError error) = tryRecover(hash, r, vs); _throwError(error); return recovered; } /** * @dev Overload of {ECDSA-tryRecover} that receives the `v`, * `r` and `s` signature fields separately. * * _Available since v4.3._ */ function tryRecover( bytes32 hash, uint8 v, bytes32 r, bytes32 s ) internal pure returns (address, RecoverError) { // 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 (301): 0 < s < secp256k1n ÷ 2 + 1, and for v in (302): 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. if (uint256(s) > 0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5D576E7357A4501DDFE92F46681B20A0) { return (address(0), RecoverError.InvalidSignatureS); } if (v != 27 && v != 28) { return (address(0), RecoverError.InvalidSignatureV); } // If the signature is valid (and not malleable), return the signer address address signer = ecrecover(hash, v, r, s); if (signer == address(0)) { return (address(0), RecoverError.InvalidSignature); } return (signer, RecoverError.NoError); } /** * @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) { (address recovered, RecoverError error) = tryRecover(hash, v, r, s); _throwError(error); return recovered; } /** * @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)); } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; /** * @title Counters * @author Matt Condon (@shrugs) * @dev Provides counters that can only be incremented, decremented or reset. This can be used e.g. to track the number * of elements in a mapping, issuing ERC721 ids, or counting request ids. * * Include with `using Counters for Counters.Counter;` */ library Counters { struct Counter { // This variable should never be directly accessed by users of the library: interactions must be restricted to // the library's function. As of Solidity v0.5.2, this cannot be enforced, though there is a proposal to add // this feature: see https://github.com/ethereum/solidity/issues/4637 uint256 _value; // default: 0 } function current(Counter storage counter) internal view returns (uint256) { return counter._value; } function increment(Counter storage counter) internal { unchecked { counter._value += 1; } } function decrement(Counter storage counter) internal { uint256 value = counter._value; require(value > 0, "Counter: decrement overflow"); unchecked { counter._value = value - 1; } } function reset(Counter storage counter) internal { counter._value = 0; } }
{ "metadata": { "bytecodeHash": "none" }, "optimizer": { "enabled": true, "runs": 999999 }, "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "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"},{"internalType":"uint256","name":"startNum","type":"uint256"}],"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":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","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":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"initializeBundleWithId","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":"uint256","name":"bundleId","type":"uint256"}],"name":"numERC1155Holdings","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"bundleId","type":"uint256"}],"name":"numERC20Holdings","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"bundleId","type":"uint256"}],"name":"numERC721Holdings","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":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"ownerOf","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"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":[],"name":"rContract","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","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":"address","name":"_rContract","type":"address"}],"name":"setRContract","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":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"bundleId","type":"uint256"}],"name":"tryWithdraw","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"bundleId","type":"uint256"}],"name":"withdraw","outputs":[],"stateMutability":"nonpayable","type":"function"}]
Contract Creation Code
6101606040527f48d39b37a35214940203bbbd4f383519797769b13d936f387d89430afef27688610120523480156200003757600080fd5b5060405162005a0238038062005a028339810160408190526200005a9162000305565b8280604051806040016040528060018152602001603160f81b8152508585816000908051906020019062000090929190620001a8565b508051620000a6906001906020840190620001a8565b5050825160209384012082519284019290922060c083815260e08290524660a0818152604080517f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f818a0181905281830198909852606081019590955260808086019390935230858301528051808603909201825293909201909252805194019390932090925261010052506200013f90503362000156565b6001600c55610140819052600d5550620003cb9050565b600b80546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b828054620001b69062000378565b90600052602060002090601f016020900481019282620001da576000855562000225565b82601f10620001f557805160ff191683800117855562000225565b8280016001018555821562000225579182015b828111156200022557825182559160200191906001019062000208565b506200023392915062000237565b5090565b5b8082111562000233576000815560010162000238565b600082601f8301126200026057600080fd5b81516001600160401b03808211156200027d576200027d620003b5565b604051601f8301601f19908116603f01168101908282118183101715620002a857620002a8620003b5565b81604052838152602092508683858801011115620002c557600080fd5b600091505b83821015620002e95785820183015181830184015290820190620002ca565b83821115620002fb5760008385830101525b9695505050505050565b6000806000606084860312156200031b57600080fd5b83516001600160401b03808211156200033357600080fd5b62000341878388016200024e565b945060208601519150808211156200035857600080fd5b5062000367868287016200024e565b925050604084015190509250925092565b600181811c908216806200038d57607f821691505b60208210811415620003af57634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052604160045260246000fd5b60805160a05160c05160e0516101005161012051610140516155dc6200042660003960006119b5015260006126fb01526000613998015260006139e7015260006139c2015260006139460152600061396f01526155dc6000f3fe6080604052600436106102dc5760003560e01c80636d5442c211610184578063bc197c81116100d6578063e3fa58821161008a578063f2fde38b11610064578063f2fde38b1461094b578063f998fe9d1461096b578063fc6bf1331461098b57600080fd5b8063e3fa588214610890578063e985e9c5146108b0578063f23a6e611461090657600080fd5b8063d505accf116100bb578063d505accf146107f7578063dcca396014610817578063ddff9f451461086357600080fd5b8063bc197c8114610792578063c87b56dd146107d757600080fd5b80638da5cb5b11610138578063a6cb599811610112578063a6cb599814610718578063b88d4fde14610745578063b915d8a91461076557600080fd5b80638da5cb5b146106b857806395d89b41146106e3578063a22cb465146106f857600080fd5b8063715018a611610169578063715018a6146106565780637298c7361461066b5780637ecebe001461069857600080fd5b80636d5442c2146105e457806370a082311461063657600080fd5b80632f745c591161023d57806345a4276b116101f15780635358fbda116101cb5780635358fbda14610591578063631e1c6c146105a45780636352211e146105c457600080fd5b806345a4276b1461052457806347f58ee7146105445780634f6ccce71461057157600080fd5b806342842e0e1161022257806342842e0e146104c457806342966c68146104e457806344f21a131461050457600080fd5b80632f745c591461048f5780633644e515146104af57600080fd5b806318160ddd1161029457806323b872dd1161027957806323b872dd1461042f5780632c1630211461044f5780632e1a7d4d1461046f57600080fd5b806318160ddd146103f057806321425ee01461040f57600080fd5b8063081812fc116102c5578063081812fc14610338578063095ea7b31461037d578063150b7a021461039f57600080fd5b806301ffc9a7146102e157806306fdde0314610316575b600080fd5b3480156102ed57600080fd5b506103016102fc3660046151ba565b6109ab565b60405190151581526020015b60405180910390f35b34801561032257600080fd5b5061032b6109bc565b60405161030d919061530d565b34801561034457600080fd5b506103586103533660046151f4565b610a4e565b60405173ffffffffffffffffffffffffffffffffffffffff909116815260200161030d565b34801561038957600080fd5b5061039d610398366004615107565b610b2d565b005b3480156103ab57600080fd5b506103bf6103ba366004614f90565b610cba565b6040517fffffffff00000000000000000000000000000000000000000000000000000000909116815260200161030d565b3480156103fc57600080fd5b506008545b60405190815260200161030d565b34801561041b57600080fd5b5061039d61042a366004615131565b610ce4565b34801561043b57600080fd5b5061039d61044a366004614f54565b610f48565b34801561045b57600080fd5b5061039d61046a366004614e5c565b610fe8565b34801561047b57600080fd5b5061039d61048a3660046151f4565b6110b0565b34801561049b57600080fd5b506104016104aa366004615107565b611798565b3480156104bb57600080fd5b50610401611867565b3480156104d057600080fd5b5061039d6104df366004614f54565b611876565b3480156104f057600080fd5b5061039d6104ff3660046151f4565b611891565b34801561051057600080fd5b5061039d61051f366004615107565b611932565b34801561053057600080fd5b5061039d61053f366004615131565b611afa565b34801561055057600080fd5b506013546103589073ffffffffffffffffffffffffffffffffffffffff1681565b34801561057d57600080fd5b5061040161058c3660046151f4565b611dd4565b61039d61059f3660046151f4565b611e92565b3480156105b057600080fd5b5061039d6105bf366004614e5c565b611f9c565b3480156105d057600080fd5b506103586105df3660046151f4565b61207b565b3480156105f057600080fd5b506106046105ff36600461520d565b61212d565b6040805173ffffffffffffffffffffffffffffffffffffffff909416845260208401929092529082015260600161030d565b34801561064257600080fd5b50610401610651366004614e5c565b612186565b34801561066257600080fd5b5061039d612254565b34801561067757600080fd5b506104016106863660046151f4565b60116020526000908152604090205481565b3480156106a457600080fd5b506104016106b3366004614e5c565b6122e1565b3480156106c457600080fd5b50600b5473ffffffffffffffffffffffffffffffffffffffff16610358565b3480156106ef57600080fd5b5061032b61230c565b34801561070457600080fd5b5061039d6107133660046150d0565b61231b565b34801561072457600080fd5b506104016107333660046151f4565b6000908152600f602052604090205490565b34801561075157600080fd5b5061039d610760366004614f90565b61242b565b34801561077157600080fd5b506104016107803660046151f4565b6000908152600e602052604090205490565b34801561079e57600080fd5b506103bf6107ad366004614eaa565b7fbc197c810000000000000000000000000000000000000000000000000000000095945050505050565b3480156107e357600080fd5b5061032b6107f23660046151f4565b6124d3565b34801561080357600080fd5b5061039d61081236600461505d565b6125f0565b34801561082357600080fd5b5061083761083236600461520d565b61284b565b6040805173ffffffffffffffffffffffffffffffffffffffff909316835260208301919091520161030d565b34801561086f57600080fd5b5061040161087e3660046151f4565b60009081526010602052604090205490565b34801561089c57600080fd5b5061039d6108ab3660046151f4565b61289e565b3480156108bc57600080fd5b506103016108cb366004614e77565b73ffffffffffffffffffffffffffffffffffffffff918216600090815260056020908152604080832093909416825291909152205460ff1690565b34801561091257600080fd5b506103bf610921366004614ff8565b7ff23a6e610000000000000000000000000000000000000000000000000000000095945050505050565b34801561095757600080fd5b5061039d610966366004614e5c565b612ec4565b34801561097757600080fd5b5061039d610986366004615164565b612ff1565b34801561099757600080fd5b506108376109a636600461520d565b613320565b60006109b68261333c565b92915050565b6060600080546109cb906153de565b80601f01602080910402602001604051908101604052809291908181526020018280546109f7906153de565b8015610a445780601f10610a1957610100808354040283529160200191610a44565b820191906000526020600020905b815481529060010190602001808311610a2757829003601f168201915b5050505050905090565b60008181526002602052604081205473ffffffffffffffffffffffffffffffffffffffff16610b04576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602c60248201527f4552433732313a20617070726f76656420717565727920666f72206e6f6e657860448201527f697374656e7420746f6b656e000000000000000000000000000000000000000060648201526084015b60405180910390fd5b5060009081526004602052604090205473ffffffffffffffffffffffffffffffffffffffff1690565b6000610b388261207b565b90508073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610bf6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602160248201527f4552433732313a20617070726f76616c20746f2063757272656e74206f776e6560448201527f72000000000000000000000000000000000000000000000000000000000000006064820152608401610afb565b3373ffffffffffffffffffffffffffffffffffffffff82161480610c1f5750610c1f81336108cb565b610cab576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603860248201527f4552433732313a20617070726f76652063616c6c6572206973206e6f74206f7760448201527f6e6572206e6f7220617070726f76656420666f7220616c6c00000000000000006064820152608401610afb565b610cb58383613392565b505050565b7f150b7a02000000000000000000000000000000000000000000000000000000005b949350505050565b6002600c541415610d51576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610afb565b6002600c55610d848160009081526002602052604090205473ffffffffffffffffffffffffffffffffffffffff16151590565b610dea576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601560248201527f42756e646c6520646f6573206e6f7420657869737400000000000000000000006044820152606401610afb565b610df5335b82613432565b610e5b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f4173736574577261707065723a204e6f6e2d6f776e6572206465706f736974006044820152606401610afb565b610e7d73ffffffffffffffffffffffffffffffffffffffff841633308561359e565b6000818152600e602090815260408083208151808301835273ffffffffffffffffffffffffffffffffffffffff888116808352828601898152845460018082018755958952978790209351600290980290930180547fffffffffffffffffffffffff0000000000000000000000000000000000000000169790921696909617815590519101558051928352908201849052829133917feee1a9363c8cef3e5872690139669b46cb0b21d9c57d568d17b7b306d96694f791015b60405180910390a350506001600c5550565b610f5133610def565b610fdd576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603160248201527f4552433732313a207472616e736665722063616c6c6572206973206e6f74206f60448201527f776e6572206e6f7220617070726f7665640000000000000000000000000000006064820152608401610afb565b610cb583838361367a565b600b5473ffffffffffffffffffffffffffffffffffffffff163314611069576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610afb565b601380547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff92909216919091179055565b6002600c54141561111d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610afb565b6002600c5561112b33610def565b6111b7576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602260248201527f4173736574577261707065723a204e6f6e2d6f776e657220776974686472617760448201527f616c0000000000000000000000000000000000000000000000000000000000006064820152608401610afb565b6111c081611891565b6000818152600e6020908152604080832080548251818502810185019093528083529192909190849084015b828210156112415760008481526020908190206040805180820190915260028502909101805473ffffffffffffffffffffffffffffffffffffffff1682526001908101548284015290835290920191016111ec565b50505050905060005b81518110156112ca576112b83383838151811061126957611269615535565b60200260200101516020015184848151811061128757611287615535565b60200260200101516000015173ffffffffffffffffffffffffffffffffffffffff166138ec9092919063ffffffff16565b806112c28161542c565b91505061124a565b506000828152600e602052604081206112e291614c56565b6000828152600f6020908152604080832080548251818502810185019093528083529192909190849084015b828210156113635760008481526020908190206040805180820190915260028502909101805473ffffffffffffffffffffffffffffffffffffffff16825260019081015482840152908352909201910161130e565b50505050905060005b81518110156114755781818151811061138757611387615535565b60200260200101516000015173ffffffffffffffffffffffffffffffffffffffff166342842e0e306113b63390565b8585815181106113c8576113c8615535565b60209081029190910181015101516040517fffffffff0000000000000000000000000000000000000000000000000000000060e086901b16815273ffffffffffffffffffffffffffffffffffffffff93841660048201529290911660248301526044820152606401600060405180830381600087803b15801561144a57600080fd5b505af115801561145e573d6000803e3d6000fd5b50505050808061146d9061542c565b91505061136c565b506000838152600f6020526040812061148d91614c56565b600083815260106020908152604080832080548251818502810185019093528083529192909190849084015b8282101561151b5760008481526020908190206040805160608101825260038602909201805473ffffffffffffffffffffffffffffffffffffffff168352600180820154848601526002909101549183019190915290835290920191016114b9565b50505050905060005b81518110156116605781818151811061153f5761153f615535565b60200260200101516000015173ffffffffffffffffffffffffffffffffffffffff1663f242432a3061156e3390565b85858151811061158057611580615535565b60200260200101516020015186868151811061159e5761159e615535565b602090810291909101015160409081015190517fffffffff0000000000000000000000000000000000000000000000000000000060e087901b16815273ffffffffffffffffffffffffffffffffffffffff94851660048201529390921660248401526044830152606482015260a06084820152600060a482015260c401600060405180830381600087803b15801561163557600080fd5b505af1158015611649573d6000803e3d6000fd5b5050505080806116589061542c565b915050611524565b50600084815260106020526040812061167891614c77565b600084815260116020526040812054903373ffffffffffffffffffffffffffffffffffffffff168260405160006040518083038185875af1925050503d80600081146116e0576040519150601f19603f3d011682016040523d82523d6000602084013e6116e5565b606091505b5050905080611750576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f4661696c656420746f20776974686472617720455448000000000000000000006044820152606401610afb565b60008681526011602052604080822082905551879133917f884edad9ce6fa2440d8a54cc123490eb96d2768479d49ff9c7366125a94243649190a350506001600c5550505050565b60006117a383612186565b8210611831576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602b60248201527f455243373231456e756d657261626c653a206f776e657220696e646578206f7560448201527f74206f6620626f756e64730000000000000000000000000000000000000000006064820152608401610afb565b5073ffffffffffffffffffffffffffffffffffffffff919091166000908152600660209081526040808320938352929052205490565b6000611871613942565b905090565b610cb58383836040518060200160405280600081525061242b565b61189a33610def565b611926576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603060248201527f4552433732314275726e61626c653a2063616c6c6572206973206e6f74206f7760448201527f6e6572206e6f7220617070726f766564000000000000000000000000000000006064820152608401610afb565b61192f81613a35565b50565b60135473ffffffffffffffffffffffffffffffffffffffff1633146119b3576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600b60248201527f4e6f7420616c6c6f7765640000000000000000000000000000000000000000006044820152606401610afb565b7f00000000000000000000000000000000000000000000000000000000000000008110611a3c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600f60248201527f496e76616c696420746f6b656e496400000000000000000000000000000000006044820152606401610afb565b60008181526012602052604090205460ff1615611ab5576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600c60248201527f416c7265616479207573656400000000000000000000000000000000000000006044820152606401610afb565b600081815260126020526040902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00166001179055611af68282613b0e565b5050565b6002600c541415611b67576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610afb565b6002600c55611b9a8160009081526002602052604090205473ffffffffffffffffffffffffffffffffffffffff16151590565b611c00576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601560248201527f42756e646c6520646f6573206e6f7420657869737400000000000000000000006044820152606401610afb565b611c0933610def565b611c6f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f4173736574577261707065723a204e6f6e2d6f776e6572206465706f736974006044820152606401610afb565b73ffffffffffffffffffffffffffffffffffffffff83166342842e0e336040517fffffffff0000000000000000000000000000000000000000000000000000000060e084901b16815273ffffffffffffffffffffffffffffffffffffffff909116600482015230602482015260448101859052606401600060405180830381600087803b158015611cff57600080fd5b505af1158015611d13573d6000803e3d6000fd5b5050506000828152600f602090815260408083208151808301835273ffffffffffffffffffffffffffffffffffffffff8981168083528286018a8152845460018082018755958952978790209351600290980290930180547fffffffffffffffffffffffff000000000000000000000000000000000000000016979092169690961781559051910155805192835290820185905283925033917f7a47efb9b86e599a690793c40afb239c7e3c6e8cc11439a9a6287798d46399a49101610f36565b6000611ddf60085490565b8210611e6d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602c60248201527f455243373231456e756d657261626c653a20676c6f62616c20696e646578206f60448201527f7574206f6620626f756e647300000000000000000000000000000000000000006064820152608401610afb565b60088281548110611e8057611e80615535565b90600052602060002001549050919050565b60008181526002602052604090205473ffffffffffffffffffffffffffffffffffffffff16611f1d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601560248201527f42756e646c6520646f6573206e6f7420657869737400000000000000000000006044820152606401610afb565b6000818152601160205260409020543490611f389082613cdc565b600083815260116020526040902055813373ffffffffffffffffffffffffffffffffffffffff167f57e8e547a3ef8d890c570ca885b0a8c441be3070e36b7ad4c7d6b9d9316ff2ce83604051611f9091815260200190565b60405180910390a35050565b600d5460009081526012602052604090205460ff1615612018576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600c60248201527f416c7265616479207573656400000000000000000000000000000000000000006044820152606401610afb565b61202481600d54613b0e565b600d8054600090815260126020526040812080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016600190811790915582549092919061207390849061536f565b909155505050565b60008181526002602052604081205473ffffffffffffffffffffffffffffffffffffffff16806109b6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602960248201527f4552433732313a206f776e657220717565727920666f72206e6f6e657869737460448201527f656e7420746f6b656e00000000000000000000000000000000000000000000006064820152608401610afb565b6010602052816000526040600020818154811061214957600080fd5b600091825260209091206003909102018054600182015460029092015473ffffffffffffffffffffffffffffffffffffffff909116935090915083565b600073ffffffffffffffffffffffffffffffffffffffff821661222b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602a60248201527f4552433732313a2062616c616e636520717565727920666f7220746865207a6560448201527f726f2061646472657373000000000000000000000000000000000000000000006064820152608401610afb565b5073ffffffffffffffffffffffffffffffffffffffff1660009081526003602052604090205490565b600b5473ffffffffffffffffffffffffffffffffffffffff1633146122d5576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610afb565b6122df6000613ce8565b565b73ffffffffffffffffffffffffffffffffffffffff81166000908152600a60205260408120546109b6565b6060600180546109cb906153de565b73ffffffffffffffffffffffffffffffffffffffff821633141561239b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601960248201527f4552433732313a20617070726f766520746f2063616c6c6572000000000000006044820152606401610afb565b33600081815260056020908152604080832073ffffffffffffffffffffffffffffffffffffffff87168085529083529281902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001686151590811790915590519081529192917f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c319101611f90565b6124353383613432565b6124c1576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603160248201527f4552433732313a207472616e736665722063616c6c6572206973206e6f74206f60448201527f776e6572206e6f7220617070726f7665640000000000000000000000000000006064820152608401610afb565b6124cd84848484613d5f565b50505050565b60008181526002602052604090205460609073ffffffffffffffffffffffffffffffffffffffff16612587576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602f60248201527f4552433732314d657461646174613a2055524920717565727920666f72206e6f60448201527f6e6578697374656e7420746f6b656e00000000000000000000000000000000006064820152608401610afb565b600061259e60408051602081019091526000815290565b905060008151116125be57604051806020016040528060008152506125e9565b806125c884613e02565b6040516020016125d9929190615295565b6040516020818303038152906040525b9392505050565b8342111561265a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601e60248201527f4552433732315065726d69743a206578706972656420646561646c696e6500006044820152606401610afb565b6126638561207b565b73ffffffffffffffffffffffffffffffffffffffff168773ffffffffffffffffffffffffffffffffffffffff16146126f7576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601760248201527f4552433732315065726d69743a206e6f74206f776e65720000000000000000006044820152606401610afb565b60007f00000000000000000000000000000000000000000000000000000000000000008888886127268c613f34565b60408051602081019690965273ffffffffffffffffffffffffffffffffffffffff94851690860152929091166060840152608083015260a082015260c0810186905260e001604051602081830303815290604052805190602001209050600061278e82613f69565b9050600061279e82878787613fd2565b90508973ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614612835576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f4552433732315065726d69743a20696e76616c6964207369676e6174757265006044820152606401610afb565b61283f8989613392565b50505050505050505050565b600f602052816000526040600020818154811061286757600080fd5b60009182526020909120600290910201805460019091015473ffffffffffffffffffffffffffffffffffffffff9091169250905082565b6002600c54141561290b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610afb565b6002600c5561291933610def565b61297f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f4173736574577261707065723a204e6f6e2d6f776e6572206465706f736974006044820152606401610afb565b61298881611891565b6000818152600e6020908152604080832080548251818502810185019093528083529192909190849084015b82821015612a095760008481526020908190206040805180820190915260028502909101805473ffffffffffffffffffffffffffffffffffffffff1682526001908101548284015290835290920191016129b4565b50505050905060005b8151811015612b3c57818181518110612a2d57612a2d615535565b60200260200101516000015173ffffffffffffffffffffffffffffffffffffffff1663a9059cbb612a5b3390565b848481518110612a6d57612a6d615535565b6020026020010151602001516040518363ffffffff1660e01b8152600401612ab792919073ffffffffffffffffffffffffffffffffffffffff929092168252602082015260400190565b602060405180830381600087803b158015612ad157600080fd5b505af1925050508015612b1f575060408051601f3d9081017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0168201909252612b1c9181019061519d565b60015b612b2857612b2a565b505b80612b348161542c565b915050612a12565b506000828152600e60205260408120612b5491614c56565b6000828152600f6020908152604080832080548251818502810185019093528083529192909190849084015b82821015612bd55760008481526020908190206040805180820190915260028502909101805473ffffffffffffffffffffffffffffffffffffffff168252600190810154828401529083529092019101612b80565b50505050905060005b8151811015612ce057818181518110612bf957612bf9615535565b60200260200101516000015173ffffffffffffffffffffffffffffffffffffffff166342842e0e30612c283390565b858581518110612c3a57612c3a615535565b60209081029190910181015101516040517fffffffff0000000000000000000000000000000000000000000000000000000060e086901b16815273ffffffffffffffffffffffffffffffffffffffff93841660048201529290911660248301526044820152606401600060405180830381600087803b158015612cbc57600080fd5b505af1925050508015612ccd575060015b5080612cd88161542c565b915050612bde565b506000838152600f60205260408120612cf891614c56565b600083815260106020908152604080832080548251818502810185019093528083529192909190849084015b82821015612d865760008481526020908190206040805160608101825260038602909201805473ffffffffffffffffffffffffffffffffffffffff16835260018082015484860152600290910154918301919091529083529092019101612d24565b50505050905060005b815181101561166057818181518110612daa57612daa615535565b60200260200101516000015173ffffffffffffffffffffffffffffffffffffffff1663f242432a30612dd93390565b858581518110612deb57612deb615535565b602002602001015160200151868681518110612e0957612e09615535565b602090810291909101015160409081015190517fffffffff0000000000000000000000000000000000000000000000000000000060e087901b16815273ffffffffffffffffffffffffffffffffffffffff94851660048201529390921660248401526044830152606482015260a06084820152600060a482015260c401600060405180830381600087803b158015612ea057600080fd5b505af1925050508015612eb1575060015b5080612ebc8161542c565b915050612d8f565b600b5473ffffffffffffffffffffffffffffffffffffffff163314612f45576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610afb565b73ffffffffffffffffffffffffffffffffffffffff8116612fe8576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f64647265737300000000000000000000000000000000000000000000000000006064820152608401610afb565b61192f81613ce8565b6002600c54141561305e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610afb565b6002600c556130918160009081526002602052604090205473ffffffffffffffffffffffffffffffffffffffff16151590565b6130f7576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601560248201527f42756e646c6520646f6573206e6f7420657869737400000000000000000000006044820152606401610afb565b61310033610def565b613166576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f4173736574577261707065723a204e6f6e2d6f776e6572206465706f736974006044820152606401610afb565b73ffffffffffffffffffffffffffffffffffffffff841663f242432a336040517fffffffff0000000000000000000000000000000000000000000000000000000060e084901b16815273ffffffffffffffffffffffffffffffffffffffff9091166004820152306024820152604481018690526064810185905260a06084820152600060a482015260c401600060405180830381600087803b15801561320b57600080fd5b505af115801561321f573d6000803e3d6000fd5b5050506000828152601060209081526040808320815160608101835273ffffffffffffffffffffffffffffffffffffffff8a811682528185018a8152938201898152835460018082018655948852959096209151600390950290910180547fffffffffffffffffffffffff0000000000000000000000000000000000000000169490911693909317835590519082015590516002909101555080336040805173ffffffffffffffffffffffffffffffffffffffff8881168252602082018890529181018690529116907fb498002f49085cb108177238b25fbdd698b687feee33f473f774476fe5f812339060600160405180910390a350506001600c555050565b600e602052816000526040600020818154811061286757600080fd5b60007fffffffff0000000000000000000000000000000000000000000000000000000082167f4e2312e00000000000000000000000000000000000000000000000000000000014806109b657506109b682613ffa565b600081815260046020526040902080547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff841690811790915581906133ec8261207b565b73ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b60008181526002602052604081205473ffffffffffffffffffffffffffffffffffffffff166134e3576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602c60248201527f4552433732313a206f70657261746f7220717565727920666f72206e6f6e657860448201527f697374656e7420746f6b656e00000000000000000000000000000000000000006064820152608401610afb565b60006134ee8361207b565b90508073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff16148061355d57508373ffffffffffffffffffffffffffffffffffffffff1661354584610a4e565b73ffffffffffffffffffffffffffffffffffffffff16145b80610cdc575073ffffffffffffffffffffffffffffffffffffffff80821660009081526005602090815260408083209388168352929052205460ff16610cdc565b60405173ffffffffffffffffffffffffffffffffffffffff808516602483015283166044820152606481018290526124cd9085907f23b872dd00000000000000000000000000000000000000000000000000000000906084015b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181529190526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fffffffff0000000000000000000000000000000000000000000000000000000090931692909217909152614050565b8273ffffffffffffffffffffffffffffffffffffffff1661369a8261207b565b73ffffffffffffffffffffffffffffffffffffffff161461373d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602960248201527f4552433732313a207472616e73666572206f6620746f6b656e2074686174206960448201527f73206e6f74206f776e00000000000000000000000000000000000000000000006064820152608401610afb565b73ffffffffffffffffffffffffffffffffffffffff82166137df576040517f08c379a0000000000000000000000000000000000000000000000000000000008152602060048201526024808201527f4552433732313a207472616e7366657220746f20746865207a65726f2061646460448201527f72657373000000000000000000000000000000000000000000000000000000006064820152608401610afb565b6137ea83838361415c565b6137f5600082613392565b73ffffffffffffffffffffffffffffffffffffffff8316600090815260036020526040812080546001929061382b90849061539b565b909155505073ffffffffffffffffffffffffffffffffffffffff8216600090815260036020526040812080546001929061386690849061536f565b909155505060008181526002602052604080822080547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff86811691821790925591518493918716917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef91a4505050565b60405173ffffffffffffffffffffffffffffffffffffffff8316602482015260448101829052610cb59084907fa9059cbb00000000000000000000000000000000000000000000000000000000906064016135f8565b60007f000000000000000000000000000000000000000000000000000000000000000046141561399157507f000000000000000000000000000000000000000000000000000000000000000090565b50604080517f00000000000000000000000000000000000000000000000000000000000000006020808301919091527f0000000000000000000000000000000000000000000000000000000000000000828401527f000000000000000000000000000000000000000000000000000000000000000060608301524660808301523060a0808401919091528351808403909101815260c0909201909252805191012090565b6000613a408261207b565b9050613a4e8160008461415c565b613a59600083613392565b73ffffffffffffffffffffffffffffffffffffffff81166000908152600360205260408120805460019290613a8f90849061539b565b909155505060008281526002602052604080822080547fffffffffffffffffffffffff00000000000000000000000000000000000000001690555183919073ffffffffffffffffffffffffffffffffffffffff8416907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908390a45050565b73ffffffffffffffffffffffffffffffffffffffff8216613b8b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4552433732313a206d696e7420746f20746865207a65726f20616464726573736044820152606401610afb565b60008181526002602052604090205473ffffffffffffffffffffffffffffffffffffffff1615613c17576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601c60248201527f4552433732313a20746f6b656e20616c7265616479206d696e746564000000006044820152606401610afb565b613c236000838361415c565b73ffffffffffffffffffffffffffffffffffffffff82166000908152600360205260408120805460019290613c5990849061536f565b909155505060008181526002602052604080822080547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff861690811790915590518392907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a45050565b60006125e9828461536f565b600b805473ffffffffffffffffffffffffffffffffffffffff8381167fffffffffffffffffffffffff0000000000000000000000000000000000000000831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b613d6a84848461367a565b613d7684848484614167565b6124cd576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603260248201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560448201527f63656976657220696d706c656d656e74657200000000000000000000000000006064820152608401610afb565b606081613e4257505060408051808201909152600181527f3000000000000000000000000000000000000000000000000000000000000000602082015290565b8160005b8115613e6c5780613e568161542c565b9150613e659050600a83615387565b9150613e46565b60008167ffffffffffffffff811115613e8757613e87615564565b6040519080825280601f01601f191660200182016040528015613eb1576020820181803683370190505b5090505b8415610cdc57613ec660018361539b565b9150613ed3600a86615465565b613ede90603061536f565b60f81b818381518110613ef357613ef3615535565b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a905350613f2d600a86615387565b9450613eb5565b73ffffffffffffffffffffffffffffffffffffffff81166000908152600a602052604090208054600181018255905b50919050565b60006109b6613f76613942565b836040517f19010000000000000000000000000000000000000000000000000000000000006020820152602281018390526042810182905260009060620160405160208183030381529060405280519060200120905092915050565b6000806000613fe387878787614363565b91509150613ff08161447b565b5095945050505050565b60007fffffffff0000000000000000000000000000000000000000000000000000000082167f780e9d630000000000000000000000000000000000000000000000000000000014806109b657506109b6826146d4565b60006140b2826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c65648152508573ffffffffffffffffffffffffffffffffffffffff166147b79092919063ffffffff16565b805190915015610cb557808060200190518101906140d0919061519d565b610cb5576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e60448201527f6f742073756363656564000000000000000000000000000000000000000000006064820152608401610afb565b610cb58383836147c6565b600073ffffffffffffffffffffffffffffffffffffffff84163b1561435b576040517f150b7a0200000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff85169063150b7a02906141de9033908990889088906004016152c4565b602060405180830381600087803b1580156141f857600080fd5b505af1925050508015614246575060408051601f3d9081017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0168201909252614243918101906151d7565b60015b614310573d808015614274576040519150601f19603f3d011682016040523d82523d6000602084013e614279565b606091505b508051614308576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603260248201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560448201527f63656976657220696d706c656d656e74657200000000000000000000000000006064820152608401610afb565b805181602001fd5b7fffffffff00000000000000000000000000000000000000000000000000000000167f150b7a0200000000000000000000000000000000000000000000000000000000149050610cdc565b506001610cdc565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a083111561439a5750600090506003614472565b8460ff16601b141580156143b257508460ff16601c14155b156143c35750600090506004614472565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa158015614417573d6000803e3d6000fd5b50506040517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0015191505073ffffffffffffffffffffffffffffffffffffffff811661446b57600060019250925050614472565b9150600090505b94509492505050565b600081600481111561448f5761448f6154d7565b14156144985750565b60018160048111156144ac576144ac6154d7565b1415614514576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601860248201527f45434453413a20696e76616c6964207369676e617475726500000000000000006044820152606401610afb565b6002816004811115614528576145286154d7565b1415614590576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e677468006044820152606401610afb565b60038160048111156145a4576145a46154d7565b1415614632576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c60448201527f75650000000000000000000000000000000000000000000000000000000000006064820152608401610afb565b6004816004811115614646576146466154d7565b141561192f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202776272076616c60448201527f75650000000000000000000000000000000000000000000000000000000000006064820152608401610afb565b60007fffffffff0000000000000000000000000000000000000000000000000000000082167f80ac58cd00000000000000000000000000000000000000000000000000000000148061476757507fffffffff0000000000000000000000000000000000000000000000000000000082167f5b5e139f00000000000000000000000000000000000000000000000000000000145b806109b657507f01ffc9a7000000000000000000000000000000000000000000000000000000007fffffffff000000000000000000000000000000000000000000000000000000008316146109b6565b6060610cdc84846000856148cc565b73ffffffffffffffffffffffffffffffffffffffff831661482e5761482981600880546000838152600960205260408120829055600182018355919091527ff3f7a9fe364faab93b216da50a3214154f22a0a2b415b23a84c8169e8b636ee30155565b61486b565b8173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161461486b5761486b8382614a4c565b73ffffffffffffffffffffffffffffffffffffffff821661488f57610cb581614b03565b8273ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614610cb557610cb58282614bb2565b60608247101561495e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f60448201527f722063616c6c00000000000000000000000000000000000000000000000000006064820152608401610afb565b843b6149c6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610afb565b6000808673ffffffffffffffffffffffffffffffffffffffff1685876040516149ef9190615279565b60006040518083038185875af1925050503d8060008114614a2c576040519150601f19603f3d011682016040523d82523d6000602084013e614a31565b606091505b5091509150614a41828286614c03565b979650505050505050565b60006001614a5984612186565b614a63919061539b565b600083815260076020526040902054909150808214614ac35773ffffffffffffffffffffffffffffffffffffffff841660009081526006602090815260408083208584528252808320548484528184208190558352600790915290208190555b50600091825260076020908152604080842084905573ffffffffffffffffffffffffffffffffffffffff9094168352600681528383209183525290812055565b600854600090614b159060019061539b565b60008381526009602052604081205460088054939450909284908110614b3d57614b3d615535565b906000526020600020015490508060088381548110614b5e57614b5e615535565b6000918252602080832090910192909255828152600990915260408082208490558582528120556008805480614b9657614b96615506565b6001900381819060005260206000200160009055905550505050565b6000614bbd83612186565b73ffffffffffffffffffffffffffffffffffffffff9093166000908152600660209081526040808320868452825280832085905593825260079052919091209190915550565b60608315614c125750816125e9565b825115614c225782518084602001fd5b816040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610afb919061530d565b508054600082556002029060005260206000209081019061192f9190614c98565b508054600082556003029060005260206000209081019061192f9190614cda565b5b80821115614cd65780547fffffffffffffffffffffffff000000000000000000000000000000000000000016815560006001820155600201614c99565b5090565b5b80821115614cd65780547fffffffffffffffffffffffff00000000000000000000000000000000000000001681556000600182018190556002820155600301614cdb565b803573ffffffffffffffffffffffffffffffffffffffff81168114614d4357600080fd5b919050565b600082601f830112614d5957600080fd5b8135602067ffffffffffffffff821115614d7557614d75615564565b8160051b614d84828201615320565b838152828101908684018388018501891015614d9f57600080fd5b600093505b85841015614dc2578035835260019390930192918401918401614da4565b50979650505050505050565b600082601f830112614ddf57600080fd5b813567ffffffffffffffff811115614df957614df9615564565b614e2a60207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f84011601615320565b818152846020838601011115614e3f57600080fd5b816020850160208301376000918101602001919091529392505050565b600060208284031215614e6e57600080fd5b6125e982614d1f565b60008060408385031215614e8a57600080fd5b614e9383614d1f565b9150614ea160208401614d1f565b90509250929050565b600080600080600060a08688031215614ec257600080fd5b614ecb86614d1f565b9450614ed960208701614d1f565b9350604086013567ffffffffffffffff80821115614ef657600080fd5b614f0289838a01614d48565b94506060880135915080821115614f1857600080fd5b614f2489838a01614d48565b93506080880135915080821115614f3a57600080fd5b50614f4788828901614dce565b9150509295509295909350565b600080600060608486031215614f6957600080fd5b614f7284614d1f565b9250614f8060208501614d1f565b9150604084013590509250925092565b60008060008060808587031215614fa657600080fd5b614faf85614d1f565b9350614fbd60208601614d1f565b925060408501359150606085013567ffffffffffffffff811115614fe057600080fd5b614fec87828801614dce565b91505092959194509250565b600080600080600060a0868803121561501057600080fd5b61501986614d1f565b945061502760208701614d1f565b93506040860135925060608601359150608086013567ffffffffffffffff81111561505157600080fd5b614f4788828901614dce565b600080600080600080600060e0888a03121561507857600080fd5b61508188614d1f565b965061508f60208901614d1f565b95506040880135945060608801359350608088013560ff811681146150b357600080fd5b9699959850939692959460a0840135945060c09093013592915050565b600080604083850312156150e357600080fd5b6150ec83614d1f565b915060208301356150fc81615593565b809150509250929050565b6000806040838503121561511a57600080fd5b61512383614d1f565b946020939093013593505050565b60008060006060848603121561514657600080fd5b61514f84614d1f565b95602085013595506040909401359392505050565b6000806000806080858703121561517a57600080fd5b61518385614d1f565b966020860135965060408601359560600135945092505050565b6000602082840312156151af57600080fd5b81516125e981615593565b6000602082840312156151cc57600080fd5b81356125e9816155a1565b6000602082840312156151e957600080fd5b81516125e9816155a1565b60006020828403121561520657600080fd5b5035919050565b6000806040838503121561522057600080fd5b50508035926020909101359150565b600081518084526152478160208601602086016153b2565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169290920160200192915050565b6000825161528b8184602087016153b2565b9190910192915050565b600083516152a78184602088016153b2565b8351908301906152bb8183602088016153b2565b01949350505050565b600073ffffffffffffffffffffffffffffffffffffffff808716835280861660208401525083604083015260806060830152615303608083018461522f565b9695505050505050565b6020815260006125e9602083018461522f565b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016810167ffffffffffffffff8111828210171561536757615367615564565b604052919050565b6000821982111561538257615382615479565b500190565b600082615396576153966154a8565b500490565b6000828210156153ad576153ad615479565b500390565b60005b838110156153cd5781810151838201526020016153b5565b838111156124cd5750506000910152565b600181811c908216806153f257607f821691505b60208210811415613f63577f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82141561545e5761545e615479565b5060010190565b600082615474576154746154a8565b500690565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b801515811461192f57600080fd5b7fffffffff000000000000000000000000000000000000000000000000000000008116811461192f57600080fdfea164736f6c6343000805000a000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000a0000000000000000000000000000000000000000000000000000000000000012c000000000000000000000000000000000000000000000000000000000000000c417373657457726170706572000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000024157000000000000000000000000000000000000000000000000000000000000
Deployed Bytecode
0x6080604052600436106102dc5760003560e01c80636d5442c211610184578063bc197c81116100d6578063e3fa58821161008a578063f2fde38b11610064578063f2fde38b1461094b578063f998fe9d1461096b578063fc6bf1331461098b57600080fd5b8063e3fa588214610890578063e985e9c5146108b0578063f23a6e611461090657600080fd5b8063d505accf116100bb578063d505accf146107f7578063dcca396014610817578063ddff9f451461086357600080fd5b8063bc197c8114610792578063c87b56dd146107d757600080fd5b80638da5cb5b11610138578063a6cb599811610112578063a6cb599814610718578063b88d4fde14610745578063b915d8a91461076557600080fd5b80638da5cb5b146106b857806395d89b41146106e3578063a22cb465146106f857600080fd5b8063715018a611610169578063715018a6146106565780637298c7361461066b5780637ecebe001461069857600080fd5b80636d5442c2146105e457806370a082311461063657600080fd5b80632f745c591161023d57806345a4276b116101f15780635358fbda116101cb5780635358fbda14610591578063631e1c6c146105a45780636352211e146105c457600080fd5b806345a4276b1461052457806347f58ee7146105445780634f6ccce71461057157600080fd5b806342842e0e1161022257806342842e0e146104c457806342966c68146104e457806344f21a131461050457600080fd5b80632f745c591461048f5780633644e515146104af57600080fd5b806318160ddd1161029457806323b872dd1161027957806323b872dd1461042f5780632c1630211461044f5780632e1a7d4d1461046f57600080fd5b806318160ddd146103f057806321425ee01461040f57600080fd5b8063081812fc116102c5578063081812fc14610338578063095ea7b31461037d578063150b7a021461039f57600080fd5b806301ffc9a7146102e157806306fdde0314610316575b600080fd5b3480156102ed57600080fd5b506103016102fc3660046151ba565b6109ab565b60405190151581526020015b60405180910390f35b34801561032257600080fd5b5061032b6109bc565b60405161030d919061530d565b34801561034457600080fd5b506103586103533660046151f4565b610a4e565b60405173ffffffffffffffffffffffffffffffffffffffff909116815260200161030d565b34801561038957600080fd5b5061039d610398366004615107565b610b2d565b005b3480156103ab57600080fd5b506103bf6103ba366004614f90565b610cba565b6040517fffffffff00000000000000000000000000000000000000000000000000000000909116815260200161030d565b3480156103fc57600080fd5b506008545b60405190815260200161030d565b34801561041b57600080fd5b5061039d61042a366004615131565b610ce4565b34801561043b57600080fd5b5061039d61044a366004614f54565b610f48565b34801561045b57600080fd5b5061039d61046a366004614e5c565b610fe8565b34801561047b57600080fd5b5061039d61048a3660046151f4565b6110b0565b34801561049b57600080fd5b506104016104aa366004615107565b611798565b3480156104bb57600080fd5b50610401611867565b3480156104d057600080fd5b5061039d6104df366004614f54565b611876565b3480156104f057600080fd5b5061039d6104ff3660046151f4565b611891565b34801561051057600080fd5b5061039d61051f366004615107565b611932565b34801561053057600080fd5b5061039d61053f366004615131565b611afa565b34801561055057600080fd5b506013546103589073ffffffffffffffffffffffffffffffffffffffff1681565b34801561057d57600080fd5b5061040161058c3660046151f4565b611dd4565b61039d61059f3660046151f4565b611e92565b3480156105b057600080fd5b5061039d6105bf366004614e5c565b611f9c565b3480156105d057600080fd5b506103586105df3660046151f4565b61207b565b3480156105f057600080fd5b506106046105ff36600461520d565b61212d565b6040805173ffffffffffffffffffffffffffffffffffffffff909416845260208401929092529082015260600161030d565b34801561064257600080fd5b50610401610651366004614e5c565b612186565b34801561066257600080fd5b5061039d612254565b34801561067757600080fd5b506104016106863660046151f4565b60116020526000908152604090205481565b3480156106a457600080fd5b506104016106b3366004614e5c565b6122e1565b3480156106c457600080fd5b50600b5473ffffffffffffffffffffffffffffffffffffffff16610358565b3480156106ef57600080fd5b5061032b61230c565b34801561070457600080fd5b5061039d6107133660046150d0565b61231b565b34801561072457600080fd5b506104016107333660046151f4565b6000908152600f602052604090205490565b34801561075157600080fd5b5061039d610760366004614f90565b61242b565b34801561077157600080fd5b506104016107803660046151f4565b6000908152600e602052604090205490565b34801561079e57600080fd5b506103bf6107ad366004614eaa565b7fbc197c810000000000000000000000000000000000000000000000000000000095945050505050565b3480156107e357600080fd5b5061032b6107f23660046151f4565b6124d3565b34801561080357600080fd5b5061039d61081236600461505d565b6125f0565b34801561082357600080fd5b5061083761083236600461520d565b61284b565b6040805173ffffffffffffffffffffffffffffffffffffffff909316835260208301919091520161030d565b34801561086f57600080fd5b5061040161087e3660046151f4565b60009081526010602052604090205490565b34801561089c57600080fd5b5061039d6108ab3660046151f4565b61289e565b3480156108bc57600080fd5b506103016108cb366004614e77565b73ffffffffffffffffffffffffffffffffffffffff918216600090815260056020908152604080832093909416825291909152205460ff1690565b34801561091257600080fd5b506103bf610921366004614ff8565b7ff23a6e610000000000000000000000000000000000000000000000000000000095945050505050565b34801561095757600080fd5b5061039d610966366004614e5c565b612ec4565b34801561097757600080fd5b5061039d610986366004615164565b612ff1565b34801561099757600080fd5b506108376109a636600461520d565b613320565b60006109b68261333c565b92915050565b6060600080546109cb906153de565b80601f01602080910402602001604051908101604052809291908181526020018280546109f7906153de565b8015610a445780601f10610a1957610100808354040283529160200191610a44565b820191906000526020600020905b815481529060010190602001808311610a2757829003601f168201915b5050505050905090565b60008181526002602052604081205473ffffffffffffffffffffffffffffffffffffffff16610b04576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602c60248201527f4552433732313a20617070726f76656420717565727920666f72206e6f6e657860448201527f697374656e7420746f6b656e000000000000000000000000000000000000000060648201526084015b60405180910390fd5b5060009081526004602052604090205473ffffffffffffffffffffffffffffffffffffffff1690565b6000610b388261207b565b90508073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610bf6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602160248201527f4552433732313a20617070726f76616c20746f2063757272656e74206f776e6560448201527f72000000000000000000000000000000000000000000000000000000000000006064820152608401610afb565b3373ffffffffffffffffffffffffffffffffffffffff82161480610c1f5750610c1f81336108cb565b610cab576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603860248201527f4552433732313a20617070726f76652063616c6c6572206973206e6f74206f7760448201527f6e6572206e6f7220617070726f76656420666f7220616c6c00000000000000006064820152608401610afb565b610cb58383613392565b505050565b7f150b7a02000000000000000000000000000000000000000000000000000000005b949350505050565b6002600c541415610d51576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610afb565b6002600c55610d848160009081526002602052604090205473ffffffffffffffffffffffffffffffffffffffff16151590565b610dea576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601560248201527f42756e646c6520646f6573206e6f7420657869737400000000000000000000006044820152606401610afb565b610df5335b82613432565b610e5b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f4173736574577261707065723a204e6f6e2d6f776e6572206465706f736974006044820152606401610afb565b610e7d73ffffffffffffffffffffffffffffffffffffffff841633308561359e565b6000818152600e602090815260408083208151808301835273ffffffffffffffffffffffffffffffffffffffff888116808352828601898152845460018082018755958952978790209351600290980290930180547fffffffffffffffffffffffff0000000000000000000000000000000000000000169790921696909617815590519101558051928352908201849052829133917feee1a9363c8cef3e5872690139669b46cb0b21d9c57d568d17b7b306d96694f791015b60405180910390a350506001600c5550565b610f5133610def565b610fdd576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603160248201527f4552433732313a207472616e736665722063616c6c6572206973206e6f74206f60448201527f776e6572206e6f7220617070726f7665640000000000000000000000000000006064820152608401610afb565b610cb583838361367a565b600b5473ffffffffffffffffffffffffffffffffffffffff163314611069576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610afb565b601380547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff92909216919091179055565b6002600c54141561111d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610afb565b6002600c5561112b33610def565b6111b7576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602260248201527f4173736574577261707065723a204e6f6e2d6f776e657220776974686472617760448201527f616c0000000000000000000000000000000000000000000000000000000000006064820152608401610afb565b6111c081611891565b6000818152600e6020908152604080832080548251818502810185019093528083529192909190849084015b828210156112415760008481526020908190206040805180820190915260028502909101805473ffffffffffffffffffffffffffffffffffffffff1682526001908101548284015290835290920191016111ec565b50505050905060005b81518110156112ca576112b83383838151811061126957611269615535565b60200260200101516020015184848151811061128757611287615535565b60200260200101516000015173ffffffffffffffffffffffffffffffffffffffff166138ec9092919063ffffffff16565b806112c28161542c565b91505061124a565b506000828152600e602052604081206112e291614c56565b6000828152600f6020908152604080832080548251818502810185019093528083529192909190849084015b828210156113635760008481526020908190206040805180820190915260028502909101805473ffffffffffffffffffffffffffffffffffffffff16825260019081015482840152908352909201910161130e565b50505050905060005b81518110156114755781818151811061138757611387615535565b60200260200101516000015173ffffffffffffffffffffffffffffffffffffffff166342842e0e306113b63390565b8585815181106113c8576113c8615535565b60209081029190910181015101516040517fffffffff0000000000000000000000000000000000000000000000000000000060e086901b16815273ffffffffffffffffffffffffffffffffffffffff93841660048201529290911660248301526044820152606401600060405180830381600087803b15801561144a57600080fd5b505af115801561145e573d6000803e3d6000fd5b50505050808061146d9061542c565b91505061136c565b506000838152600f6020526040812061148d91614c56565b600083815260106020908152604080832080548251818502810185019093528083529192909190849084015b8282101561151b5760008481526020908190206040805160608101825260038602909201805473ffffffffffffffffffffffffffffffffffffffff168352600180820154848601526002909101549183019190915290835290920191016114b9565b50505050905060005b81518110156116605781818151811061153f5761153f615535565b60200260200101516000015173ffffffffffffffffffffffffffffffffffffffff1663f242432a3061156e3390565b85858151811061158057611580615535565b60200260200101516020015186868151811061159e5761159e615535565b602090810291909101015160409081015190517fffffffff0000000000000000000000000000000000000000000000000000000060e087901b16815273ffffffffffffffffffffffffffffffffffffffff94851660048201529390921660248401526044830152606482015260a06084820152600060a482015260c401600060405180830381600087803b15801561163557600080fd5b505af1158015611649573d6000803e3d6000fd5b5050505080806116589061542c565b915050611524565b50600084815260106020526040812061167891614c77565b600084815260116020526040812054903373ffffffffffffffffffffffffffffffffffffffff168260405160006040518083038185875af1925050503d80600081146116e0576040519150601f19603f3d011682016040523d82523d6000602084013e6116e5565b606091505b5050905080611750576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f4661696c656420746f20776974686472617720455448000000000000000000006044820152606401610afb565b60008681526011602052604080822082905551879133917f884edad9ce6fa2440d8a54cc123490eb96d2768479d49ff9c7366125a94243649190a350506001600c5550505050565b60006117a383612186565b8210611831576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602b60248201527f455243373231456e756d657261626c653a206f776e657220696e646578206f7560448201527f74206f6620626f756e64730000000000000000000000000000000000000000006064820152608401610afb565b5073ffffffffffffffffffffffffffffffffffffffff919091166000908152600660209081526040808320938352929052205490565b6000611871613942565b905090565b610cb58383836040518060200160405280600081525061242b565b61189a33610def565b611926576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603060248201527f4552433732314275726e61626c653a2063616c6c6572206973206e6f74206f7760448201527f6e6572206e6f7220617070726f766564000000000000000000000000000000006064820152608401610afb565b61192f81613a35565b50565b60135473ffffffffffffffffffffffffffffffffffffffff1633146119b3576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600b60248201527f4e6f7420616c6c6f7765640000000000000000000000000000000000000000006044820152606401610afb565b7f000000000000000000000000000000000000000000000000000000000000012c8110611a3c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600f60248201527f496e76616c696420746f6b656e496400000000000000000000000000000000006044820152606401610afb565b60008181526012602052604090205460ff1615611ab5576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600c60248201527f416c7265616479207573656400000000000000000000000000000000000000006044820152606401610afb565b600081815260126020526040902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00166001179055611af68282613b0e565b5050565b6002600c541415611b67576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610afb565b6002600c55611b9a8160009081526002602052604090205473ffffffffffffffffffffffffffffffffffffffff16151590565b611c00576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601560248201527f42756e646c6520646f6573206e6f7420657869737400000000000000000000006044820152606401610afb565b611c0933610def565b611c6f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f4173736574577261707065723a204e6f6e2d6f776e6572206465706f736974006044820152606401610afb565b73ffffffffffffffffffffffffffffffffffffffff83166342842e0e336040517fffffffff0000000000000000000000000000000000000000000000000000000060e084901b16815273ffffffffffffffffffffffffffffffffffffffff909116600482015230602482015260448101859052606401600060405180830381600087803b158015611cff57600080fd5b505af1158015611d13573d6000803e3d6000fd5b5050506000828152600f602090815260408083208151808301835273ffffffffffffffffffffffffffffffffffffffff8981168083528286018a8152845460018082018755958952978790209351600290980290930180547fffffffffffffffffffffffff000000000000000000000000000000000000000016979092169690961781559051910155805192835290820185905283925033917f7a47efb9b86e599a690793c40afb239c7e3c6e8cc11439a9a6287798d46399a49101610f36565b6000611ddf60085490565b8210611e6d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602c60248201527f455243373231456e756d657261626c653a20676c6f62616c20696e646578206f60448201527f7574206f6620626f756e647300000000000000000000000000000000000000006064820152608401610afb565b60088281548110611e8057611e80615535565b90600052602060002001549050919050565b60008181526002602052604090205473ffffffffffffffffffffffffffffffffffffffff16611f1d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601560248201527f42756e646c6520646f6573206e6f7420657869737400000000000000000000006044820152606401610afb565b6000818152601160205260409020543490611f389082613cdc565b600083815260116020526040902055813373ffffffffffffffffffffffffffffffffffffffff167f57e8e547a3ef8d890c570ca885b0a8c441be3070e36b7ad4c7d6b9d9316ff2ce83604051611f9091815260200190565b60405180910390a35050565b600d5460009081526012602052604090205460ff1615612018576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600c60248201527f416c7265616479207573656400000000000000000000000000000000000000006044820152606401610afb565b61202481600d54613b0e565b600d8054600090815260126020526040812080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016600190811790915582549092919061207390849061536f565b909155505050565b60008181526002602052604081205473ffffffffffffffffffffffffffffffffffffffff16806109b6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602960248201527f4552433732313a206f776e657220717565727920666f72206e6f6e657869737460448201527f656e7420746f6b656e00000000000000000000000000000000000000000000006064820152608401610afb565b6010602052816000526040600020818154811061214957600080fd5b600091825260209091206003909102018054600182015460029092015473ffffffffffffffffffffffffffffffffffffffff909116935090915083565b600073ffffffffffffffffffffffffffffffffffffffff821661222b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602a60248201527f4552433732313a2062616c616e636520717565727920666f7220746865207a6560448201527f726f2061646472657373000000000000000000000000000000000000000000006064820152608401610afb565b5073ffffffffffffffffffffffffffffffffffffffff1660009081526003602052604090205490565b600b5473ffffffffffffffffffffffffffffffffffffffff1633146122d5576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610afb565b6122df6000613ce8565b565b73ffffffffffffffffffffffffffffffffffffffff81166000908152600a60205260408120546109b6565b6060600180546109cb906153de565b73ffffffffffffffffffffffffffffffffffffffff821633141561239b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601960248201527f4552433732313a20617070726f766520746f2063616c6c6572000000000000006044820152606401610afb565b33600081815260056020908152604080832073ffffffffffffffffffffffffffffffffffffffff87168085529083529281902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001686151590811790915590519081529192917f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c319101611f90565b6124353383613432565b6124c1576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603160248201527f4552433732313a207472616e736665722063616c6c6572206973206e6f74206f60448201527f776e6572206e6f7220617070726f7665640000000000000000000000000000006064820152608401610afb565b6124cd84848484613d5f565b50505050565b60008181526002602052604090205460609073ffffffffffffffffffffffffffffffffffffffff16612587576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602f60248201527f4552433732314d657461646174613a2055524920717565727920666f72206e6f60448201527f6e6578697374656e7420746f6b656e00000000000000000000000000000000006064820152608401610afb565b600061259e60408051602081019091526000815290565b905060008151116125be57604051806020016040528060008152506125e9565b806125c884613e02565b6040516020016125d9929190615295565b6040516020818303038152906040525b9392505050565b8342111561265a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601e60248201527f4552433732315065726d69743a206578706972656420646561646c696e6500006044820152606401610afb565b6126638561207b565b73ffffffffffffffffffffffffffffffffffffffff168773ffffffffffffffffffffffffffffffffffffffff16146126f7576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601760248201527f4552433732315065726d69743a206e6f74206f776e65720000000000000000006044820152606401610afb565b60007f48d39b37a35214940203bbbd4f383519797769b13d936f387d89430afef276888888886127268c613f34565b60408051602081019690965273ffffffffffffffffffffffffffffffffffffffff94851690860152929091166060840152608083015260a082015260c0810186905260e001604051602081830303815290604052805190602001209050600061278e82613f69565b9050600061279e82878787613fd2565b90508973ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614612835576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f4552433732315065726d69743a20696e76616c6964207369676e6174757265006044820152606401610afb565b61283f8989613392565b50505050505050505050565b600f602052816000526040600020818154811061286757600080fd5b60009182526020909120600290910201805460019091015473ffffffffffffffffffffffffffffffffffffffff9091169250905082565b6002600c54141561290b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610afb565b6002600c5561291933610def565b61297f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f4173736574577261707065723a204e6f6e2d6f776e6572206465706f736974006044820152606401610afb565b61298881611891565b6000818152600e6020908152604080832080548251818502810185019093528083529192909190849084015b82821015612a095760008481526020908190206040805180820190915260028502909101805473ffffffffffffffffffffffffffffffffffffffff1682526001908101548284015290835290920191016129b4565b50505050905060005b8151811015612b3c57818181518110612a2d57612a2d615535565b60200260200101516000015173ffffffffffffffffffffffffffffffffffffffff1663a9059cbb612a5b3390565b848481518110612a6d57612a6d615535565b6020026020010151602001516040518363ffffffff1660e01b8152600401612ab792919073ffffffffffffffffffffffffffffffffffffffff929092168252602082015260400190565b602060405180830381600087803b158015612ad157600080fd5b505af1925050508015612b1f575060408051601f3d9081017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0168201909252612b1c9181019061519d565b60015b612b2857612b2a565b505b80612b348161542c565b915050612a12565b506000828152600e60205260408120612b5491614c56565b6000828152600f6020908152604080832080548251818502810185019093528083529192909190849084015b82821015612bd55760008481526020908190206040805180820190915260028502909101805473ffffffffffffffffffffffffffffffffffffffff168252600190810154828401529083529092019101612b80565b50505050905060005b8151811015612ce057818181518110612bf957612bf9615535565b60200260200101516000015173ffffffffffffffffffffffffffffffffffffffff166342842e0e30612c283390565b858581518110612c3a57612c3a615535565b60209081029190910181015101516040517fffffffff0000000000000000000000000000000000000000000000000000000060e086901b16815273ffffffffffffffffffffffffffffffffffffffff93841660048201529290911660248301526044820152606401600060405180830381600087803b158015612cbc57600080fd5b505af1925050508015612ccd575060015b5080612cd88161542c565b915050612bde565b506000838152600f60205260408120612cf891614c56565b600083815260106020908152604080832080548251818502810185019093528083529192909190849084015b82821015612d865760008481526020908190206040805160608101825260038602909201805473ffffffffffffffffffffffffffffffffffffffff16835260018082015484860152600290910154918301919091529083529092019101612d24565b50505050905060005b815181101561166057818181518110612daa57612daa615535565b60200260200101516000015173ffffffffffffffffffffffffffffffffffffffff1663f242432a30612dd93390565b858581518110612deb57612deb615535565b602002602001015160200151868681518110612e0957612e09615535565b602090810291909101015160409081015190517fffffffff0000000000000000000000000000000000000000000000000000000060e087901b16815273ffffffffffffffffffffffffffffffffffffffff94851660048201529390921660248401526044830152606482015260a06084820152600060a482015260c401600060405180830381600087803b158015612ea057600080fd5b505af1925050508015612eb1575060015b5080612ebc8161542c565b915050612d8f565b600b5473ffffffffffffffffffffffffffffffffffffffff163314612f45576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610afb565b73ffffffffffffffffffffffffffffffffffffffff8116612fe8576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f64647265737300000000000000000000000000000000000000000000000000006064820152608401610afb565b61192f81613ce8565b6002600c54141561305e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610afb565b6002600c556130918160009081526002602052604090205473ffffffffffffffffffffffffffffffffffffffff16151590565b6130f7576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601560248201527f42756e646c6520646f6573206e6f7420657869737400000000000000000000006044820152606401610afb565b61310033610def565b613166576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f4173736574577261707065723a204e6f6e2d6f776e6572206465706f736974006044820152606401610afb565b73ffffffffffffffffffffffffffffffffffffffff841663f242432a336040517fffffffff0000000000000000000000000000000000000000000000000000000060e084901b16815273ffffffffffffffffffffffffffffffffffffffff9091166004820152306024820152604481018690526064810185905260a06084820152600060a482015260c401600060405180830381600087803b15801561320b57600080fd5b505af115801561321f573d6000803e3d6000fd5b5050506000828152601060209081526040808320815160608101835273ffffffffffffffffffffffffffffffffffffffff8a811682528185018a8152938201898152835460018082018655948852959096209151600390950290910180547fffffffffffffffffffffffff0000000000000000000000000000000000000000169490911693909317835590519082015590516002909101555080336040805173ffffffffffffffffffffffffffffffffffffffff8881168252602082018890529181018690529116907fb498002f49085cb108177238b25fbdd698b687feee33f473f774476fe5f812339060600160405180910390a350506001600c555050565b600e602052816000526040600020818154811061286757600080fd5b60007fffffffff0000000000000000000000000000000000000000000000000000000082167f4e2312e00000000000000000000000000000000000000000000000000000000014806109b657506109b682613ffa565b600081815260046020526040902080547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff841690811790915581906133ec8261207b565b73ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b60008181526002602052604081205473ffffffffffffffffffffffffffffffffffffffff166134e3576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602c60248201527f4552433732313a206f70657261746f7220717565727920666f72206e6f6e657860448201527f697374656e7420746f6b656e00000000000000000000000000000000000000006064820152608401610afb565b60006134ee8361207b565b90508073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff16148061355d57508373ffffffffffffffffffffffffffffffffffffffff1661354584610a4e565b73ffffffffffffffffffffffffffffffffffffffff16145b80610cdc575073ffffffffffffffffffffffffffffffffffffffff80821660009081526005602090815260408083209388168352929052205460ff16610cdc565b60405173ffffffffffffffffffffffffffffffffffffffff808516602483015283166044820152606481018290526124cd9085907f23b872dd00000000000000000000000000000000000000000000000000000000906084015b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181529190526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fffffffff0000000000000000000000000000000000000000000000000000000090931692909217909152614050565b8273ffffffffffffffffffffffffffffffffffffffff1661369a8261207b565b73ffffffffffffffffffffffffffffffffffffffff161461373d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602960248201527f4552433732313a207472616e73666572206f6620746f6b656e2074686174206960448201527f73206e6f74206f776e00000000000000000000000000000000000000000000006064820152608401610afb565b73ffffffffffffffffffffffffffffffffffffffff82166137df576040517f08c379a0000000000000000000000000000000000000000000000000000000008152602060048201526024808201527f4552433732313a207472616e7366657220746f20746865207a65726f2061646460448201527f72657373000000000000000000000000000000000000000000000000000000006064820152608401610afb565b6137ea83838361415c565b6137f5600082613392565b73ffffffffffffffffffffffffffffffffffffffff8316600090815260036020526040812080546001929061382b90849061539b565b909155505073ffffffffffffffffffffffffffffffffffffffff8216600090815260036020526040812080546001929061386690849061536f565b909155505060008181526002602052604080822080547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff86811691821790925591518493918716917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef91a4505050565b60405173ffffffffffffffffffffffffffffffffffffffff8316602482015260448101829052610cb59084907fa9059cbb00000000000000000000000000000000000000000000000000000000906064016135f8565b60007f000000000000000000000000000000000000000000000000000000000000000146141561399157507f1bf358733b36d5b888f6ee529f41f65b45ca75068625f8e10377d1a42f3a620e90565b50604080517f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f6020808301919091527f23fa28c7fbd07a9371f5dc8d0e0a6b90ec7b7bf4f8afd8b42ddf6ad751832444828401527fc89efdaa54c0f20c7adf612882df0950f5a951637e0307cdcb4c672f298b8bc660608301524660808301523060a0808401919091528351808403909101815260c0909201909252805191012090565b6000613a408261207b565b9050613a4e8160008461415c565b613a59600083613392565b73ffffffffffffffffffffffffffffffffffffffff81166000908152600360205260408120805460019290613a8f90849061539b565b909155505060008281526002602052604080822080547fffffffffffffffffffffffff00000000000000000000000000000000000000001690555183919073ffffffffffffffffffffffffffffffffffffffff8416907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908390a45050565b73ffffffffffffffffffffffffffffffffffffffff8216613b8b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4552433732313a206d696e7420746f20746865207a65726f20616464726573736044820152606401610afb565b60008181526002602052604090205473ffffffffffffffffffffffffffffffffffffffff1615613c17576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601c60248201527f4552433732313a20746f6b656e20616c7265616479206d696e746564000000006044820152606401610afb565b613c236000838361415c565b73ffffffffffffffffffffffffffffffffffffffff82166000908152600360205260408120805460019290613c5990849061536f565b909155505060008181526002602052604080822080547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff861690811790915590518392907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a45050565b60006125e9828461536f565b600b805473ffffffffffffffffffffffffffffffffffffffff8381167fffffffffffffffffffffffff0000000000000000000000000000000000000000831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b613d6a84848461367a565b613d7684848484614167565b6124cd576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603260248201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560448201527f63656976657220696d706c656d656e74657200000000000000000000000000006064820152608401610afb565b606081613e4257505060408051808201909152600181527f3000000000000000000000000000000000000000000000000000000000000000602082015290565b8160005b8115613e6c5780613e568161542c565b9150613e659050600a83615387565b9150613e46565b60008167ffffffffffffffff811115613e8757613e87615564565b6040519080825280601f01601f191660200182016040528015613eb1576020820181803683370190505b5090505b8415610cdc57613ec660018361539b565b9150613ed3600a86615465565b613ede90603061536f565b60f81b818381518110613ef357613ef3615535565b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a905350613f2d600a86615387565b9450613eb5565b73ffffffffffffffffffffffffffffffffffffffff81166000908152600a602052604090208054600181018255905b50919050565b60006109b6613f76613942565b836040517f19010000000000000000000000000000000000000000000000000000000000006020820152602281018390526042810182905260009060620160405160208183030381529060405280519060200120905092915050565b6000806000613fe387878787614363565b91509150613ff08161447b565b5095945050505050565b60007fffffffff0000000000000000000000000000000000000000000000000000000082167f780e9d630000000000000000000000000000000000000000000000000000000014806109b657506109b6826146d4565b60006140b2826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c65648152508573ffffffffffffffffffffffffffffffffffffffff166147b79092919063ffffffff16565b805190915015610cb557808060200190518101906140d0919061519d565b610cb5576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e60448201527f6f742073756363656564000000000000000000000000000000000000000000006064820152608401610afb565b610cb58383836147c6565b600073ffffffffffffffffffffffffffffffffffffffff84163b1561435b576040517f150b7a0200000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff85169063150b7a02906141de9033908990889088906004016152c4565b602060405180830381600087803b1580156141f857600080fd5b505af1925050508015614246575060408051601f3d9081017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0168201909252614243918101906151d7565b60015b614310573d808015614274576040519150601f19603f3d011682016040523d82523d6000602084013e614279565b606091505b508051614308576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603260248201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560448201527f63656976657220696d706c656d656e74657200000000000000000000000000006064820152608401610afb565b805181602001fd5b7fffffffff00000000000000000000000000000000000000000000000000000000167f150b7a0200000000000000000000000000000000000000000000000000000000149050610cdc565b506001610cdc565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a083111561439a5750600090506003614472565b8460ff16601b141580156143b257508460ff16601c14155b156143c35750600090506004614472565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa158015614417573d6000803e3d6000fd5b50506040517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0015191505073ffffffffffffffffffffffffffffffffffffffff811661446b57600060019250925050614472565b9150600090505b94509492505050565b600081600481111561448f5761448f6154d7565b14156144985750565b60018160048111156144ac576144ac6154d7565b1415614514576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601860248201527f45434453413a20696e76616c6964207369676e617475726500000000000000006044820152606401610afb565b6002816004811115614528576145286154d7565b1415614590576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e677468006044820152606401610afb565b60038160048111156145a4576145a46154d7565b1415614632576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c60448201527f75650000000000000000000000000000000000000000000000000000000000006064820152608401610afb565b6004816004811115614646576146466154d7565b141561192f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202776272076616c60448201527f75650000000000000000000000000000000000000000000000000000000000006064820152608401610afb565b60007fffffffff0000000000000000000000000000000000000000000000000000000082167f80ac58cd00000000000000000000000000000000000000000000000000000000148061476757507fffffffff0000000000000000000000000000000000000000000000000000000082167f5b5e139f00000000000000000000000000000000000000000000000000000000145b806109b657507f01ffc9a7000000000000000000000000000000000000000000000000000000007fffffffff000000000000000000000000000000000000000000000000000000008316146109b6565b6060610cdc84846000856148cc565b73ffffffffffffffffffffffffffffffffffffffff831661482e5761482981600880546000838152600960205260408120829055600182018355919091527ff3f7a9fe364faab93b216da50a3214154f22a0a2b415b23a84c8169e8b636ee30155565b61486b565b8173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161461486b5761486b8382614a4c565b73ffffffffffffffffffffffffffffffffffffffff821661488f57610cb581614b03565b8273ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614610cb557610cb58282614bb2565b60608247101561495e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f60448201527f722063616c6c00000000000000000000000000000000000000000000000000006064820152608401610afb565b843b6149c6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610afb565b6000808673ffffffffffffffffffffffffffffffffffffffff1685876040516149ef9190615279565b60006040518083038185875af1925050503d8060008114614a2c576040519150601f19603f3d011682016040523d82523d6000602084013e614a31565b606091505b5091509150614a41828286614c03565b979650505050505050565b60006001614a5984612186565b614a63919061539b565b600083815260076020526040902054909150808214614ac35773ffffffffffffffffffffffffffffffffffffffff841660009081526006602090815260408083208584528252808320548484528184208190558352600790915290208190555b50600091825260076020908152604080842084905573ffffffffffffffffffffffffffffffffffffffff9094168352600681528383209183525290812055565b600854600090614b159060019061539b565b60008381526009602052604081205460088054939450909284908110614b3d57614b3d615535565b906000526020600020015490508060088381548110614b5e57614b5e615535565b6000918252602080832090910192909255828152600990915260408082208490558582528120556008805480614b9657614b96615506565b6001900381819060005260206000200160009055905550505050565b6000614bbd83612186565b73ffffffffffffffffffffffffffffffffffffffff9093166000908152600660209081526040808320868452825280832085905593825260079052919091209190915550565b60608315614c125750816125e9565b825115614c225782518084602001fd5b816040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610afb919061530d565b508054600082556002029060005260206000209081019061192f9190614c98565b508054600082556003029060005260206000209081019061192f9190614cda565b5b80821115614cd65780547fffffffffffffffffffffffff000000000000000000000000000000000000000016815560006001820155600201614c99565b5090565b5b80821115614cd65780547fffffffffffffffffffffffff00000000000000000000000000000000000000001681556000600182018190556002820155600301614cdb565b803573ffffffffffffffffffffffffffffffffffffffff81168114614d4357600080fd5b919050565b600082601f830112614d5957600080fd5b8135602067ffffffffffffffff821115614d7557614d75615564565b8160051b614d84828201615320565b838152828101908684018388018501891015614d9f57600080fd5b600093505b85841015614dc2578035835260019390930192918401918401614da4565b50979650505050505050565b600082601f830112614ddf57600080fd5b813567ffffffffffffffff811115614df957614df9615564565b614e2a60207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f84011601615320565b818152846020838601011115614e3f57600080fd5b816020850160208301376000918101602001919091529392505050565b600060208284031215614e6e57600080fd5b6125e982614d1f565b60008060408385031215614e8a57600080fd5b614e9383614d1f565b9150614ea160208401614d1f565b90509250929050565b600080600080600060a08688031215614ec257600080fd5b614ecb86614d1f565b9450614ed960208701614d1f565b9350604086013567ffffffffffffffff80821115614ef657600080fd5b614f0289838a01614d48565b94506060880135915080821115614f1857600080fd5b614f2489838a01614d48565b93506080880135915080821115614f3a57600080fd5b50614f4788828901614dce565b9150509295509295909350565b600080600060608486031215614f6957600080fd5b614f7284614d1f565b9250614f8060208501614d1f565b9150604084013590509250925092565b60008060008060808587031215614fa657600080fd5b614faf85614d1f565b9350614fbd60208601614d1f565b925060408501359150606085013567ffffffffffffffff811115614fe057600080fd5b614fec87828801614dce565b91505092959194509250565b600080600080600060a0868803121561501057600080fd5b61501986614d1f565b945061502760208701614d1f565b93506040860135925060608601359150608086013567ffffffffffffffff81111561505157600080fd5b614f4788828901614dce565b600080600080600080600060e0888a03121561507857600080fd5b61508188614d1f565b965061508f60208901614d1f565b95506040880135945060608801359350608088013560ff811681146150b357600080fd5b9699959850939692959460a0840135945060c09093013592915050565b600080604083850312156150e357600080fd5b6150ec83614d1f565b915060208301356150fc81615593565b809150509250929050565b6000806040838503121561511a57600080fd5b61512383614d1f565b946020939093013593505050565b60008060006060848603121561514657600080fd5b61514f84614d1f565b95602085013595506040909401359392505050565b6000806000806080858703121561517a57600080fd5b61518385614d1f565b966020860135965060408601359560600135945092505050565b6000602082840312156151af57600080fd5b81516125e981615593565b6000602082840312156151cc57600080fd5b81356125e9816155a1565b6000602082840312156151e957600080fd5b81516125e9816155a1565b60006020828403121561520657600080fd5b5035919050565b6000806040838503121561522057600080fd5b50508035926020909101359150565b600081518084526152478160208601602086016153b2565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169290920160200192915050565b6000825161528b8184602087016153b2565b9190910192915050565b600083516152a78184602088016153b2565b8351908301906152bb8183602088016153b2565b01949350505050565b600073ffffffffffffffffffffffffffffffffffffffff808716835280861660208401525083604083015260806060830152615303608083018461522f565b9695505050505050565b6020815260006125e9602083018461522f565b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016810167ffffffffffffffff8111828210171561536757615367615564565b604052919050565b6000821982111561538257615382615479565b500190565b600082615396576153966154a8565b500490565b6000828210156153ad576153ad615479565b500390565b60005b838110156153cd5781810151838201526020016153b5565b838111156124cd5750506000910152565b600181811c908216806153f257607f821691505b60208210811415613f63577f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82141561545e5761545e615479565b5060010190565b600082615474576154746154a8565b500690565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b801515811461192f57600080fd5b7fffffffff000000000000000000000000000000000000000000000000000000008116811461192f57600080fdfea164736f6c6343000805000a
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000a0000000000000000000000000000000000000000000000000000000000000012c000000000000000000000000000000000000000000000000000000000000000c417373657457726170706572000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000024157000000000000000000000000000000000000000000000000000000000000
-----Decoded View---------------
Arg [0] : name (string): AssetWrapper
Arg [1] : symbol (string): AW
Arg [2] : startNum (uint256): 300
-----Encoded View---------------
7 Constructor Arguments found :
Arg [0] : 0000000000000000000000000000000000000000000000000000000000000060
Arg [1] : 00000000000000000000000000000000000000000000000000000000000000a0
Arg [2] : 000000000000000000000000000000000000000000000000000000000000012c
Arg [3] : 000000000000000000000000000000000000000000000000000000000000000c
Arg [4] : 4173736574577261707065720000000000000000000000000000000000000000
Arg [5] : 0000000000000000000000000000000000000000000000000000000000000002
Arg [6] : 4157000000000000000000000000000000000000000000000000000000000000
Loading...
Loading
Loading...
Loading
[ Download: CSV Export ]
[ Download: CSV Export ]
A token is a representation of an on-chain or off-chain asset. The token page shows information such as price, total supply, holders, transfers and social links. Learn more about this page in our Knowledge Base.