From e3213ae6db17d4f6f3ab648fe996509b05fc9dc5 Mon Sep 17 00:00:00 2001 From: MathisGD Date: Fri, 10 Jan 2025 16:40:53 +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 e56430d..7733147 100644 --- a/foundry.toml +++ b/foundry.toml @@ -5,6 +5,7 @@ test = "test" libs = ["lib"] via_ir = true optimizer_runs = 999999 # Etherscan does not support verifying contracts with more optimizer runs. +bytecode_hash = "none" [profile.default.fuzz] runs = 4096 From 42500576b3d52d57af99e56a27669141c1c4be4d Mon Sep 17 00:00:00 2001 From: MathisGD <74971347+MathisGD@users.noreply.github.com> Date: Fri, 10 Jan 2025 18:05:32 +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 7733147..7a3c89b 100644 --- a/foundry.toml +++ b/foundry.toml @@ -4,7 +4,8 @@ out = "out" test = "test" libs = ["lib"] via_ir = true -optimizer_runs = 999999 # Etherscan does not support verifying contracts with more optimizer runs. +optimizer = true +optimizer_runs = 999999 bytecode_hash = "none" [profile.default.fuzz] From 55173f18ce5a02e03bb0385a796f1655891ffb35 Mon Sep 17 00:00:00 2001 From: Adrien Husson Date: Mon, 13 Jan 2025 16:16:10 +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 7a3c89b..77bed82 100644 --- a/foundry.toml +++ b/foundry.toml @@ -7,6 +7,7 @@ via_ir = true optimizer = true optimizer_runs = 999999 bytecode_hash = "none" +evm_version = "paris" [profile.default.fuzz] runs = 4096 From 2c92bff21cdb94af2c49ad5a3970e12469fcbc45 Mon Sep 17 00:00:00 2001 From: Adrien Husson Date: Mon, 13 Jan 2025 18:12:48 +0100 Subject: [PATCH 4/5] docs: add warning on lack of via_ir on mainnet --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 421f79b..e037859 100644 --- a/README.md +++ b/README.md @@ -3,6 +3,7 @@ Some interest rate models for Morpho Blue: - [AdaptiveCurveIRM](src/AdaptiveCurveIrm.sol) + - _Important_: The `AdaptiveCurveIRM` was deployed [on Ethereum](https://etherscan.io/address/0x870aC11D48B15DB9a138Cf899d20F13F79Ba00BC) without the `via_ir` solc compilation option. To check the bytecode on Ethereum, disable `via_ir` in `foundry.toml`. Other deployments use `via_ir`. ## Resources From 34bd63e2e86771a02cb39cd7436328a7090d5556 Mon Sep 17 00:00:00 2001 From: MathisGD <74971347+MathisGD@users.noreply.github.com> Date: Mon, 13 Jan 2025 18:26:13 +0100 Subject: [PATCH 5/5] Update README.md Co-authored-by: Quentin Garchery Signed-off-by: MathisGD <74971347+MathisGD@users.noreply.github.com> --- README.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index e037859..aa93506 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,9 @@ Some interest rate models for Morpho Blue: - [AdaptiveCurveIRM](src/AdaptiveCurveIrm.sol) - - _Important_: The `AdaptiveCurveIRM` was deployed [on Ethereum](https://etherscan.io/address/0x870aC11D48B15DB9a138Cf899d20F13F79Ba00BC) without the `via_ir` solc compilation option. To check the bytecode on Ethereum, disable `via_ir` in `foundry.toml`. Other deployments use `via_ir`. + - _Important_: The `AdaptiveCurveIRM` was deployed [on Ethereum](https://etherscan.io/address/0x870aC11D48B15DB9a138Cf899d20F13F79Ba00BC) without the `via_ir` solc compilation option. + To check the bytecode on Ethereum, disable `via_ir` in `foundry.toml`. + Other deployments use `via_ir`. ## Resources