Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Summary of getReserves function #45

Merged
merged 4 commits into from
Sep 26, 2024
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions src/uniswap-summaries.md
Original file line number Diff line number Diff line change
Expand Up @@ -2890,6 +2890,30 @@ 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> bind ( _STORE , .List , .List , .TypedVals , ListItem ( uint112 []:TypeName ) , ListItem ( reserves ) ) ~> 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>
<current-function> getReserves </current-function>
<env> ENV=> ENV [ reserves <- var(1, uint112 []) ] </env>
Robertorosmaninho marked this conversation as resolved.
Show resolved Hide resolved
<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 +2923,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
```