Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
280 commits
Select commit Hold shift + click to select a range
930ec9b
accounts/abi: allow abi tags when unpacking structs (#16648)
gzliudan Jan 14, 2025
67fe815
console: squash golint warnings (#16836)
gzliudan Jan 14, 2025
e4adf8e
accounts/keystore: fix comment typo (#18395)
gzliudan Jan 14, 2025
a81fe22
accounts/keystore: small code simplification (#18394)
gzliudan Jan 14, 2025
2d0047b
accounts/abi: tuple support (#18406)
gzliudan Jan 14, 2025
7d5953f
accounts/abi: Extra slice tests (#18424)
gzliudan Jan 14, 2025
e70bb4b
accounts/abi: Add tests for reflection ahead of refactor (#18434)
gzliudan Jan 14, 2025
d44902a
accounts/abi: allow interface as the destination (#18490)
gzliudan Jan 14, 2025
e3c75c0
accounts/usbwallet: support trezor passphrases (#16503)
gzliudan Jan 14, 2025
f0ed124
accounts/usbwallet/trezor: expose protobuf package (#17980)
gzliudan Jan 14, 2025
fe14069
accounts: support for external signer API (#18079)
gzliudan Jan 14, 2025
07935ce
accounts: support for external signer API (#18079)
gzliudan Jan 14, 2025
43e6c8e
accounts: implemented EIP191/712 (#17789)
gzliudan Jan 14, 2025
99092ac
accounts/abi/bind/backends: add TransactionByHash to SimulatedBackend…
gzliudan Jan 14, 2025
4b32073
accounts: fix typos (#19119)
gzliudan Jan 14, 2025
dcc3fc3
accounts/abi: fix error message format (#19122)
gzliudan Jan 14, 2025
5d0dea8
accounts/abi: mutex lock in TransactionByHash and code cleanup (#19133)
gzliudan Jan 14, 2025
4955476
accounts: prefer nil slices over zero-length slices (#19079)
gzliudan Jan 14, 2025
e7d8247
usbwallet: check error returned by driver close (#18057)
gzliudan Jan 14, 2025
e4d78ed
accounts/abi/bind: static byte arrays should be right-padded (#19269)
gzliudan Jan 14, 2025
3657739
accounts/abi: add the original name as json-structtag for tuples (#19…
gzliudan Jan 14, 2025
769a34b
accounts/abi: generic unpacking of event logs into map[string]interfa…
gzliudan Jan 14, 2025
1f9778b
accounts: disable unlock account on open HTTP (#17037)
gzliudan Jan 14, 2025
2999bea
accounts: smartcard wallet without the dependency on libpcsclite (#19…
gzliudan Jan 14, 2025
508ae8f
accounts/scwallet: Update README for v2.2.1 support (#19425)
gzliudan Jan 14, 2025
194a775
accounts: switch Ledger derivation path to canonical one (#19438)
gzliudan Jan 14, 2025
44b6b14
accounts/scwallet: fix card pairing instruction message (#19436)
gzliudan Jan 14, 2025
fa35614
accounts, cmd: add note about backing up the keystore (#19432)
gzliudan Jan 14, 2025
b5ace99
accounts/usbwallet: fix a comment typo in trezor driver (#19535)
gzliudan Jan 14, 2025
44d58cb
accounts/abi: fix documentation (#19568)
gzliudan Jan 14, 2025
b75f946
accounts: better support for EIP-191 intended validator (#19523)
gzliudan Jan 14, 2025
316d2f8
accounts/abi: fix TestUnpackMethodIntoMap (#19484)
gzliudan Jan 14, 2025
7c8707f
accounts, p2p: make CGO_ENABLED=0 build again (#19593)
gzliudan Jan 14, 2025
b2a9e1c
accounts/usbwallet: enable the Nano X and upcoming Ledger IDs (#19623)
gzliudan Jan 14, 2025
00fbe17
accounts/keystore: enable fallback for darwin,!cgo (#19614)
gzliudan Jan 14, 2025
f80a00b
accounts/scwallet: display PUK retry count, validate PIN/PUK length (…
gzliudan Jan 14, 2025
fb35c54
accounts/scwallet: change sc url scheme to keycard (#19632)
gzliudan Jan 14, 2025
100ea1c
accounts/scwallet: add a switch to specify path to sc daemon (#19439)
gzliudan Jan 14, 2025
2e21b96
accounts/usbwallet: add webusb trezor support (#19588)
gzliudan Jan 14, 2025
e6df5f8
account/usbwallet: abort usb enumeration after failures (#19671)
gzliudan Jan 14, 2025
3130184
accounts: added transactorFromKeyStore (#19685)
gzliudan Jan 14, 2025
6aeab6a
accounts/abi/bind: rename NewKeystoreTransactor (#19703)
gzliudan Jan 14, 2025
07ebb5e
accounts/keystore: fix #19707, avoid keyword as variable name (#19731)
gzliudan Jan 14, 2025
894bed5
accounts/abi: adding the method EventById and its test (#19359)
gzliudan Jan 14, 2025
f542e46
accounts: implement simple checkpoint syncing (#19543)
gzliudan Jan 14, 2025
71e4c06
accounts/abi: Fix method overwritten by same name methods (#17099)
gzliudan Jan 14, 2025
0050f84
accounts/abi: enable struct golang binding generation (#18491)
gzliudan Jan 14, 2025
587f6b3
accounts/abi/bind: fix typo in comments (#19791)
gzliudan Jan 14, 2025
f571689
signer/core: fix reference issue in key derivation (#19827)
gzliudan Jan 14, 2025
6d17a42
all: replace t.Log(); t.FailNow() with t.Fatal() (#19849)
gzliudan Jan 14, 2025
9340a81
accounts/abi/bind: support closing a simulated backend (#19902)
gzliudan Jan 14, 2025
5009a3d
accounts/abi: fix incorrect signature (#19881)
gzliudan Jan 14, 2025
6a7b539
accounts, internal/ethapi: use common Accounts method (#18428)
gzliudan Jan 14, 2025
e90df44
accounts: replace passPHRASE with passWORD in any user interactions (…
gzliudan Jan 14, 2025
32615fd
accounts/abi: add internalType information and fix issues (#20179)
gzliudan Jan 14, 2025
3a320d2
accounts/abi/bind, cmd/abigen: implement alias for abigen (#20244)
gzliudan Jan 14, 2025
575a5cb
accounts/abi/bind/backends: remove unused assignment (#20359)
gzliudan Jan 14, 2025
eb628a4
accounts/abi: fix staticcheck warnings (#20358)
gzliudan Jan 14, 2025
f2fb9f8
accounts/abi/bind: avoid reclaring structs (#20381)
gzliudan Jan 14, 2025
833c851
accounts/keystore: fix staticcheck warnings (#20373)
gzliudan Jan 14, 2025
db708e7
accounts/scwallet: fix staticcheck warnings (#20370)
gzliudan Jan 14, 2025
193ee6d
accounts/usbwallet: fix staticcheck warnings (#20372)
gzliudan Jan 14, 2025
e9f9c19
accounts/abi/bind: fix destructive packing of *big.Int (#20412)
gzliudan Jan 14, 2025
f7b66c1
[#20266] Fix bugs decoding integers and fixed bytes in indexed event …
gzliudan Jan 14, 2025
0350880
accounts/abi/backends/simulated: add more API methods (#5) (#20208)
gzliudan Jan 14, 2025
8d4c290
accounts/abi: fix method constant flag for solidity 6.0 (#20482)
gzliudan Jan 14, 2025
164d929
accounts/abi/bind/backends: add support for historical state (#20644)
gzliudan Jan 14, 2025
219b5ef
accounts: add walletsNoLock to avoid double read lock (#20655)
gzliudan Jan 14, 2025
6259ce5
accounts/abi faster unpacking of int256 (#20850)
gzliudan Jan 14, 2025
601d1c8
accounts/scwallet: fix unnecessary use of fmt.Sprint
gzliudan Jan 14, 2025
f8b85af
accounts/abi/bind: Refactored topics (#20851)
gzliudan Jan 14, 2025
296c052
accounts/abi/bind: fixed erroneous filtering of negative ints (#20865)
gzliudan Jan 14, 2025
fd53a43
accounts/abi: implement new fallback functions (#20764)
gzliudan Jan 14, 2025
56f9c17
accounts/abi: Prevent recalculation of internal fields (#20895)
gzliudan Jan 14, 2025
91f6259
accounts/abi: remove function Unpack2 (#20830)
gzliudan Jan 14, 2025
0d1cd42
accounts/keystore: fix double import race (#20915)
gzliudan Jan 14, 2025
bca20a6
accounts/abi: added abi test cases, minor bug fixes (#20903)
gzliudan Jan 14, 2025
dabda33
accounts/abi: removed Kind from Type struct (#21009)
gzliudan Jan 14, 2025
f6b6a24
account/abi: remove superfluous type checking (#21022)
gzliudan Jan 14, 2025
7e3079c
accounts/abi: move topics to abi package (#21057)
gzliudan Jan 14, 2025
e836f32
accounts/abi: allow overloaded argument names (#21060)
gzliudan Jan 14, 2025
b9bcf17
accounts/abi: simplify reflection logic (#21058)
gzliudan Jan 14, 2025
e28727e
accounts: add blockByNumberNoLock() to avoid double-lock (#20983)
gzliudan Jan 14, 2025
afc814b
accounts: fix typos in comments (#21118)
gzliudan Jan 14, 2025
d918e53
acounts/keystore, cmd/faucet: fix faucet double import (#21172)
gzliudan Jan 14, 2025
5e3755c
accounts/keystore, cmd/faucet: return old account to allow unlock (#2…
gzliudan Jan 14, 2025
ef80645
accounts/abi/bind: fix test
gzliudan Jan 14, 2025
593fe53
internal/ethapi: return revert reason for eth_call (#21083)
gzliudan Jan 14, 2025
9c5dff2
accounts/keystore: fix typo in error message (#21200)
gzliudan Jan 14, 2025
25d42fe
accounts/abi: make GetType public again (#21157)
gzliudan Jan 14, 2025
089242b
accounts/abi/bind/backends: Disallow AdjustTime for non-empty blocks …
gzliudan Jan 14, 2025
f4feaeb
accounts/abi: fix a bug in getTypeSize method (#21501)
gzliudan Jan 14, 2025
c9643e9
accounts/abi/bind/backends: clean doc errors (#21514)
gzliudan Jan 14, 2025
321bcff
accounts/usbwallet, signer/core: show accounts from ledger legacy der…
gzliudan Jan 14, 2025
7c3c703
tests/fuzzers/abi: add fuzzer for fuzzing package accounts/abi (#21217)
gzliudan Jan 14, 2025
22df50c
accounts/abi: improve documentation and names (#21540)
gzliudan Jan 14, 2025
b0063d3
accounts/abi: ABI explicit difference between Unpack and UnpackIntoIn…
gzliudan Jan 14, 2025
5b48621
accouts, core: fix some comments (#21617)
gzliudan Jan 14, 2025
d8c9ad3
all: replace RWMutex with Mutex in places where RLock is not used (#2…
gzliudan Jan 14, 2025
d02ba1d
accounts/keystore: fix flaky test (#21703)
gzliudan Jan 14, 2025
3946405
accounts/usbwallet: fix ledger version check (#21733)
gzliudan Jan 14, 2025
c7efbcd
accounts/abi/bind: restore error functionality (#21743)
gzliudan Jan 14, 2025
7f2ae32
accounts/abi: template: set events Raw field in Parse methods (#21807)
gzliudan Jan 14, 2025
2528415
accounts: remove redundant conversions and import names (#21903)
gzliudan Jan 14, 2025
ddea01d
accounts: fix Ledger Live account derivation path (clef) (#21757)
gzliudan Jan 14, 2025
05e9dc0
accounts/keystore: add missing function doc for SignText (#21914)
gzliudan Jan 14, 2025
2ff9f33
core: improve contextual information on core errors (#21869)
gzliudan Jan 14, 2025
fb85aca
accounts/abi/bind: allow specifying signer on transactOpts (#21356)
gzliudan Jan 14, 2025
54e0d6c
abi/bind: fix error-handling in generated wrappers for functions retu…
gzliudan Jan 14, 2025
f873765
cmd/abigen: clarify abigen alias flag usage (#21875)
gzliudan Jan 14, 2025
cebdb44
accounts/abi/bind: fix erroneous test (#22053)
gzliudan Jan 14, 2025
f8c67ed
accounts/scwallet: use go-ethereum crypto instead of go-ecdh (#22212)
gzliudan Jan 14, 2025
4e23f7b
accounts/scwallet: update documentation (#22242)
gzliudan Jan 14, 2025
2ffdb94
accounts/keystore: remove uneeded syntax (#21921)
gzliudan Jan 14, 2025
01d3be7
accounts/abi/bind: fixed unpacking error (#22230)
gzliudan Jan 14, 2025
146ea8b
accounts: EIP-2718: Typed Transaction Envelope + EIP-2930 (#21502)
gzliudan Jan 14, 2025
c75ba99
accounts/keystore: use github.com/google/uuid (#22217)
gzliudan Jan 14, 2025
345ed3d
accounts: eip-712 signing for ledger (#22378)
gzliudan Jan 14, 2025
da6675f
accounts: documentation fixes (#22645)
gzliudan Jan 14, 2025
c2e71ef
accounts/abi/bind/backends: add simulated reorgs (#22624)
gzliudan Jan 14, 2025
e26b70e
accounts/abi/bind: fix sim backend test for 1559 (#23038)
gzliudan Jan 14, 2025
74ec702
accounts/abi/bind: replace context.TODO with context.Background (#23088)
gzliudan Jan 14, 2025
92d9f7e
accounts/abi/bind: parse ABI only once, create metadata struct (#22583)
gzliudan Jan 14, 2025
36d3e7d
accounts/abi/bind: set Context in TransactOpts (#23188)
gzliudan Jan 14, 2025
83b7c0e
accounts/keystore: add go:build lines (#23468)
gzliudan Jan 14, 2025
e339096
cmd/utils: don't enumerate usb when --usb isn't set (#22130)
gzliudan Jan 14, 2025
f74eacd
node: remove dependency on wallet backend packages (#23019)
gzliudan Jan 14, 2025
bcae420
accounts/keystore: fix flaky tests (#23599)
gzliudan Jan 14, 2025
2b396f2
accounts/abi: fix resolving single struct argument (#23573)
gzliudan Jan 14, 2025
2af78fe
accounts/abi/bind: check event signature before parsing (#23230)
gzliudan Jan 14, 2025
46a16f9
accounts/abi: fix some go-critic linter warnings (#23709)
gzliudan Jan 14, 2025
0c9babc
accounts/abi/bind: refactor transact method (#23719)
gzliudan Jan 14, 2025
7fb05b7
accounts/abi: add basic support for error types (#23161)
gzliudan Jan 14, 2025
65c3ad5
accounts/abi/bin/backends: return basefee in suggestGasPrice (#23838)
gzliudan Jan 14, 2025
bdf9d80
accounts/abi/bind/backends: fix race condition in simulated backend (…
gzliudan Jan 14, 2025
b33307e
accounts/abi/bind: correctly handle structs used only as constructor …
gzliudan Jan 14, 2025
c5acd68
accounts/abi: avoid unnecessary alloc (#24128)
gzliudan Jan 14, 2025
d89e2d6
accounts: fix comments (#24186)
gzliudan Jan 14, 2025
78fd3b4
accounts: corrected spelling mistakes (#24194)
gzliudan Jan 14, 2025
9e82b20
accouts/scwallet: typo fix (#24207)
gzliudan Jan 14, 2025
4f7123c
accounts/abi/bind/backends: return errors instead of panic (#24242)
gzliudan Jan 14, 2025
c55d8c8
accounts: fix typo in errors.go (#24270)
gzliudan Jan 14, 2025
c78cc1e
accounts/abi: simplify Arguments.Unpack (#24277)
gzliudan Jan 14, 2025
f220467
accounts: correct spelling mistake (#24323)
gzliudan Jan 14, 2025
8b91385
accounts/abi/bind: improve WaitMined error handling (#24321)
gzliudan Jan 14, 2025
5b10b24
all: use T.TempDir to create temporary test directories (#24633)
gzliudan Jan 14, 2025
206b614
abi/base: return error for pending call error (#24649)
gzliudan Jan 14, 2025
98629d0
accounts: fix typo in comments (#24805)
gzliudan Jan 14, 2025
a09fd97
abi: fix checks when all fields are indexed (#24792)
gzliudan Jan 14, 2025
16cdf8f
accounts/abi: eplace strings.Replace with string.ReplaceAll (#24835)
gzliudan Jan 14, 2025
04fabd6
accounts/abi: validate fieldnames, fixes #24930 (#24932)
gzliudan Jan 14, 2025
c4308f0
cmd/abigen: accept combined-json via stdin (#24960)
gzliudan Jan 14, 2025
13eef32
accounts/abi/bind: fix duplicate field names in the generated go stru…
gzliudan Jan 14, 2025
9dda5b9
accounts: more linters (#24783)
gzliudan Jan 14, 2025
d9b4f0f
accounts/abi: prefer new(big.Int) over big.NewInt(0) (#25087)
gzliudan Jan 14, 2025
53ea297
accounts/abi: replace fmt.Errorf with errors.New in abi argument (#25…
gzliudan Jan 14, 2025
b62913b
accounts/scwallet: change format 0x%x to %#x (#25221)
gzliudan Jan 14, 2025
c5eecc5
accounts/abi/bind/backends: return hash of new blocks (#25163)
gzliudan Jan 14, 2025
b3d89c0
accounts/abi: substitude arg%d to the range keyword (#25307)
gzliudan Jan 14, 2025
78a35f1
accounts: lint whitespace (#25312)
gzliudan Jan 14, 2025
08fedbb
accounts/abi: display name in "method/event not found" error (#25512)
gzliudan Jan 14, 2025
c046f36
accounts: fix some typos (#25551)
gzliudan Jan 14, 2025
b6be9c1
accounts/abi/bind/backends: typo fix (#25549)
gzliudan Jan 14, 2025
aec9d76
accounts/abi: fix set function (#25477)
gzliudan Jan 14, 2025
bdf80d7
accounts/abi/bind: add const for tx fee elasticity multiplier (#25504)
gzliudan Jan 14, 2025
e2b5a03
accounts: lint comments (#25726)
gzliudan Jan 14, 2025
0389524
accounts/abi: fix typo in error message (#25742)
gzliudan Jan 14, 2025
fde9a7e
cmd/abigen: redefine appp (#25851)
gzliudan Jan 14, 2025
06394ca
cmd/abigen: change --exc to exclude by type name (#22620)
gzliudan Jan 14, 2025
73947f0
accounts/abi/bind/backends: fix AdjustTime to respect Fork (#25225)
gzliudan Jan 14, 2025
98c67ab
accounts/abi: return toGoType error immediately (#25565)
gzliudan Jan 14, 2025
c241fc3
eth/filters: fix for eth_getLogs failing with tag (#25922)
gzliudan Jan 14, 2025
80f3eaa
accounts/usbwallet: support Ledger Nano S Plus and FTS (#25933)
gzliudan Jan 14, 2025
669b5e0
accounts: fix spelling mistakes (#25961)
gzliudan Jan 14, 2025
a79d2a2
accounts/keystore: faster tests (#25827)
gzliudan Jan 14, 2025
4292979
accounts/scwallet: fix keycard data signing error (#25331)
gzliudan Jan 14, 2025
1908539
accounts/abi: return error on fixed bytes with size larger than 32 by…
gzliudan Jan 14, 2025
cd9c09f
accounts/abi.bind: don't fetch head in transact unless required (#25988)
gzliudan Jan 14, 2025
e88251d
accounts/abi: properly quote untrusted data in error message (#26110)
gzliudan Jan 14, 2025
4081ed9
accounts/keystore: replace inotify with fsnotify (#26176)
gzliudan Jan 14, 2025
cab2938
eth/filters: update Backend interface (#26126)
gzliudan Jan 14, 2025
4e951ed
all: use github.com/deckarep/golang-set/v2 (generic set) (#26159)
gzliudan Jan 14, 2025
b18e0e4
accounts/abi: fix integer encoding/decoding (#26568)
gzliudan Jan 14, 2025
3d90cf7
accounts/keystore: remove deprecated uses of math.rand (#26710)
gzliudan Jan 14, 2025
ba053a5
accounts/usbwallet: mitigate ledger app chunking issue (#26773)
gzliudan Jan 14, 2025
1a07b9b
accounts/abi: add error-checks (#26914)
gzliudan Jan 14, 2025
5de9615
accounts/abi/bind: handle UnpackLog with zero topics (#26920)
gzliudan Jan 14, 2025
d9ec687
accounts/abi: resolve name conflict for methods starting with a numbe…
gzliudan Jan 14, 2025
013c90a
accounts/abi: add ErrorById (#27277)
gzliudan Jan 14, 2025
d4bf06d
accounts: replace noarg fmt.Errorf with errors.New (#27331)
gzliudan Jan 14, 2025
a57f358
accounts/keystore: handle error for invalid key in DecryptKey (#27432)
gzliudan Jan 14, 2025
f365434
accounts/keystore: use slices package for sorting (#27485)
gzliudan Jan 14, 2025
80967d5
accounts: fix docstrings (#27703)
gzliudan Jan 14, 2025
0f737b4
core: replace suicide with selfdestruct to improve code consistency (…
gzliudan Jan 14, 2025
e1c7317
all: remove trailing whitespace (#27741)
gzliudan Jan 14, 2025
3bce105
accounts: use atomic type (#27857)
gzliudan Jan 14, 2025
d2cfa78
account/abi: convert if-else-if chain to tagged switch (#27869)
gzliudan Jan 14, 2025
4c7507a
account/abi: handle solidity panic revert (#27868)
gzliudan Jan 14, 2025
3e880ef
cmd/clef: suppress fsnotify error if keydir not exists (#28160)
gzliudan Jan 14, 2025
0efc73d
accounts: handle genesis state missing (#28171)
gzliudan Jan 14, 2025
57598e1
accounts/abi/bind/backend: use requested header for gas prices and ga…
gzliudan Jan 14, 2025
382855b
accounts, cmd: fix typos (#28300)
gzliudan Jan 14, 2025
b6c33b9
internal/ethapi, accounts/abi/bind: use `errors.Is` for error compari…
gzliudan Jan 14, 2025
df87605
api/bind: add CallOpts.BlockHash to allow calling contracts at a spec…
gzliudan Jan 14, 2025
5081ad7
accounts: move fuzzers into native packages (#28467)
gzliudan Jan 14, 2025
390daf9
accounts: fix errors checked by go-staticcheck ST1005 (#28532)
gzliudan Jan 14, 2025
919cbf6
accounts/abi: improve readability of method-to-string conversion (#2…
gzliudan Jan 14, 2025
e78abe0
accounts/scwallet: replace strings.SplitN(arg, sep, 2) with strings.C…
gzliudan Jan 14, 2025
ccda15e
accounts, cmd: fix typos (#28526)
gzliudan Jan 14, 2025
4d07efe
cdm/abigen: run tests in parallel (#28546)
gzliudan Jan 14, 2025
ea6606a
accounts/abi: context info on unpack-errors (#28529)
gzliudan Jan 14, 2025
f804203
accounts/keystore: speed up tests (#28461)
gzliudan Jan 14, 2025
0b30a3d
accounts/abi/bind: fix typo (#28630)
gzliudan Jan 14, 2025
c032eed
accounts/abi/bind: fixed typos (#28634)
gzliudan Jan 14, 2025
4a54407
accounts: run tests in parallel (#28544)
gzliudan Jan 14, 2025
8133f96
all: fix typos in comments (#28662)
gzliudan Jan 14, 2025
36bf731
accounts: properly close managed wallets when closing manager (#28710)
gzliudan Jan 14, 2025
0e7679d
accounts,signer: fix typos in comments (#28730)
gzliudan Jan 14, 2025
b5f6104
accounts/abi: fix bigInt topic encoding (#28764)
gzliudan Jan 14, 2025
c1913bb
accounts/abi/bind/backends: replace NewSimulatedBackend with NewXDCSi…
gzliudan Jan 14, 2025
0a0784d
acounts/usbwallet: fix typo (#28815)
gzliudan Jan 14, 2025
2dfb1cf
accounts: fix typos (#28881)
gzliudan Jan 14, 2025
745c276
fix: update outdated link to trezor docs (#28966)
gzliudan Jan 14, 2025
b6f3007
core: move genesis alloc types to core/types (#29003)
gzliudan Jan 14, 2025
85059ed
accounts/abi: delete duplicate error check (#29136)
gzliudan Jan 14, 2025
13d3917
accounts/usbwallet: update hid library (#29176)
gzliudan Jan 14, 2025
888963c
accounts: remove deprecated function NewPlaintextKeyStore (#29171)
gzliudan Jan 14, 2025
a9ca99d
accounts: remove redundant string conversion (#29184)
gzliudan Jan 14, 2025
2b60816
accounts/scwallet: remove references to deprecated elliptic package (…
gzliudan Jan 14, 2025
30dc0f4
accounts/abi/bind: check invalid chainID first (#29275)
gzliudan Jan 14, 2025
dfc0f11
accounts/keystore: use min/max/clear from go1.21 (#29307)
gzliudan Jan 14, 2025
733a5fc
accounts: fix mismatched names in comments (#29348)
gzliudan Jan 14, 2025
02a3aa1
accounts/abi: fix typos (#29542 #29600)
gzliudan Jan 14, 2025
ef71887
accounts, cmd/geth, core: close opened files (#29598)
gzliudan Jan 14, 2025
643c715
accounts: fix TestUpdateKeyfileContents (#29867)
gzliudan Jan 14, 2025
d2e0067
accounts: avoid duplicate regex compilation (#29943)
gzliudan Jan 14, 2025
62895df
accounts/keystore: use t.TempDir in test (#30052)
gzliudan Jan 14, 2025
a0a1322
accounts/usbwallet/trezor: upgrade to generate with protoc 27.1 (#30058)
gzliudan Jan 14, 2025
1fcc36a
build: add check for stale generated files (#30037)
gzliudan Jan 14, 2025
52ac8ae
accounts/abi/bind: use embed pkg to split go source template to file …
gzliudan Jan 14, 2025
0cbaccd
accounts/keystore: simplify tests using t.TempDir() (#30150)
gzliudan Jan 14, 2025
5beff83
all: remove deprecated protobuf dependencies (#30232)
gzliudan Jan 14, 2025
c6a8f79
accounts/abi/bind: add accessList support to base bond contract (#30195)
gzliudan Jan 14, 2025
11d3afd
accounts/abi: handle ABIs with contract type parameter (#30315)
gzliudan Jan 14, 2025
ced6592
accounts/abi/bind: check SendTransaction error in tests (#30349)
gzliudan Jan 14, 2025
72e5ee7
accounts/abi: golangci-lint 1.61.0 (#30587)
gzliudan Jan 14, 2025
db3dc19
accounts/usbwallet: support dynamic tx (#30180)
gzliudan Jan 14, 2025
aa164fb
accounts/abi: fix MakeTopics mutation of big.Int inputs (#30785)
gzliudan Jan 14, 2025
6f37e85
accounts/abi: support unpacking solidity errors (#30738)
gzliudan Jan 14, 2025
a8a96a8
accounts/abi/bind: make it possible to wait for tx hash (#30079)
gzliudan Jan 14, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion XDCx/token.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ func RunContract(chain consensus.ChainContext, statedb *state.StateDB, contractA
return nil, err
}
var unpackResult interface{}
err = abi.Unpack(&unpackResult, method, result)
err = abi.UnpackIntoInterface(&unpackResult, method, result)
if err != nil {
return nil, err
}
Expand Down
2 changes: 1 addition & 1 deletion XDCx/tradingstate/statedb.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ func (t *TradingStateDB) Error() error {
}

// Exist reports whether the given orderId address exists in the state.
// Notably this also returns true for suicided exchanges.
// Notably this also returns true for self-destructed exchanges.
func (t *TradingStateDB) Exist(addr common.Hash) bool {
return t.getStateExchangeObject(addr) != nil
}
Expand Down
2 changes: 1 addition & 1 deletion XDCxlending/lendingstate/statedb.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ func (ls *LendingStateDB) Error() error {
}

// Exist reports whether the given tradeId address exists in the state.
// Notably this also returns true for suicided lenddinges.
// Notably this also returns true for self-destructed lenddinges.
func (ls *LendingStateDB) Exist(addr common.Hash) bool {
return ls.getLendingExchange(addr) != nil
}
Expand Down
247 changes: 195 additions & 52 deletions accounts/abi/abi.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,17 +22,26 @@ import (
"errors"
"fmt"
"io"
"math/big"

"github.com/XinFinOrg/XDPoSChain/common"
"github.com/XinFinOrg/XDPoSChain/crypto"
)

// The ABI holds information about a contract's context and available
// invokable methods. It will allow you to type check function calls and
// invocable methods. It will allow you to type check function calls and
// packs data accordingly.
type ABI struct {
Constructor Method
Methods map[string]Method
Events map[string]Event
Errors map[string]Error

// Additional "special" functions introduced in solidity v0.6.0.
// It's separated from the original default fallback. Each contract
// can only define one fallback and receive function.
Fallback Method // Note it's also used to represent legacy fallback before v0.6.0
Receive Method
}

// JSON returns a parsed ABI interface and error if it failed.
Expand All @@ -43,7 +52,6 @@ func JSON(reader io.Reader) (ABI, error) {
if err := dec.Decode(&abi); err != nil {
return ABI{}, err
}

return abi, nil
}

Expand All @@ -61,111 +69,246 @@ func (abi ABI) Pack(name string, args ...interface{}) ([]byte, error) {
return nil, err
}
return arguments, nil

}
method, exist := abi.Methods[name]
if !exist {
return nil, fmt.Errorf("method '%s' not found", name)
}

arguments, err := method.Inputs.Pack(args...)
if err != nil {
return nil, err
}
// Pack up the method ID too if not a constructor and return
return append(method.Id(), arguments...), nil
return append(method.ID, arguments...), nil
}

// Unpack output in v according to the abi specification
func (abi ABI) Unpack(v interface{}, name string, output []byte) (err error) {
if len(output) == 0 {
return errors.New("abi: unmarshalling empty output")
}
func (abi ABI) getArguments(name string, data []byte) (Arguments, error) {
// since there can't be naming collisions with contracts and events,
// we need to decide whether we're calling a method or an event
// we need to decide whether we're calling a method, event or an error
var args Arguments
if method, ok := abi.Methods[name]; ok {
if len(output)%32 != 0 {
return errors.New("abi: improperly formatted output")
if len(data)%32 != 0 {
return nil, fmt.Errorf("abi: improperly formatted output: %q - Bytes: %+v", data, data)
}
return method.Outputs.Unpack(v, output)
} else if event, ok := abi.Events[name]; ok {
return event.Inputs.Unpack(v, output)
args = method.Outputs
}
if event, ok := abi.Events[name]; ok {
args = event.Inputs
}
if err, ok := abi.Errors[name]; ok {
args = err.Inputs
}
if args == nil {
return nil, fmt.Errorf("abi: could not locate named method, event or error: %s", name)
}
return errors.New("abi: could not locate named method or event")
return args, nil
}

// UnmarshalJSON implements json.Unmarshaler interface
// Unpack unpacks the output according to the abi specification.
func (abi ABI) Unpack(name string, data []byte) ([]interface{}, error) {
args, err := abi.getArguments(name, data)
if err != nil {
return nil, err
}
return args.Unpack(data)
}

// UnpackIntoInterface unpacks the output in v according to the abi specification.
// It performs an additional copy. Please only use, if you want to unpack into a
// structure that does not strictly conform to the abi structure (e.g. has additional arguments)
func (abi ABI) UnpackIntoInterface(v interface{}, name string, data []byte) error {
args, err := abi.getArguments(name, data)
if err != nil {
return err
}
unpacked, err := args.Unpack(data)
if err != nil {
return err
}
return args.Copy(v, unpacked)
}

// UnpackIntoMap unpacks a log into the provided map[string]interface{}.
func (abi ABI) UnpackIntoMap(v map[string]interface{}, name string, data []byte) (err error) {
args, err := abi.getArguments(name, data)
if err != nil {
return err
}
return args.UnpackIntoMap(v, data)
}

// UnmarshalJSON implements json.Unmarshaler interface.
func (abi *ABI) UnmarshalJSON(data []byte) error {
var fields []struct {
Type string
Name string
Constant bool
Type string
Name string
Inputs []Argument
Outputs []Argument

// Status indicator which can be: "pure", "view",
// "nonpayable" or "payable".
StateMutability string

// Deprecated Status indicators, but removed in v0.6.0.
Constant bool // True if function is either pure or view
Payable bool // True if function is payable

// Event relevant indicator represents the event is
// declared as anonymous.
Anonymous bool
Inputs []Argument
Outputs []Argument
}

if err := json.Unmarshal(data, &fields); err != nil {
return err
}

abi.Methods = make(map[string]Method)
abi.Events = make(map[string]Event)
abi.Errors = make(map[string]Error)
for _, field := range fields {
switch field.Type {
case "constructor":
abi.Constructor = Method{
Inputs: field.Inputs,
abi.Constructor = NewMethod("", "", Constructor, field.StateMutability, field.Constant, field.Payable, field.Inputs, nil)
case "function":
name := ResolveNameConflict(field.Name, func(s string) bool { _, ok := abi.Methods[s]; return ok })
abi.Methods[name] = NewMethod(name, field.Name, Function, field.StateMutability, field.Constant, field.Payable, field.Inputs, field.Outputs)
case "fallback":
// New introduced function type in v0.6.0, check more detail
// here https://solidity.readthedocs.io/en/v0.6.0/contracts.html#fallback-function
if abi.HasFallback() {
return errors.New("only single fallback is allowed")
}
// empty defaults to function according to the abi spec
case "function", "":
abi.Methods[field.Name] = Method{
Name: field.Name,
Const: field.Constant,
Inputs: field.Inputs,
Outputs: field.Outputs,
abi.Fallback = NewMethod("", "", Fallback, field.StateMutability, field.Constant, field.Payable, nil, nil)
case "receive":
// New introduced function type in v0.6.0, check more detail
// here https://solidity.readthedocs.io/en/v0.6.0/contracts.html#fallback-function
if abi.HasReceive() {
return errors.New("only single receive is allowed")
}
case "event":
abi.Events[field.Name] = Event{
Name: field.Name,
Anonymous: field.Anonymous,
Inputs: field.Inputs,
if field.StateMutability != "payable" {
return errors.New("the statemutability of receive can only be payable")
}
abi.Receive = NewMethod("", "", Receive, field.StateMutability, field.Constant, field.Payable, nil, nil)
case "event":
name := ResolveNameConflict(field.Name, func(s string) bool { _, ok := abi.Events[s]; return ok })
abi.Events[name] = NewEvent(name, field.Name, field.Anonymous, field.Inputs)
case "error":
// Errors cannot be overloaded or overridden but are inherited,
// no need to resolve the name conflict here.
abi.Errors[field.Name] = NewError(field.Name, field.Inputs)
default:
return fmt.Errorf("abi: could not recognize type %v of field %v", field.Type, field.Name)
}
}

return nil
}

// MethodById looks up a method by the 4-byte id
// returns nil if none found
// MethodById looks up a method by the 4-byte id,
// returns nil if none found.
func (abi *ABI) MethodById(sigdata []byte) (*Method, error) {
if len(sigdata) < 4 {
return nil, fmt.Errorf("data too short (%d bytes) for abi method lookup", len(sigdata))
}
for _, method := range abi.Methods {
if bytes.Equal(method.Id(), sigdata[:4]) {
if bytes.Equal(method.ID, sigdata[:4]) {
return &method, nil
}
}
return nil, fmt.Errorf("no method with id: %#x", sigdata[:4])
}

// EventByID looks an event up by its topic hash in the
// ABI and returns nil if none found.
func (abi *ABI) EventByID(topic common.Hash) (*Event, error) {
for _, event := range abi.Events {
if bytes.Equal(event.ID.Bytes(), topic.Bytes()) {
return &event, nil
}
}
return nil, fmt.Errorf("no event with id: %#x", topic.Hex())
}

// ErrorByID looks up an error by the 4-byte id,
// returns nil if none found.
func (abi *ABI) ErrorByID(sigdata [4]byte) (*Error, error) {
for _, errABI := range abi.Errors {
if bytes.Equal(errABI.ID[:4], sigdata[:]) {
return &errABI, nil
}
}
return nil, fmt.Errorf("no error with id: %#x", sigdata[:])
}

// HasFallback returns an indicator whether a fallback function is included.
func (abi *ABI) HasFallback() bool {
return abi.Fallback.Type == Fallback
}

// HasReceive returns an indicator whether a receive function is included.
func (abi *ABI) HasReceive() bool {
return abi.Receive.Type == Receive
}

// revertSelector is a special function selector for revert reason unpacking.
var revertSelector = crypto.Keccak256([]byte("Error(string)"))[:4]

// panicSelector is a special function selector for panic reason unpacking.
var panicSelector = crypto.Keccak256([]byte("Panic(uint256)"))[:4]

// panicReasons map is for readable panic codes
// see this linkage for the details
// https://docs.soliditylang.org/en/v0.8.21/control-structures.html#panic-via-assert-and-error-via-require
// the reason string list is copied from ether.js
// https://github.com/ethers-io/ethers.js/blob/fa3a883ff7c88611ce766f58bdd4b8ac90814470/src.ts/abi/interface.ts#L207-L218
var panicReasons = map[uint64]string{
0x00: "generic panic",
0x01: "assert(false)",
0x11: "arithmetic underflow or overflow",
0x12: "division or modulo by zero",
0x21: "enum overflow",
0x22: "invalid encoded storage byte array accessed",
0x31: "out-of-bounds array access; popping on an empty array",
0x32: "out-of-bounds access of an array or bytesN",
0x41: "out of memory",
0x51: "uninitialized function",
}

// UnpackRevert resolves the abi-encoded revert reason. According to the solidity
// spec https://solidity.readthedocs.io/en/latest/control-structures.html#revert,
// the provided revert reason is abi-encoded as if it were a call to a function
// `Error(string)`. So it's a special tool for it.
// the provided revert reason is abi-encoded as if it were a call to function
// `Error(string)` or `Panic(uint256)`. So it's a special tool for it.
func UnpackRevert(data []byte) (string, error) {
if len(data) < 4 {
return "", errors.New("invalid data for unpacking")
}
if !bytes.Equal(data[:4], revertSelector) {
switch {
case bytes.Equal(data[:4], revertSelector):
typ, err := NewType("string", "", nil)
if err != nil {
return "", err
}
unpacked, err := (Arguments{{Type: typ}}).Unpack(data[4:])
if err != nil {
return "", err
}
return unpacked[0].(string), nil
case bytes.Equal(data[:4], panicSelector):
typ, err := NewType("uint256", "", nil)
if err != nil {
return "", err
}
unpacked, err := (Arguments{{Type: typ}}).Unpack(data[4:])
if err != nil {
return "", err
}
pCode := unpacked[0].(*big.Int)
// uint64 safety check for future
// but the code is not bigger than MAX(uint64) now
if pCode.IsUint64() {
if reason, ok := panicReasons[pCode.Uint64()]; ok {
return reason, nil
}
}
return fmt.Sprintf("unknown panic code: %#x", pCode), nil
default:
return "", errors.New("invalid data for unpacking")
}
typ, _ := NewType("string")
unpacked, err := (Arguments{{Type: typ}}).Unpack2(data[4:])
if err != nil {
return "", err
}
return unpacked[0].(string), nil
}
Loading
Loading