Closed achimstruve closed 2 years ago
Which line is it mad at?
Which line is it mad at?
It is line 22 in my version of the file
useContractFunction(erc20Contract, "approve", {
It underlines "erc20Contract" red and shows the error I have posted above.
I also tried to exchange the code with the one from your repo, but it didn't help either.
Which line is it mad at?
This is how it looks like in the firefox browser:
Which line is it mad at?
I found the solution for this problem in this comment from another project: https://github.com/TrueFiEng/useDApp/issues/263#issuecomment-1098321684
It is litterally just importing Contract directly from another path like this that solved it:
import { Contract } from '@usedapp/core/node_modules/@ethersproject/contracts'
This my current state of the useStakeTokens.ts file in the hooks folder. Unfortunately there is a red line below the erc20Contract constant when I use it as argument for the useContractFunction. When I hover over it with my mouse it gives the following error message:
Does anyone know how to fix this?