将 solidity 智能合约部署到 rinkeby 测试网络的问题
issues deploying solidity smart contract to rinkeby test network
我正在使用 openZeppelin 制定众筹合同,所有(其中 30 个)我的测试都顺利通过 ;) 我可以毫无问题地迁移到本地 ganache 区块链。
- 当我尝试部署到 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 的构造函数采用的参数)
注意事项:
- 我有一个 infura api 钥匙
- 我正在使用
truffle-wallet-provider
提供程序,只需一个私钥(无助记符)即可部署
- 我很困惑(由于上述原因),我的部署脚本如何在部署时知道多个 (10) 个钱包。通常(在 ganache 中)这些是 ganache 为你生成的 10 个钱包,但在这里,我提供了一个私钥,所以它不应该知道 10 个钱包,只有一个 - 私钥的 public 密钥部署合同的关键,不是吗? (说到这里):
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。
我正在使用 openZeppelin 制定众筹合同,所有(其中 30 个)我的测试都顺利通过 ;) 我可以毫无问题地迁移到本地 ganache 区块链。
- 当我尝试部署到 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 的构造函数采用的参数)
注意事项:
- 我有一个 infura api 钥匙
- 我正在使用
truffle-wallet-provider
提供程序,只需一个私钥(无助记符)即可部署 - 我很困惑(由于上述原因),我的部署脚本如何在部署时知道多个 (10) 个钱包。通常(在 ganache 中)这些是 ganache 为你生成的 10 个钱包,但在这里,我提供了一个私钥,所以它不应该知道 10 个钱包,只有一个 - 私钥的 public 密钥部署合同的关键,不是吗? (说到这里):
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。