编译器
0.8.17+commit.8df45f5f
文件 1 的 28:Address.sol
pragma solidity ^0.8.1;
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 的 28:Constants.sol
pragma solidity 0.8.17;
library Constants {
uint16 public constant MINIMAL = 800;
}
文件 3 的 28:Context.sol
pragma solidity ^0.8.0;
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes calldata) {
return msg.data;
}
}
文件 4 的 28:Counters.sol
pragma solidity ^0.8.0;
library Counters {
struct Counter {
uint256 _value;
}
function current(Counter storage counter) internal view returns (uint256) {
return counter._value;
}
function increment(Counter storage counter) internal {
unchecked {
counter._value += 1;
}
}
function decrement(Counter storage counter) internal {
uint256 value = counter._value;
require(value > 0, "Counter: decrement overflow");
unchecked {
counter._value = value - 1;
}
}
function reset(Counter storage counter) internal {
counter._value = 0;
}
}
文件 5 的 28:DefaultOperatorFilterer.sol
pragma solidity ^0.8.13;
import {OperatorFilterer} from "./OperatorFilterer.sol";
import {CANONICAL_CORI_SUBSCRIPTION} from "./lib/Constants.sol";
abstract contract DefaultOperatorFilterer is OperatorFilterer {
constructor() OperatorFilterer(CANONICAL_CORI_SUBSCRIPTION, true) {}
}
文件 6 的 28:EIP2981.sol
pragma solidity 0.8.17;
import "@openzeppelin/contracts/token/common/ERC2981.sol";
import "./Guard.sol";
abstract contract EIP2981 is ERC2981, Guard {
event FeeChanged(
address indexed receiver,
uint96 collectionOwnerFeeNumerator,
uint96 firstOwnerFeeNumerator
);
struct AdditionalRoyaltyInfo {
uint96 collectionOwnerFeeNumerator;
uint96 firstOwnerFeeNumerator;
}
AdditionalRoyaltyInfo private _additionalDefaultRoyaltyInfo;
function feeDenominator() external pure returns (uint96) {
return _feeDenominator();
}
function setDefaultRoyalty(
address receiver,
uint96 collectionOwnerFeeNumerator,
uint96 firstOwnerFeeNumerator
) external haveRights {
_setDefaultRoyalty(
receiver,
collectionOwnerFeeNumerator + firstOwnerFeeNumerator
);
_additionalDefaultRoyaltyInfo = _additionalDefaultRoyaltyInfo = AdditionalRoyaltyInfo(
collectionOwnerFeeNumerator,
firstOwnerFeeNumerator
);
emit FeeChanged(
receiver,
collectionOwnerFeeNumerator,
firstOwnerFeeNumerator
);
}
function additionalDefaultRoyaltyInfo()
external
view
returns (AdditionalRoyaltyInfo memory)
{
return _additionalDefaultRoyaltyInfo;
}
function deleteDefaultRoyalty() external haveRights {
_deleteDefaultRoyalty();
delete _additionalDefaultRoyaltyInfo;
}
function setTokenRoyalty(
uint256 tokenId,
address receiver,
uint96 feeNumerator
) external haveRights {
_setTokenRoyalty(tokenId, receiver, feeNumerator);
}
function resetTokenRoyalty(uint256 tokenId) external haveRights {
_resetTokenRoyalty(tokenId);
}
}
文件 7 的 28:ERC165.sol
pragma solidity ^0.8.0;
import "./IERC165.sol";
abstract contract ERC165 is IERC165 {
function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
return interfaceId == type(IERC165).interfaceId;
}
}
文件 8 的 28:ERC2981.sol
pragma solidity ^0.8.0;
import "../../interfaces/IERC2981.sol";
import "../../utils/introspection/ERC165.sol";
abstract contract ERC2981 is IERC2981, ERC165 {
struct RoyaltyInfo {
address receiver;
uint96 royaltyFraction;
}
RoyaltyInfo private _defaultRoyaltyInfo;
mapping(uint256 => RoyaltyInfo) private _tokenRoyaltyInfo;
function supportsInterface(bytes4 interfaceId) public view virtual override(IERC165, ERC165) returns (bool) {
return interfaceId == type(IERC2981).interfaceId || super.supportsInterface(interfaceId);
}
function royaltyInfo(uint256 _tokenId, uint256 _salePrice) public view virtual override returns (address, uint256) {
RoyaltyInfo memory royalty = _tokenRoyaltyInfo[_tokenId];
if (royalty.receiver == address(0)) {
royalty = _defaultRoyaltyInfo;
}
uint256 royaltyAmount = (_salePrice * royalty.royaltyFraction) / _feeDenominator();
return (royalty.receiver, royaltyAmount);
}
function _feeDenominator() internal pure virtual returns (uint96) {
return 10000;
}
function _setDefaultRoyalty(address receiver, uint96 feeNumerator) internal virtual {
require(feeNumerator <= _feeDenominator(), "ERC2981: royalty fee will exceed salePrice");
require(receiver != address(0), "ERC2981: invalid receiver");
_defaultRoyaltyInfo = RoyaltyInfo(receiver, feeNumerator);
}
function _deleteDefaultRoyalty() internal virtual {
delete _defaultRoyaltyInfo;
}
function _setTokenRoyalty(
uint256 tokenId,
address receiver,
uint96 feeNumerator
) internal virtual {
require(feeNumerator <= _feeDenominator(), "ERC2981: royalty fee will exceed salePrice");
require(receiver != address(0), "ERC2981: Invalid parameters");
_tokenRoyaltyInfo[tokenId] = RoyaltyInfo(receiver, feeNumerator);
}
function _resetTokenRoyalty(uint256 tokenId) internal virtual {
delete _tokenRoyaltyInfo[tokenId];
}
}
文件 9 的 28:ERC721.sol
pragma solidity ^0.8.0;
import "./IERC721.sol";
import "./IERC721Receiver.sol";
import "./extensions/IERC721Metadata.sol";
import "../../utils/Address.sol";
import "../../utils/Context.sol";
import "../../utils/Strings.sol";
import "../../utils/introspection/ERC165.sol";
contract ERC721 is Context, ERC165, IERC721, IERC721Metadata {
using Address for address;
using Strings for uint256;
string private _name;
string private _symbol;
mapping(uint256 => address) private _owners;
mapping(address => uint256) private _balances;
mapping(uint256 => address) private _tokenApprovals;
mapping(address => mapping(address => bool)) private _operatorApprovals;
constructor(string memory name_, string memory symbol_) {
_name = name_;
_symbol = symbol_;
}
function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165, IERC165) returns (bool) {
return
interfaceId == type(IERC721).interfaceId ||
interfaceId == type(IERC721Metadata).interfaceId ||
super.supportsInterface(interfaceId);
}
function balanceOf(address owner) public view virtual override returns (uint256) {
require(owner != address(0), "ERC721: balance query for the zero address");
return _balances[owner];
}
function ownerOf(uint256 tokenId) public view virtual override returns (address) {
address owner = _owners[tokenId];
require(owner != address(0), "ERC721: owner query for nonexistent token");
return owner;
}
function name() public view virtual override returns (string memory) {
return _name;
}
function symbol() public view virtual override returns (string memory) {
return _symbol;
}
function tokenURI(uint256 tokenId) public view virtual override returns (string memory) {
require(_exists(tokenId), "ERC721Metadata: URI query for nonexistent token");
string memory baseURI = _baseURI();
return bytes(baseURI).length > 0 ? string(abi.encodePacked(baseURI, tokenId.toString())) : "";
}
function _baseURI() internal view virtual returns (string memory) {
return "";
}
function approve(address to, uint256 tokenId) public virtual override {
address owner = ERC721.ownerOf(tokenId);
require(to != owner, "ERC721: approval to current owner");
require(
_msgSender() == owner || isApprovedForAll(owner, _msgSender()),
"ERC721: approve caller is not owner nor approved for all"
);
_approve(to, tokenId);
}
function getApproved(uint256 tokenId) public view virtual override returns (address) {
require(_exists(tokenId), "ERC721: approved query for nonexistent token");
return _tokenApprovals[tokenId];
}
function setApprovalForAll(address operator, bool approved) public virtual override {
_setApprovalForAll(_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 {
require(_isApprovedOrOwner(_msgSender(), tokenId), "ERC721: transfer caller is not owner nor approved");
_transfer(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 {
require(_isApprovedOrOwner(_msgSender(), tokenId), "ERC721: transfer caller is not owner nor approved");
_safeTransfer(from, to, tokenId, _data);
}
function _safeTransfer(
address from,
address to,
uint256 tokenId,
bytes memory _data
) internal virtual {
_transfer(from, to, tokenId);
require(_checkOnERC721Received(from, to, tokenId, _data), "ERC721: transfer to non ERC721Receiver implementer");
}
function _exists(uint256 tokenId) internal view virtual returns (bool) {
return _owners[tokenId] != address(0);
}
function _isApprovedOrOwner(address spender, uint256 tokenId) internal view virtual returns (bool) {
require(_exists(tokenId), "ERC721: operator query for nonexistent token");
address owner = ERC721.ownerOf(tokenId);
return (spender == owner || isApprovedForAll(owner, spender) || getApproved(tokenId) == spender);
}
function _safeMint(address to, uint256 tokenId) internal virtual {
_safeMint(to, tokenId, "");
}
function _safeMint(
address to,
uint256 tokenId,
bytes memory _data
) internal virtual {
_mint(to, tokenId);
require(
_checkOnERC721Received(address(0), to, tokenId, _data),
"ERC721: transfer to non ERC721Receiver implementer"
);
}
function _mint(address to, uint256 tokenId) internal virtual {
require(to != address(0), "ERC721: mint to the zero address");
require(!_exists(tokenId), "ERC721: token already minted");
_beforeTokenTransfer(address(0), to, tokenId);
_balances[to] += 1;
_owners[tokenId] = to;
emit Transfer(address(0), to, tokenId);
_afterTokenTransfer(address(0), to, tokenId);
}
function _burn(uint256 tokenId) internal virtual {
address owner = ERC721.ownerOf(tokenId);
_beforeTokenTransfer(owner, address(0), tokenId);
_approve(address(0), tokenId);
_balances[owner] -= 1;
delete _owners[tokenId];
emit Transfer(owner, address(0), tokenId);
_afterTokenTransfer(owner, address(0), tokenId);
}
function _transfer(
address from,
address to,
uint256 tokenId
) internal virtual {
require(ERC721.ownerOf(tokenId) == from, "ERC721: transfer from incorrect owner");
require(to != address(0), "ERC721: transfer to the zero address");
_beforeTokenTransfer(from, to, tokenId);
_approve(address(0), tokenId);
_balances[from] -= 1;
_balances[to] += 1;
_owners[tokenId] = to;
emit Transfer(from, to, tokenId);
_afterTokenTransfer(from, to, tokenId);
}
function _approve(address to, uint256 tokenId) internal virtual {
_tokenApprovals[tokenId] = to;
emit Approval(ERC721.ownerOf(tokenId), to, tokenId);
}
function _setApprovalForAll(
address owner,
address operator,
bool approved
) internal virtual {
require(owner != operator, "ERC721: approve to caller");
_operatorApprovals[owner][operator] = approved;
emit ApprovalForAll(owner, operator, approved);
}
function _checkOnERC721Received(
address from,
address to,
uint256 tokenId,
bytes memory _data
) private 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("ERC721: transfer to non ERC721Receiver implementer");
} else {
assembly {
revert(add(32, reason), mload(reason))
}
}
}
} else {
return true;
}
}
function _beforeTokenTransfer(
address from,
address to,
uint256 tokenId
) internal virtual {}
function _afterTokenTransfer(
address from,
address to,
uint256 tokenId
) internal virtual {}
}
文件 10 的 28:Guard.sol
pragma solidity 0.8.17;
import "../interfaces/IRights.sol";
abstract contract Guard {
string constant NO_RIGHTS = "Guard: No rights";
modifier haveRights() {
require(_rights().haveRights(address(this), msg.sender), NO_RIGHTS);
_;
}
modifier haveRightsPerson(address who_) {
require(_rights().haveRights(address(this), who_), NO_RIGHTS);
_;
}
modifier haveRightsExt(address target_, address who_) {
require(_rights().haveRights(target_, who_), NO_RIGHTS);
_;
}
function _rights() internal view virtual returns (IRights);
function setRights(address rights_) external virtual;
}
文件 11 的 28:GuardExtension.sol
pragma solidity 0.8.17;
import "../interfaces/IRights.sol";
import "../utils/Guard.sol";
contract GuardExtension is Guard {
IRights private _rightsContract;
string private constant SAME_VALUE = "Guard: same value";
string private constant ZERO_ADDRESS = "Guard: zero address";
constructor(address rights_) {
require(rights_ != address(0), ZERO_ADDRESS);
_rightsContract = IRights(rights_);
}
function _rights() internal view virtual override returns (IRights) {
return _rightsContract;
}
function setRights(address rights_) external virtual override haveRights {
require(address(_rightsContract) != rights_, SAME_VALUE);
_rightsContract = IRights(rights_);
}
}
文件 12 的 28:IActors.sol
pragma solidity 0.8.17;
import "@openzeppelin/contracts/token/ERC721/extensions/IERC721Metadata.sol";
import {Structures} from "../../lib/Structures.sol";
interface IActors is IERC721Metadata {
event Minted(address indexed owner, uint256 indexed id);
event MintedImmaculate(address indexed owner, uint256 indexed id);
event TokenUriDefined(uint256 indexed id, string kidUri, string adultUri);
event ActorWasBorn(uint256 indexed id, uint256 bornTime);
function total() external view returns (uint256);
function setMetadataHash(uint256 id_, string calldata adultHash_) external;
function setMetadataHashes(
uint256 id_,
string calldata kidHash_,
string calldata adultHash_
) external;
function tokenKidURI(uint256 id_) external view returns (string memory);
function tokenAdultURI(uint256 id_) external view returns (string memory);
function mint(
uint256 id_,
address owner_,
uint16[10] memory props_,
bool sex_,
bool born_,
uint256 adultTime_,
uint8 childs_,
bool immaculate_
) external returns (uint256);
function getProps(uint256 id_) external view returns (uint16[10] memory);
function getActor(uint256 id_)
external
view
returns (Structures.ActorData memory);
function getSex(uint256 id_) external view returns (bool);
function getChilds(uint256 id_) external view returns (uint8, uint8);
function breedChild(uint256 id_) external;
function getImmaculate(uint256 id_) external view returns (bool);
function getBornTime(uint256 id_) external view returns (uint256);
function isBorn(uint256 id_) external view returns (bool);
function born(uint256 id_, uint256 adultTime_) external;
function getAdultTime(uint256 id_) external view returns (uint256);
function setAdultTime(uint256 id_, uint256 time_) external;
function isAdult(uint256 id_) external view returns (bool);
function getRank(uint256 id_) external view returns (uint16);
}
文件 13 的 28:ICalculator.sol
pragma solidity 0.8.17;
interface ICalculator {
function compute(bytes memory params) external view returns (uint256);
}
文件 14 的 28:IERC165.sol
pragma solidity ^0.8.0;
interface IERC165 {
function supportsInterface(bytes4 interfaceId) external view returns (bool);
}
文件 15 的 28:IERC2981.sol
pragma solidity ^0.8.0;
import "../utils/introspection/IERC165.sol";
interface IERC2981 is IERC165 {
function royaltyInfo(uint256 tokenId, uint256 salePrice)
external
view
returns (address receiver, uint256 royaltyAmount);
}
文件 16 的 28: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,
bytes calldata data
) external;
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 setApprovalForAll(address operator, bool _approved) external;
function getApproved(uint256 tokenId) external view returns (address operator);
function isApprovedForAll(address owner, address operator) external view returns (bool);
}
文件 17 的 28:IERC721Metadata.sol
pragma solidity ^0.8.0;
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);
}
文件 18 的 28:IERC721Receiver.sol
pragma solidity ^0.8.0;
interface IERC721Receiver {
function onERC721Received(
address operator,
address from,
uint256 tokenId,
bytes calldata data
) external returns (bytes4);
}
文件 19 的 28:IOperatorFilterRegistry.sol
pragma solidity ^0.8.13;
interface IOperatorFilterRegistry {
function isOperatorAllowed(address registrant, address operator) external view returns (bool);
function register(address registrant) external;
function registerAndSubscribe(address registrant, address subscription) external;
function registerAndCopyEntries(address registrant, address registrantToCopy) external;
function unregister(address addr) external;
function updateOperator(address registrant, address operator, bool filtered) external;
function updateOperators(address registrant, address[] calldata operators, bool filtered) external;
function updateCodeHash(address registrant, bytes32 codehash, bool filtered) external;
function updateCodeHashes(address registrant, bytes32[] calldata codeHashes, bool filtered) external;
function subscribe(address registrant, address registrantToSubscribe) external;
function unsubscribe(address registrant, bool copyExistingEntries) external;
function subscriptionOf(address addr) external returns (address registrant);
function subscribers(address registrant) external returns (address[] memory);
function subscriberAt(address registrant, uint256 index) external returns (address);
function copyEntriesOf(address registrant, address registrantToCopy) external;
function isOperatorFiltered(address registrant, address operator) external returns (bool);
function isCodeHashOfFiltered(address registrant, address operatorWithCode) external returns (bool);
function isCodeHashFiltered(address registrant, bytes32 codeHash) external returns (bool);
function filteredOperators(address addr) external returns (address[] memory);
function filteredCodeHashes(address addr) external returns (bytes32[] memory);
function filteredOperatorAt(address registrant, uint256 index) external returns (address);
function filteredCodeHashAt(address registrant, uint256 index) external returns (bytes32);
function isRegistered(address addr) external returns (bool);
function codeHashOf(address addr) external returns (bytes32);
}
文件 20 的 28:IPotions.sol
pragma solidity 0.8.17;
import "@openzeppelin/contracts/token/ERC721/extensions/IERC721Metadata.sol";
interface IPotions is IERC721Metadata {
event Created(address indexed owner, uint256 indexed id, uint256 indexed level);
event Opened(address indexed owner, uint256 indexed id);
event ChildsDefined(uint256 indexed childs);
event TokenUriDefined(uint256 indexed id, string tokenUri);
function total() external view returns (uint256);
function unissued() external view returns (uint256);
function level(uint256 id_) external view returns (uint256);
function setChilds(uint256 childs_) external;
function getChilds() external view returns (uint256);
function open(uint256 id_) external returns (uint256);
function getMaxLevel() external view returns (uint256);
function create(
address target,
bool rare,
uint256 id_
) external returns (uint256);
function createPotion(
address target,
uint256 level,
uint256 id_
) external returns (uint256);
function getLast(address target) external view returns (uint256);
function decreaseAmount(bool rare) external returns (bool);
function setMetadataHash(uint256 id_, string calldata metadataHash_)
external;
}
文件 21 的 28:IRandomizer.sol
pragma solidity 0.8.17;
interface IRandomizer {
function randomize() external returns (uint256);
function randomize(uint256 limit) external returns (uint256);
function distributeRandom(uint256 total, uint256[] memory weights)
external
returns (uint256);
function last() external view returns (uint256);
}
文件 22 的 28:IRights.sol
pragma solidity 0.8.17;
interface IRights {
event AdminAdded(address indexed admin);
event AdminDefined(address indexed admin, address indexed contractHash);
event AdminRemoved(address indexed admin);
event AdminCleared(address indexed admin, address indexed contractHash);
function addAdmin(address admin_) external;
function addAdmin(address contract_, address admin_) external;
function removeAdmin(address admin_) external;
function removeAdmin(address contract_, address admin_) external;
function haveRights(address contract_) external view returns (bool);
function haveRights(address contract_, address admin_)
external
view
returns (bool);
}
文件 23 的 28:OperatorFilterer.sol
pragma solidity ^0.8.13;
import {IOperatorFilterRegistry} from "./IOperatorFilterRegistry.sol";
import {CANONICAL_OPERATOR_FILTER_REGISTRY_ADDRESS} from "./lib/Constants.sol";
abstract contract OperatorFilterer {
error OperatorNotAllowed(address operator);
IOperatorFilterRegistry public constant OPERATOR_FILTER_REGISTRY =
IOperatorFilterRegistry(CANONICAL_OPERATOR_FILTER_REGISTRY_ADDRESS);
constructor(address subscriptionOrRegistrantToCopy, bool subscribe) {
if (address(OPERATOR_FILTER_REGISTRY).code.length > 0) {
if (subscribe) {
OPERATOR_FILTER_REGISTRY.registerAndSubscribe(address(this), subscriptionOrRegistrantToCopy);
} else {
if (subscriptionOrRegistrantToCopy != address(0)) {
OPERATOR_FILTER_REGISTRY.registerAndCopyEntries(address(this), subscriptionOrRegistrantToCopy);
} else {
OPERATOR_FILTER_REGISTRY.register(address(this));
}
}
}
}
modifier onlyAllowedOperator(address from) virtual {
if (from != msg.sender) {
_checkFilterOperator(msg.sender);
}
_;
}
modifier onlyAllowedOperatorApproval(address operator) virtual {
_checkFilterOperator(operator);
_;
}
function _checkFilterOperator(address operator) internal view virtual {
if (address(OPERATOR_FILTER_REGISTRY).code.length > 0) {
if (!OPERATOR_FILTER_REGISTRY.isOperatorAllowed(address(this), operator)) {
revert OperatorNotAllowed(operator);
}
}
}
}
文件 24 的 28:OperatorFiltererERC721.sol
pragma solidity 0.8.17;
import "@openzeppelin/contracts/token/ERC721/ERC721.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "operator-filter-registry/src/DefaultOperatorFilterer.sol";
abstract contract OperatorFiltererERC721 is
ERC721,
DefaultOperatorFilterer,
Ownable
{
function setApprovalForAll(address operator, bool approved)
public
override
onlyAllowedOperatorApproval(operator)
{
super.setApprovalForAll(operator, approved);
}
function approve(address operator, uint256 tokenId)
public
override
onlyAllowedOperatorApproval(operator)
{
super.approve(operator, tokenId);
}
function transferFrom(
address from,
address to,
uint256 tokenId
) public override onlyAllowedOperator(from) {
super.transferFrom(from, to, tokenId);
}
function safeTransferFrom(
address from,
address to,
uint256 tokenId
) public override onlyAllowedOperator(from) {
super.safeTransferFrom(from, to, tokenId);
}
function safeTransferFrom(
address from,
address to,
uint256 tokenId,
bytes memory data
) public override onlyAllowedOperator(from) {
super.safeTransferFrom(from, to, tokenId, data);
}
}
文件 25 的 28:Ownable.sol
pragma solidity ^0.8.0;
import "../utils/Context.sol";
abstract contract Ownable is Context {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor() {
_transferOwnership(_msgSender());
}
function owner() public view virtual returns (address) {
return _owner;
}
modifier onlyOwner() {
require(owner() == _msgSender(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual onlyOwner {
_transferOwnership(address(0));
}
function transferOwnership(address newOwner) public virtual onlyOwner {
require(newOwner != address(0), "Ownable: new owner is the zero address");
_transferOwnership(newOwner);
}
function _transferOwnership(address newOwner) internal virtual {
address oldOwner = _owner;
_owner = newOwner;
emit OwnershipTransferred(oldOwner, newOwner);
}
}
文件 26 的 28:Potions.sol
pragma solidity 0.8.17;
import "@openzeppelin/contracts/utils/Counters.sol";
import "@openzeppelin/contracts/utils/Strings.sol";
import "../interfaces/IRandomizer.sol";
import "../interfaces/ICalculator.sol";
import "./interfaces/IActors.sol";
import "./interfaces/IPotions.sol";
import "../utils/EIP2981.sol";
import "../lib/Constants.sol";
import "../utils/GuardExtension.sol";
import {
OperatorFiltererERC721,
ERC721
} from "../utils/OperatorFiltererERC721.sol";
contract Potions is OperatorFiltererERC721, IPotions, EIP2981, GuardExtension {
using Counters for Counters.Counter;
using Strings for uint256;
Counters.Counter private _tokenIds;
uint256 private _childs;
uint256 private _unissued;
uint256[] private _amounts;
mapping(uint256 => uint256) private _total;
mapping(uint256 => uint256) private _women;
IActors private _zombie;
IRandomizer private _random;
address private _mysteryBoxAddress;
bytes32 private constant ZERO_STRING = keccak256(bytes(""));
string private constant WRONG_LEVEL = "Potion: wrong level";
string private constant WRONG_OWNER = "Potion: wrong owner";
string private constant NOT_A_BOX = "Potions: Not a box";
string private constant TRY_AGAIN = "Potion: try again";
string private constant SOLD_OUT = "Potion: sold out";
string private constant WRONG_ID = "Potion: wrong id";
string private constant NO_ZERO_LEVEL = "Potion: no zero level";
string private constant META_ALREADY_USED = "Potion: meta already used";
string private constant ALREADY_SET = "Potion: already set";
string private constant BOX_NOT_SET = "Potion: box not set";
string private constant SAME_VALUE = "Potion: same value";
string private constant ZERO_ADDRESS = "Potion: zero address";
string private constant IPFS_PREFIX = "ipfs://";
string private constant PLACEHOLDERS_META_HASH =
"QmZ9bCTRBNwgyhuaX6P7Xfm8D1c7jcUMZ4TFUDggGBE6hb";
mapping(bytes32 => bool) private _usedMetadata;
mapping(uint256 => string) private _tokensHashes;
mapping(uint256 => uint256) private _issuedLevels;
uint256[] private _limits;
mapping(address => uint256) private _last;
modifier onlyBox() {
require(_mysteryBoxAddress != address(0), BOX_NOT_SET);
require(
_mysteryBoxAddress == msg.sender ||
_rights().haveRights(address(this), msg.sender),
NOT_A_BOX
);
_;
}
modifier correctId(uint256 id_) {
require(_exists(id_), WRONG_ID);
_;
}
constructor(
string memory name_,
string memory symbol_,
address rights_,
address zombie_,
address random_,
uint256[] memory limits_,
uint256[] memory amounts_,
uint256[] memory women_,
uint256 childs_
) ERC721(name_, symbol_) GuardExtension(rights_) {
require(random_ != address(0), ZERO_ADDRESS);
require(zombie_ != address(0), ZERO_ADDRESS);
_childs = childs_;
_random = IRandomizer(random_);
_zombie = IActors(zombie_);
_saveAmounts(amounts_);
_saveLimits(limits_);
_saveWomen(women_);
}
function total() external view override returns (uint256) {
return _tokenIds.current();
}
function _saveAmounts(uint256[] memory amounts_) private {
uint256 len = amounts_.length;
_unissued = 0;
_amounts = amounts_;
for (uint256 i = 0; i < len; ++i) {
_unissued = _unissued + amounts_[i];
}
}
function _saveWomen(uint256[] memory women_) private {
for (uint256 i = 0; i < women_.length; i++) {
_women[i] = women_[i];
}
}
function _saveLimits(uint256[] memory limits_) private {
_limits = limits_;
}
function unissued() external view override returns (uint256) {
return _unissued;
}
function level(uint256 id_)
external
view
override
correctId(id_)
returns (uint256)
{
return _issuedLevels[id_];
}
function _create(
address owner_,
uint256 level_,
uint256 id_
) private returns (uint256) {
require(level_ > 0, NO_ZERO_LEVEL);
_tokenIds.increment();
_issuedLevels[id_] = level_;
_mint(owner_, id_);
emit Created(owner_, id_, level_);
return id_;
}
function setChilds(uint256 childs_) external override haveRights {
_childs = childs_;
emit ChildsDefined(childs_);
}
function setZombie(address value_) external haveRights {
require(address(_zombie) != value_, SAME_VALUE);
require(value_ != address(0), ZERO_ADDRESS);
_zombie = IActors(value_);
}
function setRandom(address value_) external haveRights {
require(address(_random) != value_, SAME_VALUE);
require(value_ != address(0), ZERO_ADDRESS);
_random = IRandomizer(value_);
}
function setMysteryBox(address value_) external haveRights {
require(address(_mysteryBoxAddress) != value_, SAME_VALUE);
require(value_ != address(0), ZERO_ADDRESS);
_mysteryBoxAddress = value_;
}
function getChilds() external view override returns (uint256) {
return _childs;
}
function _getLimits(uint256 level_)
private
view
returns (uint256, uint256)
{
require(level_ > 0, NO_ZERO_LEVEL);
require(level_ <= _limits.length, WRONG_LEVEL);
if (level_ == 1) {
return (Constants.MINIMAL, _limits[0]);
}
return (_limits[level_ - 2], _limits[level_ - 1]);
}
function getLimits(uint256 level_)
external
view
returns (uint256, uint256)
{
return _getLimits(level_);
}
function calcSex(
IRandomizer random_,
uint256 total_,
uint256 womenAvailable_
) internal returns (bool) {
uint256[] memory weights = new uint256[](2);
weights[0] = total_ - womenAvailable_;
weights[1] = womenAvailable_;
uint256 isWoman = random_.distributeRandom(total_, weights);
return (isWoman == 0);
}
function calcProps(
IRandomizer random,
uint256 minRange,
uint256 maxRange
) internal returns (uint256, uint16[10] memory) {
uint16[10] memory props;
uint256 range = maxRange - minRange;
uint256 power = 0;
for (uint256 i = 0; i < 10; i++) {
props[i] = uint16(random.randomize(range) + minRange);
power = power + props[i];
}
return (power, props);
}
function callMint(
uint256 id_,
uint16[10] memory props_,
bool sex_,
uint256 power_,
uint8 childs_
) internal returns (uint256) {
_zombie.mint(
id_,
msg.sender,
props_,
sex_,
true,
0,
childs_,
true
);
emit Opened(msg.sender, id_);
return id_;
}
function open(uint256 id_)
external
override
correctId(id_)
returns (uint256)
{
require(ownerOf(id_) == msg.sender, WRONG_OWNER);
uint256 level_ = _issuedLevels[id_];
IRandomizer random = _random;
(uint256 minRange, uint256 maxRange) = _getLimits(level_);
(uint256 power, uint16[10] memory props) = calcProps(
random,
minRange,
maxRange
);
bool sex = true;
if (_women[level_ - 1] > 0) {
sex = calcSex(
random,
_total[level_ - 1] + _amounts[level_ - 1],
_women[level_ - 1]
);
if (!sex) {
_women[level_ - 1] = _women[level_ - 1] - 1;
}
}
uint8 childs = sex ? 0 : uint8(random.randomize(_childs + 1));
_burn(id_);
delete _issuedLevels[id_];
return callMint(id_, props, sex, power, childs);
}
function getMaxLevel() external view override returns (uint256) {
return _amounts.length - 1;
}
function create(
address target,
bool rare,
uint256 id_
) external override onlyBox returns (uint256) {
uint256 level_ = _amounts.length - 1;
if (!rare) {
level_ = _random.distributeRandom(_unissued, _amounts);
require(_amounts[level_] > 0, TRY_AGAIN);
_amounts[level_] = _amounts[level_] - 1;
}
require(_amounts[level_] > 0, SOLD_OUT);
_total[level_] = _total[level_] + 1;
return _create(target, level_ + 1, id_);
}
function createPotion(
address target,
uint256 level_,
uint256 id_
) external override haveRights returns (uint256) {
require(level_ > 0, NO_ZERO_LEVEL);
require(_unissued > 0, SOLD_OUT);
require(_amounts[level_ - 1] > 0, SOLD_OUT);
_amounts[level_ - 1] = _amounts[level_ - 1] - 1;
_unissued = _unissued - 1;
uint256 created = _create(target, level_, id_);
_last[target] = created;
return created;
}
function getLast(address target) external view override returns (uint256) {
return _last[target];
}
function decreaseAmount(bool rare)
external
override
onlyBox
returns (bool)
{
if(_unissued == 0) return false;
if (rare) {
uint256 aLevel = _amounts.length - 1;
if(_amounts[aLevel] == 0) return false;
_amounts[aLevel] = _amounts[aLevel] - 1;
}
_unissued = _unissued - 1;
return true;
}
function supportsInterface(bytes4 interfaceId)
public
view
virtual
override(IERC165, ERC2981, ERC721)
returns (bool)
{
return super.supportsInterface(interfaceId);
}
function tokenURI(uint256 id_)
public
view
override(ERC721, IERC721Metadata)
correctId(id_)
returns (string memory)
{
uint256 level_ = _issuedLevels[id_];
if (keccak256(bytes(_tokensHashes[id_])) == ZERO_STRING) {
return
string(
abi.encodePacked(
IPFS_PREFIX,
PLACEHOLDERS_META_HASH,
"/po/",
level_.toString(),
"/meta.json"
)
);
} else {
return string(abi.encodePacked(IPFS_PREFIX, _tokensHashes[id_]));
}
}
function setMetadataHash(uint256 id_, string calldata metadataHash_)
external
override
haveRights
correctId(id_)
{
require(
keccak256(bytes(_tokensHashes[id_])) == ZERO_STRING,
ALREADY_SET
);
require(
!_usedMetadata[keccak256(bytes(metadataHash_))],
META_ALREADY_USED
);
_usedMetadata[keccak256(bytes(metadataHash_))] = true;
_tokensHashes[id_] = metadataHash_;
emit TokenUriDefined(
id_,
string(abi.encodePacked(IPFS_PREFIX, metadataHash_))
);
}
}
文件 27 的 28:Strings.sol
pragma solidity ^0.8.0;
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);
}
}
文件 28 的 28:Structures.sol
pragma solidity 0.8.17;
library Structures {
struct ActorData {
uint256 adultTime;
uint256 bornTime;
string kidTokenUriHash;
string adultTokenUriHash;
uint16[10] props;
uint8 childs;
uint8 childsPossible;
bool sex;
bool born;
bool immaculate;
uint16 rank;
address initialOwner;
}
struct Item {
uint256 class;
uint256 model;
uint256 location;
uint8 slots;
uint16[10] props;
string uri;
}
struct ItemType {
uint256 class;
uint256 model;
string uri;
}
struct LootBox {
uint256 price;
uint16 total;
uint16 available;
bool paused;
bool deleted;
string uri;
LootBoxItem[] items;
}
struct LootBoxItem {
uint256 class;
uint256 model;
uint8 slots;
uint16 promilles;
uint16[10] props;
}
struct Estate {
address lender;
uint256 location;
uint8 estateType;
uint256 parent;
uint256 coordinates;
}
struct Villa {
uint256 location;
uint256 fraction;
}
struct ManageAction {
address target;
address author;
uint256 expiration;
bytes4 signature;
bytes data;
bool executed;
}
struct InvestorData {
address investor;
uint256 promille;
}
struct Benefit {
uint256 price;
uint256 from;
uint256 until;
uint16 id;
uint8 amount;
uint8 level;
uint8 issued;
}
}
{
"compilationTarget": {
"project:/contracts/persons/Potions.sol": "Potions"
},
"evmVersion": "london",
"libraries": {},
"metadata": {
"bytecodeHash": "ipfs"
},
"optimizer": {
"enabled": true,
"runs": 200
},
"remappings": [],
"viaIR": true
}
[{"inputs":[{"internalType":"string","name":"name_","type":"string"},{"internalType":"string","name":"symbol_","type":"string"},{"internalType":"address","name":"rights_","type":"address"},{"internalType":"address","name":"zombie_","type":"address"},{"internalType":"address","name":"random_","type":"address"},{"internalType":"uint256[]","name":"limits_","type":"uint256[]"},{"internalType":"uint256[]","name":"amounts_","type":"uint256[]"},{"internalType":"uint256[]","name":"women_","type":"uint256[]"},{"internalType":"uint256","name":"childs_","type":"uint256"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[{"internalType":"address","name":"operator","type":"address"}],"name":"OperatorNotAllowed","type":"error"},{"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":"childs","type":"uint256"}],"name":"ChildsDefined","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"uint256","name":"id","type":"uint256"},{"indexed":true,"internalType":"uint256","name":"level","type":"uint256"}],"name":"Created","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"receiver","type":"address"},{"indexed":false,"internalType":"uint96","name":"collectionOwnerFeeNumerator","type":"uint96"},{"indexed":false,"internalType":"uint96","name":"firstOwnerFeeNumerator","type":"uint96"}],"name":"FeeChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"uint256","name":"id","type":"uint256"}],"name":"Opened","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":true,"internalType":"uint256","name":"id","type":"uint256"},{"indexed":false,"internalType":"string","name":"tokenUri","type":"string"}],"name":"TokenUriDefined","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":"OPERATOR_FILTER_REGISTRY","outputs":[{"internalType":"contract IOperatorFilterRegistry","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"additionalDefaultRoyaltyInfo","outputs":[{"components":[{"internalType":"uint96","name":"collectionOwnerFeeNumerator","type":"uint96"},{"internalType":"uint96","name":"firstOwnerFeeNumerator","type":"uint96"}],"internalType":"struct EIP2981.AdditionalRoyaltyInfo","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"operator","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":[{"internalType":"address","name":"target","type":"address"},{"internalType":"bool","name":"rare","type":"bool"},{"internalType":"uint256","name":"id_","type":"uint256"}],"name":"create","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"target","type":"address"},{"internalType":"uint256","name":"level_","type":"uint256"},{"internalType":"uint256","name":"id_","type":"uint256"}],"name":"createPotion","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bool","name":"rare","type":"bool"}],"name":"decreaseAmount","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"deleteDefaultRoyalty","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"feeDenominator","outputs":[{"internalType":"uint96","name":"","type":"uint96"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"getApproved","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getChilds","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"target","type":"address"}],"name":"getLast","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"level_","type":"uint256"}],"name":"getLimits","outputs":[{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getMaxLevel","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","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":"id_","type":"uint256"}],"name":"level","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"id_","type":"uint256"}],"name":"open","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"ownerOf","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"resetTokenRoyalty","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":"uint256","name":"childs_","type":"uint256"}],"name":"setChilds","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"receiver","type":"address"},{"internalType":"uint96","name":"collectionOwnerFeeNumerator","type":"uint96"},{"internalType":"uint96","name":"firstOwnerFeeNumerator","type":"uint96"}],"name":"setDefaultRoyalty","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"id_","type":"uint256"},{"internalType":"string","name":"metadataHash_","type":"string"}],"name":"setMetadataHash","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"value_","type":"address"}],"name":"setMysteryBox","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"value_","type":"address"}],"name":"setRandom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"rights_","type":"address"}],"name":"setRights","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"address","name":"receiver","type":"address"},{"internalType":"uint96","name":"feeNumerator","type":"uint96"}],"name":"setTokenRoyalty","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"value_","type":"address"}],"name":"setZombie","outputs":[],"stateMutability":"nonpayable","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":"id_","type":"uint256"}],"name":"tokenURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"total","outputs":[{"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":"transferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"unissued","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"}]