将 solidity 智能合约部署到 rinkeby 测试网络的问题

issues deploying solidity smart contract to rinkeby test network

我正在使用 openZeppelin 制定众筹合同,所有(其中 30 个)我的测试都顺利通过 ;) 我可以毫无问题地迁移到本地 ganache 区块链。

  1. 当我尝试部署到 rinkeby 时,我开始遇到问题。我在 truffle.js 中的配置是

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

当我在 rinkeby 上部署时,我得到:

"SplitWallet" hit a require or revert statement somewhere in its constructor. Try: * Verifying that your constructor params satisfy all require conditions. * Adding reason strings to your require statements.

我已经遍历并将消息放入构造函数层次结构的每个还原中,但我从未看到任何消息。我认为可能是我的收款人和股份的长度不同,但是,不,它们是相同的(只有 splitwallet 的构造函数采用的参数)

注意事项:

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

这最后一点让我感到奇怪,因为我打印了 owner/purchaser,但它们与我的 public 钥匙钱包完全不匹配,所以我不知道它们是从哪里来的。如果它们不匹配,并且默认所有者是 accounts[0],那么该钱包可能无法支付 gas ....也许??

谢谢

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