Skip to content

Commit a172159

Browse files
authored
ioctl contract prepare cmd needs to install solidity version 0.5+ (iotexproject#2283)
* ioctl contract prepare cmd needs to install solidity version 0.5+ * update * update
1 parent 4f713d0 commit a172159

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

install-solc.sh

100644100755
+4-1
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,10 @@ initOS
103103

104104
# assemble expected release artifact name
105105
if [ "$OS" = "darwin" ]; then
106-
sudo brew install solidity@4
106+
brew update
107+
brew upgrade
108+
brew tap ethereum/ethereum
109+
brew install solidity@5
107110
else
108111
if [ "${OS}" != "linux" ] && { [ "${ARCH}" = "ppc64" ] || [ "${ARCH}" = "ppc64le" ];}; then
109112
# ppc64 and ppc64le are only supported on Linux.

ioctl/cmd/contract/contractprepare.go

+2-5
Original file line numberDiff line numberDiff line change
@@ -45,21 +45,18 @@ func prepare() error {
4545
solc, err := compiler.SolidityVersion(solCompiler)
4646
if err != nil {
4747
cmdString := "curl --silent https://raw.githubusercontent.com/iotexproject/iotex-core/master/install-solc.sh | sh"
48-
4948
cmd := exec.Command("bash", "-c", cmdString)
5049
output.PrintResult("Preparing solidity compiler ...\n")
5150

5251
err = cmd.Run()
5352
if err != nil {
54-
installGuide := "https://solidity.readthedocs.io/en/v0.4.25/installing-solidity.html"
55-
return output.NewError(output.UpdateError, fmt.Sprintf("\nfailed to prepare solc\n\n"+
56-
"you can install solidity 0.4.25 manually following:\n%s\n", installGuide), nil)
53+
return output.NewError(output.UpdateError, "failed to prepare solc", err)
5754
}
5855
}
5956

6057
if !checkCompilerVersion(solc) {
6158
return output.NewError(output.CompilerError,
62-
fmt.Sprintf("unsupported solc version %d.%d.%d, expects solc version ^0.4.24",
59+
fmt.Sprintf("unsupported solc version %d.%d.%d, expects solc version 0.5.17",
6360
solc.Major, solc.Minor, solc.Patch), nil)
6461
}
6562

0 commit comments

Comments
 (0)