aboutsummaryrefslogtreecommitdiffstats
path: root/build
diff options
context:
space:
mode:
authorThomas Bocek <tom@tomp2p.net>2016-06-03 00:43:27 +0800
committerThomas Bocek <tom@tomp2p.net>2016-06-06 20:27:15 +0800
commit89c6c5bb85ff24c152218f245fa366e733c951a7 (patch)
treeed0d02d136ed0f2aa06eb617a9feec661005ddfd /build
parent16a23ff74056aa306eb8a87272277bc8660f3252 (diff)
downloaddexon-89c6c5bb85ff24c152218f245fa366e733c951a7.tar.gz
dexon-89c6c5bb85ff24c152218f245fa366e733c951a7.tar.zst
dexon-89c6c5bb85ff24c152218f245fa366e733c951a7.zip
accounts/abi: Negative numbers not properly converted in ABI encoding
When converting a negative number e.g., -2, the resulting ABI encoding should look as follows: fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe. However, since the check of the type is for an uint instead of an int, it results in the following ABI encoding: 0101010101010101010101010101010101010101010101010101010101010102. The Ethereum ABI (https://github.com/ethereum/wiki/wiki/Ethereum-Contract-ABI) says, that signed integers are stored in two's complement which should be of the form ffffff.... and not 01010101..... for e.g. -1. Thus, I removed the type check in numbers.go as well as the function S256 as I don't think they are correct. Or maybe I'm missing something?
Diffstat (limited to 'build')
0 files changed, 0 insertions, 0 deletions