Source Code
More Info
Private Name Tags
ContractCreator
TokenTracker
Latest 25 from a total of 1,712 transactions
| Transaction Hash |
|
Block
|
From
|
To
|
|||||
|---|---|---|---|---|---|---|---|---|---|
| Safe Transfer Fr... | 40775109 | 6 hrs ago | IN | 0 ETH | 0.00000028 | ||||
| Safe Transfer Fr... | 40775101 | 6 hrs ago | IN | 0 ETH | 0.0000003 | ||||
| Safe Transfer Fr... | 40775094 | 6 hrs ago | IN | 0 ETH | 0.0000003 | ||||
| Safe Transfer Fr... | 40775086 | 6 hrs ago | IN | 0 ETH | 0.00000031 | ||||
| Safe Transfer Fr... | 40775078 | 6 hrs ago | IN | 0 ETH | 0.0000003 | ||||
| Safe Transfer Fr... | 40775071 | 6 hrs ago | IN | 0 ETH | 0.0000003 | ||||
| Safe Transfer Fr... | 40775063 | 6 hrs ago | IN | 0 ETH | 0.0000003 | ||||
| Safe Transfer Fr... | 40775057 | 6 hrs ago | IN | 0 ETH | 0.0000003 | ||||
| Safe Transfer Fr... | 40775050 | 6 hrs ago | IN | 0 ETH | 0.0000003 | ||||
| Safe Transfer Fr... | 40775043 | 6 hrs ago | IN | 0 ETH | 0.0000003 | ||||
| Safe Transfer Fr... | 40775035 | 6 hrs ago | IN | 0 ETH | 0.0000003 | ||||
| Safe Transfer Fr... | 40775026 | 6 hrs ago | IN | 0 ETH | 0.0000003 | ||||
| Safe Transfer Fr... | 40775014 | 6 hrs ago | IN | 0 ETH | 0.0000003 | ||||
| Safe Transfer Fr... | 40775007 | 6 hrs ago | IN | 0 ETH | 0.0000003 | ||||
| Safe Transfer Fr... | 40775000 | 6 hrs ago | IN | 0 ETH | 0.0000003 | ||||
| Safe Transfer Fr... | 40774993 | 6 hrs ago | IN | 0 ETH | 0.0000003 | ||||
| Safe Transfer Fr... | 40774980 | 6 hrs ago | IN | 0 ETH | 0.0000003 | ||||
| Safe Transfer Fr... | 40774967 | 6 hrs ago | IN | 0 ETH | 0.0000003 | ||||
| Safe Transfer Fr... | 40774959 | 6 hrs ago | IN | 0 ETH | 0.0000003 | ||||
| Safe Transfer Fr... | 40774953 | 6 hrs ago | IN | 0 ETH | 0.0000003 | ||||
| Safe Transfer Fr... | 40774944 | 6 hrs ago | IN | 0 ETH | 0.0000003 | ||||
| Safe Transfer Fr... | 40774934 | 6 hrs ago | IN | 0 ETH | 0.00000029 | ||||
| Safe Transfer Fr... | 40774927 | 6 hrs ago | IN | 0 ETH | 0.00000029 | ||||
| Safe Transfer Fr... | 40774919 | 6 hrs ago | IN | 0 ETH | 0.00000028 | ||||
| Safe Transfer Fr... | 40774911 | 6 hrs ago | IN | 0 ETH | 0.00000028 |
Cross-Chain Transactions
Loading...
Loading
Contract Name:
VFTokenC
Compiler Version
v0.8.28+commit.7893614a
Optimization Enabled:
Yes with 200 runs
Other Settings:
cancun EvmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.28;
import {ERC721VFC} from "./token/ERC721VFC.sol";
import {OwnableVFExtension} from "./accesscontrol/OwnableVFExtension.sol";
import {AccessControlVFExtension} from "./accesscontrol/AccessControlVFExtension.sol";
import {ECDSA} from "@openzeppelin/contracts/utils/cryptography/ECDSA.sol";
import {ReentrancyGuard} from "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import {Strings} from "@openzeppelin/contracts/utils/Strings.sol";
import {BasicRoyalties} from "@limitbreak/creator-token-standards/src/programmable-royalties/BasicRoyalties.sol";
import {AccessControl} from "@openzeppelin/contracts/access/AccessControl.sol";
contract VFTokenC is
ERC721VFC,
OwnableVFExtension,
AccessControlVFExtension,
ReentrancyGuard
{
using ECDSA for bytes32;
string private _baseUri;
address private _signer;
constructor(
address royaltyReceiver_,
uint96 royaltyFeeNumerator_,
string memory name_,
string memory symbol_,
string memory initialBaseUri_,
address signer_
)
ERC721VFC(name_, symbol_)
BasicRoyalties(royaltyReceiver_, royaltyFeeNumerator_)
AccessControlVFExtension(msg.sender)
{
string memory contractAddress = Strings.toHexString(
uint160(address(this)),
20
);
setBaseURI(
string(
abi.encodePacked(initialBaseUri_, contractAddress, "/tokens/")
)
);
_signer = signer_;
}
function supportsInterface(
bytes4 interfaceId
) public view virtual override(ERC721VFC, AccessControl) returns (bool) {
return
ERC721VFC.supportsInterface(interfaceId) ||
AccessControl.supportsInterface(interfaceId);
}
function setSigner(address signer_) external onlyOwner {
_signer = signer_;
emit SignerUpdated(signer_);
}
function _baseURI() internal view virtual override returns (string memory) {
return _baseUri;
}
function setBaseURI(string memory baseUri) public onlyOwner {
_baseUri = baseUri;
emit BaseURIUpdated(baseUri);
}
function mintBatchAdmin(
address to,
uint256[] calldata tokenIds
) external onlyMinter mintActive notLocked nonReentrant {
_mintBatchByTokenIds(to, tokenIds);
}
function mintBatch(
address to,
string calldata vfId,
uint256[] calldata tokenIds,
bytes calldata signature,
uint256 nonce
) external mintActive notLocked nonReentrant {
bytes32 txHash = _getMintTxHash(vfId, msg.sender, to, tokenIds, nonce);
if (!_isValidVFSignature(txHash, signature)) {
revert ERC721VFInvalidSignature();
}
_mintBatchByTokenIds(to, tokenIds);
}
function burnBatchAdmin(
uint256[] calldata tokenIds
) external onlyBurner burnActive nonReentrant {
_burnBatch(msg.sender, tokenIds);
}
function burnBatch(
uint256[] calldata tokenIds,
bytes calldata signature,
uint256 nonce
) external burnActive nonReentrant {
bytes32 txHash = _getBurnTxHash(tokenIds, msg.sender, nonce);
if (!_isValidVFSignature(txHash, signature)) {
revert ERC721VFInvalidSignature();
}
_burnBatch(msg.sender, tokenIds);
}
function _isValidVFSignature(
bytes32 txHash,
bytes calldata signature
) internal view returns (bool isValid) {
address signer = txHash.toEthSignedMessageHash().recover(signature);
return signer == _signer;
}
function _getMintTxHash(
string calldata vfId,
address sender,
address to,
uint256[] calldata tokenIds,
uint256 nonce
) internal pure returns (bytes32) {
return keccak256(abi.encodePacked(vfId, sender, to, tokenIds, nonce));
}
function _getBurnTxHash(
uint256[] calldata tokenIds,
address sender,
uint256 nonce
) internal pure returns (bytes32) {
return keccak256(abi.encodePacked(tokenIds, sender, nonce));
}
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.4;
import "@openzeppelin/contracts/utils/Context.sol";
abstract contract OwnablePermissions is Context {
function _requireCallerIsContractOwner() internal view virtual;
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.4;
interface ICreatorToken {
event TransferValidatorUpdated(address oldValidator, address newValidator);
function getTransferValidator() external view returns (address validator);
function setTransferValidator(address validator) external;
function getTransferValidationFunction() external view returns (bytes4 functionSignature, bool isViewFunction);
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.4;
interface ICreatorTokenLegacy {
event TransferValidatorUpdated(address oldValidator, address newValidator);
function getTransferValidator() external view returns (address validator);
function setTransferValidator(address validator) external;
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.4;
interface ITransferValidator {
function applyCollectionTransferPolicy(address caller, address from, address to) external view;
function validateTransfer(address caller, address from, address to) external view;
function validateTransfer(address caller, address from, address to, uint256 tokenId) external view;
function validateTransfer(address caller, address from, address to, uint256 tokenId, uint256 amount) external;
function beforeAuthorizedTransfer(address operator, address token, uint256 tokenId) external;
function afterAuthorizedTransfer(address token, uint256 tokenId) external;
function beforeAuthorizedTransfer(address operator, address token) external;
function afterAuthorizedTransfer(address token) external;
function beforeAuthorizedTransfer(address token, uint256 tokenId) external;
function beforeAuthorizedTransferWithAmount(address token, uint256 tokenId, uint256 amount) external;
function afterAuthorizedTransferWithAmount(address token, uint256 tokenId) external;
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.4;
interface ITransferValidatorSetTokenType {
function setTokenTypeOfCollection(address collection, uint16 tokenType) external;
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.4;
import "@openzeppelin/contracts/token/common/ERC2981.sol";
/**
* @title BasicRoyaltiesBase
* @author Limit Break, Inc.
* @dev Base functionality of an NFT mix-in contract implementing the most basic form of programmable royalties.
*/
abstract contract BasicRoyaltiesBase is ERC2981 {
event DefaultRoyaltySet(address indexed receiver, uint96 feeNumerator);
event TokenRoyaltySet(uint256 indexed tokenId, address indexed receiver, uint96 feeNumerator);
function _setDefaultRoyalty(address receiver, uint96 feeNumerator) internal virtual override {
super._setDefaultRoyalty(receiver, feeNumerator);
emit DefaultRoyaltySet(receiver, feeNumerator);
}
function _setTokenRoyalty(uint256 tokenId, address receiver, uint96 feeNumerator) internal virtual override {
super._setTokenRoyalty(tokenId, receiver, feeNumerator);
emit TokenRoyaltySet(tokenId, receiver, feeNumerator);
}
}
/**
* @title BasicRoyalties
* @author Limit Break, Inc.
* @notice Constructable BasicRoyalties Contract implementation.
*/
abstract contract BasicRoyalties is BasicRoyaltiesBase {
constructor(address receiver, uint96 feeNumerator) {
_setDefaultRoyalty(receiver, feeNumerator);
}
}
/**
* @title BasicRoyaltiesInitializable
* @author Limit Break, Inc.
* @notice Initializable BasicRoyalties Contract implementation to allow for EIP-1167 clones.
*/
abstract contract BasicRoyaltiesInitializable is BasicRoyaltiesBase {}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.4;
import "../access/OwnablePermissions.sol";
/**
* @title AutomaticValidatorTransferApproval
* @author Limit Break, Inc.
* @notice Base contract mix-in that provides boilerplate code giving the contract owner the
* option to automatically approve a 721-C transfer validator implementation for transfers.
*/
abstract contract AutomaticValidatorTransferApproval is OwnablePermissions {
/// @dev Emitted when the automatic approval flag is modified by the creator.
event AutomaticApprovalOfTransferValidatorSet(bool autoApproved);
/// @dev If true, the collection's transfer validator is automatically approved to transfer holder's tokens.
bool public autoApproveTransfersFromValidator;
/**
* @notice Sets if the transfer validator is automatically approved as an operator for all token owners.
*
* @dev Throws when the caller is not the contract owner.
*
* @param autoApprove If true, the collection's transfer validator will be automatically approved to
* transfer holder's tokens.
*/
function setAutomaticApprovalOfTransfersFromValidator(bool autoApprove) external {
_requireCallerIsContractOwner();
autoApproveTransfersFromValidator = autoApprove;
emit AutomaticApprovalOfTransferValidatorSet(autoApprove);
}
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.4;
import "../access/OwnablePermissions.sol";
import "../interfaces/ICreatorToken.sol";
import "../interfaces/ICreatorTokenLegacy.sol";
import "../interfaces/ITransferValidator.sol";
import "./TransferValidation.sol";
import "../interfaces/ITransferValidatorSetTokenType.sol";
/**
* @title CreatorTokenBase
* @author Limit Break, Inc.
* @notice CreatorTokenBaseV3 is an abstract contract that provides basic functionality for managing token
* transfer policies through an implementation of ICreatorTokenTransferValidator/ICreatorTokenTransferValidatorV2/ICreatorTokenTransferValidatorV3.
* This contract is intended to be used as a base for creator-specific token contracts, enabling customizable transfer
* restrictions and security policies.
*
* <h4>Features:</h4>
* <ul>Ownable: This contract can have an owner who can set and update the transfer validator.</ul>
* <ul>TransferValidation: Implements the basic token transfer validation interface.</ul>
*
* <h4>Benefits:</h4>
* <ul>Provides a flexible and modular way to implement custom token transfer restrictions and security policies.</ul>
* <ul>Allows creators to enforce policies such as account and codehash blacklists, whitelists, and graylists.</ul>
* <ul>Can be easily integrated into other token contracts as a base contract.</ul>
*
* <h4>Intended Usage:</h4>
* <ul>Use as a base contract for creator token implementations that require advanced transfer restrictions and
* security policies.</ul>
* <ul>Set and update the ICreatorTokenTransferValidator implementation contract to enforce desired policies for the
* creator token.</ul>
*
* <h4>Compatibility:</h4>
* <ul>Backward and Forward Compatible - V1/V2/V3 Creator Token Base will work with V1/V2/V3 Transfer Validators.</ul>
*/
abstract contract CreatorTokenBase is OwnablePermissions, TransferValidation, ICreatorToken {
/// @dev Thrown when setting a transfer validator address that has no deployed code.
error CreatorTokenBase__InvalidTransferValidatorContract();
/// @dev The default transfer validator that will be used if no transfer validator has been set by the creator.
address public constant DEFAULT_TRANSFER_VALIDATOR = address(0x721C008fdff27BF06E7E123956E2Fe03B63342e3);
/// @dev Used to determine if the default transfer validator is applied.
/// @dev Set to true when the creator sets a transfer validator address.
bool private isValidatorInitialized;
/// @dev Address of the transfer validator to apply to transactions.
address private transferValidator;
constructor() {
_emitDefaultTransferValidator();
_registerTokenType(DEFAULT_TRANSFER_VALIDATOR);
}
/**
* @notice Sets the transfer validator for the token contract.
*
* @dev Throws when provided validator contract is not the zero address and does not have code.
* @dev Throws when the caller is not the contract owner.
*
* @dev <h4>Postconditions:</h4>
* 1. The transferValidator address is updated.
* 2. The `TransferValidatorUpdated` event is emitted.
*
* @param transferValidator_ The address of the transfer validator contract.
*/
function setTransferValidator(address transferValidator_) public {
_requireCallerIsContractOwner();
bool isValidTransferValidator = transferValidator_.code.length > 0;
if(transferValidator_ != address(0) && !isValidTransferValidator) {
revert CreatorTokenBase__InvalidTransferValidatorContract();
}
emit TransferValidatorUpdated(address(getTransferValidator()), transferValidator_);
isValidatorInitialized = true;
transferValidator = transferValidator_;
_registerTokenType(transferValidator_);
}
/**
* @notice Returns the transfer validator contract address for this token contract.
*/
function getTransferValidator() public view override returns (address validator) {
validator = transferValidator;
if (validator == address(0)) {
if (!isValidatorInitialized) {
validator = DEFAULT_TRANSFER_VALIDATOR;
}
}
}
/**
* @dev Pre-validates a token transfer, reverting if the transfer is not allowed by this token's security policy.
* Inheriting contracts are responsible for overriding the _beforeTokenTransfer function, or its equivalent
* and calling _validateBeforeTransfer so that checks can be properly applied during token transfers.
*
* @dev Be aware that if the msg.sender is the transfer validator, the transfer is automatically permitted, as the
* transfer validator is expected to pre-validate the transfer.
*
* @dev Throws when the transfer doesn't comply with the collection's transfer policy, if the transferValidator is
* set to a non-zero address.
*
* @param caller The address of the caller.
* @param from The address of the sender.
* @param to The address of the receiver.
* @param tokenId The token id being transferred.
*/
function _preValidateTransfer(
address caller,
address from,
address to,
uint256 tokenId,
uint256 /*value*/) internal virtual override {
address validator = getTransferValidator();
if (validator != address(0)) {
if (msg.sender == validator) {
return;
}
ITransferValidator(validator).validateTransfer(caller, from, to, tokenId);
}
}
/**
* @dev Pre-validates a token transfer, reverting if the transfer is not allowed by this token's security policy.
* Inheriting contracts are responsible for overriding the _beforeTokenTransfer function, or its equivalent
* and calling _validateBeforeTransfer so that checks can be properly applied during token transfers.
*
* @dev Be aware that if the msg.sender is the transfer validator, the transfer is automatically permitted, as the
* transfer validator is expected to pre-validate the transfer.
*
* @dev Used for ERC20 and ERC1155 token transfers which have an amount value to validate in the transfer validator.
* @dev The `tokenId` for ERC20 tokens should be set to `0`.
*
* @dev Throws when the transfer doesn't comply with the collection's transfer policy, if the transferValidator is
* set to a non-zero address.
*
* @param caller The address of the caller.
* @param from The address of the sender.
* @param to The address of the receiver.
* @param tokenId The token id being transferred.
* @param amount The amount of token being transferred.
*/
function _preValidateTransfer(
address caller,
address from,
address to,
uint256 tokenId,
uint256 amount,
uint256 /*value*/) internal virtual override {
address validator = getTransferValidator();
if (validator != address(0)) {
if (msg.sender == validator) {
return;
}
ITransferValidator(validator).validateTransfer(caller, from, to, tokenId, amount);
}
}
function _tokenType() internal virtual pure returns(uint16);
function _registerTokenType(address validator) internal {
if (validator != address(0)) {
uint256 validatorCodeSize;
assembly {
validatorCodeSize := extcodesize(validator)
}
if(validatorCodeSize > 0) {
try ITransferValidatorSetTokenType(validator).setTokenTypeOfCollection(address(this), _tokenType()) {
} catch { }
}
}
}
/**
* @dev Used during contract deployment for constructable and cloneable creator tokens
* @dev to emit the `TransferValidatorUpdated` event signaling the validator for the contract
* @dev is the default transfer validator.
*/
function _emitDefaultTransferValidator() internal {
emit TransferValidatorUpdated(address(0), DEFAULT_TRANSFER_VALIDATOR);
}
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.4;
import "@openzeppelin/contracts/utils/Context.sol";
/**
* @title TransferValidation
* @author Limit Break, Inc.
* @notice A mix-in that can be combined with ERC-721 contracts to provide more granular hooks.
* Openzeppelin's ERC721 contract only provides hooks for before and after transfer. This allows
* developers to validate or customize transfers within the context of a mint, a burn, or a transfer.
*/
abstract contract TransferValidation is Context {
/// @dev Thrown when the from and to address are both the zero address.
error ShouldNotMintToBurnAddress();
/*************************************************************************/
/* Transfers Without Amounts */
/*************************************************************************/
/// @dev Inheriting contracts should call this function in the _beforeTokenTransfer function to get more granular hooks.
function _validateBeforeTransfer(address from, address to, uint256 tokenId) internal virtual {
bool fromZeroAddress = from == address(0);
bool toZeroAddress = to == address(0);
if(fromZeroAddress && toZeroAddress) {
revert ShouldNotMintToBurnAddress();
} else if(fromZeroAddress) {
_preValidateMint(_msgSender(), to, tokenId, msg.value);
} else if(toZeroAddress) {
_preValidateBurn(_msgSender(), from, tokenId, msg.value);
} else {
_preValidateTransfer(_msgSender(), from, to, tokenId, msg.value);
}
}
/// @dev Inheriting contracts should call this function in the _afterTokenTransfer function to get more granular hooks.
function _validateAfterTransfer(address from, address to, uint256 tokenId) internal virtual {
bool fromZeroAddress = from == address(0);
bool toZeroAddress = to == address(0);
if(fromZeroAddress && toZeroAddress) {
revert ShouldNotMintToBurnAddress();
} else if(fromZeroAddress) {
_postValidateMint(_msgSender(), to, tokenId, msg.value);
} else if(toZeroAddress) {
_postValidateBurn(_msgSender(), from, tokenId, msg.value);
} else {
_postValidateTransfer(_msgSender(), from, to, tokenId, msg.value);
}
}
/// @dev Optional validation hook that fires before a mint
function _preValidateMint(address caller, address to, uint256 tokenId, uint256 value) internal virtual {}
/// @dev Optional validation hook that fires after a mint
function _postValidateMint(address caller, address to, uint256 tokenId, uint256 value) internal virtual {}
/// @dev Optional validation hook that fires before a burn
function _preValidateBurn(address caller, address from, uint256 tokenId, uint256 value) internal virtual {}
/// @dev Optional validation hook that fires after a burn
function _postValidateBurn(address caller, address from, uint256 tokenId, uint256 value) internal virtual {}
/// @dev Optional validation hook that fires before a transfer
function _preValidateTransfer(address caller, address from, address to, uint256 tokenId, uint256 value) internal virtual {}
/// @dev Optional validation hook that fires after a transfer
function _postValidateTransfer(address caller, address from, address to, uint256 tokenId, uint256 value) internal virtual {}
/*************************************************************************/
/* Transfers With Amounts */
/*************************************************************************/
/// @dev Inheriting contracts should call this function in the _beforeTokenTransfer function to get more granular hooks.
function _validateBeforeTransfer(address from, address to, uint256 tokenId, uint256 amount) internal virtual {
bool fromZeroAddress = from == address(0);
bool toZeroAddress = to == address(0);
if(fromZeroAddress && toZeroAddress) {
revert ShouldNotMintToBurnAddress();
} else if(fromZeroAddress) {
_preValidateMint(_msgSender(), to, tokenId, amount, msg.value);
} else if(toZeroAddress) {
_preValidateBurn(_msgSender(), from, tokenId, amount, msg.value);
} else {
_preValidateTransfer(_msgSender(), from, to, tokenId, amount, msg.value);
}
}
/// @dev Inheriting contracts should call this function in the _afterTokenTransfer function to get more granular hooks.
function _validateAfterTransfer(address from, address to, uint256 tokenId, uint256 amount) internal virtual {
bool fromZeroAddress = from == address(0);
bool toZeroAddress = to == address(0);
if(fromZeroAddress && toZeroAddress) {
revert ShouldNotMintToBurnAddress();
} else if(fromZeroAddress) {
_postValidateMint(_msgSender(), to, tokenId, amount, msg.value);
} else if(toZeroAddress) {
_postValidateBurn(_msgSender(), from, tokenId, amount, msg.value);
} else {
_postValidateTransfer(_msgSender(), from, to, tokenId, amount, msg.value);
}
}
/// @dev Optional validation hook that fires before a mint
function _preValidateMint(address caller, address to, uint256 tokenId, uint256 amount, uint256 value) internal virtual {}
/// @dev Optional validation hook that fires after a mint
function _postValidateMint(address caller, address to, uint256 tokenId, uint256 amount, uint256 value) internal virtual {}
/// @dev Optional validation hook that fires before a burn
function _preValidateBurn(address caller, address from, uint256 tokenId, uint256 amount, uint256 value) internal virtual {}
/// @dev Optional validation hook that fires after a burn
function _postValidateBurn(address caller, address from, uint256 tokenId, uint256 amount, uint256 value) internal virtual {}
/// @dev Optional validation hook that fires before a transfer
function _preValidateTransfer(address caller, address from, address to, uint256 tokenId, uint256 amount, uint256 value) internal virtual {}
/// @dev Optional validation hook that fires after a transfer
function _postValidateTransfer(address caller, address from, address to, uint256 tokenId, uint256 amount, uint256 value) internal virtual {}
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.4;
/// @dev Constant bytes32 value of 0x000...000
bytes32 constant ZERO_BYTES32 = bytes32(0);
/// @dev Constant value of 0
uint256 constant ZERO = 0;
/// @dev Constant value of 1
uint256 constant ONE = 1;
/// @dev Constant value representing an open order in storage
uint8 constant ORDER_STATE_OPEN = 0;
/// @dev Constant value representing a filled order in storage
uint8 constant ORDER_STATE_FILLED = 1;
/// @dev Constant value representing a cancelled order in storage
uint8 constant ORDER_STATE_CANCELLED = 2;
/// @dev Constant value representing the ERC721 token type for signatures and transfer hooks
uint256 constant TOKEN_TYPE_ERC721 = 721;
/// @dev Constant value representing the ERC1155 token type for signatures and transfer hooks
uint256 constant TOKEN_TYPE_ERC1155 = 1155;
/// @dev Constant value representing the ERC20 token type for signatures and transfer hooks
uint256 constant TOKEN_TYPE_ERC20 = 20;
/// @dev Constant value to mask the upper bits of a signature that uses a packed `vs` value to extract `s`
bytes32 constant UPPER_BIT_MASK = 0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff;
/// @dev EIP-712 typehash used for validating signature based stored approvals
bytes32 constant UPDATE_APPROVAL_TYPEHASH =
keccak256("UpdateApprovalBySignature(uint256 tokenType,address token,uint256 id,uint256 amount,uint256 nonce,address operator,uint256 approvalExpiration,uint256 sigDeadline,uint256 masterNonce)");
/// @dev EIP-712 typehash used for validating a single use permit without additional data
bytes32 constant SINGLE_USE_PERMIT_TYPEHASH =
keccak256("PermitTransferFrom(uint256 tokenType,address token,uint256 id,uint256 amount,uint256 nonce,address operator,uint256 expiration,uint256 masterNonce)");
/// @dev EIP-712 typehash used for validating a single use permit with additional data
string constant SINGLE_USE_PERMIT_TRANSFER_ADVANCED_TYPEHASH_STUB =
"PermitTransferFromWithAdditionalData(uint256 tokenType,address token,uint256 id,uint256 amount,uint256 nonce,address operator,uint256 expiration,uint256 masterNonce,";
/// @dev EIP-712 typehash used for validating an order permit that updates storage as it fills
string constant PERMIT_ORDER_ADVANCED_TYPEHASH_STUB =
"PermitOrderWithAdditionalData(uint256 tokenType,address token,uint256 id,uint256 amount,uint256 salt,address operator,uint256 expiration,uint256 masterNonce,";
/// @dev Pausable flag for stored approval transfers of ERC721 assets
uint256 constant PAUSABLE_APPROVAL_TRANSFER_FROM_ERC721 = 1 << 0;
/// @dev Pausable flag for stored approval transfers of ERC1155 assets
uint256 constant PAUSABLE_APPROVAL_TRANSFER_FROM_ERC1155 = 1 << 1;
/// @dev Pausable flag for stored approval transfers of ERC20 assets
uint256 constant PAUSABLE_APPROVAL_TRANSFER_FROM_ERC20 = 1 << 2;
/// @dev Pausable flag for single use permit transfers of ERC721 assets
uint256 constant PAUSABLE_PERMITTED_TRANSFER_FROM_ERC721 = 1 << 3;
/// @dev Pausable flag for single use permit transfers of ERC1155 assets
uint256 constant PAUSABLE_PERMITTED_TRANSFER_FROM_ERC1155 = 1 << 4;
/// @dev Pausable flag for single use permit transfers of ERC20 assets
uint256 constant PAUSABLE_PERMITTED_TRANSFER_FROM_ERC20 = 1 << 5;
/// @dev Pausable flag for order fill transfers of ERC1155 assets
uint256 constant PAUSABLE_ORDER_TRANSFER_FROM_ERC1155 = 1 << 6;
/// @dev Pausable flag for order fill transfers of ERC20 assets
uint256 constant PAUSABLE_ORDER_TRANSFER_FROM_ERC20 = 1 << 7;// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.0) (access/AccessControl.sol)
pragma solidity ^0.8.0;
import "./IAccessControl.sol";
import "../utils/Context.sol";
import "../utils/Strings.sol";
import "../utils/introspection/ERC165.sol";
/**
* @dev Contract module that allows children to implement role-based access
* control mechanisms. This is a lightweight version that doesn't allow enumerating role
* members except through off-chain means by accessing the contract event logs. Some
* applications may benefit from on-chain enumerability, for those cases see
* {AccessControlEnumerable}.
*
* Roles are referred to by their `bytes32` identifier. These should be exposed
* in the external API and be unique. The best way to achieve this is by
* using `public constant` hash digests:
*
* ```
* bytes32 public constant MY_ROLE = keccak256("MY_ROLE");
* ```
*
* Roles can be used to represent a set of permissions. To restrict access to a
* function call, use {hasRole}:
*
* ```
* function foo() public {
* require(hasRole(MY_ROLE, msg.sender));
* ...
* }
* ```
*
* Roles can be granted and revoked dynamically via the {grantRole} and
* {revokeRole} functions. Each role has an associated admin role, and only
* accounts that have a role's admin role can call {grantRole} and {revokeRole}.
*
* By default, the admin role for all roles is `DEFAULT_ADMIN_ROLE`, which means
* that only accounts with this role will be able to grant or revoke other
* roles. More complex role relationships can be created by using
* {_setRoleAdmin}.
*
* WARNING: The `DEFAULT_ADMIN_ROLE` is also its own admin: it has permission to
* grant and revoke this role. Extra precautions should be taken to secure
* accounts that have been granted it.
*/
abstract contract AccessControl is Context, IAccessControl, ERC165 {
struct RoleData {
mapping(address => bool) members;
bytes32 adminRole;
}
mapping(bytes32 => RoleData) private _roles;
bytes32 public constant DEFAULT_ADMIN_ROLE = 0x00;
/**
* @dev Modifier that checks that an account has a specific role. Reverts
* with a standardized message including the required role.
*
* The format of the revert reason is given by the following regular expression:
*
* /^AccessControl: account (0x[0-9a-f]{40}) is missing role (0x[0-9a-f]{64})$/
*
* _Available since v4.1._
*/
modifier onlyRole(bytes32 role) {
_checkRole(role);
_;
}
/**
* @dev See {IERC165-supportsInterface}.
*/
function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
return interfaceId == type(IAccessControl).interfaceId || super.supportsInterface(interfaceId);
}
/**
* @dev Returns `true` if `account` has been granted `role`.
*/
function hasRole(bytes32 role, address account) public view virtual override returns (bool) {
return _roles[role].members[account];
}
/**
* @dev Revert with a standard message if `_msgSender()` is missing `role`.
* Overriding this function changes the behavior of the {onlyRole} modifier.
*
* Format of the revert message is described in {_checkRole}.
*
* _Available since v4.6._
*/
function _checkRole(bytes32 role) internal view virtual {
_checkRole(role, _msgSender());
}
/**
* @dev Revert with a standard message if `account` is missing `role`.
*
* The format of the revert reason is given by the following regular expression:
*
* /^AccessControl: account (0x[0-9a-f]{40}) is missing role (0x[0-9a-f]{64})$/
*/
function _checkRole(bytes32 role, address account) internal view virtual {
if (!hasRole(role, account)) {
revert(
string(
abi.encodePacked(
"AccessControl: account ",
Strings.toHexString(account),
" is missing role ",
Strings.toHexString(uint256(role), 32)
)
)
);
}
}
/**
* @dev Returns the admin role that controls `role`. See {grantRole} and
* {revokeRole}.
*
* To change a role's admin, use {_setRoleAdmin}.
*/
function getRoleAdmin(bytes32 role) public view virtual override returns (bytes32) {
return _roles[role].adminRole;
}
/**
* @dev Grants `role` to `account`.
*
* If `account` had not been already granted `role`, emits a {RoleGranted}
* event.
*
* Requirements:
*
* - the caller must have ``role``'s admin role.
*
* May emit a {RoleGranted} event.
*/
function grantRole(bytes32 role, address account) public virtual override onlyRole(getRoleAdmin(role)) {
_grantRole(role, account);
}
/**
* @dev Revokes `role` from `account`.
*
* If `account` had been granted `role`, emits a {RoleRevoked} event.
*
* Requirements:
*
* - the caller must have ``role``'s admin role.
*
* May emit a {RoleRevoked} event.
*/
function revokeRole(bytes32 role, address account) public virtual override onlyRole(getRoleAdmin(role)) {
_revokeRole(role, account);
}
/**
* @dev Revokes `role` from the calling account.
*
* Roles are often managed via {grantRole} and {revokeRole}: this function's
* purpose is to provide a mechanism for accounts to lose their privileges
* if they are compromised (such as when a trusted device is misplaced).
*
* If the calling account had been revoked `role`, emits a {RoleRevoked}
* event.
*
* Requirements:
*
* - the caller must be `account`.
*
* May emit a {RoleRevoked} event.
*/
function renounceRole(bytes32 role, address account) public virtual override {
require(account == _msgSender(), "AccessControl: can only renounce roles for self");
_revokeRole(role, account);
}
/**
* @dev Grants `role` to `account`.
*
* If `account` had not been already granted `role`, emits a {RoleGranted}
* event. Note that unlike {grantRole}, this function doesn't perform any
* checks on the calling account.
*
* May emit a {RoleGranted} event.
*
* [WARNING]
* ====
* This function should only be called from the constructor when setting
* up the initial roles for the system.
*
* Using this function in any other way is effectively circumventing the admin
* system imposed by {AccessControl}.
* ====
*
* NOTE: This function is deprecated in favor of {_grantRole}.
*/
function _setupRole(bytes32 role, address account) internal virtual {
_grantRole(role, account);
}
/**
* @dev Sets `adminRole` as ``role``'s admin role.
*
* Emits a {RoleAdminChanged} event.
*/
function _setRoleAdmin(bytes32 role, bytes32 adminRole) internal virtual {
bytes32 previousAdminRole = getRoleAdmin(role);
_roles[role].adminRole = adminRole;
emit RoleAdminChanged(role, previousAdminRole, adminRole);
}
/**
* @dev Grants `role` to `account`.
*
* Internal function without access restriction.
*
* May emit a {RoleGranted} event.
*/
function _grantRole(bytes32 role, address account) internal virtual {
if (!hasRole(role, account)) {
_roles[role].members[account] = true;
emit RoleGranted(role, account, _msgSender());
}
}
/**
* @dev Revokes `role` from `account`.
*
* Internal function without access restriction.
*
* May emit a {RoleRevoked} event.
*/
function _revokeRole(bytes32 role, address account) internal virtual {
if (hasRole(role, account)) {
_roles[role].members[account] = false;
emit RoleRevoked(role, account, _msgSender());
}
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (access/IAccessControl.sol)
pragma solidity ^0.8.0;
/**
* @dev External interface of AccessControl declared to support ERC165 detection.
*/
interface IAccessControl {
/**
* @dev Emitted when `newAdminRole` is set as ``role``'s admin role, replacing `previousAdminRole`
*
* `DEFAULT_ADMIN_ROLE` is the starting admin for all roles, despite
* {RoleAdminChanged} not being emitted signaling this.
*
* _Available since v3.1._
*/
event RoleAdminChanged(bytes32 indexed role, bytes32 indexed previousAdminRole, bytes32 indexed newAdminRole);
/**
* @dev Emitted when `account` is granted `role`.
*
* `sender` is the account that originated the contract call, an admin role
* bearer except when using {AccessControl-_setupRole}.
*/
event RoleGranted(bytes32 indexed role, address indexed account, address indexed sender);
/**
* @dev Emitted when `account` is revoked `role`.
*
* `sender` is the account that originated the contract call:
* - if using `revokeRole`, it is the admin role bearer
* - if using `renounceRole`, it is the role bearer (i.e. `account`)
*/
event RoleRevoked(bytes32 indexed role, address indexed account, address indexed sender);
/**
* @dev Returns `true` if `account` has been granted `role`.
*/
function hasRole(bytes32 role, address account) external view returns (bool);
/**
* @dev Returns the admin role that controls `role`. See {grantRole} and
* {revokeRole}.
*
* To change a role's admin, use {AccessControl-_setRoleAdmin}.
*/
function getRoleAdmin(bytes32 role) external view returns (bytes32);
/**
* @dev Grants `role` to `account`.
*
* If `account` had not been already granted `role`, emits a {RoleGranted}
* event.
*
* Requirements:
*
* - the caller must have ``role``'s admin role.
*/
function grantRole(bytes32 role, address account) external;
/**
* @dev Revokes `role` from `account`.
*
* If `account` had been granted `role`, emits a {RoleRevoked} event.
*
* Requirements:
*
* - the caller must have ``role``'s admin role.
*/
function revokeRole(bytes32 role, address account) external;
/**
* @dev Revokes `role` from the calling account.
*
* Roles are often managed via {grantRole} and {revokeRole}: this function's
* purpose is to provide a mechanism for accounts to lose their privileges
* if they are compromised (such as when a trusted device is misplaced).
*
* If the calling account had been granted `role`, emits a {RoleRevoked}
* event.
*
* Requirements:
*
* - the caller must be `account`.
*/
function renounceRole(bytes32 role, address account) external;
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (access/Ownable.sol)
pragma solidity ^0.8.0;
import "../utils/Context.sol";
/**
* @dev Contract module which provides a basic access control mechanism, where
* there is an account (an owner) that can be granted exclusive access to
* specific functions.
*
* By default, the owner account will be the one that deploys the contract. This
* can later be changed with {transferOwnership}.
*
* This module is used through inheritance. It will make available the modifier
* `onlyOwner`, which can be applied to your functions to restrict their use to
* the owner.
*/
abstract contract Ownable is Context {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev Initializes the contract setting the deployer as the initial owner.
*/
constructor() {
_transferOwnership(_msgSender());
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
_checkOwner();
_;
}
/**
* @dev Returns the address of the current owner.
*/
function owner() public view virtual returns (address) {
return _owner;
}
/**
* @dev Throws if the sender is not the owner.
*/
function _checkOwner() internal view virtual {
require(owner() == _msgSender(), "Ownable: caller is not the owner");
}
/**
* @dev Leaves the contract without owner. It will not be possible to call
* `onlyOwner` functions anymore. Can only be called by the current owner.
*
* NOTE: Renouncing ownership will leave the contract without an owner,
* thereby removing any functionality that is only available to the owner.
*/
function renounceOwnership() public virtual onlyOwner {
_transferOwnership(address(0));
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Can only be called by the current owner.
*/
function transferOwnership(address newOwner) public virtual onlyOwner {
require(newOwner != address(0), "Ownable: new owner is the zero address");
_transferOwnership(newOwner);
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Internal function without access restriction.
*/
function _transferOwnership(address newOwner) internal virtual {
address oldOwner = _owner;
_owner = newOwner;
emit OwnershipTransferred(oldOwner, newOwner);
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.6.0) (interfaces/IERC2981.sol)
pragma solidity ^0.8.0;
import "../utils/introspection/IERC165.sol";
/**
* @dev Interface for the NFT Royalty Standard.
*
* A standardized way to retrieve royalty payment information for non-fungible tokens (NFTs) to enable universal
* support for royalty payments across all NFT marketplaces and ecosystem participants.
*
* _Available since v4.5._
*/
interface IERC2981 is IERC165 {
/**
* @dev Returns how much royalty is owed and to whom, based on a sale price that may be denominated in any unit of
* exchange. The royalty amount is denominated and should be paid in that same unit of exchange.
*/
function royaltyInfo(uint256 tokenId, uint256 salePrice)
external
view
returns (address receiver, uint256 royaltyAmount);
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.0) (security/ReentrancyGuard.sol)
pragma solidity ^0.8.0;
/**
* @dev Contract module that helps prevent reentrant calls to a function.
*
* Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier
* available, which can be applied to functions to make sure there are no nested
* (reentrant) calls to them.
*
* Note that because there is a single `nonReentrant` guard, functions marked as
* `nonReentrant` may not call one another. This can be worked around by making
* those functions `private`, and then adding `external` `nonReentrant` entry
* points to them.
*
* TIP: If you would like to learn more about reentrancy and alternative ways
* to protect against it, check out our blog post
* https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul].
*/
abstract contract ReentrancyGuard {
// Booleans are more expensive than uint256 or any type that takes up a full
// word because each write operation emits an extra SLOAD to first read the
// slot's contents, replace the bits taken up by the boolean, and then write
// back. This is the compiler's defense against contract upgrades and
// pointer aliasing, and it cannot be disabled.
// The values being non-zero value makes deployment a bit more expensive,
// but in exchange the refund on every call to nonReentrant will be lower in
// amount. Since refunds are capped to a percentage of the total
// transaction's gas, it is best to keep them low in cases like this one, to
// increase the likelihood of the full refund coming into effect.
uint256 private constant _NOT_ENTERED = 1;
uint256 private constant _ENTERED = 2;
uint256 private _status;
constructor() {
_status = _NOT_ENTERED;
}
/**
* @dev Prevents a contract from calling itself, directly or indirectly.
* Calling a `nonReentrant` function from another `nonReentrant`
* function is not supported. It is possible to prevent this from happening
* by making the `nonReentrant` function external, and making it call a
* `private` function that does the actual work.
*/
modifier nonReentrant() {
_nonReentrantBefore();
_;
_nonReentrantAfter();
}
function _nonReentrantBefore() private {
// On the first call to nonReentrant, _status will be _NOT_ENTERED
require(_status != _ENTERED, "ReentrancyGuard: reentrant call");
// Any calls to nonReentrant after this point will fail
_status = _ENTERED;
}
function _nonReentrantAfter() private {
// By storing the original value once again, a refund is triggered (see
// https://eips.ethereum.org/EIPS/eip-2200)
_status = _NOT_ENTERED;
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (token/common/ERC2981.sol)
pragma solidity ^0.8.0;
import "../../interfaces/IERC2981.sol";
import "../../utils/introspection/ERC165.sol";
/**
* @dev Implementation of the NFT Royalty Standard, a standardized way to retrieve royalty payment information.
*
* Royalty information can be specified globally for all token ids via {_setDefaultRoyalty}, and/or individually for
* specific token ids via {_setTokenRoyalty}. The latter takes precedence over the first.
*
* Royalty is specified as a fraction of sale price. {_feeDenominator} is overridable but defaults to 10000, meaning the
* fee is specified in basis points by default.
*
* IMPORTANT: ERC-2981 only specifies a way to signal royalty information and does not enforce its payment. See
* https://eips.ethereum.org/EIPS/eip-2981#optional-royalty-payments[Rationale] in the EIP. Marketplaces are expected to
* voluntarily pay royalties together with sales, but note that this standard is not yet widely supported.
*
* _Available since v4.5._
*/
abstract contract ERC2981 is IERC2981, ERC165 {
struct RoyaltyInfo {
address receiver;
uint96 royaltyFraction;
}
RoyaltyInfo private _defaultRoyaltyInfo;
mapping(uint256 => RoyaltyInfo) private _tokenRoyaltyInfo;
/**
* @dev See {IERC165-supportsInterface}.
*/
function supportsInterface(bytes4 interfaceId) public view virtual override(IERC165, ERC165) returns (bool) {
return interfaceId == type(IERC2981).interfaceId || super.supportsInterface(interfaceId);
}
/**
* @inheritdoc IERC2981
*/
function royaltyInfo(uint256 _tokenId, uint256 _salePrice) public view virtual override returns (address, uint256) {
RoyaltyInfo memory royalty = _tokenRoyaltyInfo[_tokenId];
if (royalty.receiver == address(0)) {
royalty = _defaultRoyaltyInfo;
}
uint256 royaltyAmount = (_salePrice * royalty.royaltyFraction) / _feeDenominator();
return (royalty.receiver, royaltyAmount);
}
/**
* @dev The denominator with which to interpret the fee set in {_setTokenRoyalty} and {_setDefaultRoyalty} as a
* fraction of the sale price. Defaults to 10000 so fees are expressed in basis points, but may be customized by an
* override.
*/
function _feeDenominator() internal pure virtual returns (uint96) {
return 10000;
}
/**
* @dev Sets the royalty information that all ids in this contract will default to.
*
* Requirements:
*
* - `receiver` cannot be the zero address.
* - `feeNumerator` cannot be greater than the fee denominator.
*/
function _setDefaultRoyalty(address receiver, uint96 feeNumerator) internal virtual {
require(feeNumerator <= _feeDenominator(), "ERC2981: royalty fee will exceed salePrice");
require(receiver != address(0), "ERC2981: invalid receiver");
_defaultRoyaltyInfo = RoyaltyInfo(receiver, feeNumerator);
}
/**
* @dev Removes default royalty information.
*/
function _deleteDefaultRoyalty() internal virtual {
delete _defaultRoyaltyInfo;
}
/**
* @dev Sets the royalty information for a specific token id, overriding the global default.
*
* Requirements:
*
* - `receiver` cannot be the zero address.
* - `feeNumerator` cannot be greater than the fee denominator.
*/
function _setTokenRoyalty(
uint256 tokenId,
address receiver,
uint96 feeNumerator
) internal virtual {
require(feeNumerator <= _feeDenominator(), "ERC2981: royalty fee will exceed salePrice");
require(receiver != address(0), "ERC2981: Invalid parameters");
_tokenRoyaltyInfo[tokenId] = RoyaltyInfo(receiver, feeNumerator);
}
/**
* @dev Resets royalty information for the token id back to the global default.
*/
function _resetTokenRoyalty(uint256 tokenId) internal virtual {
delete _tokenRoyaltyInfo[tokenId];
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC721/extensions/IERC721Metadata.sol)
pragma solidity ^0.8.0;
import "../IERC721.sol";
/**
* @title ERC-721 Non-Fungible Token Standard, optional metadata extension
* @dev See https://eips.ethereum.org/EIPS/eip-721
*/
interface IERC721Metadata is IERC721 {
/**
* @dev Returns the token collection name.
*/
function name() external view returns (string memory);
/**
* @dev Returns the token collection symbol.
*/
function symbol() external view returns (string memory);
/**
* @dev Returns the Uniform Resource Identifier (URI) for `tokenId` token.
*/
function tokenURI(uint256 tokenId) external view returns (string memory);
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.0) (token/ERC721/IERC721.sol)
pragma solidity ^0.8.0;
import "../../utils/introspection/IERC165.sol";
/**
* @dev Required interface of an ERC721 compliant contract.
*/
interface IERC721 is IERC165 {
/**
* @dev Emitted when `tokenId` token is transferred from `from` to `to`.
*/
event Transfer(address indexed from, address indexed to, uint256 indexed tokenId);
/**
* @dev Emitted when `owner` enables `approved` to manage the `tokenId` token.
*/
event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId);
/**
* @dev Emitted when `owner` enables or disables (`approved`) `operator` to manage all of its assets.
*/
event ApprovalForAll(address indexed owner, address indexed operator, bool approved);
/**
* @dev Returns the number of tokens in ``owner``'s account.
*/
function balanceOf(address owner) external view returns (uint256 balance);
/**
* @dev Returns the owner of the `tokenId` token.
*
* Requirements:
*
* - `tokenId` must exist.
*/
function ownerOf(uint256 tokenId) external view returns (address owner);
/**
* @dev Safely transfers `tokenId` token from `from` to `to`.
*
* Requirements:
*
* - `from` cannot be the zero address.
* - `to` cannot be the zero address.
* - `tokenId` token must exist and be owned by `from`.
* - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.
* - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
*
* Emits a {Transfer} event.
*/
function safeTransferFrom(
address from,
address to,
uint256 tokenId,
bytes calldata data
) external;
/**
* @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients
* are aware of the ERC721 protocol to prevent tokens from being forever locked.
*
* Requirements:
*
* - `from` cannot be the zero address.
* - `to` cannot be the zero address.
* - `tokenId` token must exist and be owned by `from`.
* - If the caller is not `from`, it must have been allowed to move this token by either {approve} or {setApprovalForAll}.
* - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
*
* Emits a {Transfer} event.
*/
function safeTransferFrom(
address from,
address to,
uint256 tokenId
) external;
/**
* @dev Transfers `tokenId` token from `from` to `to`.
*
* WARNING: Note that the caller is responsible to confirm that the recipient is capable of receiving ERC721
* or else they may be permanently lost. Usage of {safeTransferFrom} prevents loss, though the caller must
* understand this adds an external call which potentially creates a reentrancy vulnerability.
*
* Requirements:
*
* - `from` cannot be the zero address.
* - `to` cannot be the zero address.
* - `tokenId` token must be owned by `from`.
* - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.
*
* Emits a {Transfer} event.
*/
function transferFrom(
address from,
address to,
uint256 tokenId
) external;
/**
* @dev Gives permission to `to` to transfer `tokenId` token to another account.
* The approval is cleared when the token is transferred.
*
* Only a single account can be approved at a time, so approving the zero address clears previous approvals.
*
* Requirements:
*
* - The caller must own the token or be an approved operator.
* - `tokenId` must exist.
*
* Emits an {Approval} event.
*/
function approve(address to, uint256 tokenId) external;
/**
* @dev Approve or remove `operator` as an operator for the caller.
* Operators can call {transferFrom} or {safeTransferFrom} for any token owned by the caller.
*
* Requirements:
*
* - The `operator` cannot be the caller.
*
* Emits an {ApprovalForAll} event.
*/
function setApprovalForAll(address operator, bool _approved) external;
/**
* @dev Returns the account approved for `tokenId` token.
*
* Requirements:
*
* - `tokenId` must exist.
*/
function getApproved(uint256 tokenId) external view returns (address operator);
/**
* @dev Returns if the `operator` is allowed to manage all of the assets of `owner`.
*
* See {setApprovalForAll}
*/
function isApprovedForAll(address owner, address operator) external view returns (bool);
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.6.0) (token/ERC721/IERC721Receiver.sol)
pragma solidity ^0.8.0;
/**
* @title ERC721 token receiver interface
* @dev Interface for any contract that wants to support safeTransfers
* from ERC721 asset contracts.
*/
interface IERC721Receiver {
/**
* @dev Whenever an {IERC721} `tokenId` token is transferred to this contract via {IERC721-safeTransferFrom}
* by `operator` from `from`, this function is called.
*
* It must return its Solidity selector to confirm the token transfer.
* If any other value is returned or the interface is not implemented by the recipient, the transfer will be reverted.
*
* The selector can be obtained in Solidity with `IERC721Receiver.onERC721Received.selector`.
*/
function onERC721Received(
address operator,
address from,
uint256 tokenId,
bytes calldata data
) external returns (bytes4);
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.0) (utils/Address.sol)
pragma solidity ^0.8.1;
/**
* @dev Collection of functions related to the address type
*/
library Address {
/**
* @dev Returns true if `account` is a contract.
*
* [IMPORTANT]
* ====
* It is unsafe to assume that an address for which this function returns
* false is an externally-owned account (EOA) and not a contract.
*
* Among others, `isContract` will return false for the following
* types of addresses:
*
* - an externally-owned account
* - a contract in construction
* - an address where a contract will be created
* - an address where a contract lived, but was destroyed
* ====
*
* [IMPORTANT]
* ====
* You shouldn't rely on `isContract` to protect against flash loan attacks!
*
* Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets
* like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract
* constructor.
* ====
*/
function isContract(address account) internal view returns (bool) {
// This method relies on extcodesize/address.code.length, which returns 0
// for contracts in construction, since the code is only stored at the end
// of the constructor execution.
return account.code.length > 0;
}
/**
* @dev Replacement for Solidity's `transfer`: sends `amount` wei to
* `recipient`, forwarding all available gas and reverting on errors.
*
* https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost
* of certain opcodes, possibly making contracts go over the 2300 gas limit
* imposed by `transfer`, making them unable to receive funds via
* `transfer`. {sendValue} removes this limitation.
*
* https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].
*
* IMPORTANT: because control is transferred to `recipient`, care must be
* taken to not create reentrancy vulnerabilities. Consider using
* {ReentrancyGuard} or the
* https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].
*/
function sendValue(address payable recipient, uint256 amount) internal {
require(address(this).balance >= amount, "Address: insufficient balance");
(bool success, ) = recipient.call{value: amount}("");
require(success, "Address: unable to send value, recipient may have reverted");
}
/**
* @dev Performs a Solidity function call using a low level `call`. A
* plain `call` is an unsafe replacement for a function call: use this
* function instead.
*
* If `target` reverts with a revert reason, it is bubbled up by this
* function (like regular Solidity function calls).
*
* Returns the raw returned data. To convert to the expected return value,
* use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].
*
* Requirements:
*
* - `target` must be a contract.
* - calling `target` with `data` must not revert.
*
* _Available since v3.1._
*/
function functionCall(address target, bytes memory data) internal returns (bytes memory) {
return functionCallWithValue(target, data, 0, "Address: low-level call failed");
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with
* `errorMessage` as a fallback revert reason when `target` reverts.
*
* _Available since v3.1._
*/
function functionCall(
address target,
bytes memory data,
string memory errorMessage
) internal returns (bytes memory) {
return functionCallWithValue(target, data, 0, errorMessage);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but also transferring `value` wei to `target`.
*
* Requirements:
*
* - the calling contract must have an ETH balance of at least `value`.
* - the called Solidity function must be `payable`.
*
* _Available since v3.1._
*/
function functionCallWithValue(
address target,
bytes memory data,
uint256 value
) internal returns (bytes memory) {
return functionCallWithValue(target, data, value, "Address: low-level call with value failed");
}
/**
* @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but
* with `errorMessage` as a fallback revert reason when `target` reverts.
*
* _Available since v3.1._
*/
function functionCallWithValue(
address target,
bytes memory data,
uint256 value,
string memory errorMessage
) internal returns (bytes memory) {
require(address(this).balance >= value, "Address: insufficient balance for call");
(bool success, bytes memory returndata) = target.call{value: value}(data);
return verifyCallResultFromTarget(target, success, returndata, errorMessage);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but performing a static call.
*
* _Available since v3.3._
*/
function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {
return functionStaticCall(target, data, "Address: low-level static call failed");
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
* but performing a static call.
*
* _Available since v3.3._
*/
function functionStaticCall(
address target,
bytes memory data,
string memory errorMessage
) internal view returns (bytes memory) {
(bool success, bytes memory returndata) = target.staticcall(data);
return verifyCallResultFromTarget(target, success, returndata, errorMessage);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but performing a delegate call.
*
* _Available since v3.4._
*/
function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {
return functionDelegateCall(target, data, "Address: low-level delegate call failed");
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
* but performing a delegate call.
*
* _Available since v3.4._
*/
function functionDelegateCall(
address target,
bytes memory data,
string memory errorMessage
) internal returns (bytes memory) {
(bool success, bytes memory returndata) = target.delegatecall(data);
return verifyCallResultFromTarget(target, success, returndata, errorMessage);
}
/**
* @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling
* the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract.
*
* _Available since v4.8._
*/
function verifyCallResultFromTarget(
address target,
bool success,
bytes memory returndata,
string memory errorMessage
) internal view returns (bytes memory) {
if (success) {
if (returndata.length == 0) {
// only check isContract if the call was successful and the return data is empty
// otherwise we already know that it was a contract
require(isContract(target), "Address: call to non-contract");
}
return returndata;
} else {
_revert(returndata, errorMessage);
}
}
/**
* @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the
* revert reason or using the provided one.
*
* _Available since v4.3._
*/
function verifyCallResult(
bool success,
bytes memory returndata,
string memory errorMessage
) internal pure returns (bytes memory) {
if (success) {
return returndata;
} else {
_revert(returndata, errorMessage);
}
}
function _revert(bytes memory returndata, string memory errorMessage) private pure {
// Look for revert reason and bubble it up if present
if (returndata.length > 0) {
// The easiest way to bubble the revert reason is using memory via assembly
/// @solidity memory-safe-assembly
assembly {
let returndata_size := mload(returndata)
revert(add(32, returndata), returndata_size)
}
} else {
revert(errorMessage);
}
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)
pragma solidity ^0.8.0;
/**
* @dev Provides information about the current execution context, including the
* sender of the transaction and its data. While these are generally available
* via msg.sender and msg.data, they should not be accessed in such a direct
* manner, since when dealing with meta-transactions the account sending and
* paying for execution may not be the actual sender (as far as an application
* is concerned).
*
* This contract is only required for intermediate, library-like contracts.
*/
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes calldata) {
return msg.data;
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.0) (utils/cryptography/ECDSA.sol)
pragma solidity ^0.8.0;
import "../Strings.sol";
/**
* @dev Elliptic Curve Digital Signature Algorithm (ECDSA) operations.
*
* These functions can be used to verify that a message was signed by the holder
* of the private keys of a given address.
*/
library ECDSA {
enum RecoverError {
NoError,
InvalidSignature,
InvalidSignatureLength,
InvalidSignatureS,
InvalidSignatureV // Deprecated in v4.8
}
function _throwError(RecoverError error) private pure {
if (error == RecoverError.NoError) {
return; // no error: do nothing
} else if (error == RecoverError.InvalidSignature) {
revert("ECDSA: invalid signature");
} else if (error == RecoverError.InvalidSignatureLength) {
revert("ECDSA: invalid signature length");
} else if (error == RecoverError.InvalidSignatureS) {
revert("ECDSA: invalid signature 's' value");
}
}
/**
* @dev Returns the address that signed a hashed message (`hash`) with
* `signature` or error string. This address can then be used for verification purposes.
*
* The `ecrecover` EVM opcode allows for malleable (non-unique) signatures:
* this function rejects them by requiring the `s` value to be in the lower
* half order, and the `v` value to be either 27 or 28.
*
* IMPORTANT: `hash` _must_ be the result of a hash operation for the
* verification to be secure: it is possible to craft signatures that
* recover to arbitrary addresses for non-hashed data. A safe way to ensure
* this is by receiving a hash of the original message (which may otherwise
* be too long), and then calling {toEthSignedMessageHash} on it.
*
* Documentation for signature generation:
* - with https://web3js.readthedocs.io/en/v1.3.4/web3-eth-accounts.html#sign[Web3.js]
* - with https://docs.ethers.io/v5/api/signer/#Signer-signMessage[ethers]
*
* _Available since v4.3._
*/
function tryRecover(bytes32 hash, bytes memory signature) internal pure returns (address, RecoverError) {
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);
}
}
/**
* @dev Returns the address that signed a hashed message (`hash`) with
* `signature`. This address can then be used for verification purposes.
*
* The `ecrecover` EVM opcode allows for malleable (non-unique) signatures:
* this function rejects them by requiring the `s` value to be in the lower
* half order, and the `v` value to be either 27 or 28.
*
* IMPORTANT: `hash` _must_ be the result of a hash operation for the
* verification to be secure: it is possible to craft signatures that
* recover to arbitrary addresses for non-hashed data. A safe way to ensure
* this is by receiving a hash of the original message (which may otherwise
* be too long), and then calling {toEthSignedMessageHash} on it.
*/
function recover(bytes32 hash, bytes memory signature) internal pure returns (address) {
(address recovered, RecoverError error) = tryRecover(hash, signature);
_throwError(error);
return recovered;
}
/**
* @dev Overload of {ECDSA-tryRecover} that receives the `r` and `vs` short-signature fields separately.
*
* See https://eips.ethereum.org/EIPS/eip-2098[EIP-2098 short signatures]
*
* _Available since v4.3._
*/
function tryRecover(
bytes32 hash,
bytes32 r,
bytes32 vs
) internal pure returns (address, RecoverError) {
bytes32 s = vs & bytes32(0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff);
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.
*
* _Available since v4.2._
*/
function recover(
bytes32 hash,
bytes32 r,
bytes32 vs
) internal pure returns (address) {
(address recovered, RecoverError error) = tryRecover(hash, r, vs);
_throwError(error);
return recovered;
}
/**
* @dev Overload of {ECDSA-tryRecover} that receives the `v`,
* `r` and `s` signature fields separately.
*
* _Available since v4.3._
*/
function tryRecover(
bytes32 hash,
uint8 v,
bytes32 r,
bytes32 s
) internal pure returns (address, RecoverError) {
// EIP-2 still allows signature malleability for ecrecover(). Remove this possibility and make the signature
// unique. Appendix F in the Ethereum Yellow paper (https://ethereum.github.io/yellowpaper/paper.pdf), defines
// the valid range for s in (301): 0 < s < secp256k1n ÷ 2 + 1, and for v in (302): v ∈ {27, 28}. Most
// signatures from current libraries generate a unique signature with an s-value in the lower half order.
//
// If your library generates malleable signatures, such as s-values in the upper range, calculate a new s-value
// with 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141 - s1 and flip v from 27 to 28 or
// vice versa. If your library also generates signatures with 0/1 for v instead 27/28, add 27 to v to accept
// these malleable signatures as well.
if (uint256(s) > 0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5D576E7357A4501DDFE92F46681B20A0) {
return (address(0), RecoverError.InvalidSignatureS);
}
// If the signature is valid (and not malleable), return the signer address
address signer = ecrecover(hash, v, r, s);
if (signer == address(0)) {
return (address(0), RecoverError.InvalidSignature);
}
return (signer, RecoverError.NoError);
}
/**
* @dev Overload of {ECDSA-recover} that receives the `v`,
* `r` and `s` signature fields separately.
*/
function recover(
bytes32 hash,
uint8 v,
bytes32 r,
bytes32 s
) internal pure returns (address) {
(address recovered, RecoverError error) = tryRecover(hash, v, r, s);
_throwError(error);
return recovered;
}
/**
* @dev Returns an Ethereum Signed Message, created from a `hash`. This
* produces hash corresponding to the one signed with the
* https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`]
* JSON-RPC method as part of EIP-191.
*
* See {recover}.
*/
function toEthSignedMessageHash(bytes32 hash) internal pure returns (bytes32) {
// 32 is the length in bytes of hash,
// enforced by the type signature above
return keccak256(abi.encodePacked("\x19Ethereum Signed Message:\n32", hash));
}
/**
* @dev Returns an Ethereum Signed Message, created from `s`. This
* produces hash corresponding to the one signed with the
* https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`]
* JSON-RPC method as part of EIP-191.
*
* See {recover}.
*/
function toEthSignedMessageHash(bytes memory s) internal pure returns (bytes32) {
return keccak256(abi.encodePacked("\x19Ethereum Signed Message:\n", Strings.toString(s.length), s));
}
/**
* @dev Returns an Ethereum Signed Typed Data, created from a
* `domainSeparator` and a `structHash`. This produces hash corresponding
* to the one signed with the
* https://eips.ethereum.org/EIPS/eip-712[`eth_signTypedData`]
* JSON-RPC method as part of EIP-712.
*
* See {recover}.
*/
function toTypedDataHash(bytes32 domainSeparator, bytes32 structHash) internal pure returns (bytes32) {
return keccak256(abi.encodePacked("\x19\x01", domainSeparator, structHash));
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/introspection/ERC165.sol)
pragma solidity ^0.8.0;
import "./IERC165.sol";
/**
* @dev Implementation of the {IERC165} interface.
*
* Contracts that want to implement ERC165 should inherit from this contract and override {supportsInterface} to check
* for the additional interface id that will be supported. For example:
*
* ```solidity
* function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
* return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId);
* }
* ```
*
* Alternatively, {ERC165Storage} provides an easier to use but more expensive implementation.
*/
abstract contract ERC165 is IERC165 {
/**
* @dev See {IERC165-supportsInterface}.
*/
function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
return interfaceId == type(IERC165).interfaceId;
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC165.sol)
pragma solidity ^0.8.0;
/**
* @dev Interface of the ERC165 standard, as defined in the
* https://eips.ethereum.org/EIPS/eip-165[EIP].
*
* Implementers can declare support of contract interfaces, which can then be
* queried by others ({ERC165Checker}).
*
* For an implementation, see {ERC165}.
*/
interface IERC165 {
/**
* @dev Returns true if this contract implements the interface defined by
* `interfaceId`. See the corresponding
* https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section]
* to learn more about how these ids are created.
*
* This function call must use less than 30 000 gas.
*/
function supportsInterface(bytes4 interfaceId) external view returns (bool);
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.0) (utils/math/Math.sol)
pragma solidity ^0.8.0;
/**
* @dev Standard math utilities missing in the Solidity language.
*/
library Math {
enum Rounding {
Down, // Toward negative infinity
Up, // Toward infinity
Zero // Toward zero
}
/**
* @dev Returns the largest of two numbers.
*/
function max(uint256 a, uint256 b) internal pure returns (uint256) {
return a > b ? a : b;
}
/**
* @dev Returns the smallest of two numbers.
*/
function min(uint256 a, uint256 b) internal pure returns (uint256) {
return a < b ? a : b;
}
/**
* @dev Returns the average of two numbers. The result is rounded towards
* zero.
*/
function average(uint256 a, uint256 b) internal pure returns (uint256) {
// (a + b) / 2 can overflow.
return (a & b) + (a ^ b) / 2;
}
/**
* @dev Returns the ceiling of the division of two numbers.
*
* This differs from standard division with `/` in that it rounds up instead
* of rounding down.
*/
function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) {
// (a + b - 1) / b can overflow on addition, so we distribute.
return a == 0 ? 0 : (a - 1) / b + 1;
}
/**
* @notice Calculates floor(x * y / denominator) with full precision. Throws if result overflows a uint256 or denominator == 0
* @dev Original credit to Remco Bloemen under MIT license (https://xn--2-umb.com/21/muldiv)
* with further edits by Uniswap Labs also under MIT license.
*/
function mulDiv(
uint256 x,
uint256 y,
uint256 denominator
) internal pure returns (uint256 result) {
unchecked {
// 512-bit multiply [prod1 prod0] = x * y. Compute the product mod 2^256 and mod 2^256 - 1, then use
// use the Chinese Remainder Theorem to reconstruct the 512 bit result. The result is stored in two 256
// variables such that product = prod1 * 2^256 + prod0.
uint256 prod0; // Least significant 256 bits of the product
uint256 prod1; // Most significant 256 bits of the product
assembly {
let mm := mulmod(x, y, not(0))
prod0 := mul(x, y)
prod1 := sub(sub(mm, prod0), lt(mm, prod0))
}
// Handle non-overflow cases, 256 by 256 division.
if (prod1 == 0) {
return prod0 / denominator;
}
// Make sure the result is less than 2^256. Also prevents denominator == 0.
require(denominator > prod1);
///////////////////////////////////////////////
// 512 by 256 division.
///////////////////////////////////////////////
// Make division exact by subtracting the remainder from [prod1 prod0].
uint256 remainder;
assembly {
// Compute remainder using mulmod.
remainder := mulmod(x, y, denominator)
// Subtract 256 bit number from 512 bit number.
prod1 := sub(prod1, gt(remainder, prod0))
prod0 := sub(prod0, remainder)
}
// Factor powers of two out of denominator and compute largest power of two divisor of denominator. Always >= 1.
// See https://cs.stackexchange.com/q/138556/92363.
// Does not overflow because the denominator cannot be zero at this stage in the function.
uint256 twos = denominator & (~denominator + 1);
assembly {
// Divide denominator by twos.
denominator := div(denominator, twos)
// Divide [prod1 prod0] by twos.
prod0 := div(prod0, twos)
// Flip twos such that it is 2^256 / twos. If twos is zero, then it becomes one.
twos := add(div(sub(0, twos), twos), 1)
}
// Shift in bits from prod1 into prod0.
prod0 |= prod1 * twos;
// Invert denominator mod 2^256. Now that denominator is an odd number, it has an inverse modulo 2^256 such
// that denominator * inv = 1 mod 2^256. Compute the inverse by starting with a seed that is correct for
// four bits. That is, denominator * inv = 1 mod 2^4.
uint256 inverse = (3 * denominator) ^ 2;
// Use the Newton-Raphson iteration to improve the precision. Thanks to Hensel's lifting lemma, this also works
// in modular arithmetic, doubling the correct bits in each step.
inverse *= 2 - denominator * inverse; // inverse mod 2^8
inverse *= 2 - denominator * inverse; // inverse mod 2^16
inverse *= 2 - denominator * inverse; // inverse mod 2^32
inverse *= 2 - denominator * inverse; // inverse mod 2^64
inverse *= 2 - denominator * inverse; // inverse mod 2^128
inverse *= 2 - denominator * inverse; // inverse mod 2^256
// Because the division is now exact we can divide by multiplying with the modular inverse of denominator.
// This will give us the correct result modulo 2^256. Since the preconditions guarantee that the outcome is
// less than 2^256, this is the final result. We don't need to compute the high bits of the result and prod1
// is no longer required.
result = prod0 * inverse;
return result;
}
}
/**
* @notice Calculates x * y / denominator with full precision, following the selected rounding direction.
*/
function mulDiv(
uint256 x,
uint256 y,
uint256 denominator,
Rounding rounding
) internal pure returns (uint256) {
uint256 result = mulDiv(x, y, denominator);
if (rounding == Rounding.Up && mulmod(x, y, denominator) > 0) {
result += 1;
}
return result;
}
/**
* @dev Returns the square root of a number. If the number is not a perfect square, the value is rounded down.
*
* Inspired by Henry S. Warren, Jr.'s "Hacker's Delight" (Chapter 11).
*/
function sqrt(uint256 a) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
// For our first guess, we get the biggest power of 2 which is smaller than the square root of the target.
//
// We know that the "msb" (most significant bit) of our target number `a` is a power of 2 such that we have
// `msb(a) <= a < 2*msb(a)`. This value can be written `msb(a)=2**k` with `k=log2(a)`.
//
// This can be rewritten `2**log2(a) <= a < 2**(log2(a) + 1)`
// → `sqrt(2**k) <= sqrt(a) < sqrt(2**(k+1))`
// → `2**(k/2) <= sqrt(a) < 2**((k+1)/2) <= 2**(k/2 + 1)`
//
// Consequently, `2**(log2(a) / 2)` is a good first approximation of `sqrt(a)` with at least 1 correct bit.
uint256 result = 1 << (log2(a) >> 1);
// At this point `result` is an estimation with one bit of precision. We know the true value is a uint128,
// since it is the square root of a uint256. Newton's method converges quadratically (precision doubles at
// every iteration). We thus need at most 7 iteration to turn our partial result with one bit of precision
// into the expected uint128 result.
unchecked {
result = (result + a / result) >> 1;
result = (result + a / result) >> 1;
result = (result + a / result) >> 1;
result = (result + a / result) >> 1;
result = (result + a / result) >> 1;
result = (result + a / result) >> 1;
result = (result + a / result) >> 1;
return min(result, a / result);
}
}
/**
* @notice Calculates sqrt(a), following the selected rounding direction.
*/
function sqrt(uint256 a, Rounding rounding) internal pure returns (uint256) {
unchecked {
uint256 result = sqrt(a);
return result + (rounding == Rounding.Up && result * result < a ? 1 : 0);
}
}
/**
* @dev Return the log in base 2, rounded down, of a positive value.
* Returns 0 if given 0.
*/
function log2(uint256 value) internal pure returns (uint256) {
uint256 result = 0;
unchecked {
if (value >> 128 > 0) {
value >>= 128;
result += 128;
}
if (value >> 64 > 0) {
value >>= 64;
result += 64;
}
if (value >> 32 > 0) {
value >>= 32;
result += 32;
}
if (value >> 16 > 0) {
value >>= 16;
result += 16;
}
if (value >> 8 > 0) {
value >>= 8;
result += 8;
}
if (value >> 4 > 0) {
value >>= 4;
result += 4;
}
if (value >> 2 > 0) {
value >>= 2;
result += 2;
}
if (value >> 1 > 0) {
result += 1;
}
}
return result;
}
/**
* @dev Return the log in base 2, following the selected rounding direction, of a positive value.
* Returns 0 if given 0.
*/
function log2(uint256 value, Rounding rounding) internal pure returns (uint256) {
unchecked {
uint256 result = log2(value);
return result + (rounding == Rounding.Up && 1 << result < value ? 1 : 0);
}
}
/**
* @dev Return the log in base 10, rounded down, of a positive value.
* Returns 0 if given 0.
*/
function log10(uint256 value) internal pure returns (uint256) {
uint256 result = 0;
unchecked {
if (value >= 10**64) {
value /= 10**64;
result += 64;
}
if (value >= 10**32) {
value /= 10**32;
result += 32;
}
if (value >= 10**16) {
value /= 10**16;
result += 16;
}
if (value >= 10**8) {
value /= 10**8;
result += 8;
}
if (value >= 10**4) {
value /= 10**4;
result += 4;
}
if (value >= 10**2) {
value /= 10**2;
result += 2;
}
if (value >= 10**1) {
result += 1;
}
}
return result;
}
/**
* @dev Return the log in base 10, following the selected rounding direction, of a positive value.
* Returns 0 if given 0.
*/
function log10(uint256 value, Rounding rounding) internal pure returns (uint256) {
unchecked {
uint256 result = log10(value);
return result + (rounding == Rounding.Up && 10**result < value ? 1 : 0);
}
}
/**
* @dev Return the log in base 256, rounded down, of a positive value.
* Returns 0 if given 0.
*
* Adding one to the result gives the number of pairs of hex symbols needed to represent `value` as a hex string.
*/
function log256(uint256 value) internal pure returns (uint256) {
uint256 result = 0;
unchecked {
if (value >> 128 > 0) {
value >>= 128;
result += 16;
}
if (value >> 64 > 0) {
value >>= 64;
result += 8;
}
if (value >> 32 > 0) {
value >>= 32;
result += 4;
}
if (value >> 16 > 0) {
value >>= 16;
result += 2;
}
if (value >> 8 > 0) {
result += 1;
}
}
return result;
}
/**
* @dev Return the log in base 10, following the selected rounding direction, of a positive value.
* Returns 0 if given 0.
*/
function log256(uint256 value, Rounding rounding) internal pure returns (uint256) {
unchecked {
uint256 result = log256(value);
return result + (rounding == Rounding.Up && 1 << (result * 8) < value ? 1 : 0);
}
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.0) (utils/Strings.sol)
pragma solidity ^0.8.0;
import "./math/Math.sol";
/**
* @dev String operations.
*/
library Strings {
bytes16 private constant _SYMBOLS = "0123456789abcdef";
uint8 private constant _ADDRESS_LENGTH = 20;
/**
* @dev Converts a `uint256` to its ASCII `string` decimal representation.
*/
function toString(uint256 value) internal pure returns (string memory) {
unchecked {
uint256 length = Math.log10(value) + 1;
string memory buffer = new string(length);
uint256 ptr;
/// @solidity memory-safe-assembly
assembly {
ptr := add(buffer, add(32, length))
}
while (true) {
ptr--;
/// @solidity memory-safe-assembly
assembly {
mstore8(ptr, byte(mod(value, 10), _SYMBOLS))
}
value /= 10;
if (value == 0) break;
}
return buffer;
}
}
/**
* @dev Converts a `uint256` to its ASCII `string` hexadecimal representation.
*/
function toHexString(uint256 value) internal pure returns (string memory) {
unchecked {
return toHexString(value, Math.log256(value) + 1);
}
}
/**
* @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length.
*/
function toHexString(uint256 value, uint256 length) internal pure returns (string memory) {
bytes memory buffer = new bytes(2 * length + 2);
buffer[0] = "0";
buffer[1] = "x";
for (uint256 i = 2 * length + 1; i > 1; --i) {
buffer[i] = _SYMBOLS[value & 0xf];
value >>= 4;
}
require(value == 0, "Strings: hex length insufficient");
return string(buffer);
}
/**
* @dev Converts an `address` with fixed length of 20 bytes to its not checksummed ASCII `string` hexadecimal representation.
*/
function toHexString(address addr) internal pure returns (string memory) {
return toHexString(uint256(uint160(addr)), _ADDRESS_LENGTH);
}
}// SPDX-License-Identifier: MIT
pragma solidity 0.8.28;
import {AccessControl} from "@openzeppelin/contracts/access/AccessControl.sol";
abstract contract AccessControlVFExtension is AccessControl {
error AccessControlVFExtension_CallerDoesNotHaveMinterRole();
error AccessControlVFExtension_CallerDoesNotHaveBurnerRole();
bytes32 public constant MINTER_ROLE = keccak256("MINTER_ROLE");
bytes32 public constant BURNER_ROLE = keccak256("BURNER_ROLE");
constructor(address admin) {
_grantRole(DEFAULT_ADMIN_ROLE, admin);
_grantRole(MINTER_ROLE, admin);
_grantRole(BURNER_ROLE, admin);
}
modifier onlyMinter() {
_requireMinter();
_;
}
modifier onlyBurner() {
_requireBurner();
_;
}
function _requireMinter() internal view {
if (!hasRole(MINTER_ROLE, msg.sender)) {
revert AccessControlVFExtension_CallerDoesNotHaveMinterRole();
}
}
function _requireBurner() internal view {
if (!hasRole(BURNER_ROLE, msg.sender)) {
revert AccessControlVFExtension_CallerDoesNotHaveBurnerRole();
}
}
}// SPDX-License-Identifier: MIT
pragma solidity 0.8.28;
import {OwnablePermissions} from "@limitbreak/creator-token-standards/src/access/OwnablePermissions.sol";
import {Ownable} from "@openzeppelin/contracts/access/Ownable.sol";
abstract contract OwnableVFExtension is OwnablePermissions, Ownable {
function _requireCallerIsContractOwner() internal view virtual override {
_checkOwner();
}
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.28;
import {IERC721VFC} from "./IERC721VFC.sol";
import {IERC2981} from "@openzeppelin/contracts/interfaces/IERC2981.sol";
import {IERC721} from "@openzeppelin/contracts/token/ERC721/IERC721.sol";
import {IERC721Metadata} from "@openzeppelin/contracts/token/ERC721/extensions/IERC721Metadata.sol";
import {IERC721Receiver} from "@openzeppelin/contracts/token/ERC721/IERC721Receiver.sol";
import {Address} from "@openzeppelin/contracts/utils/Address.sol";
import {Context} from "@openzeppelin/contracts/utils/Context.sol";
import {Strings} from "@openzeppelin/contracts/utils/Strings.sol";
import {ERC165} from "@openzeppelin/contracts/utils/introspection/ERC165.sol";
import {IERC165} from "@openzeppelin/contracts/utils/introspection/IERC165.sol";
import {ERC2981} from "@openzeppelin/contracts/token/common/ERC2981.sol";
import {AutomaticValidatorTransferApproval} from "@limitbreak/creator-token-standards/src/utils/AutomaticValidatorTransferApproval.sol";
import {CreatorTokenBase, ICreatorToken, ICreatorTokenLegacy} from "@limitbreak/creator-token-standards/src/utils/CreatorTokenBase.sol";
import {BasicRoyalties} from "@limitbreak/creator-token-standards/src/programmable-royalties/BasicRoyalties.sol";
import {ITransferValidatorSetTokenType} from "@limitbreak/creator-token-standards/src/interfaces/ITransferValidatorSetTokenType.sol";
import {TOKEN_TYPE_ERC721} from "@limitbreak/permit-c/src/Constants.sol";
/**
* @dev Implementation of https://eips.ethereum.org/EIPS/eip-721[ERC721] Non-Fungible Token Standard, including
* the Metadata extension.
*/
abstract contract ERC721VFC is
Context,
ERC165,
IERC721VFC,
CreatorTokenBase,
AutomaticValidatorTransferApproval,
BasicRoyalties
{
using Address for address;
using Strings for uint256;
// Token name
string private _name;
// Token symbol
string private _symbol;
// Mapping from token ID to owner address
mapping(uint256 tokenId => address owner) private _owners;
// Mapping owner address to token count
mapping(address owner => uint256 balance) private _balances;
// Mapping from token ID to approved address
mapping(uint256 tokenId => address approved) private _tokenApprovals;
// Mapping from owner to operator approvals
mapping(address owner => mapping(address operator => bool approved))
private _operatorApprovals;
// The number of tokens minted
uint256 private _mintCounter;
// The number of tokens burned
uint256 private _burnCounter;
//Flag to permanently lock minting
bool public mintingPermanentlyLocked;
//Flag to activate or disable minting
bool public isMintActive;
//Flag to activate or disable burning
bool public isBurnActive;
address public constant DEAD_ADDRESS =
address(0x000000000000000000000000000000000000dEaD);
/**
* @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_;
}
modifier notLocked() virtual {
if (mintingPermanentlyLocked) {
revert ERC721VFMintingPermanentlyLocked();
}
_;
}
modifier mintActive() virtual {
if (!isMintActive) {
revert ERC721VFMintIsNotActive();
}
_;
}
modifier burnActive() virtual {
if (!isBurnActive) {
revert ERC721VFBurnIsNotActive();
}
_;
}
/**
* @dev See {IERC165-supportsInterface}.
*/
function supportsInterface(
bytes4 interfaceId
) public view virtual override(ERC165, IERC165, ERC2981) returns (bool) {
return
interfaceId == type(IERC721).interfaceId ||
interfaceId == type(IERC721Metadata).interfaceId ||
interfaceId == type(ICreatorToken).interfaceId ||
interfaceId == type(ICreatorTokenLegacy).interfaceId ||
interfaceId == type(IERC2981).interfaceId ||
interfaceId == type(IERC721VFC).interfaceId ||
super.supportsInterface(interfaceId);
}
/**
* @dev See {IERC721-balanceOf}.
*/
function balanceOf(
address owner
) public view virtual override returns (uint256) {
if (owner == address(0)) {
revert ERC721VFAddressZeroIsNotAValidOwner();
}
return _balances[owner];
}
/**
* @dev See {IERC721-ownerOf}.
*/
function ownerOf(
uint256 tokenId
) public view virtual override returns (address owner) {
owner = _ownerOf(tokenId);
if (owner == address(0)) {
revert ERC721VFInvalidTokenID(tokenId);
}
}
/**
* @dev See {IERC721Metadata-name}.
*/
function name() public view virtual override returns (string memory) {
return _name;
}
/**
* @dev See {IERC721Metadata-symbol}.
*/
function symbol() public view virtual override returns (string memory) {
return _symbol;
}
/**
* @dev See {IERC721Metadata-tokenURI}.
*/
function tokenURI(
uint256 tokenId
) public view virtual override returns (string memory) {
_requireMinted(tokenId);
string memory baseURI = _baseURI();
return
bytes(baseURI).length > 0
? string(abi.encodePacked(baseURI, tokenId.toString()))
: "";
}
/**
* @dev Base URI for computing {tokenURI}. If set, the resulting URI for each
* token will be the concatenation of the `baseURI` and the `tokenId`. Empty
* by default, can be overridden in child contracts.
*/
function _baseURI() internal view virtual returns (string memory) {
return "";
}
/**
* @dev See {IERC721-approve}.
*/
function approve(address to, uint256 tokenId) public virtual override {
address owner = ownerOf(tokenId);
if (to == owner) {
revert ERC721VFApprovalToCurrentOwner(to, tokenId);
}
if (_msgSender() != owner && !isApprovedForAll(owner, _msgSender())) {
revert ERC721VFApproveCallerIsNotTokenOwnerOrApprovedForAll(
to,
tokenId
);
}
_approve(to, tokenId);
}
/**
* @dev See {IERC721-getApproved}.
*/
function getApproved(
uint256 tokenId
) public view virtual override returns (address) {
_requireMinted(tokenId);
return _tokenApprovals[tokenId];
}
/**
* @dev See {IERC721-setApprovalForAll}.
*/
function setApprovalForAll(
address operator,
bool approved
) public virtual override {
_setApprovalForAll(_msgSender(), operator, approved);
}
/**
* @dev See {IERC721-isApprovedForAll}.
*/
function isApprovedForAll(
address owner,
address operator
) public view virtual override returns (bool isApproved) {
isApproved = _operatorApprovals[owner][operator];
if (!isApproved) {
if (autoApproveTransfersFromValidator) {
isApproved = operator == address(getTransferValidator());
}
}
}
/**
* @dev See {IERC721-transferFrom}.
*/
function transferFrom(
address from,
address to,
uint256 tokenId
) public virtual override {
_transferFrom(from, to, tokenId, true);
}
/**
* @dev See {IERC721-safeTransferFrom}.
*/
function safeTransferFrom(
address from,
address to,
uint256 tokenId
) public virtual override {
_safeTransferFrom(from, to, tokenId, true);
}
/**
* @dev See {IERC721-safeTransferFrom}.
*/
function safeTransferFrom(
address from,
address to,
uint256 tokenId,
bytes memory data
) public virtual override {
_safeTransferFrom(from, to, tokenId, true, data);
}
/**
* @dev See {IERC721VF-totalSupply}.
*/
function totalSupply() public view returns (uint256) {
unchecked {
return _mintCounter - _burnCounter;
}
}
/**
* @dev See {IERC721VF-totalMinted}.
*/
function totalMinted() public view returns (uint256) {
return _mintCounter;
}
/**
* @dev See {IERC721VF-totalBurned}.
*/
function totalBurned() public view returns (uint256) {
return _burnCounter;
}
/**
* @dev See {IERC721VF-tokensOfOwner}.
*/
function tokensOfOwner(
address owner
) public view returns (uint256[] memory ownerTokens) {
address currentOwnerAddress;
uint256 tokenCount = balanceOf(owner);
if (tokenCount == 0) {
return new uint256[](0);
} else {
uint256[] memory result = new uint256[](tokenCount);
uint256 resultIndex;
uint256 index;
for (index; resultIndex != tokenCount; index++) {
currentOwnerAddress = _owners[index];
if (currentOwnerAddress == owner) {
result[resultIndex++] = index;
}
}
return result;
}
}
/**
* @dev See {IERC721VF-tokensOfOwnerIn}.
*/
function tokensOfOwnerIn(
address owner,
uint256 startIndex,
uint256 endIndex
) public view returns (uint256[] memory ownerTokens) {
address currentOwnerAddress;
uint256 tokenCount = balanceOf(owner);
if (tokenCount == 0) {
return new uint256[](0);
} else {
uint256[] memory result = new uint256[](tokenCount);
uint256 resultIndex;
uint256 index = startIndex;
for (index; index <= endIndex; index++) {
currentOwnerAddress = _owners[index];
if (currentOwnerAddress == owner) {
result[resultIndex++] = index;
}
}
// Downsize the array to fit.
assembly {
mstore(result, resultIndex)
}
return result;
}
}
/**
* @dev See {IERC2981-setDefaultRoyalty}.
*/
function setDefaultRoyalty(address receiver, uint96 feeNumerator) public {
_requireCallerIsContractOwner();
_setDefaultRoyalty(receiver, feeNumerator);
}
/**
* @dev See {IERC2981-setTokenRoyalty}.
*/
function setTokenRoyalty(
uint256 tokenId,
address receiver,
uint96 feeNumerator
) public {
_requireCallerIsContractOwner();
_setTokenRoyalty(tokenId, receiver, feeNumerator);
}
/**
* @dev See {IERC721VF-lockMintingPermanently}.
*/
function lockMintingPermanently() external notLocked {
_requireCallerIsContractOwner();
_lockMintingPermanently();
}
/**
* @dev See {IERC721VF-toggleMintActive}.
*/
function toggleMintActive() external notLocked {
_requireCallerIsContractOwner();
_toggleMintActive();
}
/**
* @dev See {IERC721VF-toggleBurnActive}.
*/
function toggleBurnActive() external {
_requireCallerIsContractOwner();
_toggleBurnActive();
}
/**
* @dev See {IERC721-transferFrom}.
*/
function _transferFrom(
address from,
address to,
uint256 tokenId,
bool approvalCheck
) internal virtual {
//solhint-disable-next-line max-line-length
if (approvalCheck) {
if (!_isApprovedOrOwner(_msgSender(), tokenId)) {
revert ERC721VFCallerIsNotTokenOwnerOrApproved(
from,
to,
tokenId
);
}
}
_transfer(from, to, tokenId);
}
/**
* @dev See {IERC721-safeTransferFrom}.
*/
function _safeTransferFrom(
address from,
address to,
uint256 tokenId,
bool approvalCheck
) internal virtual {
_safeTransferFrom(from, to, tokenId, approvalCheck, "");
}
/**
* @dev See {IERC721-safeTransferFrom}.
*/
function _safeTransferFrom(
address from,
address to,
uint256 tokenId,
bool approvalCheck,
bytes memory data
) internal virtual {
if (approvalCheck) {
if (!_isApprovedOrOwner(_msgSender(), tokenId)) {
revert ERC721VFCallerIsNotTokenOwnerOrApproved(
from,
to,
tokenId
);
}
}
_safeTransfer(from, to, tokenId, data);
}
/**
* @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients
* are aware of the ERC721 protocol to prevent tokens from being forever locked.
*
* `data` is additional data, it has no specified format and it is sent in call to `to`.
*
* This internal function is equivalent to {safeTransferFrom}, and can be used to e.g.
* implement alternative mechanisms to perform token transfer, such as signature-based.
*
* Requirements:
*
* - `from` cannot be the zero address.
* - `to` cannot be the zero address.
* - `tokenId` token must exist and be owned by `from`.
* - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
*
* Emits a {Transfer} event.
*/
function _safeTransfer(
address from,
address to,
uint256 tokenId,
bytes memory data
) internal virtual {
_transfer(from, to, tokenId);
_checkOnERC721Received(from, to, tokenId, data);
}
/**
* @dev Returns the owner of the `tokenId`. Does NOT revert if token doesn't exist
*/
function _ownerOf(uint256 tokenId) internal view virtual returns (address) {
return _owners[tokenId];
}
/**
* @dev Returns whether `tokenId` exists.
*
* Tokens can be managed by their owner or approved accounts via {approve} or {setApprovalForAll}.
*
* Tokens start existing when they are minted (`_mint`),
* and stop existing when they are burned (`_burn`).
*/
function _exists(uint256 tokenId) internal view virtual returns (bool) {
return _ownerOf(tokenId) != address(0);
}
/**
* @dev Returns whether `spender` is allowed to manage `tokenId`.
*
* Requirements:
*
* - `tokenId` must exist.
*/
function _isApprovedOrOwner(
address spender,
uint256 tokenId
) internal view virtual returns (bool) {
address owner = ownerOf(tokenId);
return (spender == owner ||
isApprovedForAll(owner, spender) ||
getApproved(tokenId) == spender);
}
/**
* @dev Permanently lock minting
*
* Requirements:
*
* - the caller must be an admin role
*/
function _lockMintingPermanently() internal {
mintingPermanentlyLocked = true;
emit MintingPermanentlyLocked();
}
/**
* @dev Set the active/inactive state of minting
*
* Requirements:
*
* - the caller must be an admin role
*/
function _toggleMintActive() internal {
isMintActive = !isMintActive;
emit MintActiveToggled(isMintActive);
}
/**
* @dev Batch mints tokens starting at `startTokenId` until `quantity` is met and transfers them to `to`.
*
* Requirements:
*
* - `tokenId` must not exist.
* - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
*
* Emits a {Transfer} event.
*/
function _mintBatchByTokenIds(
address to,
uint256[] calldata tokenIds
) internal virtual {
for (uint256 i; i < tokenIds.length; i++) {
if (to == address(0)) {
revert ERC721VFMintToTheZeroAddress();
}
if (to == DEAD_ADDRESS) {
revert ERC721VFMintToTheDeadAddress();
}
if (_exists(tokenIds[i])) {
revert ERC721VFTokenAlreadyMinted(tokenIds[i]);
}
_beforeTokenTransfer(address(0), to, tokenIds[i], 1);
_owners[tokenIds[i]] = to;
emit Transfer(address(0), to, tokenIds[i]);
_afterTokenTransfer(address(0), to, tokenIds[i], 1);
}
unchecked {
_balances[to] += tokenIds.length;
_mintCounter += tokenIds.length;
}
}
/**
* @dev Mints `tokenId` and transfers it to `to`.
*
* WARNING: Usage of this method is discouraged, use {_safeMint} whenever possible
*
* Requirements:
*
* - `tokenId` must not exist.
* - `to` cannot be the zero address.
*
* Emits a {Transfer} event.
*/
function _mint(address to, uint256 tokenId) internal virtual {
if (to == address(0)) {
revert ERC721VFMintToTheZeroAddress();
}
if (_exists(tokenId)) {
revert ERC721VFTokenAlreadyMinted(tokenId);
}
_beforeTokenTransfer(address(0), to, tokenId, 1);
unchecked {
// Will not overflow unless all 2**256 token ids are minted to the same owner.
// Given that tokens are minted one by one, it is impossible in practice that
// this ever happens. Might change if we allow batch minting.
// The ERC fails to describe this case.
_balances[to] += 1;
}
_owners[tokenId] = to;
unchecked {
_mintCounter++;
}
emit Transfer(address(0), to, tokenId);
_afterTokenTransfer(address(0), to, tokenId, 1);
}
/**
* @dev Set the active/inactive state of burning
*
* Requirements:
*
* - the caller must be an admin role
*/
function _toggleBurnActive() internal {
isBurnActive = !isBurnActive;
emit BurnActiveToggled(isBurnActive);
}
/**
* @dev Burns `tokenIds` and transfers them to the burn island.
*
* Requirements:
*
* - `tokenIds` must exist.
*/
function _burnBatch(
address from,
uint256[] calldata tokenIds
) internal virtual {
_burnBatch(from, tokenIds, true);
}
/**
* @dev Burns `tokenIds` and transfers them to the burn island.
*
* Requirements:
*
* - `tokenIds` must exist.
*/
function _burnBatch(
address from,
uint256[] calldata tokenIds,
bool approvalCheck
) internal virtual {
if (approvalCheck) {
for (uint256 i; i < tokenIds.length; i++) {
if (!_isApprovedOrOwner(from, tokenIds[i])) {
revert ERC721VFBurnCallerIsNotTokenOwnerOrApproved(
from,
tokenIds[i]
);
}
}
}
_burnBatch(tokenIds);
}
/**
* @dev Burns `tokenIds` and transfers them to the burn island.
*
* Requirements:
*
* - `tokenIds` must exist.
*/
function _burnBatch(uint256[] calldata tokenIds) internal virtual {
for (uint256 i; i < tokenIds.length; i++) {
uint256 tokenId = tokenIds[i];
address owner = ownerOf(tokenId);
if (owner == DEAD_ADDRESS) {
revert ERC721VFTokenAlreadyBurned(tokenId);
}
_beforeTokenTransfer(owner, DEAD_ADDRESS, tokenId, 1);
// Clear approvals
delete _tokenApprovals[tokenId];
unchecked {
// Cannot overflow, as that would require more tokens to be burned/transferred
// out than the owner initially received through minting and transferring in.
_balances[owner] -= 1;
_balances[DEAD_ADDRESS] += 1;
}
_owners[tokenId] = DEAD_ADDRESS;
emit Transfer(owner, DEAD_ADDRESS, tokenId);
_afterTokenTransfer(owner, DEAD_ADDRESS, tokenId, 1);
}
unchecked {
_burnCounter += tokenIds.length;
}
}
/**
* @dev Transfers `tokenId` from `from` to `to`.
* As opposed to {transferFrom}, this imposes no restrictions on msg.sender.
*
* Requirements:
*
* - `to` cannot be the zero address.
* - `tokenId` token must be owned by `from`.
*
* Emits a {Transfer} event.
*/
function _transfer(
address from,
address to,
uint256 tokenId
) internal virtual {
if (to == address(0)) {
revert ERC721VFTransferToTheZeroAddress();
}
if (to == DEAD_ADDRESS) {
revert ERC721VFTransferToTheDeadAddress();
}
if (ownerOf(tokenId) != from) {
revert ERC721VFTransferFromIncorrectOwner(from, tokenId);
}
_beforeTokenTransfer(from, to, tokenId, 1);
// Clear approvals from the previous owner
delete _tokenApprovals[tokenId];
unchecked {
// `_balances[from]` cannot overflow for the same reason as described in `_burn`:
// `from`'s balance is the number of token held, which is at least one before the current
// transfer.
// `_balances[to]` could overflow in the conditions described in `_mint`. That would require
// all 2**256 token ids to be minted, which in practice is impossible.
_balances[from] -= 1;
_balances[to] += 1;
}
_owners[tokenId] = to;
emit Transfer(from, to, tokenId);
_afterTokenTransfer(from, to, tokenId, 1);
}
/**
* @dev Approve `to` to operate on `tokenId`
*
* Emits an {Approval} event.
*/
function _approve(address to, uint256 tokenId) internal virtual {
_tokenApprovals[tokenId] = to;
emit Approval(ownerOf(tokenId), to, tokenId);
}
/**
* @dev Approve `operator` to operate on all of `owner` tokens
*
* Emits an {ApprovalForAll} event.
*/
function _setApprovalForAll(
address owner,
address operator,
bool approved
) internal virtual {
if (owner == operator) {
revert ERC721VFApproveToCaller();
}
_operatorApprovals[owner][operator] = approved;
emit ApprovalForAll(owner, operator, approved);
}
/**
* @dev Reverts if the `tokenId` has not been minted yet.
*/
function _requireMinted(uint256 tokenId) internal view virtual {
if (!_exists(tokenId)) {
revert ERC721VFInvalidTokenID(tokenId);
}
}
/**
* @dev See {IERC721-onERC721Received}.
*/
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 ERC721VFTransferToNonERC721VFReceiverImplementer(
to,
tokenId
);
}
} catch (bytes memory reason) {
if (reason.length == 0) {
revert ERC721VFTransferToNonERC721VFReceiverImplementer(
to,
tokenId
);
} else {
/// @solidity memory-safe-assembly
assembly {
revert(add(32, reason), mload(reason))
}
}
}
}
}
/**
* @dev See {IERC721-getTransferValidationFunction}.
*/
function getTransferValidationFunction()
external
pure
returns (bytes4 functionSignature, bool isViewFunction)
{
functionSignature = bytes4(
keccak256("validateTransfer(address,address,address,uint256)")
);
isViewFunction = true;
}
/**
* @dev Hook that is called before any token transfer. This includes minting
* and burning.
*
* Calling conditions:
*
* - When `from` and `to` are both non-zero, ``from``'s `tokenId` will be
* transferred to `to`.
* - When `from` is zero, `tokenId` will be minted for `to`.
* - When `to` is zero, ``from``'s `tokenId` will be burned.
* - `from` and `to` are never both zero.
* - `batchSize` is non-zero.
*
* To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].
*/
function _beforeTokenTransfer(
address from,
address to,
uint256 firstTokenId,
uint256 batchSize
) internal virtual {
for (uint256 i; i < batchSize; ) {
_validateBeforeTransfer(from, to, firstTokenId + i);
unchecked {
++i;
}
}
}
/**
* @dev Hook that is called after any token transfer. This includes minting and burning. If {ERC721Consecutive} is
* used, the hook may be called as part of a consecutive (batch) mint, as indicated by `batchSize` greater than 1.
*
* Calling conditions:
*
* - When `from` and `to` are both non-zero, ``from``'s tokens were transferred to `to`.
* - When `from` is zero, the tokens were minted for `to`.
* - When `to` is zero, ``from``'s tokens were burned.
* - `from` and `to` are never both zero.
* - `batchSize` is non-zero.
*
* To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].
*/
function _afterTokenTransfer(
address from,
address to,
uint256 firstTokenId,
uint256 batchSize
) internal virtual {
for (uint256 i; i < batchSize; ) {
_validateAfterTransfer(from, to, firstTokenId + i);
unchecked {
++i;
}
}
}
/**
* @dev See {IERC721-getTokenType}.
*/
function _tokenType() internal pure override returns (uint16) {
return uint16(TOKEN_TYPE_ERC721);
}
}// SPDX-License-Identifier: MIT
pragma solidity 0.8.28;
import "@openzeppelin/contracts/utils/introspection/IERC165.sol";
/**
* @dev Required interface of an ERC721VF compliant contract.
*/
interface IERC721VFC is IERC165 {
error ERC721VFAddressZeroIsNotAValidOwner();
error ERC721VFInvalidTokenID(uint256 tokenId);
error ERC721VFApprovalToCurrentOwner(address to, uint256 tokenId);
error ERC721VFApproveCallerIsNotTokenOwnerOrApprovedForAll(
address to,
uint256 tokenId
);
error ERC721VFCallerIsNotTokenOwnerOrApproved(
address from,
address to,
uint256 tokenId
);
error ERC721VFTransferToNonERC721VFReceiverImplementer(
address to,
uint256 tokenId
);
error ERC721VFAddressAndQuantitiesNeedToBeEqualLength();
error ERC721VFMintToTheZeroAddress();
error ERC721VFTokenAlreadyMinted(uint256 tokenId);
error ERC721VFTransferToTheZeroAddress();
error ERC721VFTransferFromIncorrectOwner(address from, uint256 tokenId);
error ERC721VFApproveToCaller();
error ERC721VFBurnCallerIsNotTokenOwnerOrApproved(
address from,
uint256 tokenId
);
error ERC721VFMintingPermanentlyLocked();
error ERC721VFMintIsNotActive();
error ERC721VFBurnIsNotActive();
error ERC721VFBurnToInvalidAddress(address to);
error ERC721VFInvalidSignature();
error ERC721VFTokenAlreadyBurned(uint256 tokenId);
error ERC721VFTransferToTheDeadAddress();
error ERC721VFMintToTheDeadAddress();
/**
* @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 Emitted when minting is permanently locked.
*/
event MintingPermanentlyLocked();
/**
* @dev Emitted when mint active state is toggled.
*/
event MintActiveToggled(bool isActive);
/**
* @dev Emitted when burn active state is toggled.
*/
event BurnActiveToggled(bool isActive);
/**
* @dev Emitted when the signer address is updated.
*/
event SignerUpdated(address indexed newSigner);
/**
* @dev Emitted when the base URI is updated.
*/
event BaseURIUpdated(string newBaseURI);
/**
* @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);
/**
* @dev Returns the number of tokens in ``owner``'s account.
*/
function balanceOf(address owner) external view returns (uint256 balance);
/**
* @dev Returns the owner of the `tokenId` token.
*
* Requirements:
*
* - `tokenId` must exist.
*/
function ownerOf(uint256 tokenId) external view returns (address owner);
/**
* @dev Safely transfers `tokenId` token from `from` to `to`.
*
* Requirements:
*
* - `from` cannot be the zero address.
* - `to` cannot be the zero address.
* - `tokenId` token must exist and be owned by `from`.
* - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.
* - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
*
* Emits a {Transfer} event.
*/
function safeTransferFrom(
address from,
address to,
uint256 tokenId,
bytes calldata data
) external;
/**
* @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients
* are aware of the ERC721 protocol to prevent tokens from being forever locked.
*
* Requirements:
*
* - `from` cannot be the zero address.
* - `to` cannot be the zero address.
* - `tokenId` token must exist and be owned by `from`.
* - If the caller is not `from`, it must have been allowed to move this token by either {approve} or {setApprovalForAll}.
* - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
*
* Emits a {Transfer} event.
*/
function safeTransferFrom(
address from,
address to,
uint256 tokenId
) external;
/**
* @dev Transfers `tokenId` token from `from` to `to`.
*
* WARNING: Note that the caller is responsible to confirm that the recipient is capable of receiving ERC721
* or else they may be permanently lost. Usage of {safeTransferFrom} prevents loss, though the caller must
* understand this adds an external call which potentially creates a reentrancy vulnerability.
*
* Requirements:
*
* - `from` cannot be the zero address.
* - `to` cannot be the zero address.
* - `tokenId` token must be owned by `from`.
* - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.
*
* Emits a {Transfer} event.
*/
function transferFrom(
address from,
address to,
uint256 tokenId
) external;
/**
* @dev Gives permission to `to` to transfer `tokenId` token to another account.
* The approval is cleared when the token is transferred.
*
* Only a single account can be approved at a time, so approving the zero address clears previous approvals.
*
* Requirements:
*
* - The caller must own the token or be an approved operator.
* - `tokenId` must exist.
*
* Emits an {Approval} event.
*/
function approve(address to, uint256 tokenId) external;
/**
* @dev Approve or remove `operator` as an operator for the caller.
* Operators can call {transferFrom} or {safeTransferFrom} for any token owned by the caller.
*
* Requirements:
*
* - The `operator` cannot be the caller.
*
* Emits an {ApprovalForAll} event.
*/
function setApprovalForAll(address operator, bool _approved) external;
/**
* @dev Returns the account approved for `tokenId` token.
*
* Requirements:
*
* - `tokenId` must exist.
*/
function getApproved(uint256 tokenId)
external
view
returns (address operator);
/**
* @dev Returns if the `operator` is allowed to manage all of the assets of `owner`.
*
* See {setApprovalForAll}
*/
function isApprovedForAll(address owner, address operator)
external
view
returns (bool);
}{
"evmVersion": "cancun",
"optimizer": {
"enabled": true,
"runs": 200
},
"outputSelection": {
"*": {
"*": [
"evm.bytecode",
"evm.deployedBytecode",
"devdoc",
"userdoc",
"metadata",
"abi"
]
}
},
"remappings": [
"npm/@limitbreak/[email protected]/:@openzeppelin/contracts/=npm/@openzeppelin/[email protected]/",
"npm/@limitbreak/[email protected]/:@openzeppelin/contracts/=npm/@openzeppelin/[email protected]/",
"npm/@limitbreak/[email protected]/:@openzeppelin/contracts/=npm/@openzeppelin/[email protected]/",
"project/:@limitbreak/creator-token-standards/=npm/@limitbreak/[email protected]/",
"project/:@limitbreak/creator-token-standards/=npm/@limitbreak/[email protected]/",
"project/:@limitbreak/creator-token-standards/=npm/@limitbreak/[email protected]/",
"project/:@limitbreak/creator-token-standards/=npm/@limitbreak/[email protected]/",
"project/:@limitbreak/creator-token-standards/=npm/@limitbreak/[email protected]/",
"project/:@limitbreak/creator-token-standards/=npm/@limitbreak/[email protected]/",
"project/:@limitbreak/permit-c/=npm/@limitbreak/[email protected]/",
"project/:@openzeppelin/contracts/=npm/@openzeppelin/[email protected]/",
"project/:@openzeppelin/contracts/=npm/@openzeppelin/[email protected]/",
"project/:@openzeppelin/contracts/=npm/@openzeppelin/[email protected]/",
"project/:@openzeppelin/contracts/=npm/@openzeppelin/[email protected]/",
"project/:@openzeppelin/contracts/=npm/@openzeppelin/[email protected]/",
"project/:@openzeppelin/contracts/=npm/@openzeppelin/[email protected]/",
"project/:@openzeppelin/contracts/=npm/@openzeppelin/[email protected]/",
"project/:@openzeppelin/contracts/=npm/@openzeppelin/[email protected]/",
"project/:@openzeppelin/contracts/=npm/@openzeppelin/[email protected]/",
"project/:@openzeppelin/contracts/=npm/@openzeppelin/[email protected]/",
"project/:@openzeppelin/contracts/=npm/@openzeppelin/[email protected]/",
"project/:@openzeppelin/contracts/=npm/@openzeppelin/[email protected]/",
"project/:@openzeppelin/contracts/=npm/@openzeppelin/[email protected]/",
"project/:@openzeppelin/contracts/=npm/@openzeppelin/[email protected]/",
"project/:@openzeppelin/contracts/=npm/@openzeppelin/[email protected]/",
"project/:@openzeppelin/contracts/=npm/@openzeppelin/[email protected]/",
"project/:@openzeppelin/contracts/=npm/@openzeppelin/[email protected]/"
]
}Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
Contract ABI
API[{"inputs":[{"internalType":"address","name":"royaltyReceiver_","type":"address"},{"internalType":"uint96","name":"royaltyFeeNumerator_","type":"uint96"},{"internalType":"string","name":"name_","type":"string"},{"internalType":"string","name":"symbol_","type":"string"},{"internalType":"string","name":"initialBaseUri_","type":"string"},{"internalType":"address","name":"signer_","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"AccessControlVFExtension_CallerDoesNotHaveBurnerRole","type":"error"},{"inputs":[],"name":"AccessControlVFExtension_CallerDoesNotHaveMinterRole","type":"error"},{"inputs":[],"name":"CreatorTokenBase__InvalidTransferValidatorContract","type":"error"},{"inputs":[],"name":"ERC721VFAddressAndQuantitiesNeedToBeEqualLength","type":"error"},{"inputs":[],"name":"ERC721VFAddressZeroIsNotAValidOwner","type":"error"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"ERC721VFApprovalToCurrentOwner","type":"error"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"ERC721VFApproveCallerIsNotTokenOwnerOrApprovedForAll","type":"error"},{"inputs":[],"name":"ERC721VFApproveToCaller","type":"error"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"ERC721VFBurnCallerIsNotTokenOwnerOrApproved","type":"error"},{"inputs":[],"name":"ERC721VFBurnIsNotActive","type":"error"},{"inputs":[{"internalType":"address","name":"to","type":"address"}],"name":"ERC721VFBurnToInvalidAddress","type":"error"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"ERC721VFCallerIsNotTokenOwnerOrApproved","type":"error"},{"inputs":[],"name":"ERC721VFInvalidSignature","type":"error"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"ERC721VFInvalidTokenID","type":"error"},{"inputs":[],"name":"ERC721VFMintIsNotActive","type":"error"},{"inputs":[],"name":"ERC721VFMintToTheDeadAddress","type":"error"},{"inputs":[],"name":"ERC721VFMintToTheZeroAddress","type":"error"},{"inputs":[],"name":"ERC721VFMintingPermanentlyLocked","type":"error"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"ERC721VFTokenAlreadyBurned","type":"error"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"ERC721VFTokenAlreadyMinted","type":"error"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"ERC721VFTransferFromIncorrectOwner","type":"error"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"ERC721VFTransferToNonERC721VFReceiverImplementer","type":"error"},{"inputs":[],"name":"ERC721VFTransferToTheDeadAddress","type":"error"},{"inputs":[],"name":"ERC721VFTransferToTheZeroAddress","type":"error"},{"inputs":[],"name":"ShouldNotMintToBurnAddress","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":false,"internalType":"bool","name":"autoApproved","type":"bool"}],"name":"AutomaticApprovalOfTransferValidatorSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"string","name":"newBaseURI","type":"string"}],"name":"BaseURIUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"bool","name":"isActive","type":"bool"}],"name":"BurnActiveToggled","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"receiver","type":"address"},{"indexed":false,"internalType":"uint96","name":"feeNumerator","type":"uint96"}],"name":"DefaultRoyaltySet","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"bool","name":"isActive","type":"bool"}],"name":"MintActiveToggled","type":"event"},{"anonymous":false,"inputs":[],"name":"MintingPermanentlyLocked","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":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"previousAdminRole","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"newAdminRole","type":"bytes32"}],"name":"RoleAdminChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleGranted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleRevoked","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"newSigner","type":"address"}],"name":"SignerUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"},{"indexed":true,"internalType":"address","name":"receiver","type":"address"},{"indexed":false,"internalType":"uint96","name":"feeNumerator","type":"uint96"}],"name":"TokenRoyaltySet","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Transfer","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"oldValidator","type":"address"},{"indexed":false,"internalType":"address","name":"newValidator","type":"address"}],"name":"TransferValidatorUpdated","type":"event"},{"inputs":[],"name":"BURNER_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"DEAD_ADDRESS","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"DEFAULT_ADMIN_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"DEFAULT_TRANSFER_VALIDATOR","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MINTER_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"approve","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"autoApproveTransfersFromValidator","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","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":"tokenIds","type":"uint256[]"},{"internalType":"bytes","name":"signature","type":"bytes"},{"internalType":"uint256","name":"nonce","type":"uint256"}],"name":"burnBatch","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"tokenIds","type":"uint256[]"}],"name":"burnBatchAdmin","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"getApproved","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"}],"name":"getRoleAdmin","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getTransferValidationFunction","outputs":[{"internalType":"bytes4","name":"functionSignature","type":"bytes4"},{"internalType":"bool","name":"isViewFunction","type":"bool"}],"stateMutability":"pure","type":"function"},{"inputs":[],"name":"getTransferValidator","outputs":[{"internalType":"address","name":"validator","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"grantRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"hasRole","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"operator","type":"address"}],"name":"isApprovedForAll","outputs":[{"internalType":"bool","name":"isApproved","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"isBurnActive","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"isMintActive","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"lockMintingPermanently","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"string","name":"vfId","type":"string"},{"internalType":"uint256[]","name":"tokenIds","type":"uint256[]"},{"internalType":"bytes","name":"signature","type":"bytes"},{"internalType":"uint256","name":"nonce","type":"uint256"}],"name":"mintBatch","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256[]","name":"tokenIds","type":"uint256[]"}],"name":"mintBatchAdmin","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"mintingPermanentlyLocked","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","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":"owner","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"renounceRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"revokeRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_tokenId","type":"uint256"},{"internalType":"uint256","name":"_salePrice","type":"uint256"}],"name":"royaltyInfo","outputs":[{"internalType":"address","name":"","type":"address"},{"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":"safeTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"operator","type":"address"},{"internalType":"bool","name":"approved","type":"bool"}],"name":"setApprovalForAll","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bool","name":"autoApprove","type":"bool"}],"name":"setAutomaticApprovalOfTransfersFromValidator","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"baseUri","type":"string"}],"name":"setBaseURI","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"receiver","type":"address"},{"internalType":"uint96","name":"feeNumerator","type":"uint96"}],"name":"setDefaultRoyalty","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"signer_","type":"address"}],"name":"setSigner","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"address","name":"receiver","type":"address"},{"internalType":"uint96","name":"feeNumerator","type":"uint96"}],"name":"setTokenRoyalty","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"transferValidator_","type":"address"}],"name":"setTransferValidator","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":[],"name":"toggleBurnActive","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"toggleMintActive","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"tokenURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"tokensOfOwner","outputs":[{"internalType":"uint256[]","name":"ownerTokens","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"uint256","name":"startIndex","type":"uint256"},{"internalType":"uint256","name":"endIndex","type":"uint256"}],"name":"tokensOfOwnerIn","outputs":[{"internalType":"uint256[]","name":"ownerTokens","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalBurned","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalMinted","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"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
608060405234801561000f575f5ffd5b50604051613f95380380613f9583398101604081905261002e9161078b565b338484888861003b610160565b61005873721c008fdff27bf06e7e123956e2fe03b63342e36101ae565b610062828261022a565b506003905061007183826108dc565b50600461007e82826108dc565b50505061009761009261027f60201b60201c565b610283565b6100a15f826102e0565b6100cb7f9f2df0fed2c77648de5860a4cc508cd0818c85b8b8a1ab4ceeef8d981c8956a6826102e0565b6100f57f3c11d16cbaffd01df69ce1c404f6340ee057498f5f00246190ea54220576a848826102e0565b506001600d555f610107306014610380565b9050610134838260405160200161011f9291906109ad565b60408051601f19818403018152919052610523565b50600f80546001600160a01b0319166001600160a01b039290921691909117905550610a769350505050565b604080515f815273721c008fdff27bf06e7e123956e2fe03b63342e360208201527fcc5dc080ff977b3c3a211fa63ab74f90f658f5ba9d3236e92c8f59570f442aac910160405180910390a1565b6001600160a01b0381161561022757803b8015610225576040805163fb2de5d760e01b81523060048201526102d1602482015290516001600160a01b0384169163fb2de5d7916044808301925f92919082900301818387803b158015610212575f5ffd5b505af1925050508015610223575060015b505b505b50565b6102348282610572565b6040516001600160601b03821681526001600160a01b038316907f8a8bae378cb731c5c40b632330c6836c2f916f48edb967699c86736f9a6a76ef9060200160405180910390a25050565b3390565b600b80546001600160a01b0383811663010000008181026301000000600160b81b031985161790945560405193909204169182907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0905f90a35050565b5f828152600c602090815260408083206001600160a01b038516845290915290205460ff16610225575f828152600c602090815260408083206001600160a01b03851684529091529020805460ff1916600117905561033c3390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b60605f61038e8360026109ee565b610399906002610a05565b6001600160401b038111156103b0576103b06106ee565b6040519080825280601f01601f1916602001820160405280156103da576020820181803683370190505b509050600360fc1b815f815181106103f4576103f4610a18565b60200101906001600160f81b03191690815f1a905350600f60fb1b8160018151811061042257610422610a18565b60200101906001600160f81b03191690815f1a9053505f6104448460026109ee565b61044f906001610a05565b90505b60018111156104c6576f181899199a1a9b1b9c1cb0b131b232b360811b85600f166010811061048357610483610a18565b1a60f81b82828151811061049957610499610a18565b60200101906001600160f81b03191690815f1a90535060049490941c936104bf81610a2c565b9050610452565b50831561051a5760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e7460448201526064015b60405180910390fd5b90505b92915050565b61052b61066f565b600e61053782826108dc565b507f6741b2fc379fad678116fe3d4d4b9a1a184ab53ba36b86ad0fa66340b1ab41ad816040516105679190610a41565b60405180910390a150565b6127106001600160601b03821611156105e05760405162461bcd60e51b815260206004820152602a60248201527f455243323938313a20726f79616c7479206665652077696c6c206578636565646044820152692073616c65507269636560b01b6064820152608401610511565b6001600160a01b0382166106365760405162461bcd60e51b815260206004820152601960248201527f455243323938313a20696e76616c6964207265636569766572000000000000006044820152606401610511565b604080518082019091526001600160a01b039092168083526001600160601b039091166020909201829052600160a01b90910217600155565b600b546001600160a01b0363010000009091041633146106d15760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610511565b565b80516001600160a01b03811681146106e9575f5ffd5b919050565b634e487b7160e01b5f52604160045260245ffd5b5f82601f830112610711575f5ffd5b81516001600160401b0381111561072a5761072a6106ee565b604051601f8201601f19908116603f011681016001600160401b0381118282101715610758576107586106ee565b60405281815283820160200185101561076f575f5ffd5b8160208501602083015e5f918101602001919091529392505050565b5f5f5f5f5f5f60c087890312156107a0575f5ffd5b6107a9876106d3565b60208801519096506001600160601b03811681146107c5575f5ffd5b60408801519095506001600160401b038111156107e0575f5ffd5b6107ec89828a01610702565b606089015190955090506001600160401b03811115610809575f5ffd5b61081589828a01610702565b608089015190945090506001600160401b03811115610832575f5ffd5b61083e89828a01610702565b92505061084d60a088016106d3565b90509295509295509295565b600181811c9082168061086d57607f821691505b60208210810361088b57634e487b7160e01b5f52602260045260245ffd5b50919050565b601f82111561022357805f5260205f20601f840160051c810160208510156108b65750805b601f840160051c820191505b818110156108d5575f81556001016108c2565b5050505050565b81516001600160401b038111156108f5576108f56106ee565b610909816109038454610859565b84610891565b6020601f82116001811461093b575f83156109245750848201515b5f19600385901b1c1916600184901b1784556108d5565b5f84815260208120601f198516915b8281101561096a578785015182556020948501946001909201910161094a565b508482101561098757868401515f19600387901b60f8161c191681555b50505050600190811b01905550565b5f81518060208401855e5f93019283525090919050565b5f6109c16109bb8386610996565b84610996565b672f746f6b656e732f60c01b8152600801949350505050565b634e487b7160e01b5f52601160045260245ffd5b808202811582820484141761051d5761051d6109da565b8082018082111561051d5761051d6109da565b634e487b7160e01b5f52603260045260245ffd5b5f81610a3a57610a3a6109da565b505f190190565b602081525f82518060208401528060208501604085015e5f604082850101526040601f19601f83011684010191505092915050565b61351280610a835f395ff3fe608060405234801561000f575f5ffd5b50600436106102e5575f3560e01c80636352211e11610195578063a2309ff8116100e4578063d02c2bf21161009e578063d89135cd11610079578063d89135cd146106ae578063e985e9c5146106b6578063f2fde38b146106c9578063f5e92b95146106dc575f5ffd5b8063d02c2bf21461066c578063d539139314610674578063d547741f1461069b575f5ffd5b8063a2309ff814610610578063a9fc664e14610618578063b1a6676e1461062b578063b88d4fde1461063e578063bb7648b614610651578063c87b56dd14610659575f5ffd5b80638da5cb5b1161014f57806399a2557a1161012a57806399a2557a146105d05780639e05d240146105e3578063a217fddf146105f6578063a22cb465146105fd575f5ffd5b80638da5cb5b1461059d57806391d14854146105b557806395d89b41146105c8575f5ffd5b80636352211e1461052957806369d1a48f1461053c5780636c19e7831461054f57806370a0823114610562578063715018a6146105755780638462151c1461057d575f5ffd5b8063282c51f31161025157806342842e0e1161020b5780635944c753116101e65780635944c753146104e95780635b92ac0d146104fc5780635bc0997c1461050e5780636221d13c14610516575f5ffd5b806342842e0e146104ba5780634e6fd6c4146104cd57806355f804b3146104d6575f5ffd5b8063282c51f3146104155780632a55205a1461043c5780632f2ff15d1461046e57806333a24f621461048157806336568abe146104945780633c7e4164146104a7575f5ffd5b8063098144d4116102a2578063098144d4146103945780630d705df61461039c57806318160ddd146103b757806323b872dd146103cd578063248a9ca3146103e0578063263c82b114610402575f5ffd5b806301463546146102e957806301ffc9a71461032157806304634d8d1461034457806306fdde0314610359578063081812fc1461036e578063095ea7b314610381575b5f5ffd5b61030473721c008fdff27bf06e7e123956e2fe03b63342e381565b6040516001600160a01b0390911681526020015b60405180910390f35b61033461032f366004612b0f565b6106e9565b6040519015158152602001610318565b610357610352366004612b56565b610708565b005b61036161071e565b6040516103189190612bb5565b61030461037c366004612bc7565b6107ae565b61035761038f366004612bde565b6107d3565b610304610887565b6040805163657711f560e11b81526001602082015201610318565b600a54600954035b604051908152602001610318565b6103576103db366004612c06565b6108bf565b6103bf6103ee366004612bc7565b5f908152600c602052604090206001015490565b610357610410366004612cbd565b6108cc565b6103bf7f3c11d16cbaffd01df69ce1c404f6340ee057498f5f00246190ea54220576a84881565b61044f61044a366004612d70565b61097a565b604080516001600160a01b039093168352602083019190915201610318565b61035761047c366004612d90565b610a26565b61035761048f366004612db1565b610a4a565b6103576104a2366004612d90565b610a98565b6103576104b5366004612def565b610b12565b6103576104c8366004612c06565b610b97565b61030461dead81565b6103576104e4366004612ee9565b610ba4565b6103576104f7366004612f2d565b610bf3565b600b5461033490610100900460ff1681565b610357610c06565b5f5461033490600160a81b900460ff1681565b610304610537366004612bc7565b610c18565b61035761054a366004612f66565b610c55565b61035761055d366004612fb4565b610cc6565b6103bf610570366004612fb4565b610d17565b610357610d5a565b61059061058b366004612fb4565b610d6b565b6040516103189190612fcd565b600b54630100000090046001600160a01b0316610304565b6103346105c3366004612d90565b610e51565b610361610e7b565b6105906105de366004613004565b610e8a565b6103576105f1366004613043565b610f7a565b6103bf5f81565b61035761060b36600461305c565b610fce565b6009546103bf565b610357610626366004612fb4565b610fd9565b600b546103349062010000900460ff1681565b61035761064c366004613084565b611091565b6103576110a5565b610361610667366004612bc7565b6110d9565b61035761113c565b6103bf7f9f2df0fed2c77648de5860a4cc508cd0818c85b8b8a1ab4ceeef8d981c8956a681565b6103576106a9366004612d90565b611170565b600a546103bf565b6103346106c43660046130fa565b611194565b6103576106d7366004612fb4565b6111f6565b600b546103349060ff1681565b5f6106f38261126f565b8061070257506107028261131a565b92915050565b61071061133e565b61071a8282611346565b5050565b60606003805461072d90613122565b80601f016020809104026020016040519081016040528092919081815260200182805461075990613122565b80156107a45780601f1061077b576101008083540402835291602001916107a4565b820191905f5260205f20905b81548152906001019060200180831161078757829003601f168201915b5050505050905090565b5f6107b88261139b565b505f908152600760205260409020546001600160a01b031690565b5f6107dd82610c18565b9050806001600160a01b0316836001600160a01b031603610828576040516326ac089f60e01b81526001600160a01b0384166004820152602481018390526044015b60405180910390fd5b336001600160a01b0382161480159061084857506108468133611194565b155b1561087857604051632c6ae12960e21b81526001600160a01b03841660048201526024810183905260440161081f565b61088283836113d2565b505050565b5f5461010090046001600160a01b0316806108bc575f5460ff166108bc575073721c008fdff27bf06e7e123956e2fe03b63342e35b90565b610882838383600161143f565b600b54610100900460ff166108f457604051632cf2775f60e11b815260040160405180910390fd5b600b5460ff16156109185760405163b8ef635160e01b815260040160405180910390fd5b610920611491565b5f6109308888338c8a8a886114ea565b905061093d81858561152b565b61095a57604051633d70d99560e21b815260040160405180910390fd5b610965898787611591565b506109706001600d55565b5050505050505050565b5f8281526002602090815260408083208151808301909252546001600160a01b038116808352600160a01b9091046001600160601b03169282019290925282916109ee5750604080518082019091526001546001600160a01b0381168252600160a01b90046001600160601b031660208201525b60208101515f9061271090610a0c906001600160601b03168761316e565b610a169190613185565b91519350909150505b9250929050565b5f828152600c6020526040902060010154610a4081611782565b610882838361178c565b610a52611811565b600b5462010000900460ff16610a7b57604051633aed6beb60e21b815260040160405180910390fd5b610a83611491565b610a8e338383611858565b61071a6001600d55565b6001600160a01b0381163314610b085760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201526e103937b632b9903337b91039b2b63360891b606482015260840161081f565b61071a8282611865565b600b5462010000900460ff16610b3b57604051633aed6beb60e21b815260040160405180910390fd5b610b43611491565b5f610b50868633856118cb565b9050610b5d81858561152b565b610b7a57604051633d70d99560e21b815260040160405180910390fd5b610b85338787611858565b50610b906001600d55565b5050505050565b6108828383836001611903565b610bac61191e565b600e610bb882826131e8565b507f6741b2fc379fad678116fe3d4d4b9a1a184ab53ba36b86ad0fa66340b1ab41ad81604051610be89190612bb5565b60405180910390a150565b610bfb61133e565b610882838383611980565b610c0e61133e565b610c166119da565b565b5f818152600560205260409020546001600160a01b031680610c505760405163b718b68760e01b81526004810183905260240161081f565b919050565b610c5d611a3e565b600b54610100900460ff16610c8557604051632cf2775f60e11b815260040160405180910390fd5b600b5460ff1615610ca95760405163b8ef635160e01b815260040160405180910390fd5b610cb1611491565b610cbc838383611591565b6108826001600d55565b610cce61191e565b600f80546001600160a01b0319166001600160a01b0383169081179091556040517f5553331329228fbd4123164423717a4a7539f6dfa1c3279a923b98fd681a6c73905f90a250565b5f6001600160a01b038216610d3f57604051630560440d60e41b815260040160405180910390fd5b506001600160a01b03165f9081526006602052604090205490565b610d6261191e565b610c165f611a85565b60605f5f610d7884610d17565b9050805f03610d97575050604080515f81526020810190915292915050565b5f816001600160401b03811115610db057610db0612e60565b604051908082528060200260200182016040528015610dd9578160200160208202803683370190505b5090505f5f5b838214610e46575f818152600560205260409020546001600160a01b03908116955087168503610e3457808383610e15816132a2565b945081518110610e2757610e276132ba565b6020026020010181815250505b80610e3e816132a2565b915050610ddf565b509095945050505050565b5f918252600c602090815260408084206001600160a01b0393909316845291905290205460ff1690565b60606004805461072d90613122565b60605f5f610e9786610d17565b9050805f03610eb7575050604080515f8152602081019091529050610f73565b5f816001600160401b03811115610ed057610ed0612e60565b604051908082528060200260200182016040528015610ef9578160200160208202803683370190505b5090505f865b868111610f66575f818152600560205260409020546001600160a01b03908116955089168503610f5457808383610f35816132a2565b945081518110610f4757610f476132ba565b6020026020010181815250505b80610f5e816132a2565b915050610eff565b5081529250610f73915050565b9392505050565b610f8261133e565b5f8054821515600160a81b0260ff60a81b199091161790556040517f6787c7f9a80aa0f5ceddab2c54f1f5169c0b88e75dd5e19d5e858a64144c7dbc90610be890831515815260200190565b61071a338383611ae2565b610fe161133e565b6001600160a01b038116803b15159015801590610ffc575080155b1561101a576040516332483afb60e01b815260040160405180910390fd5b7fcc5dc080ff977b3c3a211fa63ab74f90f658f5ba9d3236e92c8f59570f442aac611043610887565b604080516001600160a01b03928316815291851660208301520160405180910390a15f80546001600160a01b038416610100026001600160a81b031990911617600117905561071a82611b78565b61109f848484600185611bf6565b50505050565b600b5460ff16156110c95760405163b8ef635160e01b815260040160405180910390fd5b6110d161133e565b610c16611c49565b60606110e48261139b565b5f6110ed611c80565b90505f81511161110b5760405180602001604052805f815250610f73565b8061111584611c8f565b6040516020016111269291906132e5565b6040516020818303038152906040529392505050565b600b5460ff16156111605760405163b8ef635160e01b815260040160405180910390fd5b61116861133e565b610c16611d1e565b5f828152600c602052604090206001015461118a81611782565b6108828383611865565b6001600160a01b038083165f9081526008602090815260408083209385168352929052205460ff1680610702575f54600160a81b900460ff1615610702576111da610887565b6001600160a01b0316826001600160a01b031614905092915050565b6111fe61191e565b6001600160a01b0381166112635760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b606482015260840161081f565b61126c81611a85565b50565b5f6001600160e01b031982166380ac58cd60e01b148061129f57506001600160e01b03198216635b5e139f60e01b145b806112ba57506001600160e01b03198216632b435fdb60e21b145b806112d557506001600160e01b0319821663503e914d60e11b145b806112f057506001600160e01b0319821663152a902d60e11b145b8061130b57506001600160e01b03198216636df925a960e11b145b80610702575061070282611d76565b5f6001600160e01b03198216637965db0b60e01b148061070257506107028261126f565b610c1661191e565b6113508282611daa565b6040516001600160601b03821681526001600160a01b038316907f8a8bae378cb731c5c40b632330c6836c2f916f48edb967699c86736f9a6a76ef9060200160405180910390a25050565b5f818152600560205260409020546001600160a01b031661126c5760405163b718b68760e01b81526004810182905260240161081f565b5f81815260076020526040902080546001600160a01b0319166001600160a01b038416908117909155819061140682610c18565b6001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b80156114865761144f3383611e64565b61148657604051630957569f60e01b81526001600160a01b038086166004830152841660248201526044810183905260640161081f565b61109f848484611ec2565b6002600d54036114e35760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604482015260640161081f565b6002600d55565b5f878787878787876040516020016115089796959493929190613320565b604051602081830303815290604052805190602001209050979650505050505050565b5f5f61157784848080601f0160208091040260200160405190810160405280939291908181526020018383808284375f9201919091525061157192508991506120049050565b90612056565b600f546001600160a01b0390811691161495945050505050565b5f5b81811015611757576001600160a01b0384166115c25760405163e7070eb760e01b815260040160405180910390fd5b61deac196001600160a01b038516016115ed57604051625d022b60e71b815260040160405180910390fd5b611625838383818110611602576116026132ba565b905060200201355f908152600560205260409020546001600160a01b0316151590565b1561165f5782828281811061163c5761163c6132ba565b905060200201356040516303dd6ca560e41b815260040161081f91815260200190565b6116845f85858585818110611676576116766132ba565b905060200201356001612078565b8360055f85858581811061169a5761169a6132ba565b9050602002013581526020019081526020015f205f6101000a8154816001600160a01b0302191690836001600160a01b031602179055508282828181106116e3576116e36132ba565b90506020020135846001600160a01b03165f6001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60405160405180910390a461174f5f85858585818110611741576117416132ba565b90506020020135600161209e565b600101611593565b506001600160a01b039092165f90815260066020526040902080548301905550600980549091019055565b61126c81336120c4565b6117968282610e51565b61071a575f828152600c602090815260408083206001600160a01b03851684529091529020805460ff191660011790556117cd3390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b61183b7f3c11d16cbaffd01df69ce1c404f6340ee057498f5f00246190ea54220576a84833610e51565b610c165760405163fc34014560e01b815260040160405180910390fd5b610882838383600161211d565b61186f8282610e51565b1561071a575f828152600c602090815260408083206001600160a01b0385168085529252808320805460ff1916905551339285917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45050565b5f848484846040516020016118e3949392919061336e565b604051602081830303815290604052805190602001209050949350505050565b61109f8484848460405180602001604052805f815250611bf6565b600b546001600160a01b036301000000909104163314610c165760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015260640161081f565b61198b8383836121ad565b6040516001600160601b03821681526001600160a01b0383169084907f7f5b076c952c0ec86e5425963c1326dd0f03a3595c19f81d765e8ff559a6e33c906020015b60405180910390a3505050565b600b805460ff62010000808304821615810262ff00001990931692909217928390556040517f577da8c64d93f431936fff4a4f48ae1d1f927eb42c95eb2e699c02ebfc87f16393611a349390049091161515815260200190565b60405180910390a1565b611a687f9f2df0fed2c77648de5860a4cc508cd0818c85b8b8a1ab4ceeef8d981c8956a633610e51565b610c16576040516309304cd760e21b815260040160405180910390fd5b600b80546001600160a01b0383811663010000008181026301000000600160b81b031985161790945560405193909204169182907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0905f90a35050565b816001600160a01b0316836001600160a01b031603611b1457604051631f488f8760e31b815260040160405180910390fd5b6001600160a01b038381165f81815260086020908152604080832094871680845294825291829020805460ff191686151590811790915591519182527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c3191016119cd565b6001600160a01b0381161561126c57803b801561071a576040805163fb2de5d760e01b81523060048201526102d1602482015290516001600160a01b0384169163fb2de5d7916044808301925f92919082900301818387803b158015611bdc575f5ffd5b505af1925050508015611bed575060015b1561071a575050565b8115611c3d57611c063384611e64565b611c3d57604051630957569f60e01b81526001600160a01b038087166004830152851660248201526044810184905260640161081f565b610b9085858584612277565b600b805460ff191660011790556040517fcee6e0f49275e8fab40d97ef710003453e5e85e47c41f998f81f0ef3faa131f9905f90a1565b6060600e805461072d90613122565b60605f611c9b8361228e565b60010190505f816001600160401b03811115611cb957611cb9612e60565b6040519080825280601f01601f191660200182016040528015611ce3576020820181803683370190505b5090508181016020015b5f19016f181899199a1a9b1b9c1cb0b131b232b360811b600a86061a8153600a8504945084611ced57509392505050565b600b805460ff610100808304821615810261ff001990931692909217928390556040517f4c9b4718121fe20d76004df1b8cdcdc2b64b852d9f8d72e491f65a3e4a1719f993611a349390049091161515815260200190565b5f6001600160e01b0319821663152a902d60e11b148061070257506301ffc9a760e01b6001600160e01b0319831614610702565b6127106001600160601b0382161115611dd55760405162461bcd60e51b815260040161081f906133a1565b6001600160a01b038216611e2b5760405162461bcd60e51b815260206004820152601960248201527f455243323938313a20696e76616c696420726563656976657200000000000000604482015260640161081f565b604080518082019091526001600160a01b039092168083526001600160601b039091166020909201829052600160a01b90910217600155565b5f5f611e6f83610c18565b9050806001600160a01b0316846001600160a01b03161480611e965750611e968185611194565b80611eba5750836001600160a01b0316611eaf846107ae565b6001600160a01b0316145b949350505050565b6001600160a01b038216611ee957604051630149550160e71b815260040160405180910390fd5b61deac196001600160a01b03831601611f1557604051631634e02360e21b815260040160405180910390fd5b826001600160a01b0316611f2882610c18565b6001600160a01b031614611f61576040516358253c0360e11b81526001600160a01b03841660048201526024810182905260440161081f565b611f6e8383836001612078565b5f81815260076020908152604080832080546001600160a01b03199081169091556001600160a01b038781168086526006855283862080545f1901905590871680865283862080546001019055868652600590945282852080549092168417909155905184937fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef91a4610882838383600161209e565b6040517f19457468657265756d205369676e6564204d6573736167653a0a3332000000006020820152603c81018290525f90605c01604051602081830303815290604052805190602001209050919050565b5f5f5f6120638585612365565b91509150612070816123a4565b509392505050565b5f5b81811015610b9057612096858561209184876133eb565b6124ed565b60010161207a565b5f5b81811015610b90576120bc85856120b784876133eb565b612543565b6001016120a0565b6120ce8282610e51565b61071a576120db8161258a565b6120e683602061259c565b6040516020016120f79291906133fe565b60408051601f198184030181529082905262461bcd60e51b825261081f91600401612bb5565b80156121a3575f5b828110156121a15761214f85858584818110612143576121436132ba565b90506020020135611e64565b6121995784848483818110612166576121666132ba565b60405163b2b70f8960e01b81526001600160a01b039094166004850152602002919091013560248301525060440161081f565b600101612125565b505b61109f8383612731565b6127106001600160601b03821611156121d85760405162461bcd60e51b815260040161081f906133a1565b6001600160a01b03821661222e5760405162461bcd60e51b815260206004820152601b60248201527f455243323938313a20496e76616c696420706172616d65746572730000000000604482015260640161081f565b6040805180820182526001600160a01b0393841681526001600160601b0392831660208083019182525f968752600290529190942093519051909116600160a01b029116179055565b612282848484611ec2565b61109f8484848461286b565b5f8072184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b83106122cc5772184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b830492506040015b6d04ee2d6d415b85acef810000000083106122f8576d04ee2d6d415b85acef8100000000830492506020015b662386f26fc10000831061231657662386f26fc10000830492506010015b6305f5e100831061232e576305f5e100830492506008015b612710831061234257612710830492506004015b60648310612354576064830492506002015b600a83106107025760010192915050565b5f5f8251604103612399576020830151604084015160608501515f1a61238d87828585612998565b94509450505050610a1f565b505f90506002610a1f565b5f8160048111156123b7576123b761345c565b036123bf5750565b60018160048111156123d3576123d361345c565b036124205760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e61747572650000000000000000604482015260640161081f565b60028160048111156124345761243461345c565b036124815760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e67746800604482015260640161081f565b60038160048111156124955761249561345c565b0361126c5760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c604482015261756560f01b606482015260840161081f565b6001600160a01b0383811615908316158180156125075750805b1561252557604051635cbd944160e01b815260040160405180910390fd5b8115612531575b610b90565b8061252c57610b903386868634612a55565b6001600160a01b03838116159083161581801561255d5750805b1561257b57604051635cbd944160e01b815260040160405180910390fd5b8161252c578061252c57610b90565b60606107026001600160a01b03831660145b60605f6125aa83600261316e565b6125b59060026133eb565b6001600160401b038111156125cc576125cc612e60565b6040519080825280601f01601f1916602001820160405280156125f6576020820181803683370190505b509050600360fc1b815f81518110612610576126106132ba565b60200101906001600160f81b03191690815f1a905350600f60fb1b8160018151811061263e5761263e6132ba565b60200101906001600160f81b03191690815f1a9053505f61266084600261316e565b61266b9060016133eb565b90505b60018111156126e2576f181899199a1a9b1b9c1cb0b131b232b360811b85600f166010811061269f5761269f6132ba565b1a60f81b8282815181106126b5576126b56132ba565b60200101906001600160f81b03191690815f1a90535060049490941c936126db81613470565b905061266e565b508315610f735760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e74604482015260640161081f565b5f5b8181101561285e575f83838381811061274e5761274e6132ba565b9050602002013590505f61276182610c18565b905061deac196001600160a01b038216016127925760405163fd3b071f60e01b81526004810183905260240161081f565b6127a18161dead846001612078565b5f82815260076020908152604080832080546001600160a01b03199081169091556001600160a01b0385168085526006845282852080545f190190557f1aecba4ebe7a4e0673e4891b2b092b2228e4322380b579fb494fad3da8586e22805460010190558685526005909352818420805461dead921682179055905185939192917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef91a46128548161dead84600161209e565b5050600101612733565b50600a8054909101905550565b6001600160a01b0383163b1561109f57604051630a85bd0160e11b81526001600160a01b0384169063150b7a02906128ad903390889087908790600401613485565b6020604051808303815f875af19250505080156128e7575060408051601f3d908101601f191682019092526128e4918101906134c1565b60015b612955573d808015612914576040519150601f19603f3d011682016040523d82523d5f602084013e612919565b606091505b5080515f0361294d57604051631f7f31e560e31b81526001600160a01b03851660048201526024810184905260440161081f565b805181602001fd5b6001600160e01b03198116630a85bd0160e11b14610b9057604051631f7f31e560e31b81526001600160a01b03851660048201526024810184905260440161081f565b5f807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a08311156129cd57505f90506003612a4c565b604080515f8082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa158015612a1e573d5f5f3e3d5ffd5b5050604051601f1901519150506001600160a01b038116612a46575f60019250925050612a4c565b91505f90505b94509492505050565b5f612a5e610887565b90506001600160a01b03811615612af2576001600160a01b0381163303612a855750610b90565b60405163657711f560e11b81526001600160a01b038781166004830152868116602483015285811660448301526064820185905282169063caee23ea906084015f6040518083038186803b158015612adb575f5ffd5b505afa158015612aed573d5f5f3e3d5ffd5b505050505b505050505050565b6001600160e01b03198116811461126c575f5ffd5b5f60208284031215612b1f575f5ffd5b8135610f7381612afa565b80356001600160a01b0381168114610c50575f5ffd5b80356001600160601b0381168114610c50575f5ffd5b5f5f60408385031215612b67575f5ffd5b612b7083612b2a565b9150612b7e60208401612b40565b90509250929050565b5f81518084528060208401602086015e5f602082860101526020601f19601f83011685010191505092915050565b602081525f610f736020830184612b87565b5f60208284031215612bd7575f5ffd5b5035919050565b5f5f60408385031215612bef575f5ffd5b612bf883612b2a565b946020939093013593505050565b5f5f5f60608486031215612c18575f5ffd5b612c2184612b2a565b9250612c2f60208501612b2a565b929592945050506040919091013590565b5f5f83601f840112612c50575f5ffd5b5081356001600160401b03811115612c66575f5ffd5b602083019150836020828501011115610a1f575f5ffd5b5f5f83601f840112612c8d575f5ffd5b5081356001600160401b03811115612ca3575f5ffd5b6020830191508360208260051b8501011115610a1f575f5ffd5b5f5f5f5f5f5f5f5f60a0898b031215612cd4575f5ffd5b612cdd89612b2a565b975060208901356001600160401b03811115612cf7575f5ffd5b612d038b828c01612c40565b90985096505060408901356001600160401b03811115612d21575f5ffd5b612d2d8b828c01612c7d565b90965094505060608901356001600160401b03811115612d4b575f5ffd5b612d578b828c01612c40565b999c989b50969995989497949560800135949350505050565b5f5f60408385031215612d81575f5ffd5b50508035926020909101359150565b5f5f60408385031215612da1575f5ffd5b82359150612b7e60208401612b2a565b5f5f60208385031215612dc2575f5ffd5b82356001600160401b03811115612dd7575f5ffd5b612de385828601612c7d565b90969095509350505050565b5f5f5f5f5f60608688031215612e03575f5ffd5b85356001600160401b03811115612e18575f5ffd5b612e2488828901612c7d565b90965094505060208601356001600160401b03811115612e42575f5ffd5b612e4e88828901612c40565b96999598509660400135949350505050565b634e487b7160e01b5f52604160045260245ffd5b5f5f6001600160401b03841115612e8d57612e8d612e60565b50604051601f19601f85018116603f011681018181106001600160401b0382111715612ebb57612ebb612e60565b604052838152905080828401851015612ed2575f5ffd5b838360208301375f60208583010152509392505050565b5f60208284031215612ef9575f5ffd5b81356001600160401b03811115612f0e575f5ffd5b8201601f81018413612f1e575f5ffd5b611eba84823560208401612e74565b5f5f5f60608486031215612f3f575f5ffd5b83359250612f4f60208501612b2a565b9150612f5d60408501612b40565b90509250925092565b5f5f5f60408486031215612f78575f5ffd5b612f8184612b2a565b925060208401356001600160401b03811115612f9b575f5ffd5b612fa786828701612c7d565b9497909650939450505050565b5f60208284031215612fc4575f5ffd5b610f7382612b2a565b602080825282518282018190525f918401906040840190835b81811015610e46578351835260209384019390920191600101612fe6565b5f5f5f60608486031215613016575f5ffd5b61301f84612b2a565b95602085013595506040909401359392505050565b80358015158114610c50575f5ffd5b5f60208284031215613053575f5ffd5b610f7382613034565b5f5f6040838503121561306d575f5ffd5b61307683612b2a565b9150612b7e60208401613034565b5f5f5f5f60808587031215613097575f5ffd5b6130a085612b2a565b93506130ae60208601612b2a565b92506040850135915060608501356001600160401b038111156130cf575f5ffd5b8501601f810187136130df575f5ffd5b6130ee87823560208401612e74565b91505092959194509250565b5f5f6040838503121561310b575f5ffd5b61311483612b2a565b9150612b7e60208401612b2a565b600181811c9082168061313657607f821691505b60208210810361315457634e487b7160e01b5f52602260045260245ffd5b50919050565b634e487b7160e01b5f52601160045260245ffd5b80820281158282048414176107025761070261315a565b5f8261319f57634e487b7160e01b5f52601260045260245ffd5b500490565b601f82111561088257805f5260205f20601f840160051c810160208510156131c95750805b601f840160051c820191505b81811015610b90575f81556001016131d5565b81516001600160401b0381111561320157613201612e60565b6132158161320f8454613122565b846131a4565b6020601f821160018114613247575f83156132305750848201515b5f19600385901b1c1916600184901b178455610b90565b5f84815260208120601f198516915b828110156132765787850151825560209485019460019092019101613256565b508482101561329357868401515f19600387901b60f8161c191681555b50505050600190811b01905550565b5f600182016132b3576132b361315a565b5060010190565b634e487b7160e01b5f52603260045260245ffd5b5f81518060208401855e5f93019283525090919050565b5f611eba6132f383866132ce565b846132ce565b5f6001600160fb1b0383111561330d575f5ffd5b8260051b80838637939093019392505050565b868882375f8782016001600160601b03198860601b1681526001600160601b03198760601b1660148201526133596028820186886132f9565b93845250506020909101979650505050505050565b5f61337a8286886132f9565b60609490941b6bffffffffffffffffffffffff191684525050601482015260340192915050565b6020808252602a908201527f455243323938313a20726f79616c7479206665652077696c6c206578636565646040820152692073616c65507269636560b01b606082015260800190565b808201808211156107025761070261315a565b7f416363657373436f6e74726f6c3a206163636f756e742000000000000000000081525f61342f60178301856132ce565b7001034b99036b4b9b9b4b733903937b6329607d1b815261345360118201856132ce565b95945050505050565b634e487b7160e01b5f52602160045260245ffd5b5f8161347e5761347e61315a565b505f190190565b6001600160a01b03858116825284166020820152604081018390526080606082018190525f906134b790830184612b87565b9695505050505050565b5f602082840312156134d1575f5ffd5b8151610f7381612afa56fea26469706673582212207f3880c9d4fd7d53ee554cd0a39e5a85999e9a4a3ccae67d7989c56a88d45e2264736f6c634300081c003300000000000000000000000041db617739104eb64856e28efeb323fb8b626e9900000000000000000000000000000000000000000000000000000000000001f400000000000000000000000000000000000000000000000000000000000000c00000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000014000000000000000000000000091e29c8cfdc161217d75286188507f07a576629b0000000000000000000000000000000000000000000000000000000000000018426f6f6b2047616d657320627920566565467269656e6473000000000000000000000000000000000000000000000000000000000000000000000000000000024247000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003368747470733a2f2f6170692d6d657461646174612e766565667269656e64732e636f6d2f76312f636f6c6c656374696f6e732f00000000000000000000000000
Deployed Bytecode
0x608060405234801561000f575f5ffd5b50600436106102e5575f3560e01c80636352211e11610195578063a2309ff8116100e4578063d02c2bf21161009e578063d89135cd11610079578063d89135cd146106ae578063e985e9c5146106b6578063f2fde38b146106c9578063f5e92b95146106dc575f5ffd5b8063d02c2bf21461066c578063d539139314610674578063d547741f1461069b575f5ffd5b8063a2309ff814610610578063a9fc664e14610618578063b1a6676e1461062b578063b88d4fde1461063e578063bb7648b614610651578063c87b56dd14610659575f5ffd5b80638da5cb5b1161014f57806399a2557a1161012a57806399a2557a146105d05780639e05d240146105e3578063a217fddf146105f6578063a22cb465146105fd575f5ffd5b80638da5cb5b1461059d57806391d14854146105b557806395d89b41146105c8575f5ffd5b80636352211e1461052957806369d1a48f1461053c5780636c19e7831461054f57806370a0823114610562578063715018a6146105755780638462151c1461057d575f5ffd5b8063282c51f31161025157806342842e0e1161020b5780635944c753116101e65780635944c753146104e95780635b92ac0d146104fc5780635bc0997c1461050e5780636221d13c14610516575f5ffd5b806342842e0e146104ba5780634e6fd6c4146104cd57806355f804b3146104d6575f5ffd5b8063282c51f3146104155780632a55205a1461043c5780632f2ff15d1461046e57806333a24f621461048157806336568abe146104945780633c7e4164146104a7575f5ffd5b8063098144d4116102a2578063098144d4146103945780630d705df61461039c57806318160ddd146103b757806323b872dd146103cd578063248a9ca3146103e0578063263c82b114610402575f5ffd5b806301463546146102e957806301ffc9a71461032157806304634d8d1461034457806306fdde0314610359578063081812fc1461036e578063095ea7b314610381575b5f5ffd5b61030473721c008fdff27bf06e7e123956e2fe03b63342e381565b6040516001600160a01b0390911681526020015b60405180910390f35b61033461032f366004612b0f565b6106e9565b6040519015158152602001610318565b610357610352366004612b56565b610708565b005b61036161071e565b6040516103189190612bb5565b61030461037c366004612bc7565b6107ae565b61035761038f366004612bde565b6107d3565b610304610887565b6040805163657711f560e11b81526001602082015201610318565b600a54600954035b604051908152602001610318565b6103576103db366004612c06565b6108bf565b6103bf6103ee366004612bc7565b5f908152600c602052604090206001015490565b610357610410366004612cbd565b6108cc565b6103bf7f3c11d16cbaffd01df69ce1c404f6340ee057498f5f00246190ea54220576a84881565b61044f61044a366004612d70565b61097a565b604080516001600160a01b039093168352602083019190915201610318565b61035761047c366004612d90565b610a26565b61035761048f366004612db1565b610a4a565b6103576104a2366004612d90565b610a98565b6103576104b5366004612def565b610b12565b6103576104c8366004612c06565b610b97565b61030461dead81565b6103576104e4366004612ee9565b610ba4565b6103576104f7366004612f2d565b610bf3565b600b5461033490610100900460ff1681565b610357610c06565b5f5461033490600160a81b900460ff1681565b610304610537366004612bc7565b610c18565b61035761054a366004612f66565b610c55565b61035761055d366004612fb4565b610cc6565b6103bf610570366004612fb4565b610d17565b610357610d5a565b61059061058b366004612fb4565b610d6b565b6040516103189190612fcd565b600b54630100000090046001600160a01b0316610304565b6103346105c3366004612d90565b610e51565b610361610e7b565b6105906105de366004613004565b610e8a565b6103576105f1366004613043565b610f7a565b6103bf5f81565b61035761060b36600461305c565b610fce565b6009546103bf565b610357610626366004612fb4565b610fd9565b600b546103349062010000900460ff1681565b61035761064c366004613084565b611091565b6103576110a5565b610361610667366004612bc7565b6110d9565b61035761113c565b6103bf7f9f2df0fed2c77648de5860a4cc508cd0818c85b8b8a1ab4ceeef8d981c8956a681565b6103576106a9366004612d90565b611170565b600a546103bf565b6103346106c43660046130fa565b611194565b6103576106d7366004612fb4565b6111f6565b600b546103349060ff1681565b5f6106f38261126f565b8061070257506107028261131a565b92915050565b61071061133e565b61071a8282611346565b5050565b60606003805461072d90613122565b80601f016020809104026020016040519081016040528092919081815260200182805461075990613122565b80156107a45780601f1061077b576101008083540402835291602001916107a4565b820191905f5260205f20905b81548152906001019060200180831161078757829003601f168201915b5050505050905090565b5f6107b88261139b565b505f908152600760205260409020546001600160a01b031690565b5f6107dd82610c18565b9050806001600160a01b0316836001600160a01b031603610828576040516326ac089f60e01b81526001600160a01b0384166004820152602481018390526044015b60405180910390fd5b336001600160a01b0382161480159061084857506108468133611194565b155b1561087857604051632c6ae12960e21b81526001600160a01b03841660048201526024810183905260440161081f565b61088283836113d2565b505050565b5f5461010090046001600160a01b0316806108bc575f5460ff166108bc575073721c008fdff27bf06e7e123956e2fe03b63342e35b90565b610882838383600161143f565b600b54610100900460ff166108f457604051632cf2775f60e11b815260040160405180910390fd5b600b5460ff16156109185760405163b8ef635160e01b815260040160405180910390fd5b610920611491565b5f6109308888338c8a8a886114ea565b905061093d81858561152b565b61095a57604051633d70d99560e21b815260040160405180910390fd5b610965898787611591565b506109706001600d55565b5050505050505050565b5f8281526002602090815260408083208151808301909252546001600160a01b038116808352600160a01b9091046001600160601b03169282019290925282916109ee5750604080518082019091526001546001600160a01b0381168252600160a01b90046001600160601b031660208201525b60208101515f9061271090610a0c906001600160601b03168761316e565b610a169190613185565b91519350909150505b9250929050565b5f828152600c6020526040902060010154610a4081611782565b610882838361178c565b610a52611811565b600b5462010000900460ff16610a7b57604051633aed6beb60e21b815260040160405180910390fd5b610a83611491565b610a8e338383611858565b61071a6001600d55565b6001600160a01b0381163314610b085760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201526e103937b632b9903337b91039b2b63360891b606482015260840161081f565b61071a8282611865565b600b5462010000900460ff16610b3b57604051633aed6beb60e21b815260040160405180910390fd5b610b43611491565b5f610b50868633856118cb565b9050610b5d81858561152b565b610b7a57604051633d70d99560e21b815260040160405180910390fd5b610b85338787611858565b50610b906001600d55565b5050505050565b6108828383836001611903565b610bac61191e565b600e610bb882826131e8565b507f6741b2fc379fad678116fe3d4d4b9a1a184ab53ba36b86ad0fa66340b1ab41ad81604051610be89190612bb5565b60405180910390a150565b610bfb61133e565b610882838383611980565b610c0e61133e565b610c166119da565b565b5f818152600560205260409020546001600160a01b031680610c505760405163b718b68760e01b81526004810183905260240161081f565b919050565b610c5d611a3e565b600b54610100900460ff16610c8557604051632cf2775f60e11b815260040160405180910390fd5b600b5460ff1615610ca95760405163b8ef635160e01b815260040160405180910390fd5b610cb1611491565b610cbc838383611591565b6108826001600d55565b610cce61191e565b600f80546001600160a01b0319166001600160a01b0383169081179091556040517f5553331329228fbd4123164423717a4a7539f6dfa1c3279a923b98fd681a6c73905f90a250565b5f6001600160a01b038216610d3f57604051630560440d60e41b815260040160405180910390fd5b506001600160a01b03165f9081526006602052604090205490565b610d6261191e565b610c165f611a85565b60605f5f610d7884610d17565b9050805f03610d97575050604080515f81526020810190915292915050565b5f816001600160401b03811115610db057610db0612e60565b604051908082528060200260200182016040528015610dd9578160200160208202803683370190505b5090505f5f5b838214610e46575f818152600560205260409020546001600160a01b03908116955087168503610e3457808383610e15816132a2565b945081518110610e2757610e276132ba565b6020026020010181815250505b80610e3e816132a2565b915050610ddf565b509095945050505050565b5f918252600c602090815260408084206001600160a01b0393909316845291905290205460ff1690565b60606004805461072d90613122565b60605f5f610e9786610d17565b9050805f03610eb7575050604080515f8152602081019091529050610f73565b5f816001600160401b03811115610ed057610ed0612e60565b604051908082528060200260200182016040528015610ef9578160200160208202803683370190505b5090505f865b868111610f66575f818152600560205260409020546001600160a01b03908116955089168503610f5457808383610f35816132a2565b945081518110610f4757610f476132ba565b6020026020010181815250505b80610f5e816132a2565b915050610eff565b5081529250610f73915050565b9392505050565b610f8261133e565b5f8054821515600160a81b0260ff60a81b199091161790556040517f6787c7f9a80aa0f5ceddab2c54f1f5169c0b88e75dd5e19d5e858a64144c7dbc90610be890831515815260200190565b61071a338383611ae2565b610fe161133e565b6001600160a01b038116803b15159015801590610ffc575080155b1561101a576040516332483afb60e01b815260040160405180910390fd5b7fcc5dc080ff977b3c3a211fa63ab74f90f658f5ba9d3236e92c8f59570f442aac611043610887565b604080516001600160a01b03928316815291851660208301520160405180910390a15f80546001600160a01b038416610100026001600160a81b031990911617600117905561071a82611b78565b61109f848484600185611bf6565b50505050565b600b5460ff16156110c95760405163b8ef635160e01b815260040160405180910390fd5b6110d161133e565b610c16611c49565b60606110e48261139b565b5f6110ed611c80565b90505f81511161110b5760405180602001604052805f815250610f73565b8061111584611c8f565b6040516020016111269291906132e5565b6040516020818303038152906040529392505050565b600b5460ff16156111605760405163b8ef635160e01b815260040160405180910390fd5b61116861133e565b610c16611d1e565b5f828152600c602052604090206001015461118a81611782565b6108828383611865565b6001600160a01b038083165f9081526008602090815260408083209385168352929052205460ff1680610702575f54600160a81b900460ff1615610702576111da610887565b6001600160a01b0316826001600160a01b031614905092915050565b6111fe61191e565b6001600160a01b0381166112635760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b606482015260840161081f565b61126c81611a85565b50565b5f6001600160e01b031982166380ac58cd60e01b148061129f57506001600160e01b03198216635b5e139f60e01b145b806112ba57506001600160e01b03198216632b435fdb60e21b145b806112d557506001600160e01b0319821663503e914d60e11b145b806112f057506001600160e01b0319821663152a902d60e11b145b8061130b57506001600160e01b03198216636df925a960e11b145b80610702575061070282611d76565b5f6001600160e01b03198216637965db0b60e01b148061070257506107028261126f565b610c1661191e565b6113508282611daa565b6040516001600160601b03821681526001600160a01b038316907f8a8bae378cb731c5c40b632330c6836c2f916f48edb967699c86736f9a6a76ef9060200160405180910390a25050565b5f818152600560205260409020546001600160a01b031661126c5760405163b718b68760e01b81526004810182905260240161081f565b5f81815260076020526040902080546001600160a01b0319166001600160a01b038416908117909155819061140682610c18565b6001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b80156114865761144f3383611e64565b61148657604051630957569f60e01b81526001600160a01b038086166004830152841660248201526044810183905260640161081f565b61109f848484611ec2565b6002600d54036114e35760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604482015260640161081f565b6002600d55565b5f878787878787876040516020016115089796959493929190613320565b604051602081830303815290604052805190602001209050979650505050505050565b5f5f61157784848080601f0160208091040260200160405190810160405280939291908181526020018383808284375f9201919091525061157192508991506120049050565b90612056565b600f546001600160a01b0390811691161495945050505050565b5f5b81811015611757576001600160a01b0384166115c25760405163e7070eb760e01b815260040160405180910390fd5b61deac196001600160a01b038516016115ed57604051625d022b60e71b815260040160405180910390fd5b611625838383818110611602576116026132ba565b905060200201355f908152600560205260409020546001600160a01b0316151590565b1561165f5782828281811061163c5761163c6132ba565b905060200201356040516303dd6ca560e41b815260040161081f91815260200190565b6116845f85858585818110611676576116766132ba565b905060200201356001612078565b8360055f85858581811061169a5761169a6132ba565b9050602002013581526020019081526020015f205f6101000a8154816001600160a01b0302191690836001600160a01b031602179055508282828181106116e3576116e36132ba565b90506020020135846001600160a01b03165f6001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60405160405180910390a461174f5f85858585818110611741576117416132ba565b90506020020135600161209e565b600101611593565b506001600160a01b039092165f90815260066020526040902080548301905550600980549091019055565b61126c81336120c4565b6117968282610e51565b61071a575f828152600c602090815260408083206001600160a01b03851684529091529020805460ff191660011790556117cd3390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b61183b7f3c11d16cbaffd01df69ce1c404f6340ee057498f5f00246190ea54220576a84833610e51565b610c165760405163fc34014560e01b815260040160405180910390fd5b610882838383600161211d565b61186f8282610e51565b1561071a575f828152600c602090815260408083206001600160a01b0385168085529252808320805460ff1916905551339285917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45050565b5f848484846040516020016118e3949392919061336e565b604051602081830303815290604052805190602001209050949350505050565b61109f8484848460405180602001604052805f815250611bf6565b600b546001600160a01b036301000000909104163314610c165760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015260640161081f565b61198b8383836121ad565b6040516001600160601b03821681526001600160a01b0383169084907f7f5b076c952c0ec86e5425963c1326dd0f03a3595c19f81d765e8ff559a6e33c906020015b60405180910390a3505050565b600b805460ff62010000808304821615810262ff00001990931692909217928390556040517f577da8c64d93f431936fff4a4f48ae1d1f927eb42c95eb2e699c02ebfc87f16393611a349390049091161515815260200190565b60405180910390a1565b611a687f9f2df0fed2c77648de5860a4cc508cd0818c85b8b8a1ab4ceeef8d981c8956a633610e51565b610c16576040516309304cd760e21b815260040160405180910390fd5b600b80546001600160a01b0383811663010000008181026301000000600160b81b031985161790945560405193909204169182907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0905f90a35050565b816001600160a01b0316836001600160a01b031603611b1457604051631f488f8760e31b815260040160405180910390fd5b6001600160a01b038381165f81815260086020908152604080832094871680845294825291829020805460ff191686151590811790915591519182527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c3191016119cd565b6001600160a01b0381161561126c57803b801561071a576040805163fb2de5d760e01b81523060048201526102d1602482015290516001600160a01b0384169163fb2de5d7916044808301925f92919082900301818387803b158015611bdc575f5ffd5b505af1925050508015611bed575060015b1561071a575050565b8115611c3d57611c063384611e64565b611c3d57604051630957569f60e01b81526001600160a01b038087166004830152851660248201526044810184905260640161081f565b610b9085858584612277565b600b805460ff191660011790556040517fcee6e0f49275e8fab40d97ef710003453e5e85e47c41f998f81f0ef3faa131f9905f90a1565b6060600e805461072d90613122565b60605f611c9b8361228e565b60010190505f816001600160401b03811115611cb957611cb9612e60565b6040519080825280601f01601f191660200182016040528015611ce3576020820181803683370190505b5090508181016020015b5f19016f181899199a1a9b1b9c1cb0b131b232b360811b600a86061a8153600a8504945084611ced57509392505050565b600b805460ff610100808304821615810261ff001990931692909217928390556040517f4c9b4718121fe20d76004df1b8cdcdc2b64b852d9f8d72e491f65a3e4a1719f993611a349390049091161515815260200190565b5f6001600160e01b0319821663152a902d60e11b148061070257506301ffc9a760e01b6001600160e01b0319831614610702565b6127106001600160601b0382161115611dd55760405162461bcd60e51b815260040161081f906133a1565b6001600160a01b038216611e2b5760405162461bcd60e51b815260206004820152601960248201527f455243323938313a20696e76616c696420726563656976657200000000000000604482015260640161081f565b604080518082019091526001600160a01b039092168083526001600160601b039091166020909201829052600160a01b90910217600155565b5f5f611e6f83610c18565b9050806001600160a01b0316846001600160a01b03161480611e965750611e968185611194565b80611eba5750836001600160a01b0316611eaf846107ae565b6001600160a01b0316145b949350505050565b6001600160a01b038216611ee957604051630149550160e71b815260040160405180910390fd5b61deac196001600160a01b03831601611f1557604051631634e02360e21b815260040160405180910390fd5b826001600160a01b0316611f2882610c18565b6001600160a01b031614611f61576040516358253c0360e11b81526001600160a01b03841660048201526024810182905260440161081f565b611f6e8383836001612078565b5f81815260076020908152604080832080546001600160a01b03199081169091556001600160a01b038781168086526006855283862080545f1901905590871680865283862080546001019055868652600590945282852080549092168417909155905184937fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef91a4610882838383600161209e565b6040517f19457468657265756d205369676e6564204d6573736167653a0a3332000000006020820152603c81018290525f90605c01604051602081830303815290604052805190602001209050919050565b5f5f5f6120638585612365565b91509150612070816123a4565b509392505050565b5f5b81811015610b9057612096858561209184876133eb565b6124ed565b60010161207a565b5f5b81811015610b90576120bc85856120b784876133eb565b612543565b6001016120a0565b6120ce8282610e51565b61071a576120db8161258a565b6120e683602061259c565b6040516020016120f79291906133fe565b60408051601f198184030181529082905262461bcd60e51b825261081f91600401612bb5565b80156121a3575f5b828110156121a15761214f85858584818110612143576121436132ba565b90506020020135611e64565b6121995784848483818110612166576121666132ba565b60405163b2b70f8960e01b81526001600160a01b039094166004850152602002919091013560248301525060440161081f565b600101612125565b505b61109f8383612731565b6127106001600160601b03821611156121d85760405162461bcd60e51b815260040161081f906133a1565b6001600160a01b03821661222e5760405162461bcd60e51b815260206004820152601b60248201527f455243323938313a20496e76616c696420706172616d65746572730000000000604482015260640161081f565b6040805180820182526001600160a01b0393841681526001600160601b0392831660208083019182525f968752600290529190942093519051909116600160a01b029116179055565b612282848484611ec2565b61109f8484848461286b565b5f8072184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b83106122cc5772184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b830492506040015b6d04ee2d6d415b85acef810000000083106122f8576d04ee2d6d415b85acef8100000000830492506020015b662386f26fc10000831061231657662386f26fc10000830492506010015b6305f5e100831061232e576305f5e100830492506008015b612710831061234257612710830492506004015b60648310612354576064830492506002015b600a83106107025760010192915050565b5f5f8251604103612399576020830151604084015160608501515f1a61238d87828585612998565b94509450505050610a1f565b505f90506002610a1f565b5f8160048111156123b7576123b761345c565b036123bf5750565b60018160048111156123d3576123d361345c565b036124205760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e61747572650000000000000000604482015260640161081f565b60028160048111156124345761243461345c565b036124815760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e67746800604482015260640161081f565b60038160048111156124955761249561345c565b0361126c5760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c604482015261756560f01b606482015260840161081f565b6001600160a01b0383811615908316158180156125075750805b1561252557604051635cbd944160e01b815260040160405180910390fd5b8115612531575b610b90565b8061252c57610b903386868634612a55565b6001600160a01b03838116159083161581801561255d5750805b1561257b57604051635cbd944160e01b815260040160405180910390fd5b8161252c578061252c57610b90565b60606107026001600160a01b03831660145b60605f6125aa83600261316e565b6125b59060026133eb565b6001600160401b038111156125cc576125cc612e60565b6040519080825280601f01601f1916602001820160405280156125f6576020820181803683370190505b509050600360fc1b815f81518110612610576126106132ba565b60200101906001600160f81b03191690815f1a905350600f60fb1b8160018151811061263e5761263e6132ba565b60200101906001600160f81b03191690815f1a9053505f61266084600261316e565b61266b9060016133eb565b90505b60018111156126e2576f181899199a1a9b1b9c1cb0b131b232b360811b85600f166010811061269f5761269f6132ba565b1a60f81b8282815181106126b5576126b56132ba565b60200101906001600160f81b03191690815f1a90535060049490941c936126db81613470565b905061266e565b508315610f735760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e74604482015260640161081f565b5f5b8181101561285e575f83838381811061274e5761274e6132ba565b9050602002013590505f61276182610c18565b905061deac196001600160a01b038216016127925760405163fd3b071f60e01b81526004810183905260240161081f565b6127a18161dead846001612078565b5f82815260076020908152604080832080546001600160a01b03199081169091556001600160a01b0385168085526006845282852080545f190190557f1aecba4ebe7a4e0673e4891b2b092b2228e4322380b579fb494fad3da8586e22805460010190558685526005909352818420805461dead921682179055905185939192917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef91a46128548161dead84600161209e565b5050600101612733565b50600a8054909101905550565b6001600160a01b0383163b1561109f57604051630a85bd0160e11b81526001600160a01b0384169063150b7a02906128ad903390889087908790600401613485565b6020604051808303815f875af19250505080156128e7575060408051601f3d908101601f191682019092526128e4918101906134c1565b60015b612955573d808015612914576040519150601f19603f3d011682016040523d82523d5f602084013e612919565b606091505b5080515f0361294d57604051631f7f31e560e31b81526001600160a01b03851660048201526024810184905260440161081f565b805181602001fd5b6001600160e01b03198116630a85bd0160e11b14610b9057604051631f7f31e560e31b81526001600160a01b03851660048201526024810184905260440161081f565b5f807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a08311156129cd57505f90506003612a4c565b604080515f8082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa158015612a1e573d5f5f3e3d5ffd5b5050604051601f1901519150506001600160a01b038116612a46575f60019250925050612a4c565b91505f90505b94509492505050565b5f612a5e610887565b90506001600160a01b03811615612af2576001600160a01b0381163303612a855750610b90565b60405163657711f560e11b81526001600160a01b038781166004830152868116602483015285811660448301526064820185905282169063caee23ea906084015f6040518083038186803b158015612adb575f5ffd5b505afa158015612aed573d5f5f3e3d5ffd5b505050505b505050505050565b6001600160e01b03198116811461126c575f5ffd5b5f60208284031215612b1f575f5ffd5b8135610f7381612afa565b80356001600160a01b0381168114610c50575f5ffd5b80356001600160601b0381168114610c50575f5ffd5b5f5f60408385031215612b67575f5ffd5b612b7083612b2a565b9150612b7e60208401612b40565b90509250929050565b5f81518084528060208401602086015e5f602082860101526020601f19601f83011685010191505092915050565b602081525f610f736020830184612b87565b5f60208284031215612bd7575f5ffd5b5035919050565b5f5f60408385031215612bef575f5ffd5b612bf883612b2a565b946020939093013593505050565b5f5f5f60608486031215612c18575f5ffd5b612c2184612b2a565b9250612c2f60208501612b2a565b929592945050506040919091013590565b5f5f83601f840112612c50575f5ffd5b5081356001600160401b03811115612c66575f5ffd5b602083019150836020828501011115610a1f575f5ffd5b5f5f83601f840112612c8d575f5ffd5b5081356001600160401b03811115612ca3575f5ffd5b6020830191508360208260051b8501011115610a1f575f5ffd5b5f5f5f5f5f5f5f5f60a0898b031215612cd4575f5ffd5b612cdd89612b2a565b975060208901356001600160401b03811115612cf7575f5ffd5b612d038b828c01612c40565b90985096505060408901356001600160401b03811115612d21575f5ffd5b612d2d8b828c01612c7d565b90965094505060608901356001600160401b03811115612d4b575f5ffd5b612d578b828c01612c40565b999c989b50969995989497949560800135949350505050565b5f5f60408385031215612d81575f5ffd5b50508035926020909101359150565b5f5f60408385031215612da1575f5ffd5b82359150612b7e60208401612b2a565b5f5f60208385031215612dc2575f5ffd5b82356001600160401b03811115612dd7575f5ffd5b612de385828601612c7d565b90969095509350505050565b5f5f5f5f5f60608688031215612e03575f5ffd5b85356001600160401b03811115612e18575f5ffd5b612e2488828901612c7d565b90965094505060208601356001600160401b03811115612e42575f5ffd5b612e4e88828901612c40565b96999598509660400135949350505050565b634e487b7160e01b5f52604160045260245ffd5b5f5f6001600160401b03841115612e8d57612e8d612e60565b50604051601f19601f85018116603f011681018181106001600160401b0382111715612ebb57612ebb612e60565b604052838152905080828401851015612ed2575f5ffd5b838360208301375f60208583010152509392505050565b5f60208284031215612ef9575f5ffd5b81356001600160401b03811115612f0e575f5ffd5b8201601f81018413612f1e575f5ffd5b611eba84823560208401612e74565b5f5f5f60608486031215612f3f575f5ffd5b83359250612f4f60208501612b2a565b9150612f5d60408501612b40565b90509250925092565b5f5f5f60408486031215612f78575f5ffd5b612f8184612b2a565b925060208401356001600160401b03811115612f9b575f5ffd5b612fa786828701612c7d565b9497909650939450505050565b5f60208284031215612fc4575f5ffd5b610f7382612b2a565b602080825282518282018190525f918401906040840190835b81811015610e46578351835260209384019390920191600101612fe6565b5f5f5f60608486031215613016575f5ffd5b61301f84612b2a565b95602085013595506040909401359392505050565b80358015158114610c50575f5ffd5b5f60208284031215613053575f5ffd5b610f7382613034565b5f5f6040838503121561306d575f5ffd5b61307683612b2a565b9150612b7e60208401613034565b5f5f5f5f60808587031215613097575f5ffd5b6130a085612b2a565b93506130ae60208601612b2a565b92506040850135915060608501356001600160401b038111156130cf575f5ffd5b8501601f810187136130df575f5ffd5b6130ee87823560208401612e74565b91505092959194509250565b5f5f6040838503121561310b575f5ffd5b61311483612b2a565b9150612b7e60208401612b2a565b600181811c9082168061313657607f821691505b60208210810361315457634e487b7160e01b5f52602260045260245ffd5b50919050565b634e487b7160e01b5f52601160045260245ffd5b80820281158282048414176107025761070261315a565b5f8261319f57634e487b7160e01b5f52601260045260245ffd5b500490565b601f82111561088257805f5260205f20601f840160051c810160208510156131c95750805b601f840160051c820191505b81811015610b90575f81556001016131d5565b81516001600160401b0381111561320157613201612e60565b6132158161320f8454613122565b846131a4565b6020601f821160018114613247575f83156132305750848201515b5f19600385901b1c1916600184901b178455610b90565b5f84815260208120601f198516915b828110156132765787850151825560209485019460019092019101613256565b508482101561329357868401515f19600387901b60f8161c191681555b50505050600190811b01905550565b5f600182016132b3576132b361315a565b5060010190565b634e487b7160e01b5f52603260045260245ffd5b5f81518060208401855e5f93019283525090919050565b5f611eba6132f383866132ce565b846132ce565b5f6001600160fb1b0383111561330d575f5ffd5b8260051b80838637939093019392505050565b868882375f8782016001600160601b03198860601b1681526001600160601b03198760601b1660148201526133596028820186886132f9565b93845250506020909101979650505050505050565b5f61337a8286886132f9565b60609490941b6bffffffffffffffffffffffff191684525050601482015260340192915050565b6020808252602a908201527f455243323938313a20726f79616c7479206665652077696c6c206578636565646040820152692073616c65507269636560b01b606082015260800190565b808201808211156107025761070261315a565b7f416363657373436f6e74726f6c3a206163636f756e742000000000000000000081525f61342f60178301856132ce565b7001034b99036b4b9b9b4b733903937b6329607d1b815261345360118201856132ce565b95945050505050565b634e487b7160e01b5f52602160045260245ffd5b5f8161347e5761347e61315a565b505f190190565b6001600160a01b03858116825284166020820152604081018390526080606082018190525f906134b790830184612b87565b9695505050505050565b5f602082840312156134d1575f5ffd5b8151610f7381612afa56fea26469706673582212207f3880c9d4fd7d53ee554cd0a39e5a85999e9a4a3ccae67d7989c56a88d45e2264736f6c634300081c0033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
00000000000000000000000041db617739104eb64856e28efeb323fb8b626e9900000000000000000000000000000000000000000000000000000000000001f400000000000000000000000000000000000000000000000000000000000000c00000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000014000000000000000000000000091e29c8cfdc161217d75286188507f07a576629b0000000000000000000000000000000000000000000000000000000000000018426f6f6b2047616d657320627920566565467269656e6473000000000000000000000000000000000000000000000000000000000000000000000000000000024247000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003368747470733a2f2f6170692d6d657461646174612e766565667269656e64732e636f6d2f76312f636f6c6c656374696f6e732f00000000000000000000000000
-----Decoded View---------------
Arg [0] : royaltyReceiver_ (address): 0x41db617739104EB64856e28efEB323Fb8b626E99
Arg [1] : royaltyFeeNumerator_ (uint96): 500
Arg [2] : name_ (string): Book Games by VeeFriends
Arg [3] : symbol_ (string): BG
Arg [4] : initialBaseUri_ (string): https://api-metadata.veefriends.com/v1/collections/
Arg [5] : signer_ (address): 0x91e29C8cfDC161217d75286188507f07a576629b
-----Encoded View---------------
13 Constructor Arguments found :
Arg [0] : 00000000000000000000000041db617739104eb64856e28efeb323fb8b626e99
Arg [1] : 00000000000000000000000000000000000000000000000000000000000001f4
Arg [2] : 00000000000000000000000000000000000000000000000000000000000000c0
Arg [3] : 0000000000000000000000000000000000000000000000000000000000000100
Arg [4] : 0000000000000000000000000000000000000000000000000000000000000140
Arg [5] : 00000000000000000000000091e29c8cfdc161217d75286188507f07a576629b
Arg [6] : 0000000000000000000000000000000000000000000000000000000000000018
Arg [7] : 426f6f6b2047616d657320627920566565467269656e64730000000000000000
Arg [8] : 0000000000000000000000000000000000000000000000000000000000000002
Arg [9] : 4247000000000000000000000000000000000000000000000000000000000000
Arg [10] : 0000000000000000000000000000000000000000000000000000000000000033
Arg [11] : 68747470733a2f2f6170692d6d657461646174612e766565667269656e64732e
Arg [12] : 636f6d2f76312f636f6c6c656374696f6e732f00000000000000000000000000
Loading...
Loading
Loading...
Loading
Loading...
Loading
Net Worth in USD
$5.00
Net Worth in ETH
0.001496
Token Allocations
USDC
100.00%
Multichain Portfolio | 35 Chains
| Chain | Token | Portfolio % | Price | Amount | Value |
|---|---|---|---|---|---|
| BASE | 100.00% | $0.999767 | 5 | $5 |
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.