1.0.0 • Published 2 years ago

gu-erc777-basic v1.0.0

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 sdk: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 ERC777BasicSDK = await erc777BasicSDK.deploy(
    {
      name: 'NEW',
      symbol: 'NEW',
      initialSupply: 1,
      decimal: 18
    },
    signer
  )
  const erc777 = new ERC777BasicSDK({ provider, signer, erc777ContractAddr })
  console.log(await erc777.decimals())
  console.log(await erc777.name())
  console.log(await erc777.symbol())
  console.log(await erc777.totalSupply())
  console.log(await erc777.balanceOf('0x48a1ebb823ebA4940395ddCA05b6705b3EC8755b'))
  console.log(
    await erc777.allowance('0xF4CA4e78329226247EBB08E90F05d5e456eAa108', '0x48a1ebb823ebA4940395ddCA05b6705b3EC8755b')
  )
  console.log(await erc777.transfer('0xF4CA4e78329226247EBB08E90F05d5e456eAa108', 1))