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

Uniswap sqrt eth test summary #18

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all 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
2 changes: 2 additions & 0 deletions kevm-pyk/src/kevm_pyk/kproj/evm-semantics/driver.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,14 @@ requires "evm.md"
requires "optimizations.md"
requires "asm.md"
requires "state-utils.md"
requires "lemmas/uniswap-lemmas.k"

module ETHEREUM-SIMULATION
imports EVM
imports EVM-OPTIMIZATIONS
imports EVM-ASSEMBLY
imports STATE-UTILS
imports UNISWAP-LEMMAS
```

An Ethereum simulation is a list of Ethereum commands.
Expand Down
46 changes: 46 additions & 0 deletions kevm-pyk/src/kevm_pyk/kproj/evm-semantics/lemmas/uniswap-lemmas.k
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
requires "domains.md"
requires "evm.md"

module UNISWAP-LEMMAS
imports EVM
imports FLOAT

rule [sqrt-skip]:
<kevm>
<k>
#execute ~> _REST
</k>
<ethereum>
<evm>
<callState>
<id>
352381412411141363593761104900125842968318969977
</id>
<caller>
575959589790415302576757212507209407703957814182
</caller>
<callData>
b"jbxB\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xd2\t2\x0e\xb0f\x9c=M\xd5\x1f\xd8O\xdd\xa3\xc7\xef\xb2J\xef"
</callData>
(<wordStack>
ListItem ( PAR:Int )
ListItem ( 1448 )
WSREST
</wordStack>
=>
<wordStack>
ListItem ( Float2Int(floorFloat(sqrtFloat(Int2Float(PAR, 192, 64)))) )
WSREST
</wordStack>)
(<pc> 4400 </pc> => <pc> 1448 </pc>)
(<gas> 846598 </gas> => <gas> 836628 </gas>)
...
</callState>
...
</evm>
...
</ethereum>
...
</kevm> [priority(40)]

endmodule