The types are generated using Type Chain.
After every change in the smart contracts, the types are generated again and updated here.
Install:
with yarn:
yarn add @unicrowio/ethers-types
with npm:
npm install @unicrowio/ethers-types
Import in your code:
import { ERC20__factory, Unicrow__factory } from '@unicrowio/ethers-types'
const provider = await getWeb3Provider()
const providerSigner = provider.getSigner()
const smartContract = Unicrow__factory.connect(
UNICROW_ADDRESS,
providerSigner
);
const token = ERC20__factory.connect(tokenAddress, providerSigner);