文件 1 的 19: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 的 19:AdventureERC721.sol
pragma solidity 0.8.9;
import "./IQuestStaking.sol";
import "./AdventurePermissions.sol";
import "@openzeppelin/contracts/token/ERC721/ERC721.sol";
abstract contract AdventureERC721 is ERC721, AdventurePermissions, IQuestStaking {
uint256 public constant MAX_UINT32 = type(uint32).max;
uint256 public constant MAX_CONCURRENT_QUESTS = 100;
mapping (uint256 => mapping (address => uint32[])) public activeQuestList;
mapping (uint256 => mapping (address => mapping (uint32 => Quest))) public activeQuestLookup;
mapping (uint256 => uint256) public blockingQuestCounts;
function supportsInterface(bytes4 interfaceId) public view virtual override (ERC721, IERC165) returns (bool) {
return interfaceId == type(IQuestStaking).interfaceId || super.supportsInterface(interfaceId);
}
function adventureTransferFrom(address from, address to, uint256 tokenId) external override onlyAdventure {
require(_isApprovedForAdventure(_msgSender(), tokenId), "Caller not approved for adventure");
_transfer(from, to, tokenId);
}
function adventureSafeTransferFrom(address from, address to, uint256 tokenId) external override onlyAdventure {
require(_isApprovedForAdventure(_msgSender(), tokenId), "Caller not approved for adventure");
_safeTransfer(from, to, tokenId, "");
}
function adventureBurn(uint256 tokenId) external override onlyAdventure {
require(_isApprovedForAdventure(_msgSender(), tokenId), "Caller not approved for adventure");
_burn(tokenId);
}
function enterQuest(uint256 tokenId, uint256 questId) external override onlyAdventure {
require(_isApprovedForAdventure(_msgSender(), tokenId), "Caller not approved for adventure");
_enterQuest(tokenId, _msgSender(), questId);
}
function exitQuest(uint256 tokenId, uint256 questId) external override onlyAdventure {
require(_isApprovedForAdventure(_msgSender(), tokenId), "Caller not approved for adventure");
_exitQuest(tokenId, _msgSender(), questId);
}
function bootFromAllQuests(uint256 tokenId, address adventure) external onlyOwner onlyWhenRemovedFromWhitelist(adventure) {
_exitAllQuests(tokenId, adventure, true);
}
function userExitQuest(uint256 tokenId, address adventure, uint256 questId) external onlyWhenRemovedFromWhitelist(adventure) {
require(ownerOf(tokenId) == _msgSender(), "Only token owner may exit quest");
_exitQuest(tokenId, adventure, questId);
}
function userExitAllQuests(uint256 tokenId, address adventure) external onlyWhenRemovedFromWhitelist(adventure) {
require(ownerOf(tokenId) == _msgSender(), "Only token owner may exit quest");
_exitAllQuests(tokenId, adventure, false);
}
function getQuestCount(uint256 tokenId, address adventure) public override view returns (uint256) {
return activeQuestList[tokenId][adventure].length;
}
function getTimeOnQuest(uint256 tokenId, address adventure, uint256 questId) public override view returns (uint256) {
(bool participatingInQuest, uint256 startTimestamp,) = isParticipatingInQuest(tokenId, adventure, questId);
return participatingInQuest ? (block.timestamp - startTimestamp) : 0;
}
function isParticipatingInQuest(uint256 tokenId, address adventure, uint256 questId) public override view returns (bool participatingInQuest, uint256 startTimestamp, uint256 index) {
Quest memory quest = activeQuestLookup[tokenId][adventure][uint32(questId)];
participatingInQuest = quest.isActive;
startTimestamp = quest.startTimestamp;
index = quest.arrayIndex;
return (participatingInQuest, startTimestamp, index);
}
function getActiveQuests(uint256 tokenId, address adventure) public override view returns (Quest[] memory activeQuests) {
uint256 questCount = getQuestCount(tokenId, adventure);
activeQuests = new Quest[](questCount);
uint32[] memory activeQuestIdList = activeQuestList[tokenId][adventure];
for(uint256 i = 0; i < questCount; ++i) {
activeQuests[i] = activeQuestLookup[tokenId][adventure][activeQuestIdList[i]];
}
return activeQuests;
}
function _enterQuest(uint256 tokenId, address adventure, uint256 questId) internal {
require(questId <= MAX_UINT32, "questId out of range");
(bool participatingInQuest,,) = isParticipatingInQuest(tokenId, adventure, questId);
require(!participatingInQuest, "Already on quest");
uint256 currentQuestCount = getQuestCount(tokenId, adventure);
require(currentQuestCount < MAX_CONCURRENT_QUESTS, "Too many active quests");
uint32 castedQuestId = uint32(questId);
activeQuestList[tokenId][adventure].push(castedQuestId);
activeQuestLookup[tokenId][adventure][castedQuestId] = Quest({
isActive: true,
startTimestamp: uint64(block.timestamp),
questId: castedQuestId,
arrayIndex: uint32(currentQuestCount)
});
address ownerOfToken = ownerOf(tokenId);
emit QuestUpdated(tokenId, ownerOfToken, adventure, questId, true, false);
if(IAdventure(adventure).questsLockTokens()) {
unchecked {
++blockingQuestCounts[tokenId];
}
}
IAdventure(adventure).onQuestEntered(ownerOfToken, tokenId, questId);
}
function _exitQuest(uint256 tokenId, address adventure, uint256 questId) internal {
require(questId <= MAX_UINT32, "questId out of range");
(bool participatingInQuest, uint256 startTimestamp, uint256 index) = isParticipatingInQuest(tokenId, adventure, questId);
require(participatingInQuest, "Not on quest");
uint32 castedQuestId = uint32(questId);
uint256 lastArrayIndex = getQuestCount(tokenId, adventure) - 1;
activeQuestList[tokenId][adventure][index] = activeQuestList[tokenId][adventure][lastArrayIndex];
activeQuestLookup[tokenId][adventure][activeQuestList[tokenId][adventure][lastArrayIndex]].arrayIndex = uint32(index);
activeQuestList[tokenId][adventure].pop();
delete activeQuestLookup[tokenId][adventure][castedQuestId];
address ownerOfToken = ownerOf(tokenId);
emit QuestUpdated(tokenId, ownerOfToken, adventure, questId, false, false);
if(IAdventure(adventure).questsLockTokens()) {
--blockingQuestCounts[tokenId];
}
IAdventure(adventure).onQuestExited(ownerOfToken, tokenId, questId, startTimestamp);
}
function _exitAllQuests(uint256 tokenId, address adventure, bool booted) internal {
address tokenOwner = ownerOf(tokenId);
uint256 questCount = getQuestCount(tokenId, adventure);
if(IAdventure(adventure).questsLockTokens()) {
blockingQuestCounts[tokenId] -= questCount;
}
for(uint256 i = 0; i < questCount; ++i) {
uint256 questId = activeQuestList[tokenId][adventure][i];
Quest memory quest = activeQuestLookup[tokenId][adventure][uint32(questId)];
uint256 startTimestamp = quest.startTimestamp;
emit QuestUpdated(tokenId, tokenOwner, adventure, questId, false, booted);
delete activeQuestLookup[tokenId][adventure][uint32(questId)];
IAdventure(adventure).onQuestExited(tokenOwner, tokenId, questId, startTimestamp);
}
delete activeQuestList[tokenId][adventure];
}
function _beforeTokenTransfer(address , address , uint256 tokenId) internal virtual override {
require(blockingQuestCounts[tokenId] == 0, "An active quest is preventing transfers");
}
}
文件 3 的 19:AdventurePermissions.sol
pragma solidity 0.8.9;
import "./IAdventure.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/token/ERC721/IERC721.sol";
abstract contract AdventurePermissions is Ownable {
struct AdventureDetails {
bool isWhitelisted;
uint128 arrayIndex;
}
event AdventureWhitelistUpdated(address indexed adventure, bool whitelisted);
event AdventureApprovalForAll(address indexed tokenOwner, address indexed operator, bool approved);
address[] public whitelistedAdventureList;
mapping (address => AdventureDetails) public whitelistedAdventures;
mapping (address => mapping (address => bool)) private _operatorAdventureApprovals;
modifier onlyAdventure() {
require(isAdventureWhitelisted(_msgSender()), "Not an adventure.");
_;
}
modifier onlyWhenRemovedFromWhitelist(address adventure) {
require(!isAdventureWhitelisted(adventure), "Adventure is still whitelisted");
_;
}
function isAdventureWhitelisted(address account) public view returns (bool) {
return whitelistedAdventures[account].isWhitelisted;
}
function whitelistAdventure(address adventure) external onlyOwner {
require(!whitelistedAdventures[adventure].isWhitelisted, "Already whitelisted");
require(IERC165(adventure).supportsInterface(type(IAdventure).interfaceId), "Invalid adventure contract");
whitelistedAdventures[adventure].isWhitelisted = true;
whitelistedAdventures[adventure].arrayIndex = uint128(whitelistedAdventureList.length);
whitelistedAdventureList.push(adventure);
emit AdventureWhitelistUpdated(adventure, true);
}
function unwhitelistAdventure(address adventure) external onlyOwner {
require(whitelistedAdventures[adventure].isWhitelisted, "Not whitelisted");
uint128 itemPositionToDelete = whitelistedAdventures[adventure].arrayIndex;
whitelistedAdventureList[itemPositionToDelete] = whitelistedAdventureList[whitelistedAdventureList.length - 1];
whitelistedAdventures[whitelistedAdventureList[itemPositionToDelete]].arrayIndex = itemPositionToDelete;
whitelistedAdventureList.pop();
delete whitelistedAdventures[adventure];
emit AdventureWhitelistUpdated(adventure, false);
}
function setAdventuresApprovedForAll(address operator, bool approved) public {
_setAdventuresApprovedForAll(_msgSender(), operator, approved);
}
function areAdventuresApprovedForAll(address owner, address operator) public view returns (bool) {
return _operatorAdventureApprovals[owner][operator];
}
function _setAdventuresApprovedForAll(address tokenOwner, address operator, bool approved) internal {
require(tokenOwner != operator, "approve to caller");
_operatorAdventureApprovals[tokenOwner][operator] = approved;
emit AdventureApprovalForAll(tokenOwner, operator, approved);
}
function _isApprovedForAdventure(address spender, uint256 tokenId) internal view virtual returns (bool) {
address tokenOwner = IERC721(address(this)).ownerOf(tokenId);
return (areAdventuresApprovedForAll(tokenOwner, spender));
}
}
文件 4 的 19:Bloodlines.sol
pragma solidity 0.8.9;
library Bloodlines {
enum Bloodline { None, Rogue, Warrior, Royal }
}
文件 5 的 19: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;
}
}
文件 6 的 19:DigiDaigakuHeroes.sol
pragma solidity 0.8.9;
import "./AdventureERC721.sol";
import "./Bloodlines.sol";
import "@openzeppelin/contracts/token/common/ERC2981.sol";
contract DigiDaigakuHeroes is AdventureERC721, ERC2981 {
using Strings for uint256;
uint256 private constant MAX_UINT = type(uint256).max;
uint256 public constant MAX_SUPPLY = 2022;
uint96 public constant MAX_ROYALTY_FEE_NUMERATOR = 1000;
Bloodlines.Bloodline[MAX_SUPPLY] private bloodlines;
uint256[] private mintedTokenTracker;
string public baseTokenURI;
string public suffixURI = ".json";
mapping (address => bool) public whitelistedMinters;
event BaseURISet(string baseTokenURI);
event SuffixURISet(string suffixURI);
event RoyaltySet(address receiver, uint96 feeNumerator);
event MinterWhitelistUpdated(address indexed minter, bool whitelisted);
event MintHero(address indexed to, uint256 indexed tokenId, uint256 indexed genesisTokenId, uint256 timestamp);
constructor() ERC721("DigiDaigakuHeroes", "DIHE") {
unchecked {
uint256 numberOfTokenTrackerSlots = getNumberOfTokenTrackerSlots();
for(uint256 i = 0; i < numberOfTokenTrackerSlots; ++i) {
mintedTokenTracker.push(MAX_UINT);
}
}
}
modifier onlyMinter() {
require(isMinterWhitelisted(_msgSender()), "Not a minter");
_;
}
function isMinterWhitelisted(address account) public view returns (bool) {
return whitelistedMinters[account];
}
function whitelistMinter(address minter) external onlyOwner {
require(!whitelistedMinters[minter], "Already whitelisted");
whitelistedMinters[minter] = true;
emit MinterWhitelistUpdated(minter, true);
}
function unwhitelistMinter(address minter) external onlyOwner {
require(whitelistedMinters[minter], "Not whitelisted");
delete whitelistedMinters[minter];
emit MinterWhitelistUpdated(minter, false);
}
function mintHero(address to, uint256 tokenId, uint256 genesisTokenId) external onlyMinter {
unchecked {
require(tokenId > 0, "Token id out of range");
require(tokenId <= MAX_SUPPLY, "Token id out of range");
require(genesisTokenId <= MAX_SUPPLY, "Genesis token id out of range");
uint256 slot = tokenId / 256;
uint256 offset = tokenId % 256;
uint256 slotValue = mintedTokenTracker[slot];
require(((slotValue >> offset) & uint256(1)) == 1, "Token already minted");
mintedTokenTracker[slot] = slotValue & ~(uint256(1) << offset);
bloodlines[tokenId - 1] = determineBloodline(tokenId, genesisTokenId);
emit MintHero(to, tokenId, genesisTokenId, block.timestamp);
}
_mint(to, tokenId);
}
function _baseURI() internal view virtual override returns (string memory) {
return baseTokenURI;
}
function setBaseURI(string calldata baseTokenURI_) external onlyOwner {
baseTokenURI = baseTokenURI_;
emit BaseURISet(baseTokenURI_);
}
function setSuffixURI(string calldata suffixURI_) external onlyOwner {
suffixURI = suffixURI_;
emit SuffixURISet(suffixURI_);
}
function setRoyaltyInfo(address receiver, uint96 feeNumerator) external onlyOwner {
require(feeNumerator <= MAX_ROYALTY_FEE_NUMERATOR, "Exceeds max royalty fee");
_setDefaultRoyalty(receiver, feeNumerator);
emit RoyaltySet(receiver, feeNumerator);
}
function getBloodline(uint256 tokenId) external view returns (Bloodlines.Bloodline) {
require(_exists(tokenId), "Nonexistent token");
return bloodlines[tokenId - 1];
}
function tokenURI(uint256 tokenId) public view virtual override returns (string memory) {
require(_exists(tokenId), "Nonexistent token");
string memory baseURI = _baseURI();
return bytes(baseURI).length > 0
? string(abi.encodePacked(baseURI, tokenId.toString(), suffixURI))
: "";
}
function supportsInterface(bytes4 interfaceId) public view virtual override (AdventureERC721, ERC2981) returns (bool) {
return super.supportsInterface(interfaceId);
}
function determineBloodline(uint256 tokenId, uint256 genesisTokenId) internal pure returns (Bloodlines.Bloodline) {
if(genesisTokenId == 0) {
return Bloodlines.Bloodline.Rogue;
} else if(tokenId != genesisTokenId) {
return Bloodlines.Bloodline.Warrior;
} else {
return Bloodlines.Bloodline.Royal;
}
}
function getNumberOfTokenTrackerSlots() internal pure returns (uint256 tokenTrackerSlotsRequired) {
unchecked {
uint256 maxSupplyPlusOne = 1 + MAX_SUPPLY;
tokenTrackerSlotsRequired = maxSupplyPlusOne / 256;
if(maxSupplyPlusOne % 256 > 0) {
++tokenTrackerSlotsRequired;
}
}
return tokenTrackerSlotsRequired;
}
}
文件 7 的 19: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 的 19: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 的 19: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: address zero is not a valid owner");
return _balances[owner];
}
function ownerOf(uint256 tokenId) public view virtual override returns (address) {
address owner = _owners[tokenId];
require(owner != address(0), "ERC721: invalid token ID");
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) {
_requireMinted(tokenId);
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 token owner nor approved for all"
);
_approve(to, tokenId);
}
function getApproved(uint256 tokenId) public view virtual override returns (address) {
_requireMinted(tokenId);
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: caller is not token 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: caller is not token 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) {
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 _requireMinted(uint256 tokenId) internal view virtual {
require(_exists(tokenId), "ERC721: invalid token ID");
}
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 的 19:IAdventure.sol
pragma solidity 0.8.9;
import "@openzeppelin/contracts/utils/introspection/IERC165.sol";
interface IAdventure is IERC165 {
function questsLockTokens() external view returns (bool);
function onQuestEntered(address adventurer, uint256 tokenId, uint256 questId) external;
function onQuestExited(address adventurer, uint256 tokenId, uint256 questId, uint256 questStartTimestamp) external;
}
文件 11 的 19:IERC165.sol
pragma solidity ^0.8.0;
interface IERC165 {
function supportsInterface(bytes4 interfaceId) external view returns (bool);
}
文件 12 的 19: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);
}
文件 13 的 19: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);
}
文件 14 的 19: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);
}
文件 15 的 19:IERC721Receiver.sol
pragma solidity ^0.8.0;
interface IERC721Receiver {
function onERC721Received(
address operator,
address from,
uint256 tokenId,
bytes calldata data
) external returns (bytes4);
}
文件 16 的 19:IQuestStaking.sol
pragma solidity 0.8.9;
import "./Quest.sol";
import "@openzeppelin/contracts/utils/introspection/IERC165.sol";
interface IQuestStaking is IERC165 {
event QuestUpdated(uint256 indexed tokenId, address indexed tokenOwner, address indexed adventure, uint256 questId, bool active, bool booted);
function adventureTransferFrom(address from, address to, uint256 tokenId) external;
function adventureSafeTransferFrom(address from, address to, uint256 tokenId) external;
function adventureBurn(uint256 tokenId) external;
function enterQuest(uint256 tokenId, uint256 questId) external;
function exitQuest(uint256 tokenId, uint256 questId) external;
function getQuestCount(uint256 tokenId, address adventure) external view returns (uint256);
function getTimeOnQuest(uint256 tokenId, address adventure, uint256 questId) external view returns (uint256);
function isParticipatingInQuest(uint256 tokenId, address adventure, uint256 questId) external view returns (bool participatingInQuest, uint256 startTimestamp, uint256 index);
function getActiveQuests(uint256 tokenId, address adventure) external view returns (Quest[] memory activeQuests);
}
文件 17 的 19: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());
}
modifier onlyOwner() {
_checkOwner();
_;
}
function owner() public view virtual returns (address) {
return _owner;
}
function _checkOwner() internal view virtual {
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);
}
}
文件 18 的 19:Quest.sol
pragma solidity 0.8.9;
struct Quest {
bool isActive;
uint32 questId;
uint64 startTimestamp;
uint32 arrayIndex;
}
文件 19 的 19:Strings.sol
pragma solidity ^0.8.0;
library Strings {
bytes16 private constant _HEX_SYMBOLS = "0123456789abcdef";
uint8 private constant _ADDRESS_LENGTH = 20;
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);
}
function toHexString(address addr) internal pure returns (string memory) {
return toHexString(uint256(uint160(addr)), _ADDRESS_LENGTH);
}
}
{
"compilationTarget": {
"contracts/DigiDaigakuHeroes.sol": "DigiDaigakuHeroes"
},
"evmVersion": "london",
"libraries": {},
"metadata": {
"bytecodeHash": "ipfs"
},
"optimizer": {
"enabled": true,
"runs": 1500
},
"remappings": []
}
[{"inputs":[],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"tokenOwner","type":"address"},{"indexed":true,"internalType":"address","name":"operator","type":"address"},{"indexed":false,"internalType":"bool","name":"approved","type":"bool"}],"name":"AdventureApprovalForAll","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"adventure","type":"address"},{"indexed":false,"internalType":"bool","name":"whitelisted","type":"bool"}],"name":"AdventureWhitelistUpdated","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":false,"internalType":"string","name":"baseTokenURI","type":"string"}],"name":"BaseURISet","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"},{"indexed":true,"internalType":"uint256","name":"genesisTokenId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"timestamp","type":"uint256"}],"name":"MintHero","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"minter","type":"address"},{"indexed":false,"internalType":"bool","name":"whitelisted","type":"bool"}],"name":"MinterWhitelistUpdated","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":"tokenId","type":"uint256"},{"indexed":true,"internalType":"address","name":"tokenOwner","type":"address"},{"indexed":true,"internalType":"address","name":"adventure","type":"address"},{"indexed":false,"internalType":"uint256","name":"questId","type":"uint256"},{"indexed":false,"internalType":"bool","name":"active","type":"bool"},{"indexed":false,"internalType":"bool","name":"booted","type":"bool"}],"name":"QuestUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"receiver","type":"address"},{"indexed":false,"internalType":"uint96","name":"feeNumerator","type":"uint96"}],"name":"RoyaltySet","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"string","name":"suffixURI","type":"string"}],"name":"SuffixURISet","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":"MAX_CONCURRENT_QUESTS","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MAX_ROYALTY_FEE_NUMERATOR","outputs":[{"internalType":"uint96","name":"","type":"uint96"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MAX_SUPPLY","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MAX_UINT32","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"}],"name":"activeQuestList","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"address","name":"","type":"address"},{"internalType":"uint32","name":"","type":"uint32"}],"name":"activeQuestLookup","outputs":[{"internalType":"bool","name":"isActive","type":"bool"},{"internalType":"uint32","name":"questId","type":"uint32"},{"internalType":"uint64","name":"startTimestamp","type":"uint64"},{"internalType":"uint32","name":"arrayIndex","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"adventureBurn","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"adventureSafeTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"adventureTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"approve","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"operator","type":"address"}],"name":"areAdventuresApprovedForAll","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"baseTokenURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"blockingQuestCounts","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"address","name":"adventure","type":"address"}],"name":"bootFromAllQuests","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"uint256","name":"questId","type":"uint256"}],"name":"enterQuest","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"uint256","name":"questId","type":"uint256"}],"name":"exitQuest","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"address","name":"adventure","type":"address"}],"name":"getActiveQuests","outputs":[{"components":[{"internalType":"bool","name":"isActive","type":"bool"},{"internalType":"uint32","name":"questId","type":"uint32"},{"internalType":"uint64","name":"startTimestamp","type":"uint64"},{"internalType":"uint32","name":"arrayIndex","type":"uint32"}],"internalType":"struct Quest[]","name":"activeQuests","type":"tuple[]"}],"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":"tokenId","type":"uint256"}],"name":"getBloodline","outputs":[{"internalType":"enum Bloodlines.Bloodline","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"address","name":"adventure","type":"address"}],"name":"getQuestCount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"address","name":"adventure","type":"address"},{"internalType":"uint256","name":"questId","type":"uint256"}],"name":"getTimeOnQuest","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"isAdventureWhitelisted","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":"address","name":"account","type":"address"}],"name":"isMinterWhitelisted","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"address","name":"adventure","type":"address"},{"internalType":"uint256","name":"questId","type":"uint256"}],"name":"isParticipatingInQuest","outputs":[{"internalType":"bool","name":"participatingInQuest","type":"bool"},{"internalType":"uint256","name":"startTimestamp","type":"uint256"},{"internalType":"uint256","name":"index","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"uint256","name":"genesisTokenId","type":"uint256"}],"name":"mintHero","outputs":[],"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"},{"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":"setAdventuresApprovedForAll","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"operator","type":"address"},{"internalType":"bool","name":"approved","type":"bool"}],"name":"setApprovalForAll","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"baseTokenURI_","type":"string"}],"name":"setBaseURI","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"receiver","type":"address"},{"internalType":"uint96","name":"feeNumerator","type":"uint96"}],"name":"setRoyaltyInfo","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"suffixURI_","type":"string"}],"name":"setSuffixURI","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"suffixURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"tokenURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"transferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"adventure","type":"address"}],"name":"unwhitelistAdventure","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"minter","type":"address"}],"name":"unwhitelistMinter","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"address","name":"adventure","type":"address"}],"name":"userExitAllQuests","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"address","name":"adventure","type":"address"},{"internalType":"uint256","name":"questId","type":"uint256"}],"name":"userExitQuest","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"adventure","type":"address"}],"name":"whitelistAdventure","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"minter","type":"address"}],"name":"whitelistMinter","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"whitelistedAdventureList","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"whitelistedAdventures","outputs":[{"internalType":"bool","name":"isWhitelisted","type":"bool"},{"internalType":"uint128","name":"arrayIndex","type":"uint128"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"whitelistedMinters","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"}]