文件 1 的 31:Address.sol
pragma solidity 0.8.9;
library Address {
function isContract(address account) internal view returns (bool) {
return account.code.length > 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 的 31:Clones.sol
pragma solidity 0.8.9;
library Clones {
function clone(address implementation) internal returns (address instance) {
assembly {
let ptr := mload(0x40)
mstore(ptr, 0x3d602d80600a3d3981f3363d3d373d3d3d363d73000000000000000000000000)
mstore(add(ptr, 0x14), shl(0x60, implementation))
mstore(add(ptr, 0x28), 0x5af43d82803e903d91602b57fd5bf30000000000000000000000000000000000)
instance := create(0, ptr, 0x37)
}
require(instance != address(0), "ERC1167: create failed");
}
function cloneDeterministic(address implementation, bytes32 salt) internal returns (address instance) {
assembly {
let ptr := mload(0x40)
mstore(ptr, 0x3d602d80600a3d3981f3363d3d373d3d3d363d73000000000000000000000000)
mstore(add(ptr, 0x14), shl(0x60, implementation))
mstore(add(ptr, 0x28), 0x5af43d82803e903d91602b57fd5bf30000000000000000000000000000000000)
instance := create2(0, ptr, 0x37, salt)
}
require(instance != address(0), "ERC1167: create2 failed");
}
function predictDeterministicAddress(
address implementation,
bytes32 salt,
address deployer
) internal pure returns (address predicted) {
assembly {
let ptr := mload(0x40)
mstore(ptr, 0x3d602d80600a3d3981f3363d3d373d3d3d363d73000000000000000000000000)
mstore(add(ptr, 0x14), shl(0x60, implementation))
mstore(add(ptr, 0x28), 0x5af43d82803e903d91602b57fd5bf3ff00000000000000000000000000000000)
mstore(add(ptr, 0x38), shl(0x60, deployer))
mstore(add(ptr, 0x4c), salt)
mstore(add(ptr, 0x6c), keccak256(ptr, 0x37))
predicted := keccak256(add(ptr, 0x37), 0x55)
}
}
function predictDeterministicAddress(address implementation, bytes32 salt)
internal
view
returns (address predicted)
{
return predictDeterministicAddress(implementation, salt, address(this));
}
}
文件 3 的 31:Context.sol
pragma solidity 0.8.9;
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes calldata) {
return msg.data;
}
}
文件 4 的 31:ECDSA.sol
pragma solidity 0.8.9;
import "./Strings.sol";
library ECDSA {
enum RecoverError {
NoError,
InvalidSignature,
InvalidSignatureLength,
InvalidSignatureS,
InvalidSignatureV
}
function _throwError(RecoverError error) private pure {
if (error == RecoverError.NoError) {
return;
} else if (error == RecoverError.InvalidSignature) {
revert("ECDSA: invalid signature");
} else if (error == RecoverError.InvalidSignatureLength) {
revert("ECDSA: invalid signature length");
} else if (error == RecoverError.InvalidSignatureS) {
revert("ECDSA: invalid signature 's' value");
} 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 toEthSignedMessageHash(bytes memory s) internal pure returns (bytes32) {
return keccak256(abi.encodePacked("\x19Ethereum Signed Message:\n", Strings.toString(s.length), s));
}
function toTypedDataHash(bytes32 domainSeparator, bytes32 structHash) internal pure returns (bytes32) {
return keccak256(abi.encodePacked("\x19\x01", domainSeparator, structHash));
}
}
文件 5 的 31:ERC165.sol
pragma solidity 0.8.9;
import "../interfaces/IERC165.sol";
abstract contract ERC165 is IERC165 {
function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
return interfaceId == type(IERC165).interfaceId;
}
}
文件 6 的 31:ERC721.sol
pragma solidity 0.8.9;
import "./ERC721Errors.sol";
import "../interfaces/IERC721.sol";
import "../interfaces/IERC721Receiver.sol";
import "../interfaces/IERC721Metadata.sol";
import "../interfaces/IERC721Cloneable.sol";
import "../libraries/Address.sol";
import "../libraries/Context.sol";
import "../libraries/Strings.sol";
import "../utils/ERC165.sol";
import "../utils/GenericErrors.sol";
abstract contract ERC721 is Context, ERC165, ERC721Errors, GenericErrors, IERC721Metadata, IERC721Cloneable {
using Address for address;
using Strings for uint256;
bool internal initializedERC721;
string internal tokenName;
string internal tokenSymbol;
string internal baseMetadataURI;
mapping(uint256 => address) internal owners;
mapping(address => uint256) internal balances;
mapping(uint256 => address) internal tokenApprovals;
mapping(address => mapping(address => bool)) internal operatorApprovals;
function initializeERC721(string memory name_, string memory symbol_, string memory baseURI_) public override {
require(!initializedERC721, ERROR_REINITIALIZATION_NOT_PERMITTED);
tokenName = name_;
tokenSymbol = symbol_;
_setBaseURI(baseURI_);
initializedERC721 = true;
}
function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165, IERC165) returns (bool) {
return
interfaceId == type(IERC721).interfaceId ||
interfaceId == type(IERC721Metadata).interfaceId ||
interfaceId == type(IERC721Cloneable).interfaceId ||
super.supportsInterface(interfaceId);
}
function balanceOf(address owner) public view virtual override returns (uint256) {
require(owner != address(0), ERROR_QUERY_FOR_ZERO_ADDRESS);
return balances[owner];
}
function ownerOf(uint256 tokenId) public view virtual override returns (address) {
address owner = owners[tokenId];
require(owner != address(0), ERROR_QUERY_FOR_NONEXISTENT_TOKEN);
return owner;
}
function name() public view virtual override returns (string memory) {
return tokenName;
}
function symbol() public view virtual override returns (string memory) {
return tokenSymbol;
}
function tokenURI(uint256 tokenId) public view virtual override returns (string memory) {
require(_exists(tokenId), ERROR_QUERY_FOR_NONEXISTENT_TOKEN);
string memory uriBase = baseURI();
return bytes(uriBase).length > 0 ? string(abi.encodePacked(uriBase, tokenId.toString())) : "";
}
function baseURI() public view virtual returns (string memory) {
return baseMetadataURI;
}
function _setBaseURI(string memory uri) internal {
baseMetadataURI = uri;
}
function approve(address to, uint256 tokenId) public virtual override {
address owner = ownerOf(tokenId);
require(to != owner, ERROR_APPROVAL_TO_CURRENT_OWNER);
require(_msgSender() == owner || isApprovedForAll(owner, _msgSender()), ERROR_NOT_OWNER_NOR_APPROVED);
_approve(owner, to, tokenId);
}
function getApproved(uint256 tokenId) public view virtual override returns (address) {
require(_exists(tokenId), ERROR_QUERY_FOR_NONEXISTENT_TOKEN);
return tokenApprovals[tokenId];
}
function setApprovalForAll(address operator, bool approved) public virtual override {
require(operator != _msgSender(), ERROR_APPROVE_TO_CALLER);
operatorApprovals[_msgSender()][operator] = approved;
emit ApprovalForAll(_msgSender(), operator, approved);
}
function isApprovedForAll(address owner, address operator) public view virtual override returns (bool) {
return operatorApprovals[owner][operator];
}
function transferFrom(address from, address to, uint256 tokenId) public virtual override {
(address owner, bool isApprovedOrOwner) = _isApprovedOrOwner(_msgSender(), tokenId);
require(isApprovedOrOwner, ERROR_NOT_OWNER_NOR_APPROVED);
_transfer(owner, from, to, tokenId);
}
function safeTransferFrom(address from, address to, uint256 tokenId) public virtual override {
safeTransferFrom(from, to, tokenId, "");
}
function safeTransferFrom(address from, address to, uint256 tokenId, bytes memory data) public virtual override {
transferFrom(from, to, tokenId);
require(_checkOnERC721Received(from, to, tokenId, data), ERROR_NOT_AN_ERC721_RECEIVER);
}
function _exists(uint256 tokenId) internal view virtual returns (bool) {
return owners[tokenId] != address(0);
}
function _isApprovedOrOwner(address spender, uint256 tokenId) internal view virtual returns (address owner, bool isApprovedOrOwner) {
owner = owners[tokenId];
require(owner != address(0), ERROR_QUERY_FOR_NONEXISTENT_TOKEN);
isApprovedOrOwner = (spender == owner || tokenApprovals[tokenId] == spender || isApprovedForAll(owner, spender));
}
function _burn(uint256 tokenId) internal virtual {
address owner = ownerOf(tokenId);
bool isApprovedOrOwner = (_msgSender() == owner || tokenApprovals[tokenId] == _msgSender() || isApprovedForAll(owner, _msgSender()));
require(isApprovedOrOwner, ERROR_NOT_OWNER_NOR_APPROVED);
_clearApproval(owner, tokenId);
balances[owner] -= 1;
_clearOwnership(tokenId);
emit Transfer(owner, address(0), tokenId);
}
function _transfer(address owner, address from, address to, uint256 tokenId) internal virtual {
require(owner == from, ERROR_TRANSFER_FROM_INCORRECT_OWNER);
require(to != address(0), ERROR_TRANSFER_TO_ZERO_ADDRESS);
_clearApproval(owner, tokenId);
balances[from] -= 1;
balances[to] += 1;
_setOwnership(to, tokenId);
emit Transfer(from, to, tokenId);
}
function _clearApproval(address owner, uint256 tokenId) internal virtual {
delete tokenApprovals[tokenId];
emit Approval(owner, address(0), tokenId);
}
function _approve(address owner, address to, uint256 tokenId) internal virtual {
tokenApprovals[tokenId] = to;
emit Approval(owner, to, tokenId);
}
function _clearOwnership(uint256 tokenId) internal virtual {
delete owners[tokenId];
}
function _setOwnership(address to, uint256 tokenId) internal virtual {
owners[tokenId] = to;
}
function _checkOnERC721Received(
address from,
address to,
uint256 tokenId,
bytes memory _data
) internal returns (bool) {
if (to.isContract()) {
try IERC721Receiver(to).onERC721Received(_msgSender(), from, tokenId, _data) returns (bytes4 retval) {
return retval == IERC721Receiver.onERC721Received.selector;
} catch (bytes memory reason) {
if (reason.length == 0) {
revert(ERROR_NOT_AN_ERC721_RECEIVER);
} else {
assembly {
revert(add(32, reason), mload(reason))
}
}
}
} else {
return true;
}
}
}
文件 7 的 31:ERC721Errors.sol
pragma solidity 0.8.9;
abstract contract ERC721Errors {
string internal constant ERROR_QUERY_FOR_ZERO_ADDRESS = "Query for zero address";
string internal constant ERROR_QUERY_FOR_NONEXISTENT_TOKEN = "Token does not exist";
string internal constant ERROR_APPROVAL_TO_CURRENT_OWNER = "Current owner approval";
string internal constant ERROR_APPROVE_TO_CALLER = "Approve to caller";
string internal constant ERROR_NOT_OWNER_NOR_APPROVED = "Not owner nor approved";
string internal constant ERROR_NOT_AN_ERC721_RECEIVER = "Not an ERC721Receiver";
string internal constant ERROR_TRANSFER_FROM_INCORRECT_OWNER = "Transfer from incorrect owner";
string internal constant ERROR_TRANSFER_TO_ZERO_ADDRESS = "Transfer to zero address";
string internal constant ERROR_ALREADY_MINTED = "Token already minted";
string internal constant ERROR_NO_TOKENS_MINTED = "No tokens minted";
}
文件 8 的 31:ERC721Omnibus.sol
pragma solidity 0.8.9;
import "./ERC721.sol";
import "../interfaces/IERC721DefaultOwnerCloneable.sol";
abstract contract ERC721Omnibus is ERC721, IERC721DefaultOwnerCloneable {
struct TokenOwner {
bool transferred;
address ownerAddress;
}
struct CollectionStatus {
bool isContractFinalized;
uint88 amountCreated;
address defaultOwner;
}
bool internal initializedDefaultOwner;
CollectionStatus internal collectionStatus;
mapping(uint256 => TokenOwner) internal ownersOptimized;
function initializeDefaultOwner(address defaultOwner_) public {
require(!initializedDefaultOwner, ERROR_REINITIALIZATION_NOT_PERMITTED);
collectionStatus.defaultOwner = defaultOwner_;
initializedDefaultOwner = true;
}
function supportsInterface(bytes4 interfaceId) public view virtual override(ERC721, IERC165) returns (bool) {
return
interfaceId == type(IERC721DefaultOwnerCloneable).interfaceId ||
super.supportsInterface(interfaceId);
}
function getCollectionStatus() public view virtual returns (CollectionStatus memory) {
return collectionStatus;
}
function ownerOf(uint256 tokenId) public view virtual override returns (address owner) {
require(_isValidTokenId(tokenId), ERROR_QUERY_FOR_NONEXISTENT_TOKEN);
owner = ownersOptimized[tokenId].transferred ? ownersOptimized[tokenId].ownerAddress : collectionStatus.defaultOwner;
require(owner != address(0), ERROR_QUERY_FOR_NONEXISTENT_TOKEN);
}
function _exists(uint256 tokenId) internal view virtual override returns (bool) {
if(_isValidTokenId(tokenId)) {
return ownersOptimized[tokenId].ownerAddress != address(0) || !ownersOptimized[tokenId].transferred;
}
return false;
}
function _isApprovedOrOwner(address spender, uint256 tokenId) internal view virtual override returns (address owner, bool isApprovedOrOwner) {
owner = ownerOf(tokenId);
isApprovedOrOwner = (spender == owner || tokenApprovals[tokenId] == spender || isApprovedForAll(owner, spender));
}
function _clearOwnership(uint256 tokenId) internal virtual override {
ownersOptimized[tokenId].transferred = true;
ownersOptimized[tokenId].ownerAddress = address(0);
}
function _setOwnership(address to, uint256 tokenId) internal virtual override {
ownersOptimized[tokenId].transferred = true;
ownersOptimized[tokenId].ownerAddress = to;
}
function _isValidTokenId(uint256 ) internal virtual view returns (bool);
}
文件 9 的 31:FewoWorldPaint.sol
pragma solidity 0.8.9;
import "@niftygateway/nifty-contracts/contracts/interfaces/IERC2309.sol";
import "@niftygateway/nifty-contracts/contracts/tokens/ERC721Omnibus.sol";
import "@niftygateway/nifty-contracts/contracts/utils/Royalties.sol";
import "@niftygateway/nifty-contracts/contracts/utils/Signable.sol";
import "@niftygateway/nifty-contracts/contracts/utils/Withdrawable.sol";
contract FewoWorldPaint is ERC721Omnibus, Royalties, Signable, Withdrawable, IERC2309 {
uint256 constant private BITS_PER_VALUE = 16;
uint256 constant private MAX_UINT_16 = 0xffff;
uint256 _nextIndex = 0;
uint256[] public packedPaintValues;
constructor(address niftyRegistryContract, address defaultOwner) {
initializeERC721("FewoWorld Paint", "Paint", "https://api.niftygateway.com/paint/");
initializeNiftyEntity(niftyRegistryContract);
initializeDefaultOwner(defaultOwner);
}
function supportsInterface(bytes4 interfaceId) public view virtual override(ERC721Omnibus, Royalties, NiftyPermissions) returns (bool) {
return
interfaceId == type(IERC2309).interfaceId ||
super.supportsInterface(interfaceId);
}
function exists(uint256 tokenId) public view returns (bool) {
return _exists(tokenId);
}
function getPaintValue(uint256 tokenId) public view returns (uint16) {
if(!exists(tokenId)) {
return 0;
} else {
uint256 bin = 0;
uint256 index = 0;
uint256 packedWord = 0;
unchecked {
bin = (tokenId - 1) / BITS_PER_VALUE;
index = (tokenId - 1) % BITS_PER_VALUE;
packedWord = packedPaintValues[bin];
}
return uint16(MAX_UINT_16 & (packedWord >> (BITS_PER_VALUE * index)));
}
}
function finalizeContract() external {
_requireOnlyValidSender();
collectionStatus.isContractFinalized = true;
}
function setBaseURI(string calldata uri) external {
_requireOnlyValidSender();
_setBaseURI(uri);
}
function burn(uint256 tokenId) public {
_burn(tokenId);
}
function mint(uint256[] calldata paintValues) external {
_requireOnlyValidSender();
uint256 numValues = paintValues.length;
require(numValues > 0, ERROR_INPUT_ARRAY_EMPTY);
address to = collectionStatus.defaultOwner;
require(to != address(0), ERROR_TRANSFER_TO_ZERO_ADDRESS);
require(!collectionStatus.isContractFinalized, ERROR_CONTRACT_IS_FINALIZED);
uint256 index = _nextIndex;
uint256 valueIx = 0;
uint256 firstNewTokenId = index + 1;
uint256 packedWord = 0;
if(index % BITS_PER_VALUE != 0) {
packedWord = packedPaintValues[packedPaintValues.length - 1];
packedPaintValues.pop();
}
while(valueIx < numValues) {
uint256 value = paintValues[valueIx];
require(value > 0 && value <= MAX_UINT_16, "Requires paint of 1 to 65535");
uint256 mod16 = index % BITS_PER_VALUE;
if(mod16 == 0 && packedWord > 0) {
packedPaintValues.push(packedWord);
packedWord = 0;
}
packedWord |= value << (mod16 * BITS_PER_VALUE);
valueIx++;
index++;
}
_nextIndex = index;
if(packedWord > 0) {
packedPaintValues.push(packedWord);
}
balances[to] += numValues;
collectionStatus.amountCreated += uint88(numValues);
emit ConsecutiveTransfer(firstNewTokenId, firstNewTokenId + numValues - 1, address(0), to);
}
function _isValidTokenId(uint256 tokenId) internal virtual view override returns (bool) {
return tokenId > 0 && tokenId <= collectionStatus.amountCreated;
}
function _getNiftyType(uint256 ) internal virtual view override returns (uint256) {
return 1;
}
}
文件 10 的 31:GenericErrors.sol
pragma solidity 0.8.9;
abstract contract GenericErrors {
string internal constant ERROR_INPUT_ARRAY_EMPTY = "Input array empty";
string internal constant ERROR_INPUT_ARRAY_SIZE_MISMATCH = "Input array size mismatch";
string internal constant ERROR_INVALID_MSG_SENDER = "Invalid msg.sender";
string internal constant ERROR_UNEXPECTED_DATA_SIGNER = "Unexpected data signer";
string internal constant ERROR_INSUFFICIENT_BALANCE = "Insufficient balance";
string internal constant ERROR_WITHDRAW_UNSUCCESSFUL = "Withdraw unsuccessful";
string internal constant ERROR_CONTRACT_IS_FINALIZED = "Contract is finalized";
string internal constant ERROR_CANNOT_CHANGE_DEFAULT_OWNER = "Cannot change default owner";
string internal constant ERROR_UNCLONEABLE_REFERENCE_CONTRACT = "Uncloneable reference contract";
string internal constant ERROR_BIPS_OVER_100_PERCENT = "Bips over 100%";
string internal constant ERROR_NO_ROYALTY_RECEIVER = "No royalty receiver";
string internal constant ERROR_REINITIALIZATION_NOT_PERMITTED = "Re-initialization not permitted";
string internal constant ERROR_ZERO_ETH_TRANSFER = "Zero ETH Transfer";
}
文件 11 的 31:ICloneablePaymentSplitter.sol
pragma solidity 0.8.9;
import "./IERC165.sol";
import "../libraries/SafeERC20.sol";
interface ICloneablePaymentSplitter is IERC165 {
event PayeeAdded(address account, uint256 shares);
event PaymentReleased(address to, uint256 amount);
event ERC20PaymentReleased(IERC20 indexed token, address to, uint256 amount);
event PaymentReceived(address from, uint256 amount);
function initialize(address[] calldata payees, uint256[] calldata shares_) external;
function totalShares() external view returns (uint256);
function totalReleased() external view returns (uint256);
function totalReleased(IERC20 token) external view returns (uint256);
function shares(address account) external view returns (uint256);
function released(address account) external view returns (uint256);
function released(IERC20 token, address account) external view returns (uint256);
function payee(uint256 index) external view returns (address);
function release(address payable account) external;
function release(IERC20 token, address account) external;
function pendingPayment(address account) external view returns (uint256);
function pendingPayment(IERC20 token, address account) external view returns (uint256);
}
文件 12 的 31:IERC165.sol
pragma solidity 0.8.9;
interface IERC165 {
function supportsInterface(bytes4 interfaceId) external view returns (bool);
}
文件 13 的 31:IERC20.sol
pragma solidity 0.8.9;
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);
}
文件 14 的 31:IERC2309.sol
pragma solidity 0.8.9;
interface IERC2309 {
event ConsecutiveTransfer(uint256 indexed fromTokenId, uint256 toTokenId, address indexed fromAddress, address indexed toAddress);
}
文件 15 的 31:IERC2981.sol
pragma solidity 0.8.9;
import "./IERC165.sol";
interface IERC2981 is IERC165 {
function royaltyInfo(uint256 tokenId, uint256 salePrice)
external
view
returns (address receiver, uint256 royaltyAmount);
}
文件 16 的 31:IERC721.sol
pragma solidity 0.8.9;
import "./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;
}
文件 17 的 31:IERC721Cloneable.sol
pragma solidity 0.8.9;
import "./IERC721.sol";
interface IERC721Cloneable is IERC721 {
function initializeERC721(string calldata name_, string calldata symbol_, string calldata baseURI_) external;
}
文件 18 的 31:IERC721DefaultOwnerCloneable.sol
pragma solidity 0.8.9;
import "./IERC165.sol";
interface IERC721DefaultOwnerCloneable is IERC165 {
function initializeDefaultOwner(address defaultOwner_) external;
}
文件 19 的 31:IERC721Metadata.sol
pragma solidity 0.8.9;
import "./IERC721.sol";
interface IERC721Metadata is IERC721 {
function name() external view returns (string memory);
function symbol() external view returns (string memory);
function tokenURI(uint256 tokenId) external view returns (string memory);
}
文件 20 的 31:IERC721Receiver.sol
pragma solidity 0.8.9;
interface IERC721Receiver {
function onERC721Received(
address operator,
address from,
uint256 tokenId,
bytes calldata data
) external returns (bytes4);
}
文件 21 的 31:INiftyEntityCloneable.sol
pragma solidity 0.8.9;
import "./IERC165.sol";
interface INiftyEntityCloneable is IERC165 {
function initializeNiftyEntity(address niftyRegistryContract_) external;
}
文件 22 的 31:INiftyRegistry.sol
pragma solidity 0.8.9;
interface INiftyRegistry {
function isValidNiftySender(address sendingKey) external view returns (bool);
}
文件 23 的 31:NiftyPermissions.sol
pragma solidity 0.8.9;
import "./ERC165.sol";
import "./GenericErrors.sol";
import "../interfaces/INiftyEntityCloneable.sol";
import "../interfaces/INiftyRegistry.sol";
import "../libraries/Context.sol";
abstract contract NiftyPermissions is Context, ERC165, GenericErrors, INiftyEntityCloneable {
event AdminTransferred(address indexed previousAdmin, address indexed newAdmin);
bool internal initializedNiftyEntity;
address public admin;
address public nominatedAdmin;
INiftyRegistry internal permissionsRegistry;
function initializeNiftyEntity(address niftyRegistryContract_) public {
require(!initializedNiftyEntity, ERROR_REINITIALIZATION_NOT_PERMITTED);
permissionsRegistry = INiftyRegistry(niftyRegistryContract_);
initializedNiftyEntity = true;
}
function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165, IERC165) returns (bool) {
return
interfaceId == type(INiftyEntityCloneable).interfaceId ||
super.supportsInterface(interfaceId);
}
function renounceAdmin() external {
_requireOnlyValidSender();
_transferAdmin(address(0));
}
function nominateAdmin(address nominee) external {
_requireOnlyValidSender();
nominatedAdmin = nominee;
}
function acceptAdmin() external {
address nominee = nominatedAdmin;
require(_msgSender() == nominee, ERROR_INVALID_MSG_SENDER);
_transferAdmin(nominee);
}
function _requireOnlyValidSender() internal view {
address currentAdmin = admin;
if(currentAdmin == address(0)) {
require(permissionsRegistry.isValidNiftySender(_msgSender()), ERROR_INVALID_MSG_SENDER);
} else {
require(_msgSender() == currentAdmin, ERROR_INVALID_MSG_SENDER);
}
}
function _transferAdmin(address newAdmin) internal {
address oldAdmin = admin;
admin = newAdmin;
delete nominatedAdmin;
emit AdminTransferred(oldAdmin, newAdmin);
}
}
文件 24 的 31:RejectEther.sol
pragma solidity 0.8.9;
abstract contract RejectEther {
fallback() external payable {
revert("Fallback function not permitted");
}
receive() external payable {
revert("Receiving ETH not permitted");
}
}
文件 25 的 31:Royalties.sol
pragma solidity 0.8.9;
import "./NiftyPermissions.sol";
import "../libraries/Clones.sol";
import "../interfaces/IERC20.sol";
import "../interfaces/IERC721.sol";
import "../interfaces/IERC2981.sol";
import "../interfaces/ICloneablePaymentSplitter.sol";
import "../structs/RoyaltyRecipient.sol";
abstract contract Royalties is NiftyPermissions, IERC2981 {
event RoyaltyReceiverUpdated(uint256 indexed niftyType, address previousReceiver, address newReceiver);
uint256 constant public BIPS_PERCENTAGE_TOTAL = 10000;
mapping (uint256 => RoyaltyRecipient) internal royaltyRecipients;
function supportsInterface(bytes4 interfaceId) public view virtual override(NiftyPermissions, IERC165) returns (bool) {
return
interfaceId == type(IERC2981).interfaceId ||
super.supportsInterface(interfaceId);
}
function getRoyaltySettings(uint256 niftyType) public view returns (RoyaltyRecipient memory) {
return royaltyRecipients[niftyType];
}
function setRoyaltyBips(uint256 niftyType, uint256 bips) external {
_requireOnlyValidSender();
require(bips <= BIPS_PERCENTAGE_TOTAL, ERROR_BIPS_OVER_100_PERCENT);
royaltyRecipients[niftyType].bips = uint16(bips);
}
function royaltyInfo(uint256 tokenId, uint256 salePrice) public virtual override view returns (address, uint256) {
uint256 niftyType = _getNiftyType(tokenId);
return royaltyRecipients[niftyType].recipient == address(0) ?
(address(0), 0) :
(royaltyRecipients[niftyType].recipient, (salePrice * royaltyRecipients[niftyType].bips) / BIPS_PERCENTAGE_TOTAL);
}
function initializeRoyalties(uint256 niftyType, address splitterImplementation, address[] calldata payees, uint256[] calldata shares) external returns (address) {
_requireOnlyValidSender();
address previousReceiver = royaltyRecipients[niftyType].recipient;
royaltyRecipients[niftyType].isPaymentSplitter = payees.length > 1;
royaltyRecipients[niftyType].recipient = payees.length == 1 ? payees[0] : _clonePaymentSplitter(splitterImplementation, payees, shares);
emit RoyaltyReceiverUpdated(niftyType, previousReceiver, royaltyRecipients[niftyType].recipient);
return royaltyRecipients[niftyType].recipient;
}
function getNiftyType(uint256 tokenId) public view returns (uint256) {
return _getNiftyType(tokenId);
}
function getPaymentSplitterByNiftyType(uint256 niftyType) public virtual view returns (address) {
return _getPaymentSplitter(niftyType);
}
function getPaymentSplitterByTokenId(uint256 tokenId) public virtual view returns (address) {
return _getPaymentSplitter(_getNiftyType(tokenId));
}
function _getNiftyType(uint256 tokenId) internal virtual view returns (uint256) {
return 0;
}
function _clonePaymentSplitter(address splitterImplementation, address[] calldata payees, uint256[] calldata shares_) internal returns (address) {
require(IERC165(splitterImplementation).supportsInterface(type(ICloneablePaymentSplitter).interfaceId), ERROR_UNCLONEABLE_REFERENCE_CONTRACT);
address clone = payable (Clones.clone(splitterImplementation));
ICloneablePaymentSplitter(clone).initialize(payees, shares_);
return clone;
}
function _getPaymentSplitter(uint256 niftyType) internal virtual view returns (address) {
return royaltyRecipients[niftyType].isPaymentSplitter ? royaltyRecipients[niftyType].recipient : address(0);
}
}
文件 26 的 31:RoyaltyRecipient.sol
pragma solidity 0.8.9;
struct RoyaltyRecipient {
bool isPaymentSplitter;
uint16 bips;
address recipient;
}
文件 27 的 31:SafeERC20.sol
pragma solidity 0.8.9;
import "../interfaces/IERC20.sol";
import "./Address.sol";
library SafeERC20 {
using Address for address;
function safeTransfer(
IERC20 token,
address to,
uint256 value
) internal {
_callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value));
}
function safeTransferFrom(
IERC20 token,
address from,
address to,
uint256 value
) internal {
_callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value));
}
function _callOptionalReturn(IERC20 token, bytes memory data) private {
bytes memory returndata = address(token).functionCall(data, "SafeERC20: low-level call failed");
if (returndata.length > 0) {
require(abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed");
}
}
}
文件 28 的 31:Signable.sol
pragma solidity 0.8.9;
import "./NiftyPermissions.sol";
import "../libraries/ECDSA.sol";
import "../structs/SignatureStatus.sol";
abstract contract Signable is NiftyPermissions {
event ContractSigned(address signer, bytes32 data, bytes signature);
SignatureStatus public signatureStatus;
bytes public signature;
string internal constant ERROR_CONTRACT_ALREADY_SIGNED = "Contract already signed";
string internal constant ERROR_CONTRACT_NOT_SALTED = "Contract not salted";
string internal constant ERROR_INCORRECT_SECRET_SALT = "Incorrect secret salt";
string internal constant ERROR_SALTED_HASH_SET_TO_ZERO = "Salted hash set to zero";
string internal constant ERROR_SIGNER_SET_TO_ZERO = "Signer set to zero address";
function setSigner(address signer_, bytes32 saltedHash_) external {
_requireOnlyValidSender();
require(signer_ != address(0), ERROR_SIGNER_SET_TO_ZERO);
require(saltedHash_ != bytes32(0), ERROR_SALTED_HASH_SET_TO_ZERO);
require(!signatureStatus.isVerified, ERROR_CONTRACT_ALREADY_SIGNED);
signatureStatus.signer = signer_;
signatureStatus.saltedHash = saltedHash_;
signatureStatus.isSalted = true;
}
function sign(uint256 salt, bytes calldata signature_) external {
require(!signatureStatus.isVerified, ERROR_CONTRACT_ALREADY_SIGNED);
require(signatureStatus.isSalted, ERROR_CONTRACT_NOT_SALTED);
address expectedSigner = signatureStatus.signer;
bytes32 expectedSaltedHash = signatureStatus.saltedHash;
require(_msgSender() == expectedSigner, ERROR_INVALID_MSG_SENDER);
require(keccak256(abi.encodePacked(salt)) == expectedSaltedHash, ERROR_INCORRECT_SECRET_SALT);
require(ECDSA.recover(ECDSA.toEthSignedMessageHash(expectedSaltedHash), signature_) == expectedSigner, ERROR_UNEXPECTED_DATA_SIGNER);
signature = signature_;
signatureStatus.isVerified = true;
emit ContractSigned(expectedSigner, expectedSaltedHash, signature_);
}
}
文件 29 的 31:SignatureStatus.sol
pragma solidity 0.8.9;
struct SignatureStatus {
bool isSalted;
bool isVerified;
address signer;
bytes32 saltedHash;
}
文件 30 的 31:Strings.sol
pragma solidity 0.8.9;
library Strings {
bytes16 private constant _HEX_SYMBOLS = "0123456789abcdef";
function toString(uint256 value) internal pure returns (string memory) {
if (value == 0) {
return "0";
}
uint256 temp = value;
uint256 digits;
while (temp != 0) {
digits++;
temp /= 10;
}
bytes memory buffer = new bytes(digits);
while (value != 0) {
digits -= 1;
buffer[digits] = bytes1(uint8(48 + uint256(value % 10)));
value /= 10;
}
return string(buffer);
}
function toHexString(uint256 value) internal pure returns (string memory) {
if (value == 0) {
return "0x00";
}
uint256 temp = value;
uint256 length = 0;
while (temp != 0) {
length++;
temp >>= 8;
}
return toHexString(value, length);
}
function toHexString(uint256 value, uint256 length) internal pure returns (string memory) {
bytes memory buffer = new bytes(2 * length + 2);
buffer[0] = "0";
buffer[1] = "x";
for (uint256 i = 2 * length + 1; i > 1; --i) {
buffer[i] = _HEX_SYMBOLS[value & 0xf];
value >>= 4;
}
require(value == 0, "Strings: hex length insufficient");
return string(buffer);
}
}
文件 31 的 31:Withdrawable.sol
pragma solidity 0.8.9;
import "./RejectEther.sol";
import "./NiftyPermissions.sol";
import "../interfaces/IERC20.sol";
import "../interfaces/IERC721.sol";
abstract contract Withdrawable is RejectEther, NiftyPermissions {
function withdrawETH(address payable recipient, uint256 amount) external {
_requireOnlyValidSender();
require(amount > 0, ERROR_ZERO_ETH_TRANSFER);
require(recipient != address(0), "Transfer to zero address");
uint256 currentBalance = address(this).balance;
require(amount <= currentBalance, ERROR_INSUFFICIENT_BALANCE);
(bool success,) = recipient.call{value: amount}("");
require(success, ERROR_WITHDRAW_UNSUCCESSFUL);
}
function withdrawERC20(address tokenContract, address recipient, uint256 amount) external {
_requireOnlyValidSender();
bool success = IERC20(tokenContract).transfer(recipient, amount);
require(success, ERROR_WITHDRAW_UNSUCCESSFUL);
}
function withdrawERC721(address tokenContract, address recipient, uint256 tokenId) external {
_requireOnlyValidSender();
IERC721(tokenContract).safeTransferFrom(address(this), recipient, tokenId, "");
}
}
{
"compilationTarget": {
"contracts/FewoWorldPaint.sol": "FewoWorldPaint"
},
"evmVersion": "london",
"libraries": {},
"metadata": {
"bytecodeHash": "ipfs"
},
"optimizer": {
"enabled": true,
"runs": 1500
},
"remappings": []
}
[{"inputs":[{"internalType":"address","name":"niftyRegistryContract","type":"address"},{"internalType":"address","name":"defaultOwner","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousAdmin","type":"address"},{"indexed":true,"internalType":"address","name":"newAdmin","type":"address"}],"name":"AdminTransferred","type":"event"},{"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":[{"indexed":true,"internalType":"uint256","name":"fromTokenId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"toTokenId","type":"uint256"},{"indexed":true,"internalType":"address","name":"fromAddress","type":"address"},{"indexed":true,"internalType":"address","name":"toAddress","type":"address"}],"name":"ConsecutiveTransfer","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"signer","type":"address"},{"indexed":false,"internalType":"bytes32","name":"data","type":"bytes32"},{"indexed":false,"internalType":"bytes","name":"signature","type":"bytes"}],"name":"ContractSigned","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"niftyType","type":"uint256"},{"indexed":false,"internalType":"address","name":"previousReceiver","type":"address"},{"indexed":false,"internalType":"address","name":"newReceiver","type":"address"}],"name":"RoyaltyReceiverUpdated","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"},{"stateMutability":"payable","type":"fallback"},{"inputs":[],"name":"BIPS_PERCENTAGE_TOTAL","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"acceptAdmin","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"admin","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"approve","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"baseURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"burn","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"exists","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"finalizeContract","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"getApproved","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getCollectionStatus","outputs":[{"components":[{"internalType":"bool","name":"isContractFinalized","type":"bool"},{"internalType":"uint88","name":"amountCreated","type":"uint88"},{"internalType":"address","name":"defaultOwner","type":"address"}],"internalType":"struct ERC721Omnibus.CollectionStatus","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"getNiftyType","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"getPaintValue","outputs":[{"internalType":"uint16","name":"","type":"uint16"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"niftyType","type":"uint256"}],"name":"getPaymentSplitterByNiftyType","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"getPaymentSplitterByTokenId","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"niftyType","type":"uint256"}],"name":"getRoyaltySettings","outputs":[{"components":[{"internalType":"bool","name":"isPaymentSplitter","type":"bool"},{"internalType":"uint16","name":"bips","type":"uint16"},{"internalType":"address","name":"recipient","type":"address"}],"internalType":"struct RoyaltyRecipient","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"defaultOwner_","type":"address"}],"name":"initializeDefaultOwner","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"name_","type":"string"},{"internalType":"string","name":"symbol_","type":"string"},{"internalType":"string","name":"baseURI_","type":"string"}],"name":"initializeERC721","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"niftyRegistryContract_","type":"address"}],"name":"initializeNiftyEntity","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"niftyType","type":"uint256"},{"internalType":"address","name":"splitterImplementation","type":"address"},{"internalType":"address[]","name":"payees","type":"address[]"},{"internalType":"uint256[]","name":"shares","type":"uint256[]"}],"name":"initializeRoyalties","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"operator","type":"address"}],"name":"isApprovedForAll","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"paintValues","type":"uint256[]"}],"name":"mint","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"nominee","type":"address"}],"name":"nominateAdmin","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"nominatedAdmin","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"ownerOf","outputs":[{"internalType":"address","name":"owner","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"packedPaintValues","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceAdmin","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"uint256","name":"salePrice","type":"uint256"}],"name":"royaltyInfo","outputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","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":"tokenId","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":"string","name":"uri","type":"string"}],"name":"setBaseURI","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"niftyType","type":"uint256"},{"internalType":"uint256","name":"bips","type":"uint256"}],"name":"setRoyaltyBips","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"signer_","type":"address"},{"internalType":"bytes32","name":"saltedHash_","type":"bytes32"}],"name":"setSigner","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"salt","type":"uint256"},{"internalType":"bytes","name":"signature_","type":"bytes"}],"name":"sign","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"signature","outputs":[{"internalType":"bytes","name":"","type":"bytes"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"signatureStatus","outputs":[{"internalType":"bool","name":"isSalted","type":"bool"},{"internalType":"bool","name":"isVerified","type":"bool"},{"internalType":"address","name":"signer","type":"address"},{"internalType":"bytes32","name":"saltedHash","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"tokenURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"transferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"tokenContract","type":"address"},{"internalType":"address","name":"recipient","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"withdrawERC20","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"tokenContract","type":"address"},{"internalType":"address","name":"recipient","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"withdrawERC721","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address payable","name":"recipient","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"withdrawETH","outputs":[],"stateMutability":"nonpayable","type":"function"},{"stateMutability":"payable","type":"receive"}]