Skip to content
This repository has been archived by the owner on May 26, 2023. It is now read-only.

Commit

Permalink
dedup
Browse files Browse the repository at this point in the history
  • Loading branch information
Evert0x committed Sep 16, 2022
1 parent 32acaa6 commit 52e5d3c
Show file tree
Hide file tree
Showing 34 changed files with 6 additions and 64 deletions.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
38 changes: 0 additions & 38 deletions 046-H/1-report.md

This file was deleted.

12 changes: 6 additions & 6 deletions 047-M/1-report.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,13 @@ the getPrice logic is implemented as
}
```

note the formula used is
note the formula used is

```
2 * sqrt(r0 * r1 * p0 * p1) / totalSupply
```

but
but

```
IUniswapV2Pair(pair).totalSupply());
Expand All @@ -59,7 +59,7 @@ r1 is token1 -> B,

3. The user borrows a large excessive large number of tokens and never repays back and leaves the bad debt.

4. the user withdraws liquidity, repays the flash loan, and walks away with profit at the cost of the user.
4. the user withdraws liquidity, repays the flash loan, and walks away with profit at the cost of the user.

Please check the simulation code before in Python implementation, the price is manipulated from 20 to 500

Expand All @@ -77,7 +77,7 @@ class Simulation:
self.total_lp_supply = 10
def get_price(self):
# 2 * sqrt(r0 * r1 * p0 * p1) / totalSupply
return 2 * math.sqrt(
Expand All @@ -94,7 +94,7 @@ class Simulation:
# liquidity = Math.min(amount0.mul(_totalSupply) / _reserve0, amount0.mul(_totalSupply) / _reserve0);
def inflate(self, amount0, amount1):
self.reserve0 += amount0 # transfer amount0 into pair pool
self.reserve1 += amount1 # transfer amount1 into pair pool.
Expand All @@ -120,7 +120,7 @@ if __name__ == "__main__":
print('price after', price)
```

the running result is
the running result is

```
price before 20.0
Expand Down
File renamed without changes.
File renamed without changes.
20 changes: 0 additions & 20 deletions 109-M/1-report.md

This file was deleted.

File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit 52e5d3c

Please sign in to comment.