Skip to content

Commit

Permalink
Introducing approve summary from bind to return on dAIMock (#56)
Browse files Browse the repository at this point in the history
* Introducing `approve` summary from `bind` to `return` on `dAIMock`

* Deleting temporary symbol

* Fixing approve rule

* Matching contract-state
  • Loading branch information
Robertorosmaninho authored Oct 8, 2024
1 parent 48f33bb commit eb2acdc
Showing 1 changed file with 35 additions and 1 deletion.
36 changes: 35 additions & 1 deletion src/uniswap-summaries.md
Original file line number Diff line number Diff line change
Expand Up @@ -3493,7 +3493,7 @@ module SOLIDITY-UNISWAP-MINT-SUMMARY
ListItem(V2) // wad
</store>
<env>
ENV => ENV [ usr <- var(size(S) , address) ]
ENV => ENV [ usr <- var(size(S) , address) ]
[ wad <- var(size(S) +Int 1, uint256) ]
</env>
<contract-storage> Storage => Storage [ totalSupply <- {Storage[totalSupply] orDefault 0p256}:>MInt{256} +MInt V2:MInt{256} ]
Expand All @@ -3502,6 +3502,39 @@ module SOLIDITY-UNISWAP-MINT-SUMMARY
endmodule
```

```k
module SOLIDITY-UNISWAP-APPROVE-SUMMARY
imports SOLIDITY-CONFIGURATION
imports SOLIDITY-EXPRESSION
imports SOLIDITY-UNISWAP-TOKENS
rule <k> bind ( _STORE,
ListItem ( usr ) ListItem ( wad ),
ListItem ( address ) ListItem ( uint256 ) ,
v ( V1:MInt{160} , address ),
v ( V2:MInt{256} , uint256 ),
.TypedVals , ListItem ( bool ) , ListItem ( noId ) ) ~> allowance [ msg . sender ] [ usr ] = wad ; emit approvalEvent ( msg . sender , usr , wad , .TypedVals ) ; return true ; .Statements ~> return void ; ~> .K => return v ( true , bool ) ; ~> .Statements ~> return void ; ... </k>
<summarize> true </summarize>
<this> THIS </this>
<contract-address> THIS </contract-address>
<this-type> TYPE </this-type>
<contract-id> TYPE </contract-id>
<current-function> approve </current-function>
<contract-state> (allowance |-> mapping ( address daiownr => mapping ( address daispdr => uint256 ) )) </contract-state>
<store> S => S ListItem(V1) // usr
ListItem(V2) // wad
</store>
<env>
ENV => ENV [ usr <- var(size(S) , address) ]
[ wad <- var(size(S) +Int 1, uint256) ]
</env>
<msg-sender> SENDER </msg-sender>
<contract-storage>
Storage => Storage [ allowance <- write( { Storage [ allowance ] orDefault .Map}:>Value, ListItem(SENDER), write(read({Storage [ allowance ] orDefault .Map}:>Value, ListItem(SENDER), (mapping ( address daiownr => mapping ( address daispdr => uint256)))), ListItem(V1), V2:MInt{256}, (mapping ( address spender => uint256 ))),(mapping ( address daiownr => mapping ( address daispdr => uint256))))]
</contract-storage> [priority(40)]
endmodule
```

```k
module SOLIDITY-UNISWAP-SUMMARIES
imports SOLIDITY-UNISWAP-INIT-SUMMARY
Expand All @@ -3519,6 +3552,7 @@ module SOLIDITY-UNISWAP-SUMMARIES
imports SOLIDITY-UNISWAP-SETUP-SUMMARY
imports SOLIDITY-MATHSQRT-SUMMARY
imports SOLIDITY-UNISWAP-MINT-SUMMARY
imports SOLIDITY-UNISWAP-APPROVE-SUMMARY
endmodule
```

0 comments on commit eb2acdc

Please sign in to comment.