编译器
0.8.17+commit.8df45f5f
文件 1 的 23:AdminControl.sol
pragma solidity ^0.8.0;
import "@openzeppelin/contracts/utils/introspection/ERC165.sol";
import "@openzeppelin/contracts/utils/structs/EnumerableSet.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "./IAdminControl.sol";
abstract contract AdminControl is Ownable, IAdminControl, ERC165 {
using EnumerableSet for EnumerableSet.AddressSet;
EnumerableSet.AddressSet private _admins;
function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165, IERC165) returns (bool) {
return interfaceId == type(IAdminControl).interfaceId
|| super.supportsInterface(interfaceId);
}
modifier adminRequired() {
require(owner() == msg.sender || _admins.contains(msg.sender), "AdminControl: Must be owner or admin");
_;
}
function getAdmins() external view override returns (address[] memory admins) {
admins = new address[](_admins.length());
for (uint i = 0; i < _admins.length(); i++) {
admins[i] = _admins.at(i);
}
return admins;
}
function approveAdmin(address admin) external override onlyOwner {
if (!_admins.contains(admin)) {
emit AdminApproved(admin, msg.sender);
_admins.add(admin);
}
}
function revokeAdmin(address admin) external override onlyOwner {
if (_admins.contains(admin)) {
emit AdminRevoked(admin, msg.sender);
_admins.remove(admin);
}
}
function isAdmin(address admin) public override view returns (bool) {
return (owner() == admin || _admins.contains(admin));
}
}
文件 2 的 23: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;
}
}
文件 3 的 23:ECDSA.sol
pragma solidity ^0.8.0;
import "../Strings.sol";
library ECDSA {
enum RecoverError {
NoError,
InvalidSignature,
InvalidSignatureLength,
InvalidSignatureS,
InvalidSignatureV
}
function _throwError(RecoverError error) private pure {
if (error == RecoverError.NoError) {
return;
} 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");
}
}
function tryRecover(bytes32 hash, bytes memory signature) internal pure returns (address, RecoverError) {
if (signature.length == 65) {
bytes32 r;
bytes32 s;
uint8 v;
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);
}
}
function recover(bytes32 hash, bytes memory signature) internal pure returns (address) {
(address recovered, RecoverError error) = tryRecover(hash, signature);
_throwError(error);
return recovered;
}
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);
}
function recover(
bytes32 hash,
bytes32 r,
bytes32 vs
) internal pure returns (address) {
(address recovered, RecoverError error) = tryRecover(hash, r, vs);
_throwError(error);
return recovered;
}
function tryRecover(
bytes32 hash,
uint8 v,
bytes32 r,
bytes32 s
) internal pure returns (address, RecoverError) {
if (uint256(s) > 0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5D576E7357A4501DDFE92F46681B20A0) {
return (address(0), RecoverError.InvalidSignatureS);
}
address signer = ecrecover(hash, v, r, s);
if (signer == address(0)) {
return (address(0), RecoverError.InvalidSignature);
}
return (signer, RecoverError.NoError);
}
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;
}
function toEthSignedMessageHash(bytes32 hash) internal pure returns (bytes32) {
return keccak256(abi.encodePacked("\x19Ethereum Signed Message:\n32", hash));
}
function toEthSignedMessageHash(bytes memory s) internal pure returns (bytes32) {
return keccak256(abi.encodePacked("\x19Ethereum Signed Message:\n", Strings.toString(s.length), s));
}
function toTypedDataHash(bytes32 domainSeparator, bytes32 structHash) internal pure returns (bytes32) {
return keccak256(abi.encodePacked("\x19\x01", domainSeparator, structHash));
}
}
文件 4 的 23: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;
}
}
文件 5 的 23:ERC721LazyPayableClaim.sol
pragma solidity ^0.8.0;
import "@manifoldxyz/creator-core-solidity/contracts/core/IERC721CreatorCore.sol";
import "@manifoldxyz/creator-core-solidity/contracts/extensions/ICreatorExtensionTokenURI.sol";
import "@openzeppelin/contracts/utils/introspection/IERC165.sol";
import "./LazyPayableClaim.sol";
import "./IERC721LazyPayableClaim.sol";
import "../libraries/IERC721CreatorCoreVersion.sol";
error InvalidStorageProtocol();
error ClaimNotInitialized();
error InvalidStartDate();
error InvalidAirdrop();
error TokenDNE();
error InvalidInstance();
contract ERC721LazyPayableClaim is IERC165, IERC721LazyPayableClaim, ICreatorExtensionTokenURI, LazyPayableClaim {
using Strings for uint256;
mapping(address => mapping(uint256 => Claim)) private _claims;
struct TokenClaim {
uint224 instanceId;
uint32 mintOrder;
}
mapping(address => mapping(uint256 => TokenClaim)) private _tokenClaims;
function supportsInterface(bytes4 interfaceId) public view virtual override(AdminControl, IERC165) returns (bool) {
return interfaceId == type(IERC721LazyPayableClaim).interfaceId ||
interfaceId == type(ILazyPayableClaim).interfaceId ||
interfaceId == type(ICreatorExtensionTokenURI).interfaceId ||
interfaceId == type(IAdminControl).interfaceId ||
interfaceId == type(IERC165).interfaceId;
}
constructor(address initialOwner, address delegationRegistry, address delegationRegistryV2) LazyPayableClaim(initialOwner, delegationRegistry, delegationRegistryV2) {}
function initializeClaim(
address creatorContractAddress,
uint256 instanceId,
ClaimParameters calldata claimParameters
) external override creatorAdminRequired(creatorContractAddress) {
if (instanceId == 0 || instanceId > MAX_UINT_56) revert InvalidInstance();
require(_claims[creatorContractAddress][instanceId].storageProtocol == StorageProtocol.INVALID, "Claim already initialized");
if (claimParameters.storageProtocol == StorageProtocol.INVALID) revert InvalidStorageProtocol();
if (claimParameters.endDate != 0 && claimParameters.startDate >= claimParameters.endDate) revert InvalidStartDate();
require(claimParameters.merkleRoot == "" || claimParameters.walletMax == 0, "Cannot provide both walletMax and merkleRoot");
uint8 creatorContractVersion;
try IERC721CreatorCoreVersion(creatorContractAddress).VERSION() returns(uint256 version) {
require(version <= 255, "Unsupported contract version");
creatorContractVersion = uint8(version);
} catch {}
_claims[creatorContractAddress][instanceId] = Claim({
total: 0,
totalMax: claimParameters.totalMax,
walletMax: claimParameters.walletMax,
startDate: claimParameters.startDate,
endDate: claimParameters.endDate,
storageProtocol: claimParameters.storageProtocol,
contractVersion: creatorContractVersion,
identical: claimParameters.identical,
merkleRoot: claimParameters.merkleRoot,
location: claimParameters.location,
cost: claimParameters.cost,
paymentReceiver: claimParameters.paymentReceiver,
erc20: claimParameters.erc20,
signingAddress: claimParameters.signingAddress
});
emit ClaimInitialized(creatorContractAddress, instanceId, msg.sender);
}
function updateClaim(
address creatorContractAddress,
uint256 instanceId,
ClaimParameters memory claimParameters
) external override creatorAdminRequired(creatorContractAddress) {
Claim memory claim = _claims[creatorContractAddress][instanceId];
if (claim.storageProtocol == StorageProtocol.INVALID) revert ClaimNotInitialized();
if (claimParameters.storageProtocol == StorageProtocol.INVALID) revert InvalidStorageProtocol();
if (claimParameters.endDate != 0 && claimParameters.startDate >= claimParameters.endDate) revert InvalidStartDate();
require(claimParameters.erc20 == claim.erc20, "Cannot change payment token");
if (claimParameters.totalMax != 0 && claim.total > claimParameters.totalMax) {
claimParameters.totalMax = claim.total;
}
_claims[creatorContractAddress][instanceId] = Claim({
total: claim.total,
totalMax: claimParameters.totalMax,
walletMax: claimParameters.walletMax,
startDate: claimParameters.startDate,
endDate: claimParameters.endDate,
storageProtocol: claimParameters.storageProtocol,
contractVersion: claim.contractVersion,
identical: claimParameters.identical,
merkleRoot: claimParameters.merkleRoot,
location: claimParameters.location,
cost: claimParameters.cost,
paymentReceiver: claimParameters.paymentReceiver,
erc20: claim.erc20,
signingAddress: claimParameters.signingAddress
});
emit ClaimUpdated(creatorContractAddress, instanceId);
}
function updateTokenURIParams(
address creatorContractAddress, uint256 instanceId,
StorageProtocol storageProtocol,
bool identical,
string calldata location
) external override creatorAdminRequired(creatorContractAddress) {
Claim storage claim = _claims[creatorContractAddress][instanceId];
if (_claims[creatorContractAddress][instanceId].storageProtocol == StorageProtocol.INVALID) revert ClaimNotInitialized();
if (storageProtocol == StorageProtocol.INVALID) revert InvalidStorageProtocol();
claim.storageProtocol = storageProtocol;
claim.location = location;
claim.identical = identical;
emit ClaimUpdated(creatorContractAddress, instanceId);
}
function extendTokenURI(
address creatorContractAddress, uint256 instanceId,
string calldata locationChunk
) external override creatorAdminRequired(creatorContractAddress) {
Claim storage claim = _claims[creatorContractAddress][instanceId];
if (claim.storageProtocol != StorageProtocol.NONE || !claim.identical) revert InvalidStorageProtocol();
claim.location = string(abi.encodePacked(claim.location, locationChunk));
emit ClaimUpdated(creatorContractAddress, instanceId);
}
function getClaim(address creatorContractAddress, uint256 instanceId) public override view returns(Claim memory) {
return _getClaim(creatorContractAddress, instanceId);
}
function getClaimForToken(address creatorContractAddress, uint256 tokenId) external override view returns(uint256 instanceId, Claim memory claim) {
TokenClaim memory tokenClaim = _tokenClaims[creatorContractAddress][tokenId];
if (tokenClaim.instanceId == 0) {
uint80 tokenData = IERC721CreatorCore(creatorContractAddress).tokenData(tokenId);
instanceId = uint56(tokenData >> 24);
} else {
instanceId = tokenClaim.instanceId;
}
claim = _getClaim(creatorContractAddress, instanceId);
}
function _getClaim(address creatorContractAddress, uint256 instanceId) private view returns(Claim storage claim) {
claim = _claims[creatorContractAddress][instanceId];
if (claim.storageProtocol == StorageProtocol.INVALID) revert ClaimNotInitialized();
}
function checkMintIndex(address creatorContractAddress, uint256 instanceId, uint32 mintIndex) external override view returns(bool) {
Claim memory claim = getClaim(creatorContractAddress, instanceId);
return _checkMintIndex(creatorContractAddress, instanceId, claim.merkleRoot, mintIndex);
}
function checkMintIndices(address creatorContractAddress, uint256 instanceId, uint32[] calldata mintIndices) external override view returns(bool[] memory minted) {
Claim memory claim = getClaim(creatorContractAddress, instanceId);
uint256 mintIndicesLength = mintIndices.length;
minted = new bool[](mintIndices.length);
for (uint256 i; i < mintIndicesLength;) {
minted[i] = _checkMintIndex(creatorContractAddress, instanceId, claim.merkleRoot, mintIndices[i]);
unchecked{ ++i; }
}
}
function getTotalMints(address minter, address creatorContractAddress, uint256 instanceId) external override view returns(uint32) {
Claim memory claim = getClaim(creatorContractAddress, instanceId);
return _getTotalMints(claim.walletMax, minter, creatorContractAddress, instanceId);
}
function mint(address creatorContractAddress, uint256 instanceId, uint32 mintIndex, bytes32[] calldata merkleProof, address mintFor) external payable override {
Claim storage claim = _getClaim(creatorContractAddress, instanceId);
if (claim.signingAddress != address(0)) revert MustUseSignatureMinting();
if (((++claim.total > claim.totalMax && claim.totalMax != 0) || claim.total > MAX_UINT_24)) revert TooManyRequested();
_validateMint(creatorContractAddress, instanceId, claim.startDate, claim.endDate, claim.walletMax, claim.merkleRoot, mintIndex, merkleProof, mintFor);
_transferFunds(claim.erc20, claim.cost, claim.paymentReceiver, 1, claim.merkleRoot != "", true);
if (claim.contractVersion >= 3) {
uint80 tokenData = uint56(instanceId) << 24 | uint24(claim.total);
IERC721CreatorCore(creatorContractAddress).mintExtension(msg.sender, tokenData);
} else {
uint256 newTokenId = IERC721CreatorCore(creatorContractAddress).mintExtension(msg.sender);
_tokenClaims[creatorContractAddress][newTokenId] = TokenClaim(uint224(instanceId), claim.total);
}
emit ClaimMint(creatorContractAddress, instanceId);
}
function mintBatch(address creatorContractAddress, uint256 instanceId, uint16 mintCount, uint32[] calldata mintIndices, bytes32[][] calldata merkleProofs, address mintFor) external payable override {
Claim storage claim = _getClaim(creatorContractAddress, instanceId);
if (claim.signingAddress != address(0)) revert MustUseSignatureMinting();
claim.total += mintCount;
if (((claim.totalMax != 0 && claim.total > claim.totalMax) || claim.total > MAX_UINT_24)) revert TooManyRequested();
_validateMint(creatorContractAddress, instanceId, claim.startDate, claim.endDate, claim.walletMax, claim.merkleRoot, mintCount, mintIndices, merkleProofs, mintFor);
uint256 newMintIndex = claim.total - mintCount + 1;
_transferFunds(claim.erc20, claim.cost, claim.paymentReceiver, mintCount, claim.merkleRoot != "", true);
_mintBatch(creatorContractAddress, instanceId, mintCount, msg.sender, newMintIndex, claim.contractVersion);
emit ClaimMintBatch(creatorContractAddress, instanceId, mintCount);
}
function mintProxy(address creatorContractAddress, uint256 instanceId, uint16 mintCount, uint32[] calldata mintIndices, bytes32[][] calldata merkleProofs, address mintFor) external payable override {
Claim storage claim = _getClaim(creatorContractAddress, instanceId);
if (claim.signingAddress != address(0)) revert MustUseSignatureMinting();
claim.total += mintCount;
if (((claim.totalMax != 0 && claim.total > claim.totalMax) || claim.total > MAX_UINT_24)) revert TooManyRequested();
_validateMintProxy(creatorContractAddress, instanceId, claim.startDate, claim.endDate, claim.walletMax, claim.merkleRoot, mintCount, mintIndices, merkleProofs, mintFor);
uint256 newMintIndex = claim.total - mintCount + 1;
_transferFunds(claim.erc20, claim.cost, claim.paymentReceiver, mintCount, claim.merkleRoot != "", false);
_mintBatch(creatorContractAddress, instanceId, mintCount, mintFor, newMintIndex, claim.contractVersion);
emit ClaimMintProxy(creatorContractAddress, instanceId, mintCount, msg.sender, mintFor);
}
function mintSignature(address creatorContractAddress, uint256 instanceId, uint16 mintCount, bytes calldata signature, bytes32 message, bytes32 nonce, address mintFor, uint256 expiration) external payable override {
address creatorContractAddress = creatorContractAddress;
uint16 mintCount = mintCount;
Claim storage claim = _getClaim(creatorContractAddress, instanceId);
claim.total += mintCount;
if (((claim.totalMax != 0 && claim.total > claim.totalMax) || claim.total > MAX_UINT_24)) revert TooManyRequested();
_validateMintSignature(claim.startDate, claim.endDate, signature, claim.signingAddress);
_checkSignatureAndUpdate(creatorContractAddress, instanceId, signature, message, nonce, claim.signingAddress, mintFor, expiration, mintCount);
uint256 newMintIndex = claim.total - mintCount + 1;
_transferFunds(claim.erc20, claim.cost, claim.paymentReceiver, mintCount, claim.merkleRoot != "", false);
_mintBatch(creatorContractAddress, instanceId, mintCount, mintFor, newMintIndex, claim.contractVersion);
emit ClaimMintSignature(creatorContractAddress, instanceId, mintCount, msg.sender, mintFor, nonce);
}
function _mintBatch(address creatorContractAddress, uint256 instanceId, uint16 mintCount, address recipient, uint256 startIndex, uint8 contractVersion) internal {
if (contractVersion >= 3) {
uint80[] memory tokenData = new uint80[](mintCount);
for (uint256 i; i < mintCount;) {
tokenData[i] = uint56(instanceId) << 24 | uint24(startIndex+i);
unchecked { ++i; }
}
IERC721CreatorCore(creatorContractAddress).mintExtensionBatch(recipient, tokenData);
} else {
uint256[] memory newTokenIds = IERC721CreatorCore(creatorContractAddress).mintExtensionBatch(recipient, mintCount);
for (uint256 i; i < mintCount;) {
_tokenClaims[creatorContractAddress][newTokenIds[i]] = TokenClaim(uint224(instanceId), uint32(startIndex+i));
unchecked { ++i; }
}
}
}
function airdrop(address creatorContractAddress, uint256 instanceId, address[] calldata recipients,
uint16[] calldata amounts) external override creatorAdminRequired(creatorContractAddress) {
if (recipients.length != amounts.length) revert InvalidAirdrop();
Claim storage claim = _claims[creatorContractAddress][instanceId];
uint256 newMintIndex = claim.total+1;
if (claim.contractVersion >= 3) {
for (uint256 i; i < recipients.length;) {
uint16 mintCount = amounts[i];
uint80[] memory tokenDatas = new uint80[](mintCount);
for (uint256 j; j < mintCount;) {
tokenDatas[j] = uint56(instanceId) << 24 | uint24(newMintIndex+j);
unchecked { ++j; }
}
IERC721CreatorCore(creatorContractAddress).mintExtensionBatch(recipients[i], tokenDatas);
unchecked{ newMintIndex += mintCount; }
unchecked{ ++i; }
}
} else {
for (uint256 i; i < recipients.length;) {
uint256[] memory newTokenIds = IERC721CreatorCore(creatorContractAddress).mintExtensionBatch(recipients[i], amounts[i]);
for (uint256 j; j < newTokenIds.length;) {
_tokenClaims[creatorContractAddress][newTokenIds[j]] = TokenClaim(uint224(instanceId), uint32(newMintIndex+j));
unchecked { ++j; }
}
unchecked{ newMintIndex += newTokenIds.length; }
unchecked{ ++i; }
}
}
if (newMintIndex - claim.total - 1 > MAX_UINT_24) revert TooManyRequested();
claim.total += uint32(newMintIndex - claim.total - 1);
if (claim.totalMax != 0 && claim.total > claim.totalMax) {
claim.totalMax = claim.total;
}
}
function tokenURI(address creatorContractAddress, uint256 tokenId) external override view returns(string memory uri) {
TokenClaim memory tokenClaim = _tokenClaims[creatorContractAddress][tokenId];
Claim memory claim;
uint256 mintOrder;
if (tokenClaim.instanceId != 0) {
claim = _claims[creatorContractAddress][tokenClaim.instanceId];
mintOrder = tokenClaim.mintOrder;
} else {
uint80 tokenData = IERC721CreatorCore(creatorContractAddress).tokenData(tokenId);
uint56 instanceId = uint56(tokenData >> 24);
if (instanceId == 0) revert TokenDNE();
claim = _claims[creatorContractAddress][instanceId];
mintOrder = uint24(tokenData & MAX_UINT_24);
}
string memory prefix = "";
if (claim.storageProtocol == StorageProtocol.ARWEAVE) {
prefix = ARWEAVE_PREFIX;
} else if (claim.storageProtocol == StorageProtocol.IPFS) {
prefix = IPFS_PREFIX;
}
uri = string(abi.encodePacked(prefix, claim.location));
if (!claim.identical) {
uri = string(abi.encodePacked(uri, "/", uint256(mintOrder).toString()));
}
}
}
文件 6 的 23: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;
}
}
文件 7 的 23:IAdminControl.sol
pragma solidity ^0.8.0;
import "@openzeppelin/contracts/utils/introspection/IERC165.sol";
interface IAdminControl is IERC165 {
event AdminApproved(address indexed account, address indexed sender);
event AdminRevoked(address indexed account, address indexed sender);
function getAdmins() external view returns (address[] memory);
function approveAdmin(address admin) external;
function revokeAdmin(address admin) external;
function isAdmin(address admin) external view returns (bool);
}
文件 8 的 23:ICreatorCore.sol
pragma solidity ^0.8.0;
import "@openzeppelin/contracts/utils/introspection/IERC165.sol";
interface ICreatorCore is IERC165 {
event ExtensionRegistered(address indexed extension, address indexed sender);
event ExtensionUnregistered(address indexed extension, address indexed sender);
event ExtensionBlacklisted(address indexed extension, address indexed sender);
event MintPermissionsUpdated(address indexed extension, address indexed permissions, address indexed sender);
event RoyaltiesUpdated(uint256 indexed tokenId, address payable[] receivers, uint256[] basisPoints);
event DefaultRoyaltiesUpdated(address payable[] receivers, uint256[] basisPoints);
event ApproveTransferUpdated(address extension);
event ExtensionRoyaltiesUpdated(address indexed extension, address payable[] receivers, uint256[] basisPoints);
event ExtensionApproveTransferUpdated(address indexed extension, bool enabled);
function getExtensions() external view returns (address[] memory);
function registerExtension(address extension, string calldata baseURI) external;
function registerExtension(address extension, string calldata baseURI, bool baseURIIdentical) external;
function unregisterExtension(address extension) external;
function blacklistExtension(address extension) external;
function setBaseTokenURIExtension(string calldata uri) external;
function setBaseTokenURIExtension(string calldata uri, bool identical) external;
function setTokenURIPrefixExtension(string calldata prefix) external;
function setTokenURIExtension(uint256 tokenId, string calldata uri) external;
function setTokenURIExtension(uint256[] memory tokenId, string[] calldata uri) external;
function setBaseTokenURI(string calldata uri) external;
function setTokenURIPrefix(string calldata prefix) external;
function setTokenURI(uint256 tokenId, string calldata uri) external;
function setTokenURI(uint256[] memory tokenIds, string[] calldata uris) external;
function setMintPermissions(address extension, address permissions) external;
function setApproveTransferExtension(bool enabled) external;
function tokenExtension(uint256 tokenId) external view returns (address);
function setRoyalties(address payable[] calldata receivers, uint256[] calldata basisPoints) external;
function setRoyalties(uint256 tokenId, address payable[] calldata receivers, uint256[] calldata basisPoints) external;
function setRoyaltiesExtension(address extension, address payable[] calldata receivers, uint256[] calldata basisPoints) external;
function getRoyalties(uint256 tokenId) external view returns (address payable[] memory, uint256[] memory);
function getFeeRecipients(uint256 tokenId) external view returns (address payable[] memory);
function getFeeBps(uint256 tokenId) external view returns (uint[] memory);
function getFees(uint256 tokenId) external view returns (address payable[] memory, uint256[] memory);
function royaltyInfo(uint256 tokenId, uint256 value) external view returns (address, uint256);
function setApproveTransfer(address extension) external;
function getApproveTransfer() external view returns (address);
}
文件 9 的 23:ICreatorExtensionTokenURI.sol
pragma solidity ^0.8.0;
import "@openzeppelin/contracts/utils/introspection/IERC165.sol";
interface ICreatorExtensionTokenURI is IERC165 {
function tokenURI(address creator, uint256 tokenId) external view returns (string memory);
}
文件 10 的 23:IDelegationRegistry.sol
pragma solidity ^0.8.9;
interface IDelegationRegistry {
enum DelegationType {
NONE,
ALL,
CONTRACT,
TOKEN
}
struct DelegationInfo {
DelegationType type_;
address vault;
address delegate;
address contract_;
uint256 tokenId;
}
struct ContractDelegation {
address contract_;
address delegate;
}
struct TokenDelegation {
address contract_;
uint256 tokenId;
address delegate;
}
event DelegateForAll(address vault, address delegate, bool value);
event DelegateForContract(address vault, address delegate, address contract_, bool value);
event DelegateForToken(address vault, address delegate, address contract_, uint256 tokenId, bool value);
event RevokeAllDelegates(address vault);
event RevokeDelegate(address vault, address delegate);
function delegateForAll(address delegate, bool value) external;
function delegateForContract(address delegate, address contract_, bool value) external;
function delegateForToken(address delegate, address contract_, uint256 tokenId, bool value) external;
function revokeAllDelegates() external;
function revokeDelegate(address delegate) external;
function revokeSelf(address vault) external;
function getDelegationsByDelegate(address delegate) external view returns (DelegationInfo[] memory);
function getDelegatesForAll(address vault) external view returns (address[] memory);
function getDelegatesForContract(address vault, address contract_) external view returns (address[] memory);
function getDelegatesForToken(address vault, address contract_, uint256 tokenId)
external
view
returns (address[] memory);
function getContractLevelDelegations(address vault)
external
view
returns (ContractDelegation[] memory delegations);
function getTokenLevelDelegations(address vault) external view returns (TokenDelegation[] memory delegations);
function checkDelegateForAll(address delegate, address vault) external view returns (bool);
function checkDelegateForContract(address delegate, address vault, address contract_)
external
view
returns (bool);
function checkDelegateForToken(address delegate, address vault, address contract_, uint256 tokenId)
external
view
returns (bool);
}
文件 11 的 23:IDelegationRegistryV2.sol
pragma solidity >=0.8.13;
interface IDelegationRegistryV2 {
enum DelegationType {
NONE,
ALL,
CONTRACT,
ERC721,
ERC20,
ERC1155
}
struct Delegation {
DelegationType type_;
address to;
address from;
bytes32 rights;
address contract_;
uint256 tokenId;
uint256 amount;
}
event DelegateAll(address indexed from, address indexed to, bytes32 rights, bool enable);
event DelegateContract(address indexed from, address indexed to, address indexed contract_, bytes32 rights, bool enable);
event DelegateERC721(address indexed from, address indexed to, address indexed contract_, uint256 tokenId, bytes32 rights, bool enable);
event DelegateERC20(address indexed from, address indexed to, address indexed contract_, bytes32 rights, uint256 amount);
event DelegateERC1155(address indexed from, address indexed to, address indexed contract_, uint256 tokenId, bytes32 rights, uint256 amount);
error MulticallFailed();
function multicall(bytes[] calldata data) external payable returns (bytes[] memory results);
function delegateAll(address to, bytes32 rights, bool enable) external payable returns (bytes32 delegationHash);
function delegateContract(address to, address contract_, bytes32 rights, bool enable) external payable returns (bytes32 delegationHash);
function delegateERC721(address to, address contract_, uint256 tokenId, bytes32 rights, bool enable) external payable returns (bytes32 delegationHash);
function delegateERC20(address to, address contract_, bytes32 rights, uint256 amount) external payable returns (bytes32 delegationHash);
function delegateERC1155(address to, address contract_, uint256 tokenId, bytes32 rights, uint256 amount) external payable returns (bytes32 delegationHash);
function checkDelegateForAll(address to, address from, bytes32 rights) external view returns (bool);
function checkDelegateForContract(address to, address from, address contract_, bytes32 rights) external view returns (bool);
function checkDelegateForERC721(address to, address from, address contract_, uint256 tokenId, bytes32 rights) external view returns (bool);
function checkDelegateForERC20(address to, address from, address contract_, bytes32 rights) external view returns (uint256);
function checkDelegateForERC1155(address to, address from, address contract_, uint256 tokenId, bytes32 rights) external view returns (uint256);
function getIncomingDelegations(address to) external view returns (Delegation[] memory delegations);
function getOutgoingDelegations(address from) external view returns (Delegation[] memory delegations);
function getIncomingDelegationHashes(address to) external view returns (bytes32[] memory delegationHashes);
function getOutgoingDelegationHashes(address from) external view returns (bytes32[] memory delegationHashes);
function getDelegationsFromHashes(bytes32[] calldata delegationHashes) external view returns (Delegation[] memory delegations);
function readSlot(bytes32 location) external view returns (bytes32);
function readSlots(bytes32[] calldata locations) external view returns (bytes32[] memory);
}
文件 12 的 23:IERC165.sol
pragma solidity ^0.8.0;
interface IERC165 {
function supportsInterface(bytes4 interfaceId) external view returns (bool);
}
文件 13 的 23:IERC20.sol
pragma solidity ^0.8.0;
interface IERC20 {
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address to, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(
address from,
address to,
uint256 amount
) external returns (bool);
}
文件 14 的 23:IERC721CreatorCore.sol
pragma solidity ^0.8.0;
import "./ICreatorCore.sol";
interface IERC721CreatorCore is ICreatorCore {
function mintBase(address to) external returns (uint256);
function mintBase(address to, string calldata uri) external returns (uint256);
function mintBaseBatch(address to, uint16 count) external returns (uint256[] memory);
function mintBaseBatch(address to, string[] calldata uris) external returns (uint256[] memory);
function mintExtension(address to) external returns (uint256);
function mintExtension(address to, string calldata uri) external returns (uint256);
function mintExtension(address to, uint80 data) external returns (uint256);
function mintExtensionBatch(address to, uint16 count) external returns (uint256[] memory);
function mintExtensionBatch(address to, string[] calldata uris) external returns (uint256[] memory);
function mintExtensionBatch(address to, uint80[] calldata data) external returns (uint256[] memory);
function burn(uint256 tokenId) external;
function tokenData(uint256 tokenId) external view returns (uint80);
}
文件 15 的 23:IERC721CreatorCoreVersion.sol
pragma solidity ^0.8.0;
interface IERC721CreatorCoreVersion {
function VERSION() external view returns(uint256);
}
文件 16 的 23:IERC721LazyPayableClaim.sol
pragma solidity ^0.8.0;
import "./ILazyPayableClaim.sol";
interface IERC721LazyPayableClaim is ILazyPayableClaim {
struct ClaimParameters {
uint32 totalMax;
uint32 walletMax;
uint48 startDate;
uint48 endDate;
StorageProtocol storageProtocol;
bool identical;
bytes32 merkleRoot;
string location;
uint256 cost;
address payable paymentReceiver;
address erc20;
address signingAddress;
}
struct Claim {
uint32 total;
uint32 totalMax;
uint32 walletMax;
uint48 startDate;
uint48 endDate;
StorageProtocol storageProtocol;
uint8 contractVersion;
bool identical;
bytes32 merkleRoot;
string location;
uint256 cost;
address payable paymentReceiver;
address erc20;
address signingAddress;
}
function initializeClaim(address creatorContractAddress, uint256 instanceId, ClaimParameters calldata claimParameters) external;
function updateClaim(address creatorContractAddress, uint256 instanceId, ClaimParameters calldata claimParameters) external;
function updateTokenURIParams(address creatorContractAddress, uint256 instanceId, StorageProtocol storageProtocol, bool identical, string calldata location) external;
function extendTokenURI(address creatorContractAddress, uint256 instanceId, string calldata locationChunk) external;
function getClaim(address creatorContractAddress, uint256 instanceId) external view returns(Claim memory);
function getClaimForToken(address creatorContractAddress, uint256 tokenId) external view returns(uint256, Claim memory);
function airdrop(address creatorContractAddress, uint256 instanceId, address[] calldata recipients, uint16[] calldata amounts) external;
}
文件 17 的 23:ILazyPayableClaim.sol
pragma solidity ^0.8.0;
interface ILazyPayableClaim {
enum StorageProtocol { INVALID, NONE, ARWEAVE, IPFS }
event ClaimInitialized(address indexed creatorContract, uint256 indexed instanceId, address initializer);
event ClaimUpdated(address indexed creatorContract, uint256 indexed instanceId);
event ClaimMint(address indexed creatorContract, uint256 indexed instanceId);
event ClaimMintBatch(address indexed creatorContract, uint256 indexed instanceId, uint16 mintCount);
event ClaimMintProxy(address indexed creatorContract, uint256 indexed instanceId, uint16 mintCount, address proxy, address mintFor);
event ClaimMintSignature(address indexed creatorContract, uint256 indexed instanceId, uint16 mintCount, address proxy, address mintFor, bytes32 nonce);
function withdraw(address payable receiver, uint256 amount) external;
function setMembershipAddress(address membershipAddress) external;
function checkMintIndex(address creatorContractAddress, uint256 instanceId, uint32 mintIndex) external view returns(bool);
function checkMintIndices(address creatorContractAddress, uint256 instanceId, uint32[] calldata mintIndices) external view returns(bool[] memory);
function getTotalMints(address minter, address creatorContractAddress, uint256 instanceId) external view returns(uint32);
function mint(address creatorContractAddress, uint256 instanceId, uint32 mintIndex, bytes32[] calldata merkleProof, address mintFor) external payable;
function mintBatch(address creatorContractAddress, uint256 instanceId, uint16 mintCount, uint32[] calldata mintIndices, bytes32[][] calldata merkleProofs, address mintFor) external payable;
function mintProxy(address creatorContractAddress, uint256 instanceId, uint16 mintCount, uint32[] calldata mintIndices, bytes32[][] calldata merkleProofs, address mintFor) external payable;
function mintSignature(address creatorContractAddress, uint256 instanceId, uint16 mintCount, bytes calldata signature, bytes32 message, bytes32 nonce, address mintFor, uint256 expiration) external payable;
}
文件 18 的 23:IManifoldMembership.sol
pragma solidity ^0.8.0;
interface IManifoldMembership {
function isActiveMember(address sender) external view returns (bool);
}
文件 19 的 23:LazyPayableClaim.sol
pragma solidity ^0.8.0;
import "@manifoldxyz/libraries-solidity/contracts/access/AdminControl.sol";
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/utils/cryptography/MerkleProof.sol";
import "@openzeppelin/contracts/utils/Strings.sol";
import "@openzeppelin/contracts/utils/cryptography/ECDSA.sol";
import ".././libraries/delegation-registry/IDelegationRegistry.sol";
import ".././libraries/delegation-registry/IDelegationRegistryV2.sol";
import ".././libraries/manifold-membership/IManifoldMembership.sol";
import "./ILazyPayableClaim.sol";
error InvalidInput();
error ClaimInactive();
error TooManyRequested();
error MustUseSignatureMinting();
error FailedToTransfer();
error InvalidSignature();
error ExpiredSignature();
abstract contract LazyPayableClaim is ILazyPayableClaim, AdminControl {
using EnumerableSet for EnumerableSet.AddressSet;
using ECDSA for bytes32;
string internal constant ARWEAVE_PREFIX = "https://arweave.net/";
string internal constant IPFS_PREFIX = "ipfs://";
uint256 internal constant MINT_INDEX_BITMASK = 0xFF;
address public immutable DELEGATION_REGISTRY;
address public immutable DELEGATION_REGISTRY_V2;
uint256 public constant MINT_FEE = 500000000000000;
uint256 public constant MINT_FEE_MERKLE = 690000000000000;
address public MEMBERSHIP_ADDRESS;
uint256 internal constant MAX_UINT_24 = 0xffffff;
uint256 internal constant MAX_UINT_32 = 0xffffffff;
uint256 internal constant MAX_UINT_56 = 0xffffffffffffff;
uint256 internal constant MAX_UINT_256 = 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff;
address private constant ADDRESS_ZERO = 0x0000000000000000000000000000000000000000;
mapping(address => mapping(uint256 => mapping(address => uint256))) internal _mintsPerWallet;
mapping(address => mapping(uint256 => mapping(uint256 => uint256))) internal _claimMintIndices;
mapping(address => mapping(uint256 => mapping(bytes32 => bool))) internal _usedMessages;
modifier creatorAdminRequired(address creatorContractAddress) {
AdminControl creatorCoreContract = AdminControl(creatorContractAddress);
require(creatorCoreContract.isAdmin(msg.sender), "Wallet is not an administrator for contract");
_;
}
constructor(address initialOwner, address delegationRegistry, address delegationRegistryV2) {
_transferOwnership(initialOwner);
DELEGATION_REGISTRY = delegationRegistry;
DELEGATION_REGISTRY_V2 = delegationRegistryV2;
}
function withdraw(address payable receiver, uint256 amount) external override adminRequired {
(bool sent, ) = receiver.call{value: amount}("");
if (!sent) revert FailedToTransfer();
}
function setMembershipAddress(address membershipAddress) external override adminRequired {
MEMBERSHIP_ADDRESS = membershipAddress;
}
function _transferFunds(address erc20, uint256 cost, address payable recipient, uint16 mintCount, bool merkle, bool allowMembership) internal {
uint256 payableCost;
if (erc20 != ADDRESS_ZERO) {
require(IERC20(erc20).transferFrom(msg.sender, recipient, cost*mintCount), "Insufficient funds");
} else {
payableCost = cost;
}
if (MEMBERSHIP_ADDRESS == ADDRESS_ZERO || !allowMembership || !IManifoldMembership(MEMBERSHIP_ADDRESS).isActiveMember(msg.sender)) {
payableCost += merkle ? MINT_FEE_MERKLE : MINT_FEE;
}
if (mintCount > 1) {
payableCost *= mintCount;
cost *= mintCount;
}
require(msg.value >= payableCost, "Invalid amount");
if (erc20 == ADDRESS_ZERO && cost != 0) {
(bool sent, ) = recipient.call{value: cost}("");
if (!sent) revert FailedToTransfer();
}
}
function _checkMintIndex(address creatorContractAddress, uint256 instanceId, bytes32 merkleRoot, uint32 mintIndex) internal view returns (bool) {
uint256 claimMintIndex = mintIndex >> 8;
require(merkleRoot != "", "Can only check merkle claims");
uint256 claimMintTracking = _claimMintIndices[creatorContractAddress][instanceId][claimMintIndex];
uint256 mintBitmask = 1 << (mintIndex & MINT_INDEX_BITMASK);
return mintBitmask & claimMintTracking != 0;
}
function _validateMint(address creatorContractAddress, uint256 instanceId, uint48 startDate, uint48 endDate, uint32 walletMax, bytes32 merkleRoot, uint32 mintIndex, bytes32[] calldata merkleProof, address mintFor) internal {
if ((startDate > block.timestamp) || (endDate > 0 && endDate < block.timestamp)) revert ClaimInactive();
if (merkleRoot != "") {
_checkMerkleAndUpdate(msg.sender, creatorContractAddress, instanceId, merkleRoot, mintIndex, merkleProof, mintFor);
} else {
if (mintFor != msg.sender) revert InvalidInput();
if (walletMax != 0) {
if (++_mintsPerWallet[creatorContractAddress][instanceId][msg.sender] > walletMax) revert TooManyRequested();
}
}
}
function _validateMint(address creatorContractAddress, uint256 instanceId, uint48 startDate, uint48 endDate, uint32 walletMax, bytes32 merkleRoot, uint16 mintCount, uint32[] calldata mintIndices, bytes32[][] calldata merkleProofs, address mintFor) internal {
if ((startDate > block.timestamp) || (endDate > 0 && endDate < block.timestamp)) revert ClaimInactive();
if (merkleRoot != "") {
if (!(mintCount == mintIndices.length && mintCount == merkleProofs.length)) revert InvalidInput();
for (uint256 i; i < mintCount;) {
_checkMerkleAndUpdate(msg.sender, creatorContractAddress, instanceId, merkleRoot, mintIndices[i], merkleProofs[i], mintFor);
unchecked { ++i; }
}
} else {
if (mintFor != msg.sender) revert InvalidInput();
if (walletMax != 0) {
_mintsPerWallet[creatorContractAddress][instanceId][mintFor] += mintCount;
if (_mintsPerWallet[creatorContractAddress][instanceId][mintFor] > walletMax) revert TooManyRequested();
}
}
}
function _validateMintProxy(address creatorContractAddress, uint256 instanceId, uint48 startDate, uint48 endDate, uint32 walletMax, bytes32 merkleRoot, uint16 mintCount, uint32[] calldata mintIndices, bytes32[][] calldata merkleProofs, address mintFor) internal {
if ((startDate > block.timestamp) || (endDate > 0 && endDate < block.timestamp)) revert ClaimInactive();
if (merkleRoot != "") {
if (!(mintCount == mintIndices.length && mintCount == merkleProofs.length)) revert InvalidInput();
for (uint256 i; i < mintCount;) {
_checkMerkleAndUpdate(mintFor, creatorContractAddress, instanceId, merkleRoot, mintIndices[i], merkleProofs[i], mintFor);
unchecked { ++i; }
}
} else {
if (walletMax != 0) {
_mintsPerWallet[creatorContractAddress][instanceId][mintFor] += mintCount;
if (_mintsPerWallet[creatorContractAddress][instanceId][mintFor] > walletMax) revert TooManyRequested();
}
}
}
function _validateMintSignature(uint48 startDate, uint48 endDate, bytes calldata signature, address signingAddress) internal view {
if (signingAddress == address(0)) revert MustUseSignatureMinting();
if (signature.length <= 0) revert InvalidInput();
if ((startDate > block.timestamp) || (endDate > 0 && endDate < block.timestamp)) revert ClaimInactive();
}
function _checkMerkleAndUpdate(address sender, address creatorContractAddress, uint256 instanceId, bytes32 merkleRoot, uint32 mintIndex, bytes32[] memory merkleProof, address mintFor) private {
bytes32 leaf;
if (mintFor == sender) {
leaf = keccak256(abi.encodePacked(sender, mintIndex));
} else {
IDelegationRegistry dr = IDelegationRegistry(DELEGATION_REGISTRY);
IDelegationRegistryV2 drV2 = IDelegationRegistryV2(DELEGATION_REGISTRY_V2);
require(
drV2.checkDelegateForContract(sender, mintFor, address(this), "") ||
dr.checkDelegateForContract(sender, mintFor, address(this)), "Invalid delegate");
leaf = keccak256(abi.encodePacked(mintFor, mintIndex));
}
require(MerkleProof.verify(merkleProof, merkleRoot, leaf), "Could not verify merkle proof");
uint256 claimMintIndex = mintIndex >> 8;
uint256 claimMintTracking = _claimMintIndices[creatorContractAddress][instanceId][claimMintIndex];
uint256 mintBitmask = 1 << (mintIndex & MINT_INDEX_BITMASK);
require(mintBitmask & claimMintTracking == 0, "Already minted");
_claimMintIndices[creatorContractAddress][instanceId][claimMintIndex] = claimMintTracking | mintBitmask;
}
function _checkSignatureAndUpdate(address creatorContractAddress, uint256 instanceId, bytes calldata signature, bytes32 message, bytes32 nonce, address signingAddress, address mintFor, uint256 expiration, uint16 mintCount) internal {
bytes32 expectedMessage = keccak256(abi.encodePacked("\x19Ethereum Signed Message:\n32", creatorContractAddress, instanceId, nonce, mintFor, expiration, mintCount));
require(!_usedMessages[creatorContractAddress][instanceId][nonce], "Cannot replay transaction");
address signer = message.recover(signature);
if (message != expectedMessage || signer != signingAddress) revert InvalidSignature();
if (block.timestamp > expiration) revert ExpiredSignature();
_usedMessages[creatorContractAddress][instanceId][nonce] = true;
}
function _getTotalMints(uint32 walletMax, address minter, address creatorContractAddress, uint256 instanceId) internal view returns(uint32) {
require(walletMax != 0, "Can only retrieve for non-merkle claims with walletMax");
return uint32(_mintsPerWallet[creatorContractAddress][instanceId][minter]);
}
}
文件 20 的 23: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);
}
}
}
文件 21 的 23:MerkleProof.sol
pragma solidity ^0.8.0;
library MerkleProof {
function verify(
bytes32[] memory proof,
bytes32 root,
bytes32 leaf
) internal pure returns (bool) {
return processProof(proof, leaf) == root;
}
function verifyCalldata(
bytes32[] calldata proof,
bytes32 root,
bytes32 leaf
) internal pure returns (bool) {
return processProofCalldata(proof, leaf) == root;
}
function processProof(bytes32[] memory proof, bytes32 leaf) internal pure returns (bytes32) {
bytes32 computedHash = leaf;
for (uint256 i = 0; i < proof.length; i++) {
computedHash = _hashPair(computedHash, proof[i]);
}
return computedHash;
}
function processProofCalldata(bytes32[] calldata proof, bytes32 leaf) internal pure returns (bytes32) {
bytes32 computedHash = leaf;
for (uint256 i = 0; i < proof.length; i++) {
computedHash = _hashPair(computedHash, proof[i]);
}
return computedHash;
}
function multiProofVerify(
bytes32[] memory proof,
bool[] memory proofFlags,
bytes32 root,
bytes32[] memory leaves
) internal pure returns (bool) {
return processMultiProof(proof, proofFlags, leaves) == root;
}
function multiProofVerifyCalldata(
bytes32[] calldata proof,
bool[] calldata proofFlags,
bytes32 root,
bytes32[] memory leaves
) internal pure returns (bool) {
return processMultiProofCalldata(proof, proofFlags, leaves) == root;
}
function processMultiProof(
bytes32[] memory proof,
bool[] memory proofFlags,
bytes32[] memory leaves
) internal pure returns (bytes32 merkleRoot) {
uint256 leavesLen = leaves.length;
uint256 totalHashes = proofFlags.length;
require(leavesLen + proof.length - 1 == totalHashes, "MerkleProof: invalid multiproof");
bytes32[] memory hashes = new bytes32[](totalHashes);
uint256 leafPos = 0;
uint256 hashPos = 0;
uint256 proofPos = 0;
for (uint256 i = 0; i < totalHashes; i++) {
bytes32 a = leafPos < leavesLen ? leaves[leafPos++] : hashes[hashPos++];
bytes32 b = proofFlags[i] ? leafPos < leavesLen ? leaves[leafPos++] : hashes[hashPos++] : proof[proofPos++];
hashes[i] = _hashPair(a, b);
}
if (totalHashes > 0) {
return hashes[totalHashes - 1];
} else if (leavesLen > 0) {
return leaves[0];
} else {
return proof[0];
}
}
function processMultiProofCalldata(
bytes32[] calldata proof,
bool[] calldata proofFlags,
bytes32[] memory leaves
) internal pure returns (bytes32 merkleRoot) {
uint256 leavesLen = leaves.length;
uint256 totalHashes = proofFlags.length;
require(leavesLen + proof.length - 1 == totalHashes, "MerkleProof: invalid multiproof");
bytes32[] memory hashes = new bytes32[](totalHashes);
uint256 leafPos = 0;
uint256 hashPos = 0;
uint256 proofPos = 0;
for (uint256 i = 0; i < totalHashes; i++) {
bytes32 a = leafPos < leavesLen ? leaves[leafPos++] : hashes[hashPos++];
bytes32 b = proofFlags[i] ? leafPos < leavesLen ? leaves[leafPos++] : hashes[hashPos++] : proof[proofPos++];
hashes[i] = _hashPair(a, b);
}
if (totalHashes > 0) {
return hashes[totalHashes - 1];
} else if (leavesLen > 0) {
return leaves[0];
} else {
return proof[0];
}
}
function _hashPair(bytes32 a, bytes32 b) private pure returns (bytes32) {
return a < b ? _efficientHash(a, b) : _efficientHash(b, a);
}
function _efficientHash(bytes32 a, bytes32 b) private pure returns (bytes32 value) {
assembly {
mstore(0x00, a)
mstore(0x20, b)
value := keccak256(0x00, 0x40)
}
}
}
文件 22 的 23: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);
}
}
文件 23 的 23: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);
}
}
{
"compilationTarget": {
"contracts/lazyclaim/ERC721LazyPayableClaim.sol": "ERC721LazyPayableClaim"
},
"evmVersion": "london",
"libraries": {},
"metadata": {
"bytecodeHash": "ipfs"
},
"optimizer": {
"enabled": true,
"runs": 800
},
"remappings": [
":@ensdomains/=node_modules/@ensdomains/",
":@manifoldxyz/=node_modules/@manifoldxyz/",
":@openzeppelin/=node_modules/@openzeppelin/",
":create2-helpers/=lib/create2-helpers/src/",
":create2-scripts/=lib/create2-helpers/script/",
":ds-test/=lib/forge-std/lib/ds-test/src/",
":erc4626-tests/=lib/operator-filter-registry/lib/openzeppelin-contracts/lib/erc4626-tests/",
":eth-gas-reporter/=node_modules/eth-gas-reporter/",
":forge-std/=lib/forge-std/src/",
":hardhat/=node_modules/hardhat/",
":murky/=lib/murky/src/",
":openzeppelin-contracts-upgradeable/=lib/operator-filter-registry/lib/openzeppelin-contracts-upgradeable/",
":openzeppelin-contracts/=lib/murky/lib/openzeppelin-contracts/",
":operator-filter-registry/=node_modules/operator-filter-registry/",
":truffle/=node_modules/truffle/"
]
}
[{"inputs":[{"internalType":"address","name":"initialOwner","type":"address"},{"internalType":"address","name":"delegationRegistry","type":"address"},{"internalType":"address","name":"delegationRegistryV2","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"ClaimInactive","type":"error"},{"inputs":[],"name":"ClaimNotInitialized","type":"error"},{"inputs":[],"name":"ExpiredSignature","type":"error"},{"inputs":[],"name":"FailedToTransfer","type":"error"},{"inputs":[],"name":"InvalidAirdrop","type":"error"},{"inputs":[],"name":"InvalidInput","type":"error"},{"inputs":[],"name":"InvalidInstance","type":"error"},{"inputs":[],"name":"InvalidSignature","type":"error"},{"inputs":[],"name":"InvalidStartDate","type":"error"},{"inputs":[],"name":"InvalidStorageProtocol","type":"error"},{"inputs":[],"name":"MustUseSignatureMinting","type":"error"},{"inputs":[],"name":"TokenDNE","type":"error"},{"inputs":[],"name":"TooManyRequested","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"AdminApproved","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"AdminRevoked","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"creatorContract","type":"address"},{"indexed":true,"internalType":"uint256","name":"instanceId","type":"uint256"},{"indexed":false,"internalType":"address","name":"initializer","type":"address"}],"name":"ClaimInitialized","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"creatorContract","type":"address"},{"indexed":true,"internalType":"uint256","name":"instanceId","type":"uint256"}],"name":"ClaimMint","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"creatorContract","type":"address"},{"indexed":true,"internalType":"uint256","name":"instanceId","type":"uint256"},{"indexed":false,"internalType":"uint16","name":"mintCount","type":"uint16"}],"name":"ClaimMintBatch","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"creatorContract","type":"address"},{"indexed":true,"internalType":"uint256","name":"instanceId","type":"uint256"},{"indexed":false,"internalType":"uint16","name":"mintCount","type":"uint16"},{"indexed":false,"internalType":"address","name":"proxy","type":"address"},{"indexed":false,"internalType":"address","name":"mintFor","type":"address"}],"name":"ClaimMintProxy","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"creatorContract","type":"address"},{"indexed":true,"internalType":"uint256","name":"instanceId","type":"uint256"},{"indexed":false,"internalType":"uint16","name":"mintCount","type":"uint16"},{"indexed":false,"internalType":"address","name":"proxy","type":"address"},{"indexed":false,"internalType":"address","name":"mintFor","type":"address"},{"indexed":false,"internalType":"bytes32","name":"nonce","type":"bytes32"}],"name":"ClaimMintSignature","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"creatorContract","type":"address"},{"indexed":true,"internalType":"uint256","name":"instanceId","type":"uint256"}],"name":"ClaimUpdated","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"},{"inputs":[],"name":"DELEGATION_REGISTRY","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"DELEGATION_REGISTRY_V2","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MEMBERSHIP_ADDRESS","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MINT_FEE","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MINT_FEE_MERKLE","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"creatorContractAddress","type":"address"},{"internalType":"uint256","name":"instanceId","type":"uint256"},{"internalType":"address[]","name":"recipients","type":"address[]"},{"internalType":"uint16[]","name":"amounts","type":"uint16[]"}],"name":"airdrop","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"admin","type":"address"}],"name":"approveAdmin","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"creatorContractAddress","type":"address"},{"internalType":"uint256","name":"instanceId","type":"uint256"},{"internalType":"uint32","name":"mintIndex","type":"uint32"}],"name":"checkMintIndex","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"creatorContractAddress","type":"address"},{"internalType":"uint256","name":"instanceId","type":"uint256"},{"internalType":"uint32[]","name":"mintIndices","type":"uint32[]"}],"name":"checkMintIndices","outputs":[{"internalType":"bool[]","name":"minted","type":"bool[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"creatorContractAddress","type":"address"},{"internalType":"uint256","name":"instanceId","type":"uint256"},{"internalType":"string","name":"locationChunk","type":"string"}],"name":"extendTokenURI","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"getAdmins","outputs":[{"internalType":"address[]","name":"admins","type":"address[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"creatorContractAddress","type":"address"},{"internalType":"uint256","name":"instanceId","type":"uint256"}],"name":"getClaim","outputs":[{"components":[{"internalType":"uint32","name":"total","type":"uint32"},{"internalType":"uint32","name":"totalMax","type":"uint32"},{"internalType":"uint32","name":"walletMax","type":"uint32"},{"internalType":"uint48","name":"startDate","type":"uint48"},{"internalType":"uint48","name":"endDate","type":"uint48"},{"internalType":"enum ILazyPayableClaim.StorageProtocol","name":"storageProtocol","type":"uint8"},{"internalType":"uint8","name":"contractVersion","type":"uint8"},{"internalType":"bool","name":"identical","type":"bool"},{"internalType":"bytes32","name":"merkleRoot","type":"bytes32"},{"internalType":"string","name":"location","type":"string"},{"internalType":"uint256","name":"cost","type":"uint256"},{"internalType":"address payable","name":"paymentReceiver","type":"address"},{"internalType":"address","name":"erc20","type":"address"},{"internalType":"address","name":"signingAddress","type":"address"}],"internalType":"struct IERC721LazyPayableClaim.Claim","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"creatorContractAddress","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"getClaimForToken","outputs":[{"internalType":"uint256","name":"instanceId","type":"uint256"},{"components":[{"internalType":"uint32","name":"total","type":"uint32"},{"internalType":"uint32","name":"totalMax","type":"uint32"},{"internalType":"uint32","name":"walletMax","type":"uint32"},{"internalType":"uint48","name":"startDate","type":"uint48"},{"internalType":"uint48","name":"endDate","type":"uint48"},{"internalType":"enum ILazyPayableClaim.StorageProtocol","name":"storageProtocol","type":"uint8"},{"internalType":"uint8","name":"contractVersion","type":"uint8"},{"internalType":"bool","name":"identical","type":"bool"},{"internalType":"bytes32","name":"merkleRoot","type":"bytes32"},{"internalType":"string","name":"location","type":"string"},{"internalType":"uint256","name":"cost","type":"uint256"},{"internalType":"address payable","name":"paymentReceiver","type":"address"},{"internalType":"address","name":"erc20","type":"address"},{"internalType":"address","name":"signingAddress","type":"address"}],"internalType":"struct IERC721LazyPayableClaim.Claim","name":"claim","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"minter","type":"address"},{"internalType":"address","name":"creatorContractAddress","type":"address"},{"internalType":"uint256","name":"instanceId","type":"uint256"}],"name":"getTotalMints","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"creatorContractAddress","type":"address"},{"internalType":"uint256","name":"instanceId","type":"uint256"},{"components":[{"internalType":"uint32","name":"totalMax","type":"uint32"},{"internalType":"uint32","name":"walletMax","type":"uint32"},{"internalType":"uint48","name":"startDate","type":"uint48"},{"internalType":"uint48","name":"endDate","type":"uint48"},{"internalType":"enum ILazyPayableClaim.StorageProtocol","name":"storageProtocol","type":"uint8"},{"internalType":"bool","name":"identical","type":"bool"},{"internalType":"bytes32","name":"merkleRoot","type":"bytes32"},{"internalType":"string","name":"location","type":"string"},{"internalType":"uint256","name":"cost","type":"uint256"},{"internalType":"address payable","name":"paymentReceiver","type":"address"},{"internalType":"address","name":"erc20","type":"address"},{"internalType":"address","name":"signingAddress","type":"address"}],"internalType":"struct IERC721LazyPayableClaim.ClaimParameters","name":"claimParameters","type":"tuple"}],"name":"initializeClaim","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"admin","type":"address"}],"name":"isAdmin","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"creatorContractAddress","type":"address"},{"internalType":"uint256","name":"instanceId","type":"uint256"},{"internalType":"uint32","name":"mintIndex","type":"uint32"},{"internalType":"bytes32[]","name":"merkleProof","type":"bytes32[]"},{"internalType":"address","name":"mintFor","type":"address"}],"name":"mint","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"creatorContractAddress","type":"address"},{"internalType":"uint256","name":"instanceId","type":"uint256"},{"internalType":"uint16","name":"mintCount","type":"uint16"},{"internalType":"uint32[]","name":"mintIndices","type":"uint32[]"},{"internalType":"bytes32[][]","name":"merkleProofs","type":"bytes32[][]"},{"internalType":"address","name":"mintFor","type":"address"}],"name":"mintBatch","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"creatorContractAddress","type":"address"},{"internalType":"uint256","name":"instanceId","type":"uint256"},{"internalType":"uint16","name":"mintCount","type":"uint16"},{"internalType":"uint32[]","name":"mintIndices","type":"uint32[]"},{"internalType":"bytes32[][]","name":"merkleProofs","type":"bytes32[][]"},{"internalType":"address","name":"mintFor","type":"address"}],"name":"mintProxy","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"creatorContractAddress","type":"address"},{"internalType":"uint256","name":"instanceId","type":"uint256"},{"internalType":"uint16","name":"mintCount","type":"uint16"},{"internalType":"bytes","name":"signature","type":"bytes"},{"internalType":"bytes32","name":"message","type":"bytes32"},{"internalType":"bytes32","name":"nonce","type":"bytes32"},{"internalType":"address","name":"mintFor","type":"address"},{"internalType":"uint256","name":"expiration","type":"uint256"}],"name":"mintSignature","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"admin","type":"address"}],"name":"revokeAdmin","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"membershipAddress","type":"address"}],"name":"setMembershipAddress","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":[{"internalType":"address","name":"creatorContractAddress","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"tokenURI","outputs":[{"internalType":"string","name":"uri","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"creatorContractAddress","type":"address"},{"internalType":"uint256","name":"instanceId","type":"uint256"},{"components":[{"internalType":"uint32","name":"totalMax","type":"uint32"},{"internalType":"uint32","name":"walletMax","type":"uint32"},{"internalType":"uint48","name":"startDate","type":"uint48"},{"internalType":"uint48","name":"endDate","type":"uint48"},{"internalType":"enum ILazyPayableClaim.StorageProtocol","name":"storageProtocol","type":"uint8"},{"internalType":"bool","name":"identical","type":"bool"},{"internalType":"bytes32","name":"merkleRoot","type":"bytes32"},{"internalType":"string","name":"location","type":"string"},{"internalType":"uint256","name":"cost","type":"uint256"},{"internalType":"address payable","name":"paymentReceiver","type":"address"},{"internalType":"address","name":"erc20","type":"address"},{"internalType":"address","name":"signingAddress","type":"address"}],"internalType":"struct IERC721LazyPayableClaim.ClaimParameters","name":"claimParameters","type":"tuple"}],"name":"updateClaim","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"creatorContractAddress","type":"address"},{"internalType":"uint256","name":"instanceId","type":"uint256"},{"internalType":"enum ILazyPayableClaim.StorageProtocol","name":"storageProtocol","type":"uint8"},{"internalType":"bool","name":"identical","type":"bool"},{"internalType":"string","name":"location","type":"string"}],"name":"updateTokenURIParams","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address payable","name":"receiver","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"withdraw","outputs":[],"stateMutability":"nonpayable","type":"function"}]