编译器
0.8.23+commit.f704f362
文件 1 的 11:ERC1155P.sol
pragma solidity ^0.8.20;
import "./IERC1155P.sol";
interface ERC1155P__IERC1155Receiver {
function onERC1155Received(
address operator,
address from,
uint256 id,
uint256 value,
bytes calldata data
) external returns (bytes4);
function onERC1155BatchReceived(
address operator,
address from,
uint256[] calldata ids,
uint256[] calldata values,
bytes calldata data
) external returns (bytes4);
}
interface ERC1155P__IERC1155MetadataURI {
function uri(uint256 id) external view returns (string memory);
}
abstract contract ERC1155P is IERC1155P, ERC1155P__IERC1155MetadataURI {
uint256 private constant MAX_ACCOUNT_TOKEN_BALANCE = 0xFFFF;
uint256 private constant BALANCE_STORAGE_OFFSET =
0xE000000000000000000000000000000000000000000000000000000000000000;
uint256 private constant APPROVAL_STORAGE_OFFSET =
0xD000000000000000000000000000000000000000000000000000000000000000;
uint256 private constant MAX_TOKEN_ID = 0x07FFFFFFFFFFFFFFFFFFFFFFF;
bytes32 private constant _TRANSFER_SINGLE_EVENT_SIGNATURE =
0xc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62;
bytes32 private constant _TRANSFER_BATCH_EVENT_SIGNATURE =
0x4a39dc06d4c0dbc64b70af90fd698a233a518aa5d07e595d983b8c0526c8f7fb;
bytes32 private constant _APPROVAL_FOR_ALL_EVENT_SIGNATURE =
0x17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31;
function name() public view virtual returns(string memory);
function symbol() public view virtual returns(string memory);
function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
return
interfaceId == 0x01ffc9a7 ||
interfaceId == 0xd9b67a26 ||
interfaceId == 0x0e89341c;
}
function uri(uint256 id) public view virtual returns (string memory);
function balanceOf(address account, uint256 id) public view virtual override returns (uint256) {
if(account == address(0)) { _revert(BalanceQueryForZeroAddress.selector); }
return getBalance(account, id);
}
function _numberMinted(address account, uint256 id) internal view returns (uint256) {
if(account == address(0)) { _revert(BalanceQueryForZeroAddress.selector); }
return getMinted(account, id);
}
function getBalance(address account, uint256 id) private view returns (uint256 _balance) {
assembly {
mstore(0x00, or(BALANCE_STORAGE_OFFSET, or(shr(4, shl(96, account)), shr(3, id))))
_balance := shr(shl(5, and(id, 0x07)), and(sload(keccak256(0x00, 0x20)), shl(shl(5, and(id, 0x07)), 0x0000FFFF)))
}
}
function setBalance(address account, uint256 id, uint256 amount) private {
assembly {
mstore(0x00, or(BALANCE_STORAGE_OFFSET, or(shr(4, shl(96, account)), shr(3, id))))
mstore(0x00, keccak256(0x00, 0x20))
sstore(mload(0x00), or(and(not(shl(shl(5, and(id, 0x07)), 0x0000FFFF)), sload(mload(0x00))), shl(shl(5, and(id, 0x07)), amount)))
}
}
function getMinted(address account, uint256 id) private view returns (uint256 _minted) {
assembly {
mstore(0x00, or(BALANCE_STORAGE_OFFSET, or(shr(4, shl(96, account)), shr(3, id))))
_minted := shr(16, shr(shl(5, and(id, 0x07)), and(sload(keccak256(0x00, 0x20)), shl(shl(5, and(id, 0x07)), 0xFFFF0000))))
}
}
function setMinted(address account, uint256 id, uint256 amount) private {
assembly {
mstore(0x00, or(BALANCE_STORAGE_OFFSET, or(shr(4, shl(96, account)), shr(3, id))))
mstore(0x00, keccak256(0x00, 0x20))
sstore(mload(0x00), or(and(not(shl(shl(5, and(id, 0x07)), 0xFFFF0000)), sload(mload(0x00))), shl(shl(5, and(id, 0x07)), shl(16, amount))))
}
}
function balanceOfBatch(
address[] calldata accounts,
uint256[] calldata ids
) public view virtual override returns (uint256[] memory) {
if(accounts.length != ids.length) { _revert(ArrayLengthMismatch.selector); }
uint256[] memory batchBalances = new uint256[](accounts.length);
for(uint256 i = 0; i < accounts.length;) {
batchBalances[i] = balanceOf(accounts[i], ids[i]);
unchecked {
++i;
}
}
return batchBalances;
}
function isApprovedForAll(address account, address operator) public view virtual override returns (bool _approved) {
assembly {
mstore(0x00, shr(96, shl(96, account)))
mstore(0x20, or(APPROVAL_STORAGE_OFFSET, shr(96, shl(96, operator))))
mstore(0x00, keccak256(0x00, 0x40))
_approved := sload(mload(0x00))
}
return _approved;
}
function safeTransferFrom(
address from,
address to,
uint256 id,
uint256 amount,
bytes memory data
) public virtual override {
_safeTransferFrom(from, to, id, amount, data);
}
function safeBatchTransferFrom(
address from,
address to,
uint256[] calldata ids,
uint256[] calldata amounts,
bytes memory data
) public virtual override {
_safeBatchTransferFrom(from, to, ids, amounts, data);
}
function _safeTransferFrom(
address from,
address to,
uint256 id,
uint256 amount,
bytes memory data
) internal virtual {
if(id > MAX_TOKEN_ID) { _revert(ExceedsMaximumTokenId.selector); }
if(to == address(0)) { _revert(TransferToZeroAddress.selector); }
if(from != _msgSenderERC1155P())
if (!isApprovedForAll(from, _msgSenderERC1155P())) _revert(TransferCallerNotOwnerNorApproved.selector);
address operator = _msgSenderERC1155P();
_beforeTokenTransfer(operator, from, to, id, amount, data);
uint256 fromBalance = getBalance(from, id);
if(amount > fromBalance) { _revert(TransferExceedsBalance.selector); }
if(from != to) {
uint256 toBalance = getBalance(to, id);
unchecked {
fromBalance -= amount;
toBalance += amount;
}
if(toBalance > MAX_ACCOUNT_TOKEN_BALANCE) { _revert(ExceedsMaximumBalance.selector); }
setBalance(from, id, fromBalance);
setBalance(to, id, toBalance);
}
assembly {
let memOffset := mload(0x40)
mstore(memOffset, id)
mstore(add(memOffset, 0x20), amount)
log4(
memOffset,
0x40,
_TRANSFER_SINGLE_EVENT_SIGNATURE,
operator,
from,
to
)
}
_afterTokenTransfer(operator, from, to, id, amount, data);
if(to.code.length != 0)
if(!_checkContractOnERC1155Received(from, to, id, amount, data)) {
_revert(TransferToNonERC1155ReceiverImplementer.selector);
}
}
function _safeBatchTransferFrom(
address from,
address to,
uint256[] calldata ids,
uint256[] calldata amounts,
bytes memory data
) internal virtual {
if(to == address(0)) { _revert(TransferToZeroAddress.selector); }
if(ids.length != amounts.length) { _revert(ArrayLengthMismatch.selector); }
if(from != _msgSenderERC1155P())
if (!isApprovedForAll(from, _msgSenderERC1155P())) _revert(TransferCallerNotOwnerNorApproved.selector);
address operator = _msgSenderERC1155P();
_beforeBatchTokenTransfer(operator, from, to, ids, amounts, data);
for (uint256 i = 0; i < ids.length;) {
uint256 id = ids[i];
uint256 amount = amounts[i];
if(id > MAX_TOKEN_ID) { _revert(ExceedsMaximumTokenId.selector); }
uint256 fromBalance = getBalance(from, id);
if(amount > fromBalance) { _revert(TransferExceedsBalance.selector); }
if(from != to) {
uint256 toBalance = getBalance(to, id);
unchecked {
fromBalance -= amount;
toBalance += amount;
}
if(toBalance > MAX_ACCOUNT_TOKEN_BALANCE) { _revert(ExceedsMaximumBalance.selector); }
setBalance(from, id, fromBalance);
setBalance(to, id, toBalance);
}
unchecked {
++i;
}
}
assembly {
let memOffset := mload(0x40)
mstore(memOffset, 0x40)
mstore(add(memOffset,0x20), add(0x60, mul(0x20,ids.length)))
mstore(add(memOffset,0x40), ids.length)
calldatacopy(add(memOffset,0x60), ids.offset, mul(0x20,ids.length))
mstore(add(add(memOffset,0x60),mul(0x20,ids.length)), amounts.length)
calldatacopy(add(add(memOffset,0x80),mul(0x20,ids.length)), amounts.offset, mul(0x20,amounts.length))
log4(
memOffset,
add(0x80,mul(0x40,amounts.length)),
_TRANSFER_BATCH_EVENT_SIGNATURE,
operator,
from,
to
)
}
_afterBatchTokenTransfer(operator, from, to, ids, amounts, data);
if(to.code.length != 0)
if(!_checkContractOnERC1155BatchReceived(from, to, ids, amounts, data)) {
_revert(TransferToNonERC1155ReceiverImplementer.selector);
}
}
function _mint(address to, uint256 id, uint256 amount, bytes memory data) internal virtual {
if(id > MAX_TOKEN_ID) { _revert(ExceedsMaximumTokenId.selector); }
if(to == address(0)) { _revert(MintToZeroAddress.selector); }
if(amount == 0) { _revert(MintZeroQuantity.selector); }
address operator = _msgSenderERC1155P();
_beforeTokenTransfer(operator, address(0), to, id, amount, data);
uint256 toBalanceBefore = getBalance(to, id);
uint256 toBalanceAfter;
unchecked {
toBalanceAfter = toBalanceBefore + amount;
}
if(toBalanceAfter > MAX_ACCOUNT_TOKEN_BALANCE) { _revert(ExceedsMaximumBalance.selector); }
if(toBalanceAfter < toBalanceBefore) { _revert(ExceedsMaximumBalance.selector); }
setBalance(to, id, toBalanceAfter);
uint256 toMintedBefore = getMinted(to, id);
uint256 toMintedAfter;
unchecked {
toMintedAfter = toMintedBefore + amount;
}
if(toMintedAfter > MAX_ACCOUNT_TOKEN_BALANCE) { _revert(ExceedsMaximumBalance.selector); }
if(toMintedAfter < toMintedBefore) { _revert(ExceedsMaximumBalance.selector); }
setMinted(to, id, toMintedAfter);
assembly {
let memOffset := mload(0x40)
mstore(memOffset, id)
mstore(add(memOffset, 0x20), amount)
log4(
memOffset,
0x40,
_TRANSFER_SINGLE_EVENT_SIGNATURE,
operator,
0,
to
)
}
_afterTokenTransfer(operator, address(0), to, id, amount, data);
if(to.code.length != 0)
if(!_checkContractOnERC1155Received(address(0), to, id, amount, data)) {
_revert(TransferToNonERC1155ReceiverImplementer.selector);
}
}
function _mintBatch(
address to,
uint256[] calldata ids,
uint256[] calldata amounts,
bytes memory data
) internal virtual {
if(to == address(0)) { _revert(MintToZeroAddress.selector); }
if(ids.length != amounts.length) { _revert(ArrayLengthMismatch.selector); }
address operator = _msgSenderERC1155P();
_beforeBatchTokenTransfer(operator, address(0), to, ids, amounts, data);
uint256 id;
uint256 amount;
for (uint256 i = 0; i < ids.length;) {
id = ids[i];
amount = amounts[i];
if(id > MAX_TOKEN_ID) { _revert(ExceedsMaximumTokenId.selector); }
if(amount == 0) { _revert(MintZeroQuantity.selector); }
uint256 toBalanceBefore = getBalance(to, id);
uint256 toBalanceAfter;
unchecked {
toBalanceAfter = toBalanceBefore + amount;
}
if(toBalanceAfter > MAX_ACCOUNT_TOKEN_BALANCE) { _revert(ExceedsMaximumBalance.selector); }
if(toBalanceAfter < toBalanceBefore) { _revert(ExceedsMaximumBalance.selector); }
setBalance(to, id, toBalanceAfter);
uint256 toMintedBefore = getMinted(to, id);
uint256 toMintedAfter;
unchecked {
toMintedAfter = toMintedBefore + amount;
}
if(toMintedAfter > MAX_ACCOUNT_TOKEN_BALANCE) { _revert(ExceedsMaximumBalance.selector); }
if(toMintedAfter < toMintedBefore) { _revert(ExceedsMaximumBalance.selector); }
setMinted(to, id, toMintedAfter);
unchecked {
++i;
}
}
assembly {
let memOffset := mload(0x40)
mstore(memOffset, 0x40)
mstore(add(memOffset,0x20), add(0x60, mul(0x20,ids.length)))
mstore(add(memOffset,0x40), ids.length)
calldatacopy(add(memOffset,0x60), ids.offset, mul(0x20,ids.length))
mstore(add(add(memOffset,0x60),mul(0x20,ids.length)), amounts.length)
calldatacopy(add(add(memOffset,0x80),mul(0x20,ids.length)), amounts.offset, mul(0x20,amounts.length))
log4(
memOffset,
add(0x80,mul(0x40,amounts.length)),
_TRANSFER_BATCH_EVENT_SIGNATURE,
operator,
0,
to
)
}
_afterBatchTokenTransfer(operator, address(0), to, ids, amounts, data);
if(to.code.length != 0)
if(!_checkContractOnERC1155BatchReceived(address(0), to, ids, amounts, data)) {
_revert(TransferToNonERC1155ReceiverImplementer.selector);
}
}
function _burn(address from, uint256 id, uint256 amount) internal virtual {
if(id > MAX_TOKEN_ID) { _revert(ExceedsMaximumTokenId.selector); }
if(from == address(0)) { _revert(BurnFromZeroAddress.selector); }
address operator = _msgSenderERC1155P();
_beforeTokenTransfer(operator, from, address(0), id, amount, "");
uint256 fromBalance = getBalance(from, id);
if(amount > fromBalance) { _revert(BurnExceedsBalance.selector); }
unchecked {
fromBalance -= amount;
}
setBalance(from, id, fromBalance);
assembly {
let memOffset := mload(0x40)
mstore(memOffset, id)
mstore(add(memOffset, 0x20), amount)
log4(
memOffset,
0x40,
_TRANSFER_SINGLE_EVENT_SIGNATURE,
operator,
from,
0
)
}
_afterTokenTransfer(operator, from, address(0), id, amount, "");
}
function _burnBatch(address from, uint256[] calldata ids, uint256[] calldata amounts) internal virtual {
if(from == address(0)) { _revert(BurnFromZeroAddress.selector); }
if(ids.length != amounts.length) { _revert(ArrayLengthMismatch.selector); }
address operator = _msgSenderERC1155P();
_beforeBatchTokenTransfer(operator, from, address(0), ids, amounts, "");
for (uint256 i = 0; i < ids.length;) {
uint256 id = ids[i];
uint256 amount = amounts[i];
if(id > MAX_TOKEN_ID) { _revert(ExceedsMaximumTokenId.selector); }
uint256 fromBalance = getBalance(from, id);
if(amount > fromBalance) { _revert(BurnExceedsBalance.selector); }
unchecked {
fromBalance -= amount;
}
setBalance(from, id, fromBalance);
unchecked {
++i;
}
}
assembly {
let memOffset := mload(0x40)
mstore(memOffset, 0x40)
mstore(add(memOffset,0x20), add(0x60, mul(0x20,ids.length)))
mstore(add(memOffset,0x40), ids.length)
calldatacopy(add(memOffset,0x60), ids.offset, mul(0x20,ids.length))
mstore(add(add(memOffset,0x60),mul(0x20,ids.length)), amounts.length)
calldatacopy(add(add(memOffset,0x80),mul(0x20,ids.length)), amounts.offset, mul(0x20,amounts.length))
log4(
memOffset,
add(0x80,mul(0x40,amounts.length)),
_TRANSFER_BATCH_EVENT_SIGNATURE,
operator,
from,
0
)
}
_afterBatchTokenTransfer(operator, from, address(0), ids, amounts, "");
}
function setApprovalForAll(address operator, bool approved) public virtual override {
assembly {
mstore(0x00, caller())
mstore(0x20, or(APPROVAL_STORAGE_OFFSET, shr(96, shl(96, operator))))
mstore(0x00, keccak256(0x00, 0x40))
mstore(0x20, approved)
sstore(mload(0x00), mload(0x20))
log3(
0x20,
0x20,
_APPROVAL_FOR_ALL_EVENT_SIGNATURE,
caller(),
shr(96, shl(96, operator))
)
}
}
function _beforeTokenTransfer(
address operator,
address from,
address to,
uint256 id,
uint256 amount,
bytes memory data
) internal virtual {}
function _beforeBatchTokenTransfer(
address operator,
address from,
address to,
uint256[] calldata ids,
uint256[] calldata amounts,
bytes memory data
) internal virtual {}
function _afterTokenTransfer(
address operator,
address from,
address to,
uint256 id,
uint256 amount,
bytes memory data
) internal virtual {}
function _afterBatchTokenTransfer(
address operator,
address from,
address to,
uint256[] calldata ids,
uint256[] calldata amounts,
bytes memory data
) internal virtual {}
function _checkContractOnERC1155Received(
address from,
address to,
uint256 id,
uint256 amount,
bytes memory _data
) private returns (bool) {
try ERC1155P__IERC1155Receiver(to).onERC1155Received(_msgSenderERC1155P(), from, id, amount, _data) returns (
bytes4 retval
) {
return retval == ERC1155P__IERC1155Receiver(to).onERC1155Received.selector;
} catch (bytes memory reason) {
if (reason.length == 0) {
_revert(TransferToNonERC1155ReceiverImplementer.selector);
}
assembly {
revert(add(32, reason), mload(reason))
}
}
}
function _checkContractOnERC1155BatchReceived(
address from,
address to,
uint256[] calldata ids,
uint256[] calldata amounts,
bytes memory _data
) private returns (bool) {
try ERC1155P__IERC1155Receiver(to).onERC1155BatchReceived(_msgSenderERC1155P(), from, ids, amounts, _data) returns (
bytes4 retval
) {
return retval == ERC1155P__IERC1155Receiver(to).onERC1155BatchReceived.selector;
} catch (bytes memory reason) {
if (reason.length == 0) {
_revert(TransferToNonERC1155ReceiverImplementer.selector);
}
assembly {
revert(add(32, reason), mload(reason))
}
}
}
function _msgSenderERC1155P() internal view virtual returns (address) {
return msg.sender;
}
function _toString(uint256 value) internal pure virtual returns (string memory str) {
assembly {
let m := add(mload(0x40), 0xa0)
mstore(0x40, m)
str := sub(m, 0x20)
mstore(str, 0)
let end := str
for { let temp := value } 1 {} {
str := sub(str, 1)
mstore8(str, add(48, mod(temp, 10)))
temp := div(temp, 10)
if iszero(temp) { break }
}
let length := sub(end, str)
str := sub(str, 0x20)
mstore(str, length)
}
}
function _revert(bytes4 errorSelector) internal pure {
assembly {
mstore(0x00, errorSelector)
revert(0x00, 0x04)
}
}
}
文件 2 的 11:ERC1155PSupply.sol
pragma solidity ^0.8.20;
import "../ERC1155P.sol";
abstract contract ERC1155PSupply is ERC1155P {
uint256 private constant TOTAL_SUPPLY_STORAGE_OFFSET =
0xF000000000000000000000000000000000000000000000000000000000000000;
uint256 private constant MAX_TOTAL_SUPPLY = 0xFFFFFFFF;
error ExceedsMaximumTotalSupply();
function totalSupply(
uint256 id
) public view virtual returns (uint256 _totalSupply) {
assembly {
mstore(0x00, or(TOTAL_SUPPLY_STORAGE_OFFSET, shr(2, id)))
_totalSupply := shr(shl(6, and(id, 0x03)), and(sload(keccak256(0x00, 0x20)), shl(shl(6, and(id, 0x03)), 0x00000000FFFFFFFF)))
}
}
function setTotalSupply(uint256 id, uint256 amount) private {
assembly {
mstore(0x00, or(TOTAL_SUPPLY_STORAGE_OFFSET, shr(2, id)))
mstore(0x00, keccak256(0x00, 0x20))
sstore(mload(0x00), or(and(not(shl(shl(6, and(id, 0x03)), 0x00000000FFFFFFFF)), sload(mload(0x00))), shl(shl(6, and(id, 0x03)), amount)))
}
}
function totalMinted(
uint256 id
) public view virtual returns (uint256 _totalMinted) {
assembly {
mstore(0x00, or(TOTAL_SUPPLY_STORAGE_OFFSET, shr(2, id)))
_totalMinted := shr(32, shr(shl(6, and(id, 0x03)), and(sload(keccak256(0x00, 0x20)), shl(shl(6, and(id, 0x03)), 0xFFFFFFFF00000000))))
}
}
function setTotalMinted(uint256 id, uint256 amount) private {
assembly {
mstore(0x00, or(TOTAL_SUPPLY_STORAGE_OFFSET, shr(2, id)))
mstore(0x00, keccak256(0x00, 0x20))
sstore(mload(0x00), or(and(not(shl(shl(6, and(id, 0x03)), 0xFFFFFFFF00000000)), sload(mload(0x00))), shl(shl(6, and(id, 0x03)), shl(32, amount))))
}
}
function exists(uint256 id) public view virtual returns (bool) {
return totalSupply(id) > 0;
}
function _beforeTokenTransfer(
address,
address from,
address to,
uint256 id,
uint256 amount,
bytes memory
) internal virtual override {
if (from == address(0)) {
uint256 supply = totalSupply(id);
uint256 minted = totalMinted(id);
unchecked {
supply += amount;
minted += amount;
}
if (supply > MAX_TOTAL_SUPPLY || minted > MAX_TOTAL_SUPPLY) {
ERC1155P._revert(ExceedsMaximumTotalSupply.selector);
}
setTotalSupply(id, supply);
setTotalMinted(id, minted);
}
if (to == address(0)) {
uint256 supply = totalSupply(id);
unchecked {
supply -= amount;
}
setTotalSupply(id, supply);
}
}
function _beforeBatchTokenTransfer(
address,
address from,
address to,
uint256[] calldata ids,
uint256[] calldata amounts,
bytes memory
) internal virtual override {
if (from == address(0)) {
for (uint256 i = 0; i < ids.length; ) {
uint256 id = ids[i];
uint256 supply = totalSupply(id);
uint256 minted = totalMinted(id);
unchecked {
supply += amounts[i];
minted += amounts[i];
++i;
}
if (supply > MAX_TOTAL_SUPPLY || minted > MAX_TOTAL_SUPPLY) {
ERC1155P._revert(ExceedsMaximumTotalSupply.selector);
}
setTotalSupply(id, supply);
setTotalMinted(id, minted);
}
}
if (to == address(0)) {
for (uint256 i = 0; i < ids.length; ) {
uint256 id = ids[i];
uint256 supply = totalSupply(id);
unchecked {
supply -= amounts[i];
++i;
}
setTotalSupply(id, supply);
}
}
}
function supportsInterface(
bytes4 interfaceId
) public view virtual override returns (bool) {
return super.supportsInterface(interfaceId);
}
}
文件 3 的 11:ERC2981.sol
pragma solidity ^0.8.4;
abstract contract ERC2981 {
error RoyaltyOverflow();
error RoyaltyReceiverIsZeroAddress();
uint256 private constant _ERC2981_MASTER_SLOT_SEED = 0xaa4ec00224afccfdb7;
constructor() {
require(_feeDenominator() != 0, "Fee denominator cannot be zero.");
}
function _feeDenominator() internal pure virtual returns (uint96) {
return 10000;
}
function supportsInterface(bytes4 interfaceId) public view virtual returns (bool result) {
assembly {
let s := shr(224, interfaceId)
result := or(eq(s, 0x01ffc9a7), eq(s, 0x2a55205a))
}
}
function royaltyInfo(uint256 tokenId, uint256 salePrice)
public
view
virtual
returns (address receiver, uint256 royaltyAmount)
{
uint256 feeDenominator = _feeDenominator();
assembly {
mstore(0x00, tokenId)
mstore(0x20, _ERC2981_MASTER_SLOT_SEED)
let packed := sload(keccak256(0x00, 0x40))
receiver := shr(96, packed)
if iszero(receiver) {
packed := sload(mload(0x20))
receiver := shr(96, packed)
}
let x := salePrice
let y := xor(packed, shl(96, receiver))
returndatacopy(returndatasize(), returndatasize(), mul(y, gt(x, div(not(0), y))))
royaltyAmount := div(mul(x, y), feeDenominator)
}
}
function _setDefaultRoyalty(address receiver, uint96 feeNumerator) internal virtual {
uint256 feeDenominator = _feeDenominator();
assembly {
feeNumerator := shr(160, shl(160, feeNumerator))
if gt(feeNumerator, feeDenominator) {
mstore(0x00, 0x350a88b3)
revert(0x1c, 0x04)
}
let packed := shl(96, receiver)
if iszero(packed) {
mstore(0x00, 0xb4457eaa)
revert(0x1c, 0x04)
}
sstore(_ERC2981_MASTER_SLOT_SEED, or(packed, feeNumerator))
}
}
function _deleteDefaultRoyalty() internal virtual {
assembly {
sstore(_ERC2981_MASTER_SLOT_SEED, 0)
}
}
function _setTokenRoyalty(uint256 tokenId, address receiver, uint96 feeNumerator)
internal
virtual
{
uint256 feeDenominator = _feeDenominator();
assembly {
feeNumerator := shr(160, shl(160, feeNumerator))
if gt(feeNumerator, feeDenominator) {
mstore(0x00, 0x350a88b3)
revert(0x1c, 0x04)
}
let packed := shl(96, receiver)
if iszero(packed) {
mstore(0x00, 0xb4457eaa)
revert(0x1c, 0x04)
}
mstore(0x00, tokenId)
mstore(0x20, _ERC2981_MASTER_SLOT_SEED)
sstore(keccak256(0x00, 0x40), or(packed, feeNumerator))
}
}
function _resetTokenRoyalty(uint256 tokenId) internal virtual {
assembly {
mstore(0x00, tokenId)
mstore(0x20, _ERC2981_MASTER_SLOT_SEED)
sstore(keccak256(0x00, 0x40), 0)
}
}
}
文件 4 的 11:FrenzyTrait.sol
pragma solidity ^0.8.19;
import {ERC1155PSupply} from "ERC1155P/extensions/ERC1155PSupply.sol";
import {ERC2981} from "solady/src/tokens/ERC2981.sol";
import {ITokenMetadata} from "../interfaces/ITokenMetadata.sol";
import {OwnableRoles} from "solady/src/auth/OwnableRoles.sol";
import {ICreatorToken} from "../interfaces/ICreatorToken.sol";
import {ITransferValidator} from "../interfaces/ITransferValidator.sol";
import {LibMap} from "solady/src/utils/LibMap.sol";
contract FrenzyTrait is ERC1155PSupply, ERC2981, OwnableRoles, ICreatorToken {
using LibMap for LibMap.Uint8Map;
using LibMap for LibMap.Uint16Map;
error HashReplayed();
error ExceedsMaxSupply();
uint256 constant MANAGER_ROLE = _ROLE_0;
uint256 constant MINTER_ROLE = _ROLE_1;
address public renderer;
address private _transferValidator;
mapping(bytes32 => bool) public usedHashes;
mapping(address => bool) public bypassOperators;
LibMap.Uint8Map private _tokenData;
LibMap.Uint16Map private _maxSupplies;
constructor(uint256[] memory tokenData, uint256[] memory maxSupplies) {
_initializeOwner(tx.origin);
_setDefaultRoyalty(tx.origin, 800);
_transferValidator = 0xA000027A9B2802E1ddf7000061001e5c005A0000;
emit TransferValidatorUpdated(address(0), _transferValidator);
uint256 length = tokenData.length;
for (uint256 i = 0; i < length; i++) {
_tokenData.map[i] = tokenData[i];
}
length = maxSupplies.length;
for (uint256 i = 0; i < length; i++) {
_maxSupplies.map[i] = maxSupplies[i];
}
}
function name() public pure override returns (string memory) {
return "Frensville Frenzy Traits";
}
function symbol() public pure override returns (string memory) {
return "FTRAIT";
}
function uri(uint256 id) public view override returns (string memory) {
return ITokenMetadata(renderer).tokenURI(id);
}
function ownerMint(address to, uint256[] calldata ids, uint256[] calldata amounts)
external
onlyOwnerOrRoles(MANAGER_ROLE)
{
_mintBatch(to, ids, amounts, "");
}
function mint(address to, uint256[] calldata ids, uint256[] calldata amounts, bytes32 l1TxInfo)
external
onlyRoles(MINTER_ROLE)
{
if (usedHashes[l1TxInfo]) {
revert HashReplayed();
}
usedHashes[l1TxInfo] = true;
_mintBatch(to, ids, amounts, "");
}
function getTransferValidator() external view returns (address validator) {
validator = _transferValidator;
}
function setTransferValidator(address validator) external onlyOwnerOrRoles(MANAGER_ROLE) {
emit TransferValidatorUpdated(_transferValidator, validator);
_transferValidator = validator;
}
function setOverrideOperator(address operator, bool status) external onlyOwnerOrRoles(MANAGER_ROLE) {
bypassOperators[operator] = status;
}
function setDefaultRoyalty(address receiver, uint96 feeNumerator) external onlyOwnerOrRoles(MANAGER_ROLE) {
_setDefaultRoyalty(receiver, feeNumerator);
}
function setTokenData(uint256 tokenId, uint8 tokenData) external onlyOwnerOrRoles(MANAGER_ROLE) {
_tokenData.set(tokenId, tokenData);
}
function setMaxSupply(uint256 tokenId, uint16 maxSupply_) external onlyOwnerOrRoles(MANAGER_ROLE) {
_maxSupplies.set(tokenId, maxSupply_);
}
function setRenderer(address renderer_) external onlyOwnerOrRoles(MANAGER_ROLE) {
renderer = renderer_;
}
function getTokenData(uint256 tokenId)
external
view
returns (uint8 tokenType, uint8 tokenRarity)
{
uint8 tokenData = _tokenData.get(tokenId);
tokenType = tokenData & 0x0F;
tokenRarity = tokenData >> 4;
}
function maxSupply(uint256 tokenId) public view returns (uint256) {
return _maxSupplies.get(tokenId);
}
function getTransferValidationFunction()
external
pure
returns (bytes4 functionSignature, bool isViewFunction)
{
functionSignature = 0x1854b241;
isViewFunction = false;
}
function _beforeTokenTransfer(
address operator,
address from,
address to,
uint256 id,
uint256 amount,
bytes memory
) internal override {
if (from != address(0)) {
if (to != address(0)) {
if (!bypassOperators[operator]) {
if (_transferValidator != address(0)) {
ITransferValidator(_transferValidator).validateTransfer(
operator, from, to, id, amount
);
}
}
}
} else {
_ensureSupply(id, amount);
}
}
function _beforeBatchTokenTransfer(
address operator,
address from,
address to,
uint256[] calldata ids,
uint256[] calldata amounts,
bytes memory
) internal override {
if (from != address(0)) {
if (to != address(0)) {
if (!bypassOperators[operator]) {
if (_transferValidator != address(0)) {
for (uint256 i = 0; i < ids.length; i++) {
ITransferValidator(_transferValidator).validateTransfer(
operator, from, to, ids[i], amounts[i]
);
}
}
}
}
} else {
for (uint256 i = 0; i < ids.length; i++) {
_ensureSupply(ids[i], amounts[i]);
}
}
}
function _ensureSupply(uint256 id, uint256 amount) internal view {
if (totalSupply(id) + amount > maxSupply(id)) {
revert ExceedsMaxSupply();
}
}
function supportsInterface(bytes4 interfaceId)
public
view
override(ERC1155PSupply, ERC2981)
returns (bool result)
{
return
ERC1155PSupply.supportsInterface(interfaceId) || ERC2981.supportsInterface(interfaceId);
}
}
文件 5 的 11:ICreatorToken.sol
pragma solidity ^0.8.4;
interface ICreatorToken {
event TransferValidatorUpdated(address oldValidator, address newValidator);
function getTransferValidator() external view returns (address validator);
function setTransferValidator(address validator) external;
function getTransferValidationFunction() external view returns (bytes4 functionSignature, bool isViewFunction);
}
文件 6 的 11:IERC1155P.sol
pragma solidity ^0.8.20;
interface IERC1155P {
error BalanceQueryForZeroAddress();
error ArrayLengthMismatch();
error BurnFromZeroAddress();
error MintToZeroAddress();
error MintZeroQuantity();
error BurnExceedsBalance();
error TransferExceedsBalance();
error ExceedsMaximumBalance();
error TransferCallerNotOwnerNorApproved();
error TransferToNonERC1155ReceiverImplementer();
error TransferToZeroAddress();
error ExceedsMaximumTokenId();
function supportsInterface(bytes4 interfaceId) external view returns (bool);
event TransferSingle(address indexed operator, address indexed from, address indexed to, uint256 id, uint256 value);
event TransferBatch(
address indexed operator,
address indexed from,
address indexed to,
uint256[] ids,
uint256[] values
);
event ApprovalForAll(address indexed account, address indexed operator, bool approved);
event URI(string value, uint256 indexed id);
function balanceOf(address account, uint256 id) external view returns (uint256);
function balanceOfBatch(
address[] calldata accounts,
uint256[] calldata ids
) external view returns (uint256[] memory);
function setApprovalForAll(address operator, bool approved) external;
function isApprovedForAll(address account, address operator) external view returns (bool);
function safeTransferFrom(address from, address to, uint256 id, uint256 amount, bytes calldata data) external;
function safeBatchTransferFrom(
address from,
address to,
uint256[] calldata ids,
uint256[] calldata amounts,
bytes calldata data
) external;
}
文件 7 的 11:ITokenMetadata.sol
pragma solidity ^0.8.19;
interface ITokenMetadata {
function tokenURI(uint256 id) external view returns (string memory);
}
文件 8 的 11:ITransferValidator.sol
pragma solidity ^0.8.4;
interface ITransferValidator {
function applyCollectionTransferPolicy(address caller, address from, address to) external view;
function validateTransfer(address caller, address from, address to) external view;
function validateTransfer(address caller, address from, address to, uint256 tokenId) external view;
function validateTransfer(address caller, address from, address to, uint256 tokenId, uint256 amount) external;
function beforeAuthorizedTransfer(address operator, address token, uint256 tokenId) external;
function afterAuthorizedTransfer(address token, uint256 tokenId) external;
function beforeAuthorizedTransfer(address operator, address token) external;
function afterAuthorizedTransfer(address token) external;
function beforeAuthorizedTransfer(address token, uint256 tokenId) external;
function beforeAuthorizedTransferWithAmount(address token, uint256 tokenId, uint256 amount) external;
function afterAuthorizedTransferWithAmount(address token, uint256 tokenId) external;
}
文件 9 的 11:LibMap.sol
pragma solidity ^0.8.4;
library LibMap {
struct Uint8Map {
mapping(uint256 => uint256) map;
}
struct Uint16Map {
mapping(uint256 => uint256) map;
}
struct Uint32Map {
mapping(uint256 => uint256) map;
}
struct Uint40Map {
mapping(uint256 => uint256) map;
}
struct Uint64Map {
mapping(uint256 => uint256) map;
}
struct Uint128Map {
mapping(uint256 => uint256) map;
}
function get(Uint8Map storage map, uint256 index) internal view returns (uint8 result) {
assembly {
mstore(0x20, map.slot)
mstore(0x00, shr(5, index))
result := byte(and(31, not(index)), sload(keccak256(0x00, 0x40)))
}
}
function set(Uint8Map storage map, uint256 index, uint8 value) internal {
assembly {
mstore(0x20, map.slot)
mstore(0x00, shr(5, index))
let s := keccak256(0x00, 0x40)
mstore(0x00, sload(s))
mstore8(and(31, not(index)), value)
sstore(s, mload(0x00))
}
}
function get(Uint16Map storage map, uint256 index) internal view returns (uint16 result) {
result = uint16(map.map[index >> 4] >> ((index & 15) << 4));
}
function set(Uint16Map storage map, uint256 index, uint16 value) internal {
assembly {
mstore(0x20, map.slot)
mstore(0x00, shr(4, index))
let s := keccak256(0x00, 0x40)
let o := shl(4, and(index, 15))
let v := sload(s)
let m := 0xffff
sstore(s, xor(v, shl(o, and(m, xor(shr(o, v), value)))))
}
}
function get(Uint32Map storage map, uint256 index) internal view returns (uint32 result) {
result = uint32(map.map[index >> 3] >> ((index & 7) << 5));
}
function set(Uint32Map storage map, uint256 index, uint32 value) internal {
assembly {
mstore(0x20, map.slot)
mstore(0x00, shr(3, index))
let s := keccak256(0x00, 0x40)
let o := shl(5, and(index, 7))
let v := sload(s)
let m := 0xffffffff
sstore(s, xor(v, shl(o, and(m, xor(shr(o, v), value)))))
}
}
function get(Uint40Map storage map, uint256 index) internal view returns (uint40 result) {
unchecked {
result = uint40(map.map[index / 6] >> ((index % 6) * 40));
}
}
function set(Uint40Map storage map, uint256 index, uint40 value) internal {
assembly {
mstore(0x20, map.slot)
mstore(0x00, div(index, 6))
let s := keccak256(0x00, 0x40)
let o := mul(40, mod(index, 6))
let v := sload(s)
let m := 0xffffffffff
sstore(s, xor(v, shl(o, and(m, xor(shr(o, v), value)))))
}
}
function get(Uint64Map storage map, uint256 index) internal view returns (uint64 result) {
result = uint64(map.map[index >> 2] >> ((index & 3) << 6));
}
function set(Uint64Map storage map, uint256 index, uint64 value) internal {
assembly {
mstore(0x20, map.slot)
mstore(0x00, shr(2, index))
let s := keccak256(0x00, 0x40)
let o := shl(6, and(index, 3))
let v := sload(s)
let m := 0xffffffffffffffff
sstore(s, xor(v, shl(o, and(m, xor(shr(o, v), value)))))
}
}
function get(Uint128Map storage map, uint256 index) internal view returns (uint128 result) {
result = uint128(map.map[index >> 1] >> ((index & 1) << 7));
}
function set(Uint128Map storage map, uint256 index, uint128 value) internal {
assembly {
mstore(0x20, map.slot)
mstore(0x00, shr(1, index))
let s := keccak256(0x00, 0x40)
let o := shl(7, and(index, 1))
let v := sload(s)
let m := 0xffffffffffffffffffffffffffffffff
sstore(s, xor(v, shl(o, and(m, xor(shr(o, v), value)))))
}
}
function get(mapping(uint256 => uint256) storage map, uint256 index, uint256 bitWidth)
internal
view
returns (uint256 result)
{
unchecked {
uint256 d = _rawDiv(256, bitWidth);
uint256 m = (1 << bitWidth) - 1;
result = (map[_rawDiv(index, d)] >> (_rawMod(index, d) * bitWidth)) & m;
}
}
function set(
mapping(uint256 => uint256) storage map,
uint256 index,
uint256 value,
uint256 bitWidth
) internal {
unchecked {
uint256 d = _rawDiv(256, bitWidth);
uint256 m = (1 << bitWidth) - 1;
uint256 o = _rawMod(index, d) * bitWidth;
map[_rawDiv(index, d)] ^= (((map[_rawDiv(index, d)] >> o) ^ value) & m) << o;
}
}
function searchSorted(Uint8Map storage map, uint8 needle, uint256 start, uint256 end)
internal
view
returns (bool found, uint256 index)
{
return searchSorted(map.map, needle, start, end, 8);
}
function searchSorted(Uint16Map storage map, uint16 needle, uint256 start, uint256 end)
internal
view
returns (bool found, uint256 index)
{
return searchSorted(map.map, needle, start, end, 16);
}
function searchSorted(Uint32Map storage map, uint32 needle, uint256 start, uint256 end)
internal
view
returns (bool found, uint256 index)
{
return searchSorted(map.map, needle, start, end, 32);
}
function searchSorted(Uint40Map storage map, uint40 needle, uint256 start, uint256 end)
internal
view
returns (bool found, uint256 index)
{
return searchSorted(map.map, needle, start, end, 40);
}
function searchSorted(Uint64Map storage map, uint64 needle, uint256 start, uint256 end)
internal
view
returns (bool found, uint256 index)
{
return searchSorted(map.map, needle, start, end, 64);
}
function searchSorted(Uint128Map storage map, uint128 needle, uint256 start, uint256 end)
internal
view
returns (bool found, uint256 index)
{
return searchSorted(map.map, needle, start, end, 128);
}
function searchSorted(
mapping(uint256 => uint256) storage map,
uint256 needle,
uint256 start,
uint256 end,
uint256 bitWidth
) internal view returns (bool found, uint256 index) {
unchecked {
if (start >= end) end = start;
uint256 t;
uint256 o = start - 1;
uint256 l = 1;
uint256 d = _rawDiv(256, bitWidth);
uint256 m = (1 << bitWidth) - 1;
uint256 h = end - start;
while (true) {
index = (l & h) + ((l ^ h) >> 1);
if (l > h) break;
t = (map[_rawDiv(index + o, d)] >> (_rawMod(index + o, d) * bitWidth)) & m;
if (t == needle) break;
if (needle <= t) h = index - 1;
else l = index + 1;
}
assembly {
m := or(iszero(index), iszero(bitWidth))
found := iszero(or(xor(t, needle), m))
index := add(o, xor(index, mul(xor(index, 1), m)))
}
}
}
function _rawDiv(uint256 x, uint256 y) private pure returns (uint256 z) {
assembly {
z := div(x, y)
}
}
function _rawMod(uint256 x, uint256 y) private pure returns (uint256 z) {
assembly {
z := mod(x, y)
}
}
}
文件 10 的 11:Ownable.sol
pragma solidity ^0.8.4;
abstract contract Ownable {
error Unauthorized();
error NewOwnerIsZeroAddress();
error NoHandoverRequest();
error AlreadyInitialized();
event OwnershipTransferred(address indexed oldOwner, address indexed newOwner);
event OwnershipHandoverRequested(address indexed pendingOwner);
event OwnershipHandoverCanceled(address indexed pendingOwner);
uint256 private constant _OWNERSHIP_TRANSFERRED_EVENT_SIGNATURE =
0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0;
uint256 private constant _OWNERSHIP_HANDOVER_REQUESTED_EVENT_SIGNATURE =
0xdbf36a107da19e49527a7176a1babf963b4b0ff8cde35ee35d6cd8f1f9ac7e1d;
uint256 private constant _OWNERSHIP_HANDOVER_CANCELED_EVENT_SIGNATURE =
0xfa7b8eab7da67f412cc9575ed43464468f9bfbae89d1675917346ca6d8fe3c92;
bytes32 internal constant _OWNER_SLOT =
0xffffffffffffffffffffffffffffffffffffffffffffffffffffffff74873927;
uint256 private constant _HANDOVER_SLOT_SEED = 0x389a75e1;
function _guardInitializeOwner() internal pure virtual returns (bool guard) {}
function _initializeOwner(address newOwner) internal virtual {
if (_guardInitializeOwner()) {
assembly {
let ownerSlot := _OWNER_SLOT
if sload(ownerSlot) {
mstore(0x00, 0x0dc149f0)
revert(0x1c, 0x04)
}
newOwner := shr(96, shl(96, newOwner))
sstore(ownerSlot, or(newOwner, shl(255, iszero(newOwner))))
log3(0, 0, _OWNERSHIP_TRANSFERRED_EVENT_SIGNATURE, 0, newOwner)
}
} else {
assembly {
newOwner := shr(96, shl(96, newOwner))
sstore(_OWNER_SLOT, newOwner)
log3(0, 0, _OWNERSHIP_TRANSFERRED_EVENT_SIGNATURE, 0, newOwner)
}
}
}
function _setOwner(address newOwner) internal virtual {
if (_guardInitializeOwner()) {
assembly {
let ownerSlot := _OWNER_SLOT
newOwner := shr(96, shl(96, newOwner))
log3(0, 0, _OWNERSHIP_TRANSFERRED_EVENT_SIGNATURE, sload(ownerSlot), newOwner)
sstore(ownerSlot, or(newOwner, shl(255, iszero(newOwner))))
}
} else {
assembly {
let ownerSlot := _OWNER_SLOT
newOwner := shr(96, shl(96, newOwner))
log3(0, 0, _OWNERSHIP_TRANSFERRED_EVENT_SIGNATURE, sload(ownerSlot), newOwner)
sstore(ownerSlot, newOwner)
}
}
}
function _checkOwner() internal view virtual {
assembly {
if iszero(eq(caller(), sload(_OWNER_SLOT))) {
mstore(0x00, 0x82b42900)
revert(0x1c, 0x04)
}
}
}
function _ownershipHandoverValidFor() internal view virtual returns (uint64) {
return 48 * 3600;
}
function transferOwnership(address newOwner) public payable virtual onlyOwner {
assembly {
if iszero(shl(96, newOwner)) {
mstore(0x00, 0x7448fbae)
revert(0x1c, 0x04)
}
}
_setOwner(newOwner);
}
function renounceOwnership() public payable virtual onlyOwner {
_setOwner(address(0));
}
function requestOwnershipHandover() public payable virtual {
unchecked {
uint256 expires = block.timestamp + _ownershipHandoverValidFor();
assembly {
mstore(0x0c, _HANDOVER_SLOT_SEED)
mstore(0x00, caller())
sstore(keccak256(0x0c, 0x20), expires)
log2(0, 0, _OWNERSHIP_HANDOVER_REQUESTED_EVENT_SIGNATURE, caller())
}
}
}
function cancelOwnershipHandover() public payable virtual {
assembly {
mstore(0x0c, _HANDOVER_SLOT_SEED)
mstore(0x00, caller())
sstore(keccak256(0x0c, 0x20), 0)
log2(0, 0, _OWNERSHIP_HANDOVER_CANCELED_EVENT_SIGNATURE, caller())
}
}
function completeOwnershipHandover(address pendingOwner) public payable virtual onlyOwner {
assembly {
mstore(0x0c, _HANDOVER_SLOT_SEED)
mstore(0x00, pendingOwner)
let handoverSlot := keccak256(0x0c, 0x20)
if gt(timestamp(), sload(handoverSlot)) {
mstore(0x00, 0x6f5e8818)
revert(0x1c, 0x04)
}
sstore(handoverSlot, 0)
}
_setOwner(pendingOwner);
}
function owner() public view virtual returns (address result) {
assembly {
result := sload(_OWNER_SLOT)
}
}
function ownershipHandoverExpiresAt(address pendingOwner)
public
view
virtual
returns (uint256 result)
{
assembly {
mstore(0x0c, _HANDOVER_SLOT_SEED)
mstore(0x00, pendingOwner)
result := sload(keccak256(0x0c, 0x20))
}
}
modifier onlyOwner() virtual {
_checkOwner();
_;
}
}
文件 11 的 11:OwnableRoles.sol
pragma solidity ^0.8.4;
import {Ownable} from "./Ownable.sol";
abstract contract OwnableRoles is Ownable {
event RolesUpdated(address indexed user, uint256 indexed roles);
uint256 private constant _ROLES_UPDATED_EVENT_SIGNATURE =
0x715ad5ce61fc9595c7b415289d59cf203f23a94fa06f04af7e489a0a76e1fe26;
uint256 private constant _ROLE_SLOT_SEED = 0x8b78c6d8;
function _setRoles(address user, uint256 roles) internal virtual {
assembly {
mstore(0x0c, _ROLE_SLOT_SEED)
mstore(0x00, user)
sstore(keccak256(0x0c, 0x20), roles)
log3(0, 0, _ROLES_UPDATED_EVENT_SIGNATURE, shr(96, mload(0x0c)), roles)
}
}
function _updateRoles(address user, uint256 roles, bool on) internal virtual {
assembly {
mstore(0x0c, _ROLE_SLOT_SEED)
mstore(0x00, user)
let roleSlot := keccak256(0x0c, 0x20)
let current := sload(roleSlot)
let updated := or(current, roles)
if iszero(on) { updated := xor(current, and(current, roles)) }
sstore(roleSlot, updated)
log3(0, 0, _ROLES_UPDATED_EVENT_SIGNATURE, shr(96, mload(0x0c)), updated)
}
}
function _grantRoles(address user, uint256 roles) internal virtual {
_updateRoles(user, roles, true);
}
function _removeRoles(address user, uint256 roles) internal virtual {
_updateRoles(user, roles, false);
}
function _checkRoles(uint256 roles) internal view virtual {
assembly {
mstore(0x0c, _ROLE_SLOT_SEED)
mstore(0x00, caller())
if iszero(and(sload(keccak256(0x0c, 0x20)), roles)) {
mstore(0x00, 0x82b42900)
revert(0x1c, 0x04)
}
}
}
function _checkOwnerOrRoles(uint256 roles) internal view virtual {
assembly {
if iszero(eq(caller(), sload(not(_ROLE_SLOT_SEED)))) {
mstore(0x0c, _ROLE_SLOT_SEED)
mstore(0x00, caller())
if iszero(and(sload(keccak256(0x0c, 0x20)), roles)) {
mstore(0x00, 0x82b42900)
revert(0x1c, 0x04)
}
}
}
}
function _checkRolesOrOwner(uint256 roles) internal view virtual {
assembly {
mstore(0x0c, _ROLE_SLOT_SEED)
mstore(0x00, caller())
if iszero(and(sload(keccak256(0x0c, 0x20)), roles)) {
if iszero(eq(caller(), sload(not(_ROLE_SLOT_SEED)))) {
mstore(0x00, 0x82b42900)
revert(0x1c, 0x04)
}
}
}
}
function _rolesFromOrdinals(uint8[] memory ordinals) internal pure returns (uint256 roles) {
assembly {
for { let i := shl(5, mload(ordinals)) } i { i := sub(i, 0x20) } {
roles := or(shl(mload(add(ordinals, i)), 1), roles)
}
}
}
function _ordinalsFromRoles(uint256 roles) internal pure returns (uint8[] memory ordinals) {
assembly {
ordinals := mload(0x40)
let ptr := add(ordinals, 0x20)
let o := 0
for { let t := roles } 1 {} {
mstore(ptr, o)
ptr := add(ptr, shl(5, and(t, 1)))
o := add(o, 1)
t := shr(o, roles)
if iszero(t) { break }
}
mstore(ordinals, shr(5, sub(ptr, add(ordinals, 0x20))))
mstore(0x40, ptr)
}
}
function grantRoles(address user, uint256 roles) public payable virtual onlyOwner {
_grantRoles(user, roles);
}
function revokeRoles(address user, uint256 roles) public payable virtual onlyOwner {
_removeRoles(user, roles);
}
function renounceRoles(uint256 roles) public payable virtual {
_removeRoles(msg.sender, roles);
}
function rolesOf(address user) public view virtual returns (uint256 roles) {
assembly {
mstore(0x0c, _ROLE_SLOT_SEED)
mstore(0x00, user)
roles := sload(keccak256(0x0c, 0x20))
}
}
function hasAnyRole(address user, uint256 roles) public view virtual returns (bool) {
return rolesOf(user) & roles != 0;
}
function hasAllRoles(address user, uint256 roles) public view virtual returns (bool) {
return rolesOf(user) & roles == roles;
}
modifier onlyRoles(uint256 roles) virtual {
_checkRoles(roles);
_;
}
modifier onlyOwnerOrRoles(uint256 roles) virtual {
_checkOwnerOrRoles(roles);
_;
}
modifier onlyRolesOrOwner(uint256 roles) virtual {
_checkRolesOrOwner(roles);
_;
}
uint256 internal constant _ROLE_0 = 1 << 0;
uint256 internal constant _ROLE_1 = 1 << 1;
uint256 internal constant _ROLE_2 = 1 << 2;
uint256 internal constant _ROLE_3 = 1 << 3;
uint256 internal constant _ROLE_4 = 1 << 4;
uint256 internal constant _ROLE_5 = 1 << 5;
uint256 internal constant _ROLE_6 = 1 << 6;
uint256 internal constant _ROLE_7 = 1 << 7;
uint256 internal constant _ROLE_8 = 1 << 8;
uint256 internal constant _ROLE_9 = 1 << 9;
uint256 internal constant _ROLE_10 = 1 << 10;
uint256 internal constant _ROLE_11 = 1 << 11;
uint256 internal constant _ROLE_12 = 1 << 12;
uint256 internal constant _ROLE_13 = 1 << 13;
uint256 internal constant _ROLE_14 = 1 << 14;
uint256 internal constant _ROLE_15 = 1 << 15;
uint256 internal constant _ROLE_16 = 1 << 16;
uint256 internal constant _ROLE_17 = 1 << 17;
uint256 internal constant _ROLE_18 = 1 << 18;
uint256 internal constant _ROLE_19 = 1 << 19;
uint256 internal constant _ROLE_20 = 1 << 20;
uint256 internal constant _ROLE_21 = 1 << 21;
uint256 internal constant _ROLE_22 = 1 << 22;
uint256 internal constant _ROLE_23 = 1 << 23;
uint256 internal constant _ROLE_24 = 1 << 24;
uint256 internal constant _ROLE_25 = 1 << 25;
uint256 internal constant _ROLE_26 = 1 << 26;
uint256 internal constant _ROLE_27 = 1 << 27;
uint256 internal constant _ROLE_28 = 1 << 28;
uint256 internal constant _ROLE_29 = 1 << 29;
uint256 internal constant _ROLE_30 = 1 << 30;
uint256 internal constant _ROLE_31 = 1 << 31;
uint256 internal constant _ROLE_32 = 1 << 32;
uint256 internal constant _ROLE_33 = 1 << 33;
uint256 internal constant _ROLE_34 = 1 << 34;
uint256 internal constant _ROLE_35 = 1 << 35;
uint256 internal constant _ROLE_36 = 1 << 36;
uint256 internal constant _ROLE_37 = 1 << 37;
uint256 internal constant _ROLE_38 = 1 << 38;
uint256 internal constant _ROLE_39 = 1 << 39;
uint256 internal constant _ROLE_40 = 1 << 40;
uint256 internal constant _ROLE_41 = 1 << 41;
uint256 internal constant _ROLE_42 = 1 << 42;
uint256 internal constant _ROLE_43 = 1 << 43;
uint256 internal constant _ROLE_44 = 1 << 44;
uint256 internal constant _ROLE_45 = 1 << 45;
uint256 internal constant _ROLE_46 = 1 << 46;
uint256 internal constant _ROLE_47 = 1 << 47;
uint256 internal constant _ROLE_48 = 1 << 48;
uint256 internal constant _ROLE_49 = 1 << 49;
uint256 internal constant _ROLE_50 = 1 << 50;
uint256 internal constant _ROLE_51 = 1 << 51;
uint256 internal constant _ROLE_52 = 1 << 52;
uint256 internal constant _ROLE_53 = 1 << 53;
uint256 internal constant _ROLE_54 = 1 << 54;
uint256 internal constant _ROLE_55 = 1 << 55;
uint256 internal constant _ROLE_56 = 1 << 56;
uint256 internal constant _ROLE_57 = 1 << 57;
uint256 internal constant _ROLE_58 = 1 << 58;
uint256 internal constant _ROLE_59 = 1 << 59;
uint256 internal constant _ROLE_60 = 1 << 60;
uint256 internal constant _ROLE_61 = 1 << 61;
uint256 internal constant _ROLE_62 = 1 << 62;
uint256 internal constant _ROLE_63 = 1 << 63;
uint256 internal constant _ROLE_64 = 1 << 64;
uint256 internal constant _ROLE_65 = 1 << 65;
uint256 internal constant _ROLE_66 = 1 << 66;
uint256 internal constant _ROLE_67 = 1 << 67;
uint256 internal constant _ROLE_68 = 1 << 68;
uint256 internal constant _ROLE_69 = 1 << 69;
uint256 internal constant _ROLE_70 = 1 << 70;
uint256 internal constant _ROLE_71 = 1 << 71;
uint256 internal constant _ROLE_72 = 1 << 72;
uint256 internal constant _ROLE_73 = 1 << 73;
uint256 internal constant _ROLE_74 = 1 << 74;
uint256 internal constant _ROLE_75 = 1 << 75;
uint256 internal constant _ROLE_76 = 1 << 76;
uint256 internal constant _ROLE_77 = 1 << 77;
uint256 internal constant _ROLE_78 = 1 << 78;
uint256 internal constant _ROLE_79 = 1 << 79;
uint256 internal constant _ROLE_80 = 1 << 80;
uint256 internal constant _ROLE_81 = 1 << 81;
uint256 internal constant _ROLE_82 = 1 << 82;
uint256 internal constant _ROLE_83 = 1 << 83;
uint256 internal constant _ROLE_84 = 1 << 84;
uint256 internal constant _ROLE_85 = 1 << 85;
uint256 internal constant _ROLE_86 = 1 << 86;
uint256 internal constant _ROLE_87 = 1 << 87;
uint256 internal constant _ROLE_88 = 1 << 88;
uint256 internal constant _ROLE_89 = 1 << 89;
uint256 internal constant _ROLE_90 = 1 << 90;
uint256 internal constant _ROLE_91 = 1 << 91;
uint256 internal constant _ROLE_92 = 1 << 92;
uint256 internal constant _ROLE_93 = 1 << 93;
uint256 internal constant _ROLE_94 = 1 << 94;
uint256 internal constant _ROLE_95 = 1 << 95;
uint256 internal constant _ROLE_96 = 1 << 96;
uint256 internal constant _ROLE_97 = 1 << 97;
uint256 internal constant _ROLE_98 = 1 << 98;
uint256 internal constant _ROLE_99 = 1 << 99;
uint256 internal constant _ROLE_100 = 1 << 100;
uint256 internal constant _ROLE_101 = 1 << 101;
uint256 internal constant _ROLE_102 = 1 << 102;
uint256 internal constant _ROLE_103 = 1 << 103;
uint256 internal constant _ROLE_104 = 1 << 104;
uint256 internal constant _ROLE_105 = 1 << 105;
uint256 internal constant _ROLE_106 = 1 << 106;
uint256 internal constant _ROLE_107 = 1 << 107;
uint256 internal constant _ROLE_108 = 1 << 108;
uint256 internal constant _ROLE_109 = 1 << 109;
uint256 internal constant _ROLE_110 = 1 << 110;
uint256 internal constant _ROLE_111 = 1 << 111;
uint256 internal constant _ROLE_112 = 1 << 112;
uint256 internal constant _ROLE_113 = 1 << 113;
uint256 internal constant _ROLE_114 = 1 << 114;
uint256 internal constant _ROLE_115 = 1 << 115;
uint256 internal constant _ROLE_116 = 1 << 116;
uint256 internal constant _ROLE_117 = 1 << 117;
uint256 internal constant _ROLE_118 = 1 << 118;
uint256 internal constant _ROLE_119 = 1 << 119;
uint256 internal constant _ROLE_120 = 1 << 120;
uint256 internal constant _ROLE_121 = 1 << 121;
uint256 internal constant _ROLE_122 = 1 << 122;
uint256 internal constant _ROLE_123 = 1 << 123;
uint256 internal constant _ROLE_124 = 1 << 124;
uint256 internal constant _ROLE_125 = 1 << 125;
uint256 internal constant _ROLE_126 = 1 << 126;
uint256 internal constant _ROLE_127 = 1 << 127;
uint256 internal constant _ROLE_128 = 1 << 128;
uint256 internal constant _ROLE_129 = 1 << 129;
uint256 internal constant _ROLE_130 = 1 << 130;
uint256 internal constant _ROLE_131 = 1 << 131;
uint256 internal constant _ROLE_132 = 1 << 132;
uint256 internal constant _ROLE_133 = 1 << 133;
uint256 internal constant _ROLE_134 = 1 << 134;
uint256 internal constant _ROLE_135 = 1 << 135;
uint256 internal constant _ROLE_136 = 1 << 136;
uint256 internal constant _ROLE_137 = 1 << 137;
uint256 internal constant _ROLE_138 = 1 << 138;
uint256 internal constant _ROLE_139 = 1 << 139;
uint256 internal constant _ROLE_140 = 1 << 140;
uint256 internal constant _ROLE_141 = 1 << 141;
uint256 internal constant _ROLE_142 = 1 << 142;
uint256 internal constant _ROLE_143 = 1 << 143;
uint256 internal constant _ROLE_144 = 1 << 144;
uint256 internal constant _ROLE_145 = 1 << 145;
uint256 internal constant _ROLE_146 = 1 << 146;
uint256 internal constant _ROLE_147 = 1 << 147;
uint256 internal constant _ROLE_148 = 1 << 148;
uint256 internal constant _ROLE_149 = 1 << 149;
uint256 internal constant _ROLE_150 = 1 << 150;
uint256 internal constant _ROLE_151 = 1 << 151;
uint256 internal constant _ROLE_152 = 1 << 152;
uint256 internal constant _ROLE_153 = 1 << 153;
uint256 internal constant _ROLE_154 = 1 << 154;
uint256 internal constant _ROLE_155 = 1 << 155;
uint256 internal constant _ROLE_156 = 1 << 156;
uint256 internal constant _ROLE_157 = 1 << 157;
uint256 internal constant _ROLE_158 = 1 << 158;
uint256 internal constant _ROLE_159 = 1 << 159;
uint256 internal constant _ROLE_160 = 1 << 160;
uint256 internal constant _ROLE_161 = 1 << 161;
uint256 internal constant _ROLE_162 = 1 << 162;
uint256 internal constant _ROLE_163 = 1 << 163;
uint256 internal constant _ROLE_164 = 1 << 164;
uint256 internal constant _ROLE_165 = 1 << 165;
uint256 internal constant _ROLE_166 = 1 << 166;
uint256 internal constant _ROLE_167 = 1 << 167;
uint256 internal constant _ROLE_168 = 1 << 168;
uint256 internal constant _ROLE_169 = 1 << 169;
uint256 internal constant _ROLE_170 = 1 << 170;
uint256 internal constant _ROLE_171 = 1 << 171;
uint256 internal constant _ROLE_172 = 1 << 172;
uint256 internal constant _ROLE_173 = 1 << 173;
uint256 internal constant _ROLE_174 = 1 << 174;
uint256 internal constant _ROLE_175 = 1 << 175;
uint256 internal constant _ROLE_176 = 1 << 176;
uint256 internal constant _ROLE_177 = 1 << 177;
uint256 internal constant _ROLE_178 = 1 << 178;
uint256 internal constant _ROLE_179 = 1 << 179;
uint256 internal constant _ROLE_180 = 1 << 180;
uint256 internal constant _ROLE_181 = 1 << 181;
uint256 internal constant _ROLE_182 = 1 << 182;
uint256 internal constant _ROLE_183 = 1 << 183;
uint256 internal constant _ROLE_184 = 1 << 184;
uint256 internal constant _ROLE_185 = 1 << 185;
uint256 internal constant _ROLE_186 = 1 << 186;
uint256 internal constant _ROLE_187 = 1 << 187;
uint256 internal constant _ROLE_188 = 1 << 188;
uint256 internal constant _ROLE_189 = 1 << 189;
uint256 internal constant _ROLE_190 = 1 << 190;
uint256 internal constant _ROLE_191 = 1 << 191;
uint256 internal constant _ROLE_192 = 1 << 192;
uint256 internal constant _ROLE_193 = 1 << 193;
uint256 internal constant _ROLE_194 = 1 << 194;
uint256 internal constant _ROLE_195 = 1 << 195;
uint256 internal constant _ROLE_196 = 1 << 196;
uint256 internal constant _ROLE_197 = 1 << 197;
uint256 internal constant _ROLE_198 = 1 << 198;
uint256 internal constant _ROLE_199 = 1 << 199;
uint256 internal constant _ROLE_200 = 1 << 200;
uint256 internal constant _ROLE_201 = 1 << 201;
uint256 internal constant _ROLE_202 = 1 << 202;
uint256 internal constant _ROLE_203 = 1 << 203;
uint256 internal constant _ROLE_204 = 1 << 204;
uint256 internal constant _ROLE_205 = 1 << 205;
uint256 internal constant _ROLE_206 = 1 << 206;
uint256 internal constant _ROLE_207 = 1 << 207;
uint256 internal constant _ROLE_208 = 1 << 208;
uint256 internal constant _ROLE_209 = 1 << 209;
uint256 internal constant _ROLE_210 = 1 << 210;
uint256 internal constant _ROLE_211 = 1 << 211;
uint256 internal constant _ROLE_212 = 1 << 212;
uint256 internal constant _ROLE_213 = 1 << 213;
uint256 internal constant _ROLE_214 = 1 << 214;
uint256 internal constant _ROLE_215 = 1 << 215;
uint256 internal constant _ROLE_216 = 1 << 216;
uint256 internal constant _ROLE_217 = 1 << 217;
uint256 internal constant _ROLE_218 = 1 << 218;
uint256 internal constant _ROLE_219 = 1 << 219;
uint256 internal constant _ROLE_220 = 1 << 220;
uint256 internal constant _ROLE_221 = 1 << 221;
uint256 internal constant _ROLE_222 = 1 << 222;
uint256 internal constant _ROLE_223 = 1 << 223;
uint256 internal constant _ROLE_224 = 1 << 224;
uint256 internal constant _ROLE_225 = 1 << 225;
uint256 internal constant _ROLE_226 = 1 << 226;
uint256 internal constant _ROLE_227 = 1 << 227;
uint256 internal constant _ROLE_228 = 1 << 228;
uint256 internal constant _ROLE_229 = 1 << 229;
uint256 internal constant _ROLE_230 = 1 << 230;
uint256 internal constant _ROLE_231 = 1 << 231;
uint256 internal constant _ROLE_232 = 1 << 232;
uint256 internal constant _ROLE_233 = 1 << 233;
uint256 internal constant _ROLE_234 = 1 << 234;
uint256 internal constant _ROLE_235 = 1 << 235;
uint256 internal constant _ROLE_236 = 1 << 236;
uint256 internal constant _ROLE_237 = 1 << 237;
uint256 internal constant _ROLE_238 = 1 << 238;
uint256 internal constant _ROLE_239 = 1 << 239;
uint256 internal constant _ROLE_240 = 1 << 240;
uint256 internal constant _ROLE_241 = 1 << 241;
uint256 internal constant _ROLE_242 = 1 << 242;
uint256 internal constant _ROLE_243 = 1 << 243;
uint256 internal constant _ROLE_244 = 1 << 244;
uint256 internal constant _ROLE_245 = 1 << 245;
uint256 internal constant _ROLE_246 = 1 << 246;
uint256 internal constant _ROLE_247 = 1 << 247;
uint256 internal constant _ROLE_248 = 1 << 248;
uint256 internal constant _ROLE_249 = 1 << 249;
uint256 internal constant _ROLE_250 = 1 << 250;
uint256 internal constant _ROLE_251 = 1 << 251;
uint256 internal constant _ROLE_252 = 1 << 252;
uint256 internal constant _ROLE_253 = 1 << 253;
uint256 internal constant _ROLE_254 = 1 << 254;
uint256 internal constant _ROLE_255 = 1 << 255;
}
{
"compilationTarget": {
"src/frenzy/FrenzyTrait.sol": "FrenzyTrait"
},
"evmVersion": "paris",
"libraries": {},
"metadata": {
"bytecodeHash": "ipfs"
},
"optimizer": {
"enabled": true,
"runs": 200
},
"remappings": [
":ERC1155P/=lib/ERC1155P/contracts/",
":ERC721A/=lib/ERC721A/contracts/",
":LayerZero-foundry/=lib/LayerZero-foundry/",
":closedsea/=lib/closedsea/src/",
":ds-test/=lib/forge-std/lib/ds-test/src/",
":erc4626-tests/=lib/openzeppelin-contracts/lib/erc4626-tests/",
":erc721a-upgradeable/=lib/closedsea/lib/erc721a-upgradeable/contracts/",
":erc721a/=lib/closedsea/lib/erc721a/contracts/",
":forge-std/=lib/forge-std/src/",
":openzeppelin-contracts-upgradeable/=lib/closedsea/lib/openzeppelin-contracts-upgradeable/",
":openzeppelin-contracts/=lib/openzeppelin-contracts/",
":openzeppelin/=lib/openzeppelin-contracts/contracts/",
":operator-filter-registry/=lib/closedsea/lib/operator-filter-registry/",
":solady/=lib/solady/",
":solmate/=lib/solmate/src/"
]
}
[{"inputs":[{"internalType":"uint256[]","name":"tokenData","type":"uint256[]"},{"internalType":"uint256[]","name":"maxSupplies","type":"uint256[]"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"AlreadyInitialized","type":"error"},{"inputs":[],"name":"ArrayLengthMismatch","type":"error"},{"inputs":[],"name":"BalanceQueryForZeroAddress","type":"error"},{"inputs":[],"name":"BurnExceedsBalance","type":"error"},{"inputs":[],"name":"BurnFromZeroAddress","type":"error"},{"inputs":[],"name":"ExceedsMaxSupply","type":"error"},{"inputs":[],"name":"ExceedsMaximumBalance","type":"error"},{"inputs":[],"name":"ExceedsMaximumTokenId","type":"error"},{"inputs":[],"name":"ExceedsMaximumTotalSupply","type":"error"},{"inputs":[],"name":"HashReplayed","type":"error"},{"inputs":[],"name":"MintToZeroAddress","type":"error"},{"inputs":[],"name":"MintZeroQuantity","type":"error"},{"inputs":[],"name":"NewOwnerIsZeroAddress","type":"error"},{"inputs":[],"name":"NoHandoverRequest","type":"error"},{"inputs":[],"name":"RoyaltyOverflow","type":"error"},{"inputs":[],"name":"RoyaltyReceiverIsZeroAddress","type":"error"},{"inputs":[],"name":"TransferCallerNotOwnerNorApproved","type":"error"},{"inputs":[],"name":"TransferExceedsBalance","type":"error"},{"inputs":[],"name":"TransferToNonERC1155ReceiverImplementer","type":"error"},{"inputs":[],"name":"TransferToZeroAddress","type":"error"},{"inputs":[],"name":"Unauthorized","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"operator","type":"address"},{"indexed":false,"internalType":"bool","name":"approved","type":"bool"}],"name":"ApprovalForAll","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"pendingOwner","type":"address"}],"name":"OwnershipHandoverCanceled","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"pendingOwner","type":"address"}],"name":"OwnershipHandoverRequested","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"oldOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":true,"internalType":"uint256","name":"roles","type":"uint256"}],"name":"RolesUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"operator","type":"address"},{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256[]","name":"ids","type":"uint256[]"},{"indexed":false,"internalType":"uint256[]","name":"values","type":"uint256[]"}],"name":"TransferBatch","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"operator","type":"address"},{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"id","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"TransferSingle","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"oldValidator","type":"address"},{"indexed":false,"internalType":"address","name":"newValidator","type":"address"}],"name":"TransferValidatorUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"string","name":"value","type":"string"},{"indexed":true,"internalType":"uint256","name":"id","type":"uint256"}],"name":"URI","type":"event"},{"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"uint256","name":"id","type":"uint256"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address[]","name":"accounts","type":"address[]"},{"internalType":"uint256[]","name":"ids","type":"uint256[]"}],"name":"balanceOfBatch","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"bypassOperators","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"cancelOwnershipHandover","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"pendingOwner","type":"address"}],"name":"completeOwnershipHandover","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint256","name":"id","type":"uint256"}],"name":"exists","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"getTokenData","outputs":[{"internalType":"uint8","name":"tokenType","type":"uint8"},{"internalType":"uint8","name":"tokenRarity","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getTransferValidationFunction","outputs":[{"internalType":"bytes4","name":"functionSignature","type":"bytes4"},{"internalType":"bool","name":"isViewFunction","type":"bool"}],"stateMutability":"pure","type":"function"},{"inputs":[],"name":"getTransferValidator","outputs":[{"internalType":"address","name":"validator","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"user","type":"address"},{"internalType":"uint256","name":"roles","type":"uint256"}],"name":"grantRoles","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"user","type":"address"},{"internalType":"uint256","name":"roles","type":"uint256"}],"name":"hasAllRoles","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"user","type":"address"},{"internalType":"uint256","name":"roles","type":"uint256"}],"name":"hasAnyRole","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"address","name":"operator","type":"address"}],"name":"isApprovedForAll","outputs":[{"internalType":"bool","name":"_approved","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"maxSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256[]","name":"ids","type":"uint256[]"},{"internalType":"uint256[]","name":"amounts","type":"uint256[]"},{"internalType":"bytes32","name":"l1TxInfo","type":"bytes32"}],"name":"mint","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"pure","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"result","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256[]","name":"ids","type":"uint256[]"},{"internalType":"uint256[]","name":"amounts","type":"uint256[]"}],"name":"ownerMint","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"pendingOwner","type":"address"}],"name":"ownershipHandoverExpiresAt","outputs":[{"internalType":"uint256","name":"result","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renderer","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint256","name":"roles","type":"uint256"}],"name":"renounceRoles","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"requestOwnershipHandover","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"user","type":"address"},{"internalType":"uint256","name":"roles","type":"uint256"}],"name":"revokeRoles","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"user","type":"address"}],"name":"rolesOf","outputs":[{"internalType":"uint256","name":"roles","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"uint256","name":"salePrice","type":"uint256"}],"name":"royaltyInfo","outputs":[{"internalType":"address","name":"receiver","type":"address"},{"internalType":"uint256","name":"royaltyAmount","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256[]","name":"ids","type":"uint256[]"},{"internalType":"uint256[]","name":"amounts","type":"uint256[]"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"safeBatchTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"id","type":"uint256"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"operator","type":"address"},{"internalType":"bool","name":"approved","type":"bool"}],"name":"setApprovalForAll","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"receiver","type":"address"},{"internalType":"uint96","name":"feeNumerator","type":"uint96"}],"name":"setDefaultRoyalty","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"uint16","name":"maxSupply_","type":"uint16"}],"name":"setMaxSupply","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"operator","type":"address"},{"internalType":"bool","name":"status","type":"bool"}],"name":"setOverrideOperator","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"renderer_","type":"address"}],"name":"setRenderer","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"uint8","name":"tokenData","type":"uint8"}],"name":"setTokenData","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"validator","type":"address"}],"name":"setTransferValidator","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"result","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"uint256","name":"id","type":"uint256"}],"name":"totalMinted","outputs":[{"internalType":"uint256","name":"_totalMinted","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"id","type":"uint256"}],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"_totalSupply","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint256","name":"id","type":"uint256"}],"name":"uri","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"name":"usedHashes","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"}]