编译器
0.8.19+commit.7dd6d404
文件 1 的 38:AccessControl.sol
pragma solidity ^0.8.0;
import "./IAccessControl.sol";
import "../utils/Context.sol";
import "../utils/Strings.sol";
import "../utils/introspection/ERC165.sol";
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;
modifier onlyRole(bytes32 role) {
_checkRole(role);
_;
}
function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
return interfaceId == type(IAccessControl).interfaceId || super.supportsInterface(interfaceId);
}
function hasRole(bytes32 role, address account) public view virtual override returns (bool) {
return _roles[role].members[account];
}
function _checkRole(bytes32 role) internal view virtual {
_checkRole(role, _msgSender());
}
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)
)
)
);
}
}
function getRoleAdmin(bytes32 role) public view virtual override returns (bytes32) {
return _roles[role].adminRole;
}
function grantRole(bytes32 role, address account) public virtual override onlyRole(getRoleAdmin(role)) {
_grantRole(role, account);
}
function revokeRole(bytes32 role, address account) public virtual override onlyRole(getRoleAdmin(role)) {
_revokeRole(role, account);
}
function renounceRole(bytes32 role, address account) public virtual override {
require(account == _msgSender(), "AccessControl: can only renounce roles for self");
_revokeRole(role, account);
}
function _setupRole(bytes32 role, address account) internal virtual {
_grantRole(role, account);
}
function _setRoleAdmin(bytes32 role, bytes32 adminRole) internal virtual {
bytes32 previousAdminRole = getRoleAdmin(role);
_roles[role].adminRole = adminRole;
emit RoleAdminChanged(role, previousAdminRole, adminRole);
}
function _grantRole(bytes32 role, address account) internal virtual {
if (!hasRole(role, account)) {
_roles[role].members[account] = true;
emit RoleGranted(role, account, _msgSender());
}
}
function _revokeRole(bytes32 role, address account) internal virtual {
if (hasRole(role, account)) {
_roles[role].members[account] = false;
emit RoleRevoked(role, account, _msgSender());
}
}
}
文件 2 的 38:Constants.sol
pragma solidity ^0.8.13;
address constant CANONICAL_OPERATOR_FILTER_REGISTRY_ADDRESS = 0x000000000000AAeB6D7670E522A718067333cd4E;
address constant CANONICAL_CORI_SUBSCRIPTION = 0x3cc6CddA760b79bAfa08dF41ECFA224f810dCeB6;
文件 3 的 38:Context.sol
pragma solidity ^0.8.0;
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes calldata) {
return msg.data;
}
}
文件 4 的 38:DataType.sol
pragma solidity >=0.7.0 <0.9.0;
library DataType {
enum TokenLocation {
Operator,
Other
}
enum LockStatus {
UnLock,
Lock
}
struct AfterParentTokenTransferParams {
address from;
address to;
uint256 tokenId;
uint256 totalAmountParentLinkSbtContracts;
}
struct CreateParentLinkSbtParams {
string name;
string symbol;
string baseUri;
address ownerAddress;
address parentContractAddress;
}
struct ConnectParentLinkSbtParams {
uint256 tokenId;
address parentLinkSbtContract;
uint256 parentLinkSbtTokenId;
}
struct AllStageParams {
uint256 highSchooler;
uint256 workingAdult;
uint256 marriage;
uint256 family;
uint256 oldAge;
uint256 tomb;
}
}
文件 5 的 38:ERC165.sol
pragma solidity ^0.8.0;
import "./IERC165.sol";
abstract contract ERC165 is IERC165 {
function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
return interfaceId == type(IERC165).interfaceId;
}
}
文件 6 的 38:ERC2981.sol
pragma solidity ^0.8.0;
import "../../interfaces/IERC2981.sol";
import "../../utils/introspection/ERC165.sol";
abstract contract ERC2981 is IERC2981, ERC165 {
struct RoyaltyInfo {
address receiver;
uint96 royaltyFraction;
}
RoyaltyInfo private _defaultRoyaltyInfo;
mapping(uint256 => RoyaltyInfo) private _tokenRoyaltyInfo;
function supportsInterface(bytes4 interfaceId) public view virtual override(IERC165, ERC165) returns (bool) {
return interfaceId == type(IERC2981).interfaceId || super.supportsInterface(interfaceId);
}
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);
}
function _feeDenominator() internal pure virtual returns (uint96) {
return 10000;
}
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);
}
function _deleteDefaultRoyalty() internal virtual {
delete _defaultRoyaltyInfo;
}
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);
}
function _resetTokenRoyalty(uint256 tokenId) internal virtual {
delete _tokenRoyaltyInfo[tokenId];
}
}
文件 7 的 38:ERC721A.sol
pragma solidity ^0.8.4;
import './IERC721A.sol';
interface ERC721A__IERC721Receiver {
function onERC721Received(
address operator,
address from,
uint256 tokenId,
bytes calldata data
) external returns (bytes4);
}
contract ERC721A is IERC721A {
struct TokenApprovalRef {
address value;
}
uint256 private constant _BITMASK_ADDRESS_DATA_ENTRY = (1 << 64) - 1;
uint256 private constant _BITPOS_NUMBER_MINTED = 64;
uint256 private constant _BITPOS_NUMBER_BURNED = 128;
uint256 private constant _BITPOS_AUX = 192;
uint256 private constant _BITMASK_AUX_COMPLEMENT = (1 << 192) - 1;
uint256 private constant _BITPOS_START_TIMESTAMP = 160;
uint256 private constant _BITMASK_BURNED = 1 << 224;
uint256 private constant _BITPOS_NEXT_INITIALIZED = 225;
uint256 private constant _BITMASK_NEXT_INITIALIZED = 1 << 225;
uint256 private constant _BITPOS_EXTRA_DATA = 232;
uint256 private constant _BITMASK_EXTRA_DATA_COMPLEMENT = (1 << 232) - 1;
uint256 private constant _BITMASK_ADDRESS = (1 << 160) - 1;
uint256 private constant _MAX_MINT_ERC2309_QUANTITY_LIMIT = 5000;
bytes32 private constant _TRANSFER_EVENT_SIGNATURE =
0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef;
uint256 private _currentIndex;
uint256 private _burnCounter;
string private _name;
string private _symbol;
mapping(uint256 => uint256) private _packedOwnerships;
mapping(address => uint256) private _packedAddressData;
mapping(uint256 => TokenApprovalRef) private _tokenApprovals;
mapping(address => mapping(address => bool)) private _operatorApprovals;
constructor(string memory name_, string memory symbol_) {
_name = name_;
_symbol = symbol_;
_currentIndex = _startTokenId();
}
function _startTokenId() internal view virtual returns (uint256) {
return 0;
}
function _nextTokenId() internal view virtual returns (uint256) {
return _currentIndex;
}
function totalSupply() public view virtual override returns (uint256) {
unchecked {
return _currentIndex - _burnCounter - _startTokenId();
}
}
function _totalMinted() internal view virtual returns (uint256) {
unchecked {
return _currentIndex - _startTokenId();
}
}
function _totalBurned() internal view virtual returns (uint256) {
return _burnCounter;
}
function balanceOf(address owner) public view virtual override returns (uint256) {
if (owner == address(0)) revert BalanceQueryForZeroAddress();
return _packedAddressData[owner] & _BITMASK_ADDRESS_DATA_ENTRY;
}
function _numberMinted(address owner) internal view returns (uint256) {
return (_packedAddressData[owner] >> _BITPOS_NUMBER_MINTED) & _BITMASK_ADDRESS_DATA_ENTRY;
}
function _numberBurned(address owner) internal view returns (uint256) {
return (_packedAddressData[owner] >> _BITPOS_NUMBER_BURNED) & _BITMASK_ADDRESS_DATA_ENTRY;
}
function _getAux(address owner) internal view returns (uint64) {
return uint64(_packedAddressData[owner] >> _BITPOS_AUX);
}
function _setAux(address owner, uint64 aux) internal virtual {
uint256 packed = _packedAddressData[owner];
uint256 auxCasted;
assembly {
auxCasted := aux
}
packed = (packed & _BITMASK_AUX_COMPLEMENT) | (auxCasted << _BITPOS_AUX);
_packedAddressData[owner] = packed;
}
function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
return
interfaceId == 0x01ffc9a7 ||
interfaceId == 0x80ac58cd ||
interfaceId == 0x5b5e139f;
}
function name() public view virtual override returns (string memory) {
return _name;
}
function symbol() public view virtual override returns (string memory) {
return _symbol;
}
function tokenURI(uint256 tokenId) public view virtual override returns (string memory) {
if (!_exists(tokenId)) revert URIQueryForNonexistentToken();
string memory baseURI = _baseURI();
return bytes(baseURI).length != 0 ? string(abi.encodePacked(baseURI, _toString(tokenId))) : '';
}
function _baseURI() internal view virtual returns (string memory) {
return '';
}
function ownerOf(uint256 tokenId) public view virtual override returns (address) {
return address(uint160(_packedOwnershipOf(tokenId)));
}
function _ownershipOf(uint256 tokenId) internal view virtual returns (TokenOwnership memory) {
return _unpackedOwnership(_packedOwnershipOf(tokenId));
}
function _ownershipAt(uint256 index) internal view virtual returns (TokenOwnership memory) {
return _unpackedOwnership(_packedOwnerships[index]);
}
function _initializeOwnershipAt(uint256 index) internal virtual {
if (_packedOwnerships[index] == 0) {
_packedOwnerships[index] = _packedOwnershipOf(index);
}
}
function _packedOwnershipOf(uint256 tokenId) private view returns (uint256) {
uint256 curr = tokenId;
unchecked {
if (_startTokenId() <= curr)
if (curr < _currentIndex) {
uint256 packed = _packedOwnerships[curr];
if (packed & _BITMASK_BURNED == 0) {
while (packed == 0) {
packed = _packedOwnerships[--curr];
}
return packed;
}
}
}
revert OwnerQueryForNonexistentToken();
}
function _unpackedOwnership(uint256 packed) private pure returns (TokenOwnership memory ownership) {
ownership.addr = address(uint160(packed));
ownership.startTimestamp = uint64(packed >> _BITPOS_START_TIMESTAMP);
ownership.burned = packed & _BITMASK_BURNED != 0;
ownership.extraData = uint24(packed >> _BITPOS_EXTRA_DATA);
}
function _packOwnershipData(address owner, uint256 flags) private view returns (uint256 result) {
assembly {
owner := and(owner, _BITMASK_ADDRESS)
result := or(owner, or(shl(_BITPOS_START_TIMESTAMP, timestamp()), flags))
}
}
function _nextInitializedFlag(uint256 quantity) private pure returns (uint256 result) {
assembly {
result := shl(_BITPOS_NEXT_INITIALIZED, eq(quantity, 1))
}
}
function approve(address to, uint256 tokenId) public payable virtual override {
address owner = ownerOf(tokenId);
if (_msgSenderERC721A() != owner)
if (!isApprovedForAll(owner, _msgSenderERC721A())) {
revert ApprovalCallerNotOwnerNorApproved();
}
_tokenApprovals[tokenId].value = to;
emit Approval(owner, to, tokenId);
}
function getApproved(uint256 tokenId) public view virtual override returns (address) {
if (!_exists(tokenId)) revert ApprovalQueryForNonexistentToken();
return _tokenApprovals[tokenId].value;
}
function setApprovalForAll(address operator, bool approved) public virtual override {
_operatorApprovals[_msgSenderERC721A()][operator] = approved;
emit ApprovalForAll(_msgSenderERC721A(), operator, approved);
}
function isApprovedForAll(address owner, address operator) public view virtual override returns (bool) {
return _operatorApprovals[owner][operator];
}
function _exists(uint256 tokenId) internal view virtual returns (bool) {
return
_startTokenId() <= tokenId &&
tokenId < _currentIndex &&
_packedOwnerships[tokenId] & _BITMASK_BURNED == 0;
}
function _isSenderApprovedOrOwner(
address approvedAddress,
address owner,
address msgSender
) private pure returns (bool result) {
assembly {
owner := and(owner, _BITMASK_ADDRESS)
msgSender := and(msgSender, _BITMASK_ADDRESS)
result := or(eq(msgSender, owner), eq(msgSender, approvedAddress))
}
}
function _getApprovedSlotAndAddress(uint256 tokenId)
private
view
returns (uint256 approvedAddressSlot, address approvedAddress)
{
TokenApprovalRef storage tokenApproval = _tokenApprovals[tokenId];
assembly {
approvedAddressSlot := tokenApproval.slot
approvedAddress := sload(approvedAddressSlot)
}
}
function transferFrom(
address from,
address to,
uint256 tokenId
) public payable virtual override {
uint256 prevOwnershipPacked = _packedOwnershipOf(tokenId);
if (address(uint160(prevOwnershipPacked)) != from) revert TransferFromIncorrectOwner();
(uint256 approvedAddressSlot, address approvedAddress) = _getApprovedSlotAndAddress(tokenId);
if (!_isSenderApprovedOrOwner(approvedAddress, from, _msgSenderERC721A()))
if (!isApprovedForAll(from, _msgSenderERC721A())) revert TransferCallerNotOwnerNorApproved();
if (to == address(0)) revert TransferToZeroAddress();
_beforeTokenTransfers(from, to, tokenId, 1);
assembly {
if approvedAddress {
sstore(approvedAddressSlot, 0)
}
}
unchecked {
--_packedAddressData[from];
++_packedAddressData[to];
_packedOwnerships[tokenId] = _packOwnershipData(
to,
_BITMASK_NEXT_INITIALIZED | _nextExtraData(from, to, prevOwnershipPacked)
);
if (prevOwnershipPacked & _BITMASK_NEXT_INITIALIZED == 0) {
uint256 nextTokenId = tokenId + 1;
if (_packedOwnerships[nextTokenId] == 0) {
if (nextTokenId != _currentIndex) {
_packedOwnerships[nextTokenId] = prevOwnershipPacked;
}
}
}
}
emit Transfer(from, to, tokenId);
_afterTokenTransfers(from, to, tokenId, 1);
}
function safeTransferFrom(
address from,
address to,
uint256 tokenId
) public payable virtual override {
safeTransferFrom(from, to, tokenId, '');
}
function safeTransferFrom(
address from,
address to,
uint256 tokenId,
bytes memory _data
) public payable virtual override {
transferFrom(from, to, tokenId);
if (to.code.length != 0)
if (!_checkContractOnERC721Received(from, to, tokenId, _data)) {
revert TransferToNonERC721ReceiverImplementer();
}
}
function _beforeTokenTransfers(
address from,
address to,
uint256 startTokenId,
uint256 quantity
) internal virtual {}
function _afterTokenTransfers(
address from,
address to,
uint256 startTokenId,
uint256 quantity
) internal virtual {}
function _checkContractOnERC721Received(
address from,
address to,
uint256 tokenId,
bytes memory _data
) private returns (bool) {
try ERC721A__IERC721Receiver(to).onERC721Received(_msgSenderERC721A(), from, tokenId, _data) returns (
bytes4 retval
) {
return retval == ERC721A__IERC721Receiver(to).onERC721Received.selector;
} catch (bytes memory reason) {
if (reason.length == 0) {
revert TransferToNonERC721ReceiverImplementer();
} else {
assembly {
revert(add(32, reason), mload(reason))
}
}
}
}
function _mint(address to, uint256 quantity) internal virtual {
uint256 startTokenId = _currentIndex;
if (quantity == 0) revert MintZeroQuantity();
_beforeTokenTransfers(address(0), to, startTokenId, quantity);
unchecked {
_packedAddressData[to] += quantity * ((1 << _BITPOS_NUMBER_MINTED) | 1);
_packedOwnerships[startTokenId] = _packOwnershipData(
to,
_nextInitializedFlag(quantity) | _nextExtraData(address(0), to, 0)
);
uint256 toMasked;
uint256 end = startTokenId + quantity;
assembly {
toMasked := and(to, _BITMASK_ADDRESS)
log4(
0,
0,
_TRANSFER_EVENT_SIGNATURE,
0,
toMasked,
startTokenId
)
for {
let tokenId := add(startTokenId, 1)
} iszero(eq(tokenId, end)) {
tokenId := add(tokenId, 1)
} {
log4(0, 0, _TRANSFER_EVENT_SIGNATURE, 0, toMasked, tokenId)
}
}
if (toMasked == 0) revert MintToZeroAddress();
_currentIndex = end;
}
_afterTokenTransfers(address(0), to, startTokenId, quantity);
}
function _mintERC2309(address to, uint256 quantity) internal virtual {
uint256 startTokenId = _currentIndex;
if (to == address(0)) revert MintToZeroAddress();
if (quantity == 0) revert MintZeroQuantity();
if (quantity > _MAX_MINT_ERC2309_QUANTITY_LIMIT) revert MintERC2309QuantityExceedsLimit();
_beforeTokenTransfers(address(0), to, startTokenId, quantity);
unchecked {
_packedAddressData[to] += quantity * ((1 << _BITPOS_NUMBER_MINTED) | 1);
_packedOwnerships[startTokenId] = _packOwnershipData(
to,
_nextInitializedFlag(quantity) | _nextExtraData(address(0), to, 0)
);
emit ConsecutiveTransfer(startTokenId, startTokenId + quantity - 1, address(0), to);
_currentIndex = startTokenId + quantity;
}
_afterTokenTransfers(address(0), to, startTokenId, quantity);
}
function _safeMint(
address to,
uint256 quantity,
bytes memory _data
) internal virtual {
_mint(to, quantity);
unchecked {
if (to.code.length != 0) {
uint256 end = _currentIndex;
uint256 index = end - quantity;
do {
if (!_checkContractOnERC721Received(address(0), to, index++, _data)) {
revert TransferToNonERC721ReceiverImplementer();
}
} while (index < end);
if (_currentIndex != end) revert();
}
}
}
function _safeMint(address to, uint256 quantity) internal virtual {
_safeMint(to, quantity, '');
}
function _burn(uint256 tokenId) internal virtual {
_burn(tokenId, false);
}
function _burn(uint256 tokenId, bool approvalCheck) internal virtual {
uint256 prevOwnershipPacked = _packedOwnershipOf(tokenId);
address from = address(uint160(prevOwnershipPacked));
(uint256 approvedAddressSlot, address approvedAddress) = _getApprovedSlotAndAddress(tokenId);
if (approvalCheck) {
if (!_isSenderApprovedOrOwner(approvedAddress, from, _msgSenderERC721A()))
if (!isApprovedForAll(from, _msgSenderERC721A())) revert TransferCallerNotOwnerNorApproved();
}
_beforeTokenTransfers(from, address(0), tokenId, 1);
assembly {
if approvedAddress {
sstore(approvedAddressSlot, 0)
}
}
unchecked {
_packedAddressData[from] += (1 << _BITPOS_NUMBER_BURNED) - 1;
_packedOwnerships[tokenId] = _packOwnershipData(
from,
(_BITMASK_BURNED | _BITMASK_NEXT_INITIALIZED) | _nextExtraData(from, address(0), prevOwnershipPacked)
);
if (prevOwnershipPacked & _BITMASK_NEXT_INITIALIZED == 0) {
uint256 nextTokenId = tokenId + 1;
if (_packedOwnerships[nextTokenId] == 0) {
if (nextTokenId != _currentIndex) {
_packedOwnerships[nextTokenId] = prevOwnershipPacked;
}
}
}
}
emit Transfer(from, address(0), tokenId);
_afterTokenTransfers(from, address(0), tokenId, 1);
unchecked {
_burnCounter++;
}
}
function _setExtraDataAt(uint256 index, uint24 extraData) internal virtual {
uint256 packed = _packedOwnerships[index];
if (packed == 0) revert OwnershipNotInitializedForExtraData();
uint256 extraDataCasted;
assembly {
extraDataCasted := extraData
}
packed = (packed & _BITMASK_EXTRA_DATA_COMPLEMENT) | (extraDataCasted << _BITPOS_EXTRA_DATA);
_packedOwnerships[index] = packed;
}
function _extraData(
address from,
address to,
uint24 previousExtraData
) internal view virtual returns (uint24) {}
function _nextExtraData(
address from,
address to,
uint256 prevOwnershipPacked
) private view returns (uint256) {
uint24 extraData = uint24(prevOwnershipPacked >> _BITPOS_EXTRA_DATA);
return uint256(_extraData(from, to, extraData)) << _BITPOS_EXTRA_DATA;
}
function _msgSenderERC721A() internal view virtual returns (address) {
return msg.sender;
}
function _toString(uint256 value) internal pure virtual returns (string memory str) {
assembly {
let m := add(mload(0x40), 0xa0)
mstore(0x40, m)
str := sub(m, 0x20)
mstore(str, 0)
let end := str
for { let temp := value } 1 {} {
str := sub(str, 1)
mstore8(str, add(48, mod(temp, 10)))
temp := div(temp, 10)
if iszero(temp) { break }
}
let length := sub(end, str)
str := sub(str, 0x20)
mstore(str, length)
}
}
}
文件 8 的 38:ERC721AQueryable.sol
pragma solidity ^0.8.4;
import './IERC721AQueryable.sol';
import '../ERC721A.sol';
abstract contract ERC721AQueryable is ERC721A, IERC721AQueryable {
function explicitOwnershipOf(uint256 tokenId) public view virtual override returns (TokenOwnership memory) {
TokenOwnership memory ownership;
if (tokenId < _startTokenId() || tokenId >= _nextTokenId()) {
return ownership;
}
ownership = _ownershipAt(tokenId);
if (ownership.burned) {
return ownership;
}
return _ownershipOf(tokenId);
}
function explicitOwnershipsOf(uint256[] calldata tokenIds)
external
view
virtual
override
returns (TokenOwnership[] memory)
{
unchecked {
uint256 tokenIdsLength = tokenIds.length;
TokenOwnership[] memory ownerships = new TokenOwnership[](tokenIdsLength);
for (uint256 i; i != tokenIdsLength; ++i) {
ownerships[i] = explicitOwnershipOf(tokenIds[i]);
}
return ownerships;
}
}
function tokensOfOwnerIn(
address owner,
uint256 start,
uint256 stop
) external view virtual override returns (uint256[] memory) {
unchecked {
if (start >= stop) revert InvalidQueryRange();
uint256 tokenIdsIdx;
uint256 stopLimit = _nextTokenId();
if (start < _startTokenId()) {
start = _startTokenId();
}
if (stop > stopLimit) {
stop = stopLimit;
}
uint256 tokenIdsMaxLength = balanceOf(owner);
if (start < stop) {
uint256 rangeLength = stop - start;
if (rangeLength < tokenIdsMaxLength) {
tokenIdsMaxLength = rangeLength;
}
} else {
tokenIdsMaxLength = 0;
}
uint256[] memory tokenIds = new uint256[](tokenIdsMaxLength);
if (tokenIdsMaxLength == 0) {
return tokenIds;
}
TokenOwnership memory ownership = explicitOwnershipOf(start);
address currOwnershipAddr;
if (!ownership.burned) {
currOwnershipAddr = ownership.addr;
}
for (uint256 i = start; i != stop && tokenIdsIdx != tokenIdsMaxLength; ++i) {
ownership = _ownershipAt(i);
if (ownership.burned) {
continue;
}
if (ownership.addr != address(0)) {
currOwnershipAddr = ownership.addr;
}
if (currOwnershipAddr == owner) {
tokenIds[tokenIdsIdx++] = i;
}
}
assembly {
mstore(tokenIds, tokenIdsIdx)
}
return tokenIds;
}
}
function tokensOfOwner(address owner) external view virtual override returns (uint256[] memory) {
unchecked {
uint256 tokenIdsIdx;
address currOwnershipAddr;
uint256 tokenIdsLength = balanceOf(owner);
uint256[] memory tokenIds = new uint256[](tokenIdsLength);
TokenOwnership memory ownership;
for (uint256 i = _startTokenId(); tokenIdsIdx != tokenIdsLength; ++i) {
ownership = _ownershipAt(i);
if (ownership.burned) {
continue;
}
if (ownership.addr != address(0)) {
currOwnershipAddr = ownership.addr;
}
if (currOwnershipAddr == owner) {
tokenIds[tokenIdsIdx++] = i;
}
}
return tokenIds;
}
}
}
文件 9 的 38:ERC721AntiScam.sol
pragma solidity >=0.8.0;
import "./IERC721AntiScam.sol";
import "./lockable/ERC721Lockable.sol";
import "./restrictApprove/ERC721RestrictApprove.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
abstract contract ERC721AntiScam is IERC721AntiScam, ERC721Lockable, ERC721RestrictApprove, Ownable {
function isApprovedForAll(
address owner,
address operator
) public view virtual override(ERC721Lockable, ERC721RestrictApprove) returns (bool) {
if (isLocked(owner) || !_isAllowed(owner, operator)) {
return false;
}
return super.isApprovedForAll(owner, operator);
}
function setApprovalForAll(
address operator,
bool approved
) public virtual override(ERC721Lockable, ERC721RestrictApprove) {
require(isLocked(msg.sender) == false || approved == false, "Can not approve locked token");
require(_isAllowed(operator) || approved == false, "RestrictApprove: Can not approve locked token");
super.setApprovalForAll(operator, approved);
}
function _beforeApprove(
address to,
uint256 tokenId
) internal virtual override(ERC721Lockable, ERC721RestrictApprove) {
ERC721Lockable._beforeApprove(to, tokenId);
ERC721RestrictApprove._beforeApprove(to, tokenId);
}
function approve(address to, uint256 tokenId) public payable virtual override(ERC721Lockable, ERC721RestrictApprove) {
_beforeApprove(to, tokenId);
ERC721A.approve(to, tokenId);
}
function _beforeTokenTransfers(
address from,
address to,
uint256 startTokenId,
uint256 quantity
) internal virtual override(ERC721A, ERC721Lockable) {
ERC721Lockable._beforeTokenTransfers(from, to, startTokenId, quantity);
}
function _afterTokenTransfers(
address from,
address to,
uint256 startTokenId,
uint256 quantity
) internal virtual override(ERC721Lockable, ERC721RestrictApprove) {
ERC721Lockable._afterTokenTransfers(from, to, startTokenId, quantity);
ERC721RestrictApprove._afterTokenTransfers(from, to, startTokenId, quantity);
}
function supportsInterface(
bytes4 interfaceId
) public view virtual override(ERC721Lockable, ERC721RestrictApprove) returns (bool) {
return
ERC721A.supportsInterface(interfaceId) ||
ERC721Lockable.supportsInterface(interfaceId) ||
ERC721RestrictApprove.supportsInterface(interfaceId) ||
interfaceId == type(IERC721AntiScam).interfaceId;
}
}
文件 10 的 38:ERC721Lockable.sol
pragma solidity >=0.8.0;
import "erc721a/contracts/extensions/ERC721AQueryable.sol";
import "./IERC721Lockable.sol";
abstract contract ERC721Lockable is ERC721AQueryable, IERC721Lockable {
bool public enableLock = false;
LockStatus public contractLockStatus = LockStatus.UnLock;
mapping(uint256 => LockStatus) public tokenLock;
mapping(address => LockStatus) public walletLock;
modifier existToken(uint256 tokenId) {
require(_exists(tokenId), "Lockable: locking query for nonexistent token");
_;
}
function isLocked(uint256 tokenId) public view virtual existToken(tokenId) returns (bool) {
if (!enableLock) {
return false;
}
if (
tokenLock[tokenId] == LockStatus.Lock || (tokenLock[tokenId] == LockStatus.UnSet && isLocked(ownerOf(tokenId)))
) {
return true;
}
return false;
}
function isLocked(address holder) public view virtual returns (bool) {
if (!enableLock) {
return false;
}
if (
walletLock[holder] == LockStatus.Lock ||
(walletLock[holder] == LockStatus.UnSet && contractLockStatus == LockStatus.Lock)
) {
return true;
}
return false;
}
function getTokensUnderLock() public view virtual returns (uint256[] memory) {
uint256 start = _startTokenId();
uint256 end = _nextTokenId();
return getTokensUnderLock(start, end);
}
function getTokensUnderLock(uint256 start, uint256 end) public view virtual returns (uint256[] memory) {
bool[] memory lockList = new bool[](end - start + 1);
uint256 i = 0;
uint256 lockCount = 0;
for (uint256 tokenId = start; tokenId <= end; tokenId++) {
if (_exists(tokenId) && isLocked(tokenId)) {
lockList[i] = true;
lockCount++;
} else {
lockList[i] = false;
}
i++;
}
uint256[] memory tokensUnderLock = new uint256[](lockCount);
i = 0;
uint256 j = 0;
for (uint256 tokenId = start; tokenId <= end; tokenId++) {
if (lockList[i]) {
tokensUnderLock[j] = tokenId;
j++;
}
i++;
}
return tokensUnderLock;
}
function _deleteTokenLock(uint256 tokenId) internal virtual {
delete tokenLock[tokenId];
}
function _setTokenLock(uint256[] calldata tokenIds, LockStatus lockStatus) internal virtual {
for (uint256 i = 0; i < tokenIds.length; i++) {
tokenLock[tokenIds[i]] = lockStatus;
emit TokenLock(ownerOf(tokenIds[i]), tokenIds[i], lockStatus, block.timestamp);
}
}
function _setWalletLock(address to, LockStatus lockStatus) internal virtual {
walletLock[to] = lockStatus;
emit WalletLock(to, msg.sender, lockStatus);
}
function _setContractLock(LockStatus lockStatus) internal virtual {
contractLockStatus = lockStatus;
}
function isApprovedForAll(
address owner,
address operator
) public view virtual override(ERC721A, IERC721A) returns (bool) {
if (isLocked(owner)) {
return false;
}
return super.isApprovedForAll(owner, operator);
}
function setApprovalForAll(address operator, bool approved) public virtual override(ERC721A, IERC721A) {
require(isLocked(msg.sender) == false || approved == false, "Can not approve locked token");
super.setApprovalForAll(operator, approved);
}
function _beforeApprove(address , uint256 tokenId) internal virtual {
require(isLocked(tokenId) == false, "Lockable: Can not approve locked token");
}
function approve(address to, uint256 tokenId) public payable virtual override(ERC721A, IERC721A) {
_beforeApprove(to, tokenId);
super.approve(to, tokenId);
}
function _beforeTokenTransfers(
address from,
address to,
uint256 startTokenId,
uint256
) internal virtual override {
if (from != address(0) && to != address(0)) {
require(isLocked(startTokenId) == false, "Lockable: Can not transfer locked token");
}
}
function _afterTokenTransfers(
address from,
address ,
uint256 startTokenId,
uint256
) internal virtual override {
if (from != address(0)) {
_deleteTokenLock(startTokenId);
}
}
function supportsInterface(bytes4 interfaceId) public view virtual override(ERC721A, IERC721A) returns (bool) {
return interfaceId == type(IERC721Lockable).interfaceId || super.supportsInterface(interfaceId);
}
}
文件 11 的 38:ERC721RestrictApprove.sol
pragma solidity >=0.8.0;
import "@openzeppelin/contracts/utils/structs/EnumerableSet.sol";
import "erc721a/contracts/extensions/ERC721AQueryable.sol";
import "contract-allow-list/contracts/proxy/interface/IContractAllowListProxy.sol";
import "./IERC721RestrictApprove.sol";
abstract contract ERC721RestrictApprove is ERC721AQueryable, IERC721RestrictApprove {
using EnumerableSet for EnumerableSet.AddressSet;
IContractAllowListProxy public CAL;
EnumerableSet.AddressSet localAllowedAddresses;
modifier onlyHolder(uint256 tokenId) {
require(msg.sender == ownerOf(tokenId), "RestrictApprove: operation is only holder.");
_;
}
bool public enableRestrict = true;
mapping(uint256 => uint256) public tokenCALLevel;
mapping(address => uint256) public walletCALLevel;
uint256 public CALLevel = 1;
function _addLocalContractAllowList(address transferer) internal virtual {
localAllowedAddresses.add(transferer);
emit LocalCalAdded(msg.sender, transferer);
}
function _removeLocalContractAllowList(address transferer) internal virtual {
localAllowedAddresses.remove(transferer);
emit LocalCalRemoved(msg.sender, transferer);
}
function _getLocalContractAllowList() internal view virtual returns (address[] memory) {
return localAllowedAddresses.values();
}
function _isLocalAllowed(address transferer) internal view virtual returns (bool) {
return localAllowedAddresses.contains(transferer);
}
function _isAllowed(address transferer) internal view virtual returns (bool) {
return _isAllowed(msg.sender, transferer);
}
function _isAllowed(uint256 tokenId, address transferer) internal view virtual returns (bool) {
uint256 level = _getCALLevel(msg.sender, tokenId);
return _isAllowed(transferer, level);
}
function _isAllowed(address holder, address transferer) internal view virtual returns (bool) {
uint256 level = _getCALLevel(holder);
return _isAllowed(transferer, level);
}
function _isAllowed(address transferer, uint256 level) internal view virtual returns (bool) {
if (!enableRestrict) {
return true;
}
return _isLocalAllowed(transferer) || CAL.isAllowed(transferer, level);
}
function _getCALLevel(address holder, uint256 tokenId) internal view virtual returns (uint256) {
if (tokenCALLevel[tokenId] > 0) {
return tokenCALLevel[tokenId];
}
return _getCALLevel(holder);
}
function _getCALLevel(address holder) internal view virtual returns (uint256) {
if (walletCALLevel[holder] > 0) {
return walletCALLevel[holder];
}
return CALLevel;
}
function _setCAL(address _cal) internal virtual {
CAL = IContractAllowListProxy(_cal);
}
function _deleteTokenCALLevel(uint256 tokenId) internal virtual {
delete tokenCALLevel[tokenId];
}
function setTokenCALLevel(uint256 tokenId, uint256 level) external virtual onlyHolder(tokenId) {
tokenCALLevel[tokenId] = level;
}
function setWalletCALLevel(uint256 level) external virtual {
walletCALLevel[msg.sender] = level;
}
function isApprovedForAll(
address owner,
address operator
) public view virtual override(ERC721A, IERC721A) returns (bool) {
if (_isAllowed(owner, operator) == false) {
return false;
}
return super.isApprovedForAll(owner, operator);
}
function setApprovalForAll(address operator, bool approved) public virtual override(ERC721A, IERC721A) {
require(_isAllowed(operator) || approved == false, "RestrictApprove: Can not approve locked token");
super.setApprovalForAll(operator, approved);
}
function _beforeApprove(address to, uint256 tokenId) internal virtual {
if (to != address(0)) {
require(_isAllowed(tokenId, to), "RestrictApprove: The contract is not allowed.");
}
}
function approve(address to, uint256 tokenId) public payable virtual override(ERC721A, IERC721A) {
_beforeApprove(to, tokenId);
super.approve(to, tokenId);
}
function _afterTokenTransfers(
address from,
address ,
uint256 startTokenId,
uint256
) internal virtual override {
if (from != address(0)) {
_deleteTokenCALLevel(startTokenId);
}
}
function supportsInterface(bytes4 interfaceId) public view virtual override(ERC721A, IERC721A) returns (bool) {
return interfaceId == type(IERC721RestrictApprove).interfaceId || super.supportsInterface(interfaceId);
}
}
文件 12 的 38:EnumerableSet.sol
pragma solidity ^0.8.0;
library EnumerableSet {
struct Set {
bytes32[] _values;
mapping(bytes32 => uint256) _indexes;
}
function _add(Set storage set, bytes32 value) private returns (bool) {
if (!_contains(set, value)) {
set._values.push(value);
set._indexes[value] = set._values.length;
return true;
} else {
return false;
}
}
function _remove(Set storage set, bytes32 value) private returns (bool) {
uint256 valueIndex = set._indexes[value];
if (valueIndex != 0) {
uint256 toDeleteIndex = valueIndex - 1;
uint256 lastIndex = set._values.length - 1;
if (lastIndex != toDeleteIndex) {
bytes32 lastValue = set._values[lastIndex];
set._values[toDeleteIndex] = lastValue;
set._indexes[lastValue] = valueIndex;
}
set._values.pop();
delete set._indexes[value];
return true;
} else {
return false;
}
}
function _contains(Set storage set, bytes32 value) private view returns (bool) {
return set._indexes[value] != 0;
}
function _length(Set storage set) private view returns (uint256) {
return set._values.length;
}
function _at(Set storage set, uint256 index) private view returns (bytes32) {
return set._values[index];
}
function _values(Set storage set) private view returns (bytes32[] memory) {
return set._values;
}
struct Bytes32Set {
Set _inner;
}
function add(Bytes32Set storage set, bytes32 value) internal returns (bool) {
return _add(set._inner, value);
}
function remove(Bytes32Set storage set, bytes32 value) internal returns (bool) {
return _remove(set._inner, value);
}
function contains(Bytes32Set storage set, bytes32 value) internal view returns (bool) {
return _contains(set._inner, value);
}
function length(Bytes32Set storage set) internal view returns (uint256) {
return _length(set._inner);
}
function at(Bytes32Set storage set, uint256 index) internal view returns (bytes32) {
return _at(set._inner, index);
}
function values(Bytes32Set storage set) internal view returns (bytes32[] memory) {
bytes32[] memory store = _values(set._inner);
bytes32[] memory result;
assembly {
result := store
}
return result;
}
struct AddressSet {
Set _inner;
}
function add(AddressSet storage set, address value) internal returns (bool) {
return _add(set._inner, bytes32(uint256(uint160(value))));
}
function remove(AddressSet storage set, address value) internal returns (bool) {
return _remove(set._inner, bytes32(uint256(uint160(value))));
}
function contains(AddressSet storage set, address value) internal view returns (bool) {
return _contains(set._inner, bytes32(uint256(uint160(value))));
}
function length(AddressSet storage set) internal view returns (uint256) {
return _length(set._inner);
}
function at(AddressSet storage set, uint256 index) internal view returns (address) {
return address(uint160(uint256(_at(set._inner, index))));
}
function values(AddressSet storage set) internal view returns (address[] memory) {
bytes32[] memory store = _values(set._inner);
address[] memory result;
assembly {
result := store
}
return result;
}
struct UintSet {
Set _inner;
}
function add(UintSet storage set, uint256 value) internal returns (bool) {
return _add(set._inner, bytes32(value));
}
function remove(UintSet storage set, uint256 value) internal returns (bool) {
return _remove(set._inner, bytes32(value));
}
function contains(UintSet storage set, uint256 value) internal view returns (bool) {
return _contains(set._inner, bytes32(value));
}
function length(UintSet storage set) internal view returns (uint256) {
return _length(set._inner);
}
function at(UintSet storage set, uint256 index) internal view returns (uint256) {
return uint256(_at(set._inner, index));
}
function values(UintSet storage set) internal view returns (uint256[] memory) {
bytes32[] memory store = _values(set._inner);
uint256[] memory result;
assembly {
result := store
}
return result;
}
}
文件 13 的 38:IAccessControl.sol
pragma solidity ^0.8.0;
interface IAccessControl {
event RoleAdminChanged(bytes32 indexed role, bytes32 indexed previousAdminRole, bytes32 indexed newAdminRole);
event RoleGranted(bytes32 indexed role, address indexed account, address indexed sender);
event RoleRevoked(bytes32 indexed role, address indexed account, address indexed sender);
function hasRole(bytes32 role, address account) external view returns (bool);
function getRoleAdmin(bytes32 role) external view returns (bytes32);
function grantRole(bytes32 role, address account) external;
function revokeRole(bytes32 role, address account) external;
function renounceRole(bytes32 role, address account) external;
}
文件 14 的 38:IContractAllowListProxy.sol
pragma solidity >=0.7.0 <0.9.0;
interface IContractAllowListProxy {
function isAllowed(address _transferer, uint256 _level)
external
view
returns (bool);
}
文件 15 的 38:IERC165.sol
pragma solidity ^0.8.0;
interface IERC165 {
function supportsInterface(bytes4 interfaceId) external view returns (bool);
}
文件 16 的 38:IERC2981.sol
pragma solidity ^0.8.0;
import "../utils/introspection/IERC165.sol";
interface IERC2981 is IERC165 {
function royaltyInfo(uint256 tokenId, uint256 salePrice)
external
view
returns (address receiver, uint256 royaltyAmount);
}
文件 17 的 38:IERC4906.sol
pragma solidity >=0.7.0 <0.9.0;
import { IERC721A } from "erc721a/contracts/interfaces/IERC721A.sol";
interface IERC4906 is IERC721A {
event MetadataUpdate(uint256 _tokenId);
event BatchMetadataUpdate(uint256 _fromTokenId, uint256 _toTokenId);
}
文件 18 的 38:IERC5192.sol
pragma solidity >=0.7.0 <0.9.0;
interface IERC5192 {
event Locked(uint256 tokenId);
event Unlocked(uint256 tokenId);
function locked(uint256 tokenId) external view returns (bool);
}
文件 19 的 38:IERC5192PL.sol
pragma solidity >=0.7.0 <0.9.0;
import { IERC5192 } from "./IERC5192.sol";
interface IERC5192PL is IERC5192 {
error ErrLocked();
error ErrTokenLocked();
error ErrNotFound();
error ErrNullAddress();
error ErrNotAllowtedAddress();
error ErrNotSaleActive();
function setIsTokenUnLocked(uint256 _tokenId, bool _value) external;
function setParentContractAddress(address _parentContractAddress) external;
}
文件 20 的 38:IERC5192PLConnector.sol
pragma solidity >=0.7.0 <0.9.0;
interface IERC5192PLConnector {
function isParentLinkSbtExists(
address _parentLinkSbtContract,
uint256 _parentLinkSbtTokenId
) external view returns (bool);
function getParentLinkSbtTokenOwnerId(
address _parentLinkSbtContract,
uint256 _parentLinkSbtTokenId
) external view returns (uint256);
function getParentLinkSbtTokenIndex(
uint256 _parentTokenId,
address _parentLinkSbtContract,
uint256 _parentLinkSbtTokenId
) external view returns (uint256);
function getTotalParentLinkSbtContracts(uint256 _tokenId) external view returns (uint256);
function getTotalParentLinkSbtTokens(
uint256 _tokenId,
address _parentLinkSbtContract
) external view returns (uint256);
function getParentLinkSbtContractByIndex(
uint256 _tokenId,
uint256 _index
) external view returns (address parentLinkSbtContract);
function getParentLinkSbtTokenByIndex(
uint256 _tokenId,
address _parentLinkSbtContract,
uint256 _index
) external view returns (uint256 parentLinkSbtTokenId);
}
文件 21 的 38:IERC5192PLTop.sol
pragma solidity >=0.7.0 <0.9.0;
interface IERC5192PLTop {
function ownerOfParentLinkSbt(
address _parentLinkSbtContract,
uint256 _parentLinkSbtTokenId
) external view returns (address parentTokenOwner);
}
文件 22 的 38:IERC721.sol
pragma solidity ^0.8.0;
import "../../utils/introspection/IERC165.sol";
interface IERC721 is IERC165 {
event Transfer(address indexed from, address indexed to, uint256 indexed tokenId);
event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId);
event ApprovalForAll(address indexed owner, address indexed operator, bool approved);
function balanceOf(address owner) external view returns (uint256 balance);
function ownerOf(uint256 tokenId) external view returns (address owner);
function safeTransferFrom(
address from,
address to,
uint256 tokenId,
bytes calldata data
) external;
function safeTransferFrom(
address from,
address to,
uint256 tokenId
) external;
function transferFrom(
address from,
address to,
uint256 tokenId
) external;
function approve(address to, uint256 tokenId) external;
function setApprovalForAll(address operator, bool _approved) external;
function getApproved(uint256 tokenId) external view returns (address operator);
function isApprovedForAll(address owner, address operator) external view returns (bool);
}
文件 23 的 38:IERC721A.sol
pragma solidity ^0.8.4;
import '../IERC721A.sol';
文件 24 的 38:IERC721AQueryable.sol
pragma solidity ^0.8.4;
import '../IERC721A.sol';
interface IERC721AQueryable is IERC721A {
error InvalidQueryRange();
function explicitOwnershipOf(uint256 tokenId) external view returns (TokenOwnership memory);
function explicitOwnershipsOf(uint256[] memory tokenIds) external view returns (TokenOwnership[] memory);
function tokensOfOwnerIn(
address owner,
uint256 start,
uint256 stop
) external view returns (uint256[] memory);
function tokensOfOwner(address owner) external view returns (uint256[] memory);
}
文件 25 的 38:IERC721AntiScam.sol
pragma solidity >=0.8.0;
import "./lockable/IERC721Lockable.sol";
import "./restrictApprove/IERC721RestrictApprove.sol";
interface IERC721AntiScam is IERC721Lockable, IERC721RestrictApprove {
}
文件 26 的 38:IERC721Lockable.sol
pragma solidity >=0.8.0;
interface IERC721Lockable {
enum LockStatus {
UnSet,
UnLock,
Lock
}
event TokenLock(address indexed holder, uint256 indexed tokenId, LockStatus indexed lockStatus, uint256 timestamp);
event WalletLock(address indexed holder, address indexed operator, LockStatus lockStatus);
function setTokenLock(uint256[] calldata tokenIds, LockStatus lockStatus) external;
function setWalletLock(address to, LockStatus lockStatus) external;
function setContractLock(LockStatus lockStatus) external;
function isLocked(uint256 tokenId) external view returns (bool);
function isLocked(address holder) external view returns (bool);
function getTokensUnderLock() external view returns (uint256[] memory);
function getTokensUnderLock(uint256 start, uint256 end) external view returns (uint256[] memory);
}
文件 27 的 38:IERC721RestrictApprove.sol
pragma solidity >=0.8.0;
interface IERC721RestrictApprove {
event CalLevelChanged(address indexed operator, uint256 indexed level);
event LocalCalAdded(address indexed operator, address indexed transferer);
event LocalCalRemoved(address indexed operator, address indexed transferer);
function setCALLevel(uint256 level) external;
function setCAL(address calAddress) external;
function addLocalContractAllowList(address transferer) external;
function removeLocalContractAllowList(address transferer) external;
function getLocalContractAllowList() external view returns (address[] memory);
}
文件 28 的 38:IOperatorFilterRegistry.sol
pragma solidity ^0.8.13;
interface IOperatorFilterRegistry {
function isOperatorAllowed(address registrant, address operator) external view returns (bool);
function register(address registrant) external;
function registerAndSubscribe(address registrant, address subscription) external;
function registerAndCopyEntries(address registrant, address registrantToCopy) external;
function unregister(address addr) external;
function updateOperator(address registrant, address operator, bool filtered) external;
function updateOperators(address registrant, address[] calldata operators, bool filtered) external;
function updateCodeHash(address registrant, bytes32 codehash, bool filtered) external;
function updateCodeHashes(address registrant, bytes32[] calldata codeHashes, bool filtered) external;
function subscribe(address registrant, address registrantToSubscribe) external;
function unsubscribe(address registrant, bool copyExistingEntries) external;
function subscriptionOf(address addr) external returns (address registrant);
function subscribers(address registrant) external returns (address[] memory);
function subscriberAt(address registrant, uint256 index) external returns (address);
function copyEntriesOf(address registrant, address registrantToCopy) external;
function isOperatorFiltered(address registrant, address operator) external returns (bool);
function isCodeHashOfFiltered(address registrant, address operatorWithCode) external returns (bool);
function isCodeHashFiltered(address registrant, bytes32 codeHash) external returns (bool);
function filteredOperators(address addr) external returns (address[] memory);
function filteredCodeHashes(address addr) external returns (bytes32[] memory);
function filteredOperatorAt(address registrant, uint256 index) external returns (address);
function filteredCodeHashAt(address registrant, uint256 index) external returns (bytes32);
function isRegistered(address addr) external returns (bool);
function codeHashOf(address addr) external returns (bytes32);
}
文件 29 的 38:IParentLinkSbt.sol
pragma solidity >=0.7.0 <0.9.0;
import { IERC5192PL } from "./IERC5192PL.sol";
interface IParentLinkSbt is IERC5192PL {
function exists(uint256 tokenId) external view returns (bool);
}
文件 30 的 38:IZuttoMamo.sol
pragma solidity >=0.7.0 <0.9.0;
import { IERC721A } from "erc721a/contracts/interfaces/IERC721A.sol";
import { IERC5192PLTop } from "./IERC5192PLTop.sol";
import { IERC721Lockable } from "../base/ERC721AntiScam/lockable/IERC721Lockable.sol";
import { DataType } from "../lib/type/DataType.sol";
interface IZuttoMamo is IERC721A, IERC721Lockable, IERC5192PLTop {
function getTokenLocation(uint256 _tokenId) external view returns (DataType.TokenLocation);
function refreshMetadata(uint256 _tokenId) external;
function refreshMetadata(uint256 _fromTokenId, uint256 _toTokenId) external;
function birth(address _to, uint256 _amount) external;
function birthWithSleeping(address _to, uint256 _amount) external;
}
文件 31 的 38:IZuttoMamoStage.sol
pragma solidity >=0.7.0 <0.9.0;
import { DataType } from "../lib/type/DataType.sol";
interface IZuttoMamoStage {
function tokenURI(uint256 tokenId) external view returns (string memory);
function isHighSchooler(uint256 _tokenId) external view returns (bool);
function isWorkingAdult(uint256 _tokenId) external view returns (bool);
function isElapsedTimeWorkingAdult(uint256 _tokenId) external view returns (bool);
function isMarriage(uint256 _tokenId) external view returns (bool);
function isElapsedTimeMarriage(uint256 _tokenId) external view returns (bool);
function isFamily(uint256 _tokenId) external view returns (bool);
function isOldAge(uint256 _tokenId) external view returns (bool);
function isTomb(uint256 _tokenId) external view returns (bool);
function setHighSchoolerLock(uint256 _tokenId) external;
function setFamilyLock(uint256 _tokenId) external;
function setOldAgeLock(uint256 _tokenId) external;
function setTombLock(uint256 _tokenId) external;
function getTimeGrowingUpToHighSchooler() external view returns (uint256);
function getTimeGrowingUpToFamily() external view returns (uint256);
function getTimeGrowingUpToOldAge() external view returns (uint256);
function getTimeGrowingUpToTomb() external view returns (uint256);
}
文件 32 的 38:Math.sol
pragma solidity ^0.8.0;
library Math {
enum Rounding {
Down,
Up,
Zero
}
function max(uint256 a, uint256 b) internal pure returns (uint256) {
return a > b ? a : b;
}
function min(uint256 a, uint256 b) internal pure returns (uint256) {
return a < b ? a : b;
}
function average(uint256 a, uint256 b) internal pure returns (uint256) {
return (a & b) + (a ^ b) / 2;
}
function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) {
return a == 0 ? 0 : (a - 1) / b + 1;
}
function mulDiv(
uint256 x,
uint256 y,
uint256 denominator
) internal pure returns (uint256 result) {
unchecked {
uint256 prod0;
uint256 prod1;
assembly {
let mm := mulmod(x, y, not(0))
prod0 := mul(x, y)
prod1 := sub(sub(mm, prod0), lt(mm, prod0))
}
if (prod1 == 0) {
return prod0 / denominator;
}
require(denominator > prod1);
uint256 remainder;
assembly {
remainder := mulmod(x, y, denominator)
prod1 := sub(prod1, gt(remainder, prod0))
prod0 := sub(prod0, remainder)
}
uint256 twos = denominator & (~denominator + 1);
assembly {
denominator := div(denominator, twos)
prod0 := div(prod0, twos)
twos := add(div(sub(0, twos), twos), 1)
}
prod0 |= prod1 * twos;
uint256 inverse = (3 * denominator) ^ 2;
inverse *= 2 - denominator * inverse;
inverse *= 2 - denominator * inverse;
inverse *= 2 - denominator * inverse;
inverse *= 2 - denominator * inverse;
inverse *= 2 - denominator * inverse;
inverse *= 2 - denominator * inverse;
result = prod0 * inverse;
return result;
}
}
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;
}
function sqrt(uint256 a) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 result = 1 << (log2(a) >> 1);
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);
}
}
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);
}
}
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;
}
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);
}
}
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;
}
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);
}
}
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;
}
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);
}
}
}
文件 33 的 38:Ownable.sol
pragma solidity ^0.8.0;
import "../utils/Context.sol";
abstract contract Ownable is Context {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor() {
_transferOwnership(_msgSender());
}
modifier onlyOwner() {
_checkOwner();
_;
}
function owner() public view virtual returns (address) {
return _owner;
}
function _checkOwner() internal view virtual {
require(owner() == _msgSender(), "Ownable: caller is not the owner");
}
function renounceOwnership() public virtual onlyOwner {
_transferOwnership(address(0));
}
function transferOwnership(address newOwner) public virtual onlyOwner {
require(newOwner != address(0), "Ownable: new owner is the zero address");
_transferOwnership(newOwner);
}
function _transferOwnership(address newOwner) internal virtual {
address oldOwner = _owner;
_owner = newOwner;
emit OwnershipTransferred(oldOwner, newOwner);
}
}
文件 34 的 38:RevokableDefaultOperatorFilterer.sol
pragma solidity ^0.8.13;
import {RevokableOperatorFilterer} from "./RevokableOperatorFilterer.sol";
import {CANONICAL_CORI_SUBSCRIPTION, CANONICAL_OPERATOR_FILTER_REGISTRY_ADDRESS} from "./lib/Constants.sol";
abstract contract RevokableDefaultOperatorFilterer is RevokableOperatorFilterer {
constructor()
RevokableOperatorFilterer(CANONICAL_OPERATOR_FILTER_REGISTRY_ADDRESS, CANONICAL_CORI_SUBSCRIPTION, true)
{}
}
文件 35 的 38:RevokableOperatorFilterer.sol
pragma solidity ^0.8.13;
import {UpdatableOperatorFilterer} from "./UpdatableOperatorFilterer.sol";
import {IOperatorFilterRegistry} from "./IOperatorFilterRegistry.sol";
abstract contract RevokableOperatorFilterer is UpdatableOperatorFilterer {
error RegistryHasBeenRevoked();
error InitialRegistryAddressCannotBeZeroAddress();
event OperatorFilterRegistryRevoked();
bool public isOperatorFilterRegistryRevoked;
constructor(address _registry, address subscriptionOrRegistrantToCopy, bool subscribe)
UpdatableOperatorFilterer(_registry, subscriptionOrRegistrantToCopy, subscribe)
{
if (_registry == address(0)) {
revert InitialRegistryAddressCannotBeZeroAddress();
}
}
function updateOperatorFilterRegistryAddress(address newRegistry) public override {
if (msg.sender != owner()) {
revert OnlyOwner();
}
if (isOperatorFilterRegistryRevoked) {
revert RegistryHasBeenRevoked();
}
operatorFilterRegistry = IOperatorFilterRegistry(newRegistry);
emit OperatorFilterRegistryAddressUpdated(newRegistry);
}
function revokeOperatorFilterRegistry() public {
if (msg.sender != owner()) {
revert OnlyOwner();
}
if (isOperatorFilterRegistryRevoked) {
revert RegistryHasBeenRevoked();
}
operatorFilterRegistry = IOperatorFilterRegistry(address(0));
isOperatorFilterRegistryRevoked = true;
emit OperatorFilterRegistryRevoked();
}
}
文件 36 的 38:Strings.sol
pragma solidity ^0.8.0;
import "./math/Math.sol";
library Strings {
bytes16 private constant _SYMBOLS = "0123456789abcdef";
uint8 private constant _ADDRESS_LENGTH = 20;
function toString(uint256 value) internal pure returns (string memory) {
unchecked {
uint256 length = Math.log10(value) + 1;
string memory buffer = new string(length);
uint256 ptr;
assembly {
ptr := add(buffer, add(32, length))
}
while (true) {
ptr--;
assembly {
mstore8(ptr, byte(mod(value, 10), _SYMBOLS))
}
value /= 10;
if (value == 0) break;
}
return buffer;
}
}
function toHexString(uint256 value) internal pure returns (string memory) {
unchecked {
return toHexString(value, Math.log256(value) + 1);
}
}
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);
}
function toHexString(address addr) internal pure returns (string memory) {
return toHexString(uint256(uint160(addr)), _ADDRESS_LENGTH);
}
}
文件 37 的 38:UpdatableOperatorFilterer.sol
pragma solidity ^0.8.13;
import {IOperatorFilterRegistry} from "./IOperatorFilterRegistry.sol";
abstract contract UpdatableOperatorFilterer {
error OperatorNotAllowed(address operator);
error OnlyOwner();
event OperatorFilterRegistryAddressUpdated(address newRegistry);
IOperatorFilterRegistry public operatorFilterRegistry;
constructor(address _registry, address subscriptionOrRegistrantToCopy, bool subscribe) {
IOperatorFilterRegistry registry = IOperatorFilterRegistry(_registry);
operatorFilterRegistry = registry;
if (address(registry).code.length > 0) {
if (subscribe) {
registry.registerAndSubscribe(address(this), subscriptionOrRegistrantToCopy);
} else {
if (subscriptionOrRegistrantToCopy != address(0)) {
registry.registerAndCopyEntries(address(this), subscriptionOrRegistrantToCopy);
} else {
registry.register(address(this));
}
}
}
}
modifier onlyAllowedOperator(address from) virtual {
if (from != msg.sender) {
_checkFilterOperator(msg.sender);
}
_;
}
modifier onlyAllowedOperatorApproval(address operator) virtual {
_checkFilterOperator(operator);
_;
}
function updateOperatorFilterRegistryAddress(address newRegistry) public virtual {
if (msg.sender != owner()) {
revert OnlyOwner();
}
operatorFilterRegistry = IOperatorFilterRegistry(newRegistry);
emit OperatorFilterRegistryAddressUpdated(newRegistry);
}
function owner() public view virtual returns (address);
function _checkFilterOperator(address operator) internal view virtual {
IOperatorFilterRegistry registry = operatorFilterRegistry;
if (address(registry) != address(0) && address(registry).code.length > 0) {
if (!registry.isOperatorAllowed(address(this), operator)) {
revert OperatorNotAllowed(operator);
}
}
}
}
文件 38 的 38:ZuttoMamo.sol
pragma solidity >=0.7.0 <0.9.0;
import { Ownable } from "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/access/AccessControl.sol";
import "@openzeppelin/contracts/token/common/ERC2981.sol";
import "operator-filter-registry/src/UpdatableOperatorFilterer.sol";
import "operator-filter-registry/src/RevokableDefaultOperatorFilterer.sol";
import "./base/ERC721AntiScam/ERC721AntiScam.sol";
import { DataType } from "./lib/type/DataType.sol";
import "./interface/IZuttoMamo.sol";
import "./interface/IZuttoMamoStage.sol";
import "./interface/IParentLinkSbt.sol";
import "./interface/IERC5192PLConnector.sol";
import "./interface/IERC4906.sol";
import "@openzeppelin/contracts/token/ERC721/IERC721.sol";
abstract contract ZuttoMamoConfig {
IZuttoMamoStage public zuttoMamoStage;
IERC5192PLConnector public connector;
bytes32 public constant ADMIN_ROLE = keccak256("ADMIN");
bytes32 public constant METADATA_ROLE = keccak256("METADATA");
bytes32 public constant MINTER_ROLE = keccak256("MINTER");
uint256 public maxSupply = 5210;
uint256 public unlockLeadTime = 3 hours;
uint96 public royaltyFee = 1000;
address public royaltyAddress = 0x853dac8E9115E30220857C8bDb4486e34Ba93fEa;
mapping(uint256 => uint256) internal unlockTokenTimestamp;
mapping(address => uint256) internal unlockWalletTimestamp;
mapping(uint256 => DataType.TokenLocation) internal tokenLocation;
}
abstract contract ZuttoMamoAdmin is
ZuttoMamoConfig,
Ownable,
AccessControl,
ERC721AntiScam,
ERC2981,
IZuttoMamo,
IERC4906
{
function supportsInterface(
bytes4 interfaceId
) public view virtual override(ERC721AntiScam, AccessControl, IERC721A, ERC2981) returns (bool) {
return
AccessControl.supportsInterface(interfaceId) ||
ERC721AntiScam.supportsInterface(interfaceId) ||
ERC2981.supportsInterface(interfaceId) ||
interfaceId == bytes4(0x49064906) ||
ERC165.supportsInterface(interfaceId) ||
super.supportsInterface(interfaceId);
}
function grantAdmin(address _account) external onlyOwner {
_grantRole(ADMIN_ROLE, _account);
}
function revokeAdmin(address _account) external onlyOwner {
_revokeRole(ADMIN_ROLE, _account);
}
function setZuttoMamoStage(IZuttoMamoStage _zuttoMamoStage) external onlyRole(ADMIN_ROLE) {
zuttoMamoStage = _zuttoMamoStage;
}
function setERC5192PLConnector(IERC5192PLConnector _address) external onlyRole(ADMIN_ROLE) {
connector = _address;
}
function setRoyaltyFee(uint96 _value) external onlyRole(ADMIN_ROLE) {
royaltyFee = _value;
_setDefaultRoyalty(royaltyAddress, royaltyFee);
}
function setRoyaltyAddress(address _royaltyAddress) external onlyRole(ADMIN_ROLE) {
royaltyAddress = _royaltyAddress;
_setDefaultRoyalty(royaltyAddress, royaltyFee);
}
function refreshMetadata(uint256 _tokenId) external onlyRole(METADATA_ROLE) {
emit MetadataUpdate(_tokenId);
}
function refreshMetadata(uint256 _fromTokenId, uint256 _toTokenId) external onlyRole(METADATA_ROLE) {
emit BatchMetadataUpdate(_fromTokenId, _toTokenId);
}
function setEnableRestrict(bool _value) external onlyOwner {
enableRestrict = _value;
}
function setCALLevel(uint256 _level) external override onlyRole(ADMIN_ROLE) {
CALLevel = _level;
}
function setCAL(address _calAddress) external onlyRole(ADMIN_ROLE) {
_setCAL(_calAddress);
}
function addLocalContractAllowList(address _transferer) external onlyRole(ADMIN_ROLE) {
_addLocalContractAllowList(_transferer);
}
function removeLocalContractAllowList(address _transferer) external onlyRole(ADMIN_ROLE) {
_removeLocalContractAllowList(_transferer);
}
function setEnableLock(bool _value) external onlyOwner {
enableLock = _value;
}
function setContractLock(LockStatus _lockStatus) external override onlyOwner {
_setContractLock(_lockStatus);
}
function setUnlockLeadTime(uint256 _value) external onlyRole(ADMIN_ROLE) {
unlockLeadTime = _value;
}
function setTokenLockByAdmin(uint256[] calldata _tokenIds, LockStatus _lockStatus) external onlyRole(ADMIN_ROLE) {
require(_tokenIds.length > 0, "tokenIds must be greater than 0");
_setTokenLock(_tokenIds, _lockStatus);
}
function airdropMint(
address[] calldata _to,
uint256[] calldata _quantity,
bool _withSleep
) external onlyRole(ADMIN_ROLE) {
require(_to.length == _quantity.length, "the address and quantity do not match");
for (uint256 i = 0; i < _quantity.length; i++) {
require(_quantity[i] != 0, "the quantity is zero");
if (_withSleep) {
_birthWithSleeping(_to[i], _quantity[i]);
} else {
_birth(_to[i], _quantity[i]);
}
}
}
function birth(address _to, uint256 _amount) external onlyRole(MINTER_ROLE) {
_birth(_to, _amount);
}
function birthWithSleeping(address _to, uint256 _amount) external onlyRole(MINTER_ROLE) {
_birthWithSleeping(_to, _amount);
}
function _birth(address _to, uint256 _amount) private {
for (uint256 i = 0; i < _amount; i++) {
uint256 tokenId = _nextTokenId() + i;
tokenLocation[tokenId] = DataType.TokenLocation.Other;
}
_mint(_to, _amount);
}
function _birthWithSleeping(address _to, uint256 _amount) private {
uint256 startTokenId = _nextTokenId();
_mint(_to, _amount);
for (uint256 i = 0; i < _amount; i++) {
uint256 tokenId = startTokenId + i;
tokenLocation[tokenId] = DataType.TokenLocation.Operator;
}
}
function setMaxSupply(uint256 _value) external onlyRole(ADMIN_ROLE) {
maxSupply = _value;
}
}
contract ZuttoMamo is ZuttoMamoAdmin, RevokableDefaultOperatorFilterer {
constructor() ERC721A("ZUTTO MAMORU", "ZM") {
_grantRole(DEFAULT_ADMIN_ROLE, msg.sender);
_setRoleAdmin(ADMIN_ROLE, ADMIN_ROLE);
_grantRole(ADMIN_ROLE, msg.sender);
_grantRole(METADATA_ROLE, msg.sender);
_setDefaultRoyalty(royaltyAddress, royaltyFee);
}
function getLocalContractAllowList() external view returns (address[] memory) {
return _getLocalContractAllowList();
}
function setTokenLock(uint256[] calldata _tokenIds, LockStatus _newLockStatus) external {
require(_tokenIds.length > 0, "tokenIds must be greater than 0");
for (uint256 i = 0; i < _tokenIds.length; i++) {
require(msg.sender == ownerOf(_tokenIds[i]), "not owner");
}
for (uint256 i = 0; i < _tokenIds.length; i++) {
if (_isTokenLockToUnlock(_tokenIds[i], _newLockStatus)) {
unlockTokenTimestamp[_tokenIds[i]] = block.timestamp;
}
}
_setTokenLock(_tokenIds, _newLockStatus);
for (uint256 i = 0; i < _tokenIds.length; i++) {
emit MetadataUpdate(_tokenIds[i]);
}
}
function setWalletLock(address _to, LockStatus _lockStatus) external {
require(msg.sender == _to, "only yourself");
if (walletLock[_to] == LockStatus.Lock && _lockStatus != LockStatus.Lock) {
unlockWalletTimestamp[_to] = block.timestamp;
}
_setWalletLock(_to, _lockStatus);
}
function _isTokenLockToUnlock(uint256 _tokenId, LockStatus _newLockStatus) private view returns (bool) {
if (_newLockStatus == LockStatus.UnLock) {
LockStatus currentWalletLock = walletLock[msg.sender];
bool isWalletLock_TokenLockOrUnset = (currentWalletLock == LockStatus.Lock &&
tokenLock[_tokenId] != LockStatus.UnLock);
bool isWalletUnlockOrUnset_TokenLock = (currentWalletLock != LockStatus.Lock &&
tokenLock[_tokenId] == LockStatus.Lock);
return isWalletLock_TokenLockOrUnset || isWalletUnlockOrUnset_TokenLock;
} else if (_newLockStatus == LockStatus.UnSet) {
LockStatus currentWalletLock = walletLock[msg.sender];
bool isNotWalletLock = currentWalletLock != LockStatus.Lock;
bool isTokenLock = tokenLock[_tokenId] == LockStatus.Lock;
return isNotWalletLock && isTokenLock;
} else {
return false;
}
}
function _isTokenTimeLock(uint256 _tokenId) private view returns (bool) {
return unlockTokenTimestamp[_tokenId] + unlockLeadTime > block.timestamp;
}
function _isWalletTimeLock(uint256 _tokenId) private view returns (bool) {
return unlockWalletTimestamp[ownerOf(_tokenId)] + unlockLeadTime > block.timestamp;
}
function isLocked(uint256 _tokenId) public view override(IERC721Lockable, ERC721Lockable) returns (bool) {
return ERC721Lockable.isLocked(_tokenId) || _isTokenTimeLock(_tokenId) || _isWalletTimeLock(_tokenId);
}
function _afterParentTokenTransfer(DataType.AfterParentTokenTransferParams memory _params) private {
for (uint256 i = 0; i < _params.totalAmountParentLinkSbtContracts; i++) {
address parentLinkSbtContract = connector.getParentLinkSbtContractByIndex(_params.tokenId, i);
uint256 parentLinkSbtTokenId = connector.getParentLinkSbtTokenByIndex(_params.tokenId, parentLinkSbtContract, 0);
require(_params.to == ownerOfParentLinkSbt(parentLinkSbtContract, parentLinkSbtTokenId), "not token owner");
IParentLinkSbt(parentLinkSbtContract).setIsTokenUnLocked(parentLinkSbtTokenId, true);
IERC721(parentLinkSbtContract).transferFrom(_params.from, _params.to, parentLinkSbtTokenId);
}
}
function ownerOfParentLinkSbt(
address _parentLinkSbtContract,
uint256 _parentLinkSbtTokenId
) public view returns (address parentTokenOwner) {
uint256 parentTokenId = connector.getParentLinkSbtTokenOwnerId(_parentLinkSbtContract, _parentLinkSbtTokenId);
require(
parentTokenId > 0 ||
connector.getParentLinkSbtTokenIndex(parentTokenId, _parentLinkSbtContract, _parentLinkSbtTokenId) > 0,
"not parent link sbt token"
);
return ownerOf(parentTokenId);
}
function _mint(address _to, uint256 _quantity) internal override {
require(_quantity + totalSupply() <= maxSupply, "claim is over the max supply");
super._mint(_to, _quantity);
}
function setApprovalForAll(
address operator,
bool approved
) public override(ERC721AntiScam, IERC721A) onlyAllowedOperatorApproval(operator) {
super.setApprovalForAll(operator, approved);
}
function approve(
address operator,
uint256 tokenId
) public payable override(ERC721AntiScam, IERC721A) onlyAllowedOperatorApproval(operator) {
super.approve(operator, tokenId);
}
function transferFrom(
address _from,
address _to,
uint256 _tokenId
) public payable virtual override(ERC721A, IERC721A) onlyAllowedOperator(_from) {
uint256 totalAmountParentLinkSbtContracts = address(connector) != address(0)
? connector.getTotalParentLinkSbtContracts(_tokenId)
: 0;
super.transferFrom(_from, _to, _tokenId);
if (totalAmountParentLinkSbtContracts != 0) {
_afterParentTokenTransfer(
DataType.AfterParentTokenTransferParams(_from, _to, _tokenId, totalAmountParentLinkSbtContracts)
);
}
}
function safeTransferFrom(
address _from,
address _to,
uint256 _tokenId
) public payable override(ERC721A, IERC721A) onlyAllowedOperator(_from) {
super.safeTransferFrom(_from, _to, _tokenId);
}
function safeTransferFrom(
address _from,
address _to,
uint256 _tokenId,
bytes memory _data
) public payable override(ERC721A, IERC721A) onlyAllowedOperator(_from) {
super.safeTransferFrom(_from, _to, _tokenId, _data);
}
function owner() public view virtual override(Ownable, UpdatableOperatorFilterer) returns (address) {
return Ownable.owner();
}
function tokenURI(uint256 tokenId) public view virtual override(ERC721A, IERC721A) returns (string memory) {
require(_exists(tokenId), "URI query for nonexistent token");
return zuttoMamoStage.tokenURI(tokenId);
}
function _afterTokenTransfers(address _from, address _to, uint256 _tokenId, uint256 _quantity) internal override {
if (tokenLocation[_tokenId] == DataType.TokenLocation.Operator) {
if (zuttoMamoStage.getTimeGrowingUpToHighSchooler() <= block.timestamp) {
zuttoMamoStage.setHighSchoolerLock(_tokenId);
}
tokenLocation[_tokenId] = DataType.TokenLocation.Other;
}
super._afterTokenTransfers(_from, _to, _tokenId, _quantity);
}
function exists(uint256 tokenId) public view virtual returns (bool) {
return _exists(tokenId);
}
function nextTokenId() external view returns (uint256) {
return _nextTokenId();
}
function _startTokenId() internal view virtual override returns (uint256) {
return 1;
}
function getTokenLocation(uint256 _tokenId) external view returns (DataType.TokenLocation) {
return tokenLocation[_tokenId];
}
}
{
"compilationTarget": {
"contracts/ZuttoMamo.sol": "ZuttoMamo"
},
"evmVersion": "paris",
"libraries": {},
"metadata": {
"bytecodeHash": "ipfs",
"useLiteralContent": true
},
"optimizer": {
"enabled": true,
"runs": 200
},
"remappings": []
}
[{"inputs":[],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"ApprovalCallerNotOwnerNorApproved","type":"error"},{"inputs":[],"name":"ApprovalQueryForNonexistentToken","type":"error"},{"inputs":[],"name":"BalanceQueryForZeroAddress","type":"error"},{"inputs":[],"name":"InitialRegistryAddressCannotBeZeroAddress","type":"error"},{"inputs":[],"name":"InvalidQueryRange","type":"error"},{"inputs":[],"name":"MintERC2309QuantityExceedsLimit","type":"error"},{"inputs":[],"name":"MintToZeroAddress","type":"error"},{"inputs":[],"name":"MintZeroQuantity","type":"error"},{"inputs":[],"name":"OnlyOwner","type":"error"},{"inputs":[{"internalType":"address","name":"operator","type":"address"}],"name":"OperatorNotAllowed","type":"error"},{"inputs":[],"name":"OwnerQueryForNonexistentToken","type":"error"},{"inputs":[],"name":"OwnershipNotInitializedForExtraData","type":"error"},{"inputs":[],"name":"RegistryHasBeenRevoked","type":"error"},{"inputs":[],"name":"TransferCallerNotOwnerNorApproved","type":"error"},{"inputs":[],"name":"TransferFromIncorrectOwner","type":"error"},{"inputs":[],"name":"TransferToNonERC721ReceiverImplementer","type":"error"},{"inputs":[],"name":"TransferToZeroAddress","type":"error"},{"inputs":[],"name":"URIQueryForNonexistentToken","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":"uint256","name":"_fromTokenId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"_toTokenId","type":"uint256"}],"name":"BatchMetadataUpdate","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"operator","type":"address"},{"indexed":true,"internalType":"uint256","name":"level","type":"uint256"}],"name":"CalLevelChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"fromTokenId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"toTokenId","type":"uint256"},{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"}],"name":"ConsecutiveTransfer","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"operator","type":"address"},{"indexed":true,"internalType":"address","name":"transferer","type":"address"}],"name":"LocalCalAdded","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"operator","type":"address"},{"indexed":true,"internalType":"address","name":"transferer","type":"address"}],"name":"LocalCalRemoved","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"_tokenId","type":"uint256"}],"name":"MetadataUpdate","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"newRegistry","type":"address"}],"name":"OperatorFilterRegistryAddressUpdated","type":"event"},{"anonymous":false,"inputs":[],"name":"OperatorFilterRegistryRevoked","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":"holder","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"},{"indexed":true,"internalType":"enum IERC721Lockable.LockStatus","name":"lockStatus","type":"uint8"},{"indexed":false,"internalType":"uint256","name":"timestamp","type":"uint256"}],"name":"TokenLock","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Transfer","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"holder","type":"address"},{"indexed":true,"internalType":"address","name":"operator","type":"address"},{"indexed":false,"internalType":"enum IERC721Lockable.LockStatus","name":"lockStatus","type":"uint8"}],"name":"WalletLock","type":"event"},{"inputs":[],"name":"ADMIN_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"CAL","outputs":[{"internalType":"contract IContractAllowListProxy","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"CALLevel","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"DEFAULT_ADMIN_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"METADATA_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MINTER_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_transferer","type":"address"}],"name":"addLocalContractAllowList","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address[]","name":"_to","type":"address[]"},{"internalType":"uint256[]","name":"_quantity","type":"uint256[]"},{"internalType":"bool","name":"_withSleep","type":"bool"}],"name":"airdropMint","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"operator","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"approve","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_to","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"birth","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_to","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"birthWithSleeping","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"connector","outputs":[{"internalType":"contract IERC5192PLConnector","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"contractLockStatus","outputs":[{"internalType":"enum IERC721Lockable.LockStatus","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"enableLock","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"enableRestrict","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"exists","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"explicitOwnershipOf","outputs":[{"components":[{"internalType":"address","name":"addr","type":"address"},{"internalType":"uint64","name":"startTimestamp","type":"uint64"},{"internalType":"bool","name":"burned","type":"bool"},{"internalType":"uint24","name":"extraData","type":"uint24"}],"internalType":"struct IERC721A.TokenOwnership","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"tokenIds","type":"uint256[]"}],"name":"explicitOwnershipsOf","outputs":[{"components":[{"internalType":"address","name":"addr","type":"address"},{"internalType":"uint64","name":"startTimestamp","type":"uint64"},{"internalType":"bool","name":"burned","type":"bool"},{"internalType":"uint24","name":"extraData","type":"uint24"}],"internalType":"struct IERC721A.TokenOwnership[]","name":"","type":"tuple[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"getApproved","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getLocalContractAllowList","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":[{"internalType":"uint256","name":"_tokenId","type":"uint256"}],"name":"getTokenLocation","outputs":[{"internalType":"enum DataType.TokenLocation","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"start","type":"uint256"},{"internalType":"uint256","name":"end","type":"uint256"}],"name":"getTokensUnderLock","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getTokensUnderLock","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_account","type":"address"}],"name":"grantAdmin","outputs":[],"stateMutability":"nonpayable","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":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"holder","type":"address"}],"name":"isLocked","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_tokenId","type":"uint256"}],"name":"isLocked","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"isOperatorFilterRegistryRevoked","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"maxSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"nextTokenId","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"operatorFilterRegistry","outputs":[{"internalType":"contract IOperatorFilterRegistry","name":"","type":"address"}],"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":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_parentLinkSbtContract","type":"address"},{"internalType":"uint256","name":"_parentLinkSbtTokenId","type":"uint256"}],"name":"ownerOfParentLinkSbt","outputs":[{"internalType":"address","name":"parentTokenOwner","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_fromTokenId","type":"uint256"},{"internalType":"uint256","name":"_toTokenId","type":"uint256"}],"name":"refreshMetadata","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_tokenId","type":"uint256"}],"name":"refreshMetadata","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_transferer","type":"address"}],"name":"removeLocalContractAllowList","outputs":[],"stateMutability":"nonpayable","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":"address","name":"_account","type":"address"}],"name":"revokeAdmin","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"revokeOperatorFilterRegistry","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":[],"name":"royaltyAddress","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"royaltyFee","outputs":[{"internalType":"uint96","name":"","type":"uint96"}],"stateMutability":"view","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":"payable","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":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"operator","type":"address"},{"internalType":"bool","name":"approved","type":"bool"}],"name":"setApprovalForAll","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_calAddress","type":"address"}],"name":"setCAL","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_level","type":"uint256"}],"name":"setCALLevel","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"enum IERC721Lockable.LockStatus","name":"_lockStatus","type":"uint8"}],"name":"setContractLock","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract IERC5192PLConnector","name":"_address","type":"address"}],"name":"setERC5192PLConnector","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bool","name":"_value","type":"bool"}],"name":"setEnableLock","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bool","name":"_value","type":"bool"}],"name":"setEnableRestrict","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_value","type":"uint256"}],"name":"setMaxSupply","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_royaltyAddress","type":"address"}],"name":"setRoyaltyAddress","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint96","name":"_value","type":"uint96"}],"name":"setRoyaltyFee","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"uint256","name":"level","type":"uint256"}],"name":"setTokenCALLevel","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"_tokenIds","type":"uint256[]"},{"internalType":"enum IERC721Lockable.LockStatus","name":"_newLockStatus","type":"uint8"}],"name":"setTokenLock","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"_tokenIds","type":"uint256[]"},{"internalType":"enum IERC721Lockable.LockStatus","name":"_lockStatus","type":"uint8"}],"name":"setTokenLockByAdmin","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_value","type":"uint256"}],"name":"setUnlockLeadTime","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"level","type":"uint256"}],"name":"setWalletCALLevel","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_to","type":"address"},{"internalType":"enum IERC721Lockable.LockStatus","name":"_lockStatus","type":"uint8"}],"name":"setWalletLock","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract IZuttoMamoStage","name":"_zuttoMamoStage","type":"address"}],"name":"setZuttoMamoStage","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"tokenCALLevel","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"tokenLock","outputs":[{"internalType":"enum IERC721Lockable.LockStatus","name":"","type":"uint8"}],"stateMutability":"view","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":"","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"uint256","name":"start","type":"uint256"},{"internalType":"uint256","name":"stop","type":"uint256"}],"name":"tokensOfOwnerIn","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":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"unlockLeadTime","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"newRegistry","type":"address"}],"name":"updateOperatorFilterRegistryAddress","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"walletCALLevel","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"walletLock","outputs":[{"internalType":"enum IERC721Lockable.LockStatus","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"zuttoMamoStage","outputs":[{"internalType":"contract IZuttoMamoStage","name":"","type":"address"}],"stateMutability":"view","type":"function"}]