Solidity

從外部節點設置合約變數時呼叫回退函式

  • July 14, 2016

我是乙太坊世界的初學者,在我的私人測試網上處理 SimpleStorage 合約時遇到了一些問題(http://solidity.readthedocs.io/en/latest/introduction-to-smart-contracts.html) . 特別是,如果我創建一個合約實例,然後從同一個節點呼叫 set() 函式,一切正常。但是,如果我使用以下命令從我的私有測試網的另一個節點呼叫 set() 函式:

> var instance = web3.eth.contract(abi).at(contractAddress);
> instance.set.sendTransaction(21, {from: web3.eth.accounts[0]});

該功能似乎不起作用。更準確地說,通過簡單地添加一些事件偵聽器,我可以注意到備份函式被呼叫了。誰能告訴我為什麼?我究竟做錯了什麼?

任何幫助表示讚賞。

輸入類型的 abi 定義有錯誤(它被簡單地定義為 ‘uint’ 而不是 ‘uint256’)。

引用自:https://ethereum.stackexchange.com/questions/4024