编译器
0.8.22+commit.4fc1097e
文件 1 的 28:Base64.sol
pragma solidity ^0.8.20;
library Base64 {
string internal constant _TABLE = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
function encode(bytes memory data) internal pure returns (string memory) {
if (data.length == 0) return "";
string memory table = _TABLE;
string memory result = new string(4 * ((data.length + 2) / 3));
assembly {
let tablePtr := add(table, 1)
let resultPtr := add(result, 0x20)
let dataPtr := data
let endPtr := add(data, mload(data))
let afterPtr := add(endPtr, 0x20)
let afterCache := mload(afterPtr)
mstore(afterPtr, 0x00)
for {
} lt(dataPtr, endPtr) {
} {
dataPtr := add(dataPtr, 3)
let input := mload(dataPtr)
mstore8(resultPtr, mload(add(tablePtr, and(shr(18, input), 0x3F))))
resultPtr := add(resultPtr, 1)
mstore8(resultPtr, mload(add(tablePtr, and(shr(12, input), 0x3F))))
resultPtr := add(resultPtr, 1)
mstore8(resultPtr, mload(add(tablePtr, and(shr(6, input), 0x3F))))
resultPtr := add(resultPtr, 1)
mstore8(resultPtr, mload(add(tablePtr, and(input, 0x3F))))
resultPtr := add(resultPtr, 1)
}
mstore(afterPtr, afterCache)
switch mod(mload(data), 3)
case 1 {
mstore8(sub(resultPtr, 1), 0x3d)
mstore8(sub(resultPtr, 2), 0x3d)
}
case 2 {
mstore8(sub(resultPtr, 1), 0x3d)
}
}
return result;
}
}
文件 2 的 28:Clones.sol
pragma solidity ^0.8.20;
library Clones {
error ERC1167FailedCreateClone();
function clone(address implementation) internal returns (address instance) {
assembly {
mstore(0x00, or(shr(0xe8, shl(0x60, implementation)), 0x3d602d80600a3d3981f3363d3d373d3d3d363d73000000))
mstore(0x20, or(shl(0x78, implementation), 0x5af43d82803e903d91602b57fd5bf3))
instance := create(0, 0x09, 0x37)
}
if (instance == address(0)) {
revert ERC1167FailedCreateClone();
}
}
function cloneDeterministic(address implementation, bytes32 salt) internal returns (address instance) {
assembly {
mstore(0x00, or(shr(0xe8, shl(0x60, implementation)), 0x3d602d80600a3d3981f3363d3d373d3d3d363d73000000))
mstore(0x20, or(shl(0x78, implementation), 0x5af43d82803e903d91602b57fd5bf3))
instance := create2(0, 0x09, 0x37, salt)
}
if (instance == address(0)) {
revert ERC1167FailedCreateClone();
}
}
function predictDeterministicAddress(
address implementation,
bytes32 salt,
address deployer
) internal pure returns (address predicted) {
assembly {
let ptr := mload(0x40)
mstore(add(ptr, 0x38), deployer)
mstore(add(ptr, 0x24), 0x5af43d82803e903d91602b57fd5bf3ff)
mstore(add(ptr, 0x14), implementation)
mstore(ptr, 0x3d602d80600a3d3981f3363d3d373d3d3d363d73)
mstore(add(ptr, 0x58), salt)
mstore(add(ptr, 0x78), keccak256(add(ptr, 0x0c), 0x37))
predicted := keccak256(add(ptr, 0x43), 0x55)
}
}
function predictDeterministicAddress(
address implementation,
bytes32 salt
) internal view returns (address predicted) {
return predictDeterministicAddress(implementation, salt, address(this));
}
}
文件 3 的 28:Context.sol
pragma solidity ^0.8.20;
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes calldata) {
return msg.data;
}
function _contextSuffixLength() internal view virtual returns (uint256) {
return 0;
}
}
文件 4 的 28:ContextUpgradeable.sol
pragma solidity ^0.8.20;
import {Initializable} from "../proxy/utils/Initializable.sol";
abstract contract ContextUpgradeable is Initializable {
function __Context_init() internal onlyInitializing {
}
function __Context_init_unchained() internal onlyInitializing {
}
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes calldata) {
return msg.data;
}
function _contextSuffixLength() internal view virtual returns (uint256) {
return 0;
}
}
文件 5 的 28:ECDSA.sol
pragma solidity ^0.8.20;
library ECDSA {
enum RecoverError {
NoError,
InvalidSignature,
InvalidSignatureLength,
InvalidSignatureS
}
error ECDSAInvalidSignature();
error ECDSAInvalidSignatureLength(uint256 length);
error ECDSAInvalidSignatureS(bytes32 s);
function tryRecover(bytes32 hash, bytes memory signature) internal pure returns (address, RecoverError, bytes32) {
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, bytes32(signature.length));
}
}
function recover(bytes32 hash, bytes memory signature) internal pure returns (address) {
(address recovered, RecoverError error, bytes32 errorArg) = tryRecover(hash, signature);
_throwError(error, errorArg);
return recovered;
}
function tryRecover(bytes32 hash, bytes32 r, bytes32 vs) internal pure returns (address, RecoverError, bytes32) {
unchecked {
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, bytes32 errorArg) = tryRecover(hash, r, vs);
_throwError(error, errorArg);
return recovered;
}
function tryRecover(
bytes32 hash,
uint8 v,
bytes32 r,
bytes32 s
) internal pure returns (address, RecoverError, bytes32) {
if (uint256(s) > 0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5D576E7357A4501DDFE92F46681B20A0) {
return (address(0), RecoverError.InvalidSignatureS, s);
}
address signer = ecrecover(hash, v, r, s);
if (signer == address(0)) {
return (address(0), RecoverError.InvalidSignature, bytes32(0));
}
return (signer, RecoverError.NoError, bytes32(0));
}
function recover(bytes32 hash, uint8 v, bytes32 r, bytes32 s) internal pure returns (address) {
(address recovered, RecoverError error, bytes32 errorArg) = tryRecover(hash, v, r, s);
_throwError(error, errorArg);
return recovered;
}
function _throwError(RecoverError error, bytes32 errorArg) private pure {
if (error == RecoverError.NoError) {
return;
} else if (error == RecoverError.InvalidSignature) {
revert ECDSAInvalidSignature();
} else if (error == RecoverError.InvalidSignatureLength) {
revert ECDSAInvalidSignatureLength(uint256(errorArg));
} else if (error == RecoverError.InvalidSignatureS) {
revert ECDSAInvalidSignatureS(errorArg);
}
}
}
文件 6 的 28:ERC721.sol
pragma solidity >=0.8.0;
abstract contract ERC721 {
event Transfer(address indexed from, address indexed to, uint256 indexed id);
event Approval(address indexed owner, address indexed spender, uint256 indexed id);
event ApprovalForAll(address indexed owner, address indexed operator, bool approved);
string public name;
string public symbol;
function tokenURI(uint256 id) public view virtual returns (string memory);
mapping(uint256 => address) internal _ownerOf;
mapping(address => uint256) internal _balanceOf;
function ownerOf(uint256 id) public view virtual returns (address owner) {
require((owner = _ownerOf[id]) != address(0), "NOT_MINTED");
}
function balanceOf(address owner) public view virtual returns (uint256) {
require(owner != address(0), "ZERO_ADDRESS");
return _balanceOf[owner];
}
mapping(uint256 => address) public getApproved;
mapping(address => mapping(address => bool)) public isApprovedForAll;
constructor(string memory _name, string memory _symbol) {
name = _name;
symbol = _symbol;
}
function approve(address spender, uint256 id) public virtual {
address owner = _ownerOf[id];
require(msg.sender == owner || isApprovedForAll[owner][msg.sender], "NOT_AUTHORIZED");
getApproved[id] = spender;
emit Approval(owner, spender, id);
}
function setApprovalForAll(address operator, bool approved) public virtual {
isApprovedForAll[msg.sender][operator] = approved;
emit ApprovalForAll(msg.sender, operator, approved);
}
function transferFrom(
address from,
address to,
uint256 id
) public virtual {
require(from == _ownerOf[id], "WRONG_FROM");
require(to != address(0), "INVALID_RECIPIENT");
require(
msg.sender == from || isApprovedForAll[from][msg.sender] || msg.sender == getApproved[id],
"NOT_AUTHORIZED"
);
unchecked {
_balanceOf[from]--;
_balanceOf[to]++;
}
_ownerOf[id] = to;
delete getApproved[id];
emit Transfer(from, to, id);
}
function safeTransferFrom(
address from,
address to,
uint256 id
) public virtual {
transferFrom(from, to, id);
require(
to.code.length == 0 ||
ERC721TokenReceiver(to).onERC721Received(msg.sender, from, id, "") ==
ERC721TokenReceiver.onERC721Received.selector,
"UNSAFE_RECIPIENT"
);
}
function safeTransferFrom(
address from,
address to,
uint256 id,
bytes calldata data
) public virtual {
transferFrom(from, to, id);
require(
to.code.length == 0 ||
ERC721TokenReceiver(to).onERC721Received(msg.sender, from, id, data) ==
ERC721TokenReceiver.onERC721Received.selector,
"UNSAFE_RECIPIENT"
);
}
function supportsInterface(bytes4 interfaceId) public view virtual returns (bool) {
return
interfaceId == 0x01ffc9a7 ||
interfaceId == 0x80ac58cd ||
interfaceId == 0x5b5e139f;
}
function _mint(address to, uint256 id) internal virtual {
require(to != address(0), "INVALID_RECIPIENT");
require(_ownerOf[id] == address(0), "ALREADY_MINTED");
unchecked {
_balanceOf[to]++;
}
_ownerOf[id] = to;
emit Transfer(address(0), to, id);
}
function _burn(uint256 id) internal virtual {
address owner = _ownerOf[id];
require(owner != address(0), "NOT_MINTED");
unchecked {
_balanceOf[owner]--;
}
delete _ownerOf[id];
delete getApproved[id];
emit Transfer(owner, address(0), id);
}
function _safeMint(address to, uint256 id) internal virtual {
_mint(to, id);
require(
to.code.length == 0 ||
ERC721TokenReceiver(to).onERC721Received(msg.sender, address(0), id, "") ==
ERC721TokenReceiver.onERC721Received.selector,
"UNSAFE_RECIPIENT"
);
}
function _safeMint(
address to,
uint256 id,
bytes memory data
) internal virtual {
_mint(to, id);
require(
to.code.length == 0 ||
ERC721TokenReceiver(to).onERC721Received(msg.sender, address(0), id, data) ==
ERC721TokenReceiver.onERC721Received.selector,
"UNSAFE_RECIPIENT"
);
}
}
abstract contract ERC721TokenReceiver {
function onERC721Received(
address,
address,
uint256,
bytes calldata
) external virtual returns (bytes4) {
return ERC721TokenReceiver.onERC721Received.selector;
}
}
文件 7 的 28:IERC1271.sol
pragma solidity ^0.8.20;
interface IERC1271 {
function isValidSignature(bytes32 hash, bytes memory signature) external view returns (bytes4 magicValue);
}
文件 8 的 28:IErrors.sol
pragma solidity ^0.8.22;
library IErrors {
error InvalidSignature();
error SignatureInvalidated();
error SignatureUsed();
error InvalidMintType();
error InvalidZeroAddress();
error InvalidContractAddress();
error NotCollectionCreator();
error CreationFailed();
error ContractExists();
error IncorrectETHAmount(uint256 sent, uint256 expected);
error TokenDoesNotExist(uint256 tokenId);
error OutOfSupply();
error FailedToSendEth();
error MintingNotStarted();
error MintingClosed();
error OverClaimLimit();
error InvalidMintQuantity();
}
文件 9 的 28:IMintFactory.sol
pragma solidity ^0.8.22;
import "./ISharedConstructs.sol";
interface IMintFactory {
function getMintingFee(address addr) external view returns (MintingFee memory);
}
interface IMint {
function mint(address to, uint256 quantity) external payable;
function mintWithComment(address to, uint256 quantity, string calldata comment) external payable;
function initialize(CollectionCreationRequest memory request, address _mintingContract) external;
}
文件 10 的 28:ISharedConstructs.sol
pragma solidity ^0.8.22;
struct MintingFee {
bool hasOverride;
address addr;
uint256 fee;
}
struct Royalty {
address to;
uint256 amt;
}
struct CollectionCreationRequest {
address creator;
string name;
string description;
string symbol;
string image;
string animation_url;
string mintType;
uint128 maxSupply;
uint128 maxPerWallet;
uint256 cost;
uint256 startTime;
uint256 endTime;
Royalty[] royalties;
uint256 nonce;
}
文件 11 的 28:Initializable.sol
pragma solidity ^0.8.20;
abstract contract Initializable {
struct InitializableStorage {
uint64 _initialized;
bool _initializing;
}
bytes32 private constant INITIALIZABLE_STORAGE = 0xf0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a00;
error InvalidInitialization();
error NotInitializing();
event Initialized(uint64 version);
modifier initializer() {
InitializableStorage storage $ = _getInitializableStorage();
bool isTopLevelCall = !$._initializing;
uint64 initialized = $._initialized;
bool initialSetup = initialized == 0 && isTopLevelCall;
bool construction = initialized == 1 && address(this).code.length == 0;
if (!initialSetup && !construction) {
revert InvalidInitialization();
}
$._initialized = 1;
if (isTopLevelCall) {
$._initializing = true;
}
_;
if (isTopLevelCall) {
$._initializing = false;
emit Initialized(1);
}
}
modifier reinitializer(uint64 version) {
InitializableStorage storage $ = _getInitializableStorage();
if ($._initializing || $._initialized >= version) {
revert InvalidInitialization();
}
$._initialized = version;
$._initializing = true;
_;
$._initializing = false;
emit Initialized(version);
}
modifier onlyInitializing() {
_checkInitializing();
_;
}
function _checkInitializing() internal view virtual {
if (!_isInitializing()) {
revert NotInitializing();
}
}
function _disableInitializers() internal virtual {
InitializableStorage storage $ = _getInitializableStorage();
if ($._initializing) {
revert InvalidInitialization();
}
if ($._initialized != type(uint64).max) {
$._initialized = type(uint64).max;
emit Initialized(type(uint64).max);
}
}
function _getInitializedVersion() internal view returns (uint64) {
return _getInitializableStorage()._initialized;
}
function _isInitializing() internal view returns (bool) {
return _getInitializableStorage()._initializing;
}
function _getInitializableStorage() private pure returns (InitializableStorage storage $) {
assembly {
$.slot := INITIALIZABLE_STORAGE
}
}
}
文件 12 的 28:Json.sol
pragma solidity ^0.8.22;
import {LibString} from "solmate/utils/LibString.sol";
library Json {
string private constant NULL = "";
using LibString for string;
function object(string memory value) internal pure returns (string memory) {
return string.concat("{", value, "}");
}
function array(string memory value) internal pure returns (string memory) {
return string.concat("[", value, "]");
}
function property(string memory name, string memory value) internal pure returns (string memory) {
return string.concat('"', escapeJSON(name, false), '":"', escapeJSON(value, false), '"');
}
function intProperty(string memory name, string memory value) internal pure returns (string memory) {
return string.concat('"', escapeJSON(name, false), '":', escapeJSON(value, false), "");
}
function rawProperty(string memory name, string memory rawValue) internal pure returns (string memory) {
return string.concat('"', escapeJSON(name, false), '":', rawValue);
}
function objectOf(string[] memory properties) internal pure returns (string memory) {
return object(_commaJoin(properties));
}
function _commaJoin(string[] memory values) internal pure returns (string memory) {
return _join(values, ",");
}
function _join(string[] memory values, string memory separator) internal pure returns (string memory) {
if (values.length == 0) {
return NULL;
}
string memory result = values[0];
for (uint256 i = 1; i < values.length; ++i) {
result = string.concat(result, separator, values[i]);
}
return result;
}
function escapeJSON(string memory s, bool addDoubleQuotes) internal pure returns (string memory result) {
assembly {
let end := add(s, mload(s))
result := add(mload(0x40), 0x20)
if addDoubleQuotes {
mstore8(result, 34)
result := add(1, result)
}
mstore(0x15, 0x5c75303030303031323334353637383961626364656662746e006672)
let e := or(shl(0x22, 1), shl(0x5c, 1))
for {} iszero(eq(s, end)) {} {
s := add(s, 1)
let c := and(mload(s), 0xff)
if iszero(lt(c, 0x20)) {
if iszero(and(shl(c, 1), e)) {
mstore8(result, c)
result := add(result, 1)
continue
}
mstore8(result, 0x5c)
mstore8(add(result, 1), c)
result := add(result, 2)
continue
}
if iszero(and(shl(c, 1), 0x3700)) {
mstore8(0x1d, mload(shr(4, c)))
mstore8(0x1e, mload(and(c, 15)))
mstore(result, mload(0x19))
result := add(result, 6)
continue
}
mstore8(result, 0x5c)
mstore8(add(result, 1), mload(add(c, 8)))
result := add(result, 2)
}
if addDoubleQuotes {
mstore8(result, 34)
result := add(1, result)
}
let last := result
mstore(last, 0)
result := mload(0x40)
mstore(result, sub(last, add(result, 0x20)))
mstore(0x40, add(last, 0x20))
}
}
}
文件 13 的 28:LibString.sol
pragma solidity >=0.8.0;
library LibString {
function toString(int256 value) internal pure returns (string memory str) {
if (value >= 0) return toString(uint256(value));
unchecked {
str = toString(uint256(-value));
assembly {
let length := mload(str)
mstore(str, 45)
str := sub(str, 1)
mstore(str, add(length, 1))
}
}
}
function toString(uint256 value) internal pure returns (string memory str) {
assembly {
let newFreeMemoryPointer := add(mload(0x40), 160)
mstore(0x40, newFreeMemoryPointer)
str := sub(newFreeMemoryPointer, 32)
mstore(str, 0)
let end := str
for { let temp := value } 1 {} {
str := sub(str, 1)
mstore8(str, add(48, mod(temp, 10)))
temp := div(temp, 10)
if iszero(temp) { break }
}
let length := sub(end, str)
str := sub(str, 32)
mstore(str, length)
}
}
}
文件 14 的 28:Math.sol
pragma solidity ^0.8.20;
library Math {
error MathOverflowedMulDiv();
enum Rounding {
Floor,
Ceil,
Trunc,
Expand
}
function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) {
unchecked {
uint256 c = a + b;
if (c < a) return (false, 0);
return (true, c);
}
}
function trySub(uint256 a, uint256 b) internal pure returns (bool, uint256) {
unchecked {
if (b > a) return (false, 0);
return (true, a - b);
}
}
function tryMul(uint256 a, uint256 b) internal pure returns (bool, uint256) {
unchecked {
if (a == 0) return (true, 0);
uint256 c = a * b;
if (c / a != b) return (false, 0);
return (true, c);
}
}
function tryDiv(uint256 a, uint256 b) internal pure returns (bool, uint256) {
unchecked {
if (b == 0) return (false, 0);
return (true, a / b);
}
}
function tryMod(uint256 a, uint256 b) internal pure returns (bool, uint256) {
unchecked {
if (b == 0) return (false, 0);
return (true, a % b);
}
}
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) {
if (b == 0) {
return a / b;
}
return a == 0 ? 0 : (a - 1) / b + 1;
}
function mulDiv(uint256 x, uint256 y, uint256 denominator) internal pure returns (uint256 result) {
unchecked {
uint256 prod0 = x * y;
uint256 prod1;
assembly {
let mm := mulmod(x, y, not(0))
prod1 := sub(sub(mm, prod0), lt(mm, prod0))
}
if (prod1 == 0) {
return prod0 / denominator;
}
if (denominator <= prod1) {
revert MathOverflowedMulDiv();
}
uint256 remainder;
assembly {
remainder := mulmod(x, y, denominator)
prod1 := sub(prod1, gt(remainder, prod0))
prod0 := sub(prod0, remainder)
}
uint256 twos = denominator & (0 - denominator);
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 (unsignedRoundsUp(rounding) && 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 + (unsignedRoundsUp(rounding) && 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 + (unsignedRoundsUp(rounding) && 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 + (unsignedRoundsUp(rounding) && 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 + (unsignedRoundsUp(rounding) && 1 << (result << 3) < value ? 1 : 0);
}
}
function unsignedRoundsUp(Rounding rounding) internal pure returns (bool) {
return uint8(rounding) % 2 == 1;
}
}
文件 15 的 28:MintFactory.sol
pragma solidity ^0.8.22;
import "../mint-contracts/OpenEdition721Mint.sol";
import {CollectionCreationRequest} from "../interfaces/ISharedConstructs.sol";
import {MintUtil} from "../../utils/MintUtil.sol";
import "../interfaces/IErrors.sol";
import "@openzeppelin/contracts/proxy/Clones.sol";
import {Pausable} from "@openzeppelin/contracts/utils/Pausable.sol";
import {Ownable2Step, Ownable} from "@openzeppelin/contracts/access/Ownable2Step.sol";
import {ReentrancyGuard} from "@openzeppelin/contracts/utils/ReentrancyGuard.sol";
import {SignatureChecker} from "@openzeppelin/contracts/utils/cryptography/SignatureChecker.sol";
contract MintFactory is IMintFactory, Pausable, Ownable2Step, ReentrancyGuard {
mapping(address => bool) public contracts;
mapping(bytes => bool) public cancelledSignatures;
mapping(bytes => bool) public usedSignatures;
MintingFee public mintingFee;
mapping(address => MintingFee) public feeOverrides;
mapping(string => address) public mintImplementation;
bytes32 constant DOMAIN_TYPEHASH =
keccak256("EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)");
bytes32 constant COLLECTION_CREATION_REQUEST_TYPEHASH = keccak256(
"CollectionCreationRequest(address creator,string name,string description,string symbol,string image,string animation_url,string mintType,uint128 maxSupply,uint128 maxPerWallet,uint256 cost,uint256 startTime,uint256 endTime,Royalty[] royalties,uint256 nonce)Royalty(address to,uint256 amt)"
);
bytes32 constant ROYALTIES_REQUEST_TYPEHASH = keccak256("Royalty(address to,uint256 amt)");
bytes32 public immutable domainSeparator;
event ContractCreated(address indexed contractAddress, address indexed minter);
event SignatureInvalidated(bytes indexed signature, address indexed minter);
constructor(address initialOwner, address platformFeeAddress) Ownable(initialOwner) {
domainSeparator = keccak256(
abi.encode(
DOMAIN_TYPEHASH,
keccak256(bytes("MintFactory")),
keccak256(bytes("1")),
block.chainid,
address(this)
)
);
mintingFee = MintingFee({hasOverride: false, addr: platformFeeAddress, fee: 0.0001 ether});
mintImplementation["OPEN_EDITION_721"] = address(new OpenEdition721Mint());
}
function createCollection(
CollectionCreationRequest calldata request,
bytes memory signature,
uint256 mintQuantity,
string calldata comment
) external payable nonReentrant whenNotPaused returns (address) {
if (contracts[getMintingAddress(request)]) {
address existingMintAddr = getMintingAddress(request);
IMint existingMint = IMint(existingMintAddr);
existingMint.mintWithComment{value: msg.value}(msg.sender, mintQuantity, comment);
return existingMintAddr;
}
if (!verifySignature(request, signature)) {
revert IErrors.InvalidSignature();
}
MintUtil.validateCollectionCreationRequest(request);
bytes32 salt = getSalt(request);
address contractAddr = _getMintImplementationAddr(request.mintType);
address mintAddress = Clones.cloneDeterministic(contractAddr, salt);
contracts[mintAddress] = true;
usedSignatures[signature] = true;
IMint newMint = IMint(mintAddress);
newMint.initialize(request, address(this));
if (mintQuantity > 0) {
newMint.mintWithComment{value: msg.value}(msg.sender, mintQuantity, comment);
}
emit ContractCreated(mintAddress, msg.sender);
return mintAddress;
}
function cancelSignature(CollectionCreationRequest calldata request, bytes calldata signature) external {
if (!verifySignature(request, signature)) {
revert IErrors.InvalidSignature();
}
if (request.creator != msg.sender) {
revert IErrors.NotCollectionCreator();
}
emit SignatureInvalidated(signature, msg.sender);
cancelledSignatures[signature] = true;
}
function mint(address contractAddress, address to, uint256 quantity, string calldata comment) external payable {
if (!contracts[contractAddress]) {
revert IErrors.InvalidContractAddress();
}
IMint newMint = IMint(contractAddress);
newMint.mintWithComment{value: msg.value}(to, quantity, comment);
}
function getMintingFee(address contractAddress) external view returns (MintingFee memory) {
MintingFee memory feeOverride = feeOverrides[contractAddress];
if (feeOverride.hasOverride) {
return feeOverride;
}
return mintingFee;
}
function setMintContract(string calldata contractType, address addr) external onlyOwner {
mintImplementation[contractType] = address(addr);
}
function setMintingFee(MintingFee calldata fee) external onlyOwner {
mintingFee = fee;
}
function setMintingFeeOverride(address addr, MintingFee calldata fee) external onlyOwner {
feeOverrides[addr] = fee;
}
function pause() external onlyOwner whenNotPaused {
_pause();
}
function unpause() external onlyOwner whenPaused {
_unpause();
}
function getBytesToSign(CollectionCreationRequest memory request) public view returns (bytes32) {
return keccak256(abi.encodePacked("\x19\x01", domainSeparator, getItemHash(request)));
}
function getItemHash(CollectionCreationRequest memory request) public pure returns (bytes32) {
bytes32[] memory royaltyHashes = new bytes32[](request.royalties.length);
for (uint256 i = 0; i < request.royalties.length; i++) {
royaltyHashes[i] =
keccak256(abi.encode(ROYALTIES_REQUEST_TYPEHASH, request.royalties[i].to, request.royalties[i].amt));
}
bytes memory pt1 = abi.encode(
COLLECTION_CREATION_REQUEST_TYPEHASH,
request.creator,
keccak256(bytes(request.name)),
keccak256(bytes(request.description)),
keccak256(bytes(request.symbol)),
keccak256(bytes(request.image)),
keccak256(bytes(request.animation_url)),
keccak256(bytes(request.mintType))
);
return keccak256(
abi.encodePacked(
pt1,
abi.encode(
request.maxSupply,
request.maxPerWallet,
request.cost,
request.startTime,
request.endTime,
keccak256(abi.encodePacked(royaltyHashes)),
request.nonce
)
)
);
}
function getMintingAddress(CollectionCreationRequest memory request) public view returns (address) {
bytes32 salt = getSalt(request);
address implementation = _getMintImplementationAddr(request.mintType);
return Clones.predictDeterministicAddress(implementation, salt, address(this));
}
function verifySignature(CollectionCreationRequest memory request, bytes memory signature)
public
view
returns (bool)
{
if (cancelledSignatures[signature]) {
revert IErrors.SignatureInvalidated();
}
if (usedSignatures[signature]) {
revert IErrors.SignatureUsed();
}
bytes32 digest = getBytesToSign(request);
return SignatureChecker.isValidSignatureNow(request.creator, digest, signature);
}
function getSalt(CollectionCreationRequest memory request) public view returns (bytes32) {
return keccak256(abi.encode(request, address(this)));
}
function _getMintImplementationAddr(string memory mintType) internal view returns (address) {
address mintImpl = mintImplementation[mintType];
if (mintImpl == address(0)) {
revert IErrors.InvalidMintType();
}
return mintImpl;
}
}
文件 16 的 28:MintUtil.sol
pragma solidity ^0.8.22;
import "@openzeppelin/contracts/utils/Strings.sol";
import "@openzeppelin/contracts/utils/Base64.sol";
import "../tokenforge/interfaces/ISharedConstructs.sol";
import "./Json.sol";
import {Solarray} from "solarray/Solarray.sol";
library MintUtil {
error InvalidCollectionRequest(string message);
function contractURI(CollectionCreationRequest memory metadata, uint256 cost, bool encode)
internal
pure
returns (string memory)
{
string memory jsonMetadata = Json.objectOf(
Solarray.strings(
Json.property("name", metadata.name),
Json.property("description", metadata.description),
Json.property("symbol", metadata.symbol),
Json.property("image", metadata.image),
Json.property("animation_url", metadata.animation_url),
Json.rawProperty("mintConfig", _mintConfig(metadata, cost))
)
);
if (encode) {
return encodeJsonToBase64(jsonMetadata);
} else {
return jsonMetadata;
}
}
function _mintConfig(CollectionCreationRequest memory metadata, uint256 cost)
internal
pure
returns (string memory)
{
return Json.objectOf(
Solarray.strings(
Json.intProperty("maxSupply", Strings.toString(metadata.maxSupply)),
Json.rawProperty("phases", Json.array(_encodePhases(metadata, cost)))
)
);
}
function getOpenEditionUri(CollectionCreationRequest memory metadata, uint256 tokenId, bool encode)
internal
pure
returns (string memory)
{
string memory nameWithTokenId = string(abi.encodePacked(metadata.name, " #", Strings.toString(tokenId)));
string memory jsonMetadata = Json.objectOf(
Solarray.strings(
Json.property("name", nameWithTokenId),
Json.property("description", metadata.description),
Json.property("symbol", metadata.symbol),
Json.property("image", metadata.image),
Json.property("animation_url", metadata.animation_url)
)
);
if (encode) {
return encodeJsonToBase64(jsonMetadata);
} else {
return jsonMetadata;
}
}
function _encodePhases(CollectionCreationRequest memory metadata, uint256 cost)
internal
pure
returns (string memory)
{
string memory maxPerWalletStr = Strings.toString(metadata.maxPerWallet);
string memory addrParam = '{"name": "recipient","abiType": "address","kind": "RECIPIENT"}';
string memory qtyParam = '{"name": "quantity", "abiType": "uint256", "kind": "QUANTITY"}';
string memory params = string(abi.encodePacked(addrParam, ",", qtyParam));
string memory txnData = Json.objectOf(
Solarray.strings(Json.property("method", "0x40c10f19"), Json.rawProperty("params", Json.array(params)))
);
return Json.objectOf(
Solarray.strings(
Json.intProperty("maxMintsPerWallet", maxPerWalletStr),
Json.intProperty("startTime", Strings.toString(metadata.startTime)),
Json.intProperty("endTime", Strings.toString(metadata.endTime)),
Json.intProperty("price", Strings.toString(cost)),
Json.rawProperty("tx", txnData)
)
);
}
function encodeJsonToBase64(string memory str) internal pure returns (string memory) {
return string.concat("data:application/json;base64,", Base64.encode(abi.encodePacked(str)));
}
function validateCollectionCreationRequest(CollectionCreationRequest memory metadata) internal pure {
if (metadata.startTime > metadata.endTime && metadata.endTime != 0) {
revert InvalidCollectionRequest("End time must be greater than or equal to start time.");
}
uint256 totalAmt = 0;
for (uint256 i = 0; i < metadata.royalties.length; i++) {
if (metadata.royalties[i].to == address(0)) {
revert InvalidCollectionRequest("Invalid Address");
}
totalAmt += metadata.royalties[i].amt;
}
if (totalAmt != metadata.cost) {
revert InvalidCollectionRequest("Total royalties must equal cost");
}
if (metadata.royalties.length > 5) {
revert InvalidCollectionRequest("Cannot have more than 5 royalty addresses");
}
if (metadata.maxSupply == 0) {
revert InvalidCollectionRequest("Max supply must be greater than zero.");
}
if (metadata.maxPerWallet == 0) {
revert InvalidCollectionRequest("Max per wallet must be greater than zero.");
}
if (isEmptyString(metadata.name) || isEmptyString(metadata.symbol)) {
revert InvalidCollectionRequest("Name & symbol cannot be empty.");
}
if (isEmptyString(metadata.image) && isEmptyString(metadata.animation_url)) {
revert InvalidCollectionRequest("Must have an image or animation_url.");
}
}
function isEmptyString(string memory value) internal pure returns (bool) {
return bytes(value).length == 0;
}
}
文件 17 的 28:OpenEdition721Mint.sol
pragma solidity ^0.8.22;
import {ERC721} from "solmate/tokens/ERC721.sol";
import {Initializable} from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";
import {Ownable2StepUpgradeable} from "@openzeppelin/contracts-upgradeable/access/Ownable2StepUpgradeable.sol";
import {ReentrancyGuardUpgradeable} from "@openzeppelin/contracts-upgradeable/utils/ReentrancyGuardUpgradeable.sol";
import {CollectionCreationRequest} from "../interfaces/ISharedConstructs.sol";
import "../interfaces/IErrors.sol";
import {IMintFactory, IMint, Royalty, MintingFee} from "../interfaces/IMintFactory.sol";
import {MintUtil} from "../../utils/MintUtil.sol";
contract OpenEdition721Mint is
IMint,
ERC721("", ""),
Initializable,
Ownable2StepUpgradeable,
ReentrancyGuardUpgradeable
{
uint256 public currentTokenId;
CollectionCreationRequest public metadata;
address public mintingContract;
event MintConfigChanged();
event Withdrawn(address indexed owner, uint256 amount);
event TokenForgeMintComment(address indexed to, uint256 quantity, string comment);
event TokenForgeMint(address indexed to, uint256 quantity);
constructor() {
_disableInitializers();
}
function initialize(CollectionCreationRequest memory request, address mintingContract_) public initializer {
if (mintingContract_ == address(0)) {
revert IErrors.InvalidContractAddress();
}
__Ownable2Step_init();
_transferOwnership(request.creator);
__ReentrancyGuard_init();
name = request.name;
symbol = request.symbol;
_setMetadata(request);
metadata.mintType = request.mintType;
mintingContract = mintingContract_;
currentTokenId = 1;
emit MintConfigChanged();
}
function mint(address to, uint256 quantity) external payable nonReentrant {
if (quantity == 0) {
revert IErrors.InvalidMintQuantity();
}
if (currentTokenId + quantity > metadata.maxSupply + 1) {
revert IErrors.OutOfSupply();
}
if (metadata.startTime > 0 && metadata.startTime > block.timestamp) {
revert IErrors.MintingNotStarted();
}
if (metadata.endTime > 0 && metadata.endTime < block.timestamp) {
revert IErrors.MintingClosed();
}
if (balanceOf(to) + quantity > metadata.maxPerWallet) {
revert IErrors.OverClaimLimit();
}
uint256 creatorFee;
uint256 platformFee;
address platformFeeAddr;
(creatorFee, platformFee, platformFeeAddr) = _getFees(quantity);
if (msg.value != creatorFee + platformFee) {
revert IErrors.IncorrectETHAmount(msg.value, creatorFee + platformFee);
}
for (uint64 i = 0; i < quantity; i++) {
_safeMint(to, currentTokenId++);
}
uint256 paid = 0;
paid += platformFee;
(bool payPlatformFee,) = platformFeeAddr.call{value: platformFee}("");
if (!payPlatformFee) {
revert IErrors.FailedToSendEth();
}
for (uint256 i = 0; i < metadata.royalties.length; i++) {
Royalty memory royalty = metadata.royalties[i];
uint256 royaltyAmount = quantity * royalty.amt;
paid += royaltyAmount;
(bool payRoyaltyResult,) = royalty.to.call{value: royaltyAmount}("");
if (!payRoyaltyResult) {
revert IErrors.FailedToSendEth();
}
}
if (paid != creatorFee + platformFee) {
revert IErrors.IncorrectETHAmount(paid, creatorFee + platformFee);
}
emit TokenForgeMint(to, quantity);
}
function mintWithComment(address to, uint256 quantity, string calldata comment) external payable {
this.mint{value: msg.value}(to, quantity);
if (bytes(comment).length > 0) {
emit TokenForgeMintComment(to, quantity, comment);
}
}
function withdraw() external onlyOwner {
uint256 balance = address(this).balance;
(bool payOwnerResult,) = owner().call{value: balance}("");
if (!payOwnerResult) {
revert IErrors.FailedToSendEth();
}
emit Withdrawn(owner(), balance);
}
function setMetadata(CollectionCreationRequest memory metadata_) external onlyOwner {
_setMetadata(metadata_);
emit MintConfigChanged();
}
function contractURI() external view returns (string memory) {
uint256 creatorFee;
uint256 platformFee;
(creatorFee, platformFee,) = _getFees(1);
return MintUtil.contractURI(metadata, creatorFee + platformFee, true);
}
function totalSupply() external view returns (uint256) {
return currentTokenId - 1;
}
function tokenURI(uint256 tokenId) public view override(ERC721) returns (string memory) {
if (tokenId > currentTokenId || tokenId == 0) {
revert IErrors.TokenDoesNotExist({tokenId: tokenId});
}
return MintUtil.getOpenEditionUri(metadata, tokenId, true);
}
function getMetadata() public view returns (CollectionCreationRequest memory) {
return metadata;
}
function cost(uint256 quantity) public view returns (uint256) {
uint256 creatorFee;
uint256 platformFee;
(creatorFee, platformFee,) = _getFees(quantity);
return creatorFee + platformFee;
}
function _getFees(uint256 quantity) internal view returns (uint256, uint256, address) {
IMintFactory mintFactory = IMintFactory(mintingContract);
MintingFee memory mintingFee = mintFactory.getMintingFee(address(this));
uint256 creatorFee = (metadata.cost * quantity);
uint256 platformFee = mintingFee.fee * quantity;
return (creatorFee, platformFee, mintingFee.addr);
}
function _setMetadata(CollectionCreationRequest memory metadata_) internal {
MintUtil.validateCollectionCreationRequest(metadata_);
metadata.creator = metadata_.creator;
metadata.name = metadata_.name;
metadata.description = metadata_.description;
metadata.symbol = metadata_.symbol;
metadata.image = metadata_.image;
metadata.animation_url = metadata_.animation_url;
metadata.maxSupply = metadata_.maxSupply;
metadata.maxPerWallet = metadata_.maxPerWallet;
metadata.cost = metadata_.cost;
metadata.startTime = metadata_.startTime;
metadata.endTime = metadata_.endTime;
delete metadata.royalties;
for (uint256 i = 0; i < metadata_.royalties.length; i++) {
metadata.royalties.push(Royalty({to: metadata_.royalties[i].to, amt: metadata_.royalties[i].amt}));
}
}
}
文件 18 的 28:Ownable.sol
pragma solidity ^0.8.20;
import {Context} from "../utils/Context.sol";
abstract contract Ownable is Context {
address private _owner;
error OwnableUnauthorizedAccount(address account);
error OwnableInvalidOwner(address owner);
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor(address initialOwner) {
if (initialOwner == address(0)) {
revert OwnableInvalidOwner(address(0));
}
_transferOwnership(initialOwner);
}
modifier onlyOwner() {
_checkOwner();
_;
}
function owner() public view virtual returns (address) {
return _owner;
}
function _checkOwner() internal view virtual {
if (owner() != _msgSender()) {
revert OwnableUnauthorizedAccount(_msgSender());
}
}
function renounceOwnership() public virtual onlyOwner {
_transferOwnership(address(0));
}
function transferOwnership(address newOwner) public virtual onlyOwner {
if (newOwner == address(0)) {
revert OwnableInvalidOwner(address(0));
}
_transferOwnership(newOwner);
}
function _transferOwnership(address newOwner) internal virtual {
address oldOwner = _owner;
_owner = newOwner;
emit OwnershipTransferred(oldOwner, newOwner);
}
}
文件 19 的 28:Ownable2Step.sol
pragma solidity ^0.8.20;
import {Ownable} from "./Ownable.sol";
abstract contract Ownable2Step is Ownable {
address private _pendingOwner;
event OwnershipTransferStarted(address indexed previousOwner, address indexed newOwner);
function pendingOwner() public view virtual returns (address) {
return _pendingOwner;
}
function transferOwnership(address newOwner) public virtual override onlyOwner {
_pendingOwner = newOwner;
emit OwnershipTransferStarted(owner(), newOwner);
}
function _transferOwnership(address newOwner) internal virtual override {
delete _pendingOwner;
super._transferOwnership(newOwner);
}
function acceptOwnership() public virtual {
address sender = _msgSender();
if (pendingOwner() != sender) {
revert OwnableUnauthorizedAccount(sender);
}
_transferOwnership(sender);
}
}
文件 20 的 28:Ownable2StepUpgradeable.sol
pragma solidity ^0.8.20;
import {OwnableUpgradeable} from "./OwnableUpgradeable.sol";
import {Initializable} from "../proxy/utils/Initializable.sol";
abstract contract Ownable2StepUpgradeable is Initializable, OwnableUpgradeable {
struct Ownable2StepStorage {
address _pendingOwner;
}
bytes32 private constant Ownable2StepStorageLocation = 0x237e158222e3e6968b72b9db0d8043aacf074ad9f650f0d1606b4d82ee432c00;
function _getOwnable2StepStorage() private pure returns (Ownable2StepStorage storage $) {
assembly {
$.slot := Ownable2StepStorageLocation
}
}
event OwnershipTransferStarted(address indexed previousOwner, address indexed newOwner);
function __Ownable2Step_init() internal onlyInitializing {
}
function __Ownable2Step_init_unchained() internal onlyInitializing {
}
function pendingOwner() public view virtual returns (address) {
Ownable2StepStorage storage $ = _getOwnable2StepStorage();
return $._pendingOwner;
}
function transferOwnership(address newOwner) public virtual override onlyOwner {
Ownable2StepStorage storage $ = _getOwnable2StepStorage();
$._pendingOwner = newOwner;
emit OwnershipTransferStarted(owner(), newOwner);
}
function _transferOwnership(address newOwner) internal virtual override {
Ownable2StepStorage storage $ = _getOwnable2StepStorage();
delete $._pendingOwner;
super._transferOwnership(newOwner);
}
function acceptOwnership() public virtual {
address sender = _msgSender();
if (pendingOwner() != sender) {
revert OwnableUnauthorizedAccount(sender);
}
_transferOwnership(sender);
}
}
文件 21 的 28:OwnableUpgradeable.sol
pragma solidity ^0.8.20;
import {ContextUpgradeable} from "../utils/ContextUpgradeable.sol";
import {Initializable} from "../proxy/utils/Initializable.sol";
abstract contract OwnableUpgradeable is Initializable, ContextUpgradeable {
struct OwnableStorage {
address _owner;
}
bytes32 private constant OwnableStorageLocation = 0x9016d09d72d40fdae2fd8ceac6b6234c7706214fd39c1cd1e609a0528c199300;
function _getOwnableStorage() private pure returns (OwnableStorage storage $) {
assembly {
$.slot := OwnableStorageLocation
}
}
error OwnableUnauthorizedAccount(address account);
error OwnableInvalidOwner(address owner);
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
function __Ownable_init(address initialOwner) internal onlyInitializing {
__Ownable_init_unchained(initialOwner);
}
function __Ownable_init_unchained(address initialOwner) internal onlyInitializing {
if (initialOwner == address(0)) {
revert OwnableInvalidOwner(address(0));
}
_transferOwnership(initialOwner);
}
modifier onlyOwner() {
_checkOwner();
_;
}
function owner() public view virtual returns (address) {
OwnableStorage storage $ = _getOwnableStorage();
return $._owner;
}
function _checkOwner() internal view virtual {
if (owner() != _msgSender()) {
revert OwnableUnauthorizedAccount(_msgSender());
}
}
function renounceOwnership() public virtual onlyOwner {
_transferOwnership(address(0));
}
function transferOwnership(address newOwner) public virtual onlyOwner {
if (newOwner == address(0)) {
revert OwnableInvalidOwner(address(0));
}
_transferOwnership(newOwner);
}
function _transferOwnership(address newOwner) internal virtual {
OwnableStorage storage $ = _getOwnableStorage();
address oldOwner = $._owner;
$._owner = newOwner;
emit OwnershipTransferred(oldOwner, newOwner);
}
}
文件 22 的 28:Pausable.sol
pragma solidity ^0.8.20;
import {Context} from "../utils/Context.sol";
abstract contract Pausable is Context {
bool private _paused;
event Paused(address account);
event Unpaused(address account);
error EnforcedPause();
error ExpectedPause();
constructor() {
_paused = false;
}
modifier whenNotPaused() {
_requireNotPaused();
_;
}
modifier whenPaused() {
_requirePaused();
_;
}
function paused() public view virtual returns (bool) {
return _paused;
}
function _requireNotPaused() internal view virtual {
if (paused()) {
revert EnforcedPause();
}
}
function _requirePaused() internal view virtual {
if (!paused()) {
revert ExpectedPause();
}
}
function _pause() internal virtual whenNotPaused {
_paused = true;
emit Paused(_msgSender());
}
function _unpause() internal virtual whenPaused {
_paused = false;
emit Unpaused(_msgSender());
}
}
文件 23 的 28:ReentrancyGuard.sol
pragma solidity ^0.8.20;
abstract contract ReentrancyGuard {
uint256 private constant NOT_ENTERED = 1;
uint256 private constant ENTERED = 2;
uint256 private _status;
error ReentrancyGuardReentrantCall();
constructor() {
_status = NOT_ENTERED;
}
modifier nonReentrant() {
_nonReentrantBefore();
_;
_nonReentrantAfter();
}
function _nonReentrantBefore() private {
if (_status == ENTERED) {
revert ReentrancyGuardReentrantCall();
}
_status = ENTERED;
}
function _nonReentrantAfter() private {
_status = NOT_ENTERED;
}
function _reentrancyGuardEntered() internal view returns (bool) {
return _status == ENTERED;
}
}
文件 24 的 28:ReentrancyGuardUpgradeable.sol
pragma solidity ^0.8.20;
import {Initializable} from "../proxy/utils/Initializable.sol";
abstract contract ReentrancyGuardUpgradeable is Initializable {
uint256 private constant NOT_ENTERED = 1;
uint256 private constant ENTERED = 2;
struct ReentrancyGuardStorage {
uint256 _status;
}
bytes32 private constant ReentrancyGuardStorageLocation = 0x9b779b17422d0df92223018b32b4d1fa46e071723d6817e2486d003becc55f00;
function _getReentrancyGuardStorage() private pure returns (ReentrancyGuardStorage storage $) {
assembly {
$.slot := ReentrancyGuardStorageLocation
}
}
error ReentrancyGuardReentrantCall();
function __ReentrancyGuard_init() internal onlyInitializing {
__ReentrancyGuard_init_unchained();
}
function __ReentrancyGuard_init_unchained() internal onlyInitializing {
ReentrancyGuardStorage storage $ = _getReentrancyGuardStorage();
$._status = NOT_ENTERED;
}
modifier nonReentrant() {
_nonReentrantBefore();
_;
_nonReentrantAfter();
}
function _nonReentrantBefore() private {
ReentrancyGuardStorage storage $ = _getReentrancyGuardStorage();
if ($._status == ENTERED) {
revert ReentrancyGuardReentrantCall();
}
$._status = ENTERED;
}
function _nonReentrantAfter() private {
ReentrancyGuardStorage storage $ = _getReentrancyGuardStorage();
$._status = NOT_ENTERED;
}
function _reentrancyGuardEntered() internal view returns (bool) {
ReentrancyGuardStorage storage $ = _getReentrancyGuardStorage();
return $._status == ENTERED;
}
}
文件 25 的 28:SignatureChecker.sol
pragma solidity ^0.8.20;
import {ECDSA} from "./ECDSA.sol";
import {IERC1271} from "../../interfaces/IERC1271.sol";
library SignatureChecker {
function isValidSignatureNow(address signer, bytes32 hash, bytes memory signature) internal view returns (bool) {
(address recovered, ECDSA.RecoverError error, ) = ECDSA.tryRecover(hash, signature);
return
(error == ECDSA.RecoverError.NoError && recovered == signer) ||
isValidERC1271SignatureNow(signer, hash, signature);
}
function isValidERC1271SignatureNow(
address signer,
bytes32 hash,
bytes memory signature
) internal view returns (bool) {
(bool success, bytes memory result) = signer.staticcall(
abi.encodeCall(IERC1271.isValidSignature, (hash, signature))
);
return (success &&
result.length >= 32 &&
abi.decode(result, (bytes32)) == bytes32(IERC1271.isValidSignature.selector));
}
}
文件 26 的 28:SignedMath.sol
pragma solidity ^0.8.20;
library SignedMath {
function max(int256 a, int256 b) internal pure returns (int256) {
return a > b ? a : b;
}
function min(int256 a, int256 b) internal pure returns (int256) {
return a < b ? a : b;
}
function average(int256 a, int256 b) internal pure returns (int256) {
int256 x = (a & b) + ((a ^ b) >> 1);
return x + (int256(uint256(x) >> 255) & (a ^ b));
}
function abs(int256 n) internal pure returns (uint256) {
unchecked {
return uint256(n >= 0 ? n : -n);
}
}
}
文件 27 的 28:Solarray.sol
pragma solidity >=0.6.2 <0.9.0;
library Solarray {
function uint8s(uint8 a) internal pure returns (uint8[] memory) {
uint8[] memory arr = new uint8[](1);
arr[0] = a;
return arr;
}
function uint8s(uint8 a,uint8 b) internal pure returns (uint8[] memory) {
uint8[] memory arr = new uint8[](2);
arr[0] = a;
arr[1] = b;
return arr;
}
function uint8s(uint8 a,uint8 b,uint8 c) internal pure returns (uint8[] memory) {
uint8[] memory arr = new uint8[](3);
arr[0] = a;
arr[1] = b;
arr[2] = c;
return arr;
}
function uint8s(uint8 a,uint8 b,uint8 c,uint8 d) internal pure returns (uint8[] memory) {
uint8[] memory arr = new uint8[](4);
arr[0] = a;
arr[1] = b;
arr[2] = c;
arr[3] = d;
return arr;
}
function uint8s(uint8 a,uint8 b,uint8 c,uint8 d,uint8 e) internal pure returns (uint8[] memory) {
uint8[] memory arr = new uint8[](5);
arr[0] = a;
arr[1] = b;
arr[2] = c;
arr[3] = d;
arr[4] = e;
return arr;
}
function uint8s(uint8 a,uint8 b,uint8 c,uint8 d,uint8 e,uint8 f) internal pure returns (uint8[] memory) {
uint8[] memory arr = new uint8[](6);
arr[0] = a;
arr[1] = b;
arr[2] = c;
arr[3] = d;
arr[4] = e;
arr[5] = f;
return arr;
}
function uint8s(uint8 a,uint8 b,uint8 c,uint8 d,uint8 e,uint8 f,uint8 g) internal pure returns (uint8[] memory) {
uint8[] memory arr = new uint8[](7);
arr[0] = a;
arr[1] = b;
arr[2] = c;
arr[3] = d;
arr[4] = e;
arr[5] = f;
arr[6] = g;
return arr;
}
function uint16s(uint16 a) internal pure returns (uint16[] memory) {
uint16[] memory arr = new uint16[](1);
arr[0] = a;
return arr;
}
function uint16s(uint16 a,uint16 b) internal pure returns (uint16[] memory) {
uint16[] memory arr = new uint16[](2);
arr[0] = a;
arr[1] = b;
return arr;
}
function uint16s(uint16 a,uint16 b,uint16 c) internal pure returns (uint16[] memory) {
uint16[] memory arr = new uint16[](3);
arr[0] = a;
arr[1] = b;
arr[2] = c;
return arr;
}
function uint16s(uint16 a,uint16 b,uint16 c,uint16 d) internal pure returns (uint16[] memory) {
uint16[] memory arr = new uint16[](4);
arr[0] = a;
arr[1] = b;
arr[2] = c;
arr[3] = d;
return arr;
}
function uint16s(uint16 a,uint16 b,uint16 c,uint16 d,uint16 e) internal pure returns (uint16[] memory) {
uint16[] memory arr = new uint16[](5);
arr[0] = a;
arr[1] = b;
arr[2] = c;
arr[3] = d;
arr[4] = e;
return arr;
}
function uint16s(uint16 a,uint16 b,uint16 c,uint16 d,uint16 e,uint16 f) internal pure returns (uint16[] memory) {
uint16[] memory arr = new uint16[](6);
arr[0] = a;
arr[1] = b;
arr[2] = c;
arr[3] = d;
arr[4] = e;
arr[5] = f;
return arr;
}
function uint16s(uint16 a,uint16 b,uint16 c,uint16 d,uint16 e,uint16 f,uint16 g) internal pure returns (uint16[] memory) {
uint16[] memory arr = new uint16[](7);
arr[0] = a;
arr[1] = b;
arr[2] = c;
arr[3] = d;
arr[4] = e;
arr[5] = f;
arr[6] = g;
return arr;
}
function uint32s(uint32 a) internal pure returns (uint32[] memory) {
uint32[] memory arr = new uint32[](1);
arr[0] = a;
return arr;
}
function uint32s(uint32 a,uint32 b) internal pure returns (uint32[] memory) {
uint32[] memory arr = new uint32[](2);
arr[0] = a;
arr[1] = b;
return arr;
}
function uint32s(uint32 a,uint32 b,uint32 c) internal pure returns (uint32[] memory) {
uint32[] memory arr = new uint32[](3);
arr[0] = a;
arr[1] = b;
arr[2] = c;
return arr;
}
function uint32s(uint32 a,uint32 b,uint32 c,uint32 d) internal pure returns (uint32[] memory) {
uint32[] memory arr = new uint32[](4);
arr[0] = a;
arr[1] = b;
arr[2] = c;
arr[3] = d;
return arr;
}
function uint32s(uint32 a,uint32 b,uint32 c,uint32 d,uint32 e) internal pure returns (uint32[] memory) {
uint32[] memory arr = new uint32[](5);
arr[0] = a;
arr[1] = b;
arr[2] = c;
arr[3] = d;
arr[4] = e;
return arr;
}
function uint32s(uint32 a,uint32 b,uint32 c,uint32 d,uint32 e,uint32 f) internal pure returns (uint32[] memory) {
uint32[] memory arr = new uint32[](6);
arr[0] = a;
arr[1] = b;
arr[2] = c;
arr[3] = d;
arr[4] = e;
arr[5] = f;
return arr;
}
function uint32s(uint32 a,uint32 b,uint32 c,uint32 d,uint32 e,uint32 f,uint32 g) internal pure returns (uint32[] memory) {
uint32[] memory arr = new uint32[](7);
arr[0] = a;
arr[1] = b;
arr[2] = c;
arr[3] = d;
arr[4] = e;
arr[5] = f;
arr[6] = g;
return arr;
}
function uint40s(uint40 a) internal pure returns (uint40[] memory) {
uint40[] memory arr = new uint40[](1);
arr[0] = a;
return arr;
}
function uint40s(uint40 a,uint40 b) internal pure returns (uint40[] memory) {
uint40[] memory arr = new uint40[](2);
arr[0] = a;
arr[1] = b;
return arr;
}
function uint40s(uint40 a,uint40 b,uint40 c) internal pure returns (uint40[] memory) {
uint40[] memory arr = new uint40[](3);
arr[0] = a;
arr[1] = b;
arr[2] = c;
return arr;
}
function uint40s(uint40 a,uint40 b,uint40 c,uint40 d) internal pure returns (uint40[] memory) {
uint40[] memory arr = new uint40[](4);
arr[0] = a;
arr[1] = b;
arr[2] = c;
arr[3] = d;
return arr;
}
function uint40s(uint40 a,uint40 b,uint40 c,uint40 d,uint40 e) internal pure returns (uint40[] memory) {
uint40[] memory arr = new uint40[](5);
arr[0] = a;
arr[1] = b;
arr[2] = c;
arr[3] = d;
arr[4] = e;
return arr;
}
function uint40s(uint40 a,uint40 b,uint40 c,uint40 d,uint40 e,uint40 f) internal pure returns (uint40[] memory) {
uint40[] memory arr = new uint40[](6);
arr[0] = a;
arr[1] = b;
arr[2] = c;
arr[3] = d;
arr[4] = e;
arr[5] = f;
return arr;
}
function uint40s(uint40 a,uint40 b,uint40 c,uint40 d,uint40 e,uint40 f,uint40 g) internal pure returns (uint40[] memory) {
uint40[] memory arr = new uint40[](7);
arr[0] = a;
arr[1] = b;
arr[2] = c;
arr[3] = d;
arr[4] = e;
arr[5] = f;
arr[6] = g;
return arr;
}
function uint64s(uint64 a) internal pure returns (uint64[] memory) {
uint64[] memory arr = new uint64[](1);
arr[0] = a;
return arr;
}
function uint64s(uint64 a,uint64 b) internal pure returns (uint64[] memory) {
uint64[] memory arr = new uint64[](2);
arr[0] = a;
arr[1] = b;
return arr;
}
function uint64s(uint64 a,uint64 b,uint64 c) internal pure returns (uint64[] memory) {
uint64[] memory arr = new uint64[](3);
arr[0] = a;
arr[1] = b;
arr[2] = c;
return arr;
}
function uint64s(uint64 a,uint64 b,uint64 c,uint64 d) internal pure returns (uint64[] memory) {
uint64[] memory arr = new uint64[](4);
arr[0] = a;
arr[1] = b;
arr[2] = c;
arr[3] = d;
return arr;
}
function uint64s(uint64 a,uint64 b,uint64 c,uint64 d,uint64 e) internal pure returns (uint64[] memory) {
uint64[] memory arr = new uint64[](5);
arr[0] = a;
arr[1] = b;
arr[2] = c;
arr[3] = d;
arr[4] = e;
return arr;
}
function uint64s(uint64 a,uint64 b,uint64 c,uint64 d,uint64 e,uint64 f) internal pure returns (uint64[] memory) {
uint64[] memory arr = new uint64[](6);
arr[0] = a;
arr[1] = b;
arr[2] = c;
arr[3] = d;
arr[4] = e;
arr[5] = f;
return arr;
}
function uint64s(uint64 a,uint64 b,uint64 c,uint64 d,uint64 e,uint64 f,uint64 g) internal pure returns (uint64[] memory) {
uint64[] memory arr = new uint64[](7);
arr[0] = a;
arr[1] = b;
arr[2] = c;
arr[3] = d;
arr[4] = e;
arr[5] = f;
arr[6] = g;
return arr;
}
function uint128s(uint128 a) internal pure returns (uint128[] memory) {
uint128[] memory arr = new uint128[](1);
arr[0] = a;
return arr;
}
function uint128s(uint128 a,uint128 b) internal pure returns (uint128[] memory) {
uint128[] memory arr = new uint128[](2);
arr[0] = a;
arr[1] = b;
return arr;
}
function uint128s(uint128 a,uint128 b,uint128 c) internal pure returns (uint128[] memory) {
uint128[] memory arr = new uint128[](3);
arr[0] = a;
arr[1] = b;
arr[2] = c;
return arr;
}
function uint128s(uint128 a,uint128 b,uint128 c,uint128 d) internal pure returns (uint128[] memory) {
uint128[] memory arr = new uint128[](4);
arr[0] = a;
arr[1] = b;
arr[2] = c;
arr[3] = d;
return arr;
}
function uint128s(uint128 a,uint128 b,uint128 c,uint128 d,uint128 e) internal pure returns (uint128[] memory) {
uint128[] memory arr = new uint128[](5);
arr[0] = a;
arr[1] = b;
arr[2] = c;
arr[3] = d;
arr[4] = e;
return arr;
}
function uint128s(uint128 a,uint128 b,uint128 c,uint128 d,uint128 e,uint128 f) internal pure returns (uint128[] memory) {
uint128[] memory arr = new uint128[](6);
arr[0] = a;
arr[1] = b;
arr[2] = c;
arr[3] = d;
arr[4] = e;
arr[5] = f;
return arr;
}
function uint128s(uint128 a,uint128 b,uint128 c,uint128 d,uint128 e,uint128 f,uint128 g) internal pure returns (uint128[] memory) {
uint128[] memory arr = new uint128[](7);
arr[0] = a;
arr[1] = b;
arr[2] = c;
arr[3] = d;
arr[4] = e;
arr[5] = f;
arr[6] = g;
return arr;
}
function uint256s(uint256 a) internal pure returns (uint256[] memory) {
uint256[] memory arr = new uint256[](1);
arr[0] = a;
return arr;
}
function uint256s(uint256 a,uint256 b) internal pure returns (uint256[] memory) {
uint256[] memory arr = new uint256[](2);
arr[0] = a;
arr[1] = b;
return arr;
}
function uint256s(uint256 a,uint256 b,uint256 c) internal pure returns (uint256[] memory) {
uint256[] memory arr = new uint256[](3);
arr[0] = a;
arr[1] = b;
arr[2] = c;
return arr;
}
function uint256s(uint256 a,uint256 b,uint256 c,uint256 d) internal pure returns (uint256[] memory) {
uint256[] memory arr = new uint256[](4);
arr[0] = a;
arr[1] = b;
arr[2] = c;
arr[3] = d;
return arr;
}
function uint256s(uint256 a,uint256 b,uint256 c,uint256 d,uint256 e) internal pure returns (uint256[] memory) {
uint256[] memory arr = new uint256[](5);
arr[0] = a;
arr[1] = b;
arr[2] = c;
arr[3] = d;
arr[4] = e;
return arr;
}
function uint256s(uint256 a,uint256 b,uint256 c,uint256 d,uint256 e,uint256 f) internal pure returns (uint256[] memory) {
uint256[] memory arr = new uint256[](6);
arr[0] = a;
arr[1] = b;
arr[2] = c;
arr[3] = d;
arr[4] = e;
arr[5] = f;
return arr;
}
function uint256s(uint256 a,uint256 b,uint256 c,uint256 d,uint256 e,uint256 f,uint256 g) internal pure returns (uint256[] memory) {
uint256[] memory arr = new uint256[](7);
arr[0] = a;
arr[1] = b;
arr[2] = c;
arr[3] = d;
arr[4] = e;
arr[5] = f;
arr[6] = g;
return arr;
}
function int8s(int8 a) internal pure returns (int8[] memory) {
int8[] memory arr = new int8[](1);
arr[0] = a;
return arr;
}
function int8s(int8 a,int8 b) internal pure returns (int8[] memory) {
int8[] memory arr = new int8[](2);
arr[0] = a;
arr[1] = b;
return arr;
}
function int8s(int8 a,int8 b,int8 c) internal pure returns (int8[] memory) {
int8[] memory arr = new int8[](3);
arr[0] = a;
arr[1] = b;
arr[2] = c;
return arr;
}
function int8s(int8 a,int8 b,int8 c,int8 d) internal pure returns (int8[] memory) {
int8[] memory arr = new int8[](4);
arr[0] = a;
arr[1] = b;
arr[2] = c;
arr[3] = d;
return arr;
}
function int8s(int8 a,int8 b,int8 c,int8 d,int8 e) internal pure returns (int8[] memory) {
int8[] memory arr = new int8[](5);
arr[0] = a;
arr[1] = b;
arr[2] = c;
arr[3] = d;
arr[4] = e;
return arr;
}
function int8s(int8 a,int8 b,int8 c,int8 d,int8 e,int8 f) internal pure returns (int8[] memory) {
int8[] memory arr = new int8[](6);
arr[0] = a;
arr[1] = b;
arr[2] = c;
arr[3] = d;
arr[4] = e;
arr[5] = f;
return arr;
}
function int8s(int8 a,int8 b,int8 c,int8 d,int8 e,int8 f,int8 g) internal pure returns (int8[] memory) {
int8[] memory arr = new int8[](7);
arr[0] = a;
arr[1] = b;
arr[2] = c;
arr[3] = d;
arr[4] = e;
arr[5] = f;
arr[6] = g;
return arr;
}
function int16s(int16 a) internal pure returns (int16[] memory) {
int16[] memory arr = new int16[](1);
arr[0] = a;
return arr;
}
function int16s(int16 a,int16 b) internal pure returns (int16[] memory) {
int16[] memory arr = new int16[](2);
arr[0] = a;
arr[1] = b;
return arr;
}
function int16s(int16 a,int16 b,int16 c) internal pure returns (int16[] memory) {
int16[] memory arr = new int16[](3);
arr[0] = a;
arr[1] = b;
arr[2] = c;
return arr;
}
function int16s(int16 a,int16 b,int16 c,int16 d) internal pure returns (int16[] memory) {
int16[] memory arr = new int16[](4);
arr[0] = a;
arr[1] = b;
arr[2] = c;
arr[3] = d;
return arr;
}
function int16s(int16 a,int16 b,int16 c,int16 d,int16 e) internal pure returns (int16[] memory) {
int16[] memory arr = new int16[](5);
arr[0] = a;
arr[1] = b;
arr[2] = c;
arr[3] = d;
arr[4] = e;
return arr;
}
function int16s(int16 a,int16 b,int16 c,int16 d,int16 e,int16 f) internal pure returns (int16[] memory) {
int16[] memory arr = new int16[](6);
arr[0] = a;
arr[1] = b;
arr[2] = c;
arr[3] = d;
arr[4] = e;
arr[5] = f;
return arr;
}
function int16s(int16 a,int16 b,int16 c,int16 d,int16 e,int16 f,int16 g) internal pure returns (int16[] memory) {
int16[] memory arr = new int16[](7);
arr[0] = a;
arr[1] = b;
arr[2] = c;
arr[3] = d;
arr[4] = e;
arr[5] = f;
arr[6] = g;
return arr;
}
function int32s(int32 a) internal pure returns (int32[] memory) {
int32[] memory arr = new int32[](1);
arr[0] = a;
return arr;
}
function int32s(int32 a,int32 b) internal pure returns (int32[] memory) {
int32[] memory arr = new int32[](2);
arr[0] = a;
arr[1] = b;
return arr;
}
function int32s(int32 a,int32 b,int32 c) internal pure returns (int32[] memory) {
int32[] memory arr = new int32[](3);
arr[0] = a;
arr[1] = b;
arr[2] = c;
return arr;
}
function int32s(int32 a,int32 b,int32 c,int32 d) internal pure returns (int32[] memory) {
int32[] memory arr = new int32[](4);
arr[0] = a;
arr[1] = b;
arr[2] = c;
arr[3] = d;
return arr;
}
function int32s(int32 a,int32 b,int32 c,int32 d,int32 e) internal pure returns (int32[] memory) {
int32[] memory arr = new int32[](5);
arr[0] = a;
arr[1] = b;
arr[2] = c;
arr[3] = d;
arr[4] = e;
return arr;
}
function int32s(int32 a,int32 b,int32 c,int32 d,int32 e,int32 f) internal pure returns (int32[] memory) {
int32[] memory arr = new int32[](6);
arr[0] = a;
arr[1] = b;
arr[2] = c;
arr[3] = d;
arr[4] = e;
arr[5] = f;
return arr;
}
function int32s(int32 a,int32 b,int32 c,int32 d,int32 e,int32 f,int32 g) internal pure returns (int32[] memory) {
int32[] memory arr = new int32[](7);
arr[0] = a;
arr[1] = b;
arr[2] = c;
arr[3] = d;
arr[4] = e;
arr[5] = f;
arr[6] = g;
return arr;
}
function int64s(int64 a) internal pure returns (int64[] memory) {
int64[] memory arr = new int64[](1);
arr[0] = a;
return arr;
}
function int64s(int64 a,int64 b) internal pure returns (int64[] memory) {
int64[] memory arr = new int64[](2);
arr[0] = a;
arr[1] = b;
return arr;
}
function int64s(int64 a,int64 b,int64 c) internal pure returns (int64[] memory) {
int64[] memory arr = new int64[](3);
arr[0] = a;
arr[1] = b;
arr[2] = c;
return arr;
}
function int64s(int64 a,int64 b,int64 c,int64 d) internal pure returns (int64[] memory) {
int64[] memory arr = new int64[](4);
arr[0] = a;
arr[1] = b;
arr[2] = c;
arr[3] = d;
return arr;
}
function int64s(int64 a,int64 b,int64 c,int64 d,int64 e) internal pure returns (int64[] memory) {
int64[] memory arr = new int64[](5);
arr[0] = a;
arr[1] = b;
arr[2] = c;
arr[3] = d;
arr[4] = e;
return arr;
}
function int64s(int64 a,int64 b,int64 c,int64 d,int64 e,int64 f) internal pure returns (int64[] memory) {
int64[] memory arr = new int64[](6);
arr[0] = a;
arr[1] = b;
arr[2] = c;
arr[3] = d;
arr[4] = e;
arr[5] = f;
return arr;
}
function int64s(int64 a,int64 b,int64 c,int64 d,int64 e,int64 f,int64 g) internal pure returns (int64[] memory) {
int64[] memory arr = new int64[](7);
arr[0] = a;
arr[1] = b;
arr[2] = c;
arr[3] = d;
arr[4] = e;
arr[5] = f;
arr[6] = g;
return arr;
}
function int128s(int128 a) internal pure returns (int128[] memory) {
int128[] memory arr = new int128[](1);
arr[0] = a;
return arr;
}
function int128s(int128 a,int128 b) internal pure returns (int128[] memory) {
int128[] memory arr = new int128[](2);
arr[0] = a;
arr[1] = b;
return arr;
}
function int128s(int128 a,int128 b,int128 c) internal pure returns (int128[] memory) {
int128[] memory arr = new int128[](3);
arr[0] = a;
arr[1] = b;
arr[2] = c;
return arr;
}
function int128s(int128 a,int128 b,int128 c,int128 d) internal pure returns (int128[] memory) {
int128[] memory arr = new int128[](4);
arr[0] = a;
arr[1] = b;
arr[2] = c;
arr[3] = d;
return arr;
}
function int128s(int128 a,int128 b,int128 c,int128 d,int128 e) internal pure returns (int128[] memory) {
int128[] memory arr = new int128[](5);
arr[0] = a;
arr[1] = b;
arr[2] = c;
arr[3] = d;
arr[4] = e;
return arr;
}
function int128s(int128 a,int128 b,int128 c,int128 d,int128 e,int128 f) internal pure returns (int128[] memory) {
int128[] memory arr = new int128[](6);
arr[0] = a;
arr[1] = b;
arr[2] = c;
arr[3] = d;
arr[4] = e;
arr[5] = f;
return arr;
}
function int128s(int128 a,int128 b,int128 c,int128 d,int128 e,int128 f,int128 g) internal pure returns (int128[] memory) {
int128[] memory arr = new int128[](7);
arr[0] = a;
arr[1] = b;
arr[2] = c;
arr[3] = d;
arr[4] = e;
arr[5] = f;
arr[6] = g;
return arr;
}
function int256s(int256 a) internal pure returns (int256[] memory) {
int256[] memory arr = new int256[](1);
arr[0] = a;
return arr;
}
function int256s(int256 a,int256 b) internal pure returns (int256[] memory) {
int256[] memory arr = new int256[](2);
arr[0] = a;
arr[1] = b;
return arr;
}
function int256s(int256 a,int256 b,int256 c) internal pure returns (int256[] memory) {
int256[] memory arr = new int256[](3);
arr[0] = a;
arr[1] = b;
arr[2] = c;
return arr;
}
function int256s(int256 a,int256 b,int256 c,int256 d) internal pure returns (int256[] memory) {
int256[] memory arr = new int256[](4);
arr[0] = a;
arr[1] = b;
arr[2] = c;
arr[3] = d;
return arr;
}
function int256s(int256 a,int256 b,int256 c,int256 d,int256 e) internal pure returns (int256[] memory) {
int256[] memory arr = new int256[](5);
arr[0] = a;
arr[1] = b;
arr[2] = c;
arr[3] = d;
arr[4] = e;
return arr;
}
function int256s(int256 a,int256 b,int256 c,int256 d,int256 e,int256 f) internal pure returns (int256[] memory) {
int256[] memory arr = new int256[](6);
arr[0] = a;
arr[1] = b;
arr[2] = c;
arr[3] = d;
arr[4] = e;
arr[5] = f;
return arr;
}
function int256s(int256 a,int256 b,int256 c,int256 d,int256 e,int256 f,int256 g) internal pure returns (int256[] memory) {
int256[] memory arr = new int256[](7);
arr[0] = a;
arr[1] = b;
arr[2] = c;
arr[3] = d;
arr[4] = e;
arr[5] = f;
arr[6] = g;
return arr;
}
function bytes1s(bytes1 a) internal pure returns (bytes1[] memory) {
bytes1[] memory arr = new bytes1[](1);
arr[0] = a;
return arr;
}
function bytes1s(bytes1 a,bytes1 b) internal pure returns (bytes1[] memory) {
bytes1[] memory arr = new bytes1[](2);
arr[0] = a;
arr[1] = b;
return arr;
}
function bytes1s(bytes1 a,bytes1 b,bytes1 c) internal pure returns (bytes1[] memory) {
bytes1[] memory arr = new bytes1[](3);
arr[0] = a;
arr[1] = b;
arr[2] = c;
return arr;
}
function bytes1s(bytes1 a,bytes1 b,bytes1 c,bytes1 d) internal pure returns (bytes1[] memory) {
bytes1[] memory arr = new bytes1[](4);
arr[0] = a;
arr[1] = b;
arr[2] = c;
arr[3] = d;
return arr;
}
function bytes1s(bytes1 a,bytes1 b,bytes1 c,bytes1 d,bytes1 e) internal pure returns (bytes1[] memory) {
bytes1[] memory arr = new bytes1[](5);
arr[0] = a;
arr[1] = b;
arr[2] = c;
arr[3] = d;
arr[4] = e;
return arr;
}
function bytes1s(bytes1 a,bytes1 b,bytes1 c,bytes1 d,bytes1 e,bytes1 f) internal pure returns (bytes1[] memory) {
bytes1[] memory arr = new bytes1[](6);
arr[0] = a;
arr[1] = b;
arr[2] = c;
arr[3] = d;
arr[4] = e;
arr[5] = f;
return arr;
}
function bytes1s(bytes1 a,bytes1 b,bytes1 c,bytes1 d,bytes1 e,bytes1 f,bytes1 g) internal pure returns (bytes1[] memory) {
bytes1[] memory arr = new bytes1[](7);
arr[0] = a;
arr[1] = b;
arr[2] = c;
arr[3] = d;
arr[4] = e;
arr[5] = f;
arr[6] = g;
return arr;
}
function bytes8s(bytes8 a) internal pure returns (bytes8[] memory) {
bytes8[] memory arr = new bytes8[](1);
arr[0] = a;
return arr;
}
function bytes8s(bytes8 a,bytes8 b) internal pure returns (bytes8[] memory) {
bytes8[] memory arr = new bytes8[](2);
arr[0] = a;
arr[1] = b;
return arr;
}
function bytes8s(bytes8 a,bytes8 b,bytes8 c) internal pure returns (bytes8[] memory) {
bytes8[] memory arr = new bytes8[](3);
arr[0] = a;
arr[1] = b;
arr[2] = c;
return arr;
}
function bytes8s(bytes8 a,bytes8 b,bytes8 c,bytes8 d) internal pure returns (bytes8[] memory) {
bytes8[] memory arr = new bytes8[](4);
arr[0] = a;
arr[1] = b;
arr[2] = c;
arr[3] = d;
return arr;
}
function bytes8s(bytes8 a,bytes8 b,bytes8 c,bytes8 d,bytes8 e) internal pure returns (bytes8[] memory) {
bytes8[] memory arr = new bytes8[](5);
arr[0] = a;
arr[1] = b;
arr[2] = c;
arr[3] = d;
arr[4] = e;
return arr;
}
function bytes8s(bytes8 a,bytes8 b,bytes8 c,bytes8 d,bytes8 e,bytes8 f) internal pure returns (bytes8[] memory) {
bytes8[] memory arr = new bytes8[](6);
arr[0] = a;
arr[1] = b;
arr[2] = c;
arr[3] = d;
arr[4] = e;
arr[5] = f;
return arr;
}
function bytes8s(bytes8 a,bytes8 b,bytes8 c,bytes8 d,bytes8 e,bytes8 f,bytes8 g) internal pure returns (bytes8[] memory) {
bytes8[] memory arr = new bytes8[](7);
arr[0] = a;
arr[1] = b;
arr[2] = c;
arr[3] = d;
arr[4] = e;
arr[5] = f;
arr[6] = g;
return arr;
}
function bytes16s(bytes16 a) internal pure returns (bytes16[] memory) {
bytes16[] memory arr = new bytes16[](1);
arr[0] = a;
return arr;
}
function bytes16s(bytes16 a,bytes16 b) internal pure returns (bytes16[] memory) {
bytes16[] memory arr = new bytes16[](2);
arr[0] = a;
arr[1] = b;
return arr;
}
function bytes16s(bytes16 a,bytes16 b,bytes16 c) internal pure returns (bytes16[] memory) {
bytes16[] memory arr = new bytes16[](3);
arr[0] = a;
arr[1] = b;
arr[2] = c;
return arr;
}
function bytes16s(bytes16 a,bytes16 b,bytes16 c,bytes16 d) internal pure returns (bytes16[] memory) {
bytes16[] memory arr = new bytes16[](4);
arr[0] = a;
arr[1] = b;
arr[2] = c;
arr[3] = d;
return arr;
}
function bytes16s(bytes16 a,bytes16 b,bytes16 c,bytes16 d,bytes16 e) internal pure returns (bytes16[] memory) {
bytes16[] memory arr = new bytes16[](5);
arr[0] = a;
arr[1] = b;
arr[2] = c;
arr[3] = d;
arr[4] = e;
return arr;
}
function bytes16s(bytes16 a,bytes16 b,bytes16 c,bytes16 d,bytes16 e,bytes16 f) internal pure returns (bytes16[] memory) {
bytes16[] memory arr = new bytes16[](6);
arr[0] = a;
arr[1] = b;
arr[2] = c;
arr[3] = d;
arr[4] = e;
arr[5] = f;
return arr;
}
function bytes16s(bytes16 a,bytes16 b,bytes16 c,bytes16 d,bytes16 e,bytes16 f,bytes16 g) internal pure returns (bytes16[] memory) {
bytes16[] memory arr = new bytes16[](7);
arr[0] = a;
arr[1] = b;
arr[2] = c;
arr[3] = d;
arr[4] = e;
arr[5] = f;
arr[6] = g;
return arr;
}
function bytes20s(bytes20 a) internal pure returns (bytes20[] memory) {
bytes20[] memory arr = new bytes20[](1);
arr[0] = a;
return arr;
}
function bytes20s(bytes20 a,bytes20 b) internal pure returns (bytes20[] memory) {
bytes20[] memory arr = new bytes20[](2);
arr[0] = a;
arr[1] = b;
return arr;
}
function bytes20s(bytes20 a,bytes20 b,bytes20 c) internal pure returns (bytes20[] memory) {
bytes20[] memory arr = new bytes20[](3);
arr[0] = a;
arr[1] = b;
arr[2] = c;
return arr;
}
function bytes20s(bytes20 a,bytes20 b,bytes20 c,bytes20 d) internal pure returns (bytes20[] memory) {
bytes20[] memory arr = new bytes20[](4);
arr[0] = a;
arr[1] = b;
arr[2] = c;
arr[3] = d;
return arr;
}
function bytes20s(bytes20 a,bytes20 b,bytes20 c,bytes20 d,bytes20 e) internal pure returns (bytes20[] memory) {
bytes20[] memory arr = new bytes20[](5);
arr[0] = a;
arr[1] = b;
arr[2] = c;
arr[3] = d;
arr[4] = e;
return arr;
}
function bytes20s(bytes20 a,bytes20 b,bytes20 c,bytes20 d,bytes20 e,bytes20 f) internal pure returns (bytes20[] memory) {
bytes20[] memory arr = new bytes20[](6);
arr[0] = a;
arr[1] = b;
arr[2] = c;
arr[3] = d;
arr[4] = e;
arr[5] = f;
return arr;
}
function bytes20s(bytes20 a,bytes20 b,bytes20 c,bytes20 d,bytes20 e,bytes20 f,bytes20 g) internal pure returns (bytes20[] memory) {
bytes20[] memory arr = new bytes20[](7);
arr[0] = a;
arr[1] = b;
arr[2] = c;
arr[3] = d;
arr[4] = e;
arr[5] = f;
arr[6] = g;
return arr;
}
function bytes32s(bytes32 a) internal pure returns (bytes32[] memory) {
bytes32[] memory arr = new bytes32[](1);
arr[0] = a;
return arr;
}
function bytes32s(bytes32 a,bytes32 b) internal pure returns (bytes32[] memory) {
bytes32[] memory arr = new bytes32[](2);
arr[0] = a;
arr[1] = b;
return arr;
}
function bytes32s(bytes32 a,bytes32 b,bytes32 c) internal pure returns (bytes32[] memory) {
bytes32[] memory arr = new bytes32[](3);
arr[0] = a;
arr[1] = b;
arr[2] = c;
return arr;
}
function bytes32s(bytes32 a,bytes32 b,bytes32 c,bytes32 d) internal pure returns (bytes32[] memory) {
bytes32[] memory arr = new bytes32[](4);
arr[0] = a;
arr[1] = b;
arr[2] = c;
arr[3] = d;
return arr;
}
function bytes32s(bytes32 a,bytes32 b,bytes32 c,bytes32 d,bytes32 e) internal pure returns (bytes32[] memory) {
bytes32[] memory arr = new bytes32[](5);
arr[0] = a;
arr[1] = b;
arr[2] = c;
arr[3] = d;
arr[4] = e;
return arr;
}
function bytes32s(bytes32 a,bytes32 b,bytes32 c,bytes32 d,bytes32 e,bytes32 f) internal pure returns (bytes32[] memory) {
bytes32[] memory arr = new bytes32[](6);
arr[0] = a;
arr[1] = b;
arr[2] = c;
arr[3] = d;
arr[4] = e;
arr[5] = f;
return arr;
}
function bytes32s(bytes32 a,bytes32 b,bytes32 c,bytes32 d,bytes32 e,bytes32 f,bytes32 g) internal pure returns (bytes32[] memory) {
bytes32[] memory arr = new bytes32[](7);
arr[0] = a;
arr[1] = b;
arr[2] = c;
arr[3] = d;
arr[4] = e;
arr[5] = f;
arr[6] = g;
return arr;
}
function bytess(bytes memory a) internal pure returns (bytes[] memory) {
bytes[] memory arr = new bytes[](1);
arr[0] = a;
return arr;
}
function bytess(bytes memory a,bytes memory b) internal pure returns (bytes[] memory) {
bytes[] memory arr = new bytes[](2);
arr[0] = a;
arr[1] = b;
return arr;
}
function bytess(bytes memory a,bytes memory b,bytes memory c) internal pure returns (bytes[] memory) {
bytes[] memory arr = new bytes[](3);
arr[0] = a;
arr[1] = b;
arr[2] = c;
return arr;
}
function bytess(bytes memory a,bytes memory b,bytes memory c,bytes memory d) internal pure returns (bytes[] memory) {
bytes[] memory arr = new bytes[](4);
arr[0] = a;
arr[1] = b;
arr[2] = c;
arr[3] = d;
return arr;
}
function bytess(bytes memory a,bytes memory b,bytes memory c,bytes memory d,bytes memory e) internal pure returns (bytes[] memory) {
bytes[] memory arr = new bytes[](5);
arr[0] = a;
arr[1] = b;
arr[2] = c;
arr[3] = d;
arr[4] = e;
return arr;
}
function bytess(bytes memory a,bytes memory b,bytes memory c,bytes memory d,bytes memory e,bytes memory f) internal pure returns (bytes[] memory) {
bytes[] memory arr = new bytes[](6);
arr[0] = a;
arr[1] = b;
arr[2] = c;
arr[3] = d;
arr[4] = e;
arr[5] = f;
return arr;
}
function bytess(bytes memory a,bytes memory b,bytes memory c,bytes memory d,bytes memory e,bytes memory f,bytes memory g) internal pure returns (bytes[] memory) {
bytes[] memory arr = new bytes[](7);
arr[0] = a;
arr[1] = b;
arr[2] = c;
arr[3] = d;
arr[4] = e;
arr[5] = f;
arr[6] = g;
return arr;
}
function addresses(address a) internal pure returns (address[] memory) {
address[] memory arr = new address[](1);
arr[0] = a;
return arr;
}
function addresses(address a,address b) internal pure returns (address[] memory) {
address[] memory arr = new address[](2);
arr[0] = a;
arr[1] = b;
return arr;
}
function addresses(address a,address b,address c) internal pure returns (address[] memory) {
address[] memory arr = new address[](3);
arr[0] = a;
arr[1] = b;
arr[2] = c;
return arr;
}
function addresses(address a,address b,address c,address d) internal pure returns (address[] memory) {
address[] memory arr = new address[](4);
arr[0] = a;
arr[1] = b;
arr[2] = c;
arr[3] = d;
return arr;
}
function addresses(address a,address b,address c,address d,address e) internal pure returns (address[] memory) {
address[] memory arr = new address[](5);
arr[0] = a;
arr[1] = b;
arr[2] = c;
arr[3] = d;
arr[4] = e;
return arr;
}
function addresses(address a,address b,address c,address d,address e,address f) internal pure returns (address[] memory) {
address[] memory arr = new address[](6);
arr[0] = a;
arr[1] = b;
arr[2] = c;
arr[3] = d;
arr[4] = e;
arr[5] = f;
return arr;
}
function addresses(address a,address b,address c,address d,address e,address f,address g) internal pure returns (address[] memory) {
address[] memory arr = new address[](7);
arr[0] = a;
arr[1] = b;
arr[2] = c;
arr[3] = d;
arr[4] = e;
arr[5] = f;
arr[6] = g;
return arr;
}
function bools(bool a) internal pure returns (bool[] memory) {
bool[] memory arr = new bool[](1);
arr[0] = a;
return arr;
}
function bools(bool a,bool b) internal pure returns (bool[] memory) {
bool[] memory arr = new bool[](2);
arr[0] = a;
arr[1] = b;
return arr;
}
function bools(bool a,bool b,bool c) internal pure returns (bool[] memory) {
bool[] memory arr = new bool[](3);
arr[0] = a;
arr[1] = b;
arr[2] = c;
return arr;
}
function bools(bool a,bool b,bool c,bool d) internal pure returns (bool[] memory) {
bool[] memory arr = new bool[](4);
arr[0] = a;
arr[1] = b;
arr[2] = c;
arr[3] = d;
return arr;
}
function bools(bool a,bool b,bool c,bool d,bool e) internal pure returns (bool[] memory) {
bool[] memory arr = new bool[](5);
arr[0] = a;
arr[1] = b;
arr[2] = c;
arr[3] = d;
arr[4] = e;
return arr;
}
function bools(bool a,bool b,bool c,bool d,bool e,bool f) internal pure returns (bool[] memory) {
bool[] memory arr = new bool[](6);
arr[0] = a;
arr[1] = b;
arr[2] = c;
arr[3] = d;
arr[4] = e;
arr[5] = f;
return arr;
}
function bools(bool a,bool b,bool c,bool d,bool e,bool f,bool g) internal pure returns (bool[] memory) {
bool[] memory arr = new bool[](7);
arr[0] = a;
arr[1] = b;
arr[2] = c;
arr[3] = d;
arr[4] = e;
arr[5] = f;
arr[6] = g;
return arr;
}
function strings(string memory a) internal pure returns (string[] memory) {
string[] memory arr = new string[](1);
arr[0] = a;
return arr;
}
function strings(string memory a,string memory b) internal pure returns (string[] memory) {
string[] memory arr = new string[](2);
arr[0] = a;
arr[1] = b;
return arr;
}
function strings(string memory a,string memory b,string memory c) internal pure returns (string[] memory) {
string[] memory arr = new string[](3);
arr[0] = a;
arr[1] = b;
arr[2] = c;
return arr;
}
function strings(string memory a,string memory b,string memory c,string memory d) internal pure returns (string[] memory) {
string[] memory arr = new string[](4);
arr[0] = a;
arr[1] = b;
arr[2] = c;
arr[3] = d;
return arr;
}
function strings(string memory a,string memory b,string memory c,string memory d,string memory e) internal pure returns (string[] memory) {
string[] memory arr = new string[](5);
arr[0] = a;
arr[1] = b;
arr[2] = c;
arr[3] = d;
arr[4] = e;
return arr;
}
function strings(string memory a,string memory b,string memory c,string memory d,string memory e,string memory f) internal pure returns (string[] memory) {
string[] memory arr = new string[](6);
arr[0] = a;
arr[1] = b;
arr[2] = c;
arr[3] = d;
arr[4] = e;
arr[5] = f;
return arr;
}
function strings(string memory a,string memory b,string memory c,string memory d,string memory e,string memory f,string memory g) internal pure returns (string[] memory) {
string[] memory arr = new string[](7);
arr[0] = a;
arr[1] = b;
arr[2] = c;
arr[3] = d;
arr[4] = e;
arr[5] = f;
arr[6] = g;
return arr;
}
}
文件 28 的 28:Strings.sol
pragma solidity ^0.8.20;
import {Math} from "./math/Math.sol";
import {SignedMath} from "./math/SignedMath.sol";
library Strings {
bytes16 private constant HEX_DIGITS = "0123456789abcdef";
uint8 private constant ADDRESS_LENGTH = 20;
error StringsInsufficientHexLength(uint256 value, uint256 length);
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), HEX_DIGITS))
}
value /= 10;
if (value == 0) break;
}
return buffer;
}
}
function toStringSigned(int256 value) internal pure returns (string memory) {
return string.concat(value < 0 ? "-" : "", toString(SignedMath.abs(value)));
}
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) {
uint256 localValue = value;
bytes memory buffer = new bytes(2 * length + 2);
buffer[0] = "0";
buffer[1] = "x";
for (uint256 i = 2 * length + 1; i > 1; --i) {
buffer[i] = HEX_DIGITS[localValue & 0xf];
localValue >>= 4;
}
if (localValue != 0) {
revert StringsInsufficientHexLength(value, length);
}
return string(buffer);
}
function toHexString(address addr) internal pure returns (string memory) {
return toHexString(uint256(uint160(addr)), ADDRESS_LENGTH);
}
function equal(string memory a, string memory b) internal pure returns (bool) {
return bytes(a).length == bytes(b).length && keccak256(bytes(a)) == keccak256(bytes(b));
}
}
{
"compilationTarget": {
"src/contracts/tokenforge/factories/MintFactory.sol": "MintFactory"
},
"evmVersion": "shanghai",
"libraries": {},
"metadata": {
"bytecodeHash": "ipfs"
},
"optimizer": {
"enabled": true,
"runs": 100
},
"remappings": [
":@openzeppelin/contracts-upgradeable/=lib/openzeppelin-contracts-upgradeable/contracts/",
":@openzeppelin/contracts/=lib/openzeppelin-contracts/contracts/",
":ds-test/=lib/solmate/lib/ds-test/src/",
":erc4626-tests/=lib/openzeppelin-contracts-upgradeable/lib/erc4626-tests/",
":forge-std/=lib/forge-std/src/",
":openzeppelin-contracts-upgradeable/=lib/openzeppelin-contracts-upgradeable/",
":openzeppelin-contracts/=lib/openzeppelin-contracts/",
":solarray/=lib/solarray/src/",
":solmate/=lib/solmate/src/"
]
}
[{"inputs":[{"internalType":"address","name":"initialOwner","type":"address"},{"internalType":"address","name":"platformFeeAddress","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"ERC1167FailedCreateClone","type":"error"},{"inputs":[],"name":"EnforcedPause","type":"error"},{"inputs":[],"name":"ExpectedPause","type":"error"},{"inputs":[{"internalType":"string","name":"message","type":"string"}],"name":"InvalidCollectionRequest","type":"error"},{"inputs":[],"name":"InvalidContractAddress","type":"error"},{"inputs":[],"name":"InvalidMintType","type":"error"},{"inputs":[],"name":"InvalidSignature","type":"error"},{"inputs":[],"name":"NotCollectionCreator","type":"error"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"OwnableInvalidOwner","type":"error"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"OwnableUnauthorizedAccount","type":"error"},{"inputs":[],"name":"ReentrancyGuardReentrantCall","type":"error"},{"inputs":[],"name":"SignatureInvalidated","type":"error"},{"inputs":[],"name":"SignatureUsed","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"contractAddress","type":"address"},{"indexed":true,"internalType":"address","name":"minter","type":"address"}],"name":"ContractCreated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferStarted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Paused","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes","name":"signature","type":"bytes"},{"indexed":true,"internalType":"address","name":"minter","type":"address"}],"name":"SignatureInvalidated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Unpaused","type":"event"},{"inputs":[],"name":"acceptOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"internalType":"address","name":"creator","type":"address"},{"internalType":"string","name":"name","type":"string"},{"internalType":"string","name":"description","type":"string"},{"internalType":"string","name":"symbol","type":"string"},{"internalType":"string","name":"image","type":"string"},{"internalType":"string","name":"animation_url","type":"string"},{"internalType":"string","name":"mintType","type":"string"},{"internalType":"uint128","name":"maxSupply","type":"uint128"},{"internalType":"uint128","name":"maxPerWallet","type":"uint128"},{"internalType":"uint256","name":"cost","type":"uint256"},{"internalType":"uint256","name":"startTime","type":"uint256"},{"internalType":"uint256","name":"endTime","type":"uint256"},{"components":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"amt","type":"uint256"}],"internalType":"struct Royalty[]","name":"royalties","type":"tuple[]"},{"internalType":"uint256","name":"nonce","type":"uint256"}],"internalType":"struct CollectionCreationRequest","name":"request","type":"tuple"},{"internalType":"bytes","name":"signature","type":"bytes"}],"name":"cancelSignature","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes","name":"","type":"bytes"}],"name":"cancelledSignatures","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"contracts","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"components":[{"internalType":"address","name":"creator","type":"address"},{"internalType":"string","name":"name","type":"string"},{"internalType":"string","name":"description","type":"string"},{"internalType":"string","name":"symbol","type":"string"},{"internalType":"string","name":"image","type":"string"},{"internalType":"string","name":"animation_url","type":"string"},{"internalType":"string","name":"mintType","type":"string"},{"internalType":"uint128","name":"maxSupply","type":"uint128"},{"internalType":"uint128","name":"maxPerWallet","type":"uint128"},{"internalType":"uint256","name":"cost","type":"uint256"},{"internalType":"uint256","name":"startTime","type":"uint256"},{"internalType":"uint256","name":"endTime","type":"uint256"},{"components":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"amt","type":"uint256"}],"internalType":"struct Royalty[]","name":"royalties","type":"tuple[]"},{"internalType":"uint256","name":"nonce","type":"uint256"}],"internalType":"struct CollectionCreationRequest","name":"request","type":"tuple"},{"internalType":"bytes","name":"signature","type":"bytes"},{"internalType":"uint256","name":"mintQuantity","type":"uint256"},{"internalType":"string","name":"comment","type":"string"}],"name":"createCollection","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"domainSeparator","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"feeOverrides","outputs":[{"internalType":"bool","name":"hasOverride","type":"bool"},{"internalType":"address","name":"addr","type":"address"},{"internalType":"uint256","name":"fee","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"components":[{"internalType":"address","name":"creator","type":"address"},{"internalType":"string","name":"name","type":"string"},{"internalType":"string","name":"description","type":"string"},{"internalType":"string","name":"symbol","type":"string"},{"internalType":"string","name":"image","type":"string"},{"internalType":"string","name":"animation_url","type":"string"},{"internalType":"string","name":"mintType","type":"string"},{"internalType":"uint128","name":"maxSupply","type":"uint128"},{"internalType":"uint128","name":"maxPerWallet","type":"uint128"},{"internalType":"uint256","name":"cost","type":"uint256"},{"internalType":"uint256","name":"startTime","type":"uint256"},{"internalType":"uint256","name":"endTime","type":"uint256"},{"components":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"amt","type":"uint256"}],"internalType":"struct Royalty[]","name":"royalties","type":"tuple[]"},{"internalType":"uint256","name":"nonce","type":"uint256"}],"internalType":"struct CollectionCreationRequest","name":"request","type":"tuple"}],"name":"getBytesToSign","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"components":[{"internalType":"address","name":"creator","type":"address"},{"internalType":"string","name":"name","type":"string"},{"internalType":"string","name":"description","type":"string"},{"internalType":"string","name":"symbol","type":"string"},{"internalType":"string","name":"image","type":"string"},{"internalType":"string","name":"animation_url","type":"string"},{"internalType":"string","name":"mintType","type":"string"},{"internalType":"uint128","name":"maxSupply","type":"uint128"},{"internalType":"uint128","name":"maxPerWallet","type":"uint128"},{"internalType":"uint256","name":"cost","type":"uint256"},{"internalType":"uint256","name":"startTime","type":"uint256"},{"internalType":"uint256","name":"endTime","type":"uint256"},{"components":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"amt","type":"uint256"}],"internalType":"struct Royalty[]","name":"royalties","type":"tuple[]"},{"internalType":"uint256","name":"nonce","type":"uint256"}],"internalType":"struct CollectionCreationRequest","name":"request","type":"tuple"}],"name":"getItemHash","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"pure","type":"function"},{"inputs":[{"components":[{"internalType":"address","name":"creator","type":"address"},{"internalType":"string","name":"name","type":"string"},{"internalType":"string","name":"description","type":"string"},{"internalType":"string","name":"symbol","type":"string"},{"internalType":"string","name":"image","type":"string"},{"internalType":"string","name":"animation_url","type":"string"},{"internalType":"string","name":"mintType","type":"string"},{"internalType":"uint128","name":"maxSupply","type":"uint128"},{"internalType":"uint128","name":"maxPerWallet","type":"uint128"},{"internalType":"uint256","name":"cost","type":"uint256"},{"internalType":"uint256","name":"startTime","type":"uint256"},{"internalType":"uint256","name":"endTime","type":"uint256"},{"components":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"amt","type":"uint256"}],"internalType":"struct Royalty[]","name":"royalties","type":"tuple[]"},{"internalType":"uint256","name":"nonce","type":"uint256"}],"internalType":"struct CollectionCreationRequest","name":"request","type":"tuple"}],"name":"getMintingAddress","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"contractAddress","type":"address"}],"name":"getMintingFee","outputs":[{"components":[{"internalType":"bool","name":"hasOverride","type":"bool"},{"internalType":"address","name":"addr","type":"address"},{"internalType":"uint256","name":"fee","type":"uint256"}],"internalType":"struct MintingFee","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"components":[{"internalType":"address","name":"creator","type":"address"},{"internalType":"string","name":"name","type":"string"},{"internalType":"string","name":"description","type":"string"},{"internalType":"string","name":"symbol","type":"string"},{"internalType":"string","name":"image","type":"string"},{"internalType":"string","name":"animation_url","type":"string"},{"internalType":"string","name":"mintType","type":"string"},{"internalType":"uint128","name":"maxSupply","type":"uint128"},{"internalType":"uint128","name":"maxPerWallet","type":"uint128"},{"internalType":"uint256","name":"cost","type":"uint256"},{"internalType":"uint256","name":"startTime","type":"uint256"},{"internalType":"uint256","name":"endTime","type":"uint256"},{"components":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"amt","type":"uint256"}],"internalType":"struct Royalty[]","name":"royalties","type":"tuple[]"},{"internalType":"uint256","name":"nonce","type":"uint256"}],"internalType":"struct CollectionCreationRequest","name":"request","type":"tuple"}],"name":"getSalt","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"contractAddress","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"quantity","type":"uint256"},{"internalType":"string","name":"comment","type":"string"}],"name":"mint","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"string","name":"","type":"string"}],"name":"mintImplementation","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"mintingFee","outputs":[{"internalType":"bool","name":"hasOverride","type":"bool"},{"internalType":"address","name":"addr","type":"address"},{"internalType":"uint256","name":"fee","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pause","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"paused","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pendingOwner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"contractType","type":"string"},{"internalType":"address","name":"addr","type":"address"}],"name":"setMintContract","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"internalType":"bool","name":"hasOverride","type":"bool"},{"internalType":"address","name":"addr","type":"address"},{"internalType":"uint256","name":"fee","type":"uint256"}],"internalType":"struct MintingFee","name":"fee","type":"tuple"}],"name":"setMintingFee","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"addr","type":"address"},{"components":[{"internalType":"bool","name":"hasOverride","type":"bool"},{"internalType":"address","name":"addr","type":"address"},{"internalType":"uint256","name":"fee","type":"uint256"}],"internalType":"struct MintingFee","name":"fee","type":"tuple"}],"name":"setMintingFeeOverride","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"unpause","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes","name":"","type":"bytes"}],"name":"usedSignatures","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"components":[{"internalType":"address","name":"creator","type":"address"},{"internalType":"string","name":"name","type":"string"},{"internalType":"string","name":"description","type":"string"},{"internalType":"string","name":"symbol","type":"string"},{"internalType":"string","name":"image","type":"string"},{"internalType":"string","name":"animation_url","type":"string"},{"internalType":"string","name":"mintType","type":"string"},{"internalType":"uint128","name":"maxSupply","type":"uint128"},{"internalType":"uint128","name":"maxPerWallet","type":"uint128"},{"internalType":"uint256","name":"cost","type":"uint256"},{"internalType":"uint256","name":"startTime","type":"uint256"},{"internalType":"uint256","name":"endTime","type":"uint256"},{"components":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"amt","type":"uint256"}],"internalType":"struct Royalty[]","name":"royalties","type":"tuple[]"},{"internalType":"uint256","name":"nonce","type":"uint256"}],"internalType":"struct CollectionCreationRequest","name":"request","type":"tuple"},{"internalType":"bytes","name":"signature","type":"bytes"}],"name":"verifySignature","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"}]