首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >仅在专用网络上出现OpenZeppelin MintableToken错误

仅在专用网络上出现OpenZeppelin MintableToken错误
EN

Ethereum用户
提问于 2018-08-29 01:58:34
回答 1查看 145关注 0票数 1

我通过geth命令启动了一个新的专用网络。

代码语言:javascript
运行
复制
geth --networkid "198"  --nodiscover --datadir "~/test-geth" --rpc --rpcaddr "0.0.0.0" --rpcport "8545" --rpccorsdomain "*" --rpcvhosts "*" --rpcapi web3,eth,personal,miner,net,txpool,debug --unlock 0,1 --password /home/user/.gethpasswd --mine --minerthreads 1 --targetgaslimit 6721975 --gasprice "100000"

并将我的令牌部署到这个网络中。“松露编译”和“松露迁移”成功。但是sendTransaction每次…都会失败

我用松露调试器调试器。这是“sendTransaction”的结果。

代码语言:javascript
运行
复制
MintedCrowdsale.sol:

24:   {
25:     // Potentially dangerous assumption about the type of the token.
26:     require(MintableToken(address(token)).mint(_beneficiary, _tokenAmount));
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

debug(development:0xb76ce508...)> i

Transaction halted with a RUNTIME ERROR.

This is likely due to an intentional halting expression, like assert(), require() or revert(). It can also be due to out-of-gas exceptions. Please inspect your transaction parameters and contract code to determine the meaning of this error.

我认为这个错误可能是由于"transferOwnership“的失败而发生的,但是松露调试器说"transferOwnership”成功了。

奇怪的是,在使用ganache-cli或Ropsten测试网…时没有出现错误。

我只在由geth命令建立的专用网络上出现错误。

如果有人在这个问题上有意见,请告诉我。

EN

回答 1

Ethereum用户

回答已采纳

发布于 2018-08-29 08:56:06

现在我有了解决办法。

我的创世障碍设置是错的。

这个环境对我来说很好。

代码语言:javascript
运行
复制
{
  "config": {
    "chainId": 198,
    "HomesteadBlock":      0,
    "DAOForkBlock": 0,
    "DAOForkSupport":      true,
    "EIP150Block":         0,
    "EIP155Block":         0,
    "EIP158Block":         0,
    "ByzantiumBlock":      0
  },
  "nonce": "0x0000000000000042",
  "timestamp": "0x0",
  "parentHash": "0x0000000000000000000000000000000000000000000000000000000000000000",
  "extraData": "",
  "gasLimit": "0x8000000",
  "difficulty": "0x4000",
  "mixhash": "0x0000000000000000000000000000000000000000000000000000000000000000",
  "coinbase": "0x3333333333333333333333333333333333333333",
  "alloc": {}
}

和,在迁移/2_deploy_Contracts.js中

代码语言:javascript
运行
复制
module.exports = function(deployer, network, accounts) {


    const wallet = accounts[0];

造成气量限制误差。

代码语言:javascript
运行
复制
module.exports = function(deployer, network, accounts) {


    const wallet = "<your address>";

都没问题。

票数 0
EN
页面原文内容由Ethereum提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://ethereum.stackexchange.com/questions/57646

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档