Skip to content

Commit

Permalink
Summary of getReserves function (#45)
Browse files Browse the repository at this point in the history
Introducing `getReserves` Summary
  • Loading branch information
Robertorosmaninho authored Sep 26, 2024
1 parent 0d5b028 commit 2b1217b
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions src/uniswap-summaries.md
Original file line number Diff line number Diff line change
Expand Up @@ -3124,6 +3124,30 @@ module SOLIDITY-UNISWAP-SETUP-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(size(S), 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 @@ -3134,6 +3158,7 @@ module SOLIDITY-UNISWAP-SUMMARIES
imports SOLIDITY-UNISWAP-FIDSWAP-SUMMARY
imports SOLIDITY-UNISWAP-FIDUPDATE-4-SUMMARY
imports SOLIDITY-UNISWAP-FIDUPDATE-3-SUMMARY
imports SOLIDITY-UNISWAP-GETRESERVES-SUMMARY
imports SOLIDITY-UNISWAP-SETUP-SUMMARY
endmodule
Expand Down

0 comments on commit 2b1217b

Please sign in to comment.