common solc --optimize --bin获取代码,然后我将合同部署在私有以太坊chianblock上,交易失败,当我删除--optimize时,我获得成功
在MacOs上,solc版本为 版本:0.5.7 + commit.6da8b019.Darwin.appleclang
cs,err:= compiler.CompileSolidityString(“ solc”,code)
address, tx, _ , err := bind.DeployContract(auth, parsed, common.FromHex(contract.Code), cli,
params...,
)
blockHash:“ 0x06b3f2939d0a75165380a5a4c00a16477631bb105c4a1287a22c70594ec4f8ef”, blockNumber:653 contractAddress:“ 0x125451a9f976526709ee9e37d8b77f14e6e503be”, 使用的累计气体:62076, 来自:“ 0xcd32eb2ea53babe9bed5cb050bb4cdece4443334”, 使用气体:62076, 日志:[], logsBloom:“ 0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 状态:“ 0x0”, 到:null, transactionHash:“ 0x99827d915af9650d16c176ea573916d3cf2f809193320c4d91b6895ec77a748a”, transactionIndex:0