From 062a98dbe17ff53dcd6865d48e22b4ed06c8570a Mon Sep 17 00:00:00 2001 From: MathisGD Date: Fri, 10 Jan 2025 16:50:40 +0100 Subject: [PATCH 1/5] chore: remove bytecode hash from compilation --- foundry.toml | 1 + 1 file changed, 1 insertion(+) diff --git a/foundry.toml b/foundry.toml index 17438dd..307ec2a 100644 --- a/foundry.toml +++ b/foundry.toml @@ -4,6 +4,7 @@ out = "out" libs = ["lib"] via_ir = true optimizer_runs = 999999 # Etherscan does not support verifying contracts with more optimization runs. +bytecode_hash = "none" [profile.default.fmt] wrap_comments = true From a6cbd475bb728b961a1c55092b87296a46a3276c Mon Sep 17 00:00:00 2001 From: MathisGD <74971347+MathisGD@users.noreply.github.com> Date: Fri, 10 Jan 2025 17:56:18 +0100 Subject: [PATCH 2/5] chore: explicitly turn on the optimizer Signed-off-by: MathisGD <74971347+MathisGD@users.noreply.github.com> --- foundry.toml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/foundry.toml b/foundry.toml index 307ec2a..dd0a7a3 100644 --- a/foundry.toml +++ b/foundry.toml @@ -3,7 +3,8 @@ src = "src" out = "out" libs = ["lib"] via_ir = true -optimizer_runs = 999999 # Etherscan does not support verifying contracts with more optimization runs. +optimizer = true +optimizer_runs = 999999 bytecode_hash = "none" [profile.default.fmt] From ed272e952499fe35b997c604f67deb66b90c98f5 Mon Sep 17 00:00:00 2001 From: Adrien Husson Date: Mon, 13 Jan 2025 16:34:19 +0100 Subject: [PATCH 3/5] build: add evm_version --- foundry.toml | 1 + 1 file changed, 1 insertion(+) diff --git a/foundry.toml b/foundry.toml index dd0a7a3..15c7036 100644 --- a/foundry.toml +++ b/foundry.toml @@ -6,6 +6,7 @@ via_ir = true optimizer = true optimizer_runs = 999999 bytecode_hash = "none" +evm_version = "cancun" [profile.default.fmt] wrap_comments = true From 75ccee868ae5c5bb2d2b5305b78175be63d2e3f6 Mon Sep 17 00:00:00 2001 From: MathisGD Date: Mon, 13 Jan 2025 19:05:25 +0100 Subject: [PATCH 4/5] docs: document metadata hash --- README.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 11f2392..83ab7e9 100644 --- a/README.md +++ b/README.md @@ -72,7 +72,10 @@ This manipulation can lead to repaying a proportion of the position's debt highe 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. -## Getting started +## Developpers + +> [!NOTE] +> `PreLiquidationFactory` has been deployed on Ethereum and Base with the [metadata hash](https://docs.soliditylang.org/en/latest/metadata.html) included, which appear at two places in the bytecode as it is a factory. ### Package installation From bae4f66d004564b51a7b608ffe3c848a94cfdad5 Mon Sep 17 00:00:00 2001 From: MathisGD <74971347+MathisGD@users.noreply.github.com> Date: Mon, 13 Jan 2025 19:11:12 +0100 Subject: [PATCH 5/5] Update README.md Signed-off-by: MathisGD <74971347+MathisGD@users.noreply.github.com> --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 83ab7e9..e8daa42 100644 --- a/README.md +++ b/README.md @@ -72,7 +72,7 @@ This manipulation can lead to repaying a proportion of the position's debt highe 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. -## Developpers +## Developers > [!NOTE] > `PreLiquidationFactory` has been deployed on Ethereum and Base with the [metadata hash](https://docs.soliditylang.org/en/latest/metadata.html) included, which appear at two places in the bytecode as it is a factory.