Skip to content

Commit 373347e

Browse files
committed
Clean up subState when setting up transactions
1 parent ef5ba26 commit 373347e

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

lib/Echidna/Transaction.hs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ setupTx tx@Tx{call} = fromEVM $ do
177177
, callvalue = Lit tx.value
178178
}
179179
, block = advanceBlock vm.block tx.delay
180-
, tx = vm.tx { gasprice = tx.gasprice, origin = LitAddr tx.src }
180+
, tx = vm.tx { gasprice = tx.gasprice, origin = LitAddr tx.src, subState = subState vm }
181181
}
182182
when isCreate $ do
183183
#env % #contracts % at (LitAddr tx.dst) .=
@@ -207,6 +207,12 @@ setupTx tx@Tx{call} = fromEVM $ do
207207
SolCreate bc -> bc
208208
SolCall cd -> encode cd
209209
SolCalldata cd -> cd
210+
subState vm = let
211+
initialAccessedAddrs = Set.fromList $
212+
[LitAddr tx.src, LitAddr tx.dst, vm.block.coinbase]
213+
++ fmap LitAddr [1..10] -- precompile addresses
214+
touched = if isCreate then [LitAddr tx.src] else [LitAddr tx.src, LitAddr tx.dst]
215+
in SubState mempty touched initialAccessedAddrs mempty mempty mempty
210216

211217
advanceBlock :: Block -> (W256, W256) -> Block
212218
advanceBlock blk (t,b) =

0 commit comments

Comments
 (0)