简体   繁体   English

在rinkeby测试网络上部署固态智能合约的问题

[英]issues deploying solidity smart contract to rinkeby test network

I'm using openZeppelin to make a crowdsale contract, all (30 of them) my tests pass with flying colours ;) and I can migrate on a locall ganache blockchain no problem. 我正在使用openZeppelin进行众包合同,所有(其中30个)我的测试都通过了测试;)并且我可以毫无问题地在本地ganache区块链上进行迁移。

  1. When I try to deploy to rinkeby I start having issues. 当我尝试部署到rinkeby时,我开始遇到问题。 My config in truffle.js is 我在truffle.js中的配置是

  rinkeby: { provider: rinkeybyProvider, network_id: 3, gas: 4712388, gasPrice: web3.utils.toWei("40", "gwei"), websockets: true, from: "0x9793371e69ed67284a1xxxx" } 

When I deploy on rinkeby I get: 当我在rinkeby上部署时,我得到:

"SplitWallet" hit a require or revert statement somewhere in its constructor. “ SplitWallet”在其构造函数中的某处命中了require或revert语句。 Try: * Verifying that your constructor params satisfy all require conditions. 尝试:*验证您的构造函数参数是否满足所有要求条件。 * Adding reason strings to your require statements. *在您的require语句中添加原因字符串。

I have gone through and put messages in every revert in the constructor hierachy, but I never see any of the messages. 我已经遍历并将消息放入构造函数层次结构的每个还原中,但是我从未看到任何消息。 I thought it might be that my payees and shares were different lengths but, no, they are the same (only parameters that the constructor for a splitwallet take) 我以为我的收款人和股票的长度可能不同,但是不,它们是相同的(只有splitwallet的构造函数采用的参数)

Things to note: 注意事项:

  • I have an infura api key 我有一个Infura API密钥
  • I am using truffle-wallet-provider provider, with just a private key (no mnemonic) to deploy 我使用的是truffle-wallet-provider程序,只有一个私钥(没有助记符)进行部署
  • I am confused (due to the above), how my deploy script, can know multiple (10) wallets on deployment. 由于上述原因,我很困惑,我的部署脚本如何知道部署时的多个(10)钱包。 Usually (in ganache) these are the 10 wallets ganache generates for you, but here, I am providing a private key, so it shouldn't be able to know 10 wallets, just one - the public key of the private key that is deploying the contract, no? 通常(在ganache中)这些是ganache为您生成的10个钱包,但是在这里,我提供了一个私钥,因此它应该无法知道10个钱包,而只能知道一个-正在部署的私钥的公钥。合同,不是吗? (talking about here): (在这里谈论):

 module.exports = async ( deployer, network, [owner, purchaser, investor, organisation, ...accounts] //how does it know these?? ) 

This last point, makes me wonder, because I printed out owner/purchaser and they dont match my public key wallet at all, so I have no idea where they are coming from. 最后一点让我感到奇怪,因为我打印出了所有者/购买者,而它们根本不匹配我的公钥钱包,所以我不知道它们来自何处。 And if they dont match, and it defaults to the owner being accounts[0], then that wallet may not be able to pay for the gas.... perhaps?? 如果它们不匹配,并且默认为所有者为account [0],则该钱包可能无法支付汽油费用。

Thanks 谢谢

Rinkeby的网络ID是4,而不是3。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM