@@ -950,7 +950,7 @@ def _init_cterm(
950
950
'TRACEDATA_CELL' : KApply ('.List' ),
951
951
}
952
952
953
- storage_constraints : list [KApply ] = []
953
+ cse_constraints : list [KApply ] = []
954
954
955
955
if config_type == ConfigType .TEST_CONFIG or active_simbolik :
956
956
init_account_list = (
@@ -991,7 +991,7 @@ def _init_cterm(
991
991
accounts .append (Foundry .symbolic_account (contract_account_name , contract_code ))
992
992
else :
993
993
# Symbolic accounts of all relevant contracts
994
- accounts , storage_constraints = _create_cse_accounts (
994
+ accounts , cse_constraints = _create_cse_accounts (
995
995
foundry , storage_fields , contract_account_name , contract_code
996
996
)
997
997
@@ -1006,6 +1006,23 @@ def _init_cterm(
1006
1006
if not isinstance (method , Contract .Constructor ) and not (method .view or method .pure ):
1007
1007
init_subst ['STATIC_CELL' ] = FALSE
1008
1008
1009
+ # Summarization applies to external calls, at least one level deeper than the test call where an `expectRevert` or `prank` is expected
1010
+ expectrevert_depth_constraint = mlEqualsTrue (
1011
+ KApply (
1012
+ '_>Int_' ,
1013
+ [KVariable ('CALLDEPTH_CELL' , sort = KSort ('Int' )), KVariable ('EXPECTEDDEPTH_CELL' , sort = KSort ('Int' ))],
1014
+ )
1015
+ )
1016
+ prank_depth_constraint = mlEqualsTrue (
1017
+ KApply (
1018
+ '_>Int_' , [KVariable ('CALLDEPTH_CELL' , sort = KSort ('Int' )), KVariable ('DEPTH_CELL' , sort = KSort ('Int' ))]
1019
+ )
1020
+ )
1021
+ cse_constraints += [
1022
+ expectrevert_depth_constraint ,
1023
+ prank_depth_constraint ,
1024
+ ]
1025
+
1009
1026
if calldata is not None :
1010
1027
init_subst ['CALLDATA_CELL' ] = calldata
1011
1028
@@ -1030,7 +1047,7 @@ def _init_cterm(
1030
1047
if preconditions is not None :
1031
1048
for precondition in preconditions :
1032
1049
init_cterm = init_cterm .add_constraint (mlEqualsTrue (precondition ))
1033
- for constraint in storage_constraints :
1050
+ for constraint in cse_constraints :
1034
1051
init_cterm = init_cterm .add_constraint (constraint )
1035
1052
1036
1053
non_cheatcode_contract_ids = []
0 commit comments