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

Audit fixes #85

Merged
merged 12 commits into from
Oct 31, 2024
8 changes: 7 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,8 @@ The [`PreLiquidationAddressLib`](./src/libraries/periphery/PreLiquidationAddress

### Potential preLCF manipulation

A pre-liquidation cannot pre-liquidate a proportion of the position's debt greater than `preLCF`, however it's possible to pre-liquidate a proportion of the position while keeping it pre-liquidatable before performing another pre-liquidation.
A pre-liquidation cannot repay a proportion of the position's debt greater than `preLCF`.
However it's possible to pre-liquidate a proportion of the position while keeping it pre-liquidatable before performing another pre-liquidation.
This manipulation can lead to repaying a proportion of the position's debt higher than `preLCF`.
It has been studied in the part 5.2 of [An Empirical Study of DeFi Liquidations:Incentives, Risks, and Instabilities](https://arxiv.org/pdf/2106.06389), in the case of a constant liquidation close factor.
Implementing a `preLCF` linear in the health factor can help mitigating this manipulation when choosing the right slope.
Expand All @@ -81,6 +82,11 @@ Install [Foundry](https://book.getfoundry.sh/getting-started/installation).

Run `forge test`.

## Solidity version

The main contracts (`PreLiquidation` and `PreLiquidationFactory`) are written in Solidity 0.8.27.
The bytecode of these contracts could contain new opcodes (e.g., `PUSH0`, `MCOPY`, `TSTORE`, `TLOAD`) so one should make sure that the contract bytecode can be handled by the chain used for deployment.

## Audits

All audits are stored in the [`audits`](./audits) folder.
Expand Down