文件 1 的 16:Address.sol
pragma solidity ^0.8.0;
library Address {
function isContract(address account) internal view returns (bool) {
uint256 size;
assembly {
size := extcodesize(account)
}
return size > 0;
}
function sendValue(address payable recipient, uint256 amount) internal {
require(address(this).balance >= amount, "Address: insufficient balance");
(bool success, ) = recipient.call{value: amount}("");
require(success, "Address: unable to send value, recipient may have reverted");
}
function functionCall(address target, bytes memory data) internal returns (bytes memory) {
return functionCall(target, data, "Address: low-level call failed");
}
function functionCall(
address target,
bytes memory data,
string memory errorMessage
) internal returns (bytes memory) {
return functionCallWithValue(target, data, 0, errorMessage);
}
function functionCallWithValue(
address target,
bytes memory data,
uint256 value
) internal returns (bytes memory) {
return functionCallWithValue(target, data, value, "Address: low-level call with value failed");
}
function functionCallWithValue(
address target,
bytes memory data,
uint256 value,
string memory errorMessage
) internal returns (bytes memory) {
require(address(this).balance >= value, "Address: insufficient balance for call");
require(isContract(target), "Address: call to non-contract");
(bool success, bytes memory returndata) = target.call{value: value}(data);
return verifyCallResult(success, returndata, errorMessage);
}
function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {
return functionStaticCall(target, data, "Address: low-level static call failed");
}
function functionStaticCall(
address target,
bytes memory data,
string memory errorMessage
) internal view returns (bytes memory) {
require(isContract(target), "Address: static call to non-contract");
(bool success, bytes memory returndata) = target.staticcall(data);
return verifyCallResult(success, returndata, errorMessage);
}
function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {
return functionDelegateCall(target, data, "Address: low-level delegate call failed");
}
function functionDelegateCall(
address target,
bytes memory data,
string memory errorMessage
) internal returns (bytes memory) {
require(isContract(target), "Address: delegate call to non-contract");
(bool success, bytes memory returndata) = target.delegatecall(data);
return verifyCallResult(success, returndata, errorMessage);
}
function verifyCallResult(
bool success,
bytes memory returndata,
string memory errorMessage
) internal pure returns (bytes memory) {
if (success) {
return returndata;
} else {
if (returndata.length > 0) {
assembly {
let returndata_size := mload(returndata)
revert(add(32, returndata), returndata_size)
}
} else {
revert(errorMessage);
}
}
}
}
文件 2 的 16:Bleeps.sol
pragma solidity 0.8.9;
import "./BleepsRoles.sol";
import "../base/ERC721Checkpointable.sol";
import "../interfaces/ITokenURI.sol";
import "@openzeppelin/contracts/token/ERC721/IERC721.sol";
import "../base/WithSupportForOpenSeaProxies.sol";
contract Bleeps is IERC721, WithSupportForOpenSeaProxies, ERC721Checkpointable, BleepsRoles {
event RoyaltySet(address receiver, uint256 royaltyPer10Thousands);
event TokenURIContractSet(ITokenURI newTokenURIContract);
event CheckpointingDisablerSet(address newCheckpointingDisabler);
event CheckpointingDisabled();
ITokenURI public tokenURIContract;
struct Royalty {
address receiver;
uint96 per10Thousands;
}
Royalty internal _royalty;
address public checkpointingDisabler;
constructor(
address ens,
address initialOwner,
address initialTokenURIAdmin,
address initialMinterAdmin,
address initialRoyaltyAdmin,
address initialGuardian,
address openseaProxyRegistry,
address initialRoyaltyReceiver,
uint96 imitialRoyaltyPer10Thousands,
ITokenURI initialTokenURIContract,
address initialCheckpointingDisabler
)
WithSupportForOpenSeaProxies(openseaProxyRegistry)
BleepsRoles(ens, initialOwner, initialTokenURIAdmin, initialMinterAdmin, initialRoyaltyAdmin, initialGuardian)
{
tokenURIContract = initialTokenURIContract;
emit TokenURIContractSet(initialTokenURIContract);
checkpointingDisabler = initialCheckpointingDisabler;
emit CheckpointingDisablerSet(initialCheckpointingDisabler);
_royalty.receiver = initialRoyaltyReceiver;
_royalty.per10Thousands = imitialRoyaltyPer10Thousands;
emit RoyaltySet(initialRoyaltyReceiver, imitialRoyaltyPer10Thousands);
}
function name() public pure override returns (string memory) {
return "Bleeps";
}
function symbol() external pure returns (string memory) {
return "BLEEP";
}
function contractURI() external view returns (string memory) {
return tokenURIContract.contractURI(_royalty.receiver, _royalty.per10Thousands);
}
function tokenURI(uint256 id) external view returns (string memory) {
return tokenURIContract.tokenURI(id);
}
function setTokenURIContract(ITokenURI newTokenURIContract) external {
require(msg.sender == tokenURIAdmin, "NOT_AUTHORIZED");
tokenURIContract = newTokenURIContract;
emit TokenURIContractSet(newTokenURIContract);
}
function owners(uint256[] calldata ids) external view returns (address[] memory addresses) {
addresses = new address[](ids.length);
for (uint256 i = 0; i < ids.length; i++) {
uint256 id = ids[i];
addresses[i] = address(uint160(_owners[id]));
}
}
function isApprovedForAll(address owner, address operator)
public
view
virtual
override(ERC721Base, IERC721)
returns (bool isOperator)
{
return super.isApprovedForAll(owner, operator) || _isOpenSeaProxy(owner, operator);
}
function supportsInterface(bytes4 id)
public
pure
virtual
override(ERC721BaseWithERC4494Permit, IERC165)
returns (bool)
{
return super.supportsInterface(id) || id == 0x2a55205a;
}
function royaltyInfo(uint256 id, uint256 salePrice)
external
view
returns (address receiver, uint256 royaltyAmount)
{
receiver = _royalty.receiver;
royaltyAmount = (salePrice * uint256(_royalty.per10Thousands)) / 10000;
}
function setRoyaltyParameters(address newReceiver, uint96 royaltyPer10Thousands) external {
require(msg.sender == royaltyAdmin, "NOT_AUTHORIZED");
_royalty.receiver = newReceiver;
_royalty.per10Thousands = royaltyPer10Thousands;
emit RoyaltySet(newReceiver, royaltyPer10Thousands);
}
function disableTheUseOfCheckpoints() external {
require(msg.sender == checkpointingDisabler, "NOT_AUTHORIZED");
_useCheckpoints = false;
checkpointingDisabler = address(0);
emit CheckpointingDisablerSet(address(0));
emit CheckpointingDisabled();
}
function setCheckpointingDisabler(address newCheckpointingDisabler) external {
require(msg.sender == checkpointingDisabler, "NOT_AUTHORIZED");
checkpointingDisabler = newCheckpointingDisabler;
emit CheckpointingDisablerSet(newCheckpointingDisabler);
}
function mint(uint16 id, address to) external {
require(msg.sender == minter, "ONLY_MINTER_ALLOWED");
require(id < 1024, "INVALID_BLEEP");
require(to != address(0), "NOT_TO_ZEROADDRESS");
require(to != address(this), "NOT_TO_THIS");
address owner = _ownerOf(id);
require(owner == address(0), "ALREADY_CREATED");
_safeTransferFrom(address(0), to, id, "");
}
function multiMint(uint16[] calldata ids, address[] calldata tos) external {
require(msg.sender == minter, "ONLY_MINTER_ALLOWED");
address to;
if (tos.length == 1) {
to = tos[0];
}
for (uint256 i = 0; i < ids.length; i++) {
uint256 id = ids[i];
if (tos.length > 1) {
to = tos[i];
}
require(to != address(0), "NOT_TO_ZEROADDRESS");
require(to != address(this), "NOT_TO_THIS");
require(id < 1024, "INVALID_BLEEP");
address owner = _ownerOf(id);
require(owner == address(0), "ALREADY_CREATED");
_safeTransferFrom(address(0), to, id, "");
}
}
function sound(uint256 id) external pure returns (uint8 note, uint8 instrument) {
note = uint8(id & 0x3F);
instrument = uint8(uint256(id >> 6) & 0x0F);
}
}
文件 3 的 16:BleepsRoles.sol
pragma solidity 0.8.9;
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
interface ReverseRegistrar {
function setName(string memory name) external returns (bytes32);
}
interface ENS {
function owner(bytes32 node) external view returns (address);
}
contract BleepsRoles {
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
event TokenURIAdminSet(address newTokenURIAdmin);
event RoyaltyAdminSet(address newRoyaltyAdmin);
event MinterAdminSet(address newMinterAdmin);
event GuardianSet(address newGuardian);
event MinterSet(address newMinter);
bytes32 internal constant ADDR_REVERSE_NODE = 0x91d1777781884d03a6757a803996e38de2a42967fb37eeaca72729271025a9e2;
ENS internal immutable _ens;
address public owner;
address public tokenURIAdmin;
address public royaltyAdmin;
address public minterAdmin;
address public minter;
address public guardian;
constructor(
address ens,
address initialOwner,
address initialTokenURIAdmin,
address initialMinterAdmin,
address initialRoyaltyAdmin,
address initialGuardian
) {
_ens = ENS(ens);
owner = initialOwner;
tokenURIAdmin = initialTokenURIAdmin;
royaltyAdmin = initialRoyaltyAdmin;
minterAdmin = initialMinterAdmin;
guardian = initialGuardian;
emit OwnershipTransferred(address(0), initialOwner);
emit TokenURIAdminSet(initialTokenURIAdmin);
emit RoyaltyAdminSet(initialRoyaltyAdmin);
emit MinterAdminSet(initialMinterAdmin);
emit GuardianSet(initialGuardian);
}
function setENSName(string memory name) external {
require(msg.sender == owner, "NOT_AUTHORIZED");
ReverseRegistrar reverseRegistrar = ReverseRegistrar(_ens.owner(ADDR_REVERSE_NODE));
reverseRegistrar.setName(name);
}
function withdrawERC20(IERC20 token, address to) external {
require(msg.sender == owner, "NOT_AUTHORIZED");
token.transfer(to, token.balanceOf(address(this)));
}
function transferOwnership(address newOwner) external {
address oldOwner = owner;
require(msg.sender == oldOwner);
owner = newOwner;
emit OwnershipTransferred(oldOwner, newOwner);
}
function setTokenURIAdmin(address newTokenURIAdmin) external {
require(
msg.sender == tokenURIAdmin || (msg.sender == guardian && newTokenURIAdmin == address(0)),
"NOT_AUTHORIZED"
);
tokenURIAdmin = newTokenURIAdmin;
emit TokenURIAdminSet(newTokenURIAdmin);
}
function setRoyaltyAdmin(address newRoyaltyAdmin) external {
require(
msg.sender == royaltyAdmin || (msg.sender == guardian && newRoyaltyAdmin == address(0)),
"NOT_AUTHORIZED"
);
royaltyAdmin = newRoyaltyAdmin;
emit RoyaltyAdminSet(newRoyaltyAdmin);
}
function setMinterAdmin(address newMinterAdmin) external {
require(
msg.sender == minterAdmin || (msg.sender == guardian && newMinterAdmin == address(0)),
"NOT_AUTHORIZED"
);
minterAdmin = newMinterAdmin;
emit MinterAdminSet(newMinterAdmin);
}
function setGuardian(address newGuardian) external {
require(msg.sender == guardian, "NOT_AUTHORIZED");
guardian = newGuardian;
emit GuardianSet(newGuardian);
}
function setMinter(address newMinter) external {
require(msg.sender == minterAdmin, "NOT_AUTHORIZED");
minter = newMinter;
emit MinterSet(newMinter);
}
}
文件 4 的 16:ECDSA.sol
pragma solidity ^0.8.0;
library ECDSA {
enum RecoverError {
NoError,
InvalidSignature,
InvalidSignatureLength,
InvalidSignatureS,
InvalidSignatureV
}
function _throwError(RecoverError error) private pure {
if (error == RecoverError.NoError) {
return;
} else if (error == RecoverError.InvalidSignature) {
revert("ECDSA: invalid signature");
} else if (error == RecoverError.InvalidSignatureLength) {
revert("ECDSA: invalid signature length");
} else if (error == RecoverError.InvalidSignatureS) {
revert("ECDSA: invalid signature 's' value");
} else if (error == RecoverError.InvalidSignatureV) {
revert("ECDSA: invalid signature 'v' value");
}
}
function tryRecover(bytes32 hash, bytes memory signature) internal pure returns (address, RecoverError) {
if (signature.length == 65) {
bytes32 r;
bytes32 s;
uint8 v;
assembly {
r := mload(add(signature, 0x20))
s := mload(add(signature, 0x40))
v := byte(0, mload(add(signature, 0x60)))
}
return tryRecover(hash, v, r, s);
} else if (signature.length == 64) {
bytes32 r;
bytes32 vs;
assembly {
r := mload(add(signature, 0x20))
vs := mload(add(signature, 0x40))
}
return tryRecover(hash, r, vs);
} else {
return (address(0), RecoverError.InvalidSignatureLength);
}
}
function recover(bytes32 hash, bytes memory signature) internal pure returns (address) {
(address recovered, RecoverError error) = tryRecover(hash, signature);
_throwError(error);
return recovered;
}
function tryRecover(
bytes32 hash,
bytes32 r,
bytes32 vs
) internal pure returns (address, RecoverError) {
bytes32 s;
uint8 v;
assembly {
s := and(vs, 0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff)
v := add(shr(255, vs), 27)
}
return tryRecover(hash, v, r, s);
}
function recover(
bytes32 hash,
bytes32 r,
bytes32 vs
) internal pure returns (address) {
(address recovered, RecoverError error) = tryRecover(hash, r, vs);
_throwError(error);
return recovered;
}
function tryRecover(
bytes32 hash,
uint8 v,
bytes32 r,
bytes32 s
) internal pure returns (address, RecoverError) {
if (uint256(s) > 0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5D576E7357A4501DDFE92F46681B20A0) {
return (address(0), RecoverError.InvalidSignatureS);
}
if (v != 27 && v != 28) {
return (address(0), RecoverError.InvalidSignatureV);
}
address signer = ecrecover(hash, v, r, s);
if (signer == address(0)) {
return (address(0), RecoverError.InvalidSignature);
}
return (signer, RecoverError.NoError);
}
function recover(
bytes32 hash,
uint8 v,
bytes32 r,
bytes32 s
) internal pure returns (address) {
(address recovered, RecoverError error) = tryRecover(hash, v, r, s);
_throwError(error);
return recovered;
}
function toEthSignedMessageHash(bytes32 hash) internal pure returns (bytes32) {
return keccak256(abi.encodePacked("\x19Ethereum Signed Message:\n32", hash));
}
function toTypedDataHash(bytes32 domainSeparator, bytes32 structHash) internal pure returns (bytes32) {
return keccak256(abi.encodePacked("\x19\x01", domainSeparator, structHash));
}
}
文件 5 的 16:ERC721Base.sol
pragma solidity 0.8.9;
import "@openzeppelin/contracts/utils/Address.sol";
import "@openzeppelin/contracts/token/ERC721/IERC721Receiver.sol";
import "@openzeppelin/contracts/token/ERC721/IERC721.sol";
import "@openzeppelin/contracts/interfaces/IERC165.sol";
abstract contract ERC721Base is IERC165, IERC721 {
using Address for address;
bytes4 internal constant ERC721_RECEIVED = 0x150b7a02;
bytes4 internal constant ERC165ID = 0x01ffc9a7;
uint256 internal constant OPERATOR_FLAG = 0x8000000000000000000000000000000000000000000000000000000000000000;
uint256 internal constant NOT_OPERATOR_FLAG = 0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF;
mapping(uint256 => uint256) internal _owners;
mapping(address => uint256) internal _balances;
mapping(address => mapping(address => bool)) internal _operatorsForAll;
mapping(uint256 => address) internal _operators;
function name() public pure virtual returns (string memory) {
revert("NOT_IMPLEMENTED");
}
function approve(address operator, uint256 id) external override {
(address owner, uint256 blockNumber) = _ownerAndBlockNumberOf(id);
require(owner != address(0), "NONEXISTENT_TOKEN");
require(msg.sender == owner || isApprovedForAll(owner, msg.sender), "UNAUTHORIZED_APPROVAL");
_approveFor(owner, blockNumber, operator, id);
}
function transferFrom(
address from,
address to,
uint256 id
) external override {
(address owner, bool operatorEnabled) = _ownerAndOperatorEnabledOf(id);
require(owner != address(0), "NONEXISTENT_TOKEN");
require(owner == from, "NOT_OWNER");
require(to != address(0), "NOT_TO_ZEROADDRESS");
require(to != address(this), "NOT_TO_THIS");
if (msg.sender != from) {
require(
(operatorEnabled && _operators[id] == msg.sender) || isApprovedForAll(from, msg.sender),
"UNAUTHORIZED_TRANSFER"
);
}
_transferFrom(from, to, id);
}
function safeTransferFrom(
address from,
address to,
uint256 id
) external override {
safeTransferFrom(from, to, id, "");
}
function setApprovalForAll(address operator, bool approved) external override {
_setApprovalForAll(msg.sender, operator, approved);
}
function balanceOf(address owner) public view override returns (uint256 balance) {
require(owner != address(0), "ZERO_ADDRESS_OWNER");
balance = _balances[owner];
}
function ownerOf(uint256 id) external view override returns (address owner) {
owner = _ownerOf(id);
require(owner != address(0), "NONEXISTENT_TOKEN");
}
function ownerAndLastTransferBlockNumberOf(uint256 id) internal view returns (address owner, uint256 blockNumber) {
return _ownerAndBlockNumberOf(id);
}
struct OwnerData {
address owner;
uint256 lastTransferBlockNumber;
}
function ownerAndLastTransferBlockNumberList(uint256[] calldata ids)
external
view
returns (OwnerData[] memory ownersData)
{
ownersData = new OwnerData[](ids.length);
for (uint256 i = 0; i < ids.length; i++) {
uint256 data = _owners[ids[i]];
ownersData[i].owner = address(uint160(data));
ownersData[i].lastTransferBlockNumber = (data >> 160) & 0xFFFFFFFFFFFFFFFFFFFFFF;
}
}
function getApproved(uint256 id) external view override returns (address) {
(address owner, bool operatorEnabled) = _ownerAndOperatorEnabledOf(id);
require(owner != address(0), "NONEXISTENT_TOKEN");
if (operatorEnabled) {
return _operators[id];
} else {
return address(0);
}
}
function isApprovedForAll(address owner, address operator) public view virtual override returns (bool isOperator) {
return _operatorsForAll[owner][operator];
}
function safeTransferFrom(
address from,
address to,
uint256 id,
bytes memory data
) public override {
(address owner, bool operatorEnabled) = _ownerAndOperatorEnabledOf(id);
require(owner != address(0), "NONEXISTENT_TOKEN");
require(owner == from, "NOT_OWNER");
require(to != address(0), "NOT_TO_ZEROADDRESS");
require(to != address(this), "NOT_TO_THIS");
if (msg.sender != from) {
require(
(operatorEnabled && _operators[id] == msg.sender) || isApprovedForAll(from, msg.sender),
"UNAUTHORIZED_TRANSFER"
);
}
_safeTransferFrom(from, to, id, data);
}
function supportsInterface(bytes4 id) public pure virtual override returns (bool) {
return id == 0x01ffc9a7 || id == 0x80ac58cd || id == 0x5b5e139f;
}
function _safeTransferFrom(
address from,
address to,
uint256 id,
bytes memory data
) internal {
_transferFrom(from, to, id);
if (to.isContract()) {
require(_checkOnERC721Received(msg.sender, from, to, id, data), "ERC721_TRANSFER_REJECTED");
}
}
function _beforeTokenTransfer(
address from,
address to,
uint256 id
) internal virtual {}
function _transferFrom(
address from,
address to,
uint256 id
) internal {
_beforeTokenTransfer(from, to, id);
unchecked {
_balances[to]++;
if (from != address(0)) {
_balances[from]--;
}
}
_owners[id] = (block.number << 160) | uint256(uint160(to));
emit Transfer(from, to, id);
}
function _approveFor(
address owner,
uint256 blockNumber,
address operator,
uint256 id
) internal {
if (operator == address(0)) {
_owners[id] = (blockNumber << 160) | uint256(uint160(owner));
} else {
_owners[id] = OPERATOR_FLAG | (blockNumber << 160) | uint256(uint160(owner));
_operators[id] = operator;
}
emit Approval(owner, operator, id);
}
function _setApprovalForAll(
address sender,
address operator,
bool approved
) internal {
_operatorsForAll[sender][operator] = approved;
emit ApprovalForAll(sender, operator, approved);
}
function _checkOnERC721Received(
address operator,
address from,
address to,
uint256 id,
bytes memory _data
) internal returns (bool) {
bytes4 retval = IERC721Receiver(to).onERC721Received(operator, from, id, _data);
return (retval == ERC721_RECEIVED);
}
function _ownerOf(uint256 id) internal view returns (address owner) {
return address(uint160(_owners[id]));
}
function _ownerAndOperatorEnabledOf(uint256 id) internal view returns (address owner, bool operatorEnabled) {
uint256 data = _owners[id];
owner = address(uint160(data));
operatorEnabled = (data & OPERATOR_FLAG) == OPERATOR_FLAG;
}
function _ownerAndBlockNumberOf(uint256 id) internal view returns (address owner, uint256 blockNumber) {
uint256 data = _owners[id];
owner = address(uint160(data));
blockNumber = (data >> 160) & 0xFFFFFFFFFFFFFFFFFFFFFF;
}
function multicall(bytes[] calldata data) public payable returns (bytes[] memory results) {
results = new bytes[](data.length);
for (uint256 i = 0; i < data.length; i++) {
(bool success, bytes memory result) = address(this).delegatecall(data[i]);
if (!success) {
if (result.length < 68) revert();
assembly {
result := add(result, 0x04)
}
revert(abi.decode(result, (string)));
}
results[i] = result;
}
}
}
文件 6 的 16:ERC721BaseWithERC4494Permit.sol
pragma solidity 0.8.9;
import "./ERC721Base.sol";
import "@openzeppelin/contracts/utils/Address.sol";
import "@openzeppelin/contracts/utils/cryptography/SignatureChecker.sol";
import "./IERC4494.sol";
abstract contract ERC721BaseWithERC4494Permit is ERC721Base {
using Address for address;
bytes32 public constant PERMIT_TYPEHASH =
keccak256("Permit(address spender,uint256 tokenId,uint256 nonce,uint256 deadline)");
bytes32 public constant PERMIT_FOR_ALL_TYPEHASH =
keccak256("PermitForAll(address spender,uint256 nonce,uint256 deadline)");
bytes32 public constant DOMAIN_TYPEHASH =
keccak256("EIP712Domain(string name,uint256 chainId,address verifyingContract)");
uint256 private immutable _deploymentChainId;
bytes32 private immutable _deploymentDomainSeparator;
mapping(address => uint256) internal _userNonces;
constructor() {
uint256 chainId;
assembly {
chainId := chainid()
}
_deploymentChainId = chainId;
_deploymentDomainSeparator = _calculateDomainSeparator(chainId);
}
function DOMAIN_SEPARATOR() external view returns (bytes32) {
return _DOMAIN_SEPARATOR();
}
function nonces(address account) external view virtual returns (uint256 nonce) {
return _userNonces[account];
}
function nonces(uint256 id) public view virtual returns (uint256 nonce) {
(address owner, uint256 blockNumber) = _ownerAndBlockNumberOf(id);
require(owner != address(0), "NONEXISTENT_TOKEN");
return blockNumber;
}
function tokenNonces(uint256 id) external view returns (uint256 nonce) {
return nonces(id);
}
function permit(
address spender,
uint256 tokenId,
uint256 deadline,
bytes memory sig
) external {
require(deadline >= block.timestamp, "PERMIT_DEADLINE_EXPIRED");
(address owner, uint256 blockNumber) = _ownerAndBlockNumberOf(tokenId);
require(owner != address(0), "NONEXISTENT_TOKEN");
_requireValidPermit(owner, spender, tokenId, deadline, blockNumber, sig);
_approveFor(owner, blockNumber, spender, tokenId);
}
function permitForAll(
address signer,
address spender,
uint256 deadline,
bytes memory sig
) external {
require(deadline >= block.timestamp, "PERMIT_DEADLINE_EXPIRED");
_requireValidPermitForAll(signer, spender, deadline, _userNonces[signer]++, sig);
_setApprovalForAll(signer, spender, true);
}
function supportsInterface(bytes4 id) public pure virtual override returns (bool) {
return
super.supportsInterface(id) ||
id == type(IERC4494).interfaceId ||
id == type(IERC4494Alternative).interfaceId;
}
function _requireValidPermit(
address signer,
address spender,
uint256 id,
uint256 deadline,
uint256 nonce,
bytes memory sig
) internal view {
bytes32 digest = keccak256(
abi.encodePacked(
"\x19\x01",
_DOMAIN_SEPARATOR(),
keccak256(abi.encode(PERMIT_TYPEHASH, spender, id, nonce, deadline))
)
);
require(SignatureChecker.isValidSignatureNow(signer, digest, sig), "INVALID_SIGNATURE");
}
function _requireValidPermitForAll(
address signer,
address spender,
uint256 deadline,
uint256 nonce,
bytes memory sig
) internal view {
bytes32 digest = keccak256(
abi.encodePacked(
"\x19\x01",
_DOMAIN_SEPARATOR(),
keccak256(abi.encode(PERMIT_FOR_ALL_TYPEHASH, spender, nonce, deadline))
)
);
require(SignatureChecker.isValidSignatureNow(signer, digest, sig), "INVALID_SIGNATURE");
}
function _DOMAIN_SEPARATOR() internal view returns (bytes32) {
uint256 chainId;
assembly {
chainId := chainid()
}
return chainId == _deploymentChainId ? _deploymentDomainSeparator : _calculateDomainSeparator(chainId);
}
function _calculateDomainSeparator(uint256 chainId) private view returns (bytes32) {
return keccak256(abi.encode(DOMAIN_TYPEHASH, keccak256(bytes(name())), chainId, address(this)));
}
}
文件 7 的 16:ERC721Checkpointable.sol
pragma solidity 0.8.9;
import "./ERC721BaseWithERC4494Permit.sol";
abstract contract ERC721Checkpointable is ERC721BaseWithERC4494Permit {
bool internal _useCheckpoints = true;
uint8 public constant decimals = 0;
mapping(address => address) private _delegates;
struct Checkpoint {
uint32 fromBlock;
uint96 votes;
}
mapping(address => mapping(uint32 => Checkpoint)) public checkpoints;
mapping(address => uint32) public numCheckpoints;
bytes32 public constant DELEGATION_TYPEHASH =
keccak256("Delegation(address delegatee,uint256 nonce,uint256 expiry)");
event DelegateChanged(address indexed delegator, address indexed fromDelegate, address indexed toDelegate);
event DelegateVotesChanged(address indexed delegate, uint256 previousBalance, uint256 newBalance);
function votesToDelegate(address delegator) public view returns (uint96) {
return safe96(balanceOf(delegator), "ERC721Checkpointable::votesToDelegate: amount exceeds 96 bits");
}
function delegates(address delegator) public view returns (address) {
address current = _delegates[delegator];
return current == address(0) ? delegator : current;
}
function _beforeTokenTransfer(
address from,
address to,
uint256 tokenId
) internal override {
super._beforeTokenTransfer(from, to, tokenId);
if (_useCheckpoints) {
_moveDelegates(delegates(from), delegates(to), 1);
}
}
function delegate(address delegatee) public {
if (delegatee == address(0)) delegatee = msg.sender;
return _delegate(msg.sender, delegatee);
}
function delegateBySig(
address delegatee,
uint256 nonce,
uint256 expiry,
uint8 v,
bytes32 r,
bytes32 s
) public {
bytes32 digest = keccak256(
abi.encodePacked(
"\x19\x01",
_DOMAIN_SEPARATOR(),
keccak256(abi.encode(DELEGATION_TYPEHASH, delegatee, nonce, expiry))
)
);
address signatory = ecrecover(digest, v, r, s);
require(signatory != address(0), "ERC721Checkpointable::delegateBySig: invalid signature");
require(nonce == _userNonces[signatory]++, "ERC721Checkpointable::delegateBySig: invalid nonce");
require(block.timestamp <= expiry, "ERC721Checkpointable::delegateBySig: signature expired");
return _delegate(signatory, delegatee);
}
function getCurrentVotes(address account) public view returns (uint96) {
uint32 nCheckpoints = numCheckpoints[account];
return nCheckpoints > 0 ? checkpoints[account][nCheckpoints - 1].votes : 0;
}
function getVotes(address account) external view returns (uint96) {
return getCurrentVotes(account);
}
function getPriorVotes(address account, uint256 blockNumber) public view returns (uint96) {
require(blockNumber < block.number, "ERC721Checkpointable::getPriorVotes: not yet determined");
uint32 nCheckpoints = numCheckpoints[account];
if (nCheckpoints == 0) {
return 0;
}
if (checkpoints[account][nCheckpoints - 1].fromBlock <= blockNumber) {
return checkpoints[account][nCheckpoints - 1].votes;
}
if (checkpoints[account][0].fromBlock > blockNumber) {
return 0;
}
uint32 lower = 0;
uint32 upper = nCheckpoints - 1;
while (upper > lower) {
uint32 center = upper - (upper - lower) / 2;
Checkpoint memory cp = checkpoints[account][center];
if (cp.fromBlock == blockNumber) {
return cp.votes;
} else if (cp.fromBlock < blockNumber) {
lower = center;
} else {
upper = center - 1;
}
}
return checkpoints[account][lower].votes;
}
function getPastVotes(address account, uint256 blockNumber) external view returns (uint96) {
return this.getPriorVotes(account, blockNumber);
}
function _delegate(address delegator, address delegatee) internal {
address currentDelegate = delegates(delegator);
_delegates[delegator] = delegatee;
emit DelegateChanged(delegator, currentDelegate, delegatee);
uint96 amount = votesToDelegate(delegator);
_moveDelegates(currentDelegate, delegatee, amount);
}
function _moveDelegates(
address srcRep,
address dstRep,
uint96 amount
) internal {
if (srcRep != dstRep && amount > 0) {
if (srcRep != address(0)) {
uint32 srcRepNum = numCheckpoints[srcRep];
uint96 srcRepOld = srcRepNum > 0 ? checkpoints[srcRep][srcRepNum - 1].votes : 0;
uint96 srcRepNew = sub96(srcRepOld, amount, "ERC721Checkpointable::_moveDelegates: amount underflows");
_writeCheckpoint(srcRep, srcRepNum, srcRepOld, srcRepNew);
}
if (dstRep != address(0)) {
uint32 dstRepNum = numCheckpoints[dstRep];
uint96 dstRepOld = dstRepNum > 0 ? checkpoints[dstRep][dstRepNum - 1].votes : 0;
uint96 dstRepNew = add96(dstRepOld, amount, "ERC721Checkpointable::_moveDelegates: amount overflows");
_writeCheckpoint(dstRep, dstRepNum, dstRepOld, dstRepNew);
}
}
}
function _writeCheckpoint(
address delegatee,
uint32 nCheckpoints,
uint96 oldVotes,
uint96 newVotes
) internal {
uint32 blockNumber = safe32(
block.number,
"ERC721Checkpointable::_writeCheckpoint: block number exceeds 32 bits"
);
if (nCheckpoints > 0 && checkpoints[delegatee][nCheckpoints - 1].fromBlock == blockNumber) {
checkpoints[delegatee][nCheckpoints - 1].votes = newVotes;
} else {
checkpoints[delegatee][nCheckpoints] = Checkpoint(blockNumber, newVotes);
numCheckpoints[delegatee] = nCheckpoints + 1;
}
emit DelegateVotesChanged(delegatee, oldVotes, newVotes);
}
function safe32(uint256 n, string memory errorMessage) internal pure returns (uint32) {
require(n < 2**32, errorMessage);
return uint32(n);
}
function safe96(uint256 n, string memory errorMessage) internal pure returns (uint96) {
require(n < 2**96, errorMessage);
return uint96(n);
}
function add96(
uint96 a,
uint96 b,
string memory errorMessage
) internal pure returns (uint96) {
uint96 c = a + b;
require(c >= a, errorMessage);
return c;
}
function sub96(
uint96 a,
uint96 b,
string memory errorMessage
) internal pure returns (uint96) {
require(b <= a, errorMessage);
return a - b;
}
}
文件 8 的 16:IERC1271.sol
pragma solidity ^0.8.0;
interface IERC1271 {
function isValidSignature(bytes32 hash, bytes memory signature) external view returns (bytes4 magicValue);
}
文件 9 的 16:IERC165.sol
pragma solidity ^0.8.0;
interface IERC165 {
function supportsInterface(bytes4 interfaceId) external view returns (bool);
}
文件 10 的 16:IERC20.sol
pragma solidity ^0.8.0;
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(
address sender,
address recipient,
uint256 amount
) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
文件 11 的 16:IERC4494.sol
pragma solidity 0.8.9;
interface IERC4494 {
function DOMAIN_SEPARATOR() external view returns (bytes32);
function nonces(uint256 tokenId) external view returns (uint256);
function permit(
address spender,
uint256 tokenId,
uint256 deadline,
bytes memory signature
) external;
}
interface IERC4494Alternative {
function DOMAIN_SEPARATOR() external view returns (bytes32);
function tokenNonces(uint256 tokenId) external view returns (uint256);
function permit(
address spender,
uint256 tokenId,
uint256 deadline,
bytes memory signature
) external;
}
文件 12 的 16:IERC721.sol
pragma solidity ^0.8.0;
import "../../utils/introspection/IERC165.sol";
interface IERC721 is IERC165 {
event Transfer(address indexed from, address indexed to, uint256 indexed tokenId);
event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId);
event ApprovalForAll(address indexed owner, address indexed operator, bool approved);
function balanceOf(address owner) external view returns (uint256 balance);
function ownerOf(uint256 tokenId) external view returns (address owner);
function safeTransferFrom(
address from,
address to,
uint256 tokenId
) external;
function transferFrom(
address from,
address to,
uint256 tokenId
) external;
function approve(address to, uint256 tokenId) external;
function getApproved(uint256 tokenId) external view returns (address operator);
function setApprovalForAll(address operator, bool _approved) external;
function isApprovedForAll(address owner, address operator) external view returns (bool);
function safeTransferFrom(
address from,
address to,
uint256 tokenId,
bytes calldata data
) external;
}
文件 13 的 16:IERC721Receiver.sol
pragma solidity ^0.8.0;
interface IERC721Receiver {
function onERC721Received(
address operator,
address from,
uint256 tokenId,
bytes calldata data
) external returns (bytes4);
}
文件 14 的 16:ITokenURI.sol
pragma solidity 0.8.9;
interface ITokenURI {
function tokenURI(uint256 id) external view returns (string memory);
function contractURI(address receiver, uint96 per10Thousands) external view returns (string memory);
}
文件 15 的 16:SignatureChecker.sol
pragma solidity ^0.8.0;
import "./ECDSA.sol";
import "../Address.sol";
import "../../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);
if (error == ECDSA.RecoverError.NoError && recovered == signer) {
return true;
}
(bool success, bytes memory result) = signer.staticcall(
abi.encodeWithSelector(IERC1271.isValidSignature.selector, hash, signature)
);
return (success && result.length == 32 && abi.decode(result, (bytes4)) == IERC1271.isValidSignature.selector);
}
}
文件 16 的 16:WithSupportForOpenSeaProxies.sol
pragma solidity 0.8.9;
contract OwnableDelegateProxy {}
contract ProxyRegistry {
mapping(address => OwnableDelegateProxy) public proxies;
}
abstract contract WithSupportForOpenSeaProxies {
address internal immutable _proxyRegistryAddress;
constructor(address proxyRegistryAddress) {
_proxyRegistryAddress = proxyRegistryAddress;
}
function _isOpenSeaProxy(address owner, address operator) internal view returns (bool) {
if (_proxyRegistryAddress == address(0)) {
return false;
}
ProxyRegistry proxyRegistry = ProxyRegistry(_proxyRegistryAddress);
return address(proxyRegistry.proxies(owner)) == operator;
}
}
{
"compilationTarget": {
"src/bleeps/Bleeps.sol": "Bleeps"
},
"evmVersion": "london",
"libraries": {},
"metadata": {
"bytecodeHash": "ipfs",
"useLiteralContent": true
},
"optimizer": {
"enabled": true,
"runs": 999999
},
"remappings": []
}
[{"inputs":[{"internalType":"address","name":"ens","type":"address"},{"internalType":"address","name":"initialOwner","type":"address"},{"internalType":"address","name":"initialTokenURIAdmin","type":"address"},{"internalType":"address","name":"initialMinterAdmin","type":"address"},{"internalType":"address","name":"initialRoyaltyAdmin","type":"address"},{"internalType":"address","name":"initialGuardian","type":"address"},{"internalType":"address","name":"openseaProxyRegistry","type":"address"},{"internalType":"address","name":"initialRoyaltyReceiver","type":"address"},{"internalType":"uint96","name":"imitialRoyaltyPer10Thousands","type":"uint96"},{"internalType":"contract ITokenURI","name":"initialTokenURIContract","type":"address"},{"internalType":"address","name":"initialCheckpointingDisabler","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"approved","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"operator","type":"address"},{"indexed":false,"internalType":"bool","name":"approved","type":"bool"}],"name":"ApprovalForAll","type":"event"},{"anonymous":false,"inputs":[],"name":"CheckpointingDisabled","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"newCheckpointingDisabler","type":"address"}],"name":"CheckpointingDisablerSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"delegator","type":"address"},{"indexed":true,"internalType":"address","name":"fromDelegate","type":"address"},{"indexed":true,"internalType":"address","name":"toDelegate","type":"address"}],"name":"DelegateChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"delegate","type":"address"},{"indexed":false,"internalType":"uint256","name":"previousBalance","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"newBalance","type":"uint256"}],"name":"DelegateVotesChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"newGuardian","type":"address"}],"name":"GuardianSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"newMinterAdmin","type":"address"}],"name":"MinterAdminSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"newMinter","type":"address"}],"name":"MinterSet","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":"newRoyaltyAdmin","type":"address"}],"name":"RoyaltyAdminSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"receiver","type":"address"},{"indexed":false,"internalType":"uint256","name":"royaltyPer10Thousands","type":"uint256"}],"name":"RoyaltySet","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"newTokenURIAdmin","type":"address"}],"name":"TokenURIAdminSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"contract ITokenURI","name":"newTokenURIContract","type":"address"}],"name":"TokenURIContractSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Transfer","type":"event"},{"inputs":[],"name":"DELEGATION_TYPEHASH","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"DOMAIN_SEPARATOR","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"DOMAIN_TYPEHASH","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"PERMIT_FOR_ALL_TYPEHASH","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"PERMIT_TYPEHASH","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"operator","type":"address"},{"internalType":"uint256","name":"id","type":"uint256"}],"name":"approve","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"balance","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"checkpointingDisabler","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"uint32","name":"","type":"uint32"}],"name":"checkpoints","outputs":[{"internalType":"uint32","name":"fromBlock","type":"uint32"},{"internalType":"uint96","name":"votes","type":"uint96"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"contractURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"decimals","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"delegatee","type":"address"}],"name":"delegate","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"delegatee","type":"address"},{"internalType":"uint256","name":"nonce","type":"uint256"},{"internalType":"uint256","name":"expiry","type":"uint256"},{"internalType":"uint8","name":"v","type":"uint8"},{"internalType":"bytes32","name":"r","type":"bytes32"},{"internalType":"bytes32","name":"s","type":"bytes32"}],"name":"delegateBySig","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"delegator","type":"address"}],"name":"delegates","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"disableTheUseOfCheckpoints","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"id","type":"uint256"}],"name":"getApproved","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"getCurrentVotes","outputs":[{"internalType":"uint96","name":"","type":"uint96"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"uint256","name":"blockNumber","type":"uint256"}],"name":"getPastVotes","outputs":[{"internalType":"uint96","name":"","type":"uint96"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"uint256","name":"blockNumber","type":"uint256"}],"name":"getPriorVotes","outputs":[{"internalType":"uint96","name":"","type":"uint96"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"getVotes","outputs":[{"internalType":"uint96","name":"","type":"uint96"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"guardian","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"operator","type":"address"}],"name":"isApprovedForAll","outputs":[{"internalType":"bool","name":"isOperator","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint16","name":"id","type":"uint16"},{"internalType":"address","name":"to","type":"address"}],"name":"mint","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"minter","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"minterAdmin","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint16[]","name":"ids","type":"uint16[]"},{"internalType":"address[]","name":"tos","type":"address[]"}],"name":"multiMint","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes[]","name":"data","type":"bytes[]"}],"name":"multicall","outputs":[{"internalType":"bytes[]","name":"results","type":"bytes[]"}],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"uint256","name":"id","type":"uint256"}],"name":"nonces","outputs":[{"internalType":"uint256","name":"nonce","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"nonces","outputs":[{"internalType":"uint256","name":"nonce","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"numCheckpoints","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"ids","type":"uint256[]"}],"name":"ownerAndLastTransferBlockNumberList","outputs":[{"components":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"uint256","name":"lastTransferBlockNumber","type":"uint256"}],"internalType":"struct ERC721Base.OwnerData[]","name":"ownersData","type":"tuple[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"id","type":"uint256"}],"name":"ownerOf","outputs":[{"internalType":"address","name":"owner","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"ids","type":"uint256[]"}],"name":"owners","outputs":[{"internalType":"address[]","name":"addresses","type":"address[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"uint256","name":"deadline","type":"uint256"},{"internalType":"bytes","name":"sig","type":"bytes"}],"name":"permit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"signer","type":"address"},{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"deadline","type":"uint256"},{"internalType":"bytes","name":"sig","type":"bytes"}],"name":"permitForAll","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"royaltyAdmin","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"id","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":"id","type":"uint256"}],"name":"safeTransferFrom","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":"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":"newCheckpointingDisabler","type":"address"}],"name":"setCheckpointingDisabler","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"name","type":"string"}],"name":"setENSName","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newGuardian","type":"address"}],"name":"setGuardian","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newMinter","type":"address"}],"name":"setMinter","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newMinterAdmin","type":"address"}],"name":"setMinterAdmin","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newRoyaltyAdmin","type":"address"}],"name":"setRoyaltyAdmin","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newReceiver","type":"address"},{"internalType":"uint96","name":"royaltyPer10Thousands","type":"uint96"}],"name":"setRoyaltyParameters","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newTokenURIAdmin","type":"address"}],"name":"setTokenURIAdmin","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract ITokenURI","name":"newTokenURIContract","type":"address"}],"name":"setTokenURIContract","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"id","type":"uint256"}],"name":"sound","outputs":[{"internalType":"uint8","name":"note","type":"uint8"},{"internalType":"uint8","name":"instrument","type":"uint8"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"bytes4","name":"id","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"pure","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"uint256","name":"id","type":"uint256"}],"name":"tokenNonces","outputs":[{"internalType":"uint256","name":"nonce","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"id","type":"uint256"}],"name":"tokenURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"tokenURIAdmin","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"tokenURIContract","outputs":[{"internalType":"contract ITokenURI","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"id","type":"uint256"}],"name":"transferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"delegator","type":"address"}],"name":"votesToDelegate","outputs":[{"internalType":"uint96","name":"","type":"uint96"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"contract IERC20","name":"token","type":"address"},{"internalType":"address","name":"to","type":"address"}],"name":"withdrawERC20","outputs":[],"stateMutability":"nonpayable","type":"function"}]