编译器
0.8.11+commit.d7f03943
文件 1 的 14:Address.sol
pragma solidity ^0.8.0;
library Address {
function isContract(address account) internal view returns (bool) {
uint256 size;
assembly {
size := extcodesize(account)
}
return size > 0;
}
function sendValue(address payable recipient, uint256 amount) internal {
require(address(this).balance >= amount, "Address: insufficient balance");
(bool success, ) = recipient.call{value: amount}("");
require(success, "Address: unable to send value, recipient may have reverted");
}
function functionCall(address target, bytes memory data) internal returns (bytes memory) {
return functionCall(target, data, "Address: low-level call failed");
}
function functionCall(
address target,
bytes memory data,
string memory errorMessage
) internal returns (bytes memory) {
return functionCallWithValue(target, data, 0, errorMessage);
}
function functionCallWithValue(
address target,
bytes memory data,
uint256 value
) internal returns (bytes memory) {
return functionCallWithValue(target, data, value, "Address: low-level call with value failed");
}
function functionCallWithValue(
address target,
bytes memory data,
uint256 value,
string memory errorMessage
) internal returns (bytes memory) {
require(address(this).balance >= value, "Address: insufficient balance for call");
require(isContract(target), "Address: call to non-contract");
(bool success, bytes memory returndata) = target.call{value: value}(data);
return verifyCallResult(success, returndata, errorMessage);
}
function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {
return functionStaticCall(target, data, "Address: low-level static call failed");
}
function functionStaticCall(
address target,
bytes memory data,
string memory errorMessage
) internal view returns (bytes memory) {
require(isContract(target), "Address: static call to non-contract");
(bool success, bytes memory returndata) = target.staticcall(data);
return verifyCallResult(success, returndata, errorMessage);
}
function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {
return functionDelegateCall(target, data, "Address: low-level delegate call failed");
}
function functionDelegateCall(
address target,
bytes memory data,
string memory errorMessage
) internal returns (bytes memory) {
require(isContract(target), "Address: delegate call to non-contract");
(bool success, bytes memory returndata) = target.delegatecall(data);
return verifyCallResult(success, returndata, errorMessage);
}
function verifyCallResult(
bool success,
bytes memory returndata,
string memory errorMessage
) internal pure returns (bytes memory) {
if (success) {
return returndata;
} else {
if (returndata.length > 0) {
assembly {
let returndata_size := mload(returndata)
revert(add(32, returndata), returndata_size)
}
} else {
revert(errorMessage);
}
}
}
}
文件 2 的 14: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;
}
}
文件 3 的 14: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;
}
}
文件 4 的 14:ERC721A.sol
pragma solidity =0.8.11;
import "@openzeppelin/contracts/token/ERC721/IERC721.sol";
import "@openzeppelin/contracts/token/ERC721/IERC721Receiver.sol";
import "@openzeppelin/contracts/token/ERC721/extensions/IERC721Metadata.sol";
import "@openzeppelin/contracts/token/ERC721/extensions/IERC721Enumerable.sol";
import "@openzeppelin/contracts/utils/Address.sol";
import "@openzeppelin/contracts/utils/Context.sol";
import "@openzeppelin/contracts/utils/Strings.sol";
import "@openzeppelin/contracts/utils/introspection/ERC165.sol";
contract ERC721A is
Context,
ERC165,
IERC721,
IERC721Metadata,
IERC721Enumerable
{
using Address for address;
using Strings for uint256;
struct TokenOwnership {
address addr;
uint64 startTimestamp;
}
struct AddressData {
uint128 balance;
uint128 numberMinted;
}
uint256 private currentIndex = 0;
uint256 internal immutable collectionSize;
uint256 internal immutable maxBatchSize;
string private _name;
string private _symbol;
mapping(uint256 => TokenOwnership) private _ownerships;
mapping(address => AddressData) private _addressData;
mapping(uint256 => address) private _tokenApprovals;
mapping(address => mapping(address => bool)) private _operatorApprovals;
constructor(
string memory name_,
string memory symbol_,
uint256 maxBatchSize_,
uint256 collectionSize_
) {
require(
collectionSize_ > 0,
"ERC721A: collection must have a nonzero supply"
);
require(maxBatchSize_ > 0, "ERC721A: max batch size must be nonzero");
_name = name_;
_symbol = symbol_;
maxBatchSize = maxBatchSize_;
collectionSize = collectionSize_;
}
function totalSupply() public view override returns (uint256) {
return currentIndex;
}
function tokenByIndex(uint256 index) public view override returns (uint256) {
require(index < totalSupply(), "ERC721A: global index out of bounds");
return index;
}
function tokenOfOwnerByIndex(address owner, uint256 index)
public
view
override
returns (uint256)
{
require(index < balanceOf(owner), "ERC721A: owner index out of bounds");
uint256 numMintedSoFar = totalSupply();
uint256 tokenIdsIdx = 0;
address currOwnershipAddr = address(0);
for (uint256 i = 0; i < numMintedSoFar; i++) {
TokenOwnership memory ownership = _ownerships[i];
if (ownership.addr != address(0)) {
currOwnershipAddr = ownership.addr;
}
if (currOwnershipAddr == owner) {
if (tokenIdsIdx == index) {
return i;
}
tokenIdsIdx++;
}
}
revert("ERC721A: unable to get token of owner by index");
}
function supportsInterface(bytes4 interfaceId)
public
view
virtual
override(ERC165, IERC165)
returns (bool)
{
return
interfaceId == type(IERC721).interfaceId ||
interfaceId == type(IERC721Metadata).interfaceId ||
interfaceId == type(IERC721Enumerable).interfaceId ||
super.supportsInterface(interfaceId);
}
function balanceOf(address owner) public view override returns (uint256) {
require(owner != address(0), "ERC721A: balance query for the zero address");
return uint256(_addressData[owner].balance);
}
function _numberMinted(address owner) internal view returns (uint256) {
require(
owner != address(0),
"ERC721A: number minted query for the zero address"
);
return uint256(_addressData[owner].numberMinted);
}
function ownershipOf(uint256 tokenId)
internal
view
returns (TokenOwnership memory)
{
require(_exists(tokenId), "ERC721A: owner query for nonexistent token");
uint256 lowestTokenToCheck;
if (tokenId >= maxBatchSize) {
lowestTokenToCheck = tokenId - maxBatchSize + 1;
}
for (uint256 curr = tokenId; curr >= lowestTokenToCheck; curr--) {
TokenOwnership memory ownership = _ownerships[curr];
if (ownership.addr != address(0)) {
return ownership;
}
}
revert("ERC721A: unable to determine the owner of token");
}
function ownerOf(uint256 tokenId) public view override returns (address) {
return ownershipOf(tokenId).addr;
}
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 override {
address owner = ERC721A.ownerOf(tokenId);
require(to != owner, "ERC721A: approval to current owner");
require(
_msgSender() == owner || isApprovedForAll(owner, _msgSender()),
"ERC721A: approve caller is not owner nor approved for all"
);
_approve(to, tokenId, owner);
}
function getApproved(uint256 tokenId) public view override returns (address) {
require(_exists(tokenId), "ERC721A: approved query for nonexistent token");
return _tokenApprovals[tokenId];
}
function setApprovalForAll(address operator, bool approved) public override {
require(operator != _msgSender(), "ERC721A: approve to caller");
_operatorApprovals[_msgSender()][operator] = approved;
emit ApprovalForAll(_msgSender(), operator, approved);
}
function isApprovedForAll(address owner, address operator)
public
view
virtual
override
returns (bool)
{
return _operatorApprovals[owner][operator];
}
function transferFrom(
address from,
address to,
uint256 tokenId
) public override {
_transfer(from, to, tokenId);
}
function safeTransferFrom(
address from,
address to,
uint256 tokenId
) public override {
safeTransferFrom(from, to, tokenId, "");
}
function safeTransferFrom(
address from,
address to,
uint256 tokenId,
bytes memory _data
) public override {
_transfer(from, to, tokenId);
require(
_checkOnERC721Received(from, to, tokenId, _data),
"ERC721A: transfer to non ERC721Receiver implementer"
);
}
function _exists(uint256 tokenId) internal view returns (bool) {
return tokenId < currentIndex;
}
function _safeMint(address to, uint256 quantity) internal {
_safeMint(to, quantity, "");
}
function _safeMint(
address to,
uint256 quantity,
bytes memory _data
) internal {
uint256 startTokenId = currentIndex;
require(to != address(0), "ERC721A: mint to the zero address");
require(!_exists(startTokenId), "ERC721A: token already minted");
require(quantity <= maxBatchSize, "ERC721A: quantity to mint too high");
_beforeTokenTransfers(address(0), to, startTokenId, quantity);
AddressData memory addressData = _addressData[to];
_addressData[to] = AddressData(
addressData.balance + uint128(quantity),
addressData.numberMinted + uint128(quantity)
);
_ownerships[startTokenId] = TokenOwnership(to, uint64(block.timestamp));
uint256 updatedIndex = startTokenId;
for (uint256 i = 0; i < quantity; i++) {
emit Transfer(address(0), to, updatedIndex);
require(
_checkOnERC721Received(address(0), to, updatedIndex, _data),
"ERC721A: transfer to non ERC721Receiver implementer"
);
updatedIndex++;
}
currentIndex = updatedIndex;
_afterTokenTransfers(address(0), to, startTokenId, quantity);
}
function _transfer(
address from,
address to,
uint256 tokenId
) private {
TokenOwnership memory prevOwnership = ownershipOf(tokenId);
bool isApprovedOrOwner = (_msgSender() == prevOwnership.addr ||
getApproved(tokenId) == _msgSender() ||
isApprovedForAll(prevOwnership.addr, _msgSender()));
require(
isApprovedOrOwner,
"ERC721A: transfer caller is not owner nor approved"
);
require(
prevOwnership.addr == from,
"ERC721A: transfer from incorrect owner"
);
require(to != address(0), "ERC721A: transfer to the zero address");
_beforeTokenTransfers(from, to, tokenId, 1);
_approve(address(0), tokenId, prevOwnership.addr);
_addressData[from].balance -= 1;
_addressData[to].balance += 1;
_ownerships[tokenId] = TokenOwnership(to, uint64(block.timestamp));
uint256 nextTokenId = tokenId + 1;
if (_ownerships[nextTokenId].addr == address(0)) {
if (_exists(nextTokenId)) {
_ownerships[nextTokenId] = TokenOwnership(
prevOwnership.addr,
prevOwnership.startTimestamp
);
}
}
emit Transfer(from, to, tokenId);
_afterTokenTransfers(from, to, tokenId, 1);
}
function _approve(
address to,
uint256 tokenId,
address owner
) private {
_tokenApprovals[tokenId] = to;
emit Approval(owner, to, tokenId);
}
uint256 public nextOwnerToExplicitlySet = 0;
function _setOwnersExplicit(uint256 quantity) internal {
uint256 oldNextOwnerToSet = nextOwnerToExplicitlySet;
require(quantity > 0, "quantity must be nonzero");
uint256 endIndex = oldNextOwnerToSet + quantity - 1;
if (endIndex > collectionSize - 1) {
endIndex = collectionSize - 1;
}
require(_exists(endIndex), "not enough minted yet for this cleanup");
for (uint256 i = oldNextOwnerToSet; i <= endIndex; i++) {
if (_ownerships[i].addr == address(0)) {
TokenOwnership memory ownership = ownershipOf(i);
_ownerships[i] = TokenOwnership(
ownership.addr,
ownership.startTimestamp
);
}
}
nextOwnerToExplicitlySet = endIndex + 1;
}
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(to).onERC721Received.selector;
} catch (bytes memory reason) {
if (reason.length == 0) {
revert("ERC721A: transfer to non ERC721Receiver implementer");
} else {
assembly {
revert(add(32, reason), mload(reason))
}
}
}
} else {
return true;
}
}
function _beforeTokenTransfers(
address from,
address to,
uint256 startTokenId,
uint256 quantity
) internal virtual {}
function _afterTokenTransfers(
address from,
address to,
uint256 startTokenId,
uint256 quantity
) internal virtual {}
}
文件 5 的 14:GaucheBase.sol
pragma solidity =0.8.11;
import "./LibGauche.sol";
import "./ERC721A.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
abstract contract GaucheBase is ERC721A, Ownable {
address public artistAddress;
address public developerAddress;
GaucheSale internal sale;
mapping(uint256 => bool) public accessTokenUsed;
string internal ContractURI = "https://neophorion.art/api/projects/GaucheGrimoire/contractURI";
event SaleStateChanged(SalesState state);
constructor(
string memory _tokenName,
string memory _tokenSymbol,
uint64 _pricePerToken,
address _accessTokenAddress,
address _artistAddress,
address _developerAddress
) ERC721A(_tokenName, _tokenSymbol, 10, 3333) {
sale = GaucheSale(SalesState.Closed, 0x0BB9, _pricePerToken, _accessTokenAddress);
artistAddress = _artistAddress;
developerAddress = _developerAddress;
}
modifier onlyIfTokenOwner(uint256 _tokenId) {
_checkTokenOwner(_tokenId);
_;
}
modifier isMode(SalesState _mode) {
_checkMode(_mode);
_;
}
modifier isNotMode(SalesState _mode) {
_checkNotMode(_mode);
_;
}
function multiMint(uint256 _count) public payable isMode(SalesState.Active) returns (uint256[] memory _tokenIds) {
uint256 price = sale.pricePerToken * _count;
require(msg.value >= price, "GG: Ether amount is under set price");
require(_count >= 1, "GG: Token count must be 1 or more");
require(totalSupply() < sale.maxPublicTokens, "GG: Max tokens reached");
return _mintToken(_msgSender(), _count, true);
}
function mint(uint256 _count) public payable isMode(SalesState.Active) returns (uint256[] memory _tokenIds) {
uint256 price = sale.pricePerToken * _count;
require(msg.value >= price, "Ether amount is under set price");
require(_count >= 1, "GG: Min Lvl 1");
require(_count <= 255, "GG: Max 255 lvl");
require(totalSupply() + _count < sale.maxPublicTokens, "GG: Max tokens reached");
return _mintToken(_msgSender(), _count, false);
}
function mintAccessToken(uint256 _tokenId) isMode(SalesState.AccessToken) public payable returns (uint256[] memory _tokenIds) {
require(msg.value >= sale.pricePerToken, "Ether amount is under set price");
IERC721 accessToken = IERC721(sale.accessTokenAddress);
require(accessToken.ownerOf(_tokenId) == _msgSender(), "Access token not owned");
require(accessTokenUsed[_tokenId] == false, "Access token already used");
accessTokenUsed[_tokenId] = true;
return _mintToken(_msgSender(), 3, false);
}
function reservedMint() isMode(SalesState.Closed) onlyOwner public returns (uint256[] memory _tokenIds) {
require(totalSupply() < 20, "GG: Must be less than 20");
_mintToken(owner(), 1, false);
_mintToken(artistAddress, 10, false);
_mintToken(developerAddress, 10, false);
_mintToken(owner(), 10, true);
_mintToken(owner(), 7, true);
}
function checkIfAccessTokenIsUsed(uint256 _tokenId) public view returns (bool) {
return accessTokenUsed[_tokenId];
}
function getSaleState() public view returns(uint) {
return uint(sale.saleState);
}
function contractURI() public view returns (string memory) {
return ContractURI;
}
function withdrawFunds() public onlyOwner {
uint256 share = address(this).balance / 20;
uint256 artistPayout = share * 13;
uint256 developerPayout = share * 7;
if (artistPayout > 0) {
(bool sent, bytes memory data) = payable(artistAddress).call{value: artistPayout}("");
require(sent, "Failed to send Ether");
}
if (developerPayout > 0) {
(bool sent, bytes memory data) = payable(developerAddress).call{value: developerPayout}("");
require(sent, "Failed to send Ether");
}
}
function updateSaleState(SalesState _state) public onlyOwner {
require(sale.saleState != SalesState.Finalized, "GB: Can't change state if Finalized");
require( _state > sale.saleState, "GB: Can't reverse state");
sale.saleState = _state;
emit SaleStateChanged(_state);
}
function updateContractURI(string memory _contractURI) public onlyOwner {
ContractURI = _contractURI;
}
function updateArtistAddress(address _artistAddress) public {
require(msg.sender == artistAddress, "GB: Only artist");
artistAddress = _artistAddress;
}
function updateDeveloperAddress(address _developerAddress) public {
require(msg.sender == developerAddress, "GB: Only dev");
developerAddress = _developerAddress;
}
function _checkMode(SalesState _mode) internal view {
require(_mode == sale.saleState ,"GG: Contract must be in matching mode");
}
function _checkNotMode(SalesState _mode) internal view {
require(_mode != sale.saleState ,"GG: Contract must not be in matching mode");
}
function _checkTokenOwner(uint256 _tokenId) internal view {
require(ERC721A.ownerOf(_tokenId) == _msgSender(),"ERC721: Must own token to call this function");
}
function _mintToken(address _toAddress, uint256 _count, bool _batch) internal virtual returns (uint256[] memory _tokenId);
}
文件 6 的 14:GaucheGrimoire.sol
pragma solidity =0.8.11;
import "./GaucheBase.sol";
import "./LibGauche.sol";
import "@openzeppelin/contracts/utils/Strings.sol";
contract GaucheGrimoire is GaucheBase {
uint256 constant internal MAX_LEVEL = 255;
event WordAdded(uint256 indexed tokenId, bytes32 wordHash, uint256 offsetSlot, uint256 level);
event HashUpdated(uint256 indexed tokenId, bytes32 hash);
event ProjectAdded(uint256 indexed projectId, GaucheLevel project);
event ProjectUpdated(uint256 indexed projectId, GaucheLevel project);
event TokenBurned(uint256 indexed tokenId);
mapping(uint256 => bytes32) public tokenHashes;
GaucheLevel[] public gaucheLevels;
address constant internal burnAddress = 0x000000000000000000000000000000000000dEaD;
constructor(
string memory _tokenName,
string memory _tokenSymbol,
string memory _baseURI,
uint64 _pricePerToken,
address _accessTokenAddress,
address _artistAddress,
address _developerAddress
) GaucheBase(_tokenName, _tokenSymbol, _pricePerToken, _accessTokenAddress, _artistAddress, _developerAddress) {
gaucheLevels.push(GaucheLevel(1, _pricePerToken, artistAddress, "https://neophorion.art/api/projects/GaucheGrimoire/metadata/"));
}
modifier notNullWord(bytes32 _wordHash) {
checkNotNullWord(_wordHash);
_;
}
modifier mustBeBelowMaxLevel(uint256 _tokenId) {
checkMaxLevel(_tokenId);
_;
}
modifier tokenExists(uint256 _tokenId) {
checkTokenExists(_tokenId);
_;
}
function getProjectDetails(uint256 _projectId) public view returns (GaucheLevel memory _project) {
require(_projectId < gaucheLevels.length, "GG: Must be in range of projects");
_project = gaucheLevels[_projectId];
return _project;
}
function getProjectLevel() public view returns (uint256) {
return gaucheLevels.length;
}
function addProject(uint8 _wordPrice, uint64 _price, address _artistAddress, string memory _tokenURI) onlyOwner public {
require(gaucheLevels.length < MAX_LEVEL, "GG: Max 255");
GaucheLevel memory project = GaucheLevel(_wordPrice, _price, _artistAddress, _tokenURI);
emit ProjectAdded(gaucheLevels.length, project);
gaucheLevels.push(project);
}
function editProject(uint256 _projectId, uint8 _wordPrice, uint64 _price, address _artistAddress, string memory _tokenURI) onlyOwner public {
require( _projectId < gaucheLevels.length, "GG: Must be in range");
GaucheLevel memory project = GaucheLevel(_wordPrice, _price, _artistAddress, _tokenURI);
emit ProjectUpdated(_projectId, project);
gaucheLevels[_projectId] = project;
}
function spendRealityChange(uint256 _tokenToChange, bytes32 _wordHash)
onlyIfTokenOwner(_tokenToChange)
isNotMode(SalesState.Finalized)
notNullWord(_wordHash)
mustBeBelowMaxLevel(_tokenToChange)
public payable {
uint256 tokenLevel = getLevel(_tokenToChange);
GaucheLevel memory project = gaucheLevels[tokenLevel];
require(getFree(_tokenToChange) >= project.wordPrice, "GG: No free lvl");
require(msg.value >= project.price, "GG: Too cheap");
_changeReality(_tokenToChange, _wordHash, tokenLevel, project.wordPrice);
}
function burnIntoToken(uint256 _tokenToBurn, uint256 _tokenToChange)
onlyIfTokenOwner(_tokenToBurn)
onlyIfTokenOwner(_tokenToChange)
mustBeBelowMaxLevel(_tokenToChange)
isMode(SalesState.Maintenance)
public {
uint256 burntTokenFree = getFree(_tokenToBurn);
uint256 tokenTotalFreeLevels = getFree(_tokenToChange);
require(tokenTotalFreeLevels + burntTokenFree + 1 <= 255, "GG: Max 255");
bytes32 newHash = bytes32((uint256(tokenHashes[_tokenToChange]) + uint(0x01) + burntTokenFree));
tokenHashes[_tokenToChange] = newHash;
emit HashUpdated(_tokenToChange, newHash);
_burn(msg.sender, _tokenToBurn);
}
function verifyTruth(uint256 _tokenId, uint256 _level, string calldata _word)
tokenExists(_tokenId)
public view returns (bool answer) {
require(_level < tokenLevel(_tokenId) && _level != 0, "GG: Word slot out of bounds");
bytes32 word = tokenHashes[getShifted(_tokenId) + _level];
bytes32 assertedTruth = keccak256(abi.encodePacked(_word));
return (word == assertedTruth);
}
function tokenURI(uint256 tokenId)
tokenExists(tokenId)
public view virtual override returns (string memory) {
GaucheLevel memory project = gaucheLevels[0];
require(bytes(project.baseURI).length != 0, "GG: No base URI");
return string(abi.encodePacked(project.baseURI, Strings.toString(tokenId)));
}
function tokenProjectURI(uint256 _tokenId, uint256 _projectId)
tokenExists(_tokenId)
public view returns (string memory tokenURI) {
require(_projectId < gaucheLevels.length, "GG: Must be within project range");
require(tokenHashes[_tokenId] != 0, "GG: Token not found");
require(_projectId < getLevel(_tokenId) , "GG: Level too low");
tokenURI = string(abi.encodePacked(gaucheLevels[_projectId].baseURI, Strings.toString(_tokenId)));
return tokenURI;
}
function tokenFullData(uint256 _tokenId)
public view returns (GaucheToken memory token) {
return GaucheToken(_tokenId, getFree(_tokenId), getLevel(_tokenId), getBurned(_tokenId), getOwnedHashes(_tokenId));
}
function tokenHash(uint256 _tokenId)
tokenExists(_tokenId)
public view returns (bytes32) {
return tokenHashes[_tokenId];
}
function tokenProjectHash(uint256 _tokenId, uint256 _level)
tokenExists(_tokenId)
public view returns (bytes32) {
require(_level != 0, "GG: Level must be non-zero");
require(getLevel(_tokenId) > _level , "GG: Level too low");
return tokenHashes[getShifted(_tokenId) + _level];
}
function tokenBurned(uint256 _tokenId) public view returns (bool _burned) {
return getBurned(_tokenId);
}
function tokenHashesOwned(uint256 _tokenId)
tokenExists(_tokenId)
public view returns (bytes32[] memory ownedHashes) {
return getOwnedHashes(_tokenId);
}
function tokenFreeChanges(uint256 _tokenId)
tokenExists(_tokenId)
public view returns (uint) {
return getFree(_tokenId);
}
function tokenLevel(uint256 _tokenId)
tokenExists(_tokenId)
public view returns (uint) {
return getLevel(_tokenId);
}
function getBurnedCount() public view returns(uint256) {
return balanceOf(burnAddress);
}
function getTotalSupply() public view returns(uint256) {
return totalSupply() - getBurnedCount();
}
function getShifted(uint256 _tokenId) internal view returns(uint256) {
return (_tokenId << 16);
}
function checkNotNullWord(bytes32 _wordHash) internal view {
require(_wordHash != 0x0, "GG: Cannot insert a null word");
}
function checkMaxLevel(uint256 _tokenId) internal view {
require(getLevel(_tokenId) < gaucheLevels.length , "GG: Max level reached");
}
function getFree(uint256 _tokenId) internal view returns(uint256) {
uint256 free = uint256(tokenHashes[_tokenId]) & 0xFF;
return free;
}
function getLevel(uint256 _tokenId) internal view returns(uint256) {
uint256 level = uint256(tokenHashes[_tokenId]) & 0xFF00;
return level >> 8;
}
function getBurned(uint256 _tokenId) internal view returns(bool) {
return (ownerOf(_tokenId) == burnAddress ? true : false);
}
function getOwnedHashes(uint256 _tokenId) internal view returns(bytes32[] memory ownedHashes) {
uint256 tokenShiftedId = getShifted(_tokenId);
uint256 tokenLevel = getLevel(_tokenId);
ownedHashes = new bytes32[](tokenLevel);
ownedHashes[0] = tokenHashes[_tokenId];
for (uint256 i = 1; i < tokenLevel; i++) {
ownedHashes[i] = tokenHashes[tokenShiftedId + i];
}
return ownedHashes;
}
function checkTokenExists(uint256 _tokenId) internal view returns (bool) {
require(_exists(_tokenId) && ownerOf(_tokenId) != burnAddress, "GG: Token does not exist");
}
function _mintToken(address _toAddress, uint256 _count, bool _batch) internal override returns (uint256[] memory _tokenIds) {
uint256 currentSupply = totalSupply();
if (_batch) {
_safeMint(_toAddress, _count);
_tokenIds = new uint256[](_count);
} else {
_safeMint(_toAddress, 1);
_tokenIds = new uint256[](1);
}
for(uint256 i = 0; i < _count; i++) {
uint256 tokenId = currentSupply + i;
bytes32 level0hash = bytes32( ( uint256(keccak256(abi.encodePacked(block.number, _msgSender(), tokenId)) & 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00000000000000000000) + uint(0x0100) + ( _batch ? uint(0x01) : _count) ) );
tokenHashes[tokenId] = level0hash;
emit HashUpdated(tokenId, level0hash);
_tokenIds[i] = tokenId;
if(!_batch) {
break;
}
}
return _tokenIds;
}
function _changeReality(uint256 _tokenId, bytes32 _wordHash, uint256 _newSlot, uint256 _levelWordPrice) internal {
uint256 wordSlot = getShifted(_tokenId) +_newSlot;
tokenHashes[wordSlot] = _wordHash;
bytes32 levelZeroHash = bytes32((((uint256(tokenHashes[_tokenId]) + uint(0x0100) )- _levelWordPrice)));
tokenHashes[_tokenId] = levelZeroHash;
emit WordAdded(_tokenId, _wordHash, _newSlot, wordSlot);
emit HashUpdated(_tokenId, levelZeroHash);
}
function _burn(address owner, uint256 tokenId) internal virtual {
transferFrom(owner, burnAddress, tokenId);
emit TokenBurned(tokenId);
}
}
文件 7 的 14:IERC165.sol
pragma solidity ^0.8.0;
interface IERC165 {
function supportsInterface(bytes4 interfaceId) external view returns (bool);
}
文件 8 的 14:IERC721.sol
pragma solidity ^0.8.0;
import "../../utils/introspection/IERC165.sol";
interface IERC721 is IERC165 {
event Transfer(address indexed from, address indexed to, uint256 indexed tokenId);
event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId);
event ApprovalForAll(address indexed owner, address indexed operator, bool approved);
function balanceOf(address owner) external view returns (uint256 balance);
function ownerOf(uint256 tokenId) external view returns (address owner);
function safeTransferFrom(
address from,
address to,
uint256 tokenId
) external;
function transferFrom(
address from,
address to,
uint256 tokenId
) external;
function approve(address to, uint256 tokenId) external;
function getApproved(uint256 tokenId) external view returns (address operator);
function setApprovalForAll(address operator, bool _approved) external;
function isApprovedForAll(address owner, address operator) external view returns (bool);
function safeTransferFrom(
address from,
address to,
uint256 tokenId,
bytes calldata data
) external;
}
文件 9 的 14:IERC721Enumerable.sol
pragma solidity ^0.8.0;
import "../IERC721.sol";
interface IERC721Enumerable is IERC721 {
function totalSupply() external view returns (uint256);
function tokenOfOwnerByIndex(address owner, uint256 index) external view returns (uint256 tokenId);
function tokenByIndex(uint256 index) external view returns (uint256);
}
文件 10 的 14: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);
}
文件 11 的 14:IERC721Receiver.sol
pragma solidity ^0.8.0;
interface IERC721Receiver {
function onERC721Received(
address operator,
address from,
uint256 tokenId,
bytes calldata data
) external returns (bytes4);
}
文件 12 的 14:LibGauche.sol
pragma solidity =0.8.11;
enum SalesState {
Closed,
Active,
AccessToken,
Maintenance,
Finalized
}
struct GaucheSale {
SalesState saleState;
uint16 maxPublicTokens;
uint64 pricePerToken;
address accessTokenAddress;
}
struct GaucheToken {
uint256 tokenId;
uint256 free;
uint256 spent;
bool burned;
bytes32[] ownedHashes;
}
struct GaucheLevel {
uint8 wordPrice;
uint64 price;
address artistAddress;
string baseURI;
}
文件 13 的 14: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);
}
}
文件 14 的 14: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);
}
}
{
"compilationTarget": {
"contracts/GaucheGrimoire.sol": "GaucheGrimoire"
},
"evmVersion": "london",
"libraries": {},
"metadata": {
"bytecodeHash": "ipfs"
},
"optimizer": {
"enabled": true,
"runs": 100
},
"remappings": []
}
[{"inputs":[{"internalType":"string","name":"_tokenName","type":"string"},{"internalType":"string","name":"_tokenSymbol","type":"string"},{"internalType":"string","name":"_baseURI","type":"string"},{"internalType":"uint64","name":"_pricePerToken","type":"uint64"},{"internalType":"address","name":"_accessTokenAddress","type":"address"},{"internalType":"address","name":"_artistAddress","type":"address"},{"internalType":"address","name":"_developerAddress","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"approved","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"operator","type":"address"},{"indexed":false,"internalType":"bool","name":"approved","type":"bool"}],"name":"ApprovalForAll","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"},{"indexed":false,"internalType":"bytes32","name":"hash","type":"bytes32"}],"name":"HashUpdated","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":"projectId","type":"uint256"},{"components":[{"internalType":"uint8","name":"wordPrice","type":"uint8"},{"internalType":"uint64","name":"price","type":"uint64"},{"internalType":"address","name":"artistAddress","type":"address"},{"internalType":"string","name":"baseURI","type":"string"}],"indexed":false,"internalType":"struct GaucheLevel","name":"project","type":"tuple"}],"name":"ProjectAdded","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"projectId","type":"uint256"},{"components":[{"internalType":"uint8","name":"wordPrice","type":"uint8"},{"internalType":"uint64","name":"price","type":"uint64"},{"internalType":"address","name":"artistAddress","type":"address"},{"internalType":"string","name":"baseURI","type":"string"}],"indexed":false,"internalType":"struct GaucheLevel","name":"project","type":"tuple"}],"name":"ProjectUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"enum SalesState","name":"state","type":"uint8"}],"name":"SaleStateChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"TokenBurned","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"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"},{"indexed":false,"internalType":"bytes32","name":"wordHash","type":"bytes32"},{"indexed":false,"internalType":"uint256","name":"offsetSlot","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"level","type":"uint256"}],"name":"WordAdded","type":"event"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"accessTokenUsed","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint8","name":"_wordPrice","type":"uint8"},{"internalType":"uint64","name":"_price","type":"uint64"},{"internalType":"address","name":"_artistAddress","type":"address"},{"internalType":"string","name":"_tokenURI","type":"string"}],"name":"addProject","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":[],"name":"artistAddress","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","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":"_tokenToBurn","type":"uint256"},{"internalType":"uint256","name":"_tokenToChange","type":"uint256"}],"name":"burnIntoToken","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_tokenId","type":"uint256"}],"name":"checkIfAccessTokenIsUsed","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"contractURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"developerAddress","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_projectId","type":"uint256"},{"internalType":"uint8","name":"_wordPrice","type":"uint8"},{"internalType":"uint64","name":"_price","type":"uint64"},{"internalType":"address","name":"_artistAddress","type":"address"},{"internalType":"string","name":"_tokenURI","type":"string"}],"name":"editProject","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"gaucheLevels","outputs":[{"internalType":"uint8","name":"wordPrice","type":"uint8"},{"internalType":"uint64","name":"price","type":"uint64"},{"internalType":"address","name":"artistAddress","type":"address"},{"internalType":"string","name":"baseURI","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"getApproved","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getBurnedCount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_projectId","type":"uint256"}],"name":"getProjectDetails","outputs":[{"components":[{"internalType":"uint8","name":"wordPrice","type":"uint8"},{"internalType":"uint64","name":"price","type":"uint64"},{"internalType":"address","name":"artistAddress","type":"address"},{"internalType":"string","name":"baseURI","type":"string"}],"internalType":"struct GaucheLevel","name":"_project","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getProjectLevel","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getSaleState","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getTotalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"operator","type":"address"}],"name":"isApprovedForAll","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_count","type":"uint256"}],"name":"mint","outputs":[{"internalType":"uint256[]","name":"_tokenIds","type":"uint256[]"}],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_tokenId","type":"uint256"}],"name":"mintAccessToken","outputs":[{"internalType":"uint256[]","name":"_tokenIds","type":"uint256[]"}],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_count","type":"uint256"}],"name":"multiMint","outputs":[{"internalType":"uint256[]","name":"_tokenIds","type":"uint256[]"}],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"nextOwnerToExplicitlySet","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"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":[],"name":"reservedMint","outputs":[{"internalType":"uint256[]","name":"_tokenIds","type":"uint256[]"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"bytes","name":"_data","type":"bytes"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"operator","type":"address"},{"internalType":"bool","name":"approved","type":"bool"}],"name":"setApprovalForAll","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_tokenToChange","type":"uint256"},{"internalType":"bytes32","name":"_wordHash","type":"bytes32"}],"name":"spendRealityChange","outputs":[],"stateMutability":"payable","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":"tokenBurned","outputs":[{"internalType":"bool","name":"_burned","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"index","type":"uint256"}],"name":"tokenByIndex","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_tokenId","type":"uint256"}],"name":"tokenFreeChanges","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_tokenId","type":"uint256"}],"name":"tokenFullData","outputs":[{"components":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"uint256","name":"free","type":"uint256"},{"internalType":"uint256","name":"spent","type":"uint256"},{"internalType":"bool","name":"burned","type":"bool"},{"internalType":"bytes32[]","name":"ownedHashes","type":"bytes32[]"}],"internalType":"struct GaucheToken","name":"token","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_tokenId","type":"uint256"}],"name":"tokenHash","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"tokenHashes","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_tokenId","type":"uint256"}],"name":"tokenHashesOwned","outputs":[{"internalType":"bytes32[]","name":"ownedHashes","type":"bytes32[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_tokenId","type":"uint256"}],"name":"tokenLevel","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"uint256","name":"index","type":"uint256"}],"name":"tokenOfOwnerByIndex","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_tokenId","type":"uint256"},{"internalType":"uint256","name":"_level","type":"uint256"}],"name":"tokenProjectHash","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_tokenId","type":"uint256"},{"internalType":"uint256","name":"_projectId","type":"uint256"}],"name":"tokenProjectURI","outputs":[{"internalType":"string","name":"tokenURI","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":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"transferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_artistAddress","type":"address"}],"name":"updateArtistAddress","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"_contractURI","type":"string"}],"name":"updateContractURI","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_developerAddress","type":"address"}],"name":"updateDeveloperAddress","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"enum SalesState","name":"_state","type":"uint8"}],"name":"updateSaleState","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_tokenId","type":"uint256"},{"internalType":"uint256","name":"_level","type":"uint256"},{"internalType":"string","name":"_word","type":"string"}],"name":"verifyTruth","outputs":[{"internalType":"bool","name":"answer","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"withdrawFunds","outputs":[],"stateMutability":"nonpayable","type":"function"}]