我通过geth命令启动了一个新的专用网络。
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”的结果。
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命令建立的专用网络上出现错误。
如果有人在这个问题上有意见,请告诉我。
发布于 2018-08-29 08:56:06
现在我有了解决办法。
我的创世障碍设置是错的。
这个环境对我来说很好。
{
"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中
module.exports = function(deployer, network, accounts) {
const wallet = accounts[0];
造成气量限制误差。
module.exports = function(deployer, network, accounts) {
const wallet = "<your address>";
都没问题。
https://ethereum.stackexchange.com/questions/57646
复制相似问题