如何解决在将已部署的合同地址传递给另一个合同构造函数时卡住了
我成功部署了我的第一个合同以及该合同的get实例。但是当我尝试部署时 以第一个合同为参数的第二个合同,这给了我错误。 我通过了第一个合同的地址,或者对象(第一个合同的实例)的地址。每次它给我错误时。
- 作为地址传递时,它给出了无效的地址或Iban这样的地址格式。在此处输入代码this is an error image link
和错误
Uncaught (in promise) Error: Provided address "[object Promise]" is invalid,the capitalization checksum test failed,or its an indrect IBAN address which can't be converted.
at Object.d [as inputAddressFormatter]
- 我试图用于部署的代码[`//获取编译数据
let DhiSaleJsonInterface = await $.getJSON("DhiSale.json");
//create new object of DhiSale Contract.
let instance = new web3.eth.Contract(DhiSaleJsonInterface.abi);
//added meta data or required options
instance.options.address = "";
instance.options.from = account;
instance.options.gas = 1000000;
instance.options.gasPrice = '1000000000';
//add bytecode required for deployement.
instance.options.data = DhiSaleJsonInterface.bytecode;
//deploy the DhiSale contract
//Dhi is an already deployed contract object.
//it gives the error
return instance.deploy({ arguments: [Dhi.options.address,1000000000] }).send({ from: account }).then((contractInstance) => {
console.log("Dhi Sale address :" + contractInstance.options.address);
return contractInstance;
})`]
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。