Moe*_*jac 3 javascript chai solidity ethers.js hardhat
当尝试在测试函数中使用时,ethers.utils.parseUnits("1", "ether")
会引发错误TypeError: Cannot read properties of undefined (reading 'parseUnits')
。
const { deployments, ethers, getNamedAccounts } = require("hardhat")
const { assert, expect } = require("chai")
describe("FundMe", async function () {
let fundMe
let deployer
const sendValue = ethers.utils.parseUnits("1", "ether")
})
Run Code Online (Sandbox Code Playgroud)
我也尝试过使用 parseEther 得到相同的结果。在ethers.utils.parseUnits 的文档规范中,它说只使用它。我还缺少其他功能吗?我的以太配置可能不正确吗?
归档时间: |
|
查看次数: |
1775 次 |
最近记录: |