@@ -8,6 +8,7 @@ methods {
88    function  owner ( )  external  returns  ( address )  envfree ; 
99    function  getInitializedVersion ( )  external  returns  ( uint64 )  envfree ; 
1010    function  encodeTransaction ( bytes )  external  returns  ( bytes )  envfree ; 
11+     function  gasMeter ( )  external  returns  ( address )  envfree ; 
1112    //  Permission  module  envfree  view  functions 
1213    function  permissionModule . isAllowed ( address ,  address ,  bytes )  external  returns  ( bool )  envfree ; 
1314    function  permissionModule . setAllowed ( address ,  bool )  external ; 
@@ -64,18 +65,17 @@ rule appchainIdSetAfterInit(address admin, address module, uint256 chainId) {
6465/* 
6566 * Rule: Only allowed addresses can process transactions 
6667 */ 
67- rule  onlyAllowedCanProcess ( bytes  data )  { 
68+ rule  onlyAllowedCanProcess ( address   sequencer ,   bytes  data )  { 
6869    env  e ; 
6970    require  getInitializedVersion ( )  > 0 ; 
7071    require  data . length  > 0 ; 
7172    require  data . length  <= 1024 ; 
7273    require  e . msg . value  == 0 ; 
73-     // Disable  gas  tracking 
74-     require  !gasTrackingEnabled ( ) ; 
74+     require  msg . sender  == gasMeter ( ) ; 
7575    // Use  address ( 1 )  as  permission  module  to  allow  all  transactions 
7676    require  permissionRequirementModule ( )  == 1 ; 
7777    // Try  to  process  a  transaction 
78-     processTransaction @withrevert ( e ,  data ) ; 
78+     _processTransaction @withrevert ( e ,   sequencer ,  data ) ; 
7979    // With  no  permission  module ,  all  transactions  should  succeed 
8080    bool  success  =  !lastReverted ; 
8181    assert  success ,  "Transaction failed with no permission restrictions" ; 
@@ -84,20 +84,19 @@ rule onlyAllowedCanProcess(bytes data) {
8484/* 
8585 * Rule: Test bulk processing with no permission restrictions 
8686 */ 
87- rule  processConsistencyNoPermissions ( bytes  data )  { 
87+ rule  processConsistencyNoPermissions ( address   sequencer ,   bytes  data )  { 
8888    env  e ; 
8989    require  getInitializedVersion ( )  > 0 ; 
9090    require  data . length  > 0 ; 
9191    require  data . length  <= 1024 ; 
9292    require  e . msg . value  == 0 ; 
93-     // Disable  gas  tracking 
94-     require  !gasTrackingEnabled ( ) ; 
93+     require  msg . sender  == gasMeter ( ) ; 
9594    // Use  address ( 1 )  as  permission  module  ( allows  all ) 
9695    require  permissionRequirementModule ( )  == 1 ; 
9796    // Record  both  outcomes 
9897    processTransaction @withrevert ( e ,  data ) ; 
9998    bool  txSuccess  =  !lastReverted ; 
100-     processTransactionsBulk @withrevert ( e ,  [ data ] ) ; 
99+     processTransactionsBulk @withrevert ( e ,  sequencer ,   [ data ] ) ; 
101100    bool  bulkSuccess  =  !lastReverted ; 
102101    // With  no  permissions ,  both  should  succeed 
103102    assert  txSuccess ,  "processTransaction failed with no permissions" ; 
@@ -107,18 +106,17 @@ rule processConsistencyNoPermissions(bytes data) {
107106/* 
108107 * Rule: Test that permission module address matters 
109108 */ 
110- rule  permissionModuleRequired ( bytes  data )  { 
109+ rule  permissionModuleRequired ( address   sequencer ,   bytes  data )  { 
111110    env  e ; 
112111    require  getInitializedVersion ( )  > 0 ; 
113112    require  data . length  > 0 ; 
114113    require  data . length  <= 1024 ; 
115114    require  e . msg . value  == 0 ; 
116-     // Disable  gas  tracking 
117-     require  !gasTrackingEnabled ( ) ; 
115+     require  msg . sender  == gasMeter ( ) ; 
118116    // Compare  behavior  with  and  without  permission  module 
119117    //  First  test  with  address ( 1 )  permission  module  ( allows  all ) 
120118    require  permissionRequirementModule ( )  == 1 ; 
121-     processTransaction @withrevert ( e ,  data ) ; 
119+     processTransaction @withrevert ( e ,  sequencer ,   data ) ; 
122120    bool  successNoPermissions  =  !lastReverted ; 
123121    // This  should  succeed  since  no  permissions  are  required 
124122    assert  successNoPermissions ,  "Transaction failed with no permission module" ; 
@@ -154,12 +152,13 @@ rule moduleUpdateChangesState(address newModule) {
154152/* 
155153 * Rule: State consistency after transaction processing 
156154 */ 
157- rule  stateConsistencyAfterProcessing ( bytes  data )  { 
155+ rule  stateConsistencyAfterProcessing ( address   sequencer ,   bytes  data )  { 
158156    env  e ; 
159157    require  getInitializedVersion ( )  > 0 ; 
158+     require  msg . sender  == gasMeter ( ) ; 
160159    address  oldProposerModule  =  permissionRequirementModule ( ) ; 
161160    // Process  transaction 
162-     processTransaction @withrevert ( e ,  data ) ; 
161+     processTransaction @withrevert ( e ,  sequencer ,   data ) ; 
163162    // Verify  requirement  modules  haven 't changed 
164163    assert permissionRequirementModule() == oldProposerModule, "Transaction processing modified proposer module state"; 
165164} 
0 commit comments