Remix上Solidity版本已经更新到了0.6.10(更新发展得挺快的),而在truffle上一直是0.5.16版的,重新安装了几遍也没有更新到最新版!
查了下资料,这个需要额外的设置。需要手动修改 ‘truffle-config.js’ 文件中的’compilers’ -> ‘solc’ -> ‘version’至最新版(”0.6.10”)即可。
truffle会自动从官方拉取相应版本的编译器,不再需要你手动下载配置了。
1 | compilers: { |
试着编译下”truffle migrate”,可以看到在下载最新版的Solidity! turffle version看看:
1 | Truffle v5.1.27 (core: 5.1.27) |
Solidity已经更新到了最新版,可以愉快地玩耍啰!
This page is synchronized from the post: ‘truffle技巧:更新Solidity版本 / 学习智能合约#14’