【发布时间】:2022-08-16 00:02:32
【问题描述】:
这是我的代码:
import {web3} from \"hardhat\"
const OWNER_ROLE = web3.utils.keccak256(\"OWNER_ROLE\");
这是我终端中的错误:
const OWNER_ROLE = web3.utils.keccak256(\"OWNER_ROLE\");
^
TypeError: Cannot read property \'utils\' of undefined
-
您不能从安全帽导入 web3 .. 确保安装 nomiclabs/web3 .. 以供参考检查 .. hardhat.org/hardhat-runner/plugins/nomiclabs-hardhat-web3