diff --git a/README.md b/README.md index ec139a5..5f51c07 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,454 @@ 运行代码指令 npm run dev yarn run dev +const ERC20ABI = [ + { + inputs: [ + { + internalType: "address", + name: "_nftTarget", + type: "address" + }, + { + internalType: "address[]", + name: "_manageAddress", + type: "address[]" + } + ], + stateMutability: "nonpayable", + type: "constructor" + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "address", + name: "user", + type: "address" + }, + { + indexed: true, + internalType: "address", + name: "nft", + type: "address" + }, + { + indexed: false, + internalType: "uint256[]", + name: "nftSIds", + type: "uint256[]" + }, + { + indexed: false, + internalType: "uint256[]", + name: "nftTIds", + type: "uint256[]" + } + ], + name: "Minted", + type: "event" + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "bytes32", + name: "role", + type: "bytes32" + }, + { + indexed: true, + internalType: "bytes32", + name: "previousAdminRole", + type: "bytes32" + }, + { + indexed: true, + internalType: "bytes32", + name: "newAdminRole", + type: "bytes32" + } + ], + name: "RoleAdminChanged", + type: "event" + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "bytes32", + name: "role", + type: "bytes32" + }, + { + indexed: true, + internalType: "address", + name: "account", + type: "address" + }, + { + indexed: true, + internalType: "address", + name: "sender", + type: "address" + } + ], + name: "RoleGranted", + type: "event" + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "bytes32", + name: "role", + type: "bytes32" + }, + { + indexed: true, + internalType: "address", + name: "account", + type: "address" + }, + { + indexed: true, + internalType: "address", + name: "sender", + type: "address" + } + ], + name: "RoleRevoked", + type: "event" + }, + { + inputs: [], + name: "DEFAULT_ADMIN_ROLE", + outputs: [ + { + internalType: "bytes32", + name: "", + type: "bytes32" + } + ], + stateMutability: "view", + type: "function", + constant: true + }, + { + inputs: [], + name: "MANAGE_ROLE", + outputs: [ + { + internalType: "bytes32", + name: "", + type: "bytes32" + } + ], + stateMutability: "view", + type: "function", + constant: true + }, + { + inputs: [ + { + internalType: "bytes32", + name: "role", + type: "bytes32" + } + ], + name: "getRoleAdmin", + outputs: [ + { + internalType: "bytes32", + name: "", + type: "bytes32" + } + ], + stateMutability: "view", + type: "function", + constant: true + }, + { + inputs: [ + { + internalType: "bytes32", + name: "role", + type: "bytes32" + }, + { + internalType: "uint256", + name: "index", + type: "uint256" + } + ], + name: "getRoleMember", + outputs: [ + { + internalType: "address", + name: "", + type: "address" + } + ], + stateMutability: "view", + type: "function", + constant: true + }, + { + inputs: [ + { + internalType: "bytes32", + name: "role", + type: "bytes32" + } + ], + name: "getRoleMemberCount", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256" + } + ], + stateMutability: "view", + type: "function", + constant: true + }, + { + inputs: [ + { + internalType: "bytes32", + name: "role", + type: "bytes32" + }, + { + internalType: "address", + name: "account", + type: "address" + } + ], + name: "grantRole", + outputs: [], + stateMutability: "nonpayable", + type: "function" + }, + { + inputs: [ + { + internalType: "bytes32", + name: "role", + type: "bytes32" + }, + { + internalType: "address", + name: "account", + type: "address" + } + ], + name: "hasRole", + outputs: [ + { + internalType: "bool", + name: "", + type: "bool" + } + ], + stateMutability: "view", + type: "function", + constant: true + }, + { + inputs: [], + name: "nft", + outputs: [ + { + internalType: "contract IBEERC721", + name: "", + type: "address" + } + ], + stateMutability: "view", + type: "function", + constant: true + }, + { + inputs: [ + { + internalType: "uint256", + name: "", + type: "uint256" + } + ], + name: "nftMinted", + outputs: [ + { + internalType: "bool", + name: "", + type: "bool" + } + ], + stateMutability: "view", + type: "function", + constant: true + }, + { + inputs: [ + { + internalType: "address", + name: "", + type: "address" + }, + { + internalType: "uint256", + name: "", + type: "uint256" + } + ], + name: "ownerToNFTs", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256" + } + ], + stateMutability: "view", + type: "function", + constant: true + }, + { + inputs: [ + { + internalType: "bytes32", + name: "role", + type: "bytes32" + }, + { + internalType: "address", + name: "account", + type: "address" + } + ], + name: "renounceRole", + outputs: [], + stateMutability: "nonpayable", + type: "function" + }, + { + inputs: [ + { + internalType: "bytes32", + name: "role", + type: "bytes32" + }, + { + internalType: "address", + name: "account", + type: "address" + } + ], + name: "revokeRole", + outputs: [], + stateMutability: "nonpayable", + type: "function" + }, + { + inputs: [ + { + internalType: "bytes4", + name: "interfaceId", + type: "bytes4" + } + ], + name: "supportsInterface", + outputs: [ + { + internalType: "bool", + name: "", + type: "bool" + } + ], + stateMutability: "view", + type: "function", + constant: true + }, + { + inputs: [ + { + internalType: "address", + name: "_user", + type: "address" + }, + { + internalType: "uint256", + name: "count", + type: "uint256" + } + ], + name: "mintToUser", + outputs: [], + stateMutability: "nonpayable", + type: "function" + }, + { + inputs: [ + { + internalType: "address", + name: "_user", + type: "address" + }, + { + internalType: "uint256[]", + name: "_nftIds", + type: "uint256[]" + } + ], + name: "addNFTData", + outputs: [], + stateMutability: "nonpayable", + type: "function" + }, + { + inputs: [ + { + internalType: "address", + name: "_user", + type: "address" + } + ], + name: "getMintableCount", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256" + } + ], + stateMutability: "view", + type: "function", + constant: true + }, + { + inputs: [ + { + internalType: "address", + name: "_user", + type: "address" + } + ], + name: "getMintableNftIds", + outputs: [ + { + internalType: "uint256[]", + name: "", + type: "uint256[]" + } + ], + stateMutability: "view", + type: "function", + constant: true + } +] \ No newline at end of file diff --git a/src/api/badge.js b/src/api/badge.js index 7811ac7..3ecc1eb 100644 --- a/src/api/badge.js +++ b/src/api/badge.js @@ -1,3 +1,4 @@ +import request from "@/utils/request"; /** * begin claim badge * @param {*} data: {id: string} diff --git a/src/assets/img/badge/more-hover.png b/src/assets/img/badge/more-hover.png new file mode 100644 index 0000000..3038a56 Binary files /dev/null and b/src/assets/img/badge/more-hover.png differ diff --git a/src/chain/ChainManager.ts b/src/chain/ChainManager.ts index 4b05b65..41457d9 100644 --- a/src/chain/ChainManager.ts +++ b/src/chain/ChainManager.ts @@ -11,6 +11,7 @@ import { ACTIVATE_PROXY_ABI, MYSTERY_BOX_ABI, MYSTERY_PROXY_ABI, + MEDAL_REWARDS_ABI, } from "@/configs/contracts"; const AppModule = useAppStore(pinia); @@ -115,6 +116,7 @@ export default class ChainManager { console.log("balance: ", balance); return balance; } + /** * get amount of mystery boxes diff --git a/src/chain/blockchain.ts b/src/chain/blockchain.ts index 24b7e4a..1c2d68d 100644 --- a/src/chain/blockchain.ts +++ b/src/chain/blockchain.ts @@ -6,9 +6,10 @@ import { useUserStore } from "@/store/user"; import { isMobile } from "@/utils/resize"; import { hasMetamask, toHexChainId } from "@/utils/chain.util"; import { AllChains } from "@/configs/allchain"; -import { ERC20ABI } from "@/configs/contracts"; +import { ERC20ABI, LIMIT_ABI, MEDAL_REWARDS_ABI } from "@/configs/contracts"; import { TransactionReceipt } from "web3-core"; import { useEventBus } from "@vueuse/core"; +import { Global } from "@/configs/global"; import * as bus_event from "@/bus/event"; import pinia from "@/store"; @@ -95,6 +96,7 @@ export class Blockchain { return; } this.web3 = new Web3(this.provider); + const chainId = await this.web3.eth.getChainId(); await this.checkChain(chainId); @@ -126,7 +128,7 @@ export class Blockchain { * @private */ private async checkChain(chainId: number) { - if (!this.chainMap.has(chainId)) { + if (chainId !== AVAILABLE_CHAINS[0]) { // if (this.walletType === 1) { try { await this.selectChain(); @@ -195,19 +197,12 @@ export class Blockchain { */ private selectChain(): Promise { return new Promise((resolve, reject) => { - busNeedChangeChain.emit({ - confirm: async (id: number) => { - console.log("select chain: ", id); - this.currentChain = id; - if (this.provider) { - await this.switchEthereumChain(); - } - resolve && resolve(id); - }, - cancel: (reason: any) => { - console.log("cancel select chain: ", reason); - reject && reject(reason); - }, + this.switchEthereumChain(AVAILABLE_CHAINS[0], (res: any)=>{ + if (res.err) { + reject && reject(res.err) + return + } + resolve && resolve(res.chain) }); }); } @@ -256,6 +251,11 @@ export class Blockchain { } public async getContractInstance(address: string, abi: any = ERC20ABI) { + if (!this.web3) { + throw new Error( + "Web3 instance is not initialized. Please call `initWeb3` method after user login." + ); + } if (!this.instanceCacheMap.has(address)) { const instance = new this.web3.eth.Contract(abi, address, { from: AppModule.accountId, @@ -344,49 +344,38 @@ export class Blockchain { * @param {() => void} cb * @return {Promise} */ - async switchEthereumChain(chainId?: number, cb?: () => void) { - chainId = chainId || this.currentChain; + async switchEthereumChain(chainId?: number, cb?: (res: any) => void) { + chainId = chainId || AVAILABLE_CHAINS[0]; const hexChainId = toHexChainId(chainId); const onChainChange = (chainId: string) => { console.log("switchEthereumChain: ", chainId); this.provider.removeListener("chainChanged", onChainChange); - cb && cb(); + cb && cb({chain: chainId}); }; this.provider.on("chainChanged", onChainChange); try { + const data = this.chainMap.get(chainId)!; await this.provider.request({ - method: "wallet_switchEthereumChain", - params: [{ chainId: hexChainId }], + method: "wallet_addEthereumChain", + params: [ + { + chainId: hexChainId, + chainName: data.name, + nativeCurrency: { + name: data.symbol, + symbol: data.symbol, + decimals: data.decimals || 18, + }, + blockExplorerUrls: [data.explorerurl], + rpcUrls: [data.rpc], + }, + ], }); - console.log("switch chain success"); - } catch (e: any) { - console.log("switch chain error: ", e); - if (e.code === 4902 || e.message.indexOf("Unrecognized chain ID") >= 0) { - try { - const data = this.chainMap.get(chainId)!; - await this.provider.request({ - method: "wallet_addEthereumChain", - params: [ - { - chainId: hexChainId, - chainName: data.name, - nativeCurrency: { - name: data.symbol, - symbol: data.symbol, - decimals: data.decimals || 18, - }, - blockExplorerUrls: [data.explorerurl], - rpcUrls: [data.rpc], - }, - ], - }); - console.log("add chain success"); - } catch (addError) { - console.error("add chain error: ", addError); - this.provider.removeListener("chainChanged", onChainChange); - } - } - // console.error(e) + console.log("add chain success"); + } catch (addError) { + console.error("add chain error: ", addError); + this.provider.removeListener("chainChanged", onChainChange); + cb && cb({err: addError}) } } @@ -455,6 +444,38 @@ export class Blockchain { console.log("increaseAllowance: ", res); } + public async totalSupply(address: string) { + const coinInstance: any = await this.getContractInstance( + Global.LIMIT_ABI_Address, + LIMIT_ABI + ); + const res = await coinInstance.methods.totalSupply().call({ gas: 1000000 }); + console.log("totalSupply: ", res); + return res + } + // 获取当前用户可mint的数量 + public async getMintableCount(address?: string) { + // address = address || //TODO: current address + const coinInstance: any = await this.getContractInstance( + Global.MEDAL_REWARDS_Address, + MEDAL_REWARDS_ABI + ); + const res = await coinInstance.methods + .getMintableCount(AppModule.accountId) + .call({ gas: 1000000 }); + console.log("getMintableCount: ", res); + return res + } + // 获取当前用户的mint总数 + public async supplyLimit(address: string) { + const coinInstance: any = await this.getContractInstance( + Global.LIMIT_ABI_Address, + LIMIT_ABI + ); + const res = await coinInstance.methods.supplyLimit().call({ gas: 1000000 }); + console.log("supplyLimit: ", res); + return res + } /** * @param {string} address * @param {string | null} account diff --git a/src/components/layout/NavBar.vue b/src/components/layout/NavBar.vue index 06d1302..17d7405 100644 --- a/src/components/layout/NavBar.vue +++ b/src/components/layout/NavBar.vue @@ -47,7 +47,7 @@ import { useCopyToClipboard } from "./../../hooks/useCopyToClipboard"; const AppModule = useAppStore(); const chain = useChainStore(); const app = useAppStore(); - +const emit = defineEmits(['login-success']) const { copied, copyToClipboard } = useCopyToClipboard(AppModule.accountId); const message = copied.value @@ -64,14 +64,16 @@ const formatAddress = computed(() => { async function login(event) { if (!chain.logined) { await chain.chainManager.login(); - chain.logined = chain.chainManager.isLogined; + emit('login-success'); } } + const logout = async () => { await chain.chainManager.logout(); - + chain.logined = chain.chainManager.isLogined; + }; diff --git a/src/configs/configchain.js b/src/configs/configchain.js index bf59390..41e28cb 100644 --- a/src/configs/configchain.js +++ b/src/configs/configchain.js @@ -15,7 +15,7 @@ export const ALL_PROVIDERS = [ }, ]; -export const AVAILABLE_CHAINS = env === "production" ? [321] : [322]; +export const AVAILABLE_CHAINS = env === "production" ? [137] : [80001]; export const OFFICE_ACCOUNT = env === "production" diff --git a/src/configs/contracts.ts b/src/configs/contracts.ts index b032a34..a4762f0 100644 --- a/src/configs/contracts.ts +++ b/src/configs/contracts.ts @@ -1,19 +1,19 @@ -export const ERC20ABI = [ +export const ERC20ABI = [ { inputs: [ { - internalType: "address", - name: "_nftTarget", - type: "address" + internalType: "string", + name: "name_", + type: "string", }, { - internalType: "address[]", - name: "_manageAddress", - type: "address[]" - } + internalType: "string", + name: "symbol_", + type: "string", + }, ], stateMutability: "nonpayable", - type: "constructor" + type: "constructor", }, { anonymous: false, @@ -21,30 +21,462 @@ export const ERC20ABI = [ { indexed: true, internalType: "address", - name: "user", - type: "address" + name: "owner", + type: "address", }, { indexed: true, internalType: "address", - name: "nft", - type: "address" + name: "spender", + type: "address", }, { indexed: false, - internalType: "uint256[]", - name: "nftSIds", - type: "uint256[]" + internalType: "uint256", + name: "value", + type: "uint256", }, - { - indexed: false, - internalType: "uint256[]", - name: "nftTIds", - type: "uint256[]" - } ], - name: "Minted", - type: "event" + name: "Approval", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "address", + name: "from", + type: "address", + }, + { + indexed: true, + internalType: "address", + name: "to", + type: "address", + }, + { + indexed: false, + internalType: "uint256", + name: "value", + type: "uint256", + }, + ], + name: "Transfer", + type: "event", + }, + { + inputs: [], + name: "name", + outputs: [ + { + internalType: "string", + name: "", + type: "string", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "symbol", + outputs: [ + { + internalType: "string", + name: "", + type: "string", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "decimals", + outputs: [ + { + internalType: "uint8", + name: "", + type: "uint8", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "totalSupply", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "account", + type: "address", + }, + ], + name: "balanceOf", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "recipient", + type: "address", + }, + { + internalType: "uint256", + name: "amount", + type: "uint256", + }, + ], + name: "transfer", + outputs: [ + { + internalType: "bool", + name: "", + type: "bool", + }, + ], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "owner", + type: "address", + }, + { + internalType: "address", + name: "spender", + type: "address", + }, + ], + name: "allowance", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "spender", + type: "address", + }, + { + internalType: "uint256", + name: "amount", + type: "uint256", + }, + ], + name: "approve", + outputs: [ + { + internalType: "bool", + name: "", + type: "bool", + }, + ], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "sender", + type: "address", + }, + { + internalType: "address", + name: "recipient", + type: "address", + }, + { + internalType: "uint256", + name: "amount", + type: "uint256", + }, + ], + name: "transferFrom", + outputs: [ + { + internalType: "bool", + name: "", + type: "bool", + }, + ], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "spender", + type: "address", + }, + { + internalType: "uint256", + name: "addedValue", + type: "uint256", + }, + ], + name: "increaseAllowance", + outputs: [ + { + internalType: "bool", + name: "", + type: "bool", + }, + ], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "spender", + type: "address", + }, + { + internalType: "uint256", + name: "subtractedValue", + type: "uint256", + }, + ], + name: "decreaseAllowance", + outputs: [ + { + internalType: "bool", + name: "", + type: "bool", + }, + ], + stateMutability: "nonpayable", + type: "function", + }, +]; + +export const MALL_ABI = [ + { + inputs: [ + { + internalType: "address[]", + name: "proposers", + type: "address[]", + }, + { + internalType: "address[]", + name: "executors", + type: "address[]", + }, + ], + stateMutability: "nonpayable", + type: "constructor", + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "uint256", + name: "boxId", + type: "uint256", + }, + { + indexed: true, + internalType: "address", + name: "buyer", + type: "address", + }, + { + indexed: false, + internalType: "uint256", + name: "boxType", + type: "uint256", + }, + { + indexed: false, + internalType: "uint256", + name: "price", + type: "uint256", + }, + { + indexed: false, + internalType: "address", + name: "paymentToken", + type: "address", + }, + ], + name: "BEBoxPaid", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "bytes32", + name: "id", + type: "bytes32", + }, + { + indexed: true, + internalType: "uint256", + name: "index", + type: "uint256", + }, + { + indexed: false, + internalType: "address", + name: "target", + type: "address", + }, + { + indexed: false, + internalType: "uint256", + name: "value", + type: "uint256", + }, + { + indexed: false, + internalType: "bytes", + name: "data", + type: "bytes", + }, + ], + name: "CallExecuted", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "bytes32", + name: "id", + type: "bytes32", + }, + { + indexed: true, + internalType: "uint256", + name: "index", + type: "uint256", + }, + { + indexed: false, + internalType: "address", + name: "target", + type: "address", + }, + { + indexed: false, + internalType: "uint256", + name: "value", + type: "uint256", + }, + { + indexed: false, + internalType: "bytes", + name: "data", + type: "bytes", + }, + { + indexed: false, + internalType: "bytes32", + name: "predecessor", + type: "bytes32", + }, + { + indexed: false, + internalType: "uint256", + name: "delay", + type: "uint256", + }, + ], + name: "CallScheduled", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "bytes32", + name: "id", + type: "bytes32", + }, + ], + name: "Cancelled", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: "uint256", + name: "oldDuration", + type: "uint256", + }, + { + indexed: false, + internalType: "uint256", + name: "newDuration", + type: "uint256", + }, + ], + name: "MinDelayChange", + 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, @@ -53,23 +485,23 @@ export const ERC20ABI = [ indexed: true, internalType: "bytes32", name: "role", - type: "bytes32" + type: "bytes32", }, { indexed: true, internalType: "bytes32", name: "previousAdminRole", - type: "bytes32" + type: "bytes32", }, { indexed: true, internalType: "bytes32", name: "newAdminRole", - type: "bytes32" - } + type: "bytes32", + }, ], name: "RoleAdminChanged", - type: "event" + type: "event", }, { anonymous: false, @@ -78,23 +510,23 @@ export const ERC20ABI = [ indexed: true, internalType: "bytes32", name: "role", - type: "bytes32" + type: "bytes32", }, { indexed: true, internalType: "address", name: "account", - type: "address" + type: "address", }, { indexed: true, internalType: "address", name: "sender", - type: "address" - } + type: "address", + }, ], name: "RoleGranted", - type: "event" + type: "event", }, { anonymous: false, @@ -103,23 +535,23 @@ export const ERC20ABI = [ indexed: true, internalType: "bytes32", name: "role", - type: "bytes32" + type: "bytes32", }, { indexed: true, internalType: "address", name: "account", - type: "address" + type: "address", }, { indexed: true, internalType: "address", name: "sender", - type: "address" - } + type: "address", + }, ], name: "RoleRevoked", - type: "event" + type: "event", }, { inputs: [], @@ -128,12 +560,2665 @@ export const ERC20ABI = [ { internalType: "bytes32", name: "", - type: "bytes32" - } + type: "bytes32", + }, ], stateMutability: "view", type: "function", - constant: true + }, + { + inputs: [], + name: "EXECUTOR_ROLE", + outputs: [ + { + internalType: "bytes32", + name: "", + type: "bytes32", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "MAX_DELAY", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "MIN_DELAY", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "PROPOSER_ROLE", + outputs: [ + { + internalType: "bytes32", + name: "", + type: "bytes32", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "TIMELOCK_ADMIN_ROLE", + outputs: [ + { + internalType: "bytes32", + name: "", + type: "bytes32", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "address_initialized", + outputs: [ + { + internalType: "bool", + name: "", + type: "bool", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "bytes32", + name: "id", + type: "bytes32", + }, + ], + name: "cancel", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "signer", + type: "address", + }, + { + internalType: "bytes32", + name: "hash", + type: "bytes32", + }, + { + internalType: "bytes", + name: "signature", + type: "bytes", + }, + ], + name: "checkSigner", + outputs: [], + stateMutability: "pure", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "signer", + type: "address", + }, + { + internalType: "bytes32", + name: "structHash", + type: "bytes32", + }, + { + internalType: "bytes", + name: "signature", + type: "bytes", + }, + ], + name: "checkSigner712", + outputs: [], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "target", + type: "address", + }, + { + internalType: "uint256", + name: "value", + type: "uint256", + }, + { + internalType: "bytes", + name: "data", + type: "bytes", + }, + { + internalType: "bytes32", + name: "predecessor", + type: "bytes32", + }, + { + internalType: "bytes32", + name: "salt", + type: "bytes32", + }, + ], + name: "execute", + outputs: [], + stateMutability: "payable", + type: "function", + }, + { + inputs: [ + { + internalType: "address[]", + name: "targets", + type: "address[]", + }, + { + internalType: "uint256[]", + name: "values", + type: "uint256[]", + }, + { + internalType: "bytes[]", + name: "datas", + type: "bytes[]", + }, + { + internalType: "bytes32", + name: "predecessor", + type: "bytes32", + }, + { + internalType: "bytes32", + name: "salt", + type: "bytes32", + }, + ], + name: "executeBatch", + outputs: [], + stateMutability: "payable", + type: "function", + }, + { + inputs: [ + { + internalType: "bytes32", + name: "role", + type: "bytes32", + }, + ], + name: "getRoleAdmin", + outputs: [ + { + internalType: "bytes32", + name: "", + type: "bytes32", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "bytes32", + name: "id", + type: "bytes32", + }, + ], + name: "getTimestamp", + outputs: [ + { + internalType: "uint256", + name: "timestamp", + type: "uint256", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "bytes32", + name: "role", + type: "bytes32", + }, + { + internalType: "address", + name: "account", + type: "address", + }, + ], + name: "grantRole", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + internalType: "bytes32", + name: "role", + type: "bytes32", + }, + { + internalType: "address", + name: "account", + type: "address", + }, + ], + name: "hasRole", + outputs: [ + { + internalType: "bool", + name: "", + type: "bool", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "target", + type: "address", + }, + { + internalType: "uint256", + name: "value", + type: "uint256", + }, + { + internalType: "bytes", + name: "data", + type: "bytes", + }, + { + internalType: "bytes32", + name: "predecessor", + type: "bytes32", + }, + { + internalType: "bytes32", + name: "salt", + type: "bytes32", + }, + ], + name: "hashOperation", + outputs: [ + { + internalType: "bytes32", + name: "hash", + type: "bytes32", + }, + ], + stateMutability: "pure", + type: "function", + }, + { + inputs: [ + { + internalType: "address[]", + name: "targets", + type: "address[]", + }, + { + internalType: "uint256[]", + name: "values", + type: "uint256[]", + }, + { + internalType: "bytes[]", + name: "datas", + type: "bytes[]", + }, + { + internalType: "bytes32", + name: "predecessor", + type: "bytes32", + }, + { + internalType: "bytes32", + name: "salt", + type: "bytes32", + }, + ], + name: "hashOperationBatch", + outputs: [ + { + internalType: "bytes32", + name: "hash", + type: "bytes32", + }, + ], + stateMutability: "pure", + type: "function", + }, + { + inputs: [ + { + internalType: "bytes32", + name: "id", + type: "bytes32", + }, + ], + name: "isOperation", + outputs: [ + { + internalType: "bool", + name: "pending", + type: "bool", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "bytes32", + name: "id", + type: "bytes32", + }, + ], + name: "isOperationDone", + outputs: [ + { + internalType: "bool", + name: "done", + type: "bool", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "bytes32", + name: "id", + type: "bytes32", + }, + ], + name: "isOperationPending", + outputs: [ + { + internalType: "bool", + name: "pending", + type: "bool", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "bytes32", + name: "id", + type: "bytes32", + }, + ], + name: "isOperationReady", + outputs: [ + { + internalType: "bool", + name: "ready", + type: "bool", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "owner", + outputs: [ + { + internalType: "address", + name: "", + type: "address", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "paymentReceivedAddress", + outputs: [ + { + internalType: "address", + name: "", + type: "address", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "renounceOwnership", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + internalType: "bytes32", + name: "role", + type: "bytes32", + }, + { + internalType: "address", + name: "account", + type: "address", + }, + ], + name: "renounceRole", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + internalType: "bytes32", + name: "role", + type: "bytes32", + }, + { + internalType: "address", + name: "account", + type: "address", + }, + ], + name: "revokeRole", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "target", + type: "address", + }, + { + internalType: "uint256", + name: "value", + type: "uint256", + }, + { + internalType: "bytes", + name: "data", + type: "bytes", + }, + { + internalType: "bytes32", + name: "predecessor", + type: "bytes32", + }, + { + internalType: "bytes32", + name: "salt", + type: "bytes32", + }, + { + internalType: "uint256", + name: "delay", + type: "uint256", + }, + ], + name: "schedule", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + internalType: "address[]", + name: "targets", + type: "address[]", + }, + { + internalType: "uint256[]", + name: "values", + type: "uint256[]", + }, + { + internalType: "bytes[]", + name: "datas", + type: "bytes[]", + }, + { + internalType: "bytes32", + name: "predecessor", + type: "bytes32", + }, + { + internalType: "bytes32", + name: "salt", + type: "bytes32", + }, + { + internalType: "uint256", + name: "delay", + type: "uint256", + }, + ], + name: "scheduleBatch", + 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: [ + { + internalType: "address", + name: "newOwner", + type: "address", + }, + ], + name: "transferOwnership", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + internalType: "bytes", + name: "", + type: "bytes", + }, + ], + name: "usedSignatures", + outputs: [ + { + internalType: "bool", + name: "", + type: "bool", + }, + ], + stateMutability: "view", + type: "function", + }, + { + stateMutability: "payable", + type: "receive", + }, + { + inputs: [ + { + internalType: "address", + name: "_paymentReceivedAddress", + type: "address", + }, + ], + name: "setPaymentReceivedAddress", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + internalType: "uint256", + name: "boxId", + type: "uint256", + }, + { + internalType: "uint256", + name: "_type", + type: "uint256", + }, + { + internalType: "address", + name: "userAddress", + type: "address", + }, + { + internalType: "uint256", + name: "price", + type: "uint256", + }, + { + internalType: "address", + name: "paymentErc20", + type: "address", + }, + { + internalType: "uint256", + name: "saltNonce", + type: "uint256", + }, + { + internalType: "bytes", + name: "signature", + type: "bytes", + }, + ], + name: "payForBoxWithSignature", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + internalType: "uint256", + name: "_boxType", + type: "uint256", + }, + { + internalType: "address", + name: "_paymentErc20", + type: "address", + }, + { + internalType: "uint256", + name: "_price", + type: "uint256", + }, + { + internalType: "uint256", + name: "_saltNonce", + type: "uint256", + }, + ], + name: "getMessageHash", + outputs: [ + { + internalType: "bytes32", + name: "", + type: "bytes32", + }, + ], + stateMutability: "pure", + type: "function", + }, + { + inputs: [], + name: "getMinDelay", + outputs: [ + { + internalType: "uint256", + name: "duration", + type: "uint256", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "uint256", + name: "newDelay", + type: "uint256", + }, + ], + name: "updateDelay", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, +]; + +export const MYSTERY_BOX_ABI = [ + { + 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: "bytes32", + name: "role", + type: "bytes32", + }, + { + indexed: true, + internalType: "bytes32", + name: "previousAdminRole", + type: "bytes32", + }, + { + indexed: true, + internalType: "bytes32", + name: "newAdminRole", + type: "bytes32", + }, + ], + name: "RoleAdminChanged", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "bytes32", + name: "role", + type: "bytes32", + }, + { + indexed: true, + internalType: "address", + name: "account", + type: "address", + }, + { + indexed: true, + internalType: "address", + name: "sender", + type: "address", + }, + ], + name: "RoleGranted", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "bytes32", + name: "role", + type: "bytes32", + }, + { + indexed: true, + internalType: "address", + name: "account", + type: "address", + }, + { + indexed: true, + internalType: "address", + name: "sender", + type: "address", + }, + ], + name: "RoleRevoked", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "address", + name: "from", + type: "address", + }, + { + indexed: true, + internalType: "address", + name: "to", + type: "address", + }, + { + indexed: true, + internalType: "uint256", + name: "tokenId", + type: "uint256", + }, + ], + name: "Transfer", + type: "event", + }, + { + inputs: [], + name: "BURN_ROLE", + outputs: [ + { + internalType: "bytes32", + name: "", + type: "bytes32", + }, + ], + stateMutability: "view", + type: "function", + constant: true, + }, + { + inputs: [], + name: "DEFAULT_ADMIN_ROLE", + outputs: [ + { + internalType: "bytes32", + name: "", + type: "bytes32", + }, + ], + stateMutability: "view", + type: "function", + constant: true, + }, + { + inputs: [], + name: "MINTER_ROLE", + outputs: [ + { + internalType: "bytes32", + name: "", + type: "bytes32", + }, + ], + stateMutability: "view", + type: "function", + constant: true, + }, + { + inputs: [ + { + internalType: "address", + name: "proxy", + type: "address", + }, + ], + name: "addApprovalWhitelist", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "", + type: "address", + }, + ], + name: "approvalWhitelists", + outputs: [ + { + internalType: "bool", + name: "", + type: "bool", + }, + ], + stateMutability: "view", + type: "function", + constant: true, + }, + { + inputs: [ + { + internalType: "address", + name: "to", + type: "address", + }, + { + internalType: "uint256", + name: "tokenId", + type: "uint256", + }, + ], + name: "approve", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "owner", + type: "address", + }, + ], + name: "balanceOf", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + stateMutability: "view", + type: "function", + constant: true, + }, + { + inputs: [ + { + internalType: "address", + name: "owner", + type: "address", + }, + { + internalType: "uint256", + name: "tokenId", + type: "uint256", + }, + ], + name: "burn", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + internalType: "uint256", + name: "tokenId", + type: "uint256", + }, + ], + name: "getApproved", + outputs: [ + { + internalType: "address", + name: "", + type: "address", + }, + ], + stateMutability: "view", + type: "function", + constant: true, + }, + { + inputs: [ + { + internalType: "bytes32", + name: "role", + type: "bytes32", + }, + ], + name: "getRoleAdmin", + outputs: [ + { + internalType: "bytes32", + name: "", + type: "bytes32", + }, + ], + stateMutability: "view", + type: "function", + constant: true, + }, + { + inputs: [ + { + internalType: "bytes32", + name: "role", + type: "bytes32", + }, + { + internalType: "uint256", + name: "index", + type: "uint256", + }, + ], + name: "getRoleMember", + outputs: [ + { + internalType: "address", + name: "", + type: "address", + }, + ], + stateMutability: "view", + type: "function", + constant: true, + }, + { + inputs: [ + { + internalType: "bytes32", + name: "role", + type: "bytes32", + }, + ], + name: "getRoleMemberCount", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + stateMutability: "view", + type: "function", + constant: true, + }, + { + inputs: [ + { + internalType: "bytes32", + name: "role", + type: "bytes32", + }, + { + internalType: "address", + name: "account", + type: "address", + }, + ], + name: "grantRole", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + internalType: "bytes32", + name: "role", + type: "bytes32", + }, + { + internalType: "address", + name: "account", + type: "address", + }, + ], + name: "hasRole", + outputs: [ + { + internalType: "bool", + name: "", + type: "bool", + }, + ], + stateMutability: "view", + type: "function", + constant: true, + }, + { + 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", + constant: true, + }, + { + inputs: [ + { + internalType: "uint256", + name: "tokenId", + type: "uint256", + }, + ], + name: "isLocked", + outputs: [ + { + internalType: "bool", + name: "", + type: "bool", + }, + ], + stateMutability: "view", + type: "function", + constant: true, + }, + { + inputs: [ + { + internalType: "uint256", + name: "tokenId", + type: "uint256", + }, + ], + name: "lock", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + name: "lockedTokens", + outputs: [ + { + internalType: "bool", + name: "", + type: "bool", + }, + ], + stateMutability: "view", + type: "function", + constant: true, + }, + { + inputs: [ + { + internalType: "address", + name: "to", + type: "address", + }, + { + internalType: "uint256", + name: "tokenId", + type: "uint256", + }, + ], + name: "mint", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [], + name: "name", + outputs: [ + { + internalType: "string", + name: "", + type: "string", + }, + ], + stateMutability: "view", + type: "function", + constant: true, + }, + { + inputs: [], + name: "owner", + outputs: [ + { + internalType: "address", + name: "", + type: "address", + }, + ], + stateMutability: "view", + type: "function", + constant: true, + }, + { + inputs: [ + { + internalType: "uint256", + name: "tokenId", + type: "uint256", + }, + ], + name: "ownerOf", + outputs: [ + { + internalType: "address", + name: "", + type: "address", + }, + ], + stateMutability: "view", + type: "function", + constant: true, + }, + { + inputs: [ + { + internalType: "address", + name: "proxy", + type: "address", + }, + ], + name: "removeApprovalWhitelist", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "proxy", + type: "address", + }, + ], + name: "removeBurnProxy", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "factory", + type: "address", + }, + ], + name: "removeMintFactory", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [], + name: "renounceOwnership", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + internalType: "bytes32", + name: "role", + type: "bytes32", + }, + { + internalType: "address", + name: "account", + type: "address", + }, + ], + name: "renounceRole", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + internalType: "bytes32", + name: "role", + type: "bytes32", + }, + { + internalType: "address", + name: "account", + type: "address", + }, + ], + name: "revokeRole", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "from", + type: "address", + }, + { + internalType: "address", + name: "to", + type: "address", + }, + { + internalType: "uint256", + name: "tokenId", + type: "uint256", + }, + ], + name: "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: "address", + name: "proxy", + type: "address", + }, + ], + name: "setBurnProxy", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "factory", + type: "address", + }, + ], + name: "setMintFactory", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + internalType: "bytes4", + name: "interfaceId", + type: "bytes4", + }, + ], + name: "supportsInterface", + outputs: [ + { + internalType: "bool", + name: "", + type: "bool", + }, + ], + stateMutability: "view", + type: "function", + constant: true, + }, + { + inputs: [], + name: "symbol", + outputs: [ + { + internalType: "string", + name: "", + type: "string", + }, + ], + stateMutability: "view", + type: "function", + constant: true, + }, + { + inputs: [ + { + internalType: "uint256", + name: "index", + type: "uint256", + }, + ], + name: "tokenByIndex", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + stateMutability: "view", + type: "function", + constant: true, + }, + { + 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", + constant: true, + }, + { + inputs: [ + { + internalType: "uint256", + name: "tokenId", + type: "uint256", + }, + ], + name: "tokenURI", + outputs: [ + { + internalType: "string", + name: "", + type: "string", + }, + ], + stateMutability: "view", + type: "function", + constant: true, + }, + { + inputs: [], + name: "totalSupply", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + stateMutability: "view", + type: "function", + constant: true, + }, + { + 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: "uint256", + name: "tokenId", + type: "uint256", + }, + ], + name: "unlock", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + internalType: "string", + name: "baseTokenURI", + type: "string", + }, + ], + name: "updateBaseURI", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "user", + type: "address", + }, + { + internalType: "uint256", + name: "start", + type: "uint256", + }, + { + internalType: "uint256", + name: "page", + type: "uint256", + }, + ], + name: "userTokens", + outputs: [ + { + internalType: "uint256[]", + name: "", + type: "uint256[]", + }, + ], + stateMutability: "view", + type: "function", + constant: true, + }, +]; + +export const MYSTERY_PROXY_ABI = [ + { + inputs: [], + stateMutability: "nonpayable", + type: "constructor", + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "address", + name: "to", + type: "address", + }, + { + indexed: true, + internalType: "uint256", + name: "boxId", + type: "uint256", + }, + { + indexed: false, + internalType: "uint256", + name: "val", + type: "uint256", + }, + { + indexed: false, + internalType: "uint256[3]", + name: "ids", + type: "uint256[3]", + }, + { + indexed: false, + internalType: "uint8[3]", + name: "types", + type: "uint8[3]", + }, + ], + name: "BoxOpened", + 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: false, + internalType: "address", + name: "contractAddress", + type: "address", + }, + { + indexed: false, + internalType: "address", + name: "to", + type: "address", + }, + { + indexed: true, + internalType: "uint256", + name: "tokenId", + type: "uint256", + }, + ], + name: "TokenMinted", + type: "event", + }, + { + inputs: [], + name: "TYPE_CHIP", + outputs: [ + { + internalType: "uint8", + name: "", + type: "uint8", + }, + ], + stateMutability: "view", + type: "function", + constant: true, + }, + { + inputs: [], + name: "TYPE_EQUIP", + outputs: [ + { + internalType: "uint8", + name: "", + type: "uint8", + }, + ], + stateMutability: "view", + type: "function", + constant: true, + }, + { + inputs: [], + name: "TYPE_HERO", + outputs: [ + { + internalType: "uint8", + name: "", + type: "uint8", + }, + ], + stateMutability: "view", + type: "function", + constant: true, + }, + { + inputs: [], + name: "TYPE_NONE", + outputs: [ + { + internalType: "uint8", + name: "", + type: "uint8", + }, + ], + stateMutability: "view", + type: "function", + constant: true, + }, + { + inputs: [], + name: "box", + outputs: [ + { + internalType: "contract IMintableERC721", + name: "", + type: "address", + }, + ], + stateMutability: "view", + type: "function", + constant: true, + }, + { + inputs: [ + { + internalType: "address", + name: "signer", + type: "address", + }, + { + internalType: "bytes32", + name: "hash", + type: "bytes32", + }, + { + internalType: "bytes", + name: "signature", + type: "bytes", + }, + ], + name: "checkSigner", + outputs: [], + stateMutability: "pure", + type: "function", + constant: true, + }, + { + inputs: [ + { + internalType: "address", + name: "signer", + type: "address", + }, + { + internalType: "bytes32", + name: "structHash", + type: "bytes32", + }, + { + internalType: "bytes", + name: "signature", + type: "bytes", + }, + ], + name: "checkSigner712", + outputs: [], + stateMutability: "view", + type: "function", + constant: true, + }, + { + inputs: [], + name: "chip", + outputs: [ + { + internalType: "contract IMintableERC721", + name: "", + type: "address", + }, + ], + stateMutability: "view", + type: "function", + constant: true, + }, + { + inputs: [], + name: "equip", + outputs: [ + { + internalType: "contract IMintableERC721", + name: "", + type: "address", + }, + ], + stateMutability: "view", + type: "function", + constant: true, + }, + { + inputs: [], + name: "executor", + outputs: [ + { + internalType: "address", + name: "", + type: "address", + }, + ], + stateMutability: "view", + type: "function", + constant: true, + }, + { + inputs: [], + name: "hero", + outputs: [ + { + internalType: "contract IMintableERC721", + name: "", + type: "address", + }, + ], + stateMutability: "view", + type: "function", + constant: true, + }, + { + inputs: [], + name: "owner", + outputs: [ + { + internalType: "address", + name: "", + type: "address", + }, + ], + stateMutability: "view", + type: "function", + constant: true, + }, + { + inputs: [], + name: "renounceOwnership", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "newOwner", + type: "address", + }, + ], + name: "transferOwnership", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + internalType: "bytes", + name: "", + type: "bytes", + }, + ], + name: "usedSignatures", + outputs: [ + { + internalType: "bool", + name: "", + type: "bool", + }, + ], + stateMutability: "view", + type: "function", + constant: true, + }, + { + inputs: [ + { + internalType: "address[4]", + name: "_erc721s", + type: "address[4]", + }, + ], + name: "init", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "account", + type: "address", + }, + ], + name: "updateExecutor", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "to", + type: "address", + }, + { + internalType: "uint256", + name: "tokenId", + type: "uint256", + }, + ], + name: "mintBoxTo", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + internalType: "uint256", + name: "boxId", + type: "uint256", + }, + { + internalType: "uint256[3]", + name: "ids", + type: "uint256[3]", + }, + { + internalType: "uint256", + name: "saltNonce", + type: "uint256", + }, + { + internalType: "bytes", + name: "signature", + type: "bytes", + }, + ], + name: "openBox", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + internalType: "uint256", + name: "_boxId", + type: "uint256", + }, + { + internalType: "uint256", + name: "_firstToken", + type: "uint256", + }, + { + internalType: "uint256", + name: "_secondToken", + type: "uint256", + }, + { + internalType: "uint256", + name: "_thirdToken", + type: "uint256", + }, + { + internalType: "uint256", + name: "_saltNonce", + type: "uint256", + }, + ], + name: "getMessageHash", + outputs: [ + { + internalType: "bytes32", + name: "", + type: "bytes32", + }, + ], + stateMutability: "pure", + type: "function", + constant: true, + }, +]; + +export const ACTIVATE_PROXY_ABI = [ + { + inputs: [], + stateMutability: "nonpayable", + type: "constructor", + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "address", + name: "to", + type: "address", + }, + { + indexed: true, + internalType: "uint256", + name: "nftOld", + type: "uint256", + }, + { + indexed: false, + internalType: "uint256", + name: "nftNew", + type: "uint256", + }, + { + indexed: false, + internalType: "uint256", + name: "nftType", + type: "uint256", + }, + ], + name: "LogNFTActivate", + 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", + }, + { + inputs: [], + name: "TYPE_CHIP", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + stateMutability: "view", + type: "function", + constant: true, + }, + { + inputs: [], + name: "TYPE_EQUIP", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + stateMutability: "view", + type: "function", + constant: true, + }, + { + inputs: [], + name: "TYPE_HERO", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + stateMutability: "view", + type: "function", + constant: true, + }, + { + inputs: [], + name: "TYPE_NONE", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + stateMutability: "view", + type: "function", + constant: true, + }, + { + inputs: [ + { + internalType: "address", + name: "signer", + type: "address", + }, + { + internalType: "bytes32", + name: "hash", + type: "bytes32", + }, + { + internalType: "bytes", + name: "signature", + type: "bytes", + }, + ], + name: "checkSigner", + outputs: [], + stateMutability: "pure", + type: "function", + constant: true, + }, + { + inputs: [ + { + internalType: "address", + name: "signer", + type: "address", + }, + { + internalType: "bytes32", + name: "structHash", + type: "bytes32", + }, + { + internalType: "bytes", + name: "signature", + type: "bytes", + }, + ], + name: "checkSigner712", + outputs: [], + stateMutability: "view", + type: "function", + constant: true, + }, + { + inputs: [], + name: "chip", + outputs: [ + { + internalType: "contract IMintableERC721", + name: "", + type: "address", + }, + ], + stateMutability: "view", + type: "function", + constant: true, + }, + { + inputs: [], + name: "equip", + outputs: [ + { + internalType: "contract IMintableERC721", + name: "", + type: "address", + }, + ], + stateMutability: "view", + type: "function", + constant: true, + }, + { + inputs: [], + name: "executor", + outputs: [ + { + internalType: "address", + name: "", + type: "address", + }, + ], + stateMutability: "view", + type: "function", + constant: true, + }, + { + inputs: [], + name: "hero", + outputs: [ + { + internalType: "contract IMintableERC721", + name: "", + type: "address", + }, + ], + stateMutability: "view", + type: "function", + constant: true, + }, + { + inputs: [], + name: "owner", + outputs: [ + { + internalType: "address", + name: "", + type: "address", + }, + ], + stateMutability: "view", + type: "function", + constant: true, + }, + { + inputs: [], + name: "renounceOwnership", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "newOwner", + type: "address", + }, + ], + name: "transferOwnership", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + internalType: "bytes", + name: "", + type: "bytes", + }, + ], + name: "usedSignatures", + outputs: [ + { + internalType: "bool", + name: "", + type: "bool", + }, + ], + stateMutability: "view", + type: "function", + constant: true, + }, + { + inputs: [ + { + internalType: "address[3]", + name: "_erc721s", + type: "address[3]", + }, + ], + name: "init", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "account", + type: "address", + }, + ], + name: "updateExecutor", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + internalType: "uint256", + name: "nftOld", + type: "uint256", + }, + { + internalType: "uint256", + name: "nftNew", + type: "uint256", + }, + { + internalType: "uint256", + name: "nftType", + type: "uint256", + }, + { + internalType: "uint256", + name: "saltNonce", + type: "uint256", + }, + { + internalType: "bytes", + name: "signature", + type: "bytes", + }, + ], + name: "activateOne", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "_owner", + type: "address", + }, + { + internalType: "uint256", + name: "_nftOld", + type: "uint256", + }, + { + internalType: "uint256", + name: "_nftNew", + type: "uint256", + }, + { + internalType: "uint256", + name: "_nftType", + type: "uint256", + }, + { + internalType: "uint256", + name: "_saltNonce", + type: "uint256", + }, + ], + name: "getMessageHash", + outputs: [ + { + internalType: "bytes32", + name: "", + type: "bytes32", + }, + ], + stateMutability: "pure", + type: "function", + constant: true, + }, +]; + +export const MEDAL_REWARDS_ABI = [ + { + inputs: [ + { + internalType: "address", + name: "_nftTarget", + type: "address", + }, + { + internalType: "address[]", + name: "_manageAddress", + type: "address[]", + }, + ], + stateMutability: "nonpayable", + type: "constructor", + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "address", + name: "user", + type: "address", + }, + { + indexed: true, + internalType: "address", + name: "nft", + type: "address", + }, + { + indexed: false, + internalType: "uint256[]", + name: "nftSIds", + type: "uint256[]", + }, + { + indexed: false, + internalType: "uint256[]", + name: "nftTIds", + type: "uint256[]", + }, + ], + name: "Minted", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "bytes32", + name: "role", + type: "bytes32", + }, + { + indexed: true, + internalType: "bytes32", + name: "previousAdminRole", + type: "bytes32", + }, + { + indexed: true, + internalType: "bytes32", + name: "newAdminRole", + type: "bytes32", + }, + ], + name: "RoleAdminChanged", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "bytes32", + name: "role", + type: "bytes32", + }, + { + indexed: true, + internalType: "address", + name: "account", + type: "address", + }, + { + indexed: true, + internalType: "address", + name: "sender", + type: "address", + }, + ], + name: "RoleGranted", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "bytes32", + name: "role", + type: "bytes32", + }, + { + indexed: true, + internalType: "address", + name: "account", + type: "address", + }, + { + indexed: true, + internalType: "address", + name: "sender", + type: "address", + }, + ], + name: "RoleRevoked", + type: "event", + }, + { + inputs: [], + name: "DEFAULT_ADMIN_ROLE", + outputs: [ + { + internalType: "bytes32", + name: "", + type: "bytes32", + }, + ], + stateMutability: "view", + type: "function", + constant: true, }, { inputs: [], @@ -142,120 +3227,120 @@ export const ERC20ABI = [ { internalType: "bytes32", name: "", - type: "bytes32" - } + type: "bytes32", + }, ], stateMutability: "view", type: "function", - constant: true + constant: true, }, { inputs: [ { internalType: "bytes32", name: "role", - type: "bytes32" - } + type: "bytes32", + }, ], name: "getRoleAdmin", outputs: [ { internalType: "bytes32", name: "", - type: "bytes32" - } + type: "bytes32", + }, ], stateMutability: "view", type: "function", - constant: true + constant: true, }, { inputs: [ { internalType: "bytes32", name: "role", - type: "bytes32" + type: "bytes32", }, { internalType: "uint256", name: "index", - type: "uint256" - } + type: "uint256", + }, ], name: "getRoleMember", outputs: [ { internalType: "address", name: "", - type: "address" - } + type: "address", + }, ], stateMutability: "view", type: "function", - constant: true + constant: true, }, { inputs: [ { internalType: "bytes32", name: "role", - type: "bytes32" - } + type: "bytes32", + }, ], name: "getRoleMemberCount", outputs: [ { internalType: "uint256", name: "", - type: "uint256" - } + type: "uint256", + }, ], stateMutability: "view", type: "function", - constant: true + constant: true, }, { inputs: [ { internalType: "bytes32", name: "role", - type: "bytes32" + type: "bytes32", }, { internalType: "address", name: "account", - type: "address" - } + type: "address", + }, ], name: "grantRole", outputs: [], stateMutability: "nonpayable", - type: "function" + type: "function", }, { inputs: [ { internalType: "bytes32", name: "role", - type: "bytes32" + type: "bytes32", }, { internalType: "address", name: "account", - type: "address" - } + type: "address", + }, ], name: "hasRole", outputs: [ { internalType: "bool", name: "", - type: "bool" - } + type: "bool", + }, ], stateMutability: "view", type: "function", - constant: true + constant: true, }, { inputs: [], @@ -264,2984 +3349,1109 @@ export const ERC20ABI = [ { internalType: "contract IBEERC721", name: "", - type: "address" - } + type: "address", + }, ], stateMutability: "view", type: "function", - constant: true + constant: true, }, { inputs: [ { internalType: "uint256", name: "", - type: "uint256" - } + type: "uint256", + }, ], name: "nftMinted", outputs: [ { internalType: "bool", name: "", - type: "bool" - } + type: "bool", + }, ], stateMutability: "view", type: "function", - constant: true + constant: true, }, { inputs: [ { internalType: "address", name: "", - type: "address" + type: "address", }, { internalType: "uint256", name: "", - type: "uint256" - } + type: "uint256", + }, ], name: "ownerToNFTs", outputs: [ { internalType: "uint256", name: "", - type: "uint256" - } + type: "uint256", + }, ], stateMutability: "view", type: "function", - constant: true + constant: true, }, { inputs: [ { internalType: "bytes32", name: "role", - type: "bytes32" + type: "bytes32", }, { internalType: "address", name: "account", - type: "address" - } + type: "address", + }, ], name: "renounceRole", outputs: [], stateMutability: "nonpayable", - type: "function" + type: "function", }, { inputs: [ { internalType: "bytes32", name: "role", - type: "bytes32" + type: "bytes32", }, { internalType: "address", name: "account", - type: "address" - } + type: "address", + }, ], name: "revokeRole", outputs: [], stateMutability: "nonpayable", - type: "function" + type: "function", }, { inputs: [ { internalType: "bytes4", name: "interfaceId", - type: "bytes4" - } + type: "bytes4", + }, ], name: "supportsInterface", outputs: [ { internalType: "bool", name: "", - type: "bool" - } + type: "bool", + }, ], stateMutability: "view", type: "function", - constant: true + constant: true, }, { inputs: [ { internalType: "address", name: "_user", - type: "address" + type: "address", }, { internalType: "uint256", name: "count", - type: "uint256" - } + type: "uint256", + }, ], name: "mintToUser", outputs: [], stateMutability: "nonpayable", - type: "function" + type: "function", }, { inputs: [ { internalType: "address", name: "_user", - type: "address" + type: "address", }, { internalType: "uint256[]", name: "_nftIds", - type: "uint256[]" - } + type: "uint256[]", + }, ], name: "addNFTData", outputs: [], stateMutability: "nonpayable", - type: "function" + type: "function", }, { inputs: [ { internalType: "address", name: "_user", - type: "address" - } + type: "address", + }, ], name: "getMintableCount", outputs: [ { internalType: "uint256", name: "", - type: "uint256" - } + type: "uint256", + }, ], stateMutability: "view", type: "function", - constant: true + constant: true, }, { inputs: [ { internalType: "address", name: "_user", - type: "address" - } + type: "address", + }, ], name: "getMintableNftIds", outputs: [ { internalType: "uint256[]", name: "", - type: "uint256[]" - } + type: "uint256[]", + }, ], stateMutability: "view", type: "function", - constant: true - } -] - -export const MALL_ABI = [ + constant: true, + }, +]; +export const LIMIT_ABI = [ { inputs: [ { - internalType: 'address[]', - name: 'proposers', - type: 'address[]' + internalType: "string", + name: "_name", + type: "string", }, { - internalType: 'address[]', - name: 'executors', - type: 'address[]' - } + internalType: "string", + name: "_symbol", + type: "string", + }, + { + internalType: "uint256", + name: "_supplyLimt", + type: "uint256", + }, ], - stateMutability: 'nonpayable', - type: 'constructor' + stateMutability: "nonpayable", + type: "constructor", }, { anonymous: false, inputs: [ { indexed: true, - internalType: 'uint256', - name: 'boxId', - type: 'uint256' + internalType: "address", + name: "owner", + type: "address", }, { indexed: true, - internalType: 'address', - name: 'buyer', - type: 'address' + internalType: "address", + name: "approved", + type: "address", }, { - indexed: false, - internalType: 'uint256', - name: 'boxType', - type: 'uint256' + indexed: true, + internalType: "uint256", + name: "tokenId", + type: "uint256", }, - { - indexed: false, - internalType: 'uint256', - name: 'price', - type: 'uint256' - }, - { - indexed: false, - internalType: 'address', - name: 'paymentToken', - type: 'address' - } ], - name: 'BEBoxPaid', - type: 'event' + name: "Approval", + type: "event", }, { anonymous: false, inputs: [ { indexed: true, - internalType: 'bytes32', - name: 'id', - type: 'bytes32' + internalType: "address", + name: "owner", + type: "address", }, { indexed: true, - internalType: 'uint256', - name: 'index', - type: 'uint256' + internalType: "address", + name: "operator", + type: "address", }, { indexed: false, - internalType: 'address', - name: 'target', - type: 'address' + internalType: "bool", + name: "approved", + type: "bool", + }, + ], + name: "ApprovalForAll", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "address", + name: "to", + type: "address", }, { indexed: false, - internalType: 'uint256', - name: 'value', - type: 'uint256' + internalType: "uint256[]", + name: "tokenIds", + type: "uint256[]", }, - { - indexed: false, - internalType: 'bytes', - name: 'data', - type: 'bytes' - } ], - name: 'CallExecuted', - type: 'event' + name: "BatchMint", + type: "event", }, { anonymous: false, inputs: [ { indexed: true, - internalType: 'bytes32', - name: 'id', - type: 'bytes32' + internalType: "uint256", + name: "tokenId", + type: "uint256", }, - { - indexed: true, - internalType: 'uint256', - name: 'index', - type: 'uint256' - }, - { - indexed: false, - internalType: 'address', - name: 'target', - type: 'address' - }, - { - indexed: false, - internalType: 'uint256', - name: 'value', - type: 'uint256' - }, - { - indexed: false, - internalType: 'bytes', - name: 'data', - type: 'bytes' - }, - { - indexed: false, - internalType: 'bytes32', - name: 'predecessor', - type: 'bytes32' - }, - { - indexed: false, - internalType: 'uint256', - name: 'delay', - type: 'uint256' - } ], - name: 'CallScheduled', - type: 'event' + name: "Lock", + type: "event", }, { anonymous: false, inputs: [ { indexed: true, - internalType: 'bytes32', - name: 'id', - type: 'bytes32' - } - ], - name: 'Cancelled', - type: 'event' - }, - { - anonymous: false, - inputs: [ - { - indexed: false, - internalType: 'uint256', - name: 'oldDuration', - type: 'uint256' + internalType: "bytes32", + name: "role", + type: "bytes32", }, { - indexed: false, - internalType: 'uint256', - name: 'newDuration', - type: 'uint256' - } + indexed: true, + internalType: "bytes32", + name: "previousAdminRole", + type: "bytes32", + }, + { + indexed: true, + internalType: "bytes32", + name: "newAdminRole", + type: "bytes32", + }, ], - name: 'MinDelayChange', - type: 'event' + name: "RoleAdminChanged", + type: "event", }, { anonymous: false, inputs: [ { indexed: true, - internalType: 'address', - name: 'previousOwner', - type: 'address' + internalType: "bytes32", + name: "role", + type: "bytes32", }, { indexed: true, - internalType: 'address', - name: 'newOwner', - type: 'address' - } + internalType: "address", + name: "account", + type: "address", + }, + { + indexed: true, + internalType: "address", + name: "sender", + type: "address", + }, ], - name: 'OwnershipTransferred', - type: 'event' + name: "RoleGranted", + type: "event", }, { anonymous: false, inputs: [ { indexed: true, - internalType: 'bytes32', - name: 'role', - type: 'bytes32' + internalType: "bytes32", + name: "role", + type: "bytes32", }, { indexed: true, - internalType: 'bytes32', - name: 'previousAdminRole', - type: 'bytes32' + internalType: "address", + name: "account", + type: "address", }, { indexed: true, - internalType: 'bytes32', - name: 'newAdminRole', - type: 'bytes32' - } + internalType: "address", + name: "sender", + type: "address", + }, ], - name: 'RoleAdminChanged', - type: 'event' + name: "RoleRevoked", + type: "event", }, { anonymous: false, inputs: [ { indexed: true, - internalType: 'bytes32', - name: 'role', - type: 'bytes32' + internalType: "address", + name: "from", + type: "address", }, { indexed: true, - internalType: 'address', - name: 'account', - type: 'address' + internalType: "address", + name: "to", + type: "address", }, { indexed: true, - internalType: 'address', - name: 'sender', - type: 'address' - } + internalType: "uint256", + name: "tokenId", + type: "uint256", + }, ], - name: 'RoleGranted', - type: 'event' + name: "Transfer", + type: "event", }, { anonymous: false, inputs: [ { indexed: true, - internalType: 'bytes32', - name: 'role', - type: 'bytes32' + internalType: "uint256", + name: "tokenId", + type: "uint256", }, - { - indexed: true, - internalType: 'address', - name: 'account', - type: 'address' - }, - { - indexed: true, - internalType: 'address', - name: 'sender', - type: 'address' - } ], - name: 'RoleRevoked', - type: 'event' + name: "UnLock", + type: "event", }, { inputs: [], - name: 'DEFAULT_ADMIN_ROLE', + name: "BURN_ROLE", outputs: [ { - internalType: 'bytes32', - name: '', - type: 'bytes32' - } + internalType: "bytes32", + name: "", + type: "bytes32", + }, ], - stateMutability: 'view', - type: 'function' + stateMutability: "view", + type: "function", + constant: true, }, { inputs: [], - name: 'EXECUTOR_ROLE', + name: "DEFAULT_ADMIN_ROLE", outputs: [ { - internalType: 'bytes32', - name: '', - type: 'bytes32' - } + internalType: "bytes32", + name: "", + type: "bytes32", + }, ], - stateMutability: 'view', - type: 'function' + stateMutability: "view", + type: "function", + constant: true, }, { inputs: [], - name: 'MAX_DELAY', + name: "LOCK_ROLE", outputs: [ { - internalType: 'uint256', - name: '', - type: 'uint256' - } + internalType: "bytes32", + name: "", + type: "bytes32", + }, ], - stateMutability: 'view', - type: 'function' + stateMutability: "view", + type: "function", + constant: true, }, { inputs: [], - name: 'MIN_DELAY', + name: "MINTER_ROLE", outputs: [ { - internalType: 'uint256', - name: '', - type: 'uint256' - } + internalType: "bytes32", + name: "", + type: "bytes32", + }, ], - stateMutability: 'view', - type: 'function' + stateMutability: "view", + type: "function", + constant: true, + }, + { + inputs: [ + { + internalType: "address", + name: "to", + type: "address", + }, + { + internalType: "uint256", + name: "tokenId", + type: "uint256", + }, + ], + name: "approve", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "owner", + type: "address", + }, + ], + name: "balanceOf", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + stateMutability: "view", + type: "function", + constant: true, + }, + { + inputs: [ + { + internalType: "uint256", + name: "tokenId", + type: "uint256", + }, + ], + name: "getApproved", + outputs: [ + { + internalType: "address", + name: "", + type: "address", + }, + ], + stateMutability: "view", + type: "function", + constant: true, + }, + { + inputs: [ + { + internalType: "bytes32", + name: "role", + type: "bytes32", + }, + ], + name: "getRoleAdmin", + outputs: [ + { + internalType: "bytes32", + name: "", + type: "bytes32", + }, + ], + stateMutability: "view", + type: "function", + constant: true, + }, + { + inputs: [ + { + internalType: "bytes32", + name: "role", + type: "bytes32", + }, + { + internalType: "address", + name: "account", + type: "address", + }, + ], + name: "grantRole", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + internalType: "bytes32", + name: "role", + type: "bytes32", + }, + { + internalType: "address", + name: "account", + type: "address", + }, + ], + name: "hasRole", + outputs: [ + { + internalType: "bool", + name: "", + type: "bool", + }, + ], + stateMutability: "view", + type: "function", + constant: true, + }, + { + 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", + constant: true, + }, + { + inputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + name: "lockedTokens", + outputs: [ + { + internalType: "bool", + name: "", + type: "bool", + }, + ], + stateMutability: "view", + type: "function", + constant: true, }, { inputs: [], - name: 'PROPOSER_ROLE', + name: "name", outputs: [ { - internalType: 'bytes32', - name: '', - type: 'bytes32' - } + internalType: "string", + name: "", + type: "string", + }, ], - stateMutability: 'view', - type: 'function' + stateMutability: "view", + type: "function", + constant: true, + }, + { + inputs: [ + { + internalType: "uint256", + name: "tokenId", + type: "uint256", + }, + ], + name: "ownerOf", + outputs: [ + { + internalType: "address", + name: "", + type: "address", + }, + ], + stateMutability: "view", + type: "function", + constant: true, + }, + { + inputs: [ + { + internalType: "bytes32", + name: "role", + type: "bytes32", + }, + { + internalType: "address", + name: "account", + type: "address", + }, + ], + name: "renounceRole", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + internalType: "bytes32", + name: "role", + type: "bytes32", + }, + { + internalType: "address", + name: "account", + type: "address", + }, + ], + name: "revokeRole", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "from", + type: "address", + }, + { + internalType: "address", + name: "to", + type: "address", + }, + { + internalType: "uint256", + name: "tokenId", + type: "uint256", + }, + ], + name: "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: [], - name: 'TIMELOCK_ADMIN_ROLE', + name: "supplyLimit", outputs: [ { - internalType: 'bytes32', - name: '', - type: 'bytes32' - } + internalType: "uint256", + name: "", + type: "uint256", + }, ], - stateMutability: 'view', - type: 'function' + stateMutability: "view", + type: "function", + constant: true, }, { inputs: [], - name: 'address_initialized', + name: "symbol", outputs: [ { - internalType: 'bool', - name: '', - type: 'bool' - } + internalType: "string", + name: "", + type: "string", + }, ], - stateMutability: 'view', - type: 'function' + stateMutability: "view", + type: "function", + constant: true, }, { inputs: [ { - internalType: 'bytes32', - name: 'id', - type: 'bytes32' - } + internalType: "uint256", + name: "index", + type: "uint256", + }, ], - name: 'cancel', - outputs: [], - stateMutability: 'nonpayable', - type: 'function' - }, - { - inputs: [ - { - internalType: 'address', - name: 'signer', - type: 'address' - }, - { - internalType: 'bytes32', - name: 'hash', - type: 'bytes32' - }, - { - internalType: 'bytes', - name: 'signature', - type: 'bytes' - } - ], - name: 'checkSigner', - outputs: [], - stateMutability: 'pure', - type: 'function' - }, - { - inputs: [ - { - internalType: 'address', - name: 'signer', - type: 'address' - }, - { - internalType: 'bytes32', - name: 'structHash', - type: 'bytes32' - }, - { - internalType: 'bytes', - name: 'signature', - type: 'bytes' - } - ], - name: 'checkSigner712', - outputs: [], - stateMutability: 'view', - type: 'function' - }, - { - inputs: [ - { - internalType: 'address', - name: 'target', - type: 'address' - }, - { - internalType: 'uint256', - name: 'value', - type: 'uint256' - }, - { - internalType: 'bytes', - name: 'data', - type: 'bytes' - }, - { - internalType: 'bytes32', - name: 'predecessor', - type: 'bytes32' - }, - { - internalType: 'bytes32', - name: 'salt', - type: 'bytes32' - } - ], - name: 'execute', - outputs: [], - stateMutability: 'payable', - type: 'function' - }, - { - inputs: [ - { - internalType: 'address[]', - name: 'targets', - type: 'address[]' - }, - { - internalType: 'uint256[]', - name: 'values', - type: 'uint256[]' - }, - { - internalType: 'bytes[]', - name: 'datas', - type: 'bytes[]' - }, - { - internalType: 'bytes32', - name: 'predecessor', - type: 'bytes32' - }, - { - internalType: 'bytes32', - name: 'salt', - type: 'bytes32' - } - ], - name: 'executeBatch', - outputs: [], - stateMutability: 'payable', - type: 'function' - }, - { - inputs: [ - { - internalType: 'bytes32', - name: 'role', - type: 'bytes32' - } - ], - name: 'getRoleAdmin', + name: "tokenByIndex", outputs: [ { - internalType: 'bytes32', - name: '', - type: 'bytes32' - } + internalType: "uint256", + name: "", + type: "uint256", + }, ], - stateMutability: 'view', - type: 'function' + stateMutability: "view", + type: "function", + constant: true, }, { inputs: [ { - internalType: 'bytes32', - name: 'id', - type: 'bytes32' - } + internalType: "address", + name: "owner", + type: "address", + }, + { + internalType: "uint256", + name: "index", + type: "uint256", + }, ], - name: 'getTimestamp', + name: "tokenOfOwnerByIndex", outputs: [ { - internalType: 'uint256', - name: 'timestamp', - type: 'uint256' - } + internalType: "uint256", + name: "", + type: "uint256", + }, ], - stateMutability: 'view', - type: 'function' + stateMutability: "view", + type: "function", + constant: true, }, { inputs: [ { - internalType: 'bytes32', - name: 'role', - type: 'bytes32' + internalType: "uint256", + name: "tokenId", + type: "uint256", }, - { - internalType: 'address', - name: 'account', - type: 'address' - } ], - name: 'grantRole', - outputs: [], - stateMutability: 'nonpayable', - type: 'function' - }, - { - inputs: [ - { - internalType: 'bytes32', - name: 'role', - type: 'bytes32' - }, - { - internalType: 'address', - name: 'account', - type: 'address' - } - ], - name: 'hasRole', + name: "tokenURI", outputs: [ { - internalType: 'bool', - name: '', - type: 'bool' - } - ], - stateMutability: 'view', - type: 'function' - }, - { - inputs: [ - { - internalType: 'address', - name: 'target', - type: 'address' + internalType: "string", + name: "", + type: "string", }, - { - internalType: 'uint256', - name: 'value', - type: 'uint256' - }, - { - internalType: 'bytes', - name: 'data', - type: 'bytes' - }, - { - internalType: 'bytes32', - name: 'predecessor', - type: 'bytes32' - }, - { - internalType: 'bytes32', - name: 'salt', - type: 'bytes32' - } ], - name: 'hashOperation', - outputs: [ - { - internalType: 'bytes32', - name: 'hash', - type: 'bytes32' - } - ], - stateMutability: 'pure', - type: 'function' - }, - { - inputs: [ - { - internalType: 'address[]', - name: 'targets', - type: 'address[]' - }, - { - internalType: 'uint256[]', - name: 'values', - type: 'uint256[]' - }, - { - internalType: 'bytes[]', - name: 'datas', - type: 'bytes[]' - }, - { - internalType: 'bytes32', - name: 'predecessor', - type: 'bytes32' - }, - { - internalType: 'bytes32', - name: 'salt', - type: 'bytes32' - } - ], - name: 'hashOperationBatch', - outputs: [ - { - internalType: 'bytes32', - name: 'hash', - type: 'bytes32' - } - ], - stateMutability: 'pure', - type: 'function' - }, - { - inputs: [ - { - internalType: 'bytes32', - name: 'id', - type: 'bytes32' - } - ], - name: 'isOperation', - outputs: [ - { - internalType: 'bool', - name: 'pending', - type: 'bool' - } - ], - stateMutability: 'view', - type: 'function' - }, - { - inputs: [ - { - internalType: 'bytes32', - name: 'id', - type: 'bytes32' - } - ], - name: 'isOperationDone', - outputs: [ - { - internalType: 'bool', - name: 'done', - type: 'bool' - } - ], - stateMutability: 'view', - type: 'function' - }, - { - inputs: [ - { - internalType: 'bytes32', - name: 'id', - type: 'bytes32' - } - ], - name: 'isOperationPending', - outputs: [ - { - internalType: 'bool', - name: 'pending', - type: 'bool' - } - ], - stateMutability: 'view', - type: 'function' - }, - { - inputs: [ - { - internalType: 'bytes32', - name: 'id', - type: 'bytes32' - } - ], - name: 'isOperationReady', - outputs: [ - { - internalType: 'bool', - name: 'ready', - type: 'bool' - } - ], - stateMutability: 'view', - type: 'function' + stateMutability: "view", + type: "function", + constant: true, }, { inputs: [], - name: 'owner', + name: "totalSupply", outputs: [ { - internalType: 'address', - name: '', - type: 'address' - } + internalType: "uint256", + name: "", + type: "uint256", + }, ], - stateMutability: 'view', - type: 'function' + stateMutability: "view", + type: "function", + constant: true, }, { - inputs: [], - name: 'paymentReceivedAddress', - outputs: [ + inputs: [ { - internalType: 'address', - name: '', - type: 'address' - } + internalType: "address", + name: "from", + type: "address", + }, + { + internalType: "address", + name: "to", + type: "address", + }, + { + internalType: "uint256", + name: "tokenId", + type: "uint256", + }, ], - stateMutability: 'view', - type: 'function' - }, - { - inputs: [], - name: 'renounceOwnership', + name: "transferFrom", outputs: [], - stateMutability: 'nonpayable', - type: 'function' + stateMutability: "nonpayable", + type: "function", }, { inputs: [ { - internalType: 'bytes32', - name: 'role', - type: 'bytes32' + internalType: "string", + name: "baseURI_", + type: "string", }, - { - internalType: 'address', - name: 'account', - type: 'address' - } ], - name: 'renounceRole', + name: "setBaseURI", outputs: [], - stateMutability: 'nonpayable', - type: 'function' + stateMutability: "nonpayable", + type: "function", }, { inputs: [ { - internalType: 'bytes32', - name: 'role', - type: 'bytes32' + internalType: "address", + name: "to", + type: "address", }, { - internalType: 'address', - name: 'account', - type: 'address' - } + internalType: "uint256", + name: "count", + type: "uint256", + }, ], - name: 'revokeRole', + name: "batchMint", + outputs: [ + { + internalType: "uint256[]", + name: "", + type: "uint256[]", + }, + ], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "to", + type: "address", + }, + ], + name: "setMintRole", outputs: [], - stateMutability: 'nonpayable', - type: 'function' + stateMutability: "nonpayable", + type: "function", }, { inputs: [ { - internalType: 'address', - name: 'target', - type: 'address' + internalType: "address", + name: "to", + type: "address", }, - { - internalType: 'uint256', - name: 'value', - type: 'uint256' - }, - { - internalType: 'bytes', - name: 'data', - type: 'bytes' - }, - { - internalType: 'bytes32', - name: 'predecessor', - type: 'bytes32' - }, - { - internalType: 'bytes32', - name: 'salt', - type: 'bytes32' - }, - { - internalType: 'uint256', - name: 'delay', - type: 'uint256' - } ], - name: 'schedule', + name: "removeMintRole", outputs: [], - stateMutability: 'nonpayable', - type: 'function' + stateMutability: "nonpayable", + type: "function", }, { inputs: [ { - internalType: 'address[]', - name: 'targets', - type: 'address[]' + internalType: "address", + name: "to", + type: "address", }, - { - internalType: 'uint256[]', - name: 'values', - type: 'uint256[]' - }, - { - internalType: 'bytes[]', - name: 'datas', - type: 'bytes[]' - }, - { - internalType: 'bytes32', - name: 'predecessor', - type: 'bytes32' - }, - { - internalType: 'bytes32', - name: 'salt', - type: 'bytes32' - }, - { - internalType: 'uint256', - name: 'delay', - type: 'uint256' - } ], - name: 'scheduleBatch', + name: "setBurnRole", outputs: [], - stateMutability: 'nonpayable', - type: 'function' + stateMutability: "nonpayable", + type: "function", }, { inputs: [ { - internalType: 'bytes4', - name: 'interfaceId', - type: 'bytes4' - } + internalType: "address", + name: "proxy", + type: "address", + }, ], - name: 'supportsInterface', - outputs: [ - { - internalType: 'bool', - name: '', - type: 'bool' - } - ], - stateMutability: 'view', - type: 'function' - }, - { - inputs: [ - { - internalType: 'address', - name: 'newOwner', - type: 'address' - } - ], - name: 'transferOwnership', + name: "removeBurnRole", outputs: [], - stateMutability: 'nonpayable', - type: 'function' + stateMutability: "nonpayable", + type: "function", }, { inputs: [ { - internalType: 'bytes', - name: '', - type: 'bytes' - } + internalType: "address", + name: "to", + type: "address", + }, ], - name: 'usedSignatures', - outputs: [ - { - internalType: 'bool', - name: '', - type: 'bool' - } - ], - stateMutability: 'view', - type: 'function' - }, - { - stateMutability: 'payable', - type: 'receive' - }, - { - inputs: [ - { - internalType: 'address', - name: '_paymentReceivedAddress', - type: 'address' - } - ], - name: 'setPaymentReceivedAddress', + name: "grantLockRole", outputs: [], - stateMutability: 'nonpayable', - type: 'function' + stateMutability: "nonpayable", + type: "function", }, { inputs: [ { - internalType: 'uint256', - name: 'boxId', - type: 'uint256' + internalType: "address", + name: "account", + type: "address", }, - { - internalType: 'uint256', - name: '_type', - type: 'uint256' - }, - { - internalType: 'address', - name: 'userAddress', - type: 'address' - }, - { - internalType: 'uint256', - name: 'price', - type: 'uint256' - }, - { - internalType: 'address', - name: 'paymentErc20', - type: 'address' - }, - { - internalType: 'uint256', - name: 'saltNonce', - type: 'uint256' - }, - { - internalType: 'bytes', - name: 'signature', - type: 'bytes' - } ], - name: 'payForBoxWithSignature', + name: "removeLockRole", outputs: [], - stateMutability: 'nonpayable', - type: 'function' + stateMutability: "nonpayable", + type: "function", }, { inputs: [ { - internalType: 'uint256', - name: '_boxType', - type: 'uint256' + internalType: "uint256", + name: "tokenId", + type: "uint256", }, - { - internalType: 'address', - name: '_paymentErc20', - type: 'address' - }, - { - internalType: 'uint256', - name: '_price', - type: 'uint256' - }, - { - internalType: 'uint256', - name: '_saltNonce', - type: 'uint256' - } ], - name: 'getMessageHash', - outputs: [ - { - internalType: 'bytes32', - name: '', - type: 'bytes32' - } - ], - stateMutability: 'pure', - type: 'function' - }, - { - inputs: [], - name: 'getMinDelay', - outputs: [ - { - internalType: 'uint256', - name: 'duration', - type: 'uint256' - } - ], - stateMutability: 'view', - type: 'function' - }, - { - inputs: [ - { - internalType: 'uint256', - name: 'newDelay', - type: 'uint256' - } - ], - name: 'updateDelay', + name: "lock", outputs: [], - stateMutability: 'nonpayable', - type: 'function' - } -] - -export const MYSTERY_BOX_ABI = [ - { - 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: 'bytes32', - name: 'role', - type: 'bytes32' - }, - { - indexed: true, - internalType: 'bytes32', - name: 'previousAdminRole', - type: 'bytes32' - }, - { - indexed: true, - internalType: 'bytes32', - name: 'newAdminRole', - type: 'bytes32' - } - ], - name: 'RoleAdminChanged', - type: 'event' - }, - { - anonymous: false, - inputs: [ - { - indexed: true, - internalType: 'bytes32', - name: 'role', - type: 'bytes32' - }, - { - indexed: true, - internalType: 'address', - name: 'account', - type: 'address' - }, - { - indexed: true, - internalType: 'address', - name: 'sender', - type: 'address' - } - ], - name: 'RoleGranted', - type: 'event' - }, - { - anonymous: false, - inputs: [ - { - indexed: true, - internalType: 'bytes32', - name: 'role', - type: 'bytes32' - }, - { - indexed: true, - internalType: 'address', - name: 'account', - type: 'address' - }, - { - indexed: true, - internalType: 'address', - name: 'sender', - type: 'address' - } - ], - name: 'RoleRevoked', - type: 'event' - }, - { - anonymous: false, - inputs: [ - { - indexed: true, - internalType: 'address', - name: 'from', - type: 'address' - }, - { - indexed: true, - internalType: 'address', - name: 'to', - type: 'address' - }, - { - indexed: true, - internalType: 'uint256', - name: 'tokenId', - type: 'uint256' - } - ], - name: 'Transfer', - type: 'event' - }, - { - inputs: [], - name: 'BURN_ROLE', - outputs: [ - { - internalType: 'bytes32', - name: '', - type: 'bytes32' - } - ], - stateMutability: 'view', - type: 'function', - constant: true - }, - { - inputs: [], - name: 'DEFAULT_ADMIN_ROLE', - outputs: [ - { - internalType: 'bytes32', - name: '', - type: 'bytes32' - } - ], - stateMutability: 'view', - type: 'function', - constant: true - }, - { - inputs: [], - name: 'MINTER_ROLE', - outputs: [ - { - internalType: 'bytes32', - name: '', - type: 'bytes32' - } - ], - stateMutability: 'view', - type: 'function', - constant: true + stateMutability: "nonpayable", + type: "function", }, { inputs: [ { - internalType: 'address', - name: 'proxy', - type: 'address' - } + internalType: "uint256", + name: "tokenId", + type: "uint256", + }, ], - name: 'addApprovalWhitelist', + name: "unlock", outputs: [], - stateMutability: 'nonpayable', - type: 'function' + stateMutability: "nonpayable", + type: "function", }, { inputs: [ { - internalType: 'address', - name: '', - type: 'address' - } + internalType: "uint256", + name: "tokenId", + type: "uint256", + }, ], - name: 'approvalWhitelists', + name: "isLocked", outputs: [ { - internalType: 'bool', - name: '', - type: 'bool' - } + internalType: "bool", + name: "", + type: "bool", + }, ], - stateMutability: 'view', - type: 'function', - constant: true + stateMutability: "view", + type: "function", + constant: true, }, { inputs: [ { - internalType: 'address', - name: 'to', - type: 'address' + internalType: "string", + name: "baseTokenURI", + type: "string", }, - { - internalType: 'uint256', - name: 'tokenId', - type: 'uint256' - } ], - name: 'approve', + name: "updateBaseURI", outputs: [], - stateMutability: 'nonpayable', - type: 'function' + stateMutability: "nonpayable", + type: "function", }, { inputs: [ { - internalType: 'address', - name: 'owner', - type: 'address' - } + internalType: "bytes4", + name: "interfaceId", + type: "bytes4", + }, ], - name: 'balanceOf', + name: "supportsInterface", outputs: [ { - internalType: 'uint256', - name: '', - type: 'uint256' - } + internalType: "bool", + name: "", + type: "bool", + }, ], - stateMutability: 'view', - type: 'function', - constant: true + stateMutability: "view", + type: "function", + constant: true, }, { inputs: [ { - internalType: 'address', - name: 'owner', - type: 'address' + internalType: "address", + name: "owner", + type: "address", }, { - internalType: 'uint256', - name: 'tokenId', - type: 'uint256' - } + internalType: "uint256", + name: "tokenId", + type: "uint256", + }, ], - name: 'burn', + name: "burn", outputs: [], - stateMutability: 'nonpayable', - type: 'function' + stateMutability: "nonpayable", + type: "function", }, - { - inputs: [ - { - internalType: 'uint256', - name: 'tokenId', - type: 'uint256' - } - ], - name: 'getApproved', - outputs: [ - { - internalType: 'address', - name: '', - type: 'address' - } - ], - stateMutability: 'view', - type: 'function', - constant: true - }, - { - inputs: [ - { - internalType: 'bytes32', - name: 'role', - type: 'bytes32' - } - ], - name: 'getRoleAdmin', - outputs: [ - { - internalType: 'bytes32', - name: '', - type: 'bytes32' - } - ], - stateMutability: 'view', - type: 'function', - constant: true - }, - { - inputs: [ - { - internalType: 'bytes32', - name: 'role', - type: 'bytes32' - }, - { - internalType: 'uint256', - name: 'index', - type: 'uint256' - } - ], - name: 'getRoleMember', - outputs: [ - { - internalType: 'address', - name: '', - type: 'address' - } - ], - stateMutability: 'view', - type: 'function', - constant: true - }, - { - inputs: [ - { - internalType: 'bytes32', - name: 'role', - type: 'bytes32' - } - ], - name: 'getRoleMemberCount', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256' - } - ], - stateMutability: 'view', - type: 'function', - constant: true - }, - { - inputs: [ - { - internalType: 'bytes32', - name: 'role', - type: 'bytes32' - }, - { - internalType: 'address', - name: 'account', - type: 'address' - } - ], - name: 'grantRole', - outputs: [], - stateMutability: 'nonpayable', - type: 'function' - }, - { - inputs: [ - { - internalType: 'bytes32', - name: 'role', - type: 'bytes32' - }, - { - internalType: 'address', - name: 'account', - type: 'address' - } - ], - name: 'hasRole', - outputs: [ - { - internalType: 'bool', - name: '', - type: 'bool' - } - ], - stateMutability: 'view', - type: 'function', - constant: true - }, - { - 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', - constant: true - }, - { - inputs: [ - { - internalType: 'uint256', - name: 'tokenId', - type: 'uint256' - } - ], - name: 'isLocked', - outputs: [ - { - internalType: 'bool', - name: '', - type: 'bool' - } - ], - stateMutability: 'view', - type: 'function', - constant: true - }, - { - inputs: [ - { - internalType: 'uint256', - name: 'tokenId', - type: 'uint256' - } - ], - name: 'lock', - outputs: [], - stateMutability: 'nonpayable', - type: 'function' - }, - { - inputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256' - } - ], - name: 'lockedTokens', - outputs: [ - { - internalType: 'bool', - name: '', - type: 'bool' - } - ], - stateMutability: 'view', - type: 'function', - constant: true - }, - { - inputs: [ - { - internalType: 'address', - name: 'to', - type: 'address' - }, - { - internalType: 'uint256', - name: 'tokenId', - type: 'uint256' - } - ], - name: 'mint', - outputs: [], - stateMutability: 'nonpayable', - type: 'function' - }, - { - inputs: [], - name: 'name', - outputs: [ - { - internalType: 'string', - name: '', - type: 'string' - } - ], - stateMutability: 'view', - type: 'function', - constant: true - }, - { - inputs: [], - name: 'owner', - outputs: [ - { - internalType: 'address', - name: '', - type: 'address' - } - ], - stateMutability: 'view', - type: 'function', - constant: true - }, - { - inputs: [ - { - internalType: 'uint256', - name: 'tokenId', - type: 'uint256' - } - ], - name: 'ownerOf', - outputs: [ - { - internalType: 'address', - name: '', - type: 'address' - } - ], - stateMutability: 'view', - type: 'function', - constant: true - }, - { - inputs: [ - { - internalType: 'address', - name: 'proxy', - type: 'address' - } - ], - name: 'removeApprovalWhitelist', - outputs: [], - stateMutability: 'nonpayable', - type: 'function' - }, - { - inputs: [ - { - internalType: 'address', - name: 'proxy', - type: 'address' - } - ], - name: 'removeBurnProxy', - outputs: [], - stateMutability: 'nonpayable', - type: 'function' - }, - { - inputs: [ - { - internalType: 'address', - name: 'factory', - type: 'address' - } - ], - name: 'removeMintFactory', - outputs: [], - stateMutability: 'nonpayable', - type: 'function' - }, - { - inputs: [], - name: 'renounceOwnership', - outputs: [], - stateMutability: 'nonpayable', - type: 'function' - }, - { - inputs: [ - { - internalType: 'bytes32', - name: 'role', - type: 'bytes32' - }, - { - internalType: 'address', - name: 'account', - type: 'address' - } - ], - name: 'renounceRole', - outputs: [], - stateMutability: 'nonpayable', - type: 'function' - }, - { - inputs: [ - { - internalType: 'bytes32', - name: 'role', - type: 'bytes32' - }, - { - internalType: 'address', - name: 'account', - type: 'address' - } - ], - name: 'revokeRole', - outputs: [], - stateMutability: 'nonpayable', - type: 'function' - }, - { - inputs: [ - { - internalType: 'address', - name: 'from', - type: 'address' - }, - { - internalType: 'address', - name: 'to', - type: 'address' - }, - { - internalType: 'uint256', - name: 'tokenId', - type: 'uint256' - } - ], - name: '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: 'address', - name: 'proxy', - type: 'address' - } - ], - name: 'setBurnProxy', - outputs: [], - stateMutability: 'nonpayable', - type: 'function' - }, - { - inputs: [ - { - internalType: 'address', - name: 'factory', - type: 'address' - } - ], - name: 'setMintFactory', - outputs: [], - stateMutability: 'nonpayable', - type: 'function' - }, - { - inputs: [ - { - internalType: 'bytes4', - name: 'interfaceId', - type: 'bytes4' - } - ], - name: 'supportsInterface', - outputs: [ - { - internalType: 'bool', - name: '', - type: 'bool' - } - ], - stateMutability: 'view', - type: 'function', - constant: true - }, - { - inputs: [], - name: 'symbol', - outputs: [ - { - internalType: 'string', - name: '', - type: 'string' - } - ], - stateMutability: 'view', - type: 'function', - constant: true - }, - { - inputs: [ - { - internalType: 'uint256', - name: 'index', - type: 'uint256' - } - ], - name: 'tokenByIndex', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256' - } - ], - stateMutability: 'view', - type: 'function', - constant: true - }, - { - 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', - constant: true - }, - { - inputs: [ - { - internalType: 'uint256', - name: 'tokenId', - type: 'uint256' - } - ], - name: 'tokenURI', - outputs: [ - { - internalType: 'string', - name: '', - type: 'string' - } - ], - stateMutability: 'view', - type: 'function', - constant: true - }, - { - inputs: [], - name: 'totalSupply', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256' - } - ], - stateMutability: 'view', - type: 'function', - constant: true - }, - { - 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: 'uint256', - name: 'tokenId', - type: 'uint256' - } - ], - name: 'unlock', - outputs: [], - stateMutability: 'nonpayable', - type: 'function' - }, - { - inputs: [ - { - internalType: 'string', - name: 'baseTokenURI', - type: 'string' - } - ], - name: 'updateBaseURI', - outputs: [], - stateMutability: 'nonpayable', - type: 'function' - }, - { - inputs: [ - { - internalType: 'address', - name: 'user', - type: 'address' - }, - { - internalType: 'uint256', - name: 'start', - type: 'uint256' - }, - { - internalType: 'uint256', - name: 'page', - type: 'uint256' - } - ], - name: 'userTokens', - outputs: [ - { - internalType: 'uint256[]', - name: '', - type: 'uint256[]' - } - ], - stateMutability: 'view', - type: 'function', - constant: true - } -] - -export const MYSTERY_PROXY_ABI = [ - { - inputs: [], - stateMutability: 'nonpayable', - type: 'constructor' - }, - { - anonymous: false, - inputs: [ - { - indexed: true, - internalType: 'address', - name: 'to', - type: 'address' - }, - { - indexed: true, - internalType: 'uint256', - name: 'boxId', - type: 'uint256' - }, - { - indexed: false, - internalType: 'uint256', - name: 'val', - type: 'uint256' - }, - { - indexed: false, - internalType: 'uint256[3]', - name: 'ids', - type: 'uint256[3]' - }, - { - indexed: false, - internalType: 'uint8[3]', - name: 'types', - type: 'uint8[3]' - } - ], - name: 'BoxOpened', - 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: false, - internalType: 'address', - name: 'contractAddress', - type: 'address' - }, - { - indexed: false, - internalType: 'address', - name: 'to', - type: 'address' - }, - { - indexed: true, - internalType: 'uint256', - name: 'tokenId', - type: 'uint256' - } - ], - name: 'TokenMinted', - type: 'event' - }, - { - inputs: [], - name: 'TYPE_CHIP', - outputs: [ - { - internalType: 'uint8', - name: '', - type: 'uint8' - } - ], - stateMutability: 'view', - type: 'function', - constant: true - }, - { - inputs: [], - name: 'TYPE_EQUIP', - outputs: [ - { - internalType: 'uint8', - name: '', - type: 'uint8' - } - ], - stateMutability: 'view', - type: 'function', - constant: true - }, - { - inputs: [], - name: 'TYPE_HERO', - outputs: [ - { - internalType: 'uint8', - name: '', - type: 'uint8' - } - ], - stateMutability: 'view', - type: 'function', - constant: true - }, - { - inputs: [], - name: 'TYPE_NONE', - outputs: [ - { - internalType: 'uint8', - name: '', - type: 'uint8' - } - ], - stateMutability: 'view', - type: 'function', - constant: true - }, - { - inputs: [], - name: 'box', - outputs: [ - { - internalType: 'contract IMintableERC721', - name: '', - type: 'address' - } - ], - stateMutability: 'view', - type: 'function', - constant: true - }, - { - inputs: [ - { - internalType: 'address', - name: 'signer', - type: 'address' - }, - { - internalType: 'bytes32', - name: 'hash', - type: 'bytes32' - }, - { - internalType: 'bytes', - name: 'signature', - type: 'bytes' - } - ], - name: 'checkSigner', - outputs: [], - stateMutability: 'pure', - type: 'function', - constant: true - }, - { - inputs: [ - { - internalType: 'address', - name: 'signer', - type: 'address' - }, - { - internalType: 'bytes32', - name: 'structHash', - type: 'bytes32' - }, - { - internalType: 'bytes', - name: 'signature', - type: 'bytes' - } - ], - name: 'checkSigner712', - outputs: [], - stateMutability: 'view', - type: 'function', - constant: true - }, - { - inputs: [], - name: 'chip', - outputs: [ - { - internalType: 'contract IMintableERC721', - name: '', - type: 'address' - } - ], - stateMutability: 'view', - type: 'function', - constant: true - }, - { - inputs: [], - name: 'equip', - outputs: [ - { - internalType: 'contract IMintableERC721', - name: '', - type: 'address' - } - ], - stateMutability: 'view', - type: 'function', - constant: true - }, - { - inputs: [], - name: 'executor', - outputs: [ - { - internalType: 'address', - name: '', - type: 'address' - } - ], - stateMutability: 'view', - type: 'function', - constant: true - }, - { - inputs: [], - name: 'hero', - outputs: [ - { - internalType: 'contract IMintableERC721', - name: '', - type: 'address' - } - ], - stateMutability: 'view', - type: 'function', - constant: true - }, - { - inputs: [], - name: 'owner', - outputs: [ - { - internalType: 'address', - name: '', - type: 'address' - } - ], - stateMutability: 'view', - type: 'function', - constant: true - }, - { - inputs: [], - name: 'renounceOwnership', - outputs: [], - stateMutability: 'nonpayable', - type: 'function' - }, - { - inputs: [ - { - internalType: 'address', - name: 'newOwner', - type: 'address' - } - ], - name: 'transferOwnership', - outputs: [], - stateMutability: 'nonpayable', - type: 'function' - }, - { - inputs: [ - { - internalType: 'bytes', - name: '', - type: 'bytes' - } - ], - name: 'usedSignatures', - outputs: [ - { - internalType: 'bool', - name: '', - type: 'bool' - } - ], - stateMutability: 'view', - type: 'function', - constant: true - }, - { - inputs: [ - { - internalType: 'address[4]', - name: '_erc721s', - type: 'address[4]' - } - ], - name: 'init', - outputs: [], - stateMutability: 'nonpayable', - type: 'function' - }, - { - inputs: [ - { - internalType: 'address', - name: 'account', - type: 'address' - } - ], - name: 'updateExecutor', - outputs: [], - stateMutability: 'nonpayable', - type: 'function' - }, - { - inputs: [ - { - internalType: 'address', - name: 'to', - type: 'address' - }, - { - internalType: 'uint256', - name: 'tokenId', - type: 'uint256' - } - ], - name: 'mintBoxTo', - outputs: [], - stateMutability: 'nonpayable', - type: 'function' - }, - { - inputs: [ - { - internalType: 'uint256', - name: 'boxId', - type: 'uint256' - }, - { - internalType: 'uint256[3]', - name: 'ids', - type: 'uint256[3]' - }, - { - internalType: 'uint256', - name: 'saltNonce', - type: 'uint256' - }, - { - internalType: 'bytes', - name: 'signature', - type: 'bytes' - } - ], - name: 'openBox', - outputs: [], - stateMutability: 'nonpayable', - type: 'function' - }, - { - inputs: [ - { - internalType: 'uint256', - name: '_boxId', - type: 'uint256' - }, - { - internalType: 'uint256', - name: '_firstToken', - type: 'uint256' - }, - { - internalType: 'uint256', - name: '_secondToken', - type: 'uint256' - }, - { - internalType: 'uint256', - name: '_thirdToken', - type: 'uint256' - }, - { - internalType: 'uint256', - name: '_saltNonce', - type: 'uint256' - } - ], - name: 'getMessageHash', - outputs: [ - { - internalType: 'bytes32', - name: '', - type: 'bytes32' - } - ], - stateMutability: 'pure', - type: 'function', - constant: true - } -] - -export const ACTIVATE_PROXY_ABI = [ - { - inputs: [], - stateMutability: 'nonpayable', - type: 'constructor' - }, - { - anonymous: false, - inputs: [ - { - indexed: true, - internalType: 'address', - name: 'to', - type: 'address' - }, - { - indexed: true, - internalType: 'uint256', - name: 'nftOld', - type: 'uint256' - }, - { - indexed: false, - internalType: 'uint256', - name: 'nftNew', - type: 'uint256' - }, - { - indexed: false, - internalType: 'uint256', - name: 'nftType', - type: 'uint256' - } - ], - name: 'LogNFTActivate', - 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' - }, - { - inputs: [], - name: 'TYPE_CHIP', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256' - } - ], - stateMutability: 'view', - type: 'function', - constant: true - }, - { - inputs: [], - name: 'TYPE_EQUIP', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256' - } - ], - stateMutability: 'view', - type: 'function', - constant: true - }, - { - inputs: [], - name: 'TYPE_HERO', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256' - } - ], - stateMutability: 'view', - type: 'function', - constant: true - }, - { - inputs: [], - name: 'TYPE_NONE', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256' - } - ], - stateMutability: 'view', - type: 'function', - constant: true - }, - { - inputs: [ - { - internalType: 'address', - name: 'signer', - type: 'address' - }, - { - internalType: 'bytes32', - name: 'hash', - type: 'bytes32' - }, - { - internalType: 'bytes', - name: 'signature', - type: 'bytes' - } - ], - name: 'checkSigner', - outputs: [], - stateMutability: 'pure', - type: 'function', - constant: true - }, - { - inputs: [ - { - internalType: 'address', - name: 'signer', - type: 'address' - }, - { - internalType: 'bytes32', - name: 'structHash', - type: 'bytes32' - }, - { - internalType: 'bytes', - name: 'signature', - type: 'bytes' - } - ], - name: 'checkSigner712', - outputs: [], - stateMutability: 'view', - type: 'function', - constant: true - }, - { - inputs: [], - name: 'chip', - outputs: [ - { - internalType: 'contract IMintableERC721', - name: '', - type: 'address' - } - ], - stateMutability: 'view', - type: 'function', - constant: true - }, - { - inputs: [], - name: 'equip', - outputs: [ - { - internalType: 'contract IMintableERC721', - name: '', - type: 'address' - } - ], - stateMutability: 'view', - type: 'function', - constant: true - }, - { - inputs: [], - name: 'executor', - outputs: [ - { - internalType: 'address', - name: '', - type: 'address' - } - ], - stateMutability: 'view', - type: 'function', - constant: true - }, - { - inputs: [], - name: 'hero', - outputs: [ - { - internalType: 'contract IMintableERC721', - name: '', - type: 'address' - } - ], - stateMutability: 'view', - type: 'function', - constant: true - }, - { - inputs: [], - name: 'owner', - outputs: [ - { - internalType: 'address', - name: '', - type: 'address' - } - ], - stateMutability: 'view', - type: 'function', - constant: true - }, - { - inputs: [], - name: 'renounceOwnership', - outputs: [], - stateMutability: 'nonpayable', - type: 'function' - }, - { - inputs: [ - { - internalType: 'address', - name: 'newOwner', - type: 'address' - } - ], - name: 'transferOwnership', - outputs: [], - stateMutability: 'nonpayable', - type: 'function' - }, - { - inputs: [ - { - internalType: 'bytes', - name: '', - type: 'bytes' - } - ], - name: 'usedSignatures', - outputs: [ - { - internalType: 'bool', - name: '', - type: 'bool' - } - ], - stateMutability: 'view', - type: 'function', - constant: true - }, - { - inputs: [ - { - internalType: 'address[3]', - name: '_erc721s', - type: 'address[3]' - } - ], - name: 'init', - outputs: [], - stateMutability: 'nonpayable', - type: 'function' - }, - { - inputs: [ - { - internalType: 'address', - name: 'account', - type: 'address' - } - ], - name: 'updateExecutor', - outputs: [], - stateMutability: 'nonpayable', - type: 'function' - }, - { - inputs: [ - { - internalType: 'uint256', - name: 'nftOld', - type: 'uint256' - }, - { - internalType: 'uint256', - name: 'nftNew', - type: 'uint256' - }, - { - internalType: 'uint256', - name: 'nftType', - type: 'uint256' - }, - { - internalType: 'uint256', - name: 'saltNonce', - type: 'uint256' - }, - { - internalType: 'bytes', - name: 'signature', - type: 'bytes' - } - ], - name: 'activateOne', - outputs: [], - stateMutability: 'nonpayable', - type: 'function' - }, - { - inputs: [ - { - internalType: 'address', - name: '_owner', - type: 'address' - }, - { - internalType: 'uint256', - name: '_nftOld', - type: 'uint256' - }, - { - internalType: 'uint256', - name: '_nftNew', - type: 'uint256' - }, - { - internalType: 'uint256', - name: '_nftType', - type: 'uint256' - }, - { - internalType: 'uint256', - name: '_saltNonce', - type: 'uint256' - } - ], - name: 'getMessageHash', - outputs: [ - { - internalType: 'bytes32', - name: '', - type: 'bytes32' - } - ], - stateMutability: 'pure', - type: 'function', - constant: true - } -] +]; diff --git a/src/configs/global.ts b/src/configs/global.ts new file mode 100644 index 0000000..416e988 --- /dev/null +++ b/src/configs/global.ts @@ -0,0 +1,4 @@ +export namespace Global { + export const MEDAL_REWARDS_Address: string = "0xC0DA6D9d8AaDCFf7BD6d69B8b46948dD40BF0dec"; // 分发地址 + export const LIMIT_ABI_Address: string = "0x5b36329D0DA1F56eD60F3C5DE1855c8dE0440140"; // 徽章地址 + } \ No newline at end of file diff --git a/src/store/user.js b/src/store/user.js index afed6c8..3af7cab 100644 --- a/src/store/user.js +++ b/src/store/user.js @@ -67,7 +67,7 @@ export const useUserStore = defineStore("user", () => { if (!res.errcode && res.data?.token) { accountId.value = account; setToken(res.data.token); - + glodata.token = getToken(); setAccountId(account); AppModule.updateAccount(account); AppModule.updateToken(res.data.token); @@ -83,6 +83,9 @@ export const useUserStore = defineStore("user", () => { removeToken(); token.value = ""; accountId.value = ""; + glodata.token = ''; + glodata.accountId='' + AppModule.updateToken(""); AppModule.updateAccount(""); } diff --git a/src/views/ClaimBadgeView.vue b/src/views/ClaimBadgeView.vue index 1fcd59b..4cde168 100644 --- a/src/views/ClaimBadgeView.vue +++ b/src/views/ClaimBadgeView.vue @@ -1,6 +1,6 @@ + + + \ No newline at end of file