试图运行:
1.) Dappuniversity 项目 (dappuniversity/dbank) 2.) pet-shop-tutorial
Truffle v5.3.3(核心:5.3.3)节点 v14.15.5
当 Truffle 要求它的编译器/solc 匹配 5.3.3 时,ser 如何在 0.8.4 编译代码以导入 OpenZeppelin 的 ERC20.sol 模板?
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.4;
import "@openzeppelin/contracts/token/ERC20/ERC20.sol";
contract Token is ERC20 {
//add minter variable
//add minter changed event
constructor() public payable ERC20("Name", "Symbol") {
//asign initial minter
}
//Add pass minter role function
function mint(address account, uint256 amount) public {
//check if msg.sender have minter role
_mint(account, amount);
}
}
未找到源“@openzeppelin/contracts/token/ERC20/ERC20.sol”:不支持文件导入回调