Skip to content

Commit 2badd70

Browse files
elopezblishko
authored andcommitted
EVM: EIP-1153: preserve transient storage in replaceCode
The `replaceCode` function now preserves the `tStorage` field when converting from `InitCode` to `RuntimeCode`. Per EIP-1153, transient storage set during constructor execution should be accessible in the deployed contract. This fixes 4 failing `eip1153_tstore` tests: https://github.com/ethereum/execution-specs/blob/2c549ce0b655dab328e917ed251acbae5a655cbb/tests/cancun/eip1153_tstore/test_tstorage_create_contexts.py#L72-L126
1 parent 511488a commit 2badd70

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/EVM.hs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2347,6 +2347,7 @@ replaceCode target newCode =
23472347
{ balance = now.balance
23482348
, nonce = now.nonce
23492349
, storage = now.storage
2350+
, tStorage = now.tStorage
23502351
}
23512352
RuntimeCode _ ->
23522353
internalError $ "Can't replace code of deployed contract " <> show target

0 commit comments

Comments
 (0)