Skip to content

Commit

Permalink
Introducing getReserves Summary
Browse files Browse the repository at this point in the history
  • Loading branch information
Robertorosmaninho committed Sep 26, 2024
1 parent 57ce82c commit c69fe71
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions src/uniswap-summaries.md
Original file line number Diff line number Diff line change
Expand Up @@ -2890,6 +2890,29 @@ module SOLIDITY-UNISWAP-FIDUPDATE-3-SUMMARY
endmodule
```

```k
module SOLIDITY-UNISWAP-GETRESERVES-SUMMARY
imports SOLIDITY-CONFIGURATION
imports SOLIDITY-EXPRESSION
imports SOLIDITY-UNISWAP-TOKENS
rule <k> reserves = new uint112 [ ] ( 3 , .TypedVals ) ; reserves [ 0 ] = reserve0 ; reserves [ 1 ] = reserve1 ; reserves [ 2 ] = blockTimestampLast ; .Statements ~> return reserves ; ~> .K => return v ( ListItem({Storage[reserve0] orDefault 0p112}:>MInt{112}) ListItem({Storage[reserve1] orDefault 0p112}:>MInt{112}) ListItem(roundMInt({Storage[blockTimestampLast] orDefault 0p32}:>MInt{32}):MInt{112}) , uint112 [ ] ) ; ~> .K</k>
<summarize> true </summarize>
<this> THIS </this>
<contract-address> THIS </contract-address>
<this-type> TYPE </this-type>
<contract-id> TYPE </contract-id>
<env> ENV=> ENV [ reserves <- var(1, uint112 []) ] </env>
<store> S => S ListItem(
ListItem({Storage[reserve0] orDefault 0p112}:>MInt{112})
ListItem({Storage[reserve1] orDefault 0p112}:>MInt{112})
ListItem(roundMInt({Storage[blockTimestampLast] orDefault 0p32}:>MInt{32}):MInt{112})
)
</store>
<contract-storage> Storage </contract-storage> [priority(40)]
endmodule
```

```k
module SOLIDITY-UNISWAP-SUMMARIES
imports SOLIDITY-UNISWAP-INIT-SUMMARY
Expand All @@ -2899,6 +2922,7 @@ module SOLIDITY-UNISWAP-SUMMARIES
imports SOLIDITY-UNISWAP-PAIRFOR-SUMMARY
imports SOLIDITY-UNISWAP-FIDUPDATE-4-SUMMARY
imports SOLIDITY-UNISWAP-FIDUPDATE-3-SUMMARY
imports SOLIDITY-UNISWAP-GETRESERVES-SUMMARY
endmodule
```

0 comments on commit c69fe71

Please sign in to comment.