diff --git a/src/uniswap-summaries.md b/src/uniswap-summaries.md index 6f1e0ad..d066d1f 100644 --- a/src/uniswap-summaries.md +++ b/src/uniswap-summaries.md @@ -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 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) ... + true + THIS + THIS + TYPE + TYPE + ... localPairs |-> ((mapping (address _ => mapping (address _ => address ) )) #as T) ... + CS + + 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) ) + + requires V1 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) ... + true + THIS + THIS + TYPE + TYPE + ... localPairs |-> ((mapping (address _ => mapping (address _ => address ) )) #as T) ... + CS + + 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) ) + + requires V2