编译器
0.8.17+commit.8df45f5f
文件 1 的 27:Actors.sol
pragma solidity 0.8.17;
import "@openzeppelin/contracts/token/ERC721/ERC721.sol";
import "@openzeppelin/contracts/utils/Counters.sol";
import "./interfaces/IActors.sol";
import "./interfaces/IMaternity.sol";
import "../lib/Structures.sol";
import "../utils/GuardExtension.sol";
import "../utils/EIP2981.sol";
import "../utils/OperatorFiltererERC721.sol";
abstract contract Actors is
OperatorFiltererERC721,
EIP2981,
GuardExtension,
IActors
{
using Counters for Counters.Counter;
Counters.Counter private _total;
uint256 private _counter;
bytes32 private constant ZERO_STRING = keccak256(bytes(""));
string private constant WRONG_ID = "Actor: wrong id";
string private constant ALREADY_SET = "Actor: already set";
string private constant NOT_BORN = "Actor: not borned yet";
string private constant META_ALREADY_USED = "Actor: meta already used";
string private constant ONLY_NON_IMMACULATE = "Actor: only nonimmaculate";
string private constant ONLY_IMMACULATE = "Actor: only immaculate";
string private constant IPFS_PREFIX = "ipfs://";
string private constant TOO_MUCH_CHILDS = "Actor: too much childs";
string private constant FALLBACK_META_HASH =
"QmZ9bCTRBNwgyhuaX6P7Xfm8D1c7jcUMZ4TFUDggGBE6hb";
mapping(uint256 => Structures.ActorData) private _actors;
mapping(bytes32 => bool) private _usedMetadata;
modifier correctId(uint256 id_) {
require(_exists(id_), WRONG_ID);
_;
}
constructor(
string memory name_,
string memory symbol_,
address rights_,
uint256 start_
) ERC721(name_, symbol_) GuardExtension(rights_) {
_counter = start_;
}
function total() external view override returns (uint256) {
return _total.current();
}
function setMetadataHash(uint256 id_, string calldata adultHash_)
external
override
haveRights
correctId(id_)
{
require(_actors[id_].immaculate, ONLY_IMMACULATE);
require(
keccak256(bytes(_actors[id_].adultTokenUriHash)) == ZERO_STRING,
ALREADY_SET
);
require(
!_usedMetadata[keccak256(bytes(adultHash_))],
META_ALREADY_USED
);
_usedMetadata[keccak256(bytes(adultHash_))] = true;
_actors[id_].adultTokenUriHash = adultHash_;
emit TokenUriDefined(
id_,
"",
string(abi.encodePacked(IPFS_PREFIX, adultHash_))
);
}
function setMetadataHashes(
uint256 id_,
string calldata kidHash_,
string calldata adultHash_
) external override haveRights correctId(id_) {
require(!_actors[id_].immaculate, ONLY_NON_IMMACULATE);
require(
keccak256(bytes(_actors[id_].adultTokenUriHash)) == ZERO_STRING,
ALREADY_SET
);
require(!_usedMetadata[keccak256(bytes(kidHash_))], META_ALREADY_USED);
require(
!_usedMetadata[keccak256(bytes(adultHash_))],
META_ALREADY_USED
);
_usedMetadata[keccak256(bytes(kidHash_))] = true;
_usedMetadata[keccak256(bytes(adultHash_))] = true;
_actors[id_].kidTokenUriHash = kidHash_;
_actors[id_].adultTokenUriHash = adultHash_;
emit TokenUriDefined(
id_,
string(abi.encodePacked(IPFS_PREFIX, kidHash_)),
string(abi.encodePacked(IPFS_PREFIX, adultHash_))
);
}
function tokenURI(uint256 id_)
public
view
override(ERC721, IERC721Metadata)
correctId(id_)
returns (string memory)
{
string memory tokenHash;
if (_isAdult(id_)) {
tokenHash = _actors[id_].adultTokenUriHash;
} else {
tokenHash = _actors[id_].kidTokenUriHash;
}
if (keccak256(bytes(tokenHash)) == ZERO_STRING) {
Structures.ActorData memory actor = _actors[id_];
string memory personType;
if (_isAdult(id_)) {
personType = actor.sex ? "am" : "af";
} else {
personType = "kid";
}
return
string(
abi.encodePacked(
IPFS_PREFIX,
FALLBACK_META_HASH,
"/",
_getPlaceholderSubFolder(),
"/",
personType,
"/",
"meta.json"
)
);
}
return string(abi.encodePacked(IPFS_PREFIX, tokenHash));
}
function tokenKidURI(uint256 id_)
external
view
correctId(id_)
returns (string memory)
{
string memory tokenHash = _actors[id_].kidTokenUriHash;
if (keccak256(bytes(tokenHash)) == ZERO_STRING) {
return "";
}
return string(abi.encodePacked(IPFS_PREFIX, tokenHash));
}
function tokenAdultURI(uint256 id_)
external
view
correctId(id_)
returns (string memory)
{
Structures.ActorData memory actor = _actors[id_];
string memory tokenHash = actor.adultTokenUriHash;
if (keccak256(bytes(tokenHash)) == ZERO_STRING) {
return "";
}
return string(abi.encodePacked(IPFS_PREFIX, tokenHash));
}
function _getPlaceholderSubFolder()
internal
pure
virtual
returns (string memory);
function mint(
uint256 id_,
address owner_,
uint16[10] memory props_,
bool sex_,
bool born_,
uint256 adultTime_,
uint8 childs_,
bool immaculate_
) external override haveRights returns (uint256) {
_total.increment();
uint256 newId;
if (id_ > 0) {
newId = id_;
} else {
_counter = _counter + 1;
newId = _counter;
}
_mint(owner_, newId);
uint16 rank = (props_[0] +
props_[1] +
props_[2] +
props_[3] +
props_[4] +
props_[5] +
props_[6] +
props_[7] +
props_[8] +
props_[9]) / 10;
uint256 bornTime = 0;
uint256 adultTime = 0;
if (born_) {
bornTime = block.timestamp;
if (adultTime_ > block.timestamp) {
adultTime = adultTime_;
} else {
adultTime = block.timestamp;
}
}
_actors[newId] = Structures.ActorData({
bornTime: bornTime,
adultTime: adultTime,
kidTokenUriHash: "",
adultTokenUriHash: "",
props: props_,
sex: sex_,
childs: childs_,
childsPossible: childs_,
born: born_,
immaculate: immaculate_,
rank: rank,
initialOwner: owner_
});
if (immaculate_) {
emit MintedImmaculate(owner_, newId);
} else {
emit Minted(owner_, newId);
}
return newId;
}
function getProps(uint256 id_)
external
view
override
correctId(id_)
returns (uint16[10] memory)
{
return _actors[id_].props;
}
function getActor(uint256 id_)
external
view
override
correctId(id_)
returns (Structures.ActorData memory)
{
return _actors[id_];
}
function getSex(uint256 id_)
external
view
override
correctId(id_)
returns (bool)
{
return _actors[id_].sex;
}
function getChilds(uint256 id_)
external
view
override
correctId(id_)
returns (uint8, uint8)
{
return (_actors[id_].childs, _actors[id_].childsPossible);
}
function breedChild(uint256 id_)
external
override
haveRights
correctId(id_)
{
if (!_actors[id_].sex) {
require(_actors[id_].childsPossible > 0, TOO_MUCH_CHILDS);
_actors[id_].childsPossible = _actors[id_].childsPossible - 1;
}
}
function getImmaculate(uint256 id_)
external
view
override
correctId(id_)
returns (bool)
{
return (_actors[id_].immaculate);
}
function getBornTime(uint256 id_)
external
view
override
correctId(id_)
returns (uint256)
{
require(_actors[id_].born, NOT_BORN);
return _actors[id_].bornTime;
}
function isBorn(uint256 id_)
external
view
override
correctId(id_)
returns (bool)
{
return _actors[id_].born;
}
function born(uint256 id_, uint256 adultTime_)
external
override
haveRights
correctId(id_)
{
require(!_actors[id_].born, ALREADY_SET);
_actors[id_].born = true;
_actors[id_].bornTime = block.timestamp;
emit ActorWasBorn(id_, block.timestamp);
if (adultTime_ < block.timestamp) {
_actors[id_].adultTime = block.timestamp;
} else {
_actors[id_].adultTime = adultTime_;
}
}
function setAdultTime(uint256 id_, uint256 time_)
external
override
haveRights
correctId(id_)
{
require(_actors[id_].born, NOT_BORN);
_actors[id_].adultTime = time_;
}
function _isAdult(uint256 id_) internal view returns (bool) {
return _actors[id_].born && _actors[id_].adultTime <= block.timestamp;
}
function getAdultTime(uint256 id_)
external
view
override
correctId(id_)
returns (uint256)
{
return _actors[id_].adultTime;
}
function isAdult(uint256 id_)
external
view
override
correctId(id_)
returns (bool)
{
return _isAdult(id_);
}
function getRank(uint256 id_)
external
view
override
correctId(id_)
returns (uint16)
{
return _actors[id_].rank;
}
function supportsInterface(bytes4 interfaceId)
public
view
virtual
override(IERC165, ERC721, ERC2981)
returns (bool)
{
return super.supportsInterface(interfaceId);
}
}
文件 2 的 27: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);
}
}
}
}
文件 3 的 27:Constants.sol
pragma solidity ^0.8.17;
address constant CANONICAL_OPERATOR_FILTER_REGISTRY_ADDRESS = 0x000000000000AAeB6D7670E522A718067333cd4E;
address constant CANONICAL_CORI_SUBSCRIPTION = 0x3cc6CddA760b79bAfa08dF41ECFA224f810dCeB6;
文件 4 的 27: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;
}
}
文件 5 的 27: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;
}
}
文件 6 的 27: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) {}
}
文件 7 的 27: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);
}
}
文件 8 的 27: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;
}
}
文件 9 的 27: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];
}
}
文件 10 的 27: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 {}
}
文件 11 的 27: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;
}
文件 12 的 27: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_);
}
}
文件 13 的 27: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);
}
文件 14 的 27:IERC165.sol
pragma solidity ^0.8.0;
interface IERC165 {
function supportsInterface(bytes4 interfaceId) external view returns (bool);
}
文件 15 的 27: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 的 27: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 的 27: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 的 27:IERC721Receiver.sol
pragma solidity ^0.8.0;
interface IERC721Receiver {
function onERC721Received(
address operator,
address from,
uint256 tokenId,
bytes calldata data
) external returns (bytes4);
}
文件 19 的 27:IMaternity.sol
pragma solidity 0.8.17;
interface IMaternity {
event Born(address indexed owner_, uint256 indexed id);
event Grow(address indexed owner_, uint256 indexed id);
event Adult(address indexed owner_, uint256 indexed id);
function born(uint256 id) external;
function growPrice(uint256 id) external returns (uint256);
function growTime(uint256 id, uint256 amount) external returns (uint256);
function grow(uint256 id, uint256 amount) external;
}
文件 20 的 27: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);
}
文件 21 的 27: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);
}
文件 22 的 27: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);
}
}
}
}
文件 23 的 27: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);
}
}
文件 24 的 27: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);
}
}
文件 25 的 27: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);
}
}
文件 26 的 27: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;
uint16 amount;
uint8 level;
uint8 issued;
}
}
文件 27 的 27:Zombies.sol
pragma solidity 0.8.17;
import "./Actors.sol";
contract Zombies is Actors {
constructor(address router_, uint256 start_)
Actors("UndeadsZombies", "UDZT", router_, start_)
{}
function _getPlaceholderSubFolder()
internal
pure
override
returns (string memory)
{
return "zo";
}
}
{
"compilationTarget": {
"project:/contracts/persons/Zombies.sol": "Zombies"
},
"evmVersion": "london",
"libraries": {},
"metadata": {
"bytecodeHash": "ipfs"
},
"optimizer": {
"enabled": true,
"runs": 200
},
"remappings": [],
"viaIR": true
}
[{"inputs":[{"internalType":"address","name":"router_","type":"address"},{"internalType":"uint256","name":"start_","type":"uint256"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[{"internalType":"address","name":"operator","type":"address"}],"name":"OperatorNotAllowed","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"id","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"bornTime","type":"uint256"}],"name":"ActorWasBorn","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":"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":"Minted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"uint256","name":"id","type":"uint256"}],"name":"MintedImmaculate","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":"kidUri","type":"string"},{"indexed":false,"internalType":"string","name":"adultUri","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":"uint256","name":"id_","type":"uint256"},{"internalType":"uint256","name":"adultTime_","type":"uint256"}],"name":"born","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"id_","type":"uint256"}],"name":"breedChild","outputs":[],"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":"id_","type":"uint256"}],"name":"getActor","outputs":[{"components":[{"internalType":"uint256","name":"adultTime","type":"uint256"},{"internalType":"uint256","name":"bornTime","type":"uint256"},{"internalType":"string","name":"kidTokenUriHash","type":"string"},{"internalType":"string","name":"adultTokenUriHash","type":"string"},{"internalType":"uint16[10]","name":"props","type":"uint16[10]"},{"internalType":"uint8","name":"childs","type":"uint8"},{"internalType":"uint8","name":"childsPossible","type":"uint8"},{"internalType":"bool","name":"sex","type":"bool"},{"internalType":"bool","name":"born","type":"bool"},{"internalType":"bool","name":"immaculate","type":"bool"},{"internalType":"uint16","name":"rank","type":"uint16"},{"internalType":"address","name":"initialOwner","type":"address"}],"internalType":"struct Structures.ActorData","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"id_","type":"uint256"}],"name":"getAdultTime","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"getApproved","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"id_","type":"uint256"}],"name":"getBornTime","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"id_","type":"uint256"}],"name":"getChilds","outputs":[{"internalType":"uint8","name":"","type":"uint8"},{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"id_","type":"uint256"}],"name":"getImmaculate","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"id_","type":"uint256"}],"name":"getProps","outputs":[{"internalType":"uint16[10]","name":"","type":"uint16[10]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"id_","type":"uint256"}],"name":"getRank","outputs":[{"internalType":"uint16","name":"","type":"uint16"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"id_","type":"uint256"}],"name":"getSex","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"id_","type":"uint256"}],"name":"isAdult","outputs":[{"internalType":"bool","name":"","type":"bool"}],"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":"isBorn","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"id_","type":"uint256"},{"internalType":"address","name":"owner_","type":"address"},{"internalType":"uint16[10]","name":"props_","type":"uint16[10]"},{"internalType":"bool","name":"sex_","type":"bool"},{"internalType":"bool","name":"born_","type":"bool"},{"internalType":"uint256","name":"adultTime_","type":"uint256"},{"internalType":"uint8","name":"childs_","type":"uint8"},{"internalType":"bool","name":"immaculate_","type":"bool"}],"name":"mint","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","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":"uint256","name":"id_","type":"uint256"},{"internalType":"uint256","name":"time_","type":"uint256"}],"name":"setAdultTime","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"operator","type":"address"},{"internalType":"bool","name":"approved","type":"bool"}],"name":"setApprovalForAll","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"receiver","type":"address"},{"internalType":"uint96","name":"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":"adultHash_","type":"string"}],"name":"setMetadataHash","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"id_","type":"uint256"},{"internalType":"string","name":"kidHash_","type":"string"},{"internalType":"string","name":"adultHash_","type":"string"}],"name":"setMetadataHashes","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":"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":"tokenAdultURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"id_","type":"uint256"}],"name":"tokenKidURI","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"}]