【发布时间】:2021-06-29 06:57:19
【问题描述】:
我正在尝试遵循来自 www.trufflesuite.com 的使用 OPENZEPPELIN 构建稳健智能合约的教程
这里是链接https://www.trufflesuite.com/tutorials/robust-smart-contracts-with-openzeppelin
创建“TutorialToken”智能合约
安装 OpenZeppelin 并下载项目模板后,我尝试编译并得到这个错误,我还没有编写任何自己的代码,它基本上是一个空项目,它应该按照教程编译但由于错误而失败来自 OpenZeppelinon 文件。
感谢您抽出宝贵时间阅读本文
TutorialToken.sol
pragma solidity 0.6.0;
import "openzeppelin-solidity/contracts/token/ERC20/ERC20.sol";
contract TutorialToken is ERC20 {
string public name = "TutorialToken";
string public symbol = "TT";
uint8 public decimals = 2;
uint public INITIAL_SUPPLY = 12000;
constructor() public {
_mint(msg.sender, INITIAL_SUPPLY);
}
}
truffle-config.js
module.exports = { // See <http://truffleframework.com/docs/advanced/configuration> // for more about customizing your Truffle configuration!
networks: {
development: {
host: "127.0.0.1",
port: 7545,
network_id: "*" // Match any network id
} },
compilers: {
solc: {
version: "0.4.24" //(Default: Truffle's installed solc)
}
}
};
【问题讨论】:
-
你能粘贴你
TutorialToken.sol的全部内容吗? -
确定刚刚完成
-
您能添加您的“truffle-config.js”文件代码吗?
-
'truffle-config.js' 文件已添加