Skip to content

Commit

Permalink
Introducing approve summary from bind to return on dAIMock
Browse files Browse the repository at this point in the history
  • Loading branch information
Robertorosmaninho committed Oct 4, 2024
1 parent e8ade4c commit 08f3a10
Showing 1 changed file with 36 additions and 0 deletions.
36 changes: 36 additions & 0 deletions src/uniswap-summaries.md
Original file line number Diff line number Diff line change
Expand Up @@ -3439,6 +3439,41 @@ module SOLIDITY-UNISWAP-MINT-SUMMARY
endmodule
```

```k
module SOLIDITY-UNISWAP-APPROVE-SUMMARY
imports SOLIDITY-CONFIGURATION
imports SOLIDITY-EXPRESSION
imports SOLIDITY-UNISWAP-TOKENS
syntax KItem ::= "stopFunction"
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 ) ; ... </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>
<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( {Storage [ allowance ] orDefault .Map}:>Value, ListItem(V1), ( {read( {Storage [ allowance ] orDefault .Map}:>Value, ListItem(V1), (mapping ( address daispdr => uint256 )) )}:>MInt{256} +MInt V2:MInt{256} ), (mapping ( address daispdr => uint256) ) ) }:>Value, (mapping ( address daiownr => mapping ( address daispdr => uint256))) ) ]
</contract-storage> [priority(40)]
endmodule
```

```k
module SOLIDITY-UNISWAP-SUMMARIES
imports SOLIDITY-UNISWAP-INIT-SUMMARY
Expand All @@ -3455,6 +3490,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 08f3a10

Please sign in to comment.