contract, but balance in my contract is zero. How do it right? Below is my code:
// imports
const { ethers, waffle } = require('hardhat')
const { deployContract } = waffle
// then
it('deposit USDT', async function () {
const [walletUSDT, walletMatrix] = await ethers.getSigners()
const tokenUSDT = await deployContract(walletUSDT, MockUSDT);
const tokenMatrix = await deployContract(walletMatrix, MXToken);
tokenUSDT.transfer(walletMatrix.address, 70)
const test = await tokenMatrix.balanceOf(walletMatrix.address)
console.log(test)
})
const { expect } = require("chai"); const { ethers } = require("hardhat"); describe("Contract", function () { let masterAccount, userAccount, addrs, usdtToken, busdToken; before(async () => { [masterAccount, userAccount, ...addrs] = await ethers.getSigners(); BusdToken = await ethers.getContractFactory("MockBUSD"); UsdtToken = await ethers.getContractFactory("MockUSDT"); busdToken = await BusdToken.deploy(); usdtToken = await UsdtToken.deploy(); }); describe("#Initialize", async() => { it("Should deposit busd to userAccount balance", async() => { let amount = ethers.utils.parseEther(String(15000)); await busdToken.connect(masterAccount).transfer(userAccount.address, amount); let newBalance = await busdToken.balanceOf(userAccount.address); expect(newBalance).to.equal(amount); }) }) })
U need mapping
Обсуждают сегодня