Open cjmling opened 2 years ago
while web3 is
import Web3 from 'web3'
declare const window: any
const provider =
process.browser && window !== undefined && window.ethereum !== undefined
? window.ethereum
: 'https://bsc-dataseed.binance.org/'
const web3: any = new Web3(provider)
abi is the json file
import abiFile from '../../data/abis/filename.json'
address is the contract address , which in this case 0x8e33802adb469571e63a9677b453cfcd45852fe3
new web3.eth.Contract(abi, address);
Call the method you want.
const discountBP = await contract.methods.getDiscountBP(account).call()
it will look something like this