We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
请问合约这块,怎么部署有构造参数的只能合约, 我测试过web3的 contract.new 或者合约实例(instance.method) 都会报
Account unkonw.
而且在BCOS中 执行合约和部署合约只能走 sendRawTransaction 方法构建sign后的交易数据,
sendRawTransaction
我尝试改造web3sync的 rawDeploy 方法, 增加
rawDeploy
var encodeConstructorParams = function (abi, params) { return abi.filter(function (json) { return json.type === 'constructor' && json.inputs.length === params.length; }).map(function (json) { return json.inputs.map(function (input) { return input.type; }); }).map(function (types) { return coder.codeParams(types, params); })[0] || ''; };
用来对构造函数的参数进行encode后的 数据,添加到了postdata中的data,但发现合约是能正常部署成功,但是参数还是未能顺利传递进去,
求指导,构造函数这块的参数怎么搞,或者怎么能够正常使用web3 的 contract.new 或者contract.method?
contract.new
contract.method
The text was updated successfully, but these errors were encountered:
@lmhaoye web3sync.js已经做了优化可以支持部署智能合约时的构造函数参数传入。 请参考 https://github.com/FISCO-BCOS/FISCO-BCOS/blob/master/web3lib/web3sync.js中对rawDeploy实现。 function rawDeploy(account, privateKey,filename,types,params,debug) 其中type是构造函数的参数类型,params是构造函数的入参
Sorry, something went wrong.
Merge pull request bcosorg#94 from toxotguo/dev
ef1c881
add TASSL-master.zip
No branches or pull requests
请问合约这块,怎么部署有构造参数的只能合约,
我测试过web3的 contract.new 或者合约实例(instance.method)
都会报
而且在BCOS中 执行合约和部署合约只能走
sendRawTransaction
方法构建sign后的交易数据,我尝试改造web3sync的
rawDeploy
方法,增加
用来对构造函数的参数进行encode后的 数据,添加到了postdata中的data,但发现合约是能正常部署成功,但是参数还是未能顺利传递进去,
求指导,构造函数这块的参数怎么搞,或者怎么能够正常使用web3 的
contract.new
或者contract.method
?The text was updated successfully, but these errors were encountered: