Commit 57ee135
feat: add support for eip 1967 proxy decoding of implementation contract [DPT-108] (#559)
This pull request adds support for decoding proposals that use EIP-1967
proxies, enabling the analyzer to correctly handle transactions routed
through proxy contracts. It introduces logic to detect EIP-1967 proxies,
query their implementation addresses, and decode transactions using the
implementation contract's ABI. Several interfaces and functions have
been updated to support this feature, and related CLI commands and tests
have been refactored to pass the necessary context and environment.
**EIP-1967 Proxy Decoding Support**
* Added logic in `experimental/analyzer/evm_analyzer.go` to detect
EIP-1967 proxies, query the implementation address from the proxy's
storage slot, and retry transaction decoding using the implementation's
ABI. This includes helper functions for error detection, storage
querying, and address book lookup.
[[1]](diffhunk://#diff-d05cb08f5758df1d4fe8c917b80a15ba5a039afa96389c8a658cc9640bc69bd8R4-R26)
[[2]](diffhunk://#diff-d05cb08f5758df1d4fe8c917b80a15ba5a039afa96389c8a658cc9640bc69bd8R67-R79)
[[3]](diffhunk://#diff-d05cb08f5758df1d4fe8c917b80a15ba5a039afa96389c8a658cc9640bc69bd8R144-R274)
**Interface and Function Refactoring**
* Updated the `OnchainClient` interface in `chain/evm/evm_chain.go` to
include a `StorageAt` method for reading contract storage slots,
required for EIP-1967 detection.
* Added a retrying implementation of `StorageAt` in
`chain/evm/provider/rpcclient/multiclient.go`.
* Refactored analyzer and report builder functions to accept
`context.Context`, `ProposalContext`, and `deployment.Environment`
parameters, enabling access to chain clients and address books for proxy
decoding.
[[1]](diffhunk://#diff-ff37930dedd57e6d416bf12ffbf08b8d4f98cea09a9b4583077aab2ce25210a9R4-R12)
[[2]](diffhunk://#diff-ff37930dedd57e6d416bf12ffbf08b8d4f98cea09a9b4583077aab2ce25210a9L19-R29)
[[3]](diffhunk://#diff-ff37930dedd57e6d416bf12ffbf08b8d4f98cea09a9b4583077aab2ce25210a9L36-R42)
[[4]](diffhunk://#diff-7508803ab51e1e56d089e5224e2594cd0fb2ba5e66c768f3a05d9d1866ed9d28R4-R15)
[[5]](diffhunk://#diff-7508803ab51e1e56d089e5224e2594cd0fb2ba5e66c768f3a05d9d1866ed9d28L25-R46)
[[6]](diffhunk://#diff-7508803ab51e1e56d089e5224e2594cd0fb2ba5e66c768f3a05d9d1866ed9d28L64-R67)
**CLI and Test Updates**
* Updated CLI command implementations and tests to pass the new context
and environment parameters to analyzer functions, ensuring compatibility
with the new proxy decoding logic.
[[1]](diffhunk://#diff-726dd799d05204c24b69b8bda1f4ede5393c5955b360b076db8d11bc01f56a1bL741-R743)
[[2]](diffhunk://#diff-726dd799d05204c24b69b8bda1f4ede5393c5955b360b076db8d11bc01f56a1bL885-R887)
[[3]](diffhunk://#diff-3818b4d496d99fec18364a7b0e6c7fcccbd4055c3d9b4f0adf35851350b2a89cL200-R200)
[[4]](diffhunk://#diff-96db697e4922f8c507f56e4baaf253b0fa188dceeb762abe29657beb0e98c4d9L182-R182)
[[5]](diffhunk://#diff-7b54608514607b52f696bac5ff122a5066d4315786095039743c5a1e4cb10924L17-R17)
[[6]](diffhunk://#diff-7b54608514607b52f696bac5ff122a5066d4315786095039743c5a1e4cb10924L91-R91)
[[7]](diffhunk://#diff-7b54608514607b52f696bac5ff122a5066d4315786095039743c5a1e4cb10924L115-R115)
[[8]](diffhunk://#diff-7b54608514607b52f696bac5ff122a5066d4315786095039743c5a1e4cb10924L197-R197)
**Documentation**
* Added a changeset documenting the new EIP-1967 proxy decoding support
for the `chainlink-deployments-framework` package.
---------
Co-authored-by: Copilot <[email protected]>1 parent dc2c113 commit 57ee135
File tree
17 files changed
+2516
-125
lines changed- .changeset
- chain/evm
- provider/rpcclient
- engine/cld/legacy/cli
- commands
- mcmsv2
- experimental/analyzer
- upf
17 files changed
+2516
-125
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
91 | 91 | | |
92 | 92 | | |
93 | 93 | | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
28 | 31 | | |
29 | 32 | | |
30 | 33 | | |
| |||
0 commit comments