Source Code
More Info
Private Name Tags
ContractCreator
TokenTracker
| Transaction Hash |
|
Block
|
From
|
To
|
|||||
|---|---|---|---|---|---|---|---|---|---|
Cross-Chain Transactions
Loading...
Loading
This contract may be a proxy contract. Click on More Options and select Is this a proxy? to confirm and enable the "Read as Proxy" & "Write as Proxy" tabs.
Contract Name:
PackMain
Compiler Version
v0.8.20+commit.a1b79de6
Optimization Enabled:
No with 200 runs
Other Settings:
paris EvmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.20;
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/utils/cryptography/SignatureChecker.sol";
import "@openzeppelin/contracts/utils/cryptography/MessageHashUtils.sol";
import "@openzeppelin/contracts/utils/Address.sol";
import "./interfaces/IERC6551Registry.sol";
import "./interfaces/IERC6551Account.sol";
import "./interfaces/IERC6551Executable.sol";
import "./PackNFT.sol";
import "./ClaimData.sol";
import "./lib/SignatureValidator.sol";
/**
* @title PackMain
* @dev This is the primary contract for the Pack protocol. It handles the creation, management, and execution of packs.
*/
contract PackMain is PackNFT, Ownable {
// ---------- Events ---------------------
/**
* @dev Emitted when a new pack is created
*/
event PackCreated(
uint256 indexed tokenId,
address owner,
address[] modules,
bytes[] moduleData
);
/**
* @dev Emitted when a pack is revoked
*/
event PackRevoked(uint256 indexed tokenId, address owner);
/**
* @dev Emitted when a pack is opened
*/
event PackOpened(uint256 indexed tokenId, address claimer);
// ---------- Errors ---------------------
error InvalidEthValue();
error OnlyOwnerOf(uint256 tokenId);
error TokenNotInExpectedState(uint256 tokenId);
error EtherTransferFailed();
error InvalidRefundValue();
error InvalidAddress();
error InvalidLengthOfData(uint256 modulesLength, uint256 moduleDataLength);
error ModulesNotWhitelisted(address modules);
// ---------- Constants -------------------
uint256 public constant VERSION = 1;
uint256 public constant CALL_OPERATION = 0; // Only call operations are supported for ERC6551
// ---------- ERC6551-related ------------
IERC6551Registry public immutable registry;
address public immutable implementation;
uint256 public immutable registryChainId;
uint256 public immutable salt;
mapping(uint256 => address) public claimPublicKey;
mapping(uint256 => address[]) public packModules;
// Modules whitelist
mapping(address => bool) public modulesWhitelist;
/**
* @dev Initializes the PackMain contract
* @param initialOwner_ The address that will be set as the initial owner of the contract
* @param baseTokenURI_ The base URI that will be used for all token URIs
* @param name_ The name of the NFT token
* @param symbol_ The symbol of the NFT token
* @param registry_ ERC6551 registry contract address
* @param implementation_ ERC6551 implementation contract address
* @param registryChainId_ The chain ID of the network, to prevent cross-chain replay attacks
* @param salt_ A random value used to ensure the uniqueness of the contract's address
* @param modulesWhitelist_ An array of addresses that will be initially whitelisted as valid modules
*/
constructor(
address initialOwner_,
string memory baseTokenURI_,
string memory name_,
string memory symbol_,
address registry_,
address implementation_,
uint256 registryChainId_,
uint256 salt_,
address[] memory modulesWhitelist_
) PackNFT(baseTokenURI_, name_, symbol_) Ownable(initialOwner_) {
// Check that the registry and implementation are not the zero address
if (registry_ == address(0) || implementation_ == address(0)) {
revert InvalidAddress();
}
// Set ERC6551-related params
registry = IERC6551Registry(registry_);
implementation = implementation_;
registryChainId = registryChainId_;
salt = salt_;
// Set the modules whitelist
setModulesWhitelist(modulesWhitelist_, true);
}
/**
* @dev Modifier to check if the sender is the owner of the token
* @param tokenId The ID of the token to check ownership of
*/
modifier onlyOwnerOf(uint256 tokenId) {
if (ownerOf(tokenId) != msg.sender) {
revert OnlyOwnerOf(tokenId);
}
_;
}
/**
* @dev Modifier to check if the token is in the desired state
* @param tokenId The ID of the token to check the state of
* @param desiredState Struct, the desired state of the token
*/
modifier tokenInState(uint256 tokenId, PackState desiredState) {
if (packState[tokenId] != desiredState) {
revert TokenNotInExpectedState(tokenId);
}
_;
}
/**
* @dev Function to pack a new NFT. This function is responsible for creating a new NFT and assigning it to the owner.
* This function also creates a new account for the NFT and transfers some ETH to the new account.
* Finally, it loops through the modules and executes the data.
* @param to_ The address to which the new NFT will be assigned.
* @param claimPublicKey_ The public key that will be associated with the claim of the new NFT.
* @param modules The modules that will be associated with the new NFT. These modules must be whitelisted.
* @param moduleData The data that the modules will use to execute their logic.
* @notice The ETH sent with this function will be transferred to the new account.
* @notice The modules and moduleData arrays must be the same length.
*/
function pack(
address to_,
address claimPublicKey_,
address[] calldata modules,
bytes[] calldata moduleData
) public payable returns (uint256 tokenId, address newAccount) {
// Check that the modules are whitelisted
for (uint256 i = 0; i < modules.length; i++) {
if (!modulesWhitelist[modules[i]]) {
revert ModulesNotWhitelisted(modules[i]);
}
}
// Need to check that the modules and moduleData are the same length
if (modules.length != moduleData.length) {
revert InvalidLengthOfData(modules.length, moduleData.length);
}
// Pack needs ETH to be minted
if (msg.value == 0) {
revert InvalidEthValue();
}
// Mint the Pack
tokenId = _mintPack(to_);
// Set params
claimPublicKey[tokenId] = claimPublicKey_;
packModules[tokenId] = modules;
// Create the account for the NFT
newAccount = registry.createAccount(
implementation,
registryChainId,
address(this),
tokenId,
salt,
"" // initData
);
// Transfer some ETH to newAccount
(bool successE, ) = payable(newAccount).call{value: msg.value}("");
if (!successE) {
revert EtherTransferFailed();
}
// Loop through the modules and execute the data
for (uint256 i = 0; i < modules.length; i++) {
Address.functionDelegateCall(
modules[i],
abi.encodeWithSignature(
"onCreate(uint256,address,bytes)",
tokenId,
newAccount,
moduleData[i]
)
);
}
emit PackCreated(tokenId, to_, modules, moduleData);
}
/**
* @dev This function revokes a pack. It is only callable by the owner of the pack and only if the pack is in the 'Created' state.
* @param tokenId_ The unique identifier of the pack to be revoked.
* @param moduleData The data associated with the pack's modules.
* @notice The moduleData array must be the same length as the modules array.
*/
function revoke(
uint256 tokenId_,
bytes[] calldata moduleData
) public onlyOwnerOf(tokenId_) tokenInState(tokenId_, PackState.Created) {
// Check that the moduleData is the same length as the modules
if (moduleData.length != packModules[tokenId_].length) {
revert InvalidLengthOfData(
packModules[tokenId_].length,
moduleData.length
);
}
_revokePack(tokenId_);
// Send ETH to owner
address payable thisAccount = payable(account(tokenId_));
uint256 value = thisAccount.balance;
_executeTransfer(thisAccount, msg.sender, value);
// Loop through the modules and execute the data
for (uint256 i = 0; i < packModules[tokenId_].length; i++) {
Address.functionDelegateCall(
packModules[tokenId_][i],
abi.encodeWithSignature(
"onRevoke(uint256,address,bytes)",
tokenId_,
thisAccount,
moduleData[i]
)
);
}
emit PackRevoked(tokenId_, msg.sender);
}
/**
* @dev Function to open a pack
* @param data The data associated with the pack to be opened.
* @param moduleData The data associated with the pack's modules.
* @notice The moduleData array must be the same length as the modules array.
* @notice This is normally sent by a relayer, so the relayer will be refunded the refundValue.
*/
function open(
ClaimData memory data,
bytes[] calldata moduleData
) public tokenInState(data.tokenId, PackState.Created) {
// Checks for valid signatures
_validateSignatures(data);
// Check that the refund value is not greater than the maximum refund value
if (data.refundValue > data.maxRefundValue) {
revert InvalidRefundValue();
}
// Set state to Opened
_openPack(data.tokenId);
// Loop through the modules and execute the data
for (uint256 i = 0; i < packModules[data.tokenId].length; i++) {
Address.functionDelegateCall(
packModules[data.tokenId][i],
abi.encodeWithSignature(
"onOpen(uint256,address,address,bytes)",
data.tokenId,
account(data.tokenId),
data.claimer,
moduleData[i]
)
);
}
// Transfer the ETH from the account to the owner and refund the relayer
_transferAndRefund(data);
emit PackOpened(data.tokenId, msg.sender);
}
/**
* @dev Function to set the modules whitelist
* @param modules An array of addresses representing the modules to be whitelisted
* @param value A boolean value indicating whether the modules should be whitelisted (true) or not (false)
* @notice This function can only be called by the owner of the contract
*/
function setModulesWhitelist(
address[] memory modules,
bool value
) public onlyOwner {
for (uint256 i = 0; i < modules.length; i++) {
modulesWhitelist[modules[i]] = value;
}
}
/**
* @dev This function returns the account associated with a specific token.
* @param tokenId The unique identifier of the token whose associated account is to be returned.
* @return Returns the address of the account associated with the given tokenId.
*/
function account(uint256 tokenId) public view returns (address) {
return
registry.account(
implementation,
registryChainId,
address(this),
tokenId,
salt
);
}
/**
* @dev This is an internal function that handles the transfer of ETH from the account to the owner and refunds the relayer.
* @param data This is a memory structure that contains all the necessary data for the transfer and refund operation.
*/
function _transferAndRefund(ClaimData memory data) internal {
// Refund the relayer
address payable thisAccount = payable(account(data.tokenId));
_executeTransfer(thisAccount, msg.sender, data.refundValue);
// Transfer the rest to the claimer
uint256 value = thisAccount.balance;
_executeTransfer(thisAccount, data.claimer, value);
}
/**
* @dev This is an internal function that is used to execute a transfer operation.
* @param accountAddress The address of the account from which the transfer will be made.
* @param recipient The address of the recipient who will receive the transfer.
* @param value The amount of ETH that will be transferred.
*/
function _executeTransfer(
address payable accountAddress,
address recipient,
uint256 value
) internal {
bytes memory data = abi.encodeWithSignature(
"transfer(address,uint256)",
recipient,
value
);
IERC6551Executable(accountAddress).execute(
recipient,
value,
data,
CALL_OPERATION
);
}
/**
* @dev This is an internal function that validates the signatures associated with a claim.
* It uses the SignatureValidator to check the signatures against the claim data, registry chain ID, salt, contract address, and public key associated with the token ID.
* @param data The claim data to validate.
*/
function _validateSignatures(ClaimData memory data) internal view {
SignatureValidator.validateSignatures(
data,
registryChainId,
salt,
address(this),
claimPublicKey[data.tokenId]
);
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (access/Ownable.sol)
pragma solidity ^0.8.20;
import {Context} from "../utils/Context.sol";
/**
* @dev Contract module which provides a basic access control mechanism, where
* there is an account (an owner) that can be granted exclusive access to
* specific functions.
*
* The initial owner is set to the address provided by the deployer. This can
* later be changed with {transferOwnership}.
*
* This module is used through inheritance. It will make available the modifier
* `onlyOwner`, which can be applied to your functions to restrict their use to
* the owner.
*/
abstract contract Ownable is Context {
address private _owner;
/**
* @dev The caller account is not authorized to perform an operation.
*/
error OwnableUnauthorizedAccount(address account);
/**
* @dev The owner is not a valid owner account. (eg. `address(0)`)
*/
error OwnableInvalidOwner(address owner);
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev Initializes the contract setting the address provided by the deployer as the initial owner.
*/
constructor(address initialOwner) {
if (initialOwner == address(0)) {
revert OwnableInvalidOwner(address(0));
}
_transferOwnership(initialOwner);
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
_checkOwner();
_;
}
/**
* @dev Returns the address of the current owner.
*/
function owner() public view virtual returns (address) {
return _owner;
}
/**
* @dev Throws if the sender is not the owner.
*/
function _checkOwner() internal view virtual {
if (owner() != _msgSender()) {
revert OwnableUnauthorizedAccount(_msgSender());
}
}
/**
* @dev Leaves the contract without owner. It will not be possible to call
* `onlyOwner` functions. Can only be called by the current owner.
*
* NOTE: Renouncing ownership will leave the contract without an owner,
* thereby disabling any functionality that is only available to the owner.
*/
function renounceOwnership() public virtual onlyOwner {
_transferOwnership(address(0));
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Can only be called by the current owner.
*/
function transferOwnership(address newOwner) public virtual onlyOwner {
if (newOwner == address(0)) {
revert OwnableInvalidOwner(address(0));
}
_transferOwnership(newOwner);
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Internal function without access restriction.
*/
function _transferOwnership(address newOwner) internal virtual {
address oldOwner = _owner;
_owner = newOwner;
emit OwnershipTransferred(oldOwner, newOwner);
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (interfaces/draft-IERC6093.sol)
pragma solidity ^0.8.20;
/**
* @dev Standard ERC20 Errors
* Interface of the https://eips.ethereum.org/EIPS/eip-6093[ERC-6093] custom errors for ERC20 tokens.
*/
interface IERC20Errors {
/**
* @dev Indicates an error related to the current `balance` of a `sender`. Used in transfers.
* @param sender Address whose tokens are being transferred.
* @param balance Current balance for the interacting account.
* @param needed Minimum amount required to perform a transfer.
*/
error ERC20InsufficientBalance(address sender, uint256 balance, uint256 needed);
/**
* @dev Indicates a failure with the token `sender`. Used in transfers.
* @param sender Address whose tokens are being transferred.
*/
error ERC20InvalidSender(address sender);
/**
* @dev Indicates a failure with the token `receiver`. Used in transfers.
* @param receiver Address to which tokens are being transferred.
*/
error ERC20InvalidReceiver(address receiver);
/**
* @dev Indicates a failure with the `spender`’s `allowance`. Used in transfers.
* @param spender Address that may be allowed to operate on tokens without being their owner.
* @param allowance Amount of tokens a `spender` is allowed to operate with.
* @param needed Minimum amount required to perform a transfer.
*/
error ERC20InsufficientAllowance(address spender, uint256 allowance, uint256 needed);
/**
* @dev Indicates a failure with the `approver` of a token to be approved. Used in approvals.
* @param approver Address initiating an approval operation.
*/
error ERC20InvalidApprover(address approver);
/**
* @dev Indicates a failure with the `spender` to be approved. Used in approvals.
* @param spender Address that may be allowed to operate on tokens without being their owner.
*/
error ERC20InvalidSpender(address spender);
}
/**
* @dev Standard ERC721 Errors
* Interface of the https://eips.ethereum.org/EIPS/eip-6093[ERC-6093] custom errors for ERC721 tokens.
*/
interface IERC721Errors {
/**
* @dev Indicates that an address can't be an owner. For example, `address(0)` is a forbidden owner in EIP-20.
* Used in balance queries.
* @param owner Address of the current owner of a token.
*/
error ERC721InvalidOwner(address owner);
/**
* @dev Indicates a `tokenId` whose `owner` is the zero address.
* @param tokenId Identifier number of a token.
*/
error ERC721NonexistentToken(uint256 tokenId);
/**
* @dev Indicates an error related to the ownership over a particular token. Used in transfers.
* @param sender Address whose tokens are being transferred.
* @param tokenId Identifier number of a token.
* @param owner Address of the current owner of a token.
*/
error ERC721IncorrectOwner(address sender, uint256 tokenId, address owner);
/**
* @dev Indicates a failure with the token `sender`. Used in transfers.
* @param sender Address whose tokens are being transferred.
*/
error ERC721InvalidSender(address sender);
/**
* @dev Indicates a failure with the token `receiver`. Used in transfers.
* @param receiver Address to which tokens are being transferred.
*/
error ERC721InvalidReceiver(address receiver);
/**
* @dev Indicates a failure with the `operator`’s approval. Used in transfers.
* @param operator Address that may be allowed to operate on tokens without being their owner.
* @param tokenId Identifier number of a token.
*/
error ERC721InsufficientApproval(address operator, uint256 tokenId);
/**
* @dev Indicates a failure with the `approver` of a token to be approved. Used in approvals.
* @param approver Address initiating an approval operation.
*/
error ERC721InvalidApprover(address approver);
/**
* @dev Indicates a failure with the `operator` to be approved. Used in approvals.
* @param operator Address that may be allowed to operate on tokens without being their owner.
*/
error ERC721InvalidOperator(address operator);
}
/**
* @dev Standard ERC1155 Errors
* Interface of the https://eips.ethereum.org/EIPS/eip-6093[ERC-6093] custom errors for ERC1155 tokens.
*/
interface IERC1155Errors {
/**
* @dev Indicates an error related to the current `balance` of a `sender`. Used in transfers.
* @param sender Address whose tokens are being transferred.
* @param balance Current balance for the interacting account.
* @param needed Minimum amount required to perform a transfer.
* @param tokenId Identifier number of a token.
*/
error ERC1155InsufficientBalance(address sender, uint256 balance, uint256 needed, uint256 tokenId);
/**
* @dev Indicates a failure with the token `sender`. Used in transfers.
* @param sender Address whose tokens are being transferred.
*/
error ERC1155InvalidSender(address sender);
/**
* @dev Indicates a failure with the token `receiver`. Used in transfers.
* @param receiver Address to which tokens are being transferred.
*/
error ERC1155InvalidReceiver(address receiver);
/**
* @dev Indicates a failure with the `operator`’s approval. Used in transfers.
* @param operator Address that may be allowed to operate on tokens without being their owner.
* @param owner Address of the current owner of a token.
*/
error ERC1155MissingApprovalForAll(address operator, address owner);
/**
* @dev Indicates a failure with the `approver` of a token to be approved. Used in approvals.
* @param approver Address initiating an approval operation.
*/
error ERC1155InvalidApprover(address approver);
/**
* @dev Indicates a failure with the `operator` to be approved. Used in approvals.
* @param operator Address that may be allowed to operate on tokens without being their owner.
*/
error ERC1155InvalidOperator(address operator);
/**
* @dev Indicates an array length mismatch between ids and values in a safeBatchTransferFrom operation.
* Used in batch transfers.
* @param idsLength Length of the array of token identifiers
* @param valuesLength Length of the array of token amounts
*/
error ERC1155InvalidArrayLength(uint256 idsLength, uint256 valuesLength);
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (interfaces/IERC1271.sol)
pragma solidity ^0.8.20;
/**
* @dev Interface of the ERC1271 standard signature validation method for
* contracts as defined in https://eips.ethereum.org/EIPS/eip-1271[ERC-1271].
*/
interface IERC1271 {
/**
* @dev Should return whether the signature provided is valid for the provided data
* @param hash Hash of the data to be signed
* @param signature Signature byte array associated with _data
*/
function isValidSignature(bytes32 hash, bytes memory signature) external view returns (bytes4 magicValue);
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC721/ERC721.sol)
pragma solidity ^0.8.20;
import {IERC721} from "./IERC721.sol";
import {IERC721Receiver} from "./IERC721Receiver.sol";
import {IERC721Metadata} from "./extensions/IERC721Metadata.sol";
import {Context} from "../../utils/Context.sol";
import {Strings} from "../../utils/Strings.sol";
import {IERC165, ERC165} from "../../utils/introspection/ERC165.sol";
import {IERC721Errors} from "../../interfaces/draft-IERC6093.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}.
*/
abstract contract ERC721 is Context, ERC165, IERC721, IERC721Metadata, IERC721Errors {
using Strings for uint256;
// Token name
string private _name;
// Token symbol
string private _symbol;
mapping(uint256 tokenId => address) private _owners;
mapping(address owner => uint256) private _balances;
mapping(uint256 tokenId => address) private _tokenApprovals;
mapping(address owner => mapping(address operator => 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 returns (uint256) {
if (owner == address(0)) {
revert ERC721InvalidOwner(address(0));
}
return _balances[owner];
}
/**
* @dev See {IERC721-ownerOf}.
*/
function ownerOf(uint256 tokenId) public view virtual returns (address) {
return _requireOwned(tokenId);
}
/**
* @dev See {IERC721Metadata-name}.
*/
function name() public view virtual returns (string memory) {
return _name;
}
/**
* @dev See {IERC721Metadata-symbol}.
*/
function symbol() public view virtual returns (string memory) {
return _symbol;
}
/**
* @dev See {IERC721Metadata-tokenURI}.
*/
function tokenURI(uint256 tokenId) public view virtual returns (string memory) {
_requireOwned(tokenId);
string memory baseURI = _baseURI();
return bytes(baseURI).length > 0 ? string.concat(baseURI, tokenId.toString()) : "";
}
/**
* @dev Base URI for computing {tokenURI}. If set, the resulting URI for each
* token will be the concatenation of the `baseURI` and the `tokenId`. Empty
* by default, can be overridden in child contracts.
*/
function _baseURI() internal view virtual returns (string memory) {
return "";
}
/**
* @dev See {IERC721-approve}.
*/
function approve(address to, uint256 tokenId) public virtual {
_approve(to, tokenId, _msgSender());
}
/**
* @dev See {IERC721-getApproved}.
*/
function getApproved(uint256 tokenId) public view virtual returns (address) {
_requireOwned(tokenId);
return _getApproved(tokenId);
}
/**
* @dev See {IERC721-setApprovalForAll}.
*/
function setApprovalForAll(address operator, bool approved) public virtual {
_setApprovalForAll(_msgSender(), operator, approved);
}
/**
* @dev See {IERC721-isApprovedForAll}.
*/
function isApprovedForAll(address owner, address operator) public view virtual returns (bool) {
return _operatorApprovals[owner][operator];
}
/**
* @dev See {IERC721-transferFrom}.
*/
function transferFrom(address from, address to, uint256 tokenId) public virtual {
if (to == address(0)) {
revert ERC721InvalidReceiver(address(0));
}
// Setting an "auth" arguments enables the `_isAuthorized` check which verifies that the token exists
// (from != 0). Therefore, it is not needed to verify that the return value is not 0 here.
address previousOwner = _update(to, tokenId, _msgSender());
if (previousOwner != from) {
revert ERC721IncorrectOwner(from, tokenId, previousOwner);
}
}
/**
* @dev See {IERC721-safeTransferFrom}.
*/
function safeTransferFrom(address from, address to, uint256 tokenId) public {
safeTransferFrom(from, to, tokenId, "");
}
/**
* @dev See {IERC721-safeTransferFrom}.
*/
function safeTransferFrom(address from, address to, uint256 tokenId, bytes memory data) public virtual {
transferFrom(from, to, tokenId);
_checkOnERC721Received(from, to, tokenId, data);
}
/**
* @dev Returns the owner of the `tokenId`. Does NOT revert if token doesn't exist
*
* IMPORTANT: Any overrides to this function that add ownership of tokens not tracked by the
* core ERC721 logic MUST be matched with the use of {_increaseBalance} to keep balances
* consistent with ownership. The invariant to preserve is that for any address `a` the value returned by
* `balanceOf(a)` must be equal to the number of tokens such that `_ownerOf(tokenId)` is `a`.
*/
function _ownerOf(uint256 tokenId) internal view virtual returns (address) {
return _owners[tokenId];
}
/**
* @dev Returns the approved address for `tokenId`. Returns 0 if `tokenId` is not minted.
*/
function _getApproved(uint256 tokenId) internal view virtual returns (address) {
return _tokenApprovals[tokenId];
}
/**
* @dev Returns whether `spender` is allowed to manage `owner`'s tokens, or `tokenId` in
* particular (ignoring whether it is owned by `owner`).
*
* WARNING: This function assumes that `owner` is the actual owner of `tokenId` and does not verify this
* assumption.
*/
function _isAuthorized(address owner, address spender, uint256 tokenId) internal view virtual returns (bool) {
return
spender != address(0) &&
(owner == spender || isApprovedForAll(owner, spender) || _getApproved(tokenId) == spender);
}
/**
* @dev Checks if `spender` can operate on `tokenId`, assuming the provided `owner` is the actual owner.
* Reverts if `spender` does not have approval from the provided `owner` for the given token or for all its assets
* the `spender` for the specific `tokenId`.
*
* WARNING: This function assumes that `owner` is the actual owner of `tokenId` and does not verify this
* assumption.
*/
function _checkAuthorized(address owner, address spender, uint256 tokenId) internal view virtual {
if (!_isAuthorized(owner, spender, tokenId)) {
if (owner == address(0)) {
revert ERC721NonexistentToken(tokenId);
} else {
revert ERC721InsufficientApproval(spender, tokenId);
}
}
}
/**
* @dev Unsafe write access to the balances, used by extensions that "mint" tokens using an {ownerOf} override.
*
* NOTE: the value is limited to type(uint128).max. This protect against _balance overflow. It is unrealistic that
* a uint256 would ever overflow from increments when these increments are bounded to uint128 values.
*
* WARNING: Increasing an account's balance using this function tends to be paired with an override of the
* {_ownerOf} function to resolve the ownership of the corresponding tokens so that balances and ownership
* remain consistent with one another.
*/
function _increaseBalance(address account, uint128 value) internal virtual {
unchecked {
_balances[account] += value;
}
}
/**
* @dev Transfers `tokenId` from its current owner to `to`, or alternatively mints (or burns) if the current owner
* (or `to`) is the zero address. Returns the owner of the `tokenId` before the update.
*
* The `auth` argument is optional. If the value passed is non 0, then this function will check that
* `auth` is either the owner of the token, or approved to operate on the token (by the owner).
*
* Emits a {Transfer} event.
*
* NOTE: If overriding this function in a way that tracks balances, see also {_increaseBalance}.
*/
function _update(address to, uint256 tokenId, address auth) internal virtual returns (address) {
address from = _ownerOf(tokenId);
// Perform (optional) operator check
if (auth != address(0)) {
_checkAuthorized(from, auth, tokenId);
}
// Execute the update
if (from != address(0)) {
// Clear approval. No need to re-authorize or emit the Approval event
_approve(address(0), tokenId, address(0), false);
unchecked {
_balances[from] -= 1;
}
}
if (to != address(0)) {
unchecked {
_balances[to] += 1;
}
}
_owners[tokenId] = to;
emit Transfer(from, to, tokenId);
return from;
}
/**
* @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 {
if (to == address(0)) {
revert ERC721InvalidReceiver(address(0));
}
address previousOwner = _update(to, tokenId, address(0));
if (previousOwner != address(0)) {
revert ERC721InvalidSender(address(0));
}
}
/**
* @dev Mints `tokenId`, transfers it to `to` and checks for `to` acceptance.
*
* 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 {
_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);
_checkOnERC721Received(address(0), to, tokenId, data);
}
/**
* @dev Destroys `tokenId`.
* The approval is cleared when the token is burned.
* This is an internal function that does not check if the sender is authorized to operate on the token.
*
* Requirements:
*
* - `tokenId` must exist.
*
* Emits a {Transfer} event.
*/
function _burn(uint256 tokenId) internal {
address previousOwner = _update(address(0), tokenId, address(0));
if (previousOwner == address(0)) {
revert ERC721NonexistentToken(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 {
if (to == address(0)) {
revert ERC721InvalidReceiver(address(0));
}
address previousOwner = _update(to, tokenId, address(0));
if (previousOwner == address(0)) {
revert ERC721NonexistentToken(tokenId);
} else if (previousOwner != from) {
revert ERC721IncorrectOwner(from, tokenId, previousOwner);
}
}
/**
* @dev Safely transfers `tokenId` token from `from` to `to`, checking that contract recipients
* are aware of the ERC721 standard 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 like {safeTransferFrom} in the sense that it invokes
* {IERC721Receiver-onERC721Received} on the receiver, and can be used to e.g.
* implement alternative mechanisms to perform token transfer, such as signature-based.
*
* Requirements:
*
* - `tokenId` token must exist and be owned by `from`.
* - `to` cannot be the zero address.
* - `from` cannot be the zero address.
* - 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) internal {
_safeTransfer(from, to, tokenId, "");
}
/**
* @dev Same as {xref-ERC721-_safeTransfer-address-address-uint256-}[`_safeTransfer`], with an additional `data` parameter which is
* forwarded in {IERC721Receiver-onERC721Received} to contract recipients.
*/
function _safeTransfer(address from, address to, uint256 tokenId, bytes memory data) internal virtual {
_transfer(from, to, tokenId);
_checkOnERC721Received(from, to, tokenId, data);
}
/**
* @dev Approve `to` to operate on `tokenId`
*
* The `auth` argument is optional. If the value passed is non 0, then this function will check that `auth` is
* either the owner of the token, or approved to operate on all tokens held by this owner.
*
* Emits an {Approval} event.
*
* Overrides to this logic should be done to the variant with an additional `bool emitEvent` argument.
*/
function _approve(address to, uint256 tokenId, address auth) internal {
_approve(to, tokenId, auth, true);
}
/**
* @dev Variant of `_approve` with an optional flag to enable or disable the {Approval} event. The event is not
* emitted in the context of transfers.
*/
function _approve(address to, uint256 tokenId, address auth, bool emitEvent) internal virtual {
// Avoid reading the owner unless necessary
if (emitEvent || auth != address(0)) {
address owner = _requireOwned(tokenId);
// We do not use _isAuthorized because single-token approvals should not be able to call approve
if (auth != address(0) && owner != auth && !isApprovedForAll(owner, auth)) {
revert ERC721InvalidApprover(auth);
}
if (emitEvent) {
emit Approval(owner, to, tokenId);
}
}
_tokenApprovals[tokenId] = to;
}
/**
* @dev Approve `operator` to operate on all of `owner` tokens
*
* Requirements:
* - operator can't be the address zero.
*
* Emits an {ApprovalForAll} event.
*/
function _setApprovalForAll(address owner, address operator, bool approved) internal virtual {
if (operator == address(0)) {
revert ERC721InvalidOperator(operator);
}
_operatorApprovals[owner][operator] = approved;
emit ApprovalForAll(owner, operator, approved);
}
/**
* @dev Reverts if the `tokenId` doesn't have a current owner (it hasn't been minted, or it has been burned).
* Returns the owner.
*
* Overrides to ownership logic should be done to {_ownerOf}.
*/
function _requireOwned(uint256 tokenId) internal view returns (address) {
address owner = _ownerOf(tokenId);
if (owner == address(0)) {
revert ERC721NonexistentToken(tokenId);
}
return owner;
}
/**
* @dev Private function to invoke {IERC721Receiver-onERC721Received} on a target address. This will revert if the
* recipient doesn't accept the token transfer. 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
*/
function _checkOnERC721Received(address from, address to, uint256 tokenId, bytes memory data) private {
if (to.code.length > 0) {
try IERC721Receiver(to).onERC721Received(_msgSender(), from, tokenId, data) returns (bytes4 retval) {
if (retval != IERC721Receiver.onERC721Received.selector) {
revert ERC721InvalidReceiver(to);
}
} catch (bytes memory reason) {
if (reason.length == 0) {
revert ERC721InvalidReceiver(to);
} else {
/// @solidity memory-safe-assembly
assembly {
revert(add(32, reason), mload(reason))
}
}
}
}
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC721/extensions/ERC721Enumerable.sol)
pragma solidity ^0.8.20;
import {ERC721} from "../ERC721.sol";
import {IERC721Enumerable} from "./IERC721Enumerable.sol";
import {IERC165} from "../../../utils/introspection/ERC165.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.
*
* CAUTION: `ERC721` extensions that implement custom `balanceOf` logic, such as `ERC721Consecutive`,
* interfere with enumerability and should not be used together with `ERC721Enumerable`.
*/
abstract contract ERC721Enumerable is ERC721, IERC721Enumerable {
mapping(address owner => mapping(uint256 index => uint256)) private _ownedTokens;
mapping(uint256 tokenId => uint256) private _ownedTokensIndex;
uint256[] private _allTokens;
mapping(uint256 tokenId => uint256) private _allTokensIndex;
/**
* @dev An `owner`'s token query was out of bounds for `index`.
*
* NOTE: The owner being `address(0)` indicates a global out of bounds index.
*/
error ERC721OutOfBoundsIndex(address owner, uint256 index);
/**
* @dev Batch mint is not allowed.
*/
error ERC721EnumerableForbiddenBatchMint();
/**
* @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 returns (uint256) {
if (index >= balanceOf(owner)) {
revert ERC721OutOfBoundsIndex(owner, index);
}
return _ownedTokens[owner][index];
}
/**
* @dev See {IERC721Enumerable-totalSupply}.
*/
function totalSupply() public view virtual returns (uint256) {
return _allTokens.length;
}
/**
* @dev See {IERC721Enumerable-tokenByIndex}.
*/
function tokenByIndex(uint256 index) public view virtual returns (uint256) {
if (index >= totalSupply()) {
revert ERC721OutOfBoundsIndex(address(0), index);
}
return _allTokens[index];
}
/**
* @dev See {ERC721-_update}.
*/
function _update(address to, uint256 tokenId, address auth) internal virtual override returns (address) {
address previousOwner = super._update(to, tokenId, auth);
if (previousOwner == address(0)) {
_addTokenToAllTokensEnumeration(tokenId);
} else if (previousOwner != to) {
_removeTokenFromOwnerEnumeration(previousOwner, tokenId);
}
if (to == address(0)) {
_removeTokenFromAllTokensEnumeration(tokenId);
} else if (previousOwner != to) {
_addTokenToOwnerEnumeration(to, tokenId);
}
return previousOwner;
}
/**
* @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 = balanceOf(to) - 1;
_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 = balanceOf(from);
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();
}
/**
* See {ERC721-_increaseBalance}. We need that to account tokens that were minted in batch
*/
function _increaseBalance(address account, uint128 amount) internal virtual override {
if (amount > 0) {
revert ERC721EnumerableForbiddenBatchMint();
}
super._increaseBalance(account, amount);
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC721/extensions/IERC721Enumerable.sol)
pragma solidity ^0.8.20;
import {IERC721} from "../IERC721.sol";
/**
* @title ERC-721 Non-Fungible Token Standard, optional enumeration extension
* @dev See https://eips.ethereum.org/EIPS/eip-721
*/
interface IERC721Enumerable is IERC721 {
/**
* @dev Returns the total amount of tokens stored by the contract.
*/
function totalSupply() external view returns (uint256);
/**
* @dev Returns a token ID owned by `owner` at a given `index` of its token list.
* Use along with {balanceOf} to enumerate all of ``owner``'s tokens.
*/
function tokenOfOwnerByIndex(address owner, uint256 index) external view returns (uint256);
/**
* @dev Returns a token ID at a given `index` of all the tokens stored by the contract.
* Use along with {totalSupply} to enumerate all tokens.
*/
function tokenByIndex(uint256 index) external view returns (uint256);
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC721/extensions/IERC721Metadata.sol)
pragma solidity ^0.8.20;
import {IERC721} from "../IERC721.sol";
/**
* @title ERC-721 Non-Fungible Token Standard, optional metadata extension
* @dev See https://eips.ethereum.org/EIPS/eip-721
*/
interface IERC721Metadata is IERC721 {
/**
* @dev Returns the token collection name.
*/
function name() external view returns (string memory);
/**
* @dev Returns the token collection symbol.
*/
function symbol() external view returns (string memory);
/**
* @dev Returns the Uniform Resource Identifier (URI) for `tokenId` token.
*/
function tokenURI(uint256 tokenId) external view returns (string memory);
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC721/IERC721.sol)
pragma solidity ^0.8.20;
import {IERC165} from "../../utils/introspection/IERC165.sol";
/**
* @dev Required interface of an ERC721 compliant contract.
*/
interface IERC721 is IERC165 {
/**
* @dev Emitted when `tokenId` token is transferred from `from` to `to`.
*/
event Transfer(address indexed from, address indexed to, uint256 indexed tokenId);
/**
* @dev Emitted when `owner` enables `approved` to manage the `tokenId` token.
*/
event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId);
/**
* @dev Emitted when `owner` enables or disables (`approved`) `operator` to manage all of its assets.
*/
event ApprovalForAll(address indexed owner, address indexed operator, bool approved);
/**
* @dev Returns the number of tokens in ``owner``'s account.
*/
function balanceOf(address owner) external view returns (uint256 balance);
/**
* @dev Returns the owner of the `tokenId` token.
*
* Requirements:
*
* - `tokenId` must exist.
*/
function ownerOf(uint256 tokenId) external view returns (address owner);
/**
* @dev Safely transfers `tokenId` token from `from` to `to`.
*
* Requirements:
*
* - `from` cannot be the zero address.
* - `to` cannot be the zero address.
* - `tokenId` token must exist and be owned by `from`.
* - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.
* - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon
* a safe transfer.
*
* Emits a {Transfer} event.
*/
function safeTransferFrom(address from, address to, uint256 tokenId, bytes calldata data) external;
/**
* @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients
* are aware of the ERC721 protocol to prevent tokens from being forever locked.
*
* Requirements:
*
* - `from` cannot be the zero address.
* - `to` cannot be the zero address.
* - `tokenId` token must exist and be owned by `from`.
* - If the caller is not `from`, it must have been allowed to move this token by either {approve} or
* {setApprovalForAll}.
* - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon
* a safe transfer.
*
* Emits a {Transfer} event.
*/
function safeTransferFrom(address from, address to, uint256 tokenId) external;
/**
* @dev Transfers `tokenId` token from `from` to `to`.
*
* WARNING: Note that the caller is responsible to confirm that the recipient is capable of receiving ERC721
* or else they may be permanently lost. Usage of {safeTransferFrom} prevents loss, though the caller must
* understand this adds an external call which potentially creates a reentrancy vulnerability.
*
* Requirements:
*
* - `from` cannot be the zero address.
* - `to` cannot be the zero address.
* - `tokenId` token must be owned by `from`.
* - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.
*
* Emits a {Transfer} event.
*/
function transferFrom(address from, address to, uint256 tokenId) external;
/**
* @dev Gives permission to `to` to transfer `tokenId` token to another account.
* The approval is cleared when the token is transferred.
*
* Only a single account can be approved at a time, so approving the zero address clears previous approvals.
*
* Requirements:
*
* - The caller must own the token or be an approved operator.
* - `tokenId` must exist.
*
* Emits an {Approval} event.
*/
function approve(address to, uint256 tokenId) external;
/**
* @dev Approve or remove `operator` as an operator for the caller.
* Operators can call {transferFrom} or {safeTransferFrom} for any token owned by the caller.
*
* Requirements:
*
* - The `operator` cannot be the address zero.
*
* Emits an {ApprovalForAll} event.
*/
function setApprovalForAll(address operator, bool approved) external;
/**
* @dev Returns the account approved for `tokenId` token.
*
* Requirements:
*
* - `tokenId` must exist.
*/
function getApproved(uint256 tokenId) external view returns (address operator);
/**
* @dev Returns if the `operator` is allowed to manage all of the assets of `owner`.
*
* See {setApprovalForAll}
*/
function isApprovedForAll(address owner, address operator) external view returns (bool);
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC721/IERC721Receiver.sol)
pragma solidity ^0.8.20;
/**
* @title ERC721 token receiver interface
* @dev Interface for any contract that wants to support safeTransfers
* from ERC721 asset contracts.
*/
interface IERC721Receiver {
/**
* @dev Whenever an {IERC721} `tokenId` token is transferred to this contract via {IERC721-safeTransferFrom}
* by `operator` from `from`, this function is called.
*
* It must return its Solidity selector to confirm the token transfer.
* If any other value is returned or the interface is not implemented by the recipient, the transfer will be
* reverted.
*
* The selector can be obtained in Solidity with `IERC721Receiver.onERC721Received.selector`.
*/
function onERC721Received(
address operator,
address from,
uint256 tokenId,
bytes calldata data
) external returns (bytes4);
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (utils/Address.sol)
pragma solidity ^0.8.20;
/**
* @dev Collection of functions related to the address type
*/
library Address {
/**
* @dev The ETH balance of the account is not enough to perform the operation.
*/
error AddressInsufficientBalance(address account);
/**
* @dev There's no code at `target` (it is not a contract).
*/
error AddressEmptyCode(address target);
/**
* @dev A call to an address target failed. The target may have reverted.
*/
error FailedInnerCall();
/**
* @dev Replacement for Solidity's `transfer`: sends `amount` wei to
* `recipient`, forwarding all available gas and reverting on errors.
*
* https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost
* of certain opcodes, possibly making contracts go over the 2300 gas limit
* imposed by `transfer`, making them unable to receive funds via
* `transfer`. {sendValue} removes this limitation.
*
* https://consensys.net/diligence/blog/2019/09/stop-using-soliditys-transfer-now/[Learn more].
*
* IMPORTANT: because control is transferred to `recipient`, care must be
* taken to not create reentrancy vulnerabilities. Consider using
* {ReentrancyGuard} or the
* https://solidity.readthedocs.io/en/v0.8.20/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].
*/
function sendValue(address payable recipient, uint256 amount) internal {
if (address(this).balance < amount) {
revert AddressInsufficientBalance(address(this));
}
(bool success, ) = recipient.call{value: amount}("");
if (!success) {
revert FailedInnerCall();
}
}
/**
* @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 or custom error, it is bubbled
* up by this function (like regular Solidity function calls). However, if
* the call reverted with no returned reason, this function reverts with a
* {FailedInnerCall} error.
*
* 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.
*/
function functionCall(address target, bytes memory data) internal returns (bytes memory) {
return functionCallWithValue(target, data, 0);
}
/**
* @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`.
*/
function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {
if (address(this).balance < value) {
revert AddressInsufficientBalance(address(this));
}
(bool success, bytes memory returndata) = target.call{value: value}(data);
return verifyCallResultFromTarget(target, success, returndata);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but performing a static call.
*/
function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {
(bool success, bytes memory returndata) = target.staticcall(data);
return verifyCallResultFromTarget(target, success, returndata);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but performing a delegate call.
*/
function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {
(bool success, bytes memory returndata) = target.delegatecall(data);
return verifyCallResultFromTarget(target, success, returndata);
}
/**
* @dev Tool to verify that a low level call to smart-contract was successful, and reverts if the target
* was not a contract or bubbling up the revert reason (falling back to {FailedInnerCall}) in case of an
* unsuccessful call.
*/
function verifyCallResultFromTarget(
address target,
bool success,
bytes memory returndata
) internal view returns (bytes memory) {
if (!success) {
_revert(returndata);
} else {
// only check if target is a contract if the call was successful and the return data is empty
// otherwise we already know that it was a contract
if (returndata.length == 0 && target.code.length == 0) {
revert AddressEmptyCode(target);
}
return returndata;
}
}
/**
* @dev Tool to verify that a low level call was successful, and reverts if it wasn't, either by bubbling the
* revert reason or with a default {FailedInnerCall} error.
*/
function verifyCallResult(bool success, bytes memory returndata) internal pure returns (bytes memory) {
if (!success) {
_revert(returndata);
} else {
return returndata;
}
}
/**
* @dev Reverts with returndata if present. Otherwise reverts with {FailedInnerCall}.
*/
function _revert(bytes memory returndata) private pure {
// Look for revert reason and bubble it up if present
if (returndata.length > 0) {
// The easiest way to bubble the revert reason is using memory via assembly
/// @solidity memory-safe-assembly
assembly {
let returndata_size := mload(returndata)
revert(add(32, returndata), returndata_size)
}
} else {
revert FailedInnerCall();
}
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (utils/Context.sol)
pragma solidity ^0.8.20;
/**
* @dev Provides information about the current execution context, including the
* sender of the transaction and its data. While these are generally available
* via msg.sender and msg.data, they should not be accessed in such a direct
* manner, since when dealing with meta-transactions the account sending and
* paying for execution may not be the actual sender (as far as an application
* is concerned).
*
* This contract is only required for intermediate, library-like contracts.
*/
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes calldata) {
return msg.data;
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (utils/cryptography/ECDSA.sol)
pragma solidity ^0.8.20;
/**
* @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
}
/**
* @dev The signature derives the `address(0)`.
*/
error ECDSAInvalidSignature();
/**
* @dev The signature has an invalid length.
*/
error ECDSAInvalidSignatureLength(uint256 length);
/**
* @dev The signature has an S value that is in the upper half order.
*/
error ECDSAInvalidSignatureS(bytes32 s);
/**
* @dev Returns the address that signed a hashed message (`hash`) with `signature` or an error. This will not
* return address(0) without also returning an error description. Errors are documented using an enum (error type)
* and a bytes32 providing additional information about the error.
*
* If no error is returned, then the address can be used for verification purposes.
*
* The `ecrecover` EVM precompile 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 {MessageHashUtils-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]
*/
function tryRecover(bytes32 hash, bytes memory signature) internal pure returns (address, RecoverError, bytes32) {
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.
/// @solidity memory-safe-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 {
return (address(0), RecoverError.InvalidSignatureLength, bytes32(signature.length));
}
}
/**
* @dev Returns the address that signed a hashed message (`hash`) with
* `signature`. This address can then be used for verification purposes.
*
* The `ecrecover` EVM precompile 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 {MessageHashUtils-toEthSignedMessageHash} on it.
*/
function recover(bytes32 hash, bytes memory signature) internal pure returns (address) {
(address recovered, RecoverError error, bytes32 errorArg) = tryRecover(hash, signature);
_throwError(error, errorArg);
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]
*/
function tryRecover(bytes32 hash, bytes32 r, bytes32 vs) internal pure returns (address, RecoverError, bytes32) {
unchecked {
bytes32 s = vs & bytes32(0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff);
// We do not check for an overflow here since the shift operation results in 0 or 1.
uint8 v = uint8((uint256(vs) >> 255) + 27);
return tryRecover(hash, v, r, s);
}
}
/**
* @dev Overload of {ECDSA-recover} that receives the `r and `vs` short-signature fields separately.
*/
function recover(bytes32 hash, bytes32 r, bytes32 vs) internal pure returns (address) {
(address recovered, RecoverError error, bytes32 errorArg) = tryRecover(hash, r, vs);
_throwError(error, errorArg);
return recovered;
}
/**
* @dev Overload of {ECDSA-tryRecover} that receives the `v`,
* `r` and `s` signature fields separately.
*/
function tryRecover(
bytes32 hash,
uint8 v,
bytes32 r,
bytes32 s
) internal pure returns (address, RecoverError, bytes32) {
// 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, s);
}
// 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, bytes32(0));
}
return (signer, RecoverError.NoError, bytes32(0));
}
/**
* @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, bytes32 errorArg) = tryRecover(hash, v, r, s);
_throwError(error, errorArg);
return recovered;
}
/**
* @dev Optionally reverts with the corresponding custom error according to the `error` argument provided.
*/
function _throwError(RecoverError error, bytes32 errorArg) private pure {
if (error == RecoverError.NoError) {
return; // no error: do nothing
} else if (error == RecoverError.InvalidSignature) {
revert ECDSAInvalidSignature();
} else if (error == RecoverError.InvalidSignatureLength) {
revert ECDSAInvalidSignatureLength(uint256(errorArg));
} else if (error == RecoverError.InvalidSignatureS) {
revert ECDSAInvalidSignatureS(errorArg);
}
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (utils/cryptography/MessageHashUtils.sol)
pragma solidity ^0.8.20;
import {Strings} from "../Strings.sol";
/**
* @dev Signature message hash utilities for producing digests to be consumed by {ECDSA} recovery or signing.
*
* The library provides methods for generating a hash of a message that conforms to the
* https://eips.ethereum.org/EIPS/eip-191[EIP 191] and https://eips.ethereum.org/EIPS/eip-712[EIP 712]
* specifications.
*/
library MessageHashUtils {
/**
* @dev Returns the keccak256 digest of an EIP-191 signed data with version
* `0x45` (`personal_sign` messages).
*
* The digest is calculated by prefixing a bytes32 `messageHash` with
* `"\x19Ethereum Signed Message:\n32"` and hashing the result. It corresponds with the
* hash signed when using the https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`] JSON-RPC method.
*
* NOTE: The `messageHash` parameter is intended to be the result of hashing a raw message with
* keccak256, although any bytes32 value can be safely used because the final digest will
* be re-hashed.
*
* See {ECDSA-recover}.
*/
function toEthSignedMessageHash(bytes32 messageHash) internal pure returns (bytes32 digest) {
/// @solidity memory-safe-assembly
assembly {
mstore(0x00, "\x19Ethereum Signed Message:\n32") // 32 is the bytes-length of messageHash
mstore(0x1c, messageHash) // 0x1c (28) is the length of the prefix
digest := keccak256(0x00, 0x3c) // 0x3c is the length of the prefix (0x1c) + messageHash (0x20)
}
}
/**
* @dev Returns the keccak256 digest of an EIP-191 signed data with version
* `0x45` (`personal_sign` messages).
*
* The digest is calculated by prefixing an arbitrary `message` with
* `"\x19Ethereum Signed Message:\n" + len(message)` and hashing the result. It corresponds with the
* hash signed when using the https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`] JSON-RPC method.
*
* See {ECDSA-recover}.
*/
function toEthSignedMessageHash(bytes memory message) internal pure returns (bytes32) {
return
keccak256(bytes.concat("\x19Ethereum Signed Message:\n", bytes(Strings.toString(message.length)), message));
}
/**
* @dev Returns the keccak256 digest of an EIP-191 signed data with version
* `0x00` (data with intended validator).
*
* The digest is calculated by prefixing an arbitrary `data` with `"\x19\x00"` and the intended
* `validator` address. Then hashing the result.
*
* See {ECDSA-recover}.
*/
function toDataWithIntendedValidatorHash(address validator, bytes memory data) internal pure returns (bytes32) {
return keccak256(abi.encodePacked(hex"19_00", validator, data));
}
/**
* @dev Returns the keccak256 digest of an EIP-712 typed data (EIP-191 version `0x01`).
*
* The digest is calculated from a `domainSeparator` and a `structHash`, by prefixing them with
* `\x19\x01` and hashing the result. It corresponds to the hash signed by the
* https://eips.ethereum.org/EIPS/eip-712[`eth_signTypedData`] JSON-RPC method as part of EIP-712.
*
* See {ECDSA-recover}.
*/
function toTypedDataHash(bytes32 domainSeparator, bytes32 structHash) internal pure returns (bytes32 digest) {
/// @solidity memory-safe-assembly
assembly {
let ptr := mload(0x40)
mstore(ptr, hex"19_01")
mstore(add(ptr, 0x02), domainSeparator)
mstore(add(ptr, 0x22), structHash)
digest := keccak256(ptr, 0x42)
}
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (utils/cryptography/SignatureChecker.sol)
pragma solidity ^0.8.20;
import {ECDSA} from "./ECDSA.sol";
import {IERC1271} from "../../interfaces/IERC1271.sol";
/**
* @dev Signature verification helper that can be used instead of `ECDSA.recover` to seamlessly support both ECDSA
* signatures from externally owned accounts (EOAs) as well as ERC1271 signatures from smart contract wallets like
* Argent and Safe Wallet (previously Gnosis Safe).
*/
library SignatureChecker {
/**
* @dev Checks if a signature is valid for a given signer and data hash. If the signer is a smart contract, the
* signature is validated against that smart contract using ERC1271, otherwise it's validated using `ECDSA.recover`.
*
* NOTE: Unlike ECDSA signatures, contract signatures are revocable, and the outcome of this function can thus
* change through time. It could return true at block N and false at block N+1 (or the opposite).
*/
function isValidSignatureNow(address signer, bytes32 hash, bytes memory signature) internal view returns (bool) {
(address recovered, ECDSA.RecoverError error, ) = ECDSA.tryRecover(hash, signature);
return
(error == ECDSA.RecoverError.NoError && recovered == signer) ||
isValidERC1271SignatureNow(signer, hash, signature);
}
/**
* @dev Checks if a signature is valid for a given signer and data hash. The signature is validated
* against the signer smart contract using ERC1271.
*
* NOTE: Unlike ECDSA signatures, contract signatures are revocable, and the outcome of this function can thus
* change through time. It could return true at block N and false at block N+1 (or the opposite).
*/
function isValidERC1271SignatureNow(
address signer,
bytes32 hash,
bytes memory signature
) internal view returns (bool) {
(bool success, bytes memory result) = signer.staticcall(
abi.encodeCall(IERC1271.isValidSignature, (hash, signature))
);
return (success &&
result.length >= 32 &&
abi.decode(result, (bytes32)) == bytes32(IERC1271.isValidSignature.selector));
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (utils/introspection/ERC165.sol)
pragma solidity ^0.8.20;
import {IERC165} from "./IERC165.sol";
/**
* @dev Implementation of the {IERC165} interface.
*
* Contracts that want to implement ERC165 should inherit from this contract and override {supportsInterface} to check
* for the additional interface id that will be supported. For example:
*
* ```solidity
* function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
* return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId);
* }
* ```
*/
abstract contract ERC165 is IERC165 {
/**
* @dev See {IERC165-supportsInterface}.
*/
function supportsInterface(bytes4 interfaceId) public view virtual returns (bool) {
return interfaceId == type(IERC165).interfaceId;
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (utils/introspection/IERC165.sol)
pragma solidity ^0.8.20;
/**
* @dev Interface of the ERC165 standard, as defined in the
* https://eips.ethereum.org/EIPS/eip-165[EIP].
*
* Implementers can declare support of contract interfaces, which can then be
* queried by others ({ERC165Checker}).
*
* For an implementation, see {ERC165}.
*/
interface IERC165 {
/**
* @dev Returns true if this contract implements the interface defined by
* `interfaceId`. See the corresponding
* https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section]
* to learn more about how these ids are created.
*
* This function call must use less than 30 000 gas.
*/
function supportsInterface(bytes4 interfaceId) external view returns (bool);
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (utils/math/Math.sol)
pragma solidity ^0.8.20;
/**
* @dev Standard math utilities missing in the Solidity language.
*/
library Math {
/**
* @dev Muldiv operation overflow.
*/
error MathOverflowedMulDiv();
enum Rounding {
Floor, // Toward negative infinity
Ceil, // Toward positive infinity
Trunc, // Toward zero
Expand // Away from zero
}
/**
* @dev Returns the addition of two unsigned integers, with an overflow flag.
*/
function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) {
unchecked {
uint256 c = a + b;
if (c < a) return (false, 0);
return (true, c);
}
}
/**
* @dev Returns the subtraction of two unsigned integers, with an overflow flag.
*/
function trySub(uint256 a, uint256 b) internal pure returns (bool, uint256) {
unchecked {
if (b > a) return (false, 0);
return (true, a - b);
}
}
/**
* @dev Returns the multiplication of two unsigned integers, with an overflow flag.
*/
function tryMul(uint256 a, uint256 b) internal pure returns (bool, uint256) {
unchecked {
// Gas optimization: this is cheaper than requiring 'a' not being zero, but the
// benefit is lost if 'b' is also tested.
// See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522
if (a == 0) return (true, 0);
uint256 c = a * b;
if (c / a != b) return (false, 0);
return (true, c);
}
}
/**
* @dev Returns the division of two unsigned integers, with a division by zero flag.
*/
function tryDiv(uint256 a, uint256 b) internal pure returns (bool, uint256) {
unchecked {
if (b == 0) return (false, 0);
return (true, a / b);
}
}
/**
* @dev Returns the remainder of dividing two unsigned integers, with a division by zero flag.
*/
function tryMod(uint256 a, uint256 b) internal pure returns (bool, uint256) {
unchecked {
if (b == 0) return (false, 0);
return (true, a % b);
}
}
/**
* @dev Returns the largest of two numbers.
*/
function max(uint256 a, uint256 b) internal pure returns (uint256) {
return a > b ? a : b;
}
/**
* @dev Returns the smallest of two numbers.
*/
function min(uint256 a, uint256 b) internal pure returns (uint256) {
return a < b ? a : b;
}
/**
* @dev Returns the average of two numbers. The result is rounded towards
* zero.
*/
function average(uint256 a, uint256 b) internal pure returns (uint256) {
// (a + b) / 2 can overflow.
return (a & b) + (a ^ b) / 2;
}
/**
* @dev Returns the ceiling of the division of two numbers.
*
* This differs from standard division with `/` in that it rounds towards infinity instead
* of rounding towards zero.
*/
function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) {
if (b == 0) {
// Guarantee the same behavior as in a regular Solidity division.
return a / b;
}
// (a + b - 1) / b can overflow on addition, so we distribute.
return a == 0 ? 0 : (a - 1) / b + 1;
}
/**
* @notice Calculates floor(x * y / denominator) with full precision. Throws if result overflows a uint256 or
* denominator == 0.
* @dev Original credit to Remco Bloemen under MIT license (https://xn--2-umb.com/21/muldiv) with further edits by
* Uniswap Labs also under MIT license.
*/
function mulDiv(uint256 x, uint256 y, uint256 denominator) internal pure returns (uint256 result) {
unchecked {
// 512-bit multiply [prod1 prod0] = x * y. Compute the product mod 2^256 and mod 2^256 - 1, then use
// use the Chinese Remainder Theorem to reconstruct the 512 bit result. The result is stored in two 256
// variables such that product = prod1 * 2^256 + prod0.
uint256 prod0 = x * y; // Least significant 256 bits of the product
uint256 prod1; // Most significant 256 bits of the product
assembly {
let mm := mulmod(x, y, not(0))
prod1 := sub(sub(mm, prod0), lt(mm, prod0))
}
// Handle non-overflow cases, 256 by 256 division.
if (prod1 == 0) {
// Solidity will revert if denominator == 0, unlike the div opcode on its own.
// The surrounding unchecked block does not change this fact.
// See https://docs.soliditylang.org/en/latest/control-structures.html#checked-or-unchecked-arithmetic.
return prod0 / denominator;
}
// Make sure the result is less than 2^256. Also prevents denominator == 0.
if (denominator <= prod1) {
revert MathOverflowedMulDiv();
}
///////////////////////////////////////////////
// 512 by 256 division.
///////////////////////////////////////////////
// Make division exact by subtracting the remainder from [prod1 prod0].
uint256 remainder;
assembly {
// Compute remainder using mulmod.
remainder := mulmod(x, y, denominator)
// Subtract 256 bit number from 512 bit number.
prod1 := sub(prod1, gt(remainder, prod0))
prod0 := sub(prod0, remainder)
}
// Factor powers of two out of denominator and compute largest power of two divisor of denominator.
// Always >= 1. See https://cs.stackexchange.com/q/138556/92363.
uint256 twos = denominator & (0 - denominator);
assembly {
// Divide denominator by twos.
denominator := div(denominator, twos)
// Divide [prod1 prod0] by twos.
prod0 := div(prod0, twos)
// Flip twos such that it is 2^256 / twos. If twos is zero, then it becomes one.
twos := add(div(sub(0, twos), twos), 1)
}
// Shift in bits from prod1 into prod0.
prod0 |= prod1 * twos;
// Invert denominator mod 2^256. Now that denominator is an odd number, it has an inverse modulo 2^256 such
// that denominator * inv = 1 mod 2^256. Compute the inverse by starting with a seed that is correct for
// four bits. That is, denominator * inv = 1 mod 2^4.
uint256 inverse = (3 * denominator) ^ 2;
// Use the Newton-Raphson iteration to improve the precision. Thanks to Hensel's lifting lemma, this also
// works in modular arithmetic, doubling the correct bits in each step.
inverse *= 2 - denominator * inverse; // inverse mod 2^8
inverse *= 2 - denominator * inverse; // inverse mod 2^16
inverse *= 2 - denominator * inverse; // inverse mod 2^32
inverse *= 2 - denominator * inverse; // inverse mod 2^64
inverse *= 2 - denominator * inverse; // inverse mod 2^128
inverse *= 2 - denominator * inverse; // inverse mod 2^256
// Because the division is now exact we can divide by multiplying with the modular inverse of denominator.
// This will give us the correct result modulo 2^256. Since the preconditions guarantee that the outcome is
// less than 2^256, this is the final result. We don't need to compute the high bits of the result and prod1
// is no longer required.
result = prod0 * inverse;
return result;
}
}
/**
* @notice Calculates x * y / denominator with full precision, following the selected rounding direction.
*/
function mulDiv(uint256 x, uint256 y, uint256 denominator, Rounding rounding) internal pure returns (uint256) {
uint256 result = mulDiv(x, y, denominator);
if (unsignedRoundsUp(rounding) && mulmod(x, y, denominator) > 0) {
result += 1;
}
return result;
}
/**
* @dev Returns the square root of a number. If the number is not a perfect square, the value is rounded
* towards zero.
*
* Inspired by Henry S. Warren, Jr.'s "Hacker's Delight" (Chapter 11).
*/
function sqrt(uint256 a) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
// For our first guess, we get the biggest power of 2 which is smaller than the square root of the target.
//
// We know that the "msb" (most significant bit) of our target number `a` is a power of 2 such that we have
// `msb(a) <= a < 2*msb(a)`. This value can be written `msb(a)=2**k` with `k=log2(a)`.
//
// This can be rewritten `2**log2(a) <= a < 2**(log2(a) + 1)`
// → `sqrt(2**k) <= sqrt(a) < sqrt(2**(k+1))`
// → `2**(k/2) <= sqrt(a) < 2**((k+1)/2) <= 2**(k/2 + 1)`
//
// Consequently, `2**(log2(a) / 2)` is a good first approximation of `sqrt(a)` with at least 1 correct bit.
uint256 result = 1 << (log2(a) >> 1);
// At this point `result` is an estimation with one bit of precision. We know the true value is a uint128,
// since it is the square root of a uint256. Newton's method converges quadratically (precision doubles at
// every iteration). We thus need at most 7 iteration to turn our partial result with one bit of precision
// into the expected uint128 result.
unchecked {
result = (result + a / result) >> 1;
result = (result + a / result) >> 1;
result = (result + a / result) >> 1;
result = (result + a / result) >> 1;
result = (result + a / result) >> 1;
result = (result + a / result) >> 1;
result = (result + a / result) >> 1;
return min(result, a / result);
}
}
/**
* @notice Calculates sqrt(a), following the selected rounding direction.
*/
function sqrt(uint256 a, Rounding rounding) internal pure returns (uint256) {
unchecked {
uint256 result = sqrt(a);
return result + (unsignedRoundsUp(rounding) && result * result < a ? 1 : 0);
}
}
/**
* @dev Return the log in base 2 of a positive value rounded towards zero.
* Returns 0 if given 0.
*/
function log2(uint256 value) internal pure returns (uint256) {
uint256 result = 0;
unchecked {
if (value >> 128 > 0) {
value >>= 128;
result += 128;
}
if (value >> 64 > 0) {
value >>= 64;
result += 64;
}
if (value >> 32 > 0) {
value >>= 32;
result += 32;
}
if (value >> 16 > 0) {
value >>= 16;
result += 16;
}
if (value >> 8 > 0) {
value >>= 8;
result += 8;
}
if (value >> 4 > 0) {
value >>= 4;
result += 4;
}
if (value >> 2 > 0) {
value >>= 2;
result += 2;
}
if (value >> 1 > 0) {
result += 1;
}
}
return result;
}
/**
* @dev Return the log in base 2, following the selected rounding direction, of a positive value.
* Returns 0 if given 0.
*/
function log2(uint256 value, Rounding rounding) internal pure returns (uint256) {
unchecked {
uint256 result = log2(value);
return result + (unsignedRoundsUp(rounding) && 1 << result < value ? 1 : 0);
}
}
/**
* @dev Return the log in base 10 of a positive value rounded towards zero.
* Returns 0 if given 0.
*/
function log10(uint256 value) internal pure returns (uint256) {
uint256 result = 0;
unchecked {
if (value >= 10 ** 64) {
value /= 10 ** 64;
result += 64;
}
if (value >= 10 ** 32) {
value /= 10 ** 32;
result += 32;
}
if (value >= 10 ** 16) {
value /= 10 ** 16;
result += 16;
}
if (value >= 10 ** 8) {
value /= 10 ** 8;
result += 8;
}
if (value >= 10 ** 4) {
value /= 10 ** 4;
result += 4;
}
if (value >= 10 ** 2) {
value /= 10 ** 2;
result += 2;
}
if (value >= 10 ** 1) {
result += 1;
}
}
return result;
}
/**
* @dev Return the log in base 10, following the selected rounding direction, of a positive value.
* Returns 0 if given 0.
*/
function log10(uint256 value, Rounding rounding) internal pure returns (uint256) {
unchecked {
uint256 result = log10(value);
return result + (unsignedRoundsUp(rounding) && 10 ** result < value ? 1 : 0);
}
}
/**
* @dev Return the log in base 256 of a positive value rounded towards zero.
* Returns 0 if given 0.
*
* Adding one to the result gives the number of pairs of hex symbols needed to represent `value` as a hex string.
*/
function log256(uint256 value) internal pure returns (uint256) {
uint256 result = 0;
unchecked {
if (value >> 128 > 0) {
value >>= 128;
result += 16;
}
if (value >> 64 > 0) {
value >>= 64;
result += 8;
}
if (value >> 32 > 0) {
value >>= 32;
result += 4;
}
if (value >> 16 > 0) {
value >>= 16;
result += 2;
}
if (value >> 8 > 0) {
result += 1;
}
}
return result;
}
/**
* @dev Return the log in base 256, following the selected rounding direction, of a positive value.
* Returns 0 if given 0.
*/
function log256(uint256 value, Rounding rounding) internal pure returns (uint256) {
unchecked {
uint256 result = log256(value);
return result + (unsignedRoundsUp(rounding) && 1 << (result << 3) < value ? 1 : 0);
}
}
/**
* @dev Returns whether a provided rounding mode is considered rounding up for unsigned integers.
*/
function unsignedRoundsUp(Rounding rounding) internal pure returns (bool) {
return uint8(rounding) % 2 == 1;
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (utils/math/SignedMath.sol)
pragma solidity ^0.8.20;
/**
* @dev Standard signed math utilities missing in the Solidity language.
*/
library SignedMath {
/**
* @dev Returns the largest of two signed numbers.
*/
function max(int256 a, int256 b) internal pure returns (int256) {
return a > b ? a : b;
}
/**
* @dev Returns the smallest of two signed numbers.
*/
function min(int256 a, int256 b) internal pure returns (int256) {
return a < b ? a : b;
}
/**
* @dev Returns the average of two signed numbers without overflow.
* The result is rounded towards zero.
*/
function average(int256 a, int256 b) internal pure returns (int256) {
// Formula from the book "Hacker's Delight"
int256 x = (a & b) + ((a ^ b) >> 1);
return x + (int256(uint256(x) >> 255) & (a ^ b));
}
/**
* @dev Returns the absolute unsigned value of a signed value.
*/
function abs(int256 n) internal pure returns (uint256) {
unchecked {
// must be unchecked in order to support `n = type(int256).min`
return uint256(n >= 0 ? n : -n);
}
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (utils/Strings.sol)
pragma solidity ^0.8.20;
import {Math} from "./math/Math.sol";
import {SignedMath} from "./math/SignedMath.sol";
/**
* @dev String operations.
*/
library Strings {
bytes16 private constant HEX_DIGITS = "0123456789abcdef";
uint8 private constant ADDRESS_LENGTH = 20;
/**
* @dev The `value` string doesn't fit in the specified `length`.
*/
error StringsInsufficientHexLength(uint256 value, uint256 length);
/**
* @dev Converts a `uint256` to its ASCII `string` decimal representation.
*/
function toString(uint256 value) internal pure returns (string memory) {
unchecked {
uint256 length = Math.log10(value) + 1;
string memory buffer = new string(length);
uint256 ptr;
/// @solidity memory-safe-assembly
assembly {
ptr := add(buffer, add(32, length))
}
while (true) {
ptr--;
/// @solidity memory-safe-assembly
assembly {
mstore8(ptr, byte(mod(value, 10), HEX_DIGITS))
}
value /= 10;
if (value == 0) break;
}
return buffer;
}
}
/**
* @dev Converts a `int256` to its ASCII `string` decimal representation.
*/
function toStringSigned(int256 value) internal pure returns (string memory) {
return string.concat(value < 0 ? "-" : "", toString(SignedMath.abs(value)));
}
/**
* @dev Converts a `uint256` to its ASCII `string` hexadecimal representation.
*/
function toHexString(uint256 value) internal pure returns (string memory) {
unchecked {
return toHexString(value, Math.log256(value) + 1);
}
}
/**
* @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length.
*/
function toHexString(uint256 value, uint256 length) internal pure returns (string memory) {
uint256 localValue = value;
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_DIGITS[localValue & 0xf];
localValue >>= 4;
}
if (localValue != 0) {
revert StringsInsufficientHexLength(value, length);
}
return string(buffer);
}
/**
* @dev Converts an `address` with fixed length of 20 bytes to its not checksummed ASCII `string` hexadecimal
* representation.
*/
function toHexString(address addr) internal pure returns (string memory) {
return toHexString(uint256(uint160(addr)), ADDRESS_LENGTH);
}
/**
* @dev Returns true if the two strings are equal.
*/
function equal(string memory a, string memory b) internal pure returns (bool) {
return bytes(a).length == bytes(b).length && keccak256(bytes(a)) == keccak256(bytes(b));
}
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.20;
/**
* @title ClaimData
* @dev Struct for storing claim related data
*/
struct ClaimData {
uint256 tokenId; // ID of the token
bytes sigOwner; // Signature from the Pack owner
address claimer; // Address of the claimer
bytes sigClaimer; // Signature from the claimer
uint256 refundValue; // Value to refund to the relayer
uint256 maxRefundValue; // Maximum refundable value (to prevent over-refund)
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
/// @dev the ERC-165 identifier for this interface is `0x6faff5f1`
interface IERC6551Account {
/**
* @dev Allows the account to receive Ether
*
* Accounts MUST implement a `receive` function
*
* Accounts MAY perform arbitrary logic to restrict conditions
* under which Ether can be received
*/
receive() external payable;
/**
* @dev Returns the identifier of the non-fungible token which owns the account
*
* The return value of this function MUST be constant - it MUST NOT change over time
*
* @return chainId The EIP-155 ID of the chain the token exists on
* @return tokenContract The contract address of the token
* @return tokenId The ID of the token
*/
function token()
external
view
returns (uint256 chainId, address tokenContract, uint256 tokenId);
/**
* @dev Returns a value that SHOULD be modified each time the account changes state
*
* @return The current account state
*/
function state() external view returns (uint256);
/**
* @dev Returns a magic value indicating whether a given signer is authorized to act on behalf
* of the account
*
* MUST return the bytes4 magic value 0x523e3260 if the given signer is valid
*
* By default, the holder of the non-fungible token the account is bound to MUST be considered
* a valid signer
*
* Accounts MAY implement additional authorization logic which invalidates the holder as a
* signer or grants signing permissions to other non-holder accounts
*
* @param signer The address to check signing authorization for
* @param context Additional data used to determine whether the signer is valid
* @return magicValue Magic value indicating whether the signer is valid
*/
function isValidSigner(
address signer,
bytes calldata context
) external view returns (bytes4 magicValue);
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
/// @dev the ERC-165 identifier for this interface is `0x74420f4c`
interface IERC6551Executable {
/**
* @dev Executes a low-level operation if the caller is a valid signer on the account
*
* Reverts and bubbles up error if operation fails
*
* @param to The target address of the operation
* @param value The Ether value to be sent to the target
* @param data The encoded operation calldata
* @param operation A value indicating the type of operation to perform
*
* Accounts implementing this interface MUST accept the following operation parameter values:
* - 0 = CALL
* - 1 = DELEGATECALL
* - 2 = CREATE
* - 3 = CREATE2
*
* Accounts implementing this interface MAY support additional operations or restrict a signer's
* ability to execute certain operations
*
* @return The result of the operation
*/
function execute(
address to,
uint256 value,
bytes calldata data,
uint256 operation
) external payable returns (bytes memory);
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
interface IERC6551Registry {
/**
* @dev The registry SHALL emit the AccountCreated event upon successful account creation
*/
event AccountCreated(
address account,
address indexed implementation,
uint256 chainId,
address indexed tokenContract,
uint256 indexed tokenId,
uint256 salt
);
/**
* @dev Creates a token bound account for a non-fungible token
*
* If account has already been created, returns the account address without calling create2
*
* If initData is not empty and account has not yet been created, calls account with
* provided initData after creation
*
* Emits AccountCreated event
*
* @return the address of the account
*/
function createAccount(
address implementation,
uint256 chainId,
address tokenContract,
uint256 tokenId,
uint256 seed,
bytes calldata initData
) external returns (address);
/**
* @dev Returns the computed token bound account address for a non-fungible token
*
* @return The computed address of the token bound account
*/
function account(
address implementation,
uint256 chainId,
address tokenContract,
uint256 tokenId,
uint256 salt
) external view returns (address);
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.20;
import "@openzeppelin/contracts/utils/cryptography/SignatureChecker.sol";
import "@openzeppelin/contracts/utils/cryptography/MessageHashUtils.sol";
import "../ClaimData.sol";
library SignatureValidator {
error InvalidOwnerSignature();
error InvalidClaimerSignature();
function validateSignatures(
ClaimData memory data,
uint256 registryChainId,
uint256 salt,
address addr,
address claimPublicKey
) internal view returns (bool) {
bytes32 messageHashOwner = MessageHashUtils.toEthSignedMessageHash(
keccak256(
abi.encodePacked(
data.tokenId,
data.claimer,
registryChainId,
salt,
addr
)
)
);
if (
!SignatureChecker.isValidSignatureNow(
claimPublicKey,
messageHashOwner,
data.sigOwner
)
) {
revert InvalidOwnerSignature();
}
bytes32 messageHashClaimer = MessageHashUtils.toEthSignedMessageHash(
keccak256(
abi.encodePacked(
data.tokenId,
data.maxRefundValue,
registryChainId,
salt,
addr
)
)
);
if (
!SignatureChecker.isValidSignatureNow(
data.claimer,
messageHashClaimer,
data.sigClaimer
)
) {
revert InvalidClaimerSignature();
}
return true;
}
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.20;
import "@openzeppelin/contracts/token/ERC721/ERC721.sol";
import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol";
/**
* @title PackNFT
* @dev This contract inherits from ERC721 and ERC721Enumerable. It represents a Pack NFT and includes functions for minting, revoking and opening packs.
*/
contract PackNFT is ERC721, ERC721Enumerable {
//
// ----------- Enumerations ---------------
/**
* @dev Represents the state of a Pack
* Empty: Indicates that the pack has not been minted yet
* Created: Indicates that the pack is newly minted and not yet opened or revoked
* Opened: Indicates that the pack has been opened by a claimer
* Revoked: Indicates that the pack has been revoked by the owner
*/
enum PackState {
Empty,
Created,
Opened,
Revoked
}
// ---------- Storage --------------------
uint256 private _nextTokenId;
string private _baseTokenURI;
mapping(uint256 => PackState) public packState;
mapping(uint256 => string) public packStateURIs;
// Store creation block number for each token
mapping(uint256 => uint256) public creationBlock;
/**
* @dev Constructor for the PackNFT contract
* @param baseTokenURI_ The base URI for the token
* @param name_ The name of the token
* @param symbol_ The symbol of the token
*/
constructor(
string memory baseTokenURI_,
string memory name_,
string memory symbol_
) ERC721(name_, symbol_) {
_baseTokenURI = baseTokenURI_;
// Initialize the mapping
packStateURIs[uint(PackState.Created)] = "created";
packStateURIs[uint(PackState.Opened)] = "opened";
packStateURIs[uint(PackState.Revoked)] = "revoked";
}
/**
* @dev Internal function to mint a pack and set its state to Created
* @param to The address to mint the pack to
* @return tokenId The ID of the newly minted pack
*/
function _mintPack(address to) internal returns (uint256 tokenId) {
tokenId = _nextTokenId++;
_safeMint(to, tokenId);
// Set state to Created
packState[tokenId] = PackState.Created;
// Set creation block number
creationBlock[tokenId] = block.number;
}
/**
* @dev Internal function to revoke a pack and set its state to Revoked
* @param tokenId The ID of the pack to revoke
*/
function _revokePack(uint256 tokenId) internal {
_burn(tokenId);
// Set state to Revoked
packState[tokenId] = PackState.Revoked;
}
/**
* @dev Internal function to open a pack and set its state to Opened
* @param tokenId The ID of the pack to open
*/
function _openPack(uint256 tokenId) internal {
// Set state to Opened
packState[tokenId] = PackState.Opened;
}
/**
* @dev Function to get the URI of a token based on its state
* @param tokenId The ID of the token
* @return The URI of the token
*/
function tokenURI(
uint256 tokenId
) public view override returns (string memory) {
// Get state of the Pack
PackState state = packState[tokenId];
// Check if the state exists in the mapping
string memory stateURI = packStateURIs[uint(state)];
require(bytes(stateURI).length > 0, "PackdMain: invalid state");
// Return the URI based on the state of the Pack
return string(abi.encodePacked(_baseURI(), stateURI));
}
/**
* @dev Function to get the base URI of the token
* @return The base URI of the token
*/
function _baseURI() internal view override returns (string memory) {
return _baseTokenURI;
}
// The following functions are overrides required by Solidity.
/**
* @dev Internal function to update the state of a token
* @param to The address to update the token to
* @param tokenId The ID of the token
* @param auth The address authorized to update the token
* @return The address of the updated token
*/
function _update(
address to,
uint256 tokenId,
address auth
) internal override(ERC721, ERC721Enumerable) returns (address) {
return super._update(to, tokenId, auth);
}
/**
* @dev Internal function to increase the balance of an account
* @param account The address of the account
* @param value The amount to increase the balance by
*/
function _increaseBalance(
address account,
uint128 value
) internal override(ERC721, ERC721Enumerable) {
super._increaseBalance(account, value);
}
/**
* @dev Function to check if the contract supports an interface
* @param interfaceId The ID of the interface
* @return A boolean indicating whether the contract supports the interface
*/
function supportsInterface(
bytes4 interfaceId
) public view override(ERC721, ERC721Enumerable) returns (bool) {
return super.supportsInterface(interfaceId);
}
}{
"evmVersion": "paris",
"optimizer": {
"enabled": false,
"runs": 200
},
"outputSelection": {
"*": {
"*": [
"evm.bytecode",
"evm.deployedBytecode",
"devdoc",
"userdoc",
"metadata",
"abi"
]
}
},
"libraries": {}
}Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
Contract ABI
API[{"inputs":[{"internalType":"address","name":"initialOwner_","type":"address"},{"internalType":"string","name":"baseTokenURI_","type":"string"},{"internalType":"string","name":"name_","type":"string"},{"internalType":"string","name":"symbol_","type":"string"},{"internalType":"address","name":"registry_","type":"address"},{"internalType":"address","name":"implementation_","type":"address"},{"internalType":"uint256","name":"registryChainId_","type":"uint256"},{"internalType":"uint256","name":"salt_","type":"uint256"},{"internalType":"address[]","name":"modulesWhitelist_","type":"address[]"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[{"internalType":"address","name":"target","type":"address"}],"name":"AddressEmptyCode","type":"error"},{"inputs":[],"name":"ERC721EnumerableForbiddenBatchMint","type":"error"},{"inputs":[{"internalType":"address","name":"sender","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"address","name":"owner","type":"address"}],"name":"ERC721IncorrectOwner","type":"error"},{"inputs":[{"internalType":"address","name":"operator","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"ERC721InsufficientApproval","type":"error"},{"inputs":[{"internalType":"address","name":"approver","type":"address"}],"name":"ERC721InvalidApprover","type":"error"},{"inputs":[{"internalType":"address","name":"operator","type":"address"}],"name":"ERC721InvalidOperator","type":"error"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"ERC721InvalidOwner","type":"error"},{"inputs":[{"internalType":"address","name":"receiver","type":"address"}],"name":"ERC721InvalidReceiver","type":"error"},{"inputs":[{"internalType":"address","name":"sender","type":"address"}],"name":"ERC721InvalidSender","type":"error"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"ERC721NonexistentToken","type":"error"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"uint256","name":"index","type":"uint256"}],"name":"ERC721OutOfBoundsIndex","type":"error"},{"inputs":[],"name":"EtherTransferFailed","type":"error"},{"inputs":[],"name":"FailedInnerCall","type":"error"},{"inputs":[],"name":"InvalidAddress","type":"error"},{"inputs":[],"name":"InvalidClaimerSignature","type":"error"},{"inputs":[],"name":"InvalidEthValue","type":"error"},{"inputs":[{"internalType":"uint256","name":"modulesLength","type":"uint256"},{"internalType":"uint256","name":"moduleDataLength","type":"uint256"}],"name":"InvalidLengthOfData","type":"error"},{"inputs":[],"name":"InvalidOwnerSignature","type":"error"},{"inputs":[],"name":"InvalidRefundValue","type":"error"},{"inputs":[{"internalType":"address","name":"modules","type":"address"}],"name":"ModulesNotWhitelisted","type":"error"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"OnlyOwnerOf","type":"error"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"OwnableInvalidOwner","type":"error"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"OwnableUnauthorizedAccount","type":"error"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"TokenNotInExpectedState","type":"error"},{"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":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"},{"indexed":false,"internalType":"address","name":"owner","type":"address"},{"indexed":false,"internalType":"address[]","name":"modules","type":"address[]"},{"indexed":false,"internalType":"bytes[]","name":"moduleData","type":"bytes[]"}],"name":"PackCreated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"},{"indexed":false,"internalType":"address","name":"claimer","type":"address"}],"name":"PackOpened","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"},{"indexed":false,"internalType":"address","name":"owner","type":"address"}],"name":"PackRevoked","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Transfer","type":"event"},{"inputs":[],"name":"CALL_OPERATION","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"VERSION","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"account","outputs":[{"internalType":"address","name":"","type":"address"}],"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"}],"name":"claimPublicKey","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"creationBlock","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"getApproved","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"implementation","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"operator","type":"address"}],"name":"isApprovedForAll","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"modulesWhitelist","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"components":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"bytes","name":"sigOwner","type":"bytes"},{"internalType":"address","name":"claimer","type":"address"},{"internalType":"bytes","name":"sigClaimer","type":"bytes"},{"internalType":"uint256","name":"refundValue","type":"uint256"},{"internalType":"uint256","name":"maxRefundValue","type":"uint256"}],"internalType":"struct ClaimData","name":"data","type":"tuple"},{"internalType":"bytes[]","name":"moduleData","type":"bytes[]"}],"name":"open","outputs":[],"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":"to_","type":"address"},{"internalType":"address","name":"claimPublicKey_","type":"address"},{"internalType":"address[]","name":"modules","type":"address[]"},{"internalType":"bytes[]","name":"moduleData","type":"bytes[]"}],"name":"pack","outputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"address","name":"newAccount","type":"address"}],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint256","name":"","type":"uint256"}],"name":"packModules","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"packState","outputs":[{"internalType":"enum PackNFT.PackState","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"packStateURIs","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"registry","outputs":[{"internalType":"contract IERC6551Registry","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"registryChainId","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId_","type":"uint256"},{"internalType":"bytes[]","name":"moduleData","type":"bytes[]"}],"name":"revoke","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":[],"name":"salt","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","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":"modules","type":"address[]"},{"internalType":"bool","name":"value","type":"bool"}],"name":"setModulesWhitelist","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"}]Contract Creation Code
6101006040523480156200001257600080fd5b50604051620062b2380380620062b28339818101604052810190620000389190620008d7565b88888888818181600090816200004f919062000c73565b50806001908162000061919062000c73565b50505082600b908162000075919062000c73565b506040518060400160405280600781526020017f6372656174656400000000000000000000000000000000000000000000000000815250600d600060016003811115620000c757620000c662000d5a565b5b81526020019081526020016000209081620000e3919062000c73565b506040518060400160405280600681526020017f6f70656e65640000000000000000000000000000000000000000000000000000815250600d60006002600381111562000135576200013462000d5a565b5b8152602001908152602001600020908162000151919062000c73565b506040518060400160405280600781526020017f7265766f6b656400000000000000000000000000000000000000000000000000815250600d6000600380811115620001a257620001a162000d5a565b5b81526020019081526020016000209081620001be919062000c73565b50505050600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1603620002375760006040517f1e4fbdf70000000000000000000000000000000000000000000000000000000081526004016200022e919062000d9a565b60405180910390fd5b62000248816200038360201b60201c565b50600073ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff161480620002b15750600073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff16145b15620002e9576040517fe6c4247b00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b8473ffffffffffffffffffffffffffffffffffffffff1660808173ffffffffffffffffffffffffffffffffffffffff16815250508373ffffffffffffffffffffffffffffffffffffffff1660a08173ffffffffffffffffffffffffffffffffffffffff16815250508260c081815250508160e08181525050620003748160016200044960201b60201c565b50505050505050505062000e62565b6000600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905081600f60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b62000459620004f560201b60201c565b60005b8251811015620004f057816012600085848151811062000481576200048062000db7565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080620004e79062000e15565b9150506200045c565b505050565b620005056200059760201b60201c565b73ffffffffffffffffffffffffffffffffffffffff166200052b6200059f60201b60201c565b73ffffffffffffffffffffffffffffffffffffffff16146200059557620005576200059760201b60201c565b6040517f118cdaa70000000000000000000000000000000000000000000000000000000081526004016200058c919062000d9a565b60405180910390fd5b565b600033905090565b6000600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b6000604051905090565b600080fd5b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b60006200060a82620005dd565b9050919050565b6200061c81620005fd565b81146200062857600080fd5b50565b6000815190506200063c8162000611565b92915050565b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b62000697826200064c565b810181811067ffffffffffffffff82111715620006b957620006b86200065d565b5b80604052505050565b6000620006ce620005c9565b9050620006dc82826200068c565b919050565b600067ffffffffffffffff821115620006ff57620006fe6200065d565b5b6200070a826200064c565b9050602081019050919050565b60005b83811015620007375780820151818401526020810190506200071a565b60008484015250505050565b60006200075a6200075484620006e1565b620006c2565b90508281526020810184848401111562000779576200077862000647565b5b6200078684828562000717565b509392505050565b600082601f830112620007a657620007a562000642565b5b8151620007b884826020860162000743565b91505092915050565b6000819050919050565b620007d681620007c1565b8114620007e257600080fd5b50565b600081519050620007f681620007cb565b92915050565b600067ffffffffffffffff8211156200081a57620008196200065d565b5b602082029050602081019050919050565b600080fd5b6000620008476200084184620007fc565b620006c2565b905080838252602082019050602084028301858111156200086d576200086c6200082b565b5b835b818110156200089a57806200088588826200062b565b8452602084019350506020810190506200086f565b5050509392505050565b600082601f830112620008bc57620008bb62000642565b5b8151620008ce84826020860162000830565b91505092915050565b60008060008060008060008060006101208a8c031215620008fd57620008fc620005d3565b5b60006200090d8c828d016200062b565b99505060208a015167ffffffffffffffff811115620009315762000930620005d8565b5b6200093f8c828d016200078e565b98505060408a015167ffffffffffffffff811115620009635762000962620005d8565b5b620009718c828d016200078e565b97505060608a015167ffffffffffffffff811115620009955762000994620005d8565b5b620009a38c828d016200078e565b9650506080620009b68c828d016200062b565b95505060a0620009c98c828d016200062b565b94505060c0620009dc8c828d01620007e5565b93505060e0620009ef8c828d01620007e5565b9250506101008a015167ffffffffffffffff81111562000a145762000a13620005d8565b5b62000a228c828d01620008a4565b9150509295985092959850929598565b600081519050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b6000600282049050600182168062000a8557607f821691505b60208210810362000a9b5762000a9a62000a3d565b5b50919050565b60008190508160005260206000209050919050565b60006020601f8301049050919050565b600082821b905092915050565b60006008830262000b057fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8262000ac6565b62000b11868362000ac6565b95508019841693508086168417925050509392505050565b6000819050919050565b600062000b5462000b4e62000b4884620007c1565b62000b29565b620007c1565b9050919050565b6000819050919050565b62000b708362000b33565b62000b8862000b7f8262000b5b565b84845462000ad3565b825550505050565b600090565b62000b9f62000b90565b62000bac81848462000b65565b505050565b5b8181101562000bd45762000bc860008262000b95565b60018101905062000bb2565b5050565b601f82111562000c235762000bed8162000aa1565b62000bf88462000ab6565b8101602085101562000c08578190505b62000c2062000c178562000ab6565b83018262000bb1565b50505b505050565b600082821c905092915050565b600062000c486000198460080262000c28565b1980831691505092915050565b600062000c63838362000c35565b9150826002028217905092915050565b62000c7e8262000a32565b67ffffffffffffffff81111562000c9a5762000c996200065d565b5b62000ca6825462000a6c565b62000cb382828562000bd8565b600060209050601f83116001811462000ceb576000841562000cd6578287015190505b62000ce2858262000c55565b86555062000d52565b601f19841662000cfb8662000aa1565b60005b8281101562000d255784890151825560018201915060208501945060208101905062000cfe565b8683101562000d45578489015162000d41601f89168262000c35565b8355505b6001600288020188555050505b505050505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b62000d9481620005fd565b82525050565b600060208201905062000db1600083018462000d89565b92915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b600062000e2282620007c1565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff820362000e575762000e5662000de6565b5b600182019050919050565b60805160a05160c05160e0516153d062000ee260003960008181610c89015281816114b0015281816118d5015261280f0152600081816109f301528181610c66015281816118b201526127ee015260008181610c45015281816111c90152611891015260008181610c09015281816112cd015261185501526153d06000f3fe60806040526004361061020f5760003560e01c806370a0823111610118578063bfa0b133116100a0578063d48c94a81161006f578063d48c94a814610823578063e985e9c514610854578063f2fde38b14610891578063fa757b9a146108ba578063ffa1ad74146108e35761020f565b8063bfa0b13314610753578063c26d20d31461077e578063c87b56dd146107bb578063d3f43c78146107f85761020f565b806395d89b41116100e757806395d89b4114610670578063a22cb4651461069b578063a25c4aef146106c4578063b2ddcab4146106ed578063b88d4fde1461072a5761020f565b806370a08231146105c6578063715018a6146106035780637b1039991461061a5780638da5cb5b146106455761020f565b80632dd7c6581161019b5780634f5e74c21161016a5780634f5e74c2146104bb5780634f6ccce7146104f85780635c184796146105355780635c60da1b1461055e5780636352211e146105895761020f565b80632dd7c658146103db5780632f745c59146104185780633664cd3f1461045557806342842e0e146104925761020f565b806318160ddd116101e257806318160ddd146102e257806318e3ab571461030d57806322e06ae01461033857806323b872dd14610375578063275e0a881461039e5761020f565b806301ffc9a71461021457806306fdde0314610251578063081812fc1461027c578063095ea7b3146102b9575b600080fd5b34801561022057600080fd5b5061023b60048036038101906102369190613c23565b61090e565b6040516102489190613c6b565b60405180910390f35b34801561025d57600080fd5b50610266610920565b6040516102739190613d16565b60405180910390f35b34801561028857600080fd5b506102a3600480360381019061029e9190613d6e565b6109b2565b6040516102b09190613ddc565b60405180910390f35b3480156102c557600080fd5b506102e060048036038101906102db9190613e23565b6109ce565b005b3480156102ee57600080fd5b506102f76109e4565b6040516103049190613e72565b60405180910390f35b34801561031957600080fd5b506103226109f1565b60405161032f9190613e72565b60405180910390f35b34801561034457600080fd5b5061035f600480360381019061035a9190613d6e565b610a15565b60405161036c9190613d16565b60405180910390f35b34801561038157600080fd5b5061039c60048036038101906103979190613e8d565b610ab5565b005b3480156103aa57600080fd5b506103c560048036038101906103c09190613ee0565b610bb7565b6040516103d29190613ddc565b60405180910390f35b3480156103e757600080fd5b5061040260048036038101906103fd9190613d6e565b610c05565b60405161040f9190613ddc565b60405180910390f35b34801561042457600080fd5b5061043f600480360381019061043a9190613e23565b610d10565b60405161044c9190613e72565b60405180910390f35b34801561046157600080fd5b5061047c60048036038101906104779190613d6e565b610db9565b6040516104899190613f97565b60405180910390f35b34801561049e57600080fd5b506104b960048036038101906104b49190613e8d565b610dd9565b005b3480156104c757600080fd5b506104e260048036038101906104dd9190613d6e565b610df9565b6040516104ef9190613e72565b60405180910390f35b34801561050457600080fd5b5061051f600480360381019061051a9190613d6e565b610e11565b60405161052c9190613e72565b60405180910390f35b34801561054157600080fd5b5061055c60048036038101906105579190614017565b610e87565b005b34801561056a57600080fd5b506105736111c7565b6040516105809190613ddc565b60405180910390f35b34801561059557600080fd5b506105b060048036038101906105ab9190613d6e565b6111eb565b6040516105bd9190613ddc565b60405180910390f35b3480156105d257600080fd5b506105ed60048036038101906105e89190614077565b6111fd565b6040516105fa9190613e72565b60405180910390f35b34801561060f57600080fd5b506106186112b7565b005b34801561062657600080fd5b5061062f6112cb565b60405161063c9190614103565b60405180910390f35b34801561065157600080fd5b5061065a6112ef565b6040516106679190613ddc565b60405180910390f35b34801561067c57600080fd5b50610685611319565b6040516106929190613d16565b60405180910390f35b3480156106a757600080fd5b506106c260048036038101906106bd919061414a565b6113ab565b005b3480156106d057600080fd5b506106eb60048036038101906106e691906142c8565b6113c1565b005b3480156106f957600080fd5b50610714600480360381019061070f9190613d6e565b61145e565b6040516107219190613ddc565b60405180910390f35b34801561073657600080fd5b50610751600480360381019061074c91906143d9565b611491565b005b34801561075f57600080fd5b506107686114ae565b6040516107759190613e72565b60405180910390f35b34801561078a57600080fd5b506107a560048036038101906107a09190614077565b6114d2565b6040516107b29190613c6b565b60405180910390f35b3480156107c757600080fd5b506107e260048036038101906107dd9190613d6e565b6114f2565b6040516107ef9190613d16565b60405180910390f35b34801561080457600080fd5b5061080d611641565b60405161081a9190613e72565b60405180910390f35b61083d600480360381019061083891906144b2565b611646565b60405161084b929190614559565b60405180910390f35b34801561086057600080fd5b5061087b60048036038101906108769190614582565b611b52565b6040516108889190613c6b565b60405180910390f35b34801561089d57600080fd5b506108b860048036038101906108b39190614077565b611be6565b005b3480156108c657600080fd5b506108e160048036038101906108dc91906146a4565b611c6c565b005b3480156108ef57600080fd5b506108f8611f02565b6040516109059190613e72565b60405180910390f35b600061091982611f07565b9050919050565b60606000805461092f9061474f565b80601f016020809104026020016040519081016040528092919081815260200182805461095b9061474f565b80156109a85780601f1061097d576101008083540402835291602001916109a8565b820191906000526020600020905b81548152906001019060200180831161098b57829003601f168201915b5050505050905090565b60006109bd82611f81565b506109c782612009565b9050919050565b6109e082826109db612046565b61204e565b5050565b6000600880549050905090565b7f000000000000000000000000000000000000000000000000000000000000000081565b600d6020528060005260406000206000915090508054610a349061474f565b80601f0160208091040260200160405190810160405280929190818152602001828054610a609061474f565b8015610aad5780601f10610a8257610100808354040283529160200191610aad565b820191906000526020600020905b815481529060010190602001808311610a9057829003601f168201915b505050505081565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1603610b275760006040517f64a0ae92000000000000000000000000000000000000000000000000000000008152600401610b1e9190613ddc565b60405180910390fd5b6000610b3b8383610b36612046565b612060565b90508373ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614610bb1578382826040517f64283d7b000000000000000000000000000000000000000000000000000000008152600401610ba893929190614780565b60405180910390fd5b50505050565b60116020528160005260406000208181548110610bd357600080fd5b906000526020600020016000915091509054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60007f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff16635e9bc5367f00000000000000000000000000000000000000000000000000000000000000007f000000000000000000000000000000000000000000000000000000000000000030867f00000000000000000000000000000000000000000000000000000000000000006040518663ffffffff1660e01b8152600401610cc89594939291906147b7565b602060405180830381865afa158015610ce5573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d09919061481f565b9050919050565b6000610d1b836111fd565b8210610d605782826040517fa57d13dc000000000000000000000000000000000000000000000000000000008152600401610d5792919061484c565b60405180910390fd5b600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600083815260200190815260200160002054905092915050565b600c6020528060005260406000206000915054906101000a900460ff1681565b610df483838360405180602001604052806000815250611491565b505050565b600e6020528060005260406000206000915090505481565b6000610e1b6109e4565b8210610e61576000826040517fa57d13dc000000000000000000000000000000000000000000000000000000008152600401610e5892919061484c565b60405180910390fd5b60088281548110610e7557610e74614875565b5b90600052602060002001549050919050565b823373ffffffffffffffffffffffffffffffffffffffff16610ea8826111eb565b73ffffffffffffffffffffffffffffffffffffffff1614610f0057806040517fcd5e32e2000000000000000000000000000000000000000000000000000000008152600401610ef79190613e72565b60405180910390fd5b836001806003811115610f1657610f15613f20565b5b600c600084815260200190815260200160002060009054906101000a900460ff166003811115610f4957610f48613f20565b5b14610f8b57816040517ff7453f0b000000000000000000000000000000000000000000000000000000008152600401610f829190613e72565b60405180910390fd5b60116000878152602001908152602001600020805490508585905014611003576011600087815260200190815260200160002080549050858590506040517f4fb53a3c000000000000000000000000000000000000000000000000000000008152600401610ffa9291906148a4565b60405180910390fd5b61100c86612076565b600061101787610c05565b905060008173ffffffffffffffffffffffffffffffffffffffff163190506110408233836120be565b60005b601160008a81526020019081526020016000208054905081101561118457611170601160008b8152602001908152602001600020828154811061108957611088614875565b5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168a858b8b868181106110c9576110c8614875565b5b90506020028101906110db91906148dc565b6040516024016110ee949392919061499e565b6040516020818303038152906040527ff37e724e000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff83818316178352505050506121e1565b50808061117c90614a0d565b915050611043565b50877f3ed29fb64fa945b8356199704a51c1da5e7717064a5848e693f31c84fc6c806e336040516111b59190613ddc565b60405180910390a25050505050505050565b7f000000000000000000000000000000000000000000000000000000000000000081565b60006111f682611f81565b9050919050565b60008073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16036112705760006040517f89c62b640000000000000000000000000000000000000000000000000000000081526004016112679190613ddc565b60405180910390fd5b600360008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b6112bf612265565b6112c960006122ec565b565b7f000000000000000000000000000000000000000000000000000000000000000081565b6000600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b6060600180546113289061474f565b80601f01602080910402602001604051908101604052809291908181526020018280546113549061474f565b80156113a15780601f10611376576101008083540402835291602001916113a1565b820191906000526020600020905b81548152906001019060200180831161138457829003601f168201915b5050505050905090565b6113bd6113b6612046565b83836123b2565b5050565b6113c9612265565b60005b82518110156114595781601260008584815181106113ed576113ec614875565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550808061145190614a0d565b9150506113cc565b505050565b60106020528060005260406000206000915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b61149c848484610ab5565b6114a884848484612521565b50505050565b7f000000000000000000000000000000000000000000000000000000000000000081565b60126020528060005260406000206000915054906101000a900460ff1681565b60606000600c600084815260200190815260200160002060009054906101000a900460ff1690506000600d600083600381111561153257611531613f20565b5b8152602001908152602001600020805461154b9061474f565b80601f01602080910402602001604051908101604052809291908181526020018280546115779061474f565b80156115c45780601f10611599576101008083540402835291602001916115c4565b820191906000526020600020905b8154815290600101906020018083116115a757829003601f168201915b50505050509050600081511161160f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161160690614aa1565b60405180910390fd5b6116176126d8565b81604051602001611629929190614afd565b60405160208183030381529060405292505050919050565b600081565b60008060005b86869050811015611746576012600088888481811061166e5761166d614875565b5b90506020020160208101906116839190614077565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16611733578686828181106116e2576116e1614875565b5b90506020020160208101906116f79190614077565b6040517f486c037400000000000000000000000000000000000000000000000000000000815260040161172a9190613ddc565b60405180910390fd5b808061173e90614a0d565b91505061164c565b508383905086869050146117995785859050848490506040517f4fb53a3c0000000000000000000000000000000000000000000000000000000081526004016117909291906148a4565b60405180910390fd5b600034036117d3576040517f715a6e9e00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6117dc8861276a565b9150866010600084815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508585601160008581526020019081526020016000209190611852929190613afa565b507f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1663da7323b37f00000000000000000000000000000000000000000000000000000000000000007f000000000000000000000000000000000000000000000000000000000000000030867f00000000000000000000000000000000000000000000000000000000000000006040518663ffffffff1660e01b8152600401611914959493929190614b47565b6020604051808303816000875af1158015611933573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611957919061481f565b905060008173ffffffffffffffffffffffffffffffffffffffff163460405161197f90614bdb565b60006040518083038185875af1925050503d80600081146119bc576040519150601f19603f3d011682016040523d82523d6000602084013e6119c1565b606091505b50509050806119fc576040517f6747a28800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60005b87879050811015611b0557611af1888883818110611a2057611a1f614875565b5b9050602002016020810190611a359190614077565b8585898986818110611a4a57611a49614875565b5b9050602002810190611a5c91906148dc565b604051602401611a6f9493929190614bf0565b6040516020818303038152906040527fc56d786e000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff83818316178352505050506121e1565b508080611afd90614a0d565b9150506119ff565b50827fe271f0bfd48981060c91facb315d1aac41e5ef90698ffbc1e5886dbc6dd86ec58a89898989604051611b3e959493929190614e57565b60405180910390a250965096945050505050565b6000600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16905092915050565b611bee612265565b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1603611c605760006040517f1e4fbdf7000000000000000000000000000000000000000000000000000000008152600401611c579190613ddc565b60405180910390fd5b611c69816122ec565b50565b82600001516001806003811115611c8657611c85613f20565b5b600c600084815260200190815260200160002060009054906101000a900460ff166003811115611cb957611cb8613f20565b5b14611cfb57816040517ff7453f0b000000000000000000000000000000000000000000000000000000008152600401611cf29190613e72565b60405180910390fd5b611d04856127e8565b8460a0015185608001511115611d46576040517f25fef44e00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b611d538560000151612870565b60005b601160008760000151815260200190815260200160002080549050811015611eb557611ea160116000886000015181526020019081526020016000208281548110611da457611da3614875565b5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168760000151611de18960000151610c05565b8960400151898987818110611df957611df8614875565b5b9050602002810190611e0b91906148dc565b604051602401611e1f959493929190614ea0565b6040516020818303038152906040527f15a3966f000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff83818316178352505050506121e1565b508080611ead90614a0d565b915050611d56565b50611ebf856128af565b84600001517f86ed3e19f8d5b64492a8aa542a0268f79413b19b2f76dcff5b71469d603444e633604051611ef39190613ddc565b60405180910390a25050505050565b600181565b60007f780e9d63000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19161480611f7a5750611f79826128ff565b5b9050919050565b600080611f8d836129e1565b9050600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff160361200057826040517f7e273289000000000000000000000000000000000000000000000000000000008152600401611ff79190613e72565b60405180910390fd5b80915050919050565b60006004600083815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050919050565b600033905090565b61205b8383836001612a1e565b505050565b600061206d848484612be3565b90509392505050565b61207f81612d00565b6003600c600083815260200190815260200160002060006101000a81548160ff021916908360038111156120b6576120b5613f20565b5b021790555050565b600082826040516024016120d392919061484c565b6040516020818303038152906040527fa9059cbb000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff838183161783525050505090508373ffffffffffffffffffffffffffffffffffffffff166374420f4c84848460006040518563ffffffff1660e01b81526004016121929493929190614f32565b6000604051808303816000875af11580156121b1573d6000803e3d6000fd5b505050506040513d6000823e3d601f19601f820116820180604052508101906121da9190614fee565b5050505050565b60606000808473ffffffffffffffffffffffffffffffffffffffff168460405161220b9190615068565b600060405180830381855af49150503d8060008114612246576040519150601f19603f3d011682016040523d82523d6000602084013e61224b565b606091505b509150915061225b858383612d86565b9250505092915050565b61226d612046565b73ffffffffffffffffffffffffffffffffffffffff1661228b6112ef565b73ffffffffffffffffffffffffffffffffffffffff16146122ea576122ae612046565b6040517f118cdaa70000000000000000000000000000000000000000000000000000000081526004016122e19190613ddc565b60405180910390fd5b565b6000600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905081600f60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff160361242357816040517f5b08ba1800000000000000000000000000000000000000000000000000000000815260040161241a9190613ddc565b60405180910390fd5b80600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31836040516125149190613c6b565b60405180910390a3505050565b60008373ffffffffffffffffffffffffffffffffffffffff163b11156126d2578273ffffffffffffffffffffffffffffffffffffffff1663150b7a02612565612046565b8685856040518563ffffffff1660e01b8152600401612587949392919061507f565b6020604051808303816000875af19250505080156125c357506040513d601f19601f820116820180604052508101906125c091906150e0565b60015b612647573d80600081146125f3576040519150601f19603f3d011682016040523d82523d6000602084013e6125f8565b606091505b50600081510361263f57836040517f64a0ae920000000000000000000000000000000000000000000000000000000081526004016126369190613ddc565b60405180910390fd5b805181602001fd5b63150b7a0260e01b7bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916817bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916146126d057836040517f64a0ae920000000000000000000000000000000000000000000000000000000081526004016126c79190613ddc565b60405180910390fd5b505b50505050565b6060600b80546126e79061474f565b80601f01602080910402602001604051908101604052809291908181526020018280546127139061474f565b80156127605780601f1061273557610100808354040283529160200191612760565b820191906000526020600020905b81548152906001019060200180831161274357829003601f168201915b5050505050905090565b6000600a600081548092919061277f90614a0d565b91905055905061278f8282612e15565b6001600c600083815260200190815260200160002060006101000a81548160ff021916908360038111156127c6576127c5613f20565b5b021790555043600e600083815260200190815260200160002081905550919050565b61286c817f00000000000000000000000000000000000000000000000000000000000000007f000000000000000000000000000000000000000000000000000000000000000030601060008760000151815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16612e33565b5050565b6002600c600083815260200190815260200160002060006101000a81548160ff021916908360038111156128a7576128a6613f20565b5b021790555050565b60006128be8260000151610c05565b90506128cf813384608001516120be565b60008173ffffffffffffffffffffffffffffffffffffffff163190506128fa828460400151836120be565b505050565b60007f80ac58cd000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191614806129ca57507f5b5e139f000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916145b806129da57506129d982612f57565b5b9050919050565b60006002600083815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050919050565b8080612a575750600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15612b8b576000612a6784611f81565b9050600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614158015612ad257508273ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614155b8015612ae55750612ae38184611b52565b155b15612b2757826040517fa9fbf51f000000000000000000000000000000000000000000000000000000008152600401612b1e9190613ddc565b60405180910390fd5b8115612b8957838573ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45b505b836004600085815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050505050565b600080612bf1858585612fc1565b9050600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1603612c3557612c30846131db565b612c74565b8473ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614612c7357612c728185613224565b5b5b600073ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff1603612cb657612cb184613385565b612cf5565b8473ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614612cf457612cf38585613456565b5b5b809150509392505050565b6000612d0f6000836000612060565b9050600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1603612d8257816040517f7e273289000000000000000000000000000000000000000000000000000000008152600401612d799190613e72565b60405180910390fd5b5050565b606082612d9b57612d96826134e1565b612e0d565b60008251148015612dc3575060008473ffffffffffffffffffffffffffffffffffffffff163b145b15612e0557836040517f9996b315000000000000000000000000000000000000000000000000000000008152600401612dfc9190613ddc565b60405180910390fd5b819050612e0e565b5b9392505050565b612e2f828260405180602001604052806000815250613526565b5050565b600080612e7587600001518860400151888888604051602001612e5a959493929190615176565b60405160208183030381529060405280519060200120613542565b9050612e8683828960200151613578565b612ebc576040517f38a85a8d00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6000612efd88600001518960a00151898989604051602001612ee29594939291906151d5565b60405160208183030381529060405280519060200120613542565b9050612f128860400151828a60600151613578565b612f48576040517f36ae61d500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60019250505095945050505050565b60007f01ffc9a7000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916149050919050565b600080612fcd846129e1565b9050600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161461300f5761300e818486613608565b5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16146130a057613051600085600080612a1e565b6001600360008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825403925050819055505b600073ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff1614613123576001600360008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825401925050819055505b846002600086815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550838573ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60405160405180910390a4809150509392505050565b6008805490506009600083815260200190815260200160002081905550600881908060018154018082558091505060019003906000526020600020016000909190919091505550565b600061322f836111fd565b9050600060076000848152602001908152602001600020549050818114613314576000600660008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600084815260200190815260200160002054905080600660008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600084815260200190815260200160002081905550816007600083815260200190815260200160002081905550505b6007600084815260200190815260200160002060009055600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008381526020019081526020016000206000905550505050565b600060016008805490506133999190615234565b90506000600960008481526020019081526020016000205490506000600883815481106133c9576133c8614875565b5b9060005260206000200154905080600883815481106133eb576133ea614875565b5b90600052602060002001819055508160096000838152602001908152602001600020819055506009600085815260200190815260200160002060009055600880548061343a57613439615268565b5b6001900381819060005260206000200160009055905550505050565b60006001613463846111fd565b61346d9190615234565b905081600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600083815260200190815260200160002081905550806007600084815260200190815260200160002081905550505050565b6000815111156134f45780518082602001fd5b6040517f1425ea4200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b61353083836136cc565b61353d6000848484612521565b505050565b60007f19457468657265756d205369676e6564204d6573736167653a0a33320000000060005281601c52603c6000209050919050565b600080600061358785856137c5565b5091509150600060038111156135a05761359f613f20565b5b8160038111156135b3576135b2613f20565b5b1480156135eb57508573ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16145b806135fd57506135fc868686613821565b5b925050509392505050565b613613838383613945565b6136c757600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff160361368857806040517f7e27328900000000000000000000000000000000000000000000000000000000815260040161367f9190613e72565b60405180910390fd5b81816040517f177e802f0000000000000000000000000000000000000000000000000000000081526004016136be92919061484c565b60405180910390fd5b505050565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff160361373e5760006040517f64a0ae920000000000000000000000000000000000000000000000000000000081526004016137359190613ddc565b60405180910390fd5b600061374c83836000612060565b9050600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16146137c05760006040517f73c6ac6e0000000000000000000000000000000000000000000000000000000081526004016137b79190613ddc565b60405180910390fd5b505050565b6000806000604184510361380a5760008060006020870151925060408701519150606087015160001a90506137fc88828585613a06565b95509550955050505061381a565b60006002855160001b9250925092505b9250925092565b60008060008573ffffffffffffffffffffffffffffffffffffffff1685856040516024016138509291906152b0565b604051602081830303815290604052631626ba7e60e01b6020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff83818316178352505050506040516138a29190615068565b600060405180830381855afa9150503d80600081146138dd576040519150601f19603f3d011682016040523d82523d6000602084013e6138e2565b606091505b50915091508180156138f657506020815110155b801561393a5750631626ba7e60e01b7bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191681806020019051810190613938919061530c565b145b925050509392505050565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141580156139fd57508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614806139be57506139bd8484611b52565b5b806139fc57508273ffffffffffffffffffffffffffffffffffffffff166139e483612009565b73ffffffffffffffffffffffffffffffffffffffff16145b5b90509392505050565b60008060007f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a08460001c1115613a46576000600385925092509250613af0565b600060018888888860405160008152602001604052604051613a6b9493929190615355565b6020604051602081039080840390855afa158015613a8d573d6000803e3d6000fd5b505050602060405103519050600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1603613ae157600060016000801b93509350935050613af0565b8060008060001b935093509350505b9450945094915050565b828054828255906000526020600020908101928215613b89579160200282015b82811115613b8857823573ffffffffffffffffffffffffffffffffffffffff168260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555091602001919060010190613b1a565b5b509050613b969190613b9a565b5090565b5b80821115613bb3576000816000905550600101613b9b565b5090565b6000604051905090565b600080fd5b600080fd5b60007fffffffff0000000000000000000000000000000000000000000000000000000082169050919050565b613c0081613bcb565b8114613c0b57600080fd5b50565b600081359050613c1d81613bf7565b92915050565b600060208284031215613c3957613c38613bc1565b5b6000613c4784828501613c0e565b91505092915050565b60008115159050919050565b613c6581613c50565b82525050565b6000602082019050613c806000830184613c5c565b92915050565b600081519050919050565b600082825260208201905092915050565b60005b83811015613cc0578082015181840152602081019050613ca5565b60008484015250505050565b6000601f19601f8301169050919050565b6000613ce882613c86565b613cf28185613c91565b9350613d02818560208601613ca2565b613d0b81613ccc565b840191505092915050565b60006020820190508181036000830152613d308184613cdd565b905092915050565b6000819050919050565b613d4b81613d38565b8114613d5657600080fd5b50565b600081359050613d6881613d42565b92915050565b600060208284031215613d8457613d83613bc1565b5b6000613d9284828501613d59565b91505092915050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000613dc682613d9b565b9050919050565b613dd681613dbb565b82525050565b6000602082019050613df16000830184613dcd565b92915050565b613e0081613dbb565b8114613e0b57600080fd5b50565b600081359050613e1d81613df7565b92915050565b60008060408385031215613e3a57613e39613bc1565b5b6000613e4885828601613e0e565b9250506020613e5985828601613d59565b9150509250929050565b613e6c81613d38565b82525050565b6000602082019050613e876000830184613e63565b92915050565b600080600060608486031215613ea657613ea5613bc1565b5b6000613eb486828701613e0e565b9350506020613ec586828701613e0e565b9250506040613ed686828701613d59565b9150509250925092565b60008060408385031215613ef757613ef6613bc1565b5b6000613f0585828601613d59565b9250506020613f1685828601613d59565b9150509250929050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b60048110613f6057613f5f613f20565b5b50565b6000819050613f7182613f4f565b919050565b6000613f8182613f63565b9050919050565b613f9181613f76565b82525050565b6000602082019050613fac6000830184613f88565b92915050565b600080fd5b600080fd5b600080fd5b60008083601f840112613fd757613fd6613fb2565b5b8235905067ffffffffffffffff811115613ff457613ff3613fb7565b5b6020830191508360208202830111156140105761400f613fbc565b5b9250929050565b6000806000604084860312156140305761402f613bc1565b5b600061403e86828701613d59565b935050602084013567ffffffffffffffff81111561405f5761405e613bc6565b5b61406b86828701613fc1565b92509250509250925092565b60006020828403121561408d5761408c613bc1565b5b600061409b84828501613e0e565b91505092915050565b6000819050919050565b60006140c96140c46140bf84613d9b565b6140a4565b613d9b565b9050919050565b60006140db826140ae565b9050919050565b60006140ed826140d0565b9050919050565b6140fd816140e2565b82525050565b600060208201905061411860008301846140f4565b92915050565b61412781613c50565b811461413257600080fd5b50565b6000813590506141448161411e565b92915050565b6000806040838503121561416157614160613bc1565b5b600061416f85828601613e0e565b925050602061418085828601614135565b9150509250929050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6141c282613ccc565b810181811067ffffffffffffffff821117156141e1576141e061418a565b5b80604052505050565b60006141f4613bb7565b905061420082826141b9565b919050565b600067ffffffffffffffff8211156142205761421f61418a565b5b602082029050602081019050919050565b600061424461423f84614205565b6141ea565b9050808382526020820190506020840283018581111561426757614266613fbc565b5b835b81811015614290578061427c8882613e0e565b845260208401935050602081019050614269565b5050509392505050565b600082601f8301126142af576142ae613fb2565b5b81356142bf848260208601614231565b91505092915050565b600080604083850312156142df576142de613bc1565b5b600083013567ffffffffffffffff8111156142fd576142fc613bc6565b5b6143098582860161429a565b925050602061431a85828601614135565b9150509250929050565b600080fd5b600067ffffffffffffffff8211156143445761434361418a565b5b61434d82613ccc565b9050602081019050919050565b82818337600083830152505050565b600061437c61437784614329565b6141ea565b90508281526020810184848401111561439857614397614324565b5b6143a384828561435a565b509392505050565b600082601f8301126143c0576143bf613fb2565b5b81356143d0848260208601614369565b91505092915050565b600080600080608085870312156143f3576143f2613bc1565b5b600061440187828801613e0e565b945050602061441287828801613e0e565b935050604061442387828801613d59565b925050606085013567ffffffffffffffff81111561444457614443613bc6565b5b614450878288016143ab565b91505092959194509250565b60008083601f84011261447257614471613fb2565b5b8235905067ffffffffffffffff81111561448f5761448e613fb7565b5b6020830191508360208202830111156144ab576144aa613fbc565b5b9250929050565b600080600080600080608087890312156144cf576144ce613bc1565b5b60006144dd89828a01613e0e565b96505060206144ee89828a01613e0e565b955050604087013567ffffffffffffffff81111561450f5761450e613bc6565b5b61451b89828a0161445c565b9450945050606087013567ffffffffffffffff81111561453e5761453d613bc6565b5b61454a89828a01613fc1565b92509250509295509295509295565b600060408201905061456e6000830185613e63565b61457b6020830184613dcd565b9392505050565b6000806040838503121561459957614598613bc1565b5b60006145a785828601613e0e565b92505060206145b885828601613e0e565b9150509250929050565b600080fd5b600080fd5b600060c082840312156145e2576145e16145c2565b5b6145ec60c06141ea565b905060006145fc84828501613d59565b600083015250602082013567ffffffffffffffff8111156146205761461f6145c7565b5b61462c848285016143ab565b602083015250604061464084828501613e0e565b604083015250606082013567ffffffffffffffff811115614664576146636145c7565b5b614670848285016143ab565b606083015250608061468484828501613d59565b60808301525060a061469884828501613d59565b60a08301525092915050565b6000806000604084860312156146bd576146bc613bc1565b5b600084013567ffffffffffffffff8111156146db576146da613bc6565b5b6146e7868287016145cc565b935050602084013567ffffffffffffffff81111561470857614707613bc6565b5b61471486828701613fc1565b92509250509250925092565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b6000600282049050600182168061476757607f821691505b60208210810361477a57614779614720565b5b50919050565b60006060820190506147956000830186613dcd565b6147a26020830185613e63565b6147af6040830184613dcd565b949350505050565b600060a0820190506147cc6000830188613dcd565b6147d96020830187613e63565b6147e66040830186613dcd565b6147f36060830185613e63565b6148006080830184613e63565b9695505050505050565b60008151905061481981613df7565b92915050565b60006020828403121561483557614834613bc1565b5b60006148438482850161480a565b91505092915050565b60006040820190506148616000830185613dcd565b61486e6020830184613e63565b9392505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60006040820190506148b96000830185613e63565b6148c66020830184613e63565b9392505050565b600080fd5b600080fd5b600080fd5b600080833560016020038436030381126148f9576148f86148cd565b5b80840192508235915067ffffffffffffffff82111561491b5761491a6148d2565b5b602083019250600182023603831315614937576149366148d7565b5b509250929050565b600061494a82613d9b565b9050919050565b61495a8161493f565b82525050565b600082825260208201905092915050565b600061497d8385614960565b935061498a83858461435a565b61499383613ccc565b840190509392505050565b60006060820190506149b36000830187613e63565b6149c06020830186614951565b81810360408301526149d3818486614971565b905095945050505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b6000614a1882613d38565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8203614a4a57614a496149de565b5b600182019050919050565b7f5061636b644d61696e3a20696e76616c69642073746174650000000000000000600082015250565b6000614a8b601883613c91565b9150614a9682614a55565b602082019050919050565b60006020820190508181036000830152614aba81614a7e565b9050919050565b600081905092915050565b6000614ad782613c86565b614ae18185614ac1565b9350614af1818560208601613ca2565b80840191505092915050565b6000614b098285614acc565b9150614b158284614acc565b91508190509392505050565b50565b6000614b31600083614960565b9150614b3c82614b21565b600082019050919050565b600060c082019050614b5c6000830188613dcd565b614b696020830187613e63565b614b766040830186613dcd565b614b836060830185613e63565b614b906080830184613e63565b81810360a0830152614ba181614b24565b90509695505050505050565b600081905092915050565b6000614bc5600083614bad565b9150614bd082614b21565b600082019050919050565b6000614be682614bb8565b9150819050919050565b6000606082019050614c056000830187613e63565b614c126020830186613dcd565b8181036040830152614c25818486614971565b905095945050505050565b600082825260208201905092915050565b6000819050919050565b614c5481613dbb565b82525050565b6000614c668383614c4b565b60208301905092915050565b6000614c816020840184613e0e565b905092915050565b6000602082019050919050565b6000614ca28385614c30565b9350614cad82614c41565b8060005b85811015614ce657614cc38284614c72565b614ccd8882614c5a565b9750614cd883614c89565b925050600181019050614cb1565b5085925050509392505050565b600082825260208201905092915050565b6000819050919050565b600082825260208201905092915050565b6000614d2b8385614d0e565b9350614d3883858461435a565b614d4183613ccc565b840190509392505050565b6000614d59848484614d1f565b90509392505050565b600080fd5b600080fd5b600080fd5b60008083356001602003843603038112614d8e57614d8d614d6c565b5b83810192508235915060208301925067ffffffffffffffff821115614db657614db5614d62565b5b600182023603831315614dcc57614dcb614d67565b5b509250929050565b6000602082019050919050565b6000614ded8385614cf3565b935083602084028501614dff84614d04565b8060005b87811015614e45578484038952614e1a8284614d71565b614e25868284614d4c565b9550614e3084614dd4565b935060208b019a505050600181019050614e03565b50829750879450505050509392505050565b6000606082019050614e6c6000830188613dcd565b8181036020830152614e7f818688614c96565b90508181036040830152614e94818486614de1565b90509695505050505050565b6000608082019050614eb56000830188613e63565b614ec26020830187613dcd565b614ecf6040830186613dcd565b8181036060830152614ee2818486614971565b90509695505050505050565b600081519050919050565b6000614f0482614eee565b614f0e8185614960565b9350614f1e818560208601613ca2565b614f2781613ccc565b840191505092915050565b6000608082019050614f476000830187613dcd565b614f546020830186613e63565b8181036040830152614f668185614ef9565b9050614f756060830184613e63565b95945050505050565b6000614f91614f8c84614329565b6141ea565b905082815260208101848484011115614fad57614fac614324565b5b614fb8848285613ca2565b509392505050565b600082601f830112614fd557614fd4613fb2565b5b8151614fe5848260208601614f7e565b91505092915050565b60006020828403121561500457615003613bc1565b5b600082015167ffffffffffffffff81111561502257615021613bc6565b5b61502e84828501614fc0565b91505092915050565b600061504282614eee565b61504c8185614bad565b935061505c818560208601613ca2565b80840191505092915050565b60006150748284615037565b915081905092915050565b60006080820190506150946000830187613dcd565b6150a16020830186613dcd565b6150ae6040830185613e63565b81810360608301526150c08184614ef9565b905095945050505050565b6000815190506150da81613bf7565b92915050565b6000602082840312156150f6576150f5613bc1565b5b6000615104848285016150cb565b91505092915050565b6000819050919050565b61512861512382613d38565b61510d565b82525050565b60008160601b9050919050565b60006151468261512e565b9050919050565b60006151588261513b565b9050919050565b61517061516b82613dbb565b61514d565b82525050565b60006151828288615117565b602082019150615192828761515f565b6014820191506151a28286615117565b6020820191506151b28285615117565b6020820191506151c2828461515f565b6014820191508190509695505050505050565b60006151e18288615117565b6020820191506151f18287615117565b6020820191506152018286615117565b6020820191506152118285615117565b602082019150615221828461515f565b6014820191508190509695505050505050565b600061523f82613d38565b915061524a83613d38565b9250828203905081811115615262576152616149de565b5b92915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603160045260246000fd5b6000819050919050565b6152aa81615297565b82525050565b60006040820190506152c560008301856152a1565b81810360208301526152d78184614ef9565b90509392505050565b6152e981615297565b81146152f457600080fd5b50565b600081519050615306816152e0565b92915050565b60006020828403121561532257615321613bc1565b5b6000615330848285016152f7565b91505092915050565b600060ff82169050919050565b61534f81615339565b82525050565b600060808201905061536a60008301876152a1565b6153776020830186615346565b61538460408301856152a1565b61539160608301846152a1565b9594505050505056fea2646970667358221220dbbe4b371de1d0e4e6514355a1f23a42e483fe2edd2875cb3cc142dfc251a16c64736f6c63430008140033000000000000000000000000840c1b6ce85bbfebcfad737514c0097b078a7e7e0000000000000000000000000000000000000000000000000000000000000120000000000000000000000000000000000000000000000000000000000000016000000000000000000000000000000000000000000000000000000000000001a000000000000000000000000016de95d9199fceb3546565909eb52a4726b14311000000000000000000000000804bcb3b87f93ec42b672cda3f88a1978d6e884f00000000000000000000000000000000000000000000000000000000000000fc000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001e0000000000000000000000000000000000000000000000000000000000000001168747470733a2f2f7061636b642e696f2f00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000085061636b4d61696e000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000350434b0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000200000000000000000000000024c23a634dc1dd033dc2b2063bc689bd35be610f000000000000000000000000b11011307e0f3c805387c10aa69f874244b1bec3
Deployed Bytecode
0x60806040526004361061020f5760003560e01c806370a0823111610118578063bfa0b133116100a0578063d48c94a81161006f578063d48c94a814610823578063e985e9c514610854578063f2fde38b14610891578063fa757b9a146108ba578063ffa1ad74146108e35761020f565b8063bfa0b13314610753578063c26d20d31461077e578063c87b56dd146107bb578063d3f43c78146107f85761020f565b806395d89b41116100e757806395d89b4114610670578063a22cb4651461069b578063a25c4aef146106c4578063b2ddcab4146106ed578063b88d4fde1461072a5761020f565b806370a08231146105c6578063715018a6146106035780637b1039991461061a5780638da5cb5b146106455761020f565b80632dd7c6581161019b5780634f5e74c21161016a5780634f5e74c2146104bb5780634f6ccce7146104f85780635c184796146105355780635c60da1b1461055e5780636352211e146105895761020f565b80632dd7c658146103db5780632f745c59146104185780633664cd3f1461045557806342842e0e146104925761020f565b806318160ddd116101e257806318160ddd146102e257806318e3ab571461030d57806322e06ae01461033857806323b872dd14610375578063275e0a881461039e5761020f565b806301ffc9a71461021457806306fdde0314610251578063081812fc1461027c578063095ea7b3146102b9575b600080fd5b34801561022057600080fd5b5061023b60048036038101906102369190613c23565b61090e565b6040516102489190613c6b565b60405180910390f35b34801561025d57600080fd5b50610266610920565b6040516102739190613d16565b60405180910390f35b34801561028857600080fd5b506102a3600480360381019061029e9190613d6e565b6109b2565b6040516102b09190613ddc565b60405180910390f35b3480156102c557600080fd5b506102e060048036038101906102db9190613e23565b6109ce565b005b3480156102ee57600080fd5b506102f76109e4565b6040516103049190613e72565b60405180910390f35b34801561031957600080fd5b506103226109f1565b60405161032f9190613e72565b60405180910390f35b34801561034457600080fd5b5061035f600480360381019061035a9190613d6e565b610a15565b60405161036c9190613d16565b60405180910390f35b34801561038157600080fd5b5061039c60048036038101906103979190613e8d565b610ab5565b005b3480156103aa57600080fd5b506103c560048036038101906103c09190613ee0565b610bb7565b6040516103d29190613ddc565b60405180910390f35b3480156103e757600080fd5b5061040260048036038101906103fd9190613d6e565b610c05565b60405161040f9190613ddc565b60405180910390f35b34801561042457600080fd5b5061043f600480360381019061043a9190613e23565b610d10565b60405161044c9190613e72565b60405180910390f35b34801561046157600080fd5b5061047c60048036038101906104779190613d6e565b610db9565b6040516104899190613f97565b60405180910390f35b34801561049e57600080fd5b506104b960048036038101906104b49190613e8d565b610dd9565b005b3480156104c757600080fd5b506104e260048036038101906104dd9190613d6e565b610df9565b6040516104ef9190613e72565b60405180910390f35b34801561050457600080fd5b5061051f600480360381019061051a9190613d6e565b610e11565b60405161052c9190613e72565b60405180910390f35b34801561054157600080fd5b5061055c60048036038101906105579190614017565b610e87565b005b34801561056a57600080fd5b506105736111c7565b6040516105809190613ddc565b60405180910390f35b34801561059557600080fd5b506105b060048036038101906105ab9190613d6e565b6111eb565b6040516105bd9190613ddc565b60405180910390f35b3480156105d257600080fd5b506105ed60048036038101906105e89190614077565b6111fd565b6040516105fa9190613e72565b60405180910390f35b34801561060f57600080fd5b506106186112b7565b005b34801561062657600080fd5b5061062f6112cb565b60405161063c9190614103565b60405180910390f35b34801561065157600080fd5b5061065a6112ef565b6040516106679190613ddc565b60405180910390f35b34801561067c57600080fd5b50610685611319565b6040516106929190613d16565b60405180910390f35b3480156106a757600080fd5b506106c260048036038101906106bd919061414a565b6113ab565b005b3480156106d057600080fd5b506106eb60048036038101906106e691906142c8565b6113c1565b005b3480156106f957600080fd5b50610714600480360381019061070f9190613d6e565b61145e565b6040516107219190613ddc565b60405180910390f35b34801561073657600080fd5b50610751600480360381019061074c91906143d9565b611491565b005b34801561075f57600080fd5b506107686114ae565b6040516107759190613e72565b60405180910390f35b34801561078a57600080fd5b506107a560048036038101906107a09190614077565b6114d2565b6040516107b29190613c6b565b60405180910390f35b3480156107c757600080fd5b506107e260048036038101906107dd9190613d6e565b6114f2565b6040516107ef9190613d16565b60405180910390f35b34801561080457600080fd5b5061080d611641565b60405161081a9190613e72565b60405180910390f35b61083d600480360381019061083891906144b2565b611646565b60405161084b929190614559565b60405180910390f35b34801561086057600080fd5b5061087b60048036038101906108769190614582565b611b52565b6040516108889190613c6b565b60405180910390f35b34801561089d57600080fd5b506108b860048036038101906108b39190614077565b611be6565b005b3480156108c657600080fd5b506108e160048036038101906108dc91906146a4565b611c6c565b005b3480156108ef57600080fd5b506108f8611f02565b6040516109059190613e72565b60405180910390f35b600061091982611f07565b9050919050565b60606000805461092f9061474f565b80601f016020809104026020016040519081016040528092919081815260200182805461095b9061474f565b80156109a85780601f1061097d576101008083540402835291602001916109a8565b820191906000526020600020905b81548152906001019060200180831161098b57829003601f168201915b5050505050905090565b60006109bd82611f81565b506109c782612009565b9050919050565b6109e082826109db612046565b61204e565b5050565b6000600880549050905090565b7f00000000000000000000000000000000000000000000000000000000000000fc81565b600d6020528060005260406000206000915090508054610a349061474f565b80601f0160208091040260200160405190810160405280929190818152602001828054610a609061474f565b8015610aad5780601f10610a8257610100808354040283529160200191610aad565b820191906000526020600020905b815481529060010190602001808311610a9057829003601f168201915b505050505081565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1603610b275760006040517f64a0ae92000000000000000000000000000000000000000000000000000000008152600401610b1e9190613ddc565b60405180910390fd5b6000610b3b8383610b36612046565b612060565b90508373ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614610bb1578382826040517f64283d7b000000000000000000000000000000000000000000000000000000008152600401610ba893929190614780565b60405180910390fd5b50505050565b60116020528160005260406000208181548110610bd357600080fd5b906000526020600020016000915091509054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60007f00000000000000000000000016de95d9199fceb3546565909eb52a4726b1431173ffffffffffffffffffffffffffffffffffffffff16635e9bc5367f000000000000000000000000804bcb3b87f93ec42b672cda3f88a1978d6e884f7f00000000000000000000000000000000000000000000000000000000000000fc30867f00000000000000000000000000000000000000000000000000000000000000006040518663ffffffff1660e01b8152600401610cc89594939291906147b7565b602060405180830381865afa158015610ce5573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d09919061481f565b9050919050565b6000610d1b836111fd565b8210610d605782826040517fa57d13dc000000000000000000000000000000000000000000000000000000008152600401610d5792919061484c565b60405180910390fd5b600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600083815260200190815260200160002054905092915050565b600c6020528060005260406000206000915054906101000a900460ff1681565b610df483838360405180602001604052806000815250611491565b505050565b600e6020528060005260406000206000915090505481565b6000610e1b6109e4565b8210610e61576000826040517fa57d13dc000000000000000000000000000000000000000000000000000000008152600401610e5892919061484c565b60405180910390fd5b60088281548110610e7557610e74614875565b5b90600052602060002001549050919050565b823373ffffffffffffffffffffffffffffffffffffffff16610ea8826111eb565b73ffffffffffffffffffffffffffffffffffffffff1614610f0057806040517fcd5e32e2000000000000000000000000000000000000000000000000000000008152600401610ef79190613e72565b60405180910390fd5b836001806003811115610f1657610f15613f20565b5b600c600084815260200190815260200160002060009054906101000a900460ff166003811115610f4957610f48613f20565b5b14610f8b57816040517ff7453f0b000000000000000000000000000000000000000000000000000000008152600401610f829190613e72565b60405180910390fd5b60116000878152602001908152602001600020805490508585905014611003576011600087815260200190815260200160002080549050858590506040517f4fb53a3c000000000000000000000000000000000000000000000000000000008152600401610ffa9291906148a4565b60405180910390fd5b61100c86612076565b600061101787610c05565b905060008173ffffffffffffffffffffffffffffffffffffffff163190506110408233836120be565b60005b601160008a81526020019081526020016000208054905081101561118457611170601160008b8152602001908152602001600020828154811061108957611088614875565b5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168a858b8b868181106110c9576110c8614875565b5b90506020028101906110db91906148dc565b6040516024016110ee949392919061499e565b6040516020818303038152906040527ff37e724e000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff83818316178352505050506121e1565b50808061117c90614a0d565b915050611043565b50877f3ed29fb64fa945b8356199704a51c1da5e7717064a5848e693f31c84fc6c806e336040516111b59190613ddc565b60405180910390a25050505050505050565b7f000000000000000000000000804bcb3b87f93ec42b672cda3f88a1978d6e884f81565b60006111f682611f81565b9050919050565b60008073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16036112705760006040517f89c62b640000000000000000000000000000000000000000000000000000000081526004016112679190613ddc565b60405180910390fd5b600360008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b6112bf612265565b6112c960006122ec565b565b7f00000000000000000000000016de95d9199fceb3546565909eb52a4726b1431181565b6000600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b6060600180546113289061474f565b80601f01602080910402602001604051908101604052809291908181526020018280546113549061474f565b80156113a15780601f10611376576101008083540402835291602001916113a1565b820191906000526020600020905b81548152906001019060200180831161138457829003601f168201915b5050505050905090565b6113bd6113b6612046565b83836123b2565b5050565b6113c9612265565b60005b82518110156114595781601260008584815181106113ed576113ec614875565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550808061145190614a0d565b9150506113cc565b505050565b60106020528060005260406000206000915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b61149c848484610ab5565b6114a884848484612521565b50505050565b7f000000000000000000000000000000000000000000000000000000000000000081565b60126020528060005260406000206000915054906101000a900460ff1681565b60606000600c600084815260200190815260200160002060009054906101000a900460ff1690506000600d600083600381111561153257611531613f20565b5b8152602001908152602001600020805461154b9061474f565b80601f01602080910402602001604051908101604052809291908181526020018280546115779061474f565b80156115c45780601f10611599576101008083540402835291602001916115c4565b820191906000526020600020905b8154815290600101906020018083116115a757829003601f168201915b50505050509050600081511161160f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161160690614aa1565b60405180910390fd5b6116176126d8565b81604051602001611629929190614afd565b60405160208183030381529060405292505050919050565b600081565b60008060005b86869050811015611746576012600088888481811061166e5761166d614875565b5b90506020020160208101906116839190614077565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16611733578686828181106116e2576116e1614875565b5b90506020020160208101906116f79190614077565b6040517f486c037400000000000000000000000000000000000000000000000000000000815260040161172a9190613ddc565b60405180910390fd5b808061173e90614a0d565b91505061164c565b508383905086869050146117995785859050848490506040517f4fb53a3c0000000000000000000000000000000000000000000000000000000081526004016117909291906148a4565b60405180910390fd5b600034036117d3576040517f715a6e9e00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6117dc8861276a565b9150866010600084815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508585601160008581526020019081526020016000209190611852929190613afa565b507f00000000000000000000000016de95d9199fceb3546565909eb52a4726b1431173ffffffffffffffffffffffffffffffffffffffff1663da7323b37f000000000000000000000000804bcb3b87f93ec42b672cda3f88a1978d6e884f7f00000000000000000000000000000000000000000000000000000000000000fc30867f00000000000000000000000000000000000000000000000000000000000000006040518663ffffffff1660e01b8152600401611914959493929190614b47565b6020604051808303816000875af1158015611933573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611957919061481f565b905060008173ffffffffffffffffffffffffffffffffffffffff163460405161197f90614bdb565b60006040518083038185875af1925050503d80600081146119bc576040519150601f19603f3d011682016040523d82523d6000602084013e6119c1565b606091505b50509050806119fc576040517f6747a28800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60005b87879050811015611b0557611af1888883818110611a2057611a1f614875565b5b9050602002016020810190611a359190614077565b8585898986818110611a4a57611a49614875565b5b9050602002810190611a5c91906148dc565b604051602401611a6f9493929190614bf0565b6040516020818303038152906040527fc56d786e000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff83818316178352505050506121e1565b508080611afd90614a0d565b9150506119ff565b50827fe271f0bfd48981060c91facb315d1aac41e5ef90698ffbc1e5886dbc6dd86ec58a89898989604051611b3e959493929190614e57565b60405180910390a250965096945050505050565b6000600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16905092915050565b611bee612265565b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1603611c605760006040517f1e4fbdf7000000000000000000000000000000000000000000000000000000008152600401611c579190613ddc565b60405180910390fd5b611c69816122ec565b50565b82600001516001806003811115611c8657611c85613f20565b5b600c600084815260200190815260200160002060009054906101000a900460ff166003811115611cb957611cb8613f20565b5b14611cfb57816040517ff7453f0b000000000000000000000000000000000000000000000000000000008152600401611cf29190613e72565b60405180910390fd5b611d04856127e8565b8460a0015185608001511115611d46576040517f25fef44e00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b611d538560000151612870565b60005b601160008760000151815260200190815260200160002080549050811015611eb557611ea160116000886000015181526020019081526020016000208281548110611da457611da3614875565b5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168760000151611de18960000151610c05565b8960400151898987818110611df957611df8614875565b5b9050602002810190611e0b91906148dc565b604051602401611e1f959493929190614ea0565b6040516020818303038152906040527f15a3966f000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff83818316178352505050506121e1565b508080611ead90614a0d565b915050611d56565b50611ebf856128af565b84600001517f86ed3e19f8d5b64492a8aa542a0268f79413b19b2f76dcff5b71469d603444e633604051611ef39190613ddc565b60405180910390a25050505050565b600181565b60007f780e9d63000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19161480611f7a5750611f79826128ff565b5b9050919050565b600080611f8d836129e1565b9050600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff160361200057826040517f7e273289000000000000000000000000000000000000000000000000000000008152600401611ff79190613e72565b60405180910390fd5b80915050919050565b60006004600083815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050919050565b600033905090565b61205b8383836001612a1e565b505050565b600061206d848484612be3565b90509392505050565b61207f81612d00565b6003600c600083815260200190815260200160002060006101000a81548160ff021916908360038111156120b6576120b5613f20565b5b021790555050565b600082826040516024016120d392919061484c565b6040516020818303038152906040527fa9059cbb000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff838183161783525050505090508373ffffffffffffffffffffffffffffffffffffffff166374420f4c84848460006040518563ffffffff1660e01b81526004016121929493929190614f32565b6000604051808303816000875af11580156121b1573d6000803e3d6000fd5b505050506040513d6000823e3d601f19601f820116820180604052508101906121da9190614fee565b5050505050565b60606000808473ffffffffffffffffffffffffffffffffffffffff168460405161220b9190615068565b600060405180830381855af49150503d8060008114612246576040519150601f19603f3d011682016040523d82523d6000602084013e61224b565b606091505b509150915061225b858383612d86565b9250505092915050565b61226d612046565b73ffffffffffffffffffffffffffffffffffffffff1661228b6112ef565b73ffffffffffffffffffffffffffffffffffffffff16146122ea576122ae612046565b6040517f118cdaa70000000000000000000000000000000000000000000000000000000081526004016122e19190613ddc565b60405180910390fd5b565b6000600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905081600f60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff160361242357816040517f5b08ba1800000000000000000000000000000000000000000000000000000000815260040161241a9190613ddc565b60405180910390fd5b80600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31836040516125149190613c6b565b60405180910390a3505050565b60008373ffffffffffffffffffffffffffffffffffffffff163b11156126d2578273ffffffffffffffffffffffffffffffffffffffff1663150b7a02612565612046565b8685856040518563ffffffff1660e01b8152600401612587949392919061507f565b6020604051808303816000875af19250505080156125c357506040513d601f19601f820116820180604052508101906125c091906150e0565b60015b612647573d80600081146125f3576040519150601f19603f3d011682016040523d82523d6000602084013e6125f8565b606091505b50600081510361263f57836040517f64a0ae920000000000000000000000000000000000000000000000000000000081526004016126369190613ddc565b60405180910390fd5b805181602001fd5b63150b7a0260e01b7bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916817bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916146126d057836040517f64a0ae920000000000000000000000000000000000000000000000000000000081526004016126c79190613ddc565b60405180910390fd5b505b50505050565b6060600b80546126e79061474f565b80601f01602080910402602001604051908101604052809291908181526020018280546127139061474f565b80156127605780601f1061273557610100808354040283529160200191612760565b820191906000526020600020905b81548152906001019060200180831161274357829003601f168201915b5050505050905090565b6000600a600081548092919061277f90614a0d565b91905055905061278f8282612e15565b6001600c600083815260200190815260200160002060006101000a81548160ff021916908360038111156127c6576127c5613f20565b5b021790555043600e600083815260200190815260200160002081905550919050565b61286c817f00000000000000000000000000000000000000000000000000000000000000fc7f000000000000000000000000000000000000000000000000000000000000000030601060008760000151815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16612e33565b5050565b6002600c600083815260200190815260200160002060006101000a81548160ff021916908360038111156128a7576128a6613f20565b5b021790555050565b60006128be8260000151610c05565b90506128cf813384608001516120be565b60008173ffffffffffffffffffffffffffffffffffffffff163190506128fa828460400151836120be565b505050565b60007f80ac58cd000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191614806129ca57507f5b5e139f000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916145b806129da57506129d982612f57565b5b9050919050565b60006002600083815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050919050565b8080612a575750600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15612b8b576000612a6784611f81565b9050600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614158015612ad257508273ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614155b8015612ae55750612ae38184611b52565b155b15612b2757826040517fa9fbf51f000000000000000000000000000000000000000000000000000000008152600401612b1e9190613ddc565b60405180910390fd5b8115612b8957838573ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45b505b836004600085815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050505050565b600080612bf1858585612fc1565b9050600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1603612c3557612c30846131db565b612c74565b8473ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614612c7357612c728185613224565b5b5b600073ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff1603612cb657612cb184613385565b612cf5565b8473ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614612cf457612cf38585613456565b5b5b809150509392505050565b6000612d0f6000836000612060565b9050600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1603612d8257816040517f7e273289000000000000000000000000000000000000000000000000000000008152600401612d799190613e72565b60405180910390fd5b5050565b606082612d9b57612d96826134e1565b612e0d565b60008251148015612dc3575060008473ffffffffffffffffffffffffffffffffffffffff163b145b15612e0557836040517f9996b315000000000000000000000000000000000000000000000000000000008152600401612dfc9190613ddc565b60405180910390fd5b819050612e0e565b5b9392505050565b612e2f828260405180602001604052806000815250613526565b5050565b600080612e7587600001518860400151888888604051602001612e5a959493929190615176565b60405160208183030381529060405280519060200120613542565b9050612e8683828960200151613578565b612ebc576040517f38a85a8d00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6000612efd88600001518960a00151898989604051602001612ee29594939291906151d5565b60405160208183030381529060405280519060200120613542565b9050612f128860400151828a60600151613578565b612f48576040517f36ae61d500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60019250505095945050505050565b60007f01ffc9a7000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916149050919050565b600080612fcd846129e1565b9050600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161461300f5761300e818486613608565b5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16146130a057613051600085600080612a1e565b6001600360008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825403925050819055505b600073ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff1614613123576001600360008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825401925050819055505b846002600086815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550838573ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60405160405180910390a4809150509392505050565b6008805490506009600083815260200190815260200160002081905550600881908060018154018082558091505060019003906000526020600020016000909190919091505550565b600061322f836111fd565b9050600060076000848152602001908152602001600020549050818114613314576000600660008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600084815260200190815260200160002054905080600660008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600084815260200190815260200160002081905550816007600083815260200190815260200160002081905550505b6007600084815260200190815260200160002060009055600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008381526020019081526020016000206000905550505050565b600060016008805490506133999190615234565b90506000600960008481526020019081526020016000205490506000600883815481106133c9576133c8614875565b5b9060005260206000200154905080600883815481106133eb576133ea614875565b5b90600052602060002001819055508160096000838152602001908152602001600020819055506009600085815260200190815260200160002060009055600880548061343a57613439615268565b5b6001900381819060005260206000200160009055905550505050565b60006001613463846111fd565b61346d9190615234565b905081600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600083815260200190815260200160002081905550806007600084815260200190815260200160002081905550505050565b6000815111156134f45780518082602001fd5b6040517f1425ea4200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b61353083836136cc565b61353d6000848484612521565b505050565b60007f19457468657265756d205369676e6564204d6573736167653a0a33320000000060005281601c52603c6000209050919050565b600080600061358785856137c5565b5091509150600060038111156135a05761359f613f20565b5b8160038111156135b3576135b2613f20565b5b1480156135eb57508573ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16145b806135fd57506135fc868686613821565b5b925050509392505050565b613613838383613945565b6136c757600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff160361368857806040517f7e27328900000000000000000000000000000000000000000000000000000000815260040161367f9190613e72565b60405180910390fd5b81816040517f177e802f0000000000000000000000000000000000000000000000000000000081526004016136be92919061484c565b60405180910390fd5b505050565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff160361373e5760006040517f64a0ae920000000000000000000000000000000000000000000000000000000081526004016137359190613ddc565b60405180910390fd5b600061374c83836000612060565b9050600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16146137c05760006040517f73c6ac6e0000000000000000000000000000000000000000000000000000000081526004016137b79190613ddc565b60405180910390fd5b505050565b6000806000604184510361380a5760008060006020870151925060408701519150606087015160001a90506137fc88828585613a06565b95509550955050505061381a565b60006002855160001b9250925092505b9250925092565b60008060008573ffffffffffffffffffffffffffffffffffffffff1685856040516024016138509291906152b0565b604051602081830303815290604052631626ba7e60e01b6020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff83818316178352505050506040516138a29190615068565b600060405180830381855afa9150503d80600081146138dd576040519150601f19603f3d011682016040523d82523d6000602084013e6138e2565b606091505b50915091508180156138f657506020815110155b801561393a5750631626ba7e60e01b7bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191681806020019051810190613938919061530c565b145b925050509392505050565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141580156139fd57508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614806139be57506139bd8484611b52565b5b806139fc57508273ffffffffffffffffffffffffffffffffffffffff166139e483612009565b73ffffffffffffffffffffffffffffffffffffffff16145b5b90509392505050565b60008060007f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a08460001c1115613a46576000600385925092509250613af0565b600060018888888860405160008152602001604052604051613a6b9493929190615355565b6020604051602081039080840390855afa158015613a8d573d6000803e3d6000fd5b505050602060405103519050600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1603613ae157600060016000801b93509350935050613af0565b8060008060001b935093509350505b9450945094915050565b828054828255906000526020600020908101928215613b89579160200282015b82811115613b8857823573ffffffffffffffffffffffffffffffffffffffff168260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555091602001919060010190613b1a565b5b509050613b969190613b9a565b5090565b5b80821115613bb3576000816000905550600101613b9b565b5090565b6000604051905090565b600080fd5b600080fd5b60007fffffffff0000000000000000000000000000000000000000000000000000000082169050919050565b613c0081613bcb565b8114613c0b57600080fd5b50565b600081359050613c1d81613bf7565b92915050565b600060208284031215613c3957613c38613bc1565b5b6000613c4784828501613c0e565b91505092915050565b60008115159050919050565b613c6581613c50565b82525050565b6000602082019050613c806000830184613c5c565b92915050565b600081519050919050565b600082825260208201905092915050565b60005b83811015613cc0578082015181840152602081019050613ca5565b60008484015250505050565b6000601f19601f8301169050919050565b6000613ce882613c86565b613cf28185613c91565b9350613d02818560208601613ca2565b613d0b81613ccc565b840191505092915050565b60006020820190508181036000830152613d308184613cdd565b905092915050565b6000819050919050565b613d4b81613d38565b8114613d5657600080fd5b50565b600081359050613d6881613d42565b92915050565b600060208284031215613d8457613d83613bc1565b5b6000613d9284828501613d59565b91505092915050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000613dc682613d9b565b9050919050565b613dd681613dbb565b82525050565b6000602082019050613df16000830184613dcd565b92915050565b613e0081613dbb565b8114613e0b57600080fd5b50565b600081359050613e1d81613df7565b92915050565b60008060408385031215613e3a57613e39613bc1565b5b6000613e4885828601613e0e565b9250506020613e5985828601613d59565b9150509250929050565b613e6c81613d38565b82525050565b6000602082019050613e876000830184613e63565b92915050565b600080600060608486031215613ea657613ea5613bc1565b5b6000613eb486828701613e0e565b9350506020613ec586828701613e0e565b9250506040613ed686828701613d59565b9150509250925092565b60008060408385031215613ef757613ef6613bc1565b5b6000613f0585828601613d59565b9250506020613f1685828601613d59565b9150509250929050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b60048110613f6057613f5f613f20565b5b50565b6000819050613f7182613f4f565b919050565b6000613f8182613f63565b9050919050565b613f9181613f76565b82525050565b6000602082019050613fac6000830184613f88565b92915050565b600080fd5b600080fd5b600080fd5b60008083601f840112613fd757613fd6613fb2565b5b8235905067ffffffffffffffff811115613ff457613ff3613fb7565b5b6020830191508360208202830111156140105761400f613fbc565b5b9250929050565b6000806000604084860312156140305761402f613bc1565b5b600061403e86828701613d59565b935050602084013567ffffffffffffffff81111561405f5761405e613bc6565b5b61406b86828701613fc1565b92509250509250925092565b60006020828403121561408d5761408c613bc1565b5b600061409b84828501613e0e565b91505092915050565b6000819050919050565b60006140c96140c46140bf84613d9b565b6140a4565b613d9b565b9050919050565b60006140db826140ae565b9050919050565b60006140ed826140d0565b9050919050565b6140fd816140e2565b82525050565b600060208201905061411860008301846140f4565b92915050565b61412781613c50565b811461413257600080fd5b50565b6000813590506141448161411e565b92915050565b6000806040838503121561416157614160613bc1565b5b600061416f85828601613e0e565b925050602061418085828601614135565b9150509250929050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6141c282613ccc565b810181811067ffffffffffffffff821117156141e1576141e061418a565b5b80604052505050565b60006141f4613bb7565b905061420082826141b9565b919050565b600067ffffffffffffffff8211156142205761421f61418a565b5b602082029050602081019050919050565b600061424461423f84614205565b6141ea565b9050808382526020820190506020840283018581111561426757614266613fbc565b5b835b81811015614290578061427c8882613e0e565b845260208401935050602081019050614269565b5050509392505050565b600082601f8301126142af576142ae613fb2565b5b81356142bf848260208601614231565b91505092915050565b600080604083850312156142df576142de613bc1565b5b600083013567ffffffffffffffff8111156142fd576142fc613bc6565b5b6143098582860161429a565b925050602061431a85828601614135565b9150509250929050565b600080fd5b600067ffffffffffffffff8211156143445761434361418a565b5b61434d82613ccc565b9050602081019050919050565b82818337600083830152505050565b600061437c61437784614329565b6141ea565b90508281526020810184848401111561439857614397614324565b5b6143a384828561435a565b509392505050565b600082601f8301126143c0576143bf613fb2565b5b81356143d0848260208601614369565b91505092915050565b600080600080608085870312156143f3576143f2613bc1565b5b600061440187828801613e0e565b945050602061441287828801613e0e565b935050604061442387828801613d59565b925050606085013567ffffffffffffffff81111561444457614443613bc6565b5b614450878288016143ab565b91505092959194509250565b60008083601f84011261447257614471613fb2565b5b8235905067ffffffffffffffff81111561448f5761448e613fb7565b5b6020830191508360208202830111156144ab576144aa613fbc565b5b9250929050565b600080600080600080608087890312156144cf576144ce613bc1565b5b60006144dd89828a01613e0e565b96505060206144ee89828a01613e0e565b955050604087013567ffffffffffffffff81111561450f5761450e613bc6565b5b61451b89828a0161445c565b9450945050606087013567ffffffffffffffff81111561453e5761453d613bc6565b5b61454a89828a01613fc1565b92509250509295509295509295565b600060408201905061456e6000830185613e63565b61457b6020830184613dcd565b9392505050565b6000806040838503121561459957614598613bc1565b5b60006145a785828601613e0e565b92505060206145b885828601613e0e565b9150509250929050565b600080fd5b600080fd5b600060c082840312156145e2576145e16145c2565b5b6145ec60c06141ea565b905060006145fc84828501613d59565b600083015250602082013567ffffffffffffffff8111156146205761461f6145c7565b5b61462c848285016143ab565b602083015250604061464084828501613e0e565b604083015250606082013567ffffffffffffffff811115614664576146636145c7565b5b614670848285016143ab565b606083015250608061468484828501613d59565b60808301525060a061469884828501613d59565b60a08301525092915050565b6000806000604084860312156146bd576146bc613bc1565b5b600084013567ffffffffffffffff8111156146db576146da613bc6565b5b6146e7868287016145cc565b935050602084013567ffffffffffffffff81111561470857614707613bc6565b5b61471486828701613fc1565b92509250509250925092565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b6000600282049050600182168061476757607f821691505b60208210810361477a57614779614720565b5b50919050565b60006060820190506147956000830186613dcd565b6147a26020830185613e63565b6147af6040830184613dcd565b949350505050565b600060a0820190506147cc6000830188613dcd565b6147d96020830187613e63565b6147e66040830186613dcd565b6147f36060830185613e63565b6148006080830184613e63565b9695505050505050565b60008151905061481981613df7565b92915050565b60006020828403121561483557614834613bc1565b5b60006148438482850161480a565b91505092915050565b60006040820190506148616000830185613dcd565b61486e6020830184613e63565b9392505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60006040820190506148b96000830185613e63565b6148c66020830184613e63565b9392505050565b600080fd5b600080fd5b600080fd5b600080833560016020038436030381126148f9576148f86148cd565b5b80840192508235915067ffffffffffffffff82111561491b5761491a6148d2565b5b602083019250600182023603831315614937576149366148d7565b5b509250929050565b600061494a82613d9b565b9050919050565b61495a8161493f565b82525050565b600082825260208201905092915050565b600061497d8385614960565b935061498a83858461435a565b61499383613ccc565b840190509392505050565b60006060820190506149b36000830187613e63565b6149c06020830186614951565b81810360408301526149d3818486614971565b905095945050505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b6000614a1882613d38565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8203614a4a57614a496149de565b5b600182019050919050565b7f5061636b644d61696e3a20696e76616c69642073746174650000000000000000600082015250565b6000614a8b601883613c91565b9150614a9682614a55565b602082019050919050565b60006020820190508181036000830152614aba81614a7e565b9050919050565b600081905092915050565b6000614ad782613c86565b614ae18185614ac1565b9350614af1818560208601613ca2565b80840191505092915050565b6000614b098285614acc565b9150614b158284614acc565b91508190509392505050565b50565b6000614b31600083614960565b9150614b3c82614b21565b600082019050919050565b600060c082019050614b5c6000830188613dcd565b614b696020830187613e63565b614b766040830186613dcd565b614b836060830185613e63565b614b906080830184613e63565b81810360a0830152614ba181614b24565b90509695505050505050565b600081905092915050565b6000614bc5600083614bad565b9150614bd082614b21565b600082019050919050565b6000614be682614bb8565b9150819050919050565b6000606082019050614c056000830187613e63565b614c126020830186613dcd565b8181036040830152614c25818486614971565b905095945050505050565b600082825260208201905092915050565b6000819050919050565b614c5481613dbb565b82525050565b6000614c668383614c4b565b60208301905092915050565b6000614c816020840184613e0e565b905092915050565b6000602082019050919050565b6000614ca28385614c30565b9350614cad82614c41565b8060005b85811015614ce657614cc38284614c72565b614ccd8882614c5a565b9750614cd883614c89565b925050600181019050614cb1565b5085925050509392505050565b600082825260208201905092915050565b6000819050919050565b600082825260208201905092915050565b6000614d2b8385614d0e565b9350614d3883858461435a565b614d4183613ccc565b840190509392505050565b6000614d59848484614d1f565b90509392505050565b600080fd5b600080fd5b600080fd5b60008083356001602003843603038112614d8e57614d8d614d6c565b5b83810192508235915060208301925067ffffffffffffffff821115614db657614db5614d62565b5b600182023603831315614dcc57614dcb614d67565b5b509250929050565b6000602082019050919050565b6000614ded8385614cf3565b935083602084028501614dff84614d04565b8060005b87811015614e45578484038952614e1a8284614d71565b614e25868284614d4c565b9550614e3084614dd4565b935060208b019a505050600181019050614e03565b50829750879450505050509392505050565b6000606082019050614e6c6000830188613dcd565b8181036020830152614e7f818688614c96565b90508181036040830152614e94818486614de1565b90509695505050505050565b6000608082019050614eb56000830188613e63565b614ec26020830187613dcd565b614ecf6040830186613dcd565b8181036060830152614ee2818486614971565b90509695505050505050565b600081519050919050565b6000614f0482614eee565b614f0e8185614960565b9350614f1e818560208601613ca2565b614f2781613ccc565b840191505092915050565b6000608082019050614f476000830187613dcd565b614f546020830186613e63565b8181036040830152614f668185614ef9565b9050614f756060830184613e63565b95945050505050565b6000614f91614f8c84614329565b6141ea565b905082815260208101848484011115614fad57614fac614324565b5b614fb8848285613ca2565b509392505050565b600082601f830112614fd557614fd4613fb2565b5b8151614fe5848260208601614f7e565b91505092915050565b60006020828403121561500457615003613bc1565b5b600082015167ffffffffffffffff81111561502257615021613bc6565b5b61502e84828501614fc0565b91505092915050565b600061504282614eee565b61504c8185614bad565b935061505c818560208601613ca2565b80840191505092915050565b60006150748284615037565b915081905092915050565b60006080820190506150946000830187613dcd565b6150a16020830186613dcd565b6150ae6040830185613e63565b81810360608301526150c08184614ef9565b905095945050505050565b6000815190506150da81613bf7565b92915050565b6000602082840312156150f6576150f5613bc1565b5b6000615104848285016150cb565b91505092915050565b6000819050919050565b61512861512382613d38565b61510d565b82525050565b60008160601b9050919050565b60006151468261512e565b9050919050565b60006151588261513b565b9050919050565b61517061516b82613dbb565b61514d565b82525050565b60006151828288615117565b602082019150615192828761515f565b6014820191506151a28286615117565b6020820191506151b28285615117565b6020820191506151c2828461515f565b6014820191508190509695505050505050565b60006151e18288615117565b6020820191506151f18287615117565b6020820191506152018286615117565b6020820191506152118285615117565b602082019150615221828461515f565b6014820191508190509695505050505050565b600061523f82613d38565b915061524a83613d38565b9250828203905081811115615262576152616149de565b5b92915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603160045260246000fd5b6000819050919050565b6152aa81615297565b82525050565b60006040820190506152c560008301856152a1565b81810360208301526152d78184614ef9565b90509392505050565b6152e981615297565b81146152f457600080fd5b50565b600081519050615306816152e0565b92915050565b60006020828403121561532257615321613bc1565b5b6000615330848285016152f7565b91505092915050565b600060ff82169050919050565b61534f81615339565b82525050565b600060808201905061536a60008301876152a1565b6153776020830186615346565b61538460408301856152a1565b61539160608301846152a1565b9594505050505056fea2646970667358221220dbbe4b371de1d0e4e6514355a1f23a42e483fe2edd2875cb3cc142dfc251a16c64736f6c63430008140033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
000000000000000000000000840c1b6ce85bbfebcfad737514c0097b078a7e7e0000000000000000000000000000000000000000000000000000000000000120000000000000000000000000000000000000000000000000000000000000016000000000000000000000000000000000000000000000000000000000000001a000000000000000000000000016de95d9199fceb3546565909eb52a4726b14311000000000000000000000000804bcb3b87f93ec42b672cda3f88a1978d6e884f00000000000000000000000000000000000000000000000000000000000000fc000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001e0000000000000000000000000000000000000000000000000000000000000001168747470733a2f2f7061636b642e696f2f00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000085061636b4d61696e000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000350434b0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000200000000000000000000000024c23a634dc1dd033dc2b2063bc689bd35be610f000000000000000000000000b11011307e0f3c805387c10aa69f874244b1bec3
-----Decoded View---------------
Arg [0] : initialOwner_ (address): 0x840C1b6ce85bBFEbcFAd737514c0097B078a7E7E
Arg [1] : baseTokenURI_ (string): https://packd.io/
Arg [2] : name_ (string): PackMain
Arg [3] : symbol_ (string): PCK
Arg [4] : registry_ (address): 0x16de95d9199Fceb3546565909eB52a4726B14311
Arg [5] : implementation_ (address): 0x804BCb3B87F93Ec42B672cda3f88A1978d6e884F
Arg [6] : registryChainId_ (uint256): 252
Arg [7] : salt_ (uint256): 0
Arg [8] : modulesWhitelist_ (address[]): 0x24c23a634dC1dD033Dc2B2063bc689BD35BE610f,0xB11011307e0F3c805387c10aa69F874244b1bec3
-----Encoded View---------------
18 Constructor Arguments found :
Arg [0] : 000000000000000000000000840c1b6ce85bbfebcfad737514c0097b078a7e7e
Arg [1] : 0000000000000000000000000000000000000000000000000000000000000120
Arg [2] : 0000000000000000000000000000000000000000000000000000000000000160
Arg [3] : 00000000000000000000000000000000000000000000000000000000000001a0
Arg [4] : 00000000000000000000000016de95d9199fceb3546565909eb52a4726b14311
Arg [5] : 000000000000000000000000804bcb3b87f93ec42b672cda3f88a1978d6e884f
Arg [6] : 00000000000000000000000000000000000000000000000000000000000000fc
Arg [7] : 0000000000000000000000000000000000000000000000000000000000000000
Arg [8] : 00000000000000000000000000000000000000000000000000000000000001e0
Arg [9] : 0000000000000000000000000000000000000000000000000000000000000011
Arg [10] : 68747470733a2f2f7061636b642e696f2f000000000000000000000000000000
Arg [11] : 0000000000000000000000000000000000000000000000000000000000000008
Arg [12] : 5061636b4d61696e000000000000000000000000000000000000000000000000
Arg [13] : 0000000000000000000000000000000000000000000000000000000000000003
Arg [14] : 50434b0000000000000000000000000000000000000000000000000000000000
Arg [15] : 0000000000000000000000000000000000000000000000000000000000000002
Arg [16] : 00000000000000000000000024c23a634dc1dd033dc2b2063bc689bd35be610f
Arg [17] : 000000000000000000000000b11011307e0f3c805387c10aa69f874244b1bec3
Loading...
Loading
Loading...
Loading
Loading...
Loading
Net Worth in USD
$0.00
Net Worth in FRAX
0
Multichain Portfolio | 35 Chains
| Chain | Token | Portfolio % | Price | Amount | Value |
|---|
Loading...
Loading
Loading...
Loading
Loading...
Loading
[ Download: CSV Export ]
A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.