github.com/cgcardona/r-subnet-evm@v0.1.5/contracts/test/contract_native_minter.ts (about)

     1  // (c) 2019-2022, Ava Labs, Inc. All rights reserved.
     2  // See the file LICENSE for licensing terms.
     3  
     4  import { ethers } from "hardhat"
     5  import { test } from "./utils"
     6  
     7  const ADMIN_ADDRESS: string = "0x8db97C7cEcE249c2b98bDC0226Cc4C2A57BF52FC"
     8  const MINT_PRECOMPILE_ADDRESS = "0x0200000000000000000000000000000000000001"
     9  
    10  describe("ERC20NativeMinter", function () {
    11    beforeEach('Setup DS-Test contract', async function () {
    12      const signer = await ethers.getSigner(ADMIN_ADDRESS)
    13      const nativeMinterPromise = ethers.getContractAt("INativeMinter", MINT_PRECOMPILE_ADDRESS, signer)
    14  
    15      return ethers.getContractFactory("ERC20NativeMinterTest", { signer })
    16        .then(factory => factory.deploy())
    17        .then(contract => {
    18          this.testContract = contract
    19          return contract.deployed().then(() => contract)
    20        })
    21        .then(contract => contract.setUp())
    22        .then(tx => Promise.all([nativeMinterPromise, tx.wait()]))
    23        .then(([nativeMinter]) => nativeMinter.setAdmin(this.testContract.address))
    24        .then(tx => tx.wait())
    25    })
    26  
    27    test("contract should not be able to mintdraw", "step_mintdrawFailure")
    28  
    29    test("should be added to minter list", "step_addMinter")
    30  
    31    test("admin should mintdraw", "step_adminMintdraw")
    32  
    33    test("minter should not mintdraw", "step_minterMintdrawFailure")
    34    
    35    test("should deposit for minter", "step_minterDeposit")
    36  
    37    test("minter should mintdraw", "step_mintdraw")
    38  })