8

truffle-flattener 合并openzeppelin erc20报错

 2 years ago
source link: https://learnblockchain.cn/question/2741
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client
truffle-flattener 合并openzeppelin erc20报错

truffle-flattener 合并openzeppelin erc20报错

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

怎么解决这个问题?


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK