0

我正在使用两种合同方法作为getResult- 获取合同状态 - 和setNumber(uint num)- 更新状态的当前值。但是每次我在返回原始值getResult后调用方法setNumber(10),而不是更新后的值。

4

1 回答 1

0

The others are right when they say you should supply code if you want an accurate response. That said, it could be that your problem is you are calling setNumber(10) on your smart contract i.e. myContract.setNumber.call(10). Doing this wont actually update the state of the contract as .call() simply looks up the current state of the chain rather than altering it.

于 2017-12-22T17:40:15.387 回答