报错如下
Error: Could not parse /Users/zhangnan/blockchain/test_merge/node_modules/@openzeppelin/contracts/token/ERC20/ERC20.sol for extracting its imports: ParserError: missing ';' at '{' (158:18)
at getDependencies (/usr/local/lib/node_modules/truffle-flattener/index.js:44:11)
at dependenciesDfs (/usr/local/lib/node_modules/truffle-flattener/index.js:64:24)
最简单的openzeppelin erc20 token代码
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.2;
import "@openzeppelin/contracts/token/ERC20/ERC20.sol";
contract MyToken is ERC20 {
constructor() ERC20("MyToken", "MTK") {}
}
使用命令
truffle-flattener TestOpenzeppelin.sol > test_merge2.sol
怎么解决这个问题?