qpzm / kyber-exploit-example

reproduce kyber-elastic exploit

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Kyber elastic exploit POC

Test

I added basic tests about 3 swaps in https://etherscan.io/tx/0x485e08dc2b6a4b3aeadcb89c3d18a37666dc7d9424961a2091d6b3696792f0f3.

# To see the resulting sqrtP and tick info in each swap
forge test --mc SwapMathTest

# To test the exploit & its solution
forge test --mt testBruteForceExploit

You can see more detailed explanation about tests in https://github.com/paco0x/kyber-exploit-example.

Result

deltaL sqrtP tick
floor 75619198150999 20693058119558072255665971001964 111310
ceil 75619198151000 20693058119558072255388935748427 111309

About

reproduce kyber-elastic exploit


Languages

Language:Solidity 56.3%Language:JavaScript 38.7%Language:Ruby 4.4%Language:Shell 0.4%Language:Python 0.1%Language:Handlebars 0.1%Language:Makefile 0.0%Language:Jupyter Notebook 0.0%Language:Nix 0.0%