diff --git a/frontend/src/components/farms/Farm.vue b/frontend/src/components/farms/Farm.vue index 647b1784..1252b28a 100644 --- a/frontend/src/components/farms/Farm.vue +++ b/frontend/src/components/farms/Farm.vue @@ -332,11 +332,7 @@ export default class Farm extends Vue { if (permitEnabled) { this.lpTokenAllowance = true } else { - const allowance: BigNumber = await this.bep20.allowance( - this.account, - lpTokenAddress, - this.signer - ) + const allowance: BigNumber = await this.bep20.allowance(this.account, lpTokenAddress, this.signer) this.lpTokenAllowance = allowance.gt(BigNumber.from('0')) } diff --git a/frontend/src/layouts/MainLayout.vue b/frontend/src/layouts/MainLayout.vue index 0c02d22c..e99653cd 100644 --- a/frontend/src/layouts/MainLayout.vue +++ b/frontend/src/layouts/MainLayout.vue @@ -181,7 +181,7 @@ import BlockchainChooser from '@/components/BlockchainChooser.vue' import { blockchainAddressFilter } from '@/utils/filters' import QRCode from 'qrcode' import { openURL } from 'quasar' -import { Network, POLYGON_MAINNET } from '@/utils/Networks' +import { Network, POLYGON_MAINNET, ETHEREUM_TESTNET } from '@/utils/Networks' import Dialogs from '@/utils/Dialogs' const accountsStore = namespace('accounts') @@ -274,7 +274,11 @@ export default class MainLayout extends Vue { } openNftPage() { - if (this.isUserConnected && this.currentBlockchain.chainIdNumber === POLYGON_MAINNET.chainIdNumber) { + if ( + this.isUserConnected && + (this.currentBlockchain.chainIdNumber === POLYGON_MAINNET.chainIdNumber || + this.currentBlockchain.chainIdNumber === ETHEREUM_TESTNET.chainIdNumber) + ) { router.push('/nft') } else { openURL('https://opensea.io/collection/wban') diff --git a/frontend/src/pages/NftRewards.vue b/frontend/src/pages/NftRewards.vue index d3a5cec6..eff096d8 100644 --- a/frontend/src/pages/NftRewards.vue +++ b/frontend/src/pages/NftRewards.vue @@ -156,7 +156,7 @@ import { asyncFilter } from '@/utils/AsyncUtils' import { ethers } from 'ethers' import axios, { AxiosResponse } from 'axios' import { openURL } from 'quasar' -import { Network, POLYGON_MAINNET } from '@/utils/Networks' +import { Network, POLYGON_MAINNET, ETHEREUM_TESTNET } from '@/utils/Networks' const nftStore = namespace('nft') const accountsStore = namespace('accounts') @@ -323,7 +323,10 @@ export default class NftRewardsPage extends Vue { } async onProviderChange() { - if (this.activeAccount && this.network.chainId === POLYGON_MAINNET.chainId) { + if ( + this.activeAccount && + (this.network.chainId === POLYGON_MAINNET.chainId || this.network.chainId === ETHEREUM_TESTNET.chainId) + ) { this.wrongNetwork = false await nft.initContract(this.provider) await this.reload() diff --git a/frontend/src/store/modules/nft.ts b/frontend/src/store/modules/nft.ts index 977b2156..83adbe31 100644 --- a/frontend/src/store/modules/nft.ts +++ b/frontend/src/store/modules/nft.ts @@ -22,7 +22,7 @@ class NftModule extends VuexModule { private _uri = '' private _nfts: Map = new Map() - static NFT_IDS = [902, 900, 901, 0, 1, 2, 10, 11, 12, 20, 21, 22, 100, 101, 102] + static NFT_IDS = [999, 903, 902, 900, 901, 0, 1, 2, 10, 11, 12, 20, 21, 22, 100, 101, 102] static NFT_REWARDS_CONTRACT: string = process.env.VUE_APP_NFT_REWARDS_CONTRACT || '' static NFT_OPENSEA_URL: string = process.env.VUE_APP_NFT_OPENSEA_URL || '' @@ -85,26 +85,7 @@ class NftModule extends VuexModule { const { contract, account } = request console.debug(`in loadNFTs for ${account}`) // load NFT balances - const balances = await contract.balanceOfBatch( - [ - account, - account, - account, - account, - account, - account, - account, - account, - account, - account, - account, - account, - account, - account, - account, - ], - NftModule.NFT_IDS - ) + const balances = await contract.balanceOfBatch(Array(NftModule.NFT_IDS.length).fill(account), NftModule.NFT_IDS) console.debug(`Balances of ${account} are ${balances}`) // load NFT data const uriTemplate = this._uri.replace('ipfs://', NftModule.IPFS_GATEWAY)