1.0.2 • Published 2 years ago

@cuonghx.gu-tech/gu-erc20-basic v1.0.2

Weekly downloads
-
License
SEE LICENSE IN LI...
Repository
-
Last release
2 years ago

Test

  1. Start local network npx hardhat node
  2. cp .env.example .env
  3. npm run test

Deploy

npm run deploy

Usage

 const provider = new ethers.providers.JsonRpcProvider({
    url: 'https://sandbox1.japanopenchain.org:8545/'
  })

  const signer = new ethers.Wallet({{privateKey}}, provider)
  const erc20ContractAddr = await ERC20BasicSDK.deploy(
    {
      name: 'NEW',
      symbol: 'NEW',
      initialSupply: 1,
      decimal: 18
    },
    signer
  )
  const erc20 = new ERC20BasicSDK({ provider, signer, erc20ContractAddr })
  console.log(await erc20.decimals())
  console.log(await erc20.name())
  console.log(await erc20.symbol())
  console.log(await erc20.totalSupply())
  console.log(await erc20.balanceOf('0x48a1ebb823ebA4940395ddCA05b6705b3EC8755b'))
  console.log(
    await erc20.allowance('0xF4CA4e78329226247EBB08E90F05d5e456eAa108', '0x48a1ebb823ebA4940395ddCA05b6705b3EC8755b')
  )
  console.log(await erc20.transfer('0xF4CA4e78329226247EBB08E90F05d5e456eAa108', 1))
1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago