【问题标题】:the tx doesn't have the correct nonce. account has nonce of: 5 tx has nonce of: 15tx 没有正确的随机数。帐户的随机数为:5 tx 的随机数为:15
【发布时间】:2017-07-30 19:08:51
【问题描述】:

使用 truffle (3.4.6)、metamask (3.9.2) 和 testrpc (4.0.1),我调用了一个事务并得到“错误:tx 没有正确的随机数。帐户的随机数为:5 tx 的随机数为:15"。我已经将我的合同方法的主体缩减为一些微不足道的东西,但我仍然得到了这个。知道是什么原因造成的吗?

contract MyContract {
  mapping (address => bool) authorized;

  function myMethod (uint element, uint price) whenNotPaused returns (bool) {
     if (!authorized[msg.sender]) throw;
     return true;
  }
}

我这样调用方法(使用松露):

  MyContract.deployed().then((instance) => {
      instance.myMethod (id, price, {from: account}).then (...)

【问题讨论】:

    标签: ethereum truffle consensys-truffle


    【解决方案1】:

    this thread 我看到了一个来回切换网络和错误自我纠正的建议。

    ¯\_(ツ)_/¯

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-12-17
      • 1970-01-01
      • 2012-10-04
      • 1970-01-01
      • 2011-11-07
      相关资源
      最近更新 更多