1.系统linux ubuntu20.04
2.solc安装指定版本。
在编译的时候报错
Error: Data location must be "storage" or "memory" for constructor parameter, but none was given
在网上找了许多,发现是solc版本的问题;开始改版本
3.方法一
sudo add-apt-repository ppa:ethereum/ethereum
sudo apt-get update
sudo apt-get install solc
安装指定版本,先安装brew
sudo apt install linuxbrew-wrapper
安装完以后在安装指定版本
brew install solidity@0.5.0
但是这个方案需要安装linuxbrew,我找了许多文章没学会;咱就曲线救国吧
方法二
pip3 install solc-select==0.2.0
可以选择可以安装的版本
solc-select install
选择需要安装的版本进行安装
solc-select install 0.8.15
选择需要的版本
solc-select use 0.4.25
以上就可以了