You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/audits/EulerSwapHook_Audit_Scope.md
+20-13Lines changed: 20 additions & 13 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,15 +2,15 @@
2
2
3
3
Through a new partnership between Euler Labs and Uniswap Foundation, the teams intend to expose EulerSwap's core logic and mechanisms via a Uniswap v4 Hook interface.
4
4
5
-
This is primarily done by inheriting `EulerSwap.sol:EulerSwap`, i.e. `EulerSwapHook is EulerSwap, BaseHook`, and implementing a "custom curve" via `beforeSwap`. The implementation will allow integrators, interfaces, and aggregators, to trade on EulerSwap as-if it is any other Uniswap v4 Pool
5
+
This is primarily done by inheriting `UniswapHook.sol:UniswapHook`, i.e. `EulerSwap is UniswapHook, ...`, and implementing a "custom curve" via `beforeSwap`. The implementation will allow integrators, interfaces, and aggregators, to trade on EulerSwap as-if it is any other Uniswap v4 Pool
6
6
7
7
```solidity
8
8
// assuming the EulerSwapHook was instantiated via EulerSwapFactory
The scope of audit involves the code-diff introduced by [PR #48](https://github.com/euler-xyz/euler-swap/pull/48/files). **As of Apr 1st, 2025, the diff is subject to change but will be code-complete by the audit start time.**
24
-
25
-
Major Changes will include:
26
-
27
-
* Replacing `binarySearch` quoting algorithm with a closed-form formula
28
-
* Implementing a protocol fee, as a percentage of LP fees, enacted by governance
29
-
30
-
As for the files in scope, only files from `src/` should be considered:
23
+
The scope of audit involves a re-audit of EulerSwap, primarily `src/`:
31
24
32
25
```
33
26
├── src
27
+
│ ├── CtxLib.sol
28
+
│ ├── CurveLib.sol
29
+
│ ├── EulerSwap.sol
34
30
│ ├── EulerSwapFactory.sol
35
-
│ ├── EulerSwapHook.sol
36
-
│ └── utils
37
-
│ └── HookMiner.sol
31
+
│ ├── EulerSwapPeriphery.sol
32
+
│ ├── FundsLib.sol
33
+
│ ├── MetaProxyDeployer.sol
34
+
│ ├── QuoteLib.sol
35
+
│ ├── UniswapHook.sol
38
36
```
39
37
38
+
> The interfaces are out of scope
39
+
40
+
## Notable Changes since the prior audit:
41
+
42
+
* Introduction of Uniswap v4 Hook logic
43
+
* Addition of a protocol fee
44
+
* Refactoring EulerSwap instances to delegate call into an implementation contract
45
+
* Replaced binary-search quoting, with a closed formula `fInverse()`
0 commit comments