2.0.0 • Published 3 years ago
erc20-instance v2.0.0
erc20-instance
A package helps you to create an erc20 contract instance easily.
Installation
npm install erc20-instanceUsage
Only use common ERC20 ABI:
import { ERC20ABI } from "erc20-instance"; const erc20Token = new Contract(contractAddress, ERC20ABI, provider);Use erc20 ABI with
ERC20Contracttype:For my personal preference, I also introduce a pre-defined type
ERC20Contractto help support typescript better.ERC20Contractis a type generated from a common ERC20 contract code with the toolTypechain.import { createERC20Instance } from "erc20-instance"; let erc20Token = createERC20Instance(contractAddress, provider);In this example,
erc20Tokenis anERC20Contractinstance instead of aContractinstance.
Contribute
Any contribution is welcomed to make it better.
If you have any questions, please create an issue.