go-ethereum/accounts/abi
Daniel Liu b6f28effa9
accounts/abi: error when packing negative values in unsigned types #31790 (#1422)
This is an alternative approach to
https://github.com/ethereum/go-ethereum/pull/31607 , that doesn't break
backwards-compatibility with abigen.

Note that this does change the behavior of `Argument.Pack`: previously,
packing negative values for a `uint` parameter would cause them to be
represented in signed binary representation via two's complement. Now,
it will fail explicitly in this case.

However, I don't see a reason to support this functionality. The ABI
already explicitly supports signed integers. There's no reason that a
smart contract author would choose to store signed values in a `uint`
afaict.

---------

Co-authored-by: jwasinger <j-wasinger@hotmail.com>
Co-authored-by: MariusVanDerWijden <m.vanderwijden@live.de>
2025-09-03 15:48:44 +08:00
..
abigen cmd/abigen, accounts/abi/bind: implement abigen version 2 #31379 (#1416) 2025-09-03 15:47:12 +08:00
bind cmd/abigen, accounts/abi/bind: implement abigen version 2 #31379 (#1416) 2025-09-03 15:47:12 +08:00
abi.go accounts/abi: support unpacking solidity errors (#30738) 2025-01-24 16:54:12 +08:00
abi_test.go accounts/abi: support unpacking solidity errors (#30738) 2025-01-24 16:54:12 +08:00
abifuzzer_test.go accounts: run tests in parallel (#28544) 2025-01-24 16:54:12 +08:00
argument.go accounts/abi: improve unpack performance #31387 (#1415) 2025-09-03 15:46:23 +08:00
doc.go all: fix license headers one more time 2015-07-23 18:35:11 +02:00
error.go accounts/abi: context info on unpack-errors (#28529) 2025-01-24 16:54:12 +08:00
error_handling.go accounts/abi: error when packing negative values in unsigned types #31790 (#1422) 2025-09-03 15:48:44 +08:00
event.go accounts/abi/bind: fix duplicate field names in the generated go struct (#24924) 2025-01-24 16:54:11 +08:00
event_test.go accounts/abi: golangci-lint 1.61.0 (#30587) 2025-01-24 16:54:12 +08:00
method.go accounts/abi: improve readability of method-to-string conversion (#28530) 2025-01-24 16:54:12 +08:00
method_test.go accounts: run tests in parallel (#28544) 2025-01-24 16:54:12 +08:00
pack.go accounts/abi: error when packing negative values in unsigned types #31790 (#1422) 2025-09-03 15:48:44 +08:00
pack_test.go accounts/abi: error when packing negative values in unsigned types #31790 (#1422) 2025-09-03 15:48:44 +08:00
packing_test.go accounts/abi: ABI explicit difference between Unpack and UnpackIntoInterface (#21091) 2025-01-24 16:18:30 +08:00
reflect.go accounts/abi: fix typos (#29542 #29600) 2025-01-24 16:54:12 +08:00
reflect_test.go accounts/abi: golangci-lint 1.61.0 (#30587) 2025-01-24 16:54:12 +08:00
topics.go accounts/abi: fix MakeTopics mutation of big.Int inputs (#30785) 2025-01-24 16:54:12 +08:00
topics_test.go accounts/abi: fix MakeTopics mutation of big.Int inputs (#30785) 2025-01-24 16:54:12 +08:00
type.go accounts/abi: handle ABIs with contract type parameter (#30315) 2025-01-24 16:54:12 +08:00
type_test.go accounts/abi: fix typos (#29542 #29600) 2025-01-24 16:54:12 +08:00
unpack.go account/abi: convert if-else-if chain to tagged switch (#27869) 2025-01-24 16:54:12 +08:00
unpack_test.go accounts/abi: error when packing negative values in unsigned types #31790 (#1422) 2025-09-03 15:48:44 +08:00
utils.go accounts: lint comments (#25726) 2025-01-24 16:54:11 +08:00