文件 1 的 16:AOToken.sol
pragma solidity ^0.8.9;
import { Strings } from "@openzeppelin/contracts/utils/Strings.sol";
import { Ownable } from "@openzeppelin/contracts/access/Ownable.sol";
import { ERC721Enumerable, ERC721 } from "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol";
import { VRFConsumerBase } from "@chainlink/contracts/src/v0.8/VRFConsumerBase.sol";
contract AOToken is Ownable, ERC721Enumerable, VRFConsumerBase {
using Strings for uint8;
using Strings for uint16;
struct TokenInfo {
uint8 ball_type;
uint8 pattern;
uint8 wrap;
uint8 overlay;
uint8 rally;
uint8 colour;
uint8 scheme;
uint8 logo;
uint8 shot;
uint8 coord_x;
uint8 coord_y;
uint16[] winnings;
string uri;
}
address public constant VRF_COORDINATOR_ADDRESS = 0xf0d54349aDdcf704F77AE15b96510dEA15cb7952;
address public constant LINK_ADDRESS = 0x514910771AF9Ca656af840dff83E8264EcF986CA;
bytes32 public constant VRF_KEY_HASH = 0xAA77729D3466CA35AE8D28B3BBAC7CC36A5031EFDC430821C02BC31A238AF445;
uint256 public constant VRF_FEE = 2 * (10 ** 18);
uint16 public constant MAX_SALE_SUPPLY = 6726;
uint16 public constant MAX_WHITELIST_SALE_SUPPLY = 300;
uint16 public constant MAX_PRESALE_SUPPLY = 3388;
uint256 public constant BUY_PRICE = 0.067 ether;
string[3] public BALL_TYPE = ['Generative', 'Artist', 'Legend'];
string[8] public PATTERN = ['Block', 'Sweetspot', 'Love All', 'Line Call', 'Quiet Please', 'Smash', 'Crikey', 'Heatwave'];
string[5] public WRAP = ['None', 'Small', 'Medium', 'Large', 'Flow'];
string[5] public OVERLAY = ['None', 'Delete', 'Fade', 'Loop', 'Mosaic'];
string[6] public RALLY = ['Love', '15', '30', '40', 'Deuce', 'Advantage'];
string[2] public COLOUR = ['AO Blue', 'AO Green'];
string[8] public SCHEME = ['Shade', 'Tint', 'Complimentary', 'Complimentary Shade', 'Complimentary Tint', 'Analogous', 'Triadic', 'Tetradic'];
string[2] public LOGO = ['White', 'Black'];
string[7] public SHOT = ['Ace', 'Fault', 'Topspin', 'Slice', 'Volley', 'Lob', 'Forehand'];
bool public saleActive;
bool public presaleActive;
bool public revealed;
bool public seeded;
bool public enableTokenURI;
uint16 public whitelistClaimed;
uint16 public presaleClaimed;
uint16 public publicClaimed;
uint16 public boundary = 6776;
uint256 public seedNumber;
string public baseURI;
string public provenance;
mapping(uint16 => uint16) randoms;
mapping(uint16 => TokenInfo) public tokens;
mapping(address => bool) public whitelist;
mapping(uint16 => string) public legendPattern;
mapping(uint16 => string) public artist;
constructor() ERC721("AO Art Ball", "ARTB") VRFConsumerBase(VRF_COORDINATOR_ADDRESS, LINK_ADDRESS) {}
function getRandomNumber() external onlyOwner returns (bytes32 requestId) {
require(LINK.balanceOf(address(this)) >= VRF_FEE, "Not enough LINK.");
return requestRandomness(VRF_KEY_HASH, VRF_FEE);
}
function fulfillRandomness(bytes32, uint256 randomness) internal override {
seedNumber = randomness;
seeded = true;
}
function claim(uint16 _amount) external payable {
require(saleActive, "Not active");
require(tx.origin == msg.sender, "Not allowed");
require(balanceOf(msg.sender) + _amount <= 5, "Exceed max");
require(_amount <= 5, "Exceed max");
require(publicClaimed + whitelistClaimed + presaleClaimed + _amount <= MAX_SALE_SUPPLY, "Exceed total");
require(msg.value >= _amount * BUY_PRICE, "Ether value incorrect");
for (uint16 i = 0; i < _amount; i++) {
_mintRandomToken(msg.sender);
}
publicClaimed += _amount;
}
function metakeyEligible() public view returns (bool) {
IMetaKey metakey = IMetaKey(0x10DaA9f4c0F985430fdE4959adB2c791ef2CCF83);
return metakey.balanceOf(msg.sender, 10004) > 0 ||
metakey.balanceOf(msg.sender, 10003) > 0 ||
metakey.balanceOf(msg.sender, 2) > 0 ||
metakey.balanceOf(msg.sender, 1) > 0;
}
function eligiblePresale() public view returns(bool) {
return metakeyEligible() || (whitelist[msg.sender] && whitelistClaimed < MAX_WHITELIST_SALE_SUPPLY);
}
function presaleClaim() external payable {
require(presaleActive, "Not active");
require(tx.origin == msg.sender, "Not allowed");
require(eligiblePresale(), "Not eligible");
require(balanceOf(msg.sender) == 0, "Exceed max");
require(msg.value >= 1 * BUY_PRICE, "Ether value incorrect.");
if (whitelist[msg.sender] && whitelistClaimed < MAX_WHITELIST_SALE_SUPPLY) {
_mintRandomToken(msg.sender);
whitelistClaimed++;
whitelist[msg.sender] = false;
}
else if (metakeyEligible()) {
require(presaleClaimed + 1 <= MAX_PRESALE_SUPPLY, "Exceeds total presale.");
_mintRandomToken(msg.sender);
presaleClaimed++;
}
}
function _mintRandomToken(address _to) internal {
require(seeded, "Need VRF seed");
uint16 index = uint16(uint256(keccak256(abi.encodePacked(seedNumber, block.timestamp, _to, block.number, totalSupply(), address(this)))) % boundary) + 1;
uint16 tokenId = randoms[index] > 0 ? randoms[index] - 1 : index - 1;
randoms[index] = randoms[boundary] > 0 ? randoms[boundary] : boundary;
boundary -= 1;
_safeMint(_to, tokenId);
}
function getTokenWinnings(uint256 _tokenId) public view returns (uint16[] memory) {
require(_exists(_tokenId), "Token does not exist");
return tokens[uint16(_tokenId)].winnings;
}
function commonAttributes(uint256 _tokenId) internal view returns (string memory) {
TokenInfo memory ball = tokens[uint16(_tokenId)];
return string(abi.encodePacked(
'{"trait_type":"Plot No","value":"', uint16(_tokenId + 1).toString(), '"},'
'{"trait_type":"X Coordinate","value":"', ball.coord_x.toString(), '"},',
'{"trait_type":"Y Coordinate","value":"', ball.coord_y.toString(), '"},',
'{"trait_type":"Ball Type","value":"', BALL_TYPE[ball.ball_type % 3], '"}'
));
}
function genericAttributes(uint256 _tokenId) internal view returns (string memory) {
TokenInfo memory ball = tokens[uint16(_tokenId)];
return string(abi.encodePacked(
string(abi.encodePacked(
'{"trait_type":"Pattern","value":"', PATTERN[ball.pattern], '"},',
'{"trait_type":"Wrap","value":"', WRAP[ball.wrap], '"},',
'{"trait_type":"Overlay","value":"', OVERLAY[ball.overlay], '"},',
'{"trait_type":"Rally","value":"', RALLY[ball.rally], '"},'
)),
string(abi.encodePacked(
'{"trait_type":"Colour","value":"', COLOUR[ball.colour], '"},',
'{"trait_type":"Scheme","value":"', SCHEME[ball.scheme], '"},',
'{"trait_type":"Logo","value":"', LOGO[ball.logo], '"},',
'{"trait_type":"Shot","value":"', SHOT[ball.shot], '"}'
))
));
}
function legendAttributes(uint256 _tokenId) internal view returns (string memory) {
return string(abi.encodePacked('{"trait_type":"Legendary Pattern","value":"', legendPattern[uint16(_tokenId)], '"}'));
}
function artistAttributes(uint256 _tokenId) internal view returns (string memory) {
return string(abi.encodePacked('{"trait_type":"Artist","value":"', artist[uint16(_tokenId)], '"}'));
}
function getAttributes(uint256 _tokenId) public view returns (string memory) {
require(_exists(_tokenId), "Token does not exist");
function(uint256) internal view returns (string memory)[3] memory options = [
genericAttributes,
artistAttributes,
legendAttributes
];
return string(abi.encodePacked(
'[', commonAttributes(_tokenId), ',',
options[tokens[uint16(_tokenId)].ball_type % 3](_tokenId),
']'
));
}
function tokenURI(uint256 _tokenId) public view virtual override returns (string memory) {
require(_exists(_tokenId), "URI query for non exists token.");
if (!revealed) {
return 'ipfs://QmUMeAJdjrZYcaLbCRDF35MBXa1LdEPpt6RziwhTAbpgA4';
}
uint16 tokenId = uint16(_tokenId);
if (bytes(tokens[tokenId].uri).length > 0 && enableTokenURI) {
return string(abi.encodePacked(tokens[tokenId].uri, tokenId.toString()));
}
return string(abi.encodePacked(baseURI, tokenId.toString()));
}
function teamClaim() external onlyOwner {
for (uint16 i = 0; i < 5; i++) {
_mintRandomToken(0x6b37Ca573f0A877F342434236721D1eE6CE83bb1);
}
for (uint16 i = 0; i < 15; i++) {
_mintRandomToken(0x5151FCF0ED173426d9D095367360Be58F1AE7993);
}
for (uint16 i = 0; i < 15; i++) {
_mintRandomToken(0x01cE3D2A58c85983Ab6f40e1f05B6f7EceC3f379);
}
for (uint16 i = 0; i < 15; i++) {
_mintRandomToken(0x3c02bA1b4E3149e34880f7bf39C61087B4262a18);
}
}
function addWhitelist(address[] calldata _accounts, bool _status) external onlyOwner {
for (uint256 i = 0; i < _accounts.length; i++) {
whitelist[_accounts[i]] = _status;
}
}
function setProvenance(string calldata _provenance) external onlyOwner {
provenance = _provenance;
}
function toggleActive() external onlyOwner {
saleActive = !saleActive;
}
function togglePresaleActive() external onlyOwner {
presaleActive = !presaleActive;
}
function toggleTokenURI() external onlyOwner {
enableTokenURI = !enableTokenURI;
}
function toggleReveal() external onlyOwner {
revealed = !revealed;
}
function setBaseURI(string calldata _uri) external onlyOwner {
baseURI = _uri;
}
function setTokenBaseURI(uint16[] calldata _tokenIds, string calldata _uri) external onlyOwner {
for (uint16 i = 0; i < _tokenIds.length; i++) {
tokens[_tokenIds[i]].uri = _uri;
}
}
function setTokenWinnings(uint16[] calldata _tokenIds, uint16[][] calldata _winnings) external onlyOwner {
require(_tokenIds.length == _winnings.length, "Input data mismatch.");
for (uint16 i = 0; i < _tokenIds.length; i++) {
tokens[_tokenIds[i]].winnings = _winnings[i];
}
}
function addTokenWinnings(uint16[] calldata _tokenIds, uint16[] calldata _winnings) external onlyOwner {
require(_tokenIds.length == _winnings.length, "Input data mismatch.");
for (uint16 i = 0; i < _tokenIds.length; i++) {
tokens[_tokenIds[i]].winnings.push(_winnings[i]);
}
}
function updateLegendToken(uint16[] calldata _tokenIds, uint8[2][] calldata _attributes, string[] calldata _pattern) external onlyOwner {
require(_tokenIds.length == _attributes.length, "Input mismatch.");
require(_tokenIds.length == _pattern.length, "Input mismatch.");
for (uint16 i = 0; i < _tokenIds.length; i++) {
tokens[_tokenIds[i]].ball_type = 2;
tokens[_tokenIds[i]].coord_x = _attributes[i][0];
tokens[_tokenIds[i]].coord_y = _attributes[i][1];
legendPattern[_tokenIds[i]] = _pattern[i];
}
}
function updateArtistToken(uint16[] calldata _tokenIds, uint8[2][] calldata _attributes, string[] calldata _artist) external onlyOwner {
require(_tokenIds.length == _attributes.length, "Input mismatch.");
require(_tokenIds.length == _artist.length, "Input mismatch.");
for (uint16 i = 0; i < _tokenIds.length; i++) {
tokens[_tokenIds[i]].ball_type = 1;
tokens[_tokenIds[i]].coord_x = _attributes[i][0];
tokens[_tokenIds[i]].coord_y = _attributes[i][1];
artist[_tokenIds[i]] = _artist[i];
}
}
function updateGenerativeToken(uint16[] calldata _tokenIds, uint8[10][] calldata _attributes) external onlyOwner {
require(_tokenIds.length == _attributes.length, "Input mismatch.");
for (uint16 i = 0; i < _tokenIds.length; i++) {
tokens[_tokenIds[i]].ball_type = 0;
tokens[_tokenIds[i]].coord_x = _attributes[i][0];
tokens[_tokenIds[i]].coord_y = _attributes[i][1];
tokens[_tokenIds[i]].pattern = _attributes[i][2];
tokens[_tokenIds[i]].wrap = _attributes[i][3];
tokens[_tokenIds[i]].overlay = _attributes[i][4];
tokens[_tokenIds[i]].rally = _attributes[i][5];
tokens[_tokenIds[i]].colour = _attributes[i][6];
tokens[_tokenIds[i]].scheme = _attributes[i][7];
tokens[_tokenIds[i]].logo = _attributes[i][8];
tokens[_tokenIds[i]].shot = _attributes[i][9];
}
}
function withdraw() public onlyOwner {
uint balanceA = (address(this).balance * 75) / 1000;
uint balanceB = (address(this).balance * 400) / 1000;
uint balanceC = (address(this).balance * 200) / 1000;
uint balanceD = address(this).balance - balanceA - balanceB - balanceC;
payable(0x6b37Ca573f0A877F342434236721D1eE6CE83bb1).transfer(balanceA);
payable(0x5151FCF0ED173426d9D095367360Be58F1AE7993).transfer(balanceB);
payable(0x01cE3D2A58c85983Ab6f40e1f05B6f7EceC3f379).transfer(balanceC);
payable(0x3c02bA1b4E3149e34880f7bf39C61087B4262a18).transfer(balanceD);
}
function withdrawLink() external onlyOwner {
uint256 balance = LINK.balanceOf(address(this));
LINK.transfer(msg.sender, balance);
}
}
interface IMetaKey {
function balanceOf(address, uint256) external view returns (uint256);
}
文件 2 的 16: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);
}
}
}
}
文件 3 的 16:Context.sol
pragma solidity ^0.8.0;
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes calldata) {
return msg.data;
}
}
文件 4 的 16: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;
}
}
文件 5 的 16:ERC721.sol
pragma solidity ^0.8.0;
import "./IERC721.sol";
import "./IERC721Receiver.sol";
import "./extensions/IERC721Metadata.sol";
import "../../utils/Address.sol";
import "../../utils/Context.sol";
import "../../utils/Strings.sol";
import "../../utils/introspection/ERC165.sol";
contract ERC721 is Context, ERC165, IERC721, IERC721Metadata {
using Address for address;
using Strings for uint256;
string private _name;
string private _symbol;
mapping(uint256 => address) private _owners;
mapping(address => uint256) private _balances;
mapping(uint256 => address) private _tokenApprovals;
mapping(address => mapping(address => bool)) private _operatorApprovals;
constructor(string memory name_, string memory symbol_) {
_name = name_;
_symbol = symbol_;
}
function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165, IERC165) returns (bool) {
return
interfaceId == type(IERC721).interfaceId ||
interfaceId == type(IERC721Metadata).interfaceId ||
super.supportsInterface(interfaceId);
}
function balanceOf(address owner) public view virtual override returns (uint256) {
require(owner != address(0), "ERC721: balance query for the zero address");
return _balances[owner];
}
function ownerOf(uint256 tokenId) public view virtual override returns (address) {
address owner = _owners[tokenId];
require(owner != address(0), "ERC721: owner query for nonexistent token");
return owner;
}
function name() public view virtual override returns (string memory) {
return _name;
}
function symbol() public view virtual override returns (string memory) {
return _symbol;
}
function tokenURI(uint256 tokenId) public view virtual override returns (string memory) {
require(_exists(tokenId), "ERC721Metadata: URI query for nonexistent token");
string memory baseURI = _baseURI();
return bytes(baseURI).length > 0 ? string(abi.encodePacked(baseURI, tokenId.toString())) : "";
}
function _baseURI() internal view virtual returns (string memory) {
return "";
}
function approve(address to, uint256 tokenId) public virtual override {
address owner = ERC721.ownerOf(tokenId);
require(to != owner, "ERC721: approval to current owner");
require(
_msgSender() == owner || isApprovedForAll(owner, _msgSender()),
"ERC721: approve caller is not owner nor approved for all"
);
_approve(to, tokenId);
}
function getApproved(uint256 tokenId) public view virtual override returns (address) {
require(_exists(tokenId), "ERC721: approved query for nonexistent token");
return _tokenApprovals[tokenId];
}
function setApprovalForAll(address operator, bool approved) public virtual override {
require(operator != _msgSender(), "ERC721: approve to caller");
_operatorApprovals[_msgSender()][operator] = approved;
emit ApprovalForAll(_msgSender(), operator, approved);
}
function isApprovedForAll(address owner, address operator) public view virtual override returns (bool) {
return _operatorApprovals[owner][operator];
}
function transferFrom(
address from,
address to,
uint256 tokenId
) public virtual override {
require(_isApprovedOrOwner(_msgSender(), tokenId), "ERC721: transfer caller is not owner nor approved");
_transfer(from, to, tokenId);
}
function safeTransferFrom(
address from,
address to,
uint256 tokenId
) public virtual override {
safeTransferFrom(from, to, tokenId, "");
}
function safeTransferFrom(
address from,
address to,
uint256 tokenId,
bytes memory _data
) public virtual override {
require(_isApprovedOrOwner(_msgSender(), tokenId), "ERC721: transfer caller is not owner nor approved");
_safeTransfer(from, to, tokenId, _data);
}
function _safeTransfer(
address from,
address to,
uint256 tokenId,
bytes memory _data
) internal virtual {
_transfer(from, to, tokenId);
require(_checkOnERC721Received(from, to, tokenId, _data), "ERC721: transfer to non ERC721Receiver implementer");
}
function _exists(uint256 tokenId) internal view virtual returns (bool) {
return _owners[tokenId] != address(0);
}
function _isApprovedOrOwner(address spender, uint256 tokenId) internal view virtual returns (bool) {
require(_exists(tokenId), "ERC721: operator query for nonexistent token");
address owner = ERC721.ownerOf(tokenId);
return (spender == owner || getApproved(tokenId) == spender || isApprovedForAll(owner, 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);
}
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);
}
function _transfer(
address from,
address to,
uint256 tokenId
) internal virtual {
require(ERC721.ownerOf(tokenId) == from, "ERC721: transfer of token that is not own");
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);
}
function _approve(address to, uint256 tokenId) internal virtual {
_tokenApprovals[tokenId] = to;
emit Approval(ERC721.ownerOf(tokenId), to, tokenId);
}
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 {}
}
文件 6 的 16:ERC721Enumerable.sol
pragma solidity ^0.8.0;
import "../ERC721.sol";
import "./IERC721Enumerable.sol";
abstract contract ERC721Enumerable is ERC721, IERC721Enumerable {
mapping(address => mapping(uint256 => uint256)) private _ownedTokens;
mapping(uint256 => uint256) private _ownedTokensIndex;
uint256[] private _allTokens;
mapping(uint256 => uint256) private _allTokensIndex;
function supportsInterface(bytes4 interfaceId) public view virtual override(IERC165, ERC721) returns (bool) {
return interfaceId == type(IERC721Enumerable).interfaceId || super.supportsInterface(interfaceId);
}
function tokenOfOwnerByIndex(address owner, uint256 index) public view virtual override returns (uint256) {
require(index < ERC721.balanceOf(owner), "ERC721Enumerable: owner index out of bounds");
return _ownedTokens[owner][index];
}
function totalSupply() public view virtual override returns (uint256) {
return _allTokens.length;
}
function tokenByIndex(uint256 index) public view virtual override returns (uint256) {
require(index < ERC721Enumerable.totalSupply(), "ERC721Enumerable: global index out of bounds");
return _allTokens[index];
}
function _beforeTokenTransfer(
address from,
address to,
uint256 tokenId
) internal virtual override {
super._beforeTokenTransfer(from, to, tokenId);
if (from == address(0)) {
_addTokenToAllTokensEnumeration(tokenId);
} else if (from != to) {
_removeTokenFromOwnerEnumeration(from, tokenId);
}
if (to == address(0)) {
_removeTokenFromAllTokensEnumeration(tokenId);
} else if (to != from) {
_addTokenToOwnerEnumeration(to, tokenId);
}
}
function _addTokenToOwnerEnumeration(address to, uint256 tokenId) private {
uint256 length = ERC721.balanceOf(to);
_ownedTokens[to][length] = tokenId;
_ownedTokensIndex[tokenId] = length;
}
function _addTokenToAllTokensEnumeration(uint256 tokenId) private {
_allTokensIndex[tokenId] = _allTokens.length;
_allTokens.push(tokenId);
}
function _removeTokenFromOwnerEnumeration(address from, uint256 tokenId) private {
uint256 lastTokenIndex = ERC721.balanceOf(from) - 1;
uint256 tokenIndex = _ownedTokensIndex[tokenId];
if (tokenIndex != lastTokenIndex) {
uint256 lastTokenId = _ownedTokens[from][lastTokenIndex];
_ownedTokens[from][tokenIndex] = lastTokenId;
_ownedTokensIndex[lastTokenId] = tokenIndex;
}
delete _ownedTokensIndex[tokenId];
delete _ownedTokens[from][lastTokenIndex];
}
function _removeTokenFromAllTokensEnumeration(uint256 tokenId) private {
uint256 lastTokenIndex = _allTokens.length - 1;
uint256 tokenIndex = _allTokensIndex[tokenId];
uint256 lastTokenId = _allTokens[lastTokenIndex];
_allTokens[tokenIndex] = lastTokenId;
_allTokensIndex[lastTokenId] = tokenIndex;
delete _allTokensIndex[tokenId];
_allTokens.pop();
}
}
文件 7 的 16:IERC165.sol
pragma solidity ^0.8.0;
interface IERC165 {
function supportsInterface(bytes4 interfaceId) external view returns (bool);
}
文件 8 的 16: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 的 16: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 的 16: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 的 16:IERC721Receiver.sol
pragma solidity ^0.8.0;
interface IERC721Receiver {
function onERC721Received(
address operator,
address from,
uint256 tokenId,
bytes calldata data
) external returns (bytes4);
}
文件 12 的 16:LinkTokenInterface.sol
pragma solidity ^0.8.0;
interface LinkTokenInterface {
function allowance(
address owner,
address spender
)
external
view
returns (
uint256 remaining
);
function approve(
address spender,
uint256 value
)
external
returns (
bool success
);
function balanceOf(
address owner
)
external
view
returns (
uint256 balance
);
function decimals()
external
view
returns (
uint8 decimalPlaces
);
function decreaseApproval(
address spender,
uint256 addedValue
)
external
returns (
bool success
);
function increaseApproval(
address spender,
uint256 subtractedValue
) external;
function name()
external
view
returns (
string memory tokenName
);
function symbol()
external
view
returns (
string memory tokenSymbol
);
function totalSupply()
external
view
returns (
uint256 totalTokensIssued
);
function transfer(
address to,
uint256 value
)
external
returns (
bool success
);
function transferAndCall(
address to,
uint256 value,
bytes calldata data
)
external
returns (
bool success
);
function transferFrom(
address from,
address to,
uint256 value
)
external
returns (
bool success
);
}
文件 13 的 16: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() {
_setOwner(_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 {
_setOwner(address(0));
}
function transferOwnership(address newOwner) public virtual onlyOwner {
require(newOwner != address(0), "Ownable: new owner is the zero address");
_setOwner(newOwner);
}
function _setOwner(address newOwner) private {
address oldOwner = _owner;
_owner = newOwner;
emit OwnershipTransferred(oldOwner, newOwner);
}
}
文件 14 的 16: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);
}
}
文件 15 的 16:VRFConsumerBase.sol
pragma solidity ^0.8.0;
import "./interfaces/LinkTokenInterface.sol";
import "./VRFRequestIDBase.sol";
abstract contract VRFConsumerBase is VRFRequestIDBase {
function fulfillRandomness(
bytes32 requestId,
uint256 randomness
)
internal
virtual;
uint256 constant private USER_SEED_PLACEHOLDER = 0;
function requestRandomness(
bytes32 _keyHash,
uint256 _fee
)
internal
returns (
bytes32 requestId
)
{
LINK.transferAndCall(vrfCoordinator, _fee, abi.encode(_keyHash, USER_SEED_PLACEHOLDER));
uint256 vRFSeed = makeVRFInputSeed(_keyHash, USER_SEED_PLACEHOLDER, address(this), nonces[_keyHash]);
nonces[_keyHash] = nonces[_keyHash] + 1;
return makeRequestId(_keyHash, vRFSeed);
}
LinkTokenInterface immutable internal LINK;
address immutable private vrfCoordinator;
mapping(bytes32 => uint256 ) private nonces;
constructor(
address _vrfCoordinator,
address _link
) {
vrfCoordinator = _vrfCoordinator;
LINK = LinkTokenInterface(_link);
}
function rawFulfillRandomness(
bytes32 requestId,
uint256 randomness
)
external
{
require(msg.sender == vrfCoordinator, "Only VRFCoordinator can fulfill");
fulfillRandomness(requestId, randomness);
}
}
文件 16 的 16:VRFRequestIDBase.sol
pragma solidity ^0.8.0;
contract VRFRequestIDBase {
function makeVRFInputSeed(
bytes32 _keyHash,
uint256 _userSeed,
address _requester,
uint256 _nonce
)
internal
pure
returns (
uint256
)
{
return uint256(keccak256(abi.encode(_keyHash, _userSeed, _requester, _nonce)));
}
function makeRequestId(
bytes32 _keyHash,
uint256 _vRFInputSeed
)
internal
pure
returns (
bytes32
)
{
return keccak256(abi.encodePacked(_keyHash, _vRFInputSeed));
}
}
{
"compilationTarget": {
"contracts/AOToken.sol": "AOToken"
},
"evmVersion": "london",
"libraries": {},
"metadata": {
"bytecodeHash": "ipfs"
},
"optimizer": {
"enabled": true,
"runs": 200
},
"remappings": []
}
[{"inputs":[],"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":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","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":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"BALL_TYPE","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"BUY_PRICE","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"COLOUR","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"LINK_ADDRESS","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"LOGO","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MAX_PRESALE_SUPPLY","outputs":[{"internalType":"uint16","name":"","type":"uint16"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MAX_SALE_SUPPLY","outputs":[{"internalType":"uint16","name":"","type":"uint16"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MAX_WHITELIST_SALE_SUPPLY","outputs":[{"internalType":"uint16","name":"","type":"uint16"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"OVERLAY","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"PATTERN","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"RALLY","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"SCHEME","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"SHOT","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"VRF_COORDINATOR_ADDRESS","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"VRF_FEE","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"VRF_KEY_HASH","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"WRAP","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint16[]","name":"_tokenIds","type":"uint16[]"},{"internalType":"uint16[]","name":"_winnings","type":"uint16[]"}],"name":"addTokenWinnings","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address[]","name":"_accounts","type":"address[]"},{"internalType":"bool","name":"_status","type":"bool"}],"name":"addWhitelist","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":"uint16","name":"","type":"uint16"}],"name":"artist","outputs":[{"internalType":"string","name":"","type":"string"}],"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":"baseURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"boundary","outputs":[{"internalType":"uint16","name":"","type":"uint16"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint16","name":"_amount","type":"uint16"}],"name":"claim","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"eligiblePresale","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"enableTokenURI","outputs":[{"internalType":"bool","name":"","type":"bool"}],"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":"getAttributes","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getRandomNumber","outputs":[{"internalType":"bytes32","name":"requestId","type":"bytes32"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_tokenId","type":"uint256"}],"name":"getTokenWinnings","outputs":[{"internalType":"uint16[]","name":"","type":"uint16[]"}],"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":"uint16","name":"","type":"uint16"}],"name":"legendPattern","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"metakeyEligible","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","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":"presaleActive","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"presaleClaim","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"presaleClaimed","outputs":[{"internalType":"uint16","name":"","type":"uint16"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"provenance","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"publicClaimed","outputs":[{"internalType":"uint16","name":"","type":"uint16"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"requestId","type":"bytes32"},{"internalType":"uint256","name":"randomness","type":"uint256"}],"name":"rawFulfillRandomness","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"revealed","outputs":[{"internalType":"bool","name":"","type":"bool"}],"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":[],"name":"saleActive","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"seedNumber","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"seeded","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"operator","type":"address"},{"internalType":"bool","name":"approved","type":"bool"}],"name":"setApprovalForAll","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"_uri","type":"string"}],"name":"setBaseURI","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"_provenance","type":"string"}],"name":"setProvenance","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint16[]","name":"_tokenIds","type":"uint16[]"},{"internalType":"string","name":"_uri","type":"string"}],"name":"setTokenBaseURI","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint16[]","name":"_tokenIds","type":"uint16[]"},{"internalType":"uint16[][]","name":"_winnings","type":"uint16[][]"}],"name":"setTokenWinnings","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"teamClaim","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"toggleActive","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"togglePresaleActive","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"toggleReveal","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"toggleTokenURI","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"index","type":"uint256"}],"name":"tokenByIndex","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"}],"name":"tokenURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint16","name":"","type":"uint16"}],"name":"tokens","outputs":[{"internalType":"uint8","name":"ball_type","type":"uint8"},{"internalType":"uint8","name":"pattern","type":"uint8"},{"internalType":"uint8","name":"wrap","type":"uint8"},{"internalType":"uint8","name":"overlay","type":"uint8"},{"internalType":"uint8","name":"rally","type":"uint8"},{"internalType":"uint8","name":"colour","type":"uint8"},{"internalType":"uint8","name":"scheme","type":"uint8"},{"internalType":"uint8","name":"logo","type":"uint8"},{"internalType":"uint8","name":"shot","type":"uint8"},{"internalType":"uint8","name":"coord_x","type":"uint8"},{"internalType":"uint8","name":"coord_y","type":"uint8"},{"internalType":"string","name":"uri","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":"uint16[]","name":"_tokenIds","type":"uint16[]"},{"internalType":"uint8[2][]","name":"_attributes","type":"uint8[2][]"},{"internalType":"string[]","name":"_artist","type":"string[]"}],"name":"updateArtistToken","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint16[]","name":"_tokenIds","type":"uint16[]"},{"internalType":"uint8[10][]","name":"_attributes","type":"uint8[10][]"}],"name":"updateGenerativeToken","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint16[]","name":"_tokenIds","type":"uint16[]"},{"internalType":"uint8[2][]","name":"_attributes","type":"uint8[2][]"},{"internalType":"string[]","name":"_pattern","type":"string[]"}],"name":"updateLegendToken","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"whitelist","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"whitelistClaimed","outputs":[{"internalType":"uint16","name":"","type":"uint16"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"withdraw","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"withdrawLink","outputs":[],"stateMutability":"nonpayable","type":"function"}]