编译器
0.8.17+commit.8df45f5f
文件 1 的 16: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 的 16: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 的 16: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 的 16:ERC1155.sol
pragma solidity >=0.8.0;
abstract contract ERC1155 {
event TransferSingle(
address indexed operator,
address indexed from,
address indexed to,
uint256 id,
uint256 amount
);
event TransferBatch(
address indexed operator,
address indexed from,
address indexed to,
uint256[] ids,
uint256[] amounts
);
event ApprovalForAll(address indexed owner, address indexed operator, bool approved);
event URI(string value, uint256 indexed id);
mapping(address => mapping(uint256 => uint256)) public balanceOf;
mapping(address => mapping(address => bool)) public isApprovedForAll;
function uri(uint256 id) public view virtual returns (string memory);
function setApprovalForAll(address operator, bool approved) public virtual {
isApprovedForAll[msg.sender][operator] = approved;
emit ApprovalForAll(msg.sender, operator, approved);
}
function safeTransferFrom(
address from,
address to,
uint256 id,
uint256 amount,
bytes calldata data
) public virtual {
require(msg.sender == from || isApprovedForAll[from][msg.sender], "NOT_AUTHORIZED");
balanceOf[from][id] -= amount;
balanceOf[to][id] += amount;
emit TransferSingle(msg.sender, from, to, id, amount);
require(
to.code.length == 0
? to != address(0)
: ERC1155TokenReceiver(to).onERC1155Received(msg.sender, from, id, amount, data) ==
ERC1155TokenReceiver.onERC1155Received.selector,
"UNSAFE_RECIPIENT"
);
}
function safeBatchTransferFrom(
address from,
address to,
uint256[] calldata ids,
uint256[] calldata amounts,
bytes calldata data
) public virtual {
require(ids.length == amounts.length, "LENGTH_MISMATCH");
require(msg.sender == from || isApprovedForAll[from][msg.sender], "NOT_AUTHORIZED");
uint256 id;
uint256 amount;
for (uint256 i = 0; i < ids.length; ) {
id = ids[i];
amount = amounts[i];
balanceOf[from][id] -= amount;
balanceOf[to][id] += amount;
unchecked {
++i;
}
}
emit TransferBatch(msg.sender, from, to, ids, amounts);
require(
to.code.length == 0
? to != address(0)
: ERC1155TokenReceiver(to).onERC1155BatchReceived(msg.sender, from, ids, amounts, data) ==
ERC1155TokenReceiver.onERC1155BatchReceived.selector,
"UNSAFE_RECIPIENT"
);
}
function balanceOfBatch(address[] calldata owners, uint256[] calldata ids)
public
view
virtual
returns (uint256[] memory balances)
{
require(owners.length == ids.length, "LENGTH_MISMATCH");
balances = new uint256[](owners.length);
unchecked {
for (uint256 i = 0; i < owners.length; ++i) {
balances[i] = balanceOf[owners[i]][ids[i]];
}
}
}
function supportsInterface(bytes4 interfaceId) public view virtual returns (bool) {
return
interfaceId == 0x01ffc9a7 ||
interfaceId == 0xd9b67a26 ||
interfaceId == 0x0e89341c;
}
function _mint(
address to,
uint256 id,
uint256 amount,
bytes memory data
) internal virtual {
balanceOf[to][id] += amount;
emit TransferSingle(msg.sender, address(0), to, id, amount);
require(
to.code.length == 0
? to != address(0)
: ERC1155TokenReceiver(to).onERC1155Received(msg.sender, address(0), id, amount, data) ==
ERC1155TokenReceiver.onERC1155Received.selector,
"UNSAFE_RECIPIENT"
);
}
function _batchMint(
address to,
uint256[] memory ids,
uint256[] memory amounts,
bytes memory data
) internal virtual {
uint256 idsLength = ids.length;
require(idsLength == amounts.length, "LENGTH_MISMATCH");
for (uint256 i = 0; i < idsLength; ) {
balanceOf[to][ids[i]] += amounts[i];
unchecked {
++i;
}
}
emit TransferBatch(msg.sender, address(0), to, ids, amounts);
require(
to.code.length == 0
? to != address(0)
: ERC1155TokenReceiver(to).onERC1155BatchReceived(msg.sender, address(0), ids, amounts, data) ==
ERC1155TokenReceiver.onERC1155BatchReceived.selector,
"UNSAFE_RECIPIENT"
);
}
function _batchBurn(
address from,
uint256[] memory ids,
uint256[] memory amounts
) internal virtual {
uint256 idsLength = ids.length;
require(idsLength == amounts.length, "LENGTH_MISMATCH");
for (uint256 i = 0; i < idsLength; ) {
balanceOf[from][ids[i]] -= amounts[i];
unchecked {
++i;
}
}
emit TransferBatch(msg.sender, from, address(0), ids, amounts);
}
function _burn(
address from,
uint256 id,
uint256 amount
) internal virtual {
balanceOf[from][id] -= amount;
emit TransferSingle(msg.sender, from, address(0), id, amount);
}
}
abstract contract ERC1155TokenReceiver {
function onERC1155Received(
address,
address,
uint256,
uint256,
bytes calldata
) external virtual returns (bytes4) {
return ERC1155TokenReceiver.onERC1155Received.selector;
}
function onERC1155BatchReceived(
address,
address,
uint256[] calldata,
uint256[] calldata,
bytes calldata
) external virtual returns (bytes4) {
return ERC1155TokenReceiver.onERC1155BatchReceived.selector;
}
}
文件 5 的 16: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 的 16:Errors.sol
pragma solidity 0.8.17;
library Errors {
error WithdrawalPercentageWrongSize();
error WithdrawalPercentageNot100();
error WithdrawalPercentageZero();
error MintNotAvailable();
error InsufficientFunds();
error SupplyLimitReached();
error ContractCantMint();
error InvalidSignature();
error AccountAlreadyMintedMax();
error TokenDoesNotExist();
error NotOwner();
error NotAuthorized();
error MaxSupplyTooSmall();
error CanNotIncreaseMaxSupply();
error InvalidOwner();
error TokenNotTransferable();
error RoyaltiesPercentageTooHigh();
error NothingToWithdraw();
error WithdrawFailed();
error ContractLocked();
error NewSignerCantBeZero();
error PaymentTypeNotEnabled();
error WrongInputSize();
error IdBeyondSupplyLimit();
error InvalidBaseContractURL();
error InvalidBaseURI();
error MismatchLengths();
error AccountMaxMintAmountExceeded();
error InvalidMintMaxAmount();
error InvalidMintPrice();
error InsufficientBalance();
error TokenSaleClosed(uint256 tokenId);
error TokenGatedIdAlreadyUsed(uint256 tokenGatedId);
error TokenAlreadyMinted();
error MintDeadlinePassed();
error TokenGatedIdAlreadyUsedInSeason(
uint256 tokenGatedId,
uint256 seasonId
);
error TokenNotSupported();
error InvalidDeadlineLength();
error OneTokenPerPass();
error SignatureLengthMismatch();
error TokenPriceNotSet();
error DeadlineNotSet();
error InvalidDeadlines();
}
文件 7 的 16:Helpers.sol
pragma solidity 0.8.17;
import { Types } from "./Types.sol";
import "@openzeppelin/contracts/utils/cryptography/ECDSA.sol";
library Helpers {
function uint2string(uint256 value) internal pure returns (string memory) {
if (value == 0) {
return "0";
}
uint256 temp = value;
uint256 digits;
while (temp != 0) {
digits++;
temp /= 10;
}
bytes memory buffer = new bytes(digits);
while (value != 0) {
digits -= 1;
buffer[digits] = bytes1(uint8(48 + uint256(value % 10)));
value /= 10;
}
return string(buffer);
}
function _verify(
address signer,
bytes32 hash,
bytes memory signature
) internal pure returns (bool) {
return signer == ECDSA.recover(hash, signature);
}
function _hash(
Types.TokenGatedMintArgs memory args,
uint256 deadline,
uint16 seasonId
) internal view returns (bytes32) {
return
ECDSA.toEthSignedMessageHash(
keccak256(
abi.encodePacked(
msg.sender,
args.tokenId,
args.amount,
args.tokenGatedId,
seasonId,
deadline,
args.pass,
address(this)
)
)
);
}
function readableStablePrice(
uint256 stableMintPrice
) internal pure returns (string memory) {
uint256 dollars = stableMintPrice / 1000000;
uint256 cents = (stableMintPrice / 10000) % 100;
return
string(
abi.encodePacked(
Helpers.uint2string(dollars),
".",
Helpers.uint2string(cents)
)
);
}
}
文件 8 的 16: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;
}
文件 9 的 16:IERC165.sol
pragma solidity ^0.8.0;
interface IERC165 {
function supportsInterface(bytes4 interfaceId) external view returns (bool);
}
文件 10 的 16: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);
}
文件 11 的 16:InspiredByLedger.sol
pragma solidity 0.8.17;
import { ERC1155 } from "@rari-capital/solmate/src/tokens/ERC1155.sol";
import { Signable } from "../generic/Signable.sol";
import { AccessControl } from "@openzeppelin/contracts/access/AccessControl.sol";
import { Errors } from "../generic/Errors.sol";
import { Helpers } from "../Helpers.sol";
import { Types } from "../Types.sol";
import { IERC2981 } from "@openzeppelin/contracts/interfaces/IERC2981.sol";
import { IERC165 } from "@openzeppelin/contracts/utils/introspection/IERC165.sol";
contract InspiredByLedger is ERC1155, Signable, IERC2981, AccessControl {
event FeaturesEnabled(Feature[] features);
event FeatureStatusChanged(Feature features, bool status);
event DefaultMaxSupplyChanged(uint256 defaultMaxSupply);
event MaxSupplyPerTokenChanged(uint256[] tokenIds, uint256[] maxSupplies);
event SeasonUpdated(uint16 seasonId);
event ETHMintPricePerTokenChanged(uint256[] tokenIds, uint256[] prices);
event TokenURIChanged(uint256 tokenId, string tokenURI);
event TokenTypesChanged(address[] tokens, TokenType[] tokenTypes);
event TokenDeadlinesChanged(uint256[] tokenIds, uint256[][] deadlines);
event ContractURIChanged(string contractUri);
event DefaultMaxMintChanged(uint256 defaultMaxMint);
event MaxMintPerTokenChanged(uint256[] tokenIds, uint256[] maxMints);
event DefaultRoyaltyReceiverChanged(address defaultRoyaltyReceiver);
event RoyaltiesInfoUpdated(
uint256 tokenId,
address royaltyReceiver,
uint256 percentage
);
event TipReceived(address indexed sender, uint256 amount);
event TokenInitialized(
uint256 tokenId,
uint256 maxSupply,
uint256 maxMintPerToken,
uint256 mintPrice,
address withdrawalAddress,
address royaltyReceiver,
uint256 royaltiesPercentage,
string tokenURI,
uint256[2] deadlines
);
event WithdrawalAddressesChanged(
uint256 tokenId,
address withdrawalAddress
);
event DefaultWithdrawalAddressChanged(address defaultWithdrawalAddress);
enum Feature {
MINTER_CAN_MINT,
ETH_WITH_SIGN,
ETH_PUBLIC
}
enum TokenType {
NONE,
INFINITY,
GENESIS
}
bytes32 public constant BURNER_ROLE = keccak256("BURNER_ROLE");
bytes32 public constant MINTER_ROLE = keccak256("MINTER_ROLE");
string public name;
string public symbol;
address public defaultWithdrawalAddress;
mapping(uint256 => address) public withdrawalAddresses;
uint256 private featureEnabledBitMap;
string private baseContractURI;
mapping(uint256 => string) private tokenURIs;
mapping(uint256 => uint256) public mintPrices;
uint256 public defaultMaxSupply = 100000;
mapping(uint256 => uint256) private maxSupplyPerToken;
mapping(uint256 => uint256) public currentSupplyPerToken;
mapping(address => mapping(uint256 => uint256)) public minted;
uint16 public seasonId;
mapping(address => TokenType) public tokenTypes;
mapping(uint256 => uint256[]) public tokenDeadlines;
uint256 public defaultMaxMint = 1000;
mapping(uint256 => uint256) public maxMintPerToken;
mapping(address => mapping(uint256 => mapping(address => mapping(uint256 => bool))))
public usedInfinityPasses;
mapping(address => mapping(uint256 => mapping(uint256 => mapping(uint256 => bool))))
public usedGenesisPasses;
mapping(uint256 => address) public royaltiesReceivers;
address public defaultRoyaltyReceiver;
mapping(uint256 => uint256) private royaltiesPercentage;
mapping(uint256 => uint256) public tokenEscrow;
uint256 public tips;
modifier featureRequired(Feature feature_) {
if (!isFeatureEnabled(feature_)) revert Errors.MintNotAvailable();
_;
}
modifier onlyWithinDeadline(uint256[] calldata deadlines) {
for (uint256 i; i < deadlines.length; ) {
if (block.timestamp > deadlines[i]) {
revert Errors.MintDeadlinePassed();
}
unchecked {
++i;
}
}
_;
}
function checkTokenValidity(uint256 tokenId) internal view {
uint256[] memory deadlines = tokenDeadlines[tokenId];
if (deadlines.length == 0) {
revert Errors.DeadlineNotSet();
}
if (
block.timestamp < tokenDeadlines[tokenId][0] ||
block.timestamp > tokenDeadlines[tokenId][1]
) {
revert Errors.TokenSaleClosed(tokenId);
}
}
function onlyMatchingLengths(uint256 a, uint256 b) internal pure {
if (a != b) revert Errors.MismatchLengths();
}
constructor(
string memory _name,
string memory _symbol,
string memory _baseContractURI,
address _defaultRoyaltyReceiver,
address _defaultWithdrawalAddress
) {
_setupRole(DEFAULT_ADMIN_ROLE, msg.sender);
name = _name;
symbol = _symbol;
baseContractURI = _baseContractURI;
defaultRoyaltyReceiver = _defaultRoyaltyReceiver;
defaultWithdrawalAddress = _defaultWithdrawalAddress;
}
receive() external payable virtual {
tips += msg.value;
emit TipReceived(msg.sender, msg.value);
}
fallback() external payable virtual {
tips += msg.value;
emit TipReceived(msg.sender, msg.value);
}
function minterMint(
address to,
uint256 tokenId,
uint256 amount,
bytes calldata data
) external onlyRole(MINTER_ROLE) featureRequired(Feature.MINTER_CAN_MINT) {
_mintLogic(to, tokenId, amount, data, false);
}
function minterMintSign(
Types.TokenGatedMintArgs[] calldata args,
bytes[] calldata signatures,
uint256[] calldata deadlines,
bytes calldata data
)
external
onlyRole(MINTER_ROLE)
featureRequired(Feature.MINTER_CAN_MINT)
featureRequired(Feature.ETH_WITH_SIGN)
onlyWithinDeadline(deadlines)
{
_mintSignLogic(args, signatures, deadlines, data);
}
function mint(
uint256 tokenId,
uint256 amount,
bytes calldata data
) external payable featureRequired(Feature.ETH_PUBLIC) {
checkTokenValidity(tokenId);
uint256 totalPrice = priceETH(tokenId, amount);
if (msg.value < totalPrice) {
revert Errors.InsufficientFunds();
}
tokenEscrow[tokenId] += totalPrice;
if (msg.value > totalPrice) {
tips += msg.value - totalPrice;
}
_mintLogic(msg.sender, tokenId, amount, data, false);
}
function mintSign(
Types.TokenGatedMintArgs[] calldata args,
bytes[] calldata signatures,
uint256[] calldata deadlines,
bytes calldata data
)
external
payable
featureRequired(Feature.ETH_WITH_SIGN)
onlyWithinDeadline(deadlines)
{
Types.TokenGatedMintArgs[] memory tmpArgs = args;
uint256 totalCost = 0;
for (uint256 i; i < tmpArgs.length; ) {
uint256 currentPrice = priceETH(
tmpArgs[i].tokenId,
tmpArgs[i].amount
);
tokenEscrow[tmpArgs[i].tokenId] += currentPrice;
totalCost += currentPrice;
unchecked {
++i;
}
}
if (msg.value < totalCost) revert Errors.InsufficientFunds();
if (msg.value > totalCost) {
tips += msg.value - totalCost;
}
_mintSignLogic(args, signatures, deadlines, data);
}
function burn(
uint256 tokenId,
uint256 amount,
address tokenOwner
) external onlyRole(BURNER_ROLE) {
if (balanceOf[tokenOwner][tokenId] < amount) {
revert Errors.InsufficientBalance();
}
super._burn(tokenOwner, tokenId, amount);
unchecked {
minted[tokenOwner][tokenId] -= amount;
currentSupplyPerToken[tokenId] -= amount;
}
}
function withdrawAll() external onlyOwner {
uint256 balance = tips;
if (tips == 0) revert Errors.NothingToWithdraw();
tips = 0;
(defaultWithdrawalAddress.call{ value: balance }(""));
}
function withdrawPerToken(uint256 tokenId) external {
if (msg.sender != withdrawalAddresses[tokenId])
revert Errors.NotAuthorized();
uint256 balance = tokenEscrow[tokenId];
if (balance == 0) revert Errors.NothingToWithdraw();
tokenEscrow[tokenId] = 0;
(withdrawalAddresses[tokenId].call{ value: balance }(""));
}
function initializeToken(
uint256 tokenId_,
uint256 maxSupply_,
uint256 maxMintPerToken_,
uint256 mintPrice_,
address withdrawalAddresses_,
address royaltyReceiver_,
uint256 royaltiesPercentage_,
string memory tokenURI_,
uint256[2] memory deadlines_
) external onlyOwner {
if (deadlines_[0] > deadlines_[1]) {
revert Errors.InvalidDeadlines();
}
if (royaltiesPercentage_ > 10000) {
revert Errors.RoyaltiesPercentageTooHigh();
}
maxSupplyPerToken[tokenId_] = maxSupply_;
maxMintPerToken[tokenId_] = maxMintPerToken_;
mintPrices[tokenId_] = mintPrice_;
withdrawalAddresses[tokenId_] = withdrawalAddresses_;
royaltiesReceivers[tokenId_] = royaltyReceiver_;
royaltiesPercentage[tokenId_] = royaltiesPercentage_;
tokenURIs[tokenId_] = tokenURI_;
tokenDeadlines[tokenId_] = deadlines_;
emit TokenInitialized(
tokenId_,
maxSupply_,
maxMintPerToken_,
mintPrice_,
withdrawalAddresses_,
royaltyReceiver_,
royaltiesPercentage_,
tokenURI_,
deadlines_
);
}
function setEnabledFeatures(Feature[] memory features) external onlyOwner {
uint256 featuresBitMap = 0;
for (uint256 i = 0; i < features.length; i++) {
uint256 featureIndex = uint256(features[i]);
featuresBitMap = featuresBitMap | (1 << featureIndex);
}
featureEnabledBitMap = featuresBitMap;
emit FeaturesEnabled(features);
}
function setFeatureStatus(Feature feature, bool status) external onlyOwner {
uint256 featureIndex = uint256(feature);
if (status == true) {
featureEnabledBitMap = featureEnabledBitMap | (1 << featureIndex);
} else {
featureEnabledBitMap = featureEnabledBitMap & ~(1 << featureIndex);
}
emit FeatureStatusChanged(feature, status);
}
function setMaxSupplyPerToken(
uint256[] calldata tokenIds_,
uint256[] calldata maxSupplies_
) external onlyOwner {
onlyMatchingLengths(tokenIds_.length, maxSupplies_.length);
for (uint256 i; i < tokenIds_.length; ) {
maxSupplyPerToken[tokenIds_[i]] = maxSupplies_[i];
unchecked {
i++;
}
}
emit MaxSupplyPerTokenChanged(tokenIds_, maxSupplies_);
}
function updateSeason() external onlyOwner {
++seasonId;
emit SeasonUpdated(seasonId);
}
function setETHMintPricePerToken(
uint256[] calldata tokenIds_,
uint256[] calldata mintPrices_
) external onlyOwner {
onlyMatchingLengths(tokenIds_.length, mintPrices_.length);
for (uint256 i; i < tokenIds_.length; ) {
mintPrices[tokenIds_[i]] = mintPrices_[i];
unchecked {
i++;
}
}
emit ETHMintPricePerTokenChanged(tokenIds_, mintPrices_);
}
function setTokenURI(
uint256 tokenId_,
string calldata uri_
) external onlyOwner {
if (bytes(uri_).length == 0) {
revert Errors.InvalidBaseURI();
}
tokenURIs[tokenId_] = uri_;
emit TokenURIChanged(tokenId_, uri_);
}
function setTokenTypes(
address[] calldata addresses_,
TokenType[] calldata types_
) external onlyOwner {
onlyMatchingLengths(addresses_.length, types_.length);
for (uint256 i; i < addresses_.length; ) {
tokenTypes[addresses_[i]] = types_[i];
unchecked {
i++;
}
}
emit TokenTypesChanged(addresses_, types_);
}
function setTokenDeadlines(
uint256[] calldata tokenIds_,
uint256[][] calldata deadlines_
) external onlyOwner {
onlyMatchingLengths(tokenIds_.length, deadlines_.length);
for (uint256 i; i < tokenIds_.length; ) {
if (deadlines_[i].length != 2) {
revert Errors.InvalidDeadlineLength();
}
tokenDeadlines[tokenIds_[i]] = deadlines_[i];
unchecked {
i++;
}
}
emit TokenDeadlinesChanged(tokenIds_, deadlines_);
}
function setContractURI(
string calldata baseContractURI_
) external onlyOwner {
if (bytes(baseContractURI_).length == 0)
revert Errors.InvalidBaseContractURL();
baseContractURI = baseContractURI_;
emit ContractURIChanged(baseContractURI_);
}
function setDefaultMaxMint(uint256 defaultMaxMint_) external onlyOwner {
defaultMaxMint = defaultMaxMint_;
emit DefaultMaxMintChanged(defaultMaxMint_);
}
function setMaxMintPerToken(
uint256[] calldata tokenIds_,
uint256[] calldata maxMints_
) external onlyOwner {
onlyMatchingLengths(tokenIds_.length, maxMints_.length);
for (uint256 i; i < tokenIds_.length; ) {
maxMintPerToken[tokenIds_[i]] = maxMints_[i];
unchecked {
i++;
}
}
emit MaxMintPerTokenChanged(tokenIds_, maxMints_);
}
function setDefaultMaxSupply(uint256 defaultMaxSupply_) external onlyOwner {
defaultMaxSupply = defaultMaxSupply_;
emit DefaultMaxSupplyChanged(defaultMaxSupply_);
}
function setDefaultRoyaltyReceiver(
address defaultRoyaltyReceiver_
) external onlyOwner {
defaultRoyaltyReceiver = defaultRoyaltyReceiver_;
emit DefaultRoyaltyReceiverChanged(defaultRoyaltyReceiver_);
}
function setRoyaltiesInfo(
uint256 tokenId,
address royaltyReceiver_,
uint256 royaltiesPercentage_
) external onlyOwner {
if (royaltiesPercentage_ > 10000) {
revert Errors.RoyaltiesPercentageTooHigh();
}
royaltiesPercentage[tokenId] = royaltiesPercentage_;
royaltiesReceivers[tokenId] = royaltyReceiver_;
emit RoyaltiesInfoUpdated(
tokenId,
royaltyReceiver_,
royaltiesPercentage_
);
}
function setDefaultWithdrawalAddress(
address defaultWithdrawalAddress_
) external onlyOwner {
defaultWithdrawalAddress = defaultWithdrawalAddress_;
emit DefaultWithdrawalAddressChanged(defaultWithdrawalAddress_);
}
function setWithdrawalAddressPerToken(
uint256 tokenId,
address withdrawalAddress_
) external onlyOwner {
withdrawalAddresses[tokenId] = withdrawalAddress_;
emit WithdrawalAddressesChanged(tokenId, withdrawalAddress_);
}
function contractURI() external view returns (string memory) {
return baseContractURI;
}
function totalPriceETH(
uint256[] memory tokenIds,
uint256[] memory amounts
) public view returns (uint totalPrice) {
for (uint i; i < tokenIds.length; ) {
totalPrice += priceETH(tokenIds[i], amounts[i]);
unchecked {
i++;
}
}
}
function priceETH(
uint256 tokenId,
uint256 amount
) public view returns (uint256) {
return mintPrices[tokenId] * amount;
}
function isFeatureEnabled(Feature feature) public view returns (bool) {
return (featureEnabledBitMap & (1 << uint256(feature))) != 0;
}
function uri(
uint256 tokenId_
) public view override returns (string memory) {
return tokenURIs[tokenId_];
}
function supportsInterface(
bytes4 interfaceId
)
public
view
virtual
override(ERC1155, AccessControl, IERC165)
returns (bool)
{
return
ERC1155.supportsInterface(interfaceId) ||
AccessControl.supportsInterface(interfaceId) ||
interfaceId == type(IERC2981).interfaceId;
}
function royaltyInfo(
uint256 tokenId,
uint256 salePrice
) external view override returns (address receiver, uint256 royaltyAmount) {
receiver = royaltiesReceivers[tokenId] != address(0)
? royaltiesReceivers[tokenId]
: defaultRoyaltyReceiver;
return (receiver, (salePrice * royaltiesPercentage[tokenId]) / 10000);
}
function getMaxMintPerToken(uint256 tokenId) public view returns (uint256) {
return
maxMintPerToken[tokenId] > 0
? maxMintPerToken[tokenId]
: defaultMaxMint;
}
function getMaxSupplyPerToken(
uint256 tokenId
) public view returns (uint256) {
return
maxSupplyPerToken[tokenId] > 0
? maxSupplyPerToken[tokenId]
: defaultMaxSupply;
}
function _mintSignLogic(
Types.TokenGatedMintArgs[] calldata args,
bytes[] calldata signatures,
uint256[] calldata deadlines,
bytes calldata data
) private {
Types.TokenGatedMintArgs[] memory tmpArgsArr = args;
uint256[] memory tmpDeadlines = deadlines;
bytes[] memory tmpSignatures = signatures;
bytes memory tmpData = data;
onlyMatchingLengths(tmpArgsArr.length, tmpSignatures.length);
onlyMatchingLengths(tmpSignatures.length, tmpDeadlines.length);
for (uint i = 0; i < tmpArgsArr.length; ) {
if (
tokenTypes[tmpArgsArr[i].pass] != TokenType.GENESIS &&
tokenTypes[tmpArgsArr[i].pass] != TokenType.INFINITY
) {
revert Errors.TokenNotSupported();
}
Types.TokenGatedMintArgs memory tmpArgs = tmpArgsArr[i];
checkTokenValidity(tmpArgs.tokenId);
if (
!Helpers._verify(
signer(),
Helpers._hash(tmpArgs, tmpDeadlines[i], seasonId),
tmpSignatures[i]
)
) revert Errors.InvalidSignature();
if (tokenTypes[tmpArgs.pass] == TokenType.GENESIS) {
_processGenesisPass(
tmpArgs.pass,
tmpArgs.tokenGatedId,
tmpArgs.tokenId
);
} else {
_processInfinityPass(tmpArgs.pass, tmpArgs.tokenGatedId);
}
_mintLogic(
msg.sender,
tmpArgs.tokenId,
tmpArgs.amount,
tmpData,
true
);
unchecked {
++i;
}
}
}
function _processGenesisPass(
address pass,
uint256 tokenGatedId,
uint256 tokenId
) private {
if (usedGenesisPasses[pass][tokenGatedId][seasonId][tokenId]) {
revert Errors.TokenGatedIdAlreadyUsed(tokenGatedId);
}
usedGenesisPasses[pass][tokenGatedId][seasonId][tokenId] = true;
}
function _processInfinityPass(address pass, uint256 tokenGatedId) private {
if (usedInfinityPasses[pass][tokenGatedId][msg.sender][seasonId]) {
revert Errors.TokenGatedIdAlreadyUsedInSeason(
tokenGatedId,
seasonId
);
}
usedInfinityPasses[pass][tokenGatedId][msg.sender][seasonId] = true;
}
function _mintLogic(
address to,
uint256 tokenId,
uint256 amount,
bytes memory data,
bool isTokenGated
) private {
if (
currentSupplyPerToken[tokenId] + amount >
getMaxSupplyPerToken(tokenId)
) {
revert Errors.SupplyLimitReached();
}
if (
!isTokenGated &&
minted[to][tokenId] + amount > getMaxMintPerToken(tokenId)
) {
revert Errors.AccountAlreadyMintedMax();
}
minted[to][tokenId] += amount;
currentSupplyPerToken[tokenId] += amount;
super._mint(to, tokenId, amount, data);
}
}
文件 12 的 16: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);
}
}
}
文件 13 的 16:Owned.sol
pragma solidity >=0.8.0;
abstract contract Owned {
event OwnerUpdated(address indexed user, address indexed newOwner);
address public owner;
modifier onlyOwner() virtual {
require(msg.sender == owner, "UNAUTHORIZED");
_;
}
constructor(address _owner) {
owner = _owner;
emit OwnerUpdated(address(0), _owner);
}
function setOwner(address newOwner) public virtual onlyOwner {
owner = newOwner;
emit OwnerUpdated(msg.sender, newOwner);
}
}
文件 14 的 16:Signable.sol
pragma solidity 0.8.17;
import "@rari-capital/solmate/src/auth/Owned.sol";
abstract contract Signable is Owned {
error NewSignerCantBeZero();
address private _signer;
constructor() Owned(msg.sender) {
_signer = msg.sender;
}
function signer() public view returns (address) {
return _signer;
}
function transferSigner(address newSigner) external onlyOwner {
if (newSigner == address(0)) revert NewSignerCantBeZero();
_signer = newSigner;
}
}
文件 15 的 16: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);
}
}
文件 16 的 16:Types.sol
pragma solidity 0.8.17;
library Types {
struct TokenGatedMintArgs {
uint256 tokenId;
uint256 amount;
uint256 tokenGatedId;
address pass;
}
struct MintArgs {
uint256[] tokenIds;
uint256[] amounts;
}
}
{
"compilationTarget": {
"sol/src/inspired-by-ledger/InspiredByLedger.sol": "InspiredByLedger"
},
"evmVersion": "london",
"libraries": {},
"metadata": {
"bytecodeHash": "ipfs"
},
"optimizer": {
"enabled": true,
"runs": 200
},
"remappings": []
}
[{"inputs":[{"internalType":"string","name":"_name","type":"string"},{"internalType":"string","name":"_symbol","type":"string"},{"internalType":"string","name":"_baseContractURI","type":"string"},{"internalType":"address","name":"_defaultRoyaltyReceiver","type":"address"},{"internalType":"address","name":"_defaultWithdrawalAddress","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"AccountAlreadyMintedMax","type":"error"},{"inputs":[],"name":"DeadlineNotSet","type":"error"},{"inputs":[],"name":"InsufficientBalance","type":"error"},{"inputs":[],"name":"InsufficientFunds","type":"error"},{"inputs":[],"name":"InvalidBaseContractURL","type":"error"},{"inputs":[],"name":"InvalidBaseURI","type":"error"},{"inputs":[],"name":"InvalidDeadlineLength","type":"error"},{"inputs":[],"name":"InvalidDeadlines","type":"error"},{"inputs":[],"name":"InvalidSignature","type":"error"},{"inputs":[],"name":"MintDeadlinePassed","type":"error"},{"inputs":[],"name":"MintNotAvailable","type":"error"},{"inputs":[],"name":"MismatchLengths","type":"error"},{"inputs":[],"name":"NewSignerCantBeZero","type":"error"},{"inputs":[],"name":"NotAuthorized","type":"error"},{"inputs":[],"name":"NothingToWithdraw","type":"error"},{"inputs":[],"name":"RoyaltiesPercentageTooHigh","type":"error"},{"inputs":[],"name":"SupplyLimitReached","type":"error"},{"inputs":[{"internalType":"uint256","name":"tokenGatedId","type":"uint256"}],"name":"TokenGatedIdAlreadyUsed","type":"error"},{"inputs":[{"internalType":"uint256","name":"tokenGatedId","type":"uint256"},{"internalType":"uint256","name":"seasonId","type":"uint256"}],"name":"TokenGatedIdAlreadyUsedInSeason","type":"error"},{"inputs":[],"name":"TokenNotSupported","type":"error"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"TokenSaleClosed","type":"error"},{"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":"string","name":"contractUri","type":"string"}],"name":"ContractURIChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"defaultMaxMint","type":"uint256"}],"name":"DefaultMaxMintChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"defaultMaxSupply","type":"uint256"}],"name":"DefaultMaxSupplyChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"defaultRoyaltyReceiver","type":"address"}],"name":"DefaultRoyaltyReceiverChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"defaultWithdrawalAddress","type":"address"}],"name":"DefaultWithdrawalAddressChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256[]","name":"tokenIds","type":"uint256[]"},{"indexed":false,"internalType":"uint256[]","name":"prices","type":"uint256[]"}],"name":"ETHMintPricePerTokenChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"enum InspiredByLedger.Feature","name":"features","type":"uint8"},{"indexed":false,"internalType":"bool","name":"status","type":"bool"}],"name":"FeatureStatusChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"enum InspiredByLedger.Feature[]","name":"features","type":"uint8[]"}],"name":"FeaturesEnabled","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256[]","name":"tokenIds","type":"uint256[]"},{"indexed":false,"internalType":"uint256[]","name":"maxMints","type":"uint256[]"}],"name":"MaxMintPerTokenChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256[]","name":"tokenIds","type":"uint256[]"},{"indexed":false,"internalType":"uint256[]","name":"maxSupplies","type":"uint256[]"}],"name":"MaxSupplyPerTokenChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnerUpdated","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":false,"internalType":"uint256","name":"tokenId","type":"uint256"},{"indexed":false,"internalType":"address","name":"royaltyReceiver","type":"address"},{"indexed":false,"internalType":"uint256","name":"percentage","type":"uint256"}],"name":"RoyaltiesInfoUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint16","name":"seasonId","type":"uint16"}],"name":"SeasonUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"sender","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"TipReceived","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256[]","name":"tokenIds","type":"uint256[]"},{"indexed":false,"internalType":"uint256[][]","name":"deadlines","type":"uint256[][]"}],"name":"TokenDeadlinesChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"tokenId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"maxSupply","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"maxMintPerToken","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"mintPrice","type":"uint256"},{"indexed":false,"internalType":"address","name":"withdrawalAddress","type":"address"},{"indexed":false,"internalType":"address","name":"royaltyReceiver","type":"address"},{"indexed":false,"internalType":"uint256","name":"royaltiesPercentage","type":"uint256"},{"indexed":false,"internalType":"string","name":"tokenURI","type":"string"},{"indexed":false,"internalType":"uint256[2]","name":"deadlines","type":"uint256[2]"}],"name":"TokenInitialized","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address[]","name":"tokens","type":"address[]"},{"indexed":false,"internalType":"enum InspiredByLedger.TokenType[]","name":"tokenTypes","type":"uint8[]"}],"name":"TokenTypesChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"tokenId","type":"uint256"},{"indexed":false,"internalType":"string","name":"tokenURI","type":"string"}],"name":"TokenURIChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"operator","type":"address"},{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256[]","name":"ids","type":"uint256[]"},{"indexed":false,"internalType":"uint256[]","name":"amounts","type":"uint256[]"}],"name":"TransferBatch","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"operator","type":"address"},{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"id","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"TransferSingle","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"string","name":"value","type":"string"},{"indexed":true,"internalType":"uint256","name":"id","type":"uint256"}],"name":"URI","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"tokenId","type":"uint256"},{"indexed":false,"internalType":"address","name":"withdrawalAddress","type":"address"}],"name":"WithdrawalAddressesChanged","type":"event"},{"stateMutability":"payable","type":"fallback"},{"inputs":[],"name":"BURNER_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"DEFAULT_ADMIN_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":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address[]","name":"owners","type":"address[]"},{"internalType":"uint256[]","name":"ids","type":"uint256[]"}],"name":"balanceOfBatch","outputs":[{"internalType":"uint256[]","name":"balances","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"address","name":"tokenOwner","type":"address"}],"name":"burn","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"contractURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"currentSupplyPerToken","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"defaultMaxMint","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"defaultMaxSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"defaultRoyaltyReceiver","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"defaultWithdrawalAddress","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"getMaxMintPerToken","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"getMaxSupplyPerToken","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"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":"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":"uint256","name":"tokenId_","type":"uint256"},{"internalType":"uint256","name":"maxSupply_","type":"uint256"},{"internalType":"uint256","name":"maxMintPerToken_","type":"uint256"},{"internalType":"uint256","name":"mintPrice_","type":"uint256"},{"internalType":"address","name":"withdrawalAddresses_","type":"address"},{"internalType":"address","name":"royaltyReceiver_","type":"address"},{"internalType":"uint256","name":"royaltiesPercentage_","type":"uint256"},{"internalType":"string","name":"tokenURI_","type":"string"},{"internalType":"uint256[2]","name":"deadlines_","type":"uint256[2]"}],"name":"initializeToken","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"address","name":"","type":"address"}],"name":"isApprovedForAll","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"enum InspiredByLedger.Feature","name":"feature","type":"uint8"}],"name":"isFeatureEnabled","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"maxMintPerToken","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"mint","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"mintPrices","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"components":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"uint256","name":"tokenGatedId","type":"uint256"},{"internalType":"address","name":"pass","type":"address"}],"internalType":"struct Types.TokenGatedMintArgs[]","name":"args","type":"tuple[]"},{"internalType":"bytes[]","name":"signatures","type":"bytes[]"},{"internalType":"uint256[]","name":"deadlines","type":"uint256[]"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"mintSign","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"}],"name":"minted","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"minterMint","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"uint256","name":"tokenGatedId","type":"uint256"},{"internalType":"address","name":"pass","type":"address"}],"internalType":"struct Types.TokenGatedMintArgs[]","name":"args","type":"tuple[]"},{"internalType":"bytes[]","name":"signatures","type":"bytes[]"},{"internalType":"uint256[]","name":"deadlines","type":"uint256[]"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"minterMintSign","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"priceETH","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"renounceRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"revokeRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"royaltiesReceivers","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"uint256","name":"salePrice","type":"uint256"}],"name":"royaltyInfo","outputs":[{"internalType":"address","name":"receiver","type":"address"},{"internalType":"uint256","name":"royaltyAmount","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256[]","name":"ids","type":"uint256[]"},{"internalType":"uint256[]","name":"amounts","type":"uint256[]"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"safeBatchTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"id","type":"uint256"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"seasonId","outputs":[{"internalType":"uint16","name":"","type":"uint16"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"operator","type":"address"},{"internalType":"bool","name":"approved","type":"bool"}],"name":"setApprovalForAll","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"baseContractURI_","type":"string"}],"name":"setContractURI","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"defaultMaxMint_","type":"uint256"}],"name":"setDefaultMaxMint","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"defaultMaxSupply_","type":"uint256"}],"name":"setDefaultMaxSupply","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"defaultRoyaltyReceiver_","type":"address"}],"name":"setDefaultRoyaltyReceiver","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"defaultWithdrawalAddress_","type":"address"}],"name":"setDefaultWithdrawalAddress","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"tokenIds_","type":"uint256[]"},{"internalType":"uint256[]","name":"mintPrices_","type":"uint256[]"}],"name":"setETHMintPricePerToken","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"enum InspiredByLedger.Feature[]","name":"features","type":"uint8[]"}],"name":"setEnabledFeatures","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"enum InspiredByLedger.Feature","name":"feature","type":"uint8"},{"internalType":"bool","name":"status","type":"bool"}],"name":"setFeatureStatus","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"tokenIds_","type":"uint256[]"},{"internalType":"uint256[]","name":"maxMints_","type":"uint256[]"}],"name":"setMaxMintPerToken","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"tokenIds_","type":"uint256[]"},{"internalType":"uint256[]","name":"maxSupplies_","type":"uint256[]"}],"name":"setMaxSupplyPerToken","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"setOwner","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"address","name":"royaltyReceiver_","type":"address"},{"internalType":"uint256","name":"royaltiesPercentage_","type":"uint256"}],"name":"setRoyaltiesInfo","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"tokenIds_","type":"uint256[]"},{"internalType":"uint256[][]","name":"deadlines_","type":"uint256[][]"}],"name":"setTokenDeadlines","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address[]","name":"addresses_","type":"address[]"},{"internalType":"enum InspiredByLedger.TokenType[]","name":"types_","type":"uint8[]"}],"name":"setTokenTypes","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId_","type":"uint256"},{"internalType":"string","name":"uri_","type":"string"}],"name":"setTokenURI","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"address","name":"withdrawalAddress_","type":"address"}],"name":"setWithdrawalAddressPerToken","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"signer","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"tips","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint256","name":"","type":"uint256"}],"name":"tokenDeadlines","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"tokenEscrow","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"tokenTypes","outputs":[{"internalType":"enum InspiredByLedger.TokenType","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"tokenIds","type":"uint256[]"},{"internalType":"uint256[]","name":"amounts","type":"uint256[]"}],"name":"totalPriceETH","outputs":[{"internalType":"uint256","name":"totalPrice","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"newSigner","type":"address"}],"name":"transferSigner","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"updateSeason","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId_","type":"uint256"}],"name":"uri","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint256","name":"","type":"uint256"}],"name":"usedGenesisPasses","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"}],"name":"usedInfinityPasses","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"withdrawAll","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"withdrawPerToken","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"withdrawalAddresses","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"stateMutability":"payable","type":"receive"}]