-
Notifications
You must be signed in to change notification settings - Fork 73
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Write storage change in trace (#213)
This PR writes the storage change in the trace. Example output when using cast run from [the PR](foundry-rs/foundry#9013): ``` ❯ cargo run --bin cast run 0xefc789b63631b255aeb6f97d948c9eac14bae4b7f021122fe24c7c6e4f34667f -r https://eth.llamarpc.com -q --decode-internal --with-state-changes Compiling: TransparentUpgradeableProxy 0x6bE457e04092B28865E0cBa84E3b2CFa0f871E67 Compiling: TransparentUpgradeableProxy 0x7a7f0b3c23C23a31cFcb0c44709be70d4D545c6e Compiling: TransparentUpgradeableProxy 0xD523794C879D9eC028960a231F866758e405bE34 Compiling: Pool 0xDEbbf61098642C7c06fAd1E116C1a00e50405D0d Traces: [247473] TransparentUpgradeableProxy::stake{value: 1949677189193480698}(1) ├─ [2232] TransparentUpgradeableProxy::_beforeFallback() │ ├─ [2150] ERC1967Upgrade::_getAdmin() │ │ └─ ← 0xD491302a6621128f4b5a6A49ce6657230732b0cb │ └─ ← ├─ [2196] ERC1967Proxy::_implementation() │ └─ ← 0xDEbbf61098642C7c06fAd1E116C1a00e50405D0d ├─ [240157] Pool::stake{value: 1949677189193480698}(1) [delegatecall] │ ├─ [213932] Pool::_stake(0x93386C72aa57082820Ad6Aa29998B820971a8d61, 1949677189193480698 [1.949e18]) │ │ ├─ [228681] TransparentUpgradeableProxy::deposit(0x93386C72aa57082820Ad6Aa29998B820971a8d61, 1949677189193480698 [1.949e18]) │ │ │ ├─ [2232] TransparentUpgradeableProxy::_beforeFallback() │ │ │ │ ├─ [2150] ERC1967Upgrade::_getAdmin() │ │ │ │ │ └─ ← 0xD491302a6621128f4b5a6A49ce6657230732b0cb │ │ │ │ └─ ← │ │ │ ├─ [2196] ERC1967Proxy::_implementation() │ │ │ │ └─ ← 0x1a5b89b2ef0028A059EAD7D9E648B533f87c8558 │ │ │ ├─ [221356] 0x1a5b89b2ef0028A059EAD7D9E648B533f87c8558::deposit(0x93386C72aa57082820Ad6Aa29998B820971a8d61, 1949677189193480698 [1.949e18]) [delegatecall] │ │ │ │ ├─ emit Update(: 1305166715630598691 [1.305e18], : 17341785000000000 [1.734e16], : 1926865000000000 [1.926e15]) │ │ │ │ ├─ [22215] TransparentUpgradeableProxy::reStake(17341785000000000 [1.734e16], 0) │ │ │ │ │ ├─ [2232] TransparentUpgradeableProxy::_beforeFallback() │ │ │ │ │ │ ├─ [2150] ERC1967Upgrade::_getAdmin() │ │ │ │ │ │ │ └─ ← 0xD491302a6621128f4b5a6A49ce6657230732b0cb │ │ │ │ │ │ └─ ← │ │ │ │ │ ├─ [2196] ERC1967Proxy::_implementation() │ │ │ │ │ │ └─ ← 0xbE3366a14D0c87094DEB6DFbA667299b4EaC489d │ │ │ │ │ ├─ [14896] 0xbE3366a14D0c87094DEB6DFbA667299b4EaC489d::reStake(17341785000000000 [1.734e16], 0) [delegatecall] │ │ │ │ │ │ ├─ [3266] TransparentUpgradeableProxy::restake{value: 17341785000000000}(0) │ │ │ │ │ │ │ ├─ [232] TransparentUpgradeableProxy::_beforeFallback() │ │ │ │ │ │ │ │ ├─ [150] ERC1967Upgrade::_getAdmin() │ │ │ │ │ │ │ │ │ └─ ← 0xD491302a6621128f4b5a6A49ce6657230732b0cb │ │ │ │ │ │ │ │ └─ ← │ │ │ │ │ │ │ ├─ [196] ERC1967Proxy::_implementation() │ │ │ │ │ │ │ │ └─ ← 0xDEbbf61098642C7c06fAd1E116C1a00e50405D0d │ │ │ │ │ │ │ ├─ [2450] Pool::restake{value: 17341785000000000}(0) [delegatecall] │ │ │ │ │ │ │ │ └─ ← [Stop] │ │ │ │ │ │ │ └─ ← [Return] │ │ │ │ │ │ └─ ← [Stop] │ │ │ │ │ └─ ← [Return] │ │ │ │ ├─ emit topic 0: 0xb0ec6c271a891e04f03d43bf454839acfbf574e269cb5599c1f70b9257cf9cd7 │ │ │ │ │ data: 0x000000000000000000000000000000000000000000000000003d9c42f6b23a00 │ │ │ │ ├─ emit topic 0: 0xc8724ec5e59eea00f3f35419c3139ead03ff07766e7e9cf00a62381692aac8c7 │ │ │ │ │ topic 1: 0x00000000000000000000000093386c72aa57082820ad6aa29998b820971a8d61 │ │ │ │ │ data: 0x0000000000000000000000000000000000000000000000001b0ea512e08f39fa │ │ │ │ ├─ storage write 0x7a7f0b3c23C23a31cFcb0c44709be70d4D545c6e [0x501d093c0316d001addb7dc8913312112ff29225e2343de5aed242436c83ecaf]: │ │ │ │ │ 0x0000000000000000000000000000000000000000000000000000000000000000 → 0x0000000000000000000000000000000000000000000000001b0ea512e08f39fa ... │ │ │ │ │ 0x0000000000000000000000000000000000000000000000000000000000000003 → 0x0000000000000000000000000000000000000000000000000000000000000004 │ │ │ │ ├─ storage write 0x7a7f0b3c23C23a31cFcb0c44709be70d4D545c6e [0xb4c87350b3618bf3b0453372aae234908cc3b6cf61d458f195edd9160dac1f7f]: │ │ │ │ │ 0x000000000000000000000000000000000000000000000000ce8cbfb644313c26 → 0x000000000000000000000000000000000000000000000000e9d9010c1b72b020 │ │ │ │ └─ ← [Return] 0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 │ │ │ └─ ← [Return] 0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 │ │ └─ ← │ ├─ emit StakeAdded(staker: 0x93386C72aa57082820Ad6Aa29998B820971a8d61, value: 1949677189193480698 [1.949e18], source: 1) │ └─ ← [Stop] └─ ← [Return] Transaction successfully executed. Gas used: 248777 ``` --------- Co-authored-by: DaniPopes <[email protected]>
- Loading branch information
Showing
170 changed files
with
2,302 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes
File renamed without changes.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
[18] → new RevertingConstructor@0xBd770416a3345F91E4B34576cb804a576fa48EB1(0x604260005260206000fd) | ||
└─ ← [Revert] 42 |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
[18] → new RevertingConstructor@0xBd770416a3345F91E4B34576cb804a576fa48EB1 | ||
└─ ← [Revert] 42 |
File renamed without changes
File renamed without changes.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
[18] → new <unknown>@0xBd770416a3345F91E4B34576cb804a576fa48EB1(0x604260005260206000fd) | ||
└─ ← [Revert] 0x0000000000000000000000000000000000000000000000000000000000000042 |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
[18] → new <unknown>@0xBd770416a3345F91E4B34576cb804a576fa48EB1 | ||
└─ ← [Revert] 0x0000000000000000000000000000000000000000000000000000000000000042 |
File renamed without changes
File renamed without changes.
29 changes: 29 additions & 0 deletions
29
tests/it/writer/test_trace_printing/0.bytecodes.storage.decoded.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.