Commit 40a1eed0 authored by lilinleeli1234's avatar lilinleeli1234 Committed by vipwzw

update linter

parent ce6ee49c
......@@ -238,27 +238,26 @@ func createContract(cmd *cobra.Command, args []string) {
if _, err := os.Stat(sol); os.IsNotExist(err) {
fmt.Fprintln(os.Stderr, "Sol file is not exist.")
return
} else {
contracts, err := compiler.CompileSolidity(solc, sol)
if err != nil {
fmt.Fprintln(os.Stderr, "Failed to build Solidity contract", err)
return
}
}
contracts, err := compiler.CompileSolidity(solc, sol)
if err != nil {
fmt.Fprintln(os.Stderr, "Failed to build Solidity contract", err)
return
}
if len(contracts) > 1 {
fmt.Fprintln(os.Stderr, "There are too many contracts in the sol file.")
return
}
if len(contracts) > 1 {
fmt.Fprintln(os.Stderr, "There are too many contracts in the sol file.")
return
}
for _, contract := range contracts {
abi, _ := json.Marshal(contract.Info.AbiDefinition) // Flatten the compiler parse
bCode, err := common.FromHex(contract.Code)
if err != nil {
fmt.Fprintln(os.Stderr, "parse evm code error", err)
return
}
action = evmtypes.EVMContractAction{Amount: 0, Code: bCode, GasLimit: 0, GasPrice: 0, Note: note, Alias: alias, Abi: string(abi)}
for _, contract := range contracts {
abi, _ := json.Marshal(contract.Info.AbiDefinition) // Flatten the compiler parse
bCode, err := common.FromHex(contract.Code)
if err != nil {
fmt.Fprintln(os.Stderr, "parse evm code error", err)
return
}
action = evmtypes.EVMContractAction{Amount: 0, Code: bCode, GasLimit: 0, GasPrice: 0, Note: note, Alias: alias, Abi: string(abi)}
}
} else {
bCode, err := common.FromHex(code)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment