10
10
from pyk .cterm import CTerm
11
11
from pyk .kast .inner import KApply , KAtt , KInner , KLabel , KRewrite , KSequence , KSort , KVariable , build_assoc
12
12
from pyk .kast .manip import abstract_term_safely , substitute
13
- from pyk .kast .outer import (
14
- KFlatModule ,
15
- KImport ,
16
- KNonTerminal ,
17
- KProduction ,
18
- KProductionItem ,
19
- KRule ,
20
- KSentence ,
21
- KTerminal ,
22
- KToken ,
23
- )
13
+ from pyk .kast .outer import KFlatModule , KImport , KNonTerminal , KProduction , KProductionItem , KRule , KSentence , KTerminal
24
14
from pyk .kcfg import KCFG
25
15
from pyk .prelude .kbool import FALSE , TRUE , andBool , notBool
26
16
from pyk .prelude .kint import intToken
@@ -337,11 +327,10 @@ def method_to_cfg(empty_config: KInner, contract: Contract, method: Contract.Met
337
327
338
328
339
329
def _init_cterm (init_term : KInner ) -> CTerm :
340
- key_dst = KEVM .loc (KToken ('FoundryCheat . Failed' , 'ContractAccess' ))
341
- dst_failed_prev = KEVM .lookup (KVariable ('CHEATCODE_STORAGE' ), key_dst )
330
+ dst_failed_prev = KEVM .lookup (KVariable ('CHEATCODE_STORAGE' ), Foundry .loc_FOUNDRY_FAILED ())
342
331
init_cterm = CTerm (init_term )
343
332
init_cterm = KEVM .add_invariant (init_cterm )
344
- init_cterm = init_cterm .add_constraint (mlEqualsTrue (KApply ('_==Int_' , [dst_failed_prev , KToken ( '0' , 'Int' )])))
333
+ init_cterm = init_cterm .add_constraint (mlEqualsTrue (KApply ('_==Int_' , [dst_failed_prev , intToken ( 0 )])))
345
334
return init_cterm
346
335
347
336
@@ -389,10 +378,10 @@ def _init_term(
389
378
),
390
379
),
391
380
'LOCALMEM_CELL' : KApply ('.Memory_EVM-TYPES_Memory' ),
392
- 'PREVCALLER_CELL' : KToken ('.Account' , 'K ' ),
393
- 'PREVORIGIN_CELL' : KToken ('.Account' , 'K ' ),
394
- 'NEWCALLER_CELL' : KToken ('.Account' , 'K ' ),
395
- 'NEWORIGIN_CELL' : KToken ('.Account' , 'K ' ),
381
+ 'PREVCALLER_CELL' : KApply ('.Account_EVM-TYPES_Account ' ),
382
+ 'PREVORIGIN_CELL' : KApply ('.Account_EVM-TYPES_Account ' ),
383
+ 'NEWCALLER_CELL' : KApply ('.Account_EVM-TYPES_Account ' ),
384
+ 'NEWORIGIN_CELL' : KApply ('.Account_EVM-TYPES_Account ' ),
396
385
'ACTIVE_CELL' : FALSE ,
397
386
'STATIC_CELL' : FALSE ,
398
387
'MEMORYUSED_CELL' : intToken (0 ),
@@ -412,10 +401,10 @@ def _init_term(
412
401
'SINGLECALL_CELL' : FALSE ,
413
402
'EXPECTEDREVERT_CELL' : FALSE ,
414
403
'ISOPCODEEXPECTED_CELL' : FALSE ,
415
- 'EXPECTEDADDRESS_CELL' : KToken ('.Account' , 'K ' ),
404
+ 'EXPECTEDADDRESS_CELL' : KApply ('.Account_EVM-TYPES_Account ' ),
416
405
'EXPECTEDVALUE_CELL' : intToken (0 ),
417
- 'EXPECTEDDATA_CELL' : KToken ('.ByteArray' , 'K ' ),
418
- 'OPCODETYPE_CELL' : KToken ('.OpcodeType' , 'K ' ),
406
+ 'EXPECTEDDATA_CELL' : KApply ('.ByteArray_EVM-TYPES_ByteArray ' ),
407
+ 'OPCODETYPE_CELL' : KApply ('.OpcodeType_FOUNDRY-CHEAT-CODES_OpcodeType ' ),
419
408
}
420
409
421
410
if calldata is not None :
@@ -429,8 +418,7 @@ def _init_term(
429
418
430
419
def _final_cterm (empty_config : KInner , contract_name : str , * , failing : bool , is_test : bool = True ) -> CTerm :
431
420
final_term = _final_term (empty_config , contract_name )
432
- key_dst = KEVM .loc (KToken ('FoundryCheat . Failed' , 'ContractAccess' ))
433
- dst_failed_post = KEVM .lookup (KVariable ('CHEATCODE_STORAGE_FINAL' ), key_dst )
421
+ dst_failed_post = KEVM .lookup (KVariable ('CHEATCODE_STORAGE_FINAL' ), Foundry .loc_FOUNDRY_FAILED ())
434
422
foundry_success = Foundry .success (
435
423
KVariable ('STATUSCODE_FINAL' ),
436
424
dst_failed_post ,
0 commit comments