Skip to content

Commit

Permalink
Summary for PairFor. (#37)
Browse files Browse the repository at this point in the history
  • Loading branch information
mariaKt authored Sep 20, 2024
1 parent 50ab2f8 commit eaa815e
Showing 1 changed file with 50 additions and 0 deletions.
50 changes: 50 additions & 0 deletions src/uniswap-summaries.md
Original file line number Diff line number Diff line change
Expand Up @@ -2678,9 +2678,59 @@ module SOLIDITY-UNISWAP-SORTTOKENS-SUMMARY
endmodule
```

```k
module SOLIDITY-UNISWAP-PAIRFOR-SUMMARY
imports SOLIDITY-CONFIGURATION
imports SOLIDITY-EXPRESSION
imports SOLIDITY-UNISWAP-TOKENS
rule <k> uniswapV2LibraryPairFor:Id ( v(V1:MInt{160}, address), v(V2:MInt{160}, address), .TypedVals ) => v(read({CS [ localPairs ] orDefault .Map}:>Value, ListItem(V1) ListItem(V2), T), address) ...</k>
<summarize> true </summarize>
<this> THIS </this>
<contract-address> THIS </contract-address>
<this-type> TYPE </this-type>
<contract-id> TYPE </contract-id>
<contract-state>... localPairs |-> ((mapping (address _ => mapping (address _ => address ) )) #as T) ...</contract-state>
<contract-storage> CS </contract-storage>
<store>
S => S ListItem(V1)
ListItem(V2)
ListItem(read({CS [ localPairs ] orDefault .Map}:>Value, ListItem(V1) ListItem(V2), T))
ListItem(V1)
ListItem(V2)
ListItem(default(address[]))
ListItem( ListItem(V1) ListItem(V2) )
ListItem( ListItem(V1) ListItem(V2) )
</store>
requires V1 <uMInt V2 andBool V1 =/=MInt 0p160 [priority(40)]
rule <k> uniswapV2LibraryPairFor:Id ( v(V1:MInt{160}, address), v(V2:MInt{160}, address), .TypedVals ) => v(read({CS [ localPairs ] orDefault .Map}:>Value, ListItem(V2) ListItem(V1), T), address) ...</k>
<summarize> true </summarize>
<this> THIS </this>
<contract-address> THIS </contract-address>
<this-type> TYPE </this-type>
<contract-id> TYPE </contract-id>
<contract-state>... localPairs |-> ((mapping (address _ => mapping (address _ => address ) )) #as T) ...</contract-state>
<contract-storage> CS </contract-storage>
<store>
S => S ListItem(V1)
ListItem(V2)
ListItem(read({CS [ localPairs ] orDefault .Map}:>Value, ListItem(V2) ListItem(V1), T))
ListItem(V1)
ListItem(V2)
ListItem(default(address[]))
ListItem( ListItem(V2) ListItem(V1) )
ListItem( ListItem(V2) ListItem(V1) )
</store>
requires V2 <uMInt V1 andBool V2 =/=MInt 0p160 [priority(40)]
endmodule
```

```k
module SOLIDITY-UNISWAP-SUMMARIES
imports SOLIDITY-UNISWAP-INIT-SUMMARY
imports SOLIDITY-UNISWAP-SORTTOKENS-SUMMARY
imports SOLIDITY-UNISWAP-PAIRFOR-SUMMARY
endmodule
```

0 comments on commit eaa815e

Please sign in to comment.