【发布时间】:2018-11-16 15:19:28
【问题描述】:
我正在使用 this Ethereum Go Client 并尝试将字符串 / bytes32 传递给 Solidity。
智能合约中的功能很简单(现在测试):
function vote(bytes32 id) {
//id has the value 0x0000000000000000000000000000000000000000000000000000000000000000
}
打电话
hash, err := contract.Send(transaction, "vote", "myString")
将导致0x0000000000000000000000000000000000000000000000000000000000000000
对于 bytes32 参数 id...
我必须如何将参数从 Go 传递给我的智能合约,以便solidity 具有正确的值?
或者,我只需要为该字符串传递一个唯一标识符,我可以在 Golang 中轻松地从字符串中创建该标识符...
【问题讨论】:
标签: go ethereum solidity web3 go-ethereum