From 00ce7c95969da5f5f26810e7511114c806165ebd Mon Sep 17 00:00:00 2001 From: "vlad.burtsevych" Date: Sun, 9 Nov 2025 20:22:02 -0300 Subject: [PATCH 01/11] add: upgradeable beacon proxy dependency --- .gitmodules | 3 +++ lib/transparent_upgradeable_beacon_proxy | 1 + 2 files changed, 4 insertions(+) create mode 160000 lib/transparent_upgradeable_beacon_proxy diff --git a/.gitmodules b/.gitmodules index 23acfb1d..0c02805a 100644 --- a/.gitmodules +++ b/.gitmodules @@ -7,3 +7,6 @@ [submodule "lib/openzeppelin-contracts-upgradeable"] path = lib/openzeppelin-contracts-upgradeable url = https://github.com/OpenZeppelin/openzeppelin-contracts-upgradeable +[submodule "lib/transparent_upgradeable_beacon_proxy"] + path = lib/transparent_upgradeable_beacon_proxy + url = https://github.com/ltvprotocol/transparent_upgradeable_beacon_proxy diff --git a/lib/transparent_upgradeable_beacon_proxy b/lib/transparent_upgradeable_beacon_proxy new file mode 160000 index 00000000..22aca3f1 --- /dev/null +++ b/lib/transparent_upgradeable_beacon_proxy @@ -0,0 +1 @@ +Subproject commit 22aca3f1d1cd76999f3c7775ca606cd0a80ac9ab From 4932863a68b9a09a308f251367c841df7e62df18 Mon Sep 17 00:00:00 2001 From: "vlad.burtsevych" Date: Sun, 9 Nov 2025 20:32:43 -0300 Subject: [PATCH 02/11] add: deploy upgradeable beacon proxy support --- deploy/mainnet/aave/SUSDE_USDT_X10_AAVEV3.json | 1 + deploy/mainnet/morpho/weETH_WETH_x15_Morpho.json | 1 + .../mainnet/morpho/wstETH_WETH_x24_Morpho.json | 1 + deploy/sepolia/aave/kamikaze.json | 1 + deploy/sepolia/aave/permissioned.json | 1 + deploy/sepolia/aave/permissionless.json | 1 + deploy/sepolia/morpho/args.json | 1 + script/ltv_elements/DeployLTVBeaconProxy.s.sol | 16 ++++++++++++---- 8 files changed, 19 insertions(+), 4 deletions(-) diff --git a/deploy/mainnet/aave/SUSDE_USDT_X10_AAVEV3.json b/deploy/mainnet/aave/SUSDE_USDT_X10_AAVEV3.json index bc7d06dd..3356a389 100644 --- a/deploy/mainnet/aave/SUSDE_USDT_X10_AAVEV3.json +++ b/deploy/mainnet/aave/SUSDE_USDT_X10_AAVEV3.json @@ -1,6 +1,7 @@ { "LENDING_CONNECTOR_NAME": "AaveV3", "BEACON_OWNER": "0xcf0475d9B0a29975bc5132A3066010eC898d8CaB", + "BEACON_PROXY_OWNER": "0xcf0475d9B0a29975bc5132A3066010eC898d8CaB", "WHITELIST_OWNER": "0xcf0475d9B0a29975bc5132A3066010eC898d8CaB", "NAME": "SUSDE/USDT x10 on Aave v3", "SYMBOL": "SUSDE_USDT_X10_AAVEV3", diff --git a/deploy/mainnet/morpho/weETH_WETH_x15_Morpho.json b/deploy/mainnet/morpho/weETH_WETH_x15_Morpho.json index 3a3ac6a8..b4d8321e 100644 --- a/deploy/mainnet/morpho/weETH_WETH_x15_Morpho.json +++ b/deploy/mainnet/morpho/weETH_WETH_x15_Morpho.json @@ -1,6 +1,7 @@ { "LENDING_CONNECTOR_NAME": "Morpho", "BEACON_OWNER": "0xcf0475d9B0a29975bc5132A3066010eC898d8CaB", + "BEACON_PROXY_OWNER": "0xcf0475d9B0a29975bc5132A3066010eC898d8CaB", "WHITELIST_OWNER": "0xcf0475d9B0a29975bc5132A3066010eC898d8CaB", "NAME": "weETH/WETH x15 on Morpho", "SYMBOL": "weETH_WETH_x15_Morpho", diff --git a/deploy/mainnet/morpho/wstETH_WETH_x24_Morpho.json b/deploy/mainnet/morpho/wstETH_WETH_x24_Morpho.json index aa97088e..2193dc9b 100644 --- a/deploy/mainnet/morpho/wstETH_WETH_x24_Morpho.json +++ b/deploy/mainnet/morpho/wstETH_WETH_x24_Morpho.json @@ -1,6 +1,7 @@ { "LENDING_CONNECTOR_NAME": "Morpho", "BEACON_OWNER": "0xcf0475d9B0a29975bc5132A3066010eC898d8CaB", + "BEACON_PROXY_OWNER": "0xcf0475d9B0a29975bc5132A3066010eC898d8CaB", "WHITELIST_OWNER": "0xcf0475d9B0a29975bc5132A3066010eC898d8CaB", "NAME": "wstETH/WETH x24 on Morpho", "SYMBOL": "wstETH_WETH_x24_Morpho", diff --git a/deploy/sepolia/aave/kamikaze.json b/deploy/sepolia/aave/kamikaze.json index c6646813..75889096 100644 --- a/deploy/sepolia/aave/kamikaze.json +++ b/deploy/sepolia/aave/kamikaze.json @@ -1,6 +1,7 @@ { "LENDING_CONNECTOR_NAME": "AaveV3", "BEACON_OWNER": "0xde1d9ff8d1396a98688d7e07eda88a19cf2bb6cf", + "BEACON_PROXY_OWNER": "0xde1d9ff8d1396a98688d7e07eda88a19cf2bb6cf", "WHITELIST_OWNER": "0xdbd5bcfd943e7666fcd3585382ca808bef61c8ae", "NAME": "weth/wbtc x4 on Aave v3 kamikaze", "SYMBOL": "WETH_WBTC_x4_AAVEV3_KAMIKAZE", diff --git a/deploy/sepolia/aave/permissioned.json b/deploy/sepolia/aave/permissioned.json index 0d21ddcf..41184b13 100644 --- a/deploy/sepolia/aave/permissioned.json +++ b/deploy/sepolia/aave/permissioned.json @@ -1,6 +1,7 @@ { "LENDING_CONNECTOR_NAME": "AaveV3", "BEACON_OWNER": "0xde1d9ff8d1396a98688d7e07eda88a19cf2bb6cf", + "BEACON_PROXY_OWNER": "0xde1d9ff8d1396a98688d7e07eda88a19cf2bb6cf", "WHITELIST_OWNER": "0xdbd5bcfd943e7666fcd3585382ca808bef61c8ae", "NAME": "weth/wbtc x4 on Aave v3 permissioned", "SYMBOL": "WETH_WBTC_x4_AAVEV3_PERMISSIONED", diff --git a/deploy/sepolia/aave/permissionless.json b/deploy/sepolia/aave/permissionless.json index f95edb44..a389433b 100644 --- a/deploy/sepolia/aave/permissionless.json +++ b/deploy/sepolia/aave/permissionless.json @@ -1,6 +1,7 @@ { "LENDING_CONNECTOR_NAME": "AaveV3", "BEACON_OWNER": "0xde1d9ff8d1396a98688d7e07eda88a19cf2bb6cf", + "BEACON_PROXY_OWNER": "0xde1d9ff8d1396a98688d7e07eda88a19cf2bb6cf", "WHITELIST_OWNER": "0xdbd5bcfd943e7666fcd3585382ca808bef61c8ae", "NAME": "weth/wbtc x4 on Aave v3", "SYMBOL": "WETH_WBTC_x4_AAVEV3", diff --git a/deploy/sepolia/morpho/args.json b/deploy/sepolia/morpho/args.json index 6a809d79..04e5051e 100644 --- a/deploy/sepolia/morpho/args.json +++ b/deploy/sepolia/morpho/args.json @@ -1,6 +1,7 @@ { "LENDING_CONNECTOR_NAME": "Morpho", "BEACON_OWNER": "0xde1d9ff8d1396a98688d7e07eda88a19cf2bb6cf", + "BEACON_PROXY_OWNER": "0xde1d9ff8d1396a98688d7e07eda88a19cf2bb6cf", "WHITELIST_OWNER": "0xdbd5bcfd943e7666fcd3585382ca808bef61c8ae", "NAME": "WETH/USDC x3 on Morpho", "SYMBOL": "WETH_USDC_x3_Morpho", diff --git a/script/ltv_elements/DeployLTVBeaconProxy.s.sol b/script/ltv_elements/DeployLTVBeaconProxy.s.sol index 7f874edb..c2b13c0d 100644 --- a/script/ltv_elements/DeployLTVBeaconProxy.s.sol +++ b/script/ltv_elements/DeployLTVBeaconProxy.s.sol @@ -7,22 +7,30 @@ import {ILTV} from "src/interfaces/ILTV.sol"; import {ILendingConnector} from "src/interfaces/connectors/ILendingConnector.sol"; import {IOracleConnector} from "src/interfaces/connectors/IOracleConnector.sol"; import {ISlippageConnector} from "src/interfaces/connectors/ISlippageConnector.sol"; -import {BeaconProxy} from "openzeppelin-contracts/contracts/proxy/beacon/BeaconProxy.sol"; import {GetConnectorData} from "../utils/GetConnectorData.s.sol"; import {console} from "forge-std/console.sol"; +import {TransparentUpgradeableBeaconProxy} from "transparent_upgradeable_beacon_proxy/TransparentUpgradeableBeaconProxy.sol"; contract DeployLTVBeaconProxy is BaseScript, GetConnectorData { function deploy() internal override { address beacon = vm.envAddress("BEACON"); + address beaconProxyOwner = vm.envAddress("BEACON_PROXY_OWNER"); - BeaconProxy beaconProxy = new BeaconProxy{salt: bytes32(0)}(beacon, getInitializeFunctionCall()); + TransparentUpgradeableBeaconProxy beaconProxy = new TransparentUpgradeableBeaconProxy{salt: bytes32(0)}( + beacon, beaconProxyOwner, getInitializeFunctionCall() + ); console.log("Beacon proxy deployed at: ", address(beaconProxy)); } function hashedCreationCode() internal view override returns (bytes32) { address beacon = vm.envAddress("BEACON"); - return - keccak256(abi.encodePacked(type(BeaconProxy).creationCode, abi.encode(beacon, getInitializeFunctionCall()))); + address beaconProxyOwner = vm.envAddress("BEACON_PROXY_OWNER"); + return keccak256( + abi.encodePacked( + type(TransparentUpgradeableBeaconProxy).creationCode, + abi.encode(beacon, beaconProxyOwner, getInitializeFunctionCall()) + ) + ); } function getInitializeFunctionCall() internal view returns (bytes memory) { From a9f004d4131e22e264dedbbb66e7f43171517ef8 Mon Sep 17 00:00:00 2001 From: "vlad.burtsevych" Date: Sun, 9 Nov 2025 20:32:43 -0300 Subject: [PATCH 03/11] fix: args fix --- deploy/mainnet/aave/SUSDE_USDT_X10_AAVEV3.json | 1 + deploy/mainnet/aave/WSTETH_WETH_x12_AAVEV3.json | 1 + deploy/mainnet/morpho/weETH_WETH_x15_Morpho.json | 3 ++- deploy/mainnet/morpho/wstETH_WETH_x24_Morpho.json | 3 ++- 4 files changed, 6 insertions(+), 2 deletions(-) diff --git a/deploy/mainnet/aave/SUSDE_USDT_X10_AAVEV3.json b/deploy/mainnet/aave/SUSDE_USDT_X10_AAVEV3.json index 3356a389..c8efca10 100644 --- a/deploy/mainnet/aave/SUSDE_USDT_X10_AAVEV3.json +++ b/deploy/mainnet/aave/SUSDE_USDT_X10_AAVEV3.json @@ -32,5 +32,6 @@ "SOFT_LIQUIDATION_LTV_DIVIDEND": 92, "SOFT_LIQUIDATION_LTV_DIVIDER": 100, "EMODE": 2, + "ACTIVATE_WHITELIST": true, "WHITELIST_SIGNER": "0x0000000000000000000000000000000000000000" } \ No newline at end of file diff --git a/deploy/mainnet/aave/WSTETH_WETH_x12_AAVEV3.json b/deploy/mainnet/aave/WSTETH_WETH_x12_AAVEV3.json index b87b59fa..73115ee9 100644 --- a/deploy/mainnet/aave/WSTETH_WETH_x12_AAVEV3.json +++ b/deploy/mainnet/aave/WSTETH_WETH_x12_AAVEV3.json @@ -33,5 +33,6 @@ "SOFT_LIQUIDATION_LTV_DIVIDER": 100, "EMODE": 1, "WHITELIST_SIGNER": "0x0000000000000000000000000000000000000000", + "ACTIVATE_WHITELIST": true, "DEPLOY_BEACON": true } \ No newline at end of file diff --git a/deploy/mainnet/morpho/weETH_WETH_x15_Morpho.json b/deploy/mainnet/morpho/weETH_WETH_x15_Morpho.json index b4d8321e..c8ee0a9c 100644 --- a/deploy/mainnet/morpho/weETH_WETH_x15_Morpho.json +++ b/deploy/mainnet/morpho/weETH_WETH_x15_Morpho.json @@ -34,5 +34,6 @@ "LLTV": 945000000000000000, "IRM": "0x870aC11D48B15DB9a138Cf899d20F13F79Ba00BC", "ORACLE": "0xbDd2F2D473E8D63d1BFb0185B5bDB8046ca48a72", - "WHITELIST_SIGNER": "0x0000000000000000000000000000000000000000" + "WHITELIST_SIGNER": "0x0000000000000000000000000000000000000000", + "ACTIVATE_WHITELIST": true } \ No newline at end of file diff --git a/deploy/mainnet/morpho/wstETH_WETH_x24_Morpho.json b/deploy/mainnet/morpho/wstETH_WETH_x24_Morpho.json index 2193dc9b..9eaf6ece 100644 --- a/deploy/mainnet/morpho/wstETH_WETH_x24_Morpho.json +++ b/deploy/mainnet/morpho/wstETH_WETH_x24_Morpho.json @@ -34,5 +34,6 @@ "LLTV": 965000000000000000, "IRM": "0x870aC11D48B15DB9a138Cf899d20F13F79Ba00BC", "ORACLE": "0xbD60A6770b27E084E8617335ddE769241B0e71D8", - "WHITELIST_SIGNER": "0x0000000000000000000000000000000000000000" + "WHITELIST_SIGNER": "0x0000000000000000000000000000000000000000", + "ACTIVATE_WHITELIST": true } \ No newline at end of file From 89da8e7264f5256d8c72ab8a0880c3f85d01d458 Mon Sep 17 00:00:00 2001 From: "vlad.burtsevych" Date: Sun, 9 Nov 2025 21:20:22 -0300 Subject: [PATCH 04/11] fix: fmt --- script/ltv_elements/DeployLTVBeaconProxy.s.sol | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/script/ltv_elements/DeployLTVBeaconProxy.s.sol b/script/ltv_elements/DeployLTVBeaconProxy.s.sol index c2b13c0d..fcd3ca17 100644 --- a/script/ltv_elements/DeployLTVBeaconProxy.s.sol +++ b/script/ltv_elements/DeployLTVBeaconProxy.s.sol @@ -9,7 +9,8 @@ import {IOracleConnector} from "src/interfaces/connectors/IOracleConnector.sol"; import {ISlippageConnector} from "src/interfaces/connectors/ISlippageConnector.sol"; import {GetConnectorData} from "../utils/GetConnectorData.s.sol"; import {console} from "forge-std/console.sol"; -import {TransparentUpgradeableBeaconProxy} from "transparent_upgradeable_beacon_proxy/TransparentUpgradeableBeaconProxy.sol"; +import {TransparentUpgradeableBeaconProxy} from + "transparent_upgradeable_beacon_proxy/TransparentUpgradeableBeaconProxy.sol"; contract DeployLTVBeaconProxy is BaseScript, GetConnectorData { function deploy() internal override { From 393e0e443dd1da4bff2e9986d96aed0655001acc Mon Sep 17 00:00:00 2001 From: "vlad.burtsevych" Date: Sun, 9 Nov 2025 22:06:51 -0300 Subject: [PATCH 05/11] fix: foundry version --- .github/workflows/ci.yml | 6 +++--- test/ERC20CompatibilityTest.t.sol | 2 ++ test/ERC4626CompatibilityTest.t.sol | 2 ++ test/invariant/findings/DecimalsPrecision.t.sol | 10 +++++----- 4 files changed, 12 insertions(+), 8 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5adeaa42..5381b2a1 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -16,7 +16,7 @@ jobs: - name: Install Foundry uses: foundry-rs/foundry-toolchain@v1 with: - version: nightly-567ac47f2b4bf6e295c9ab876a781c563da7b3f1 + version: nightly-cca5d6f7dc60a9a5318af523c187c2a2416377d2 - name: Print forge version run: forge --version @@ -38,7 +38,7 @@ jobs: - name: Install Foundry uses: foundry-rs/foundry-toolchain@v1 with: - version: nightly-567ac47f2b4bf6e295c9ab876a781c563da7b3f1 + version: nightly-cca5d6f7dc60a9a5318af523c187c2a2416377d2 - name: Print forge version run: forge --version @@ -54,7 +54,7 @@ jobs: - name: Install Foundry uses: foundry-rs/foundry-toolchain@v1 with: - version: nightly-567ac47f2b4bf6e295c9ab876a781c563da7b3f1 + version: nightly-cca5d6f7dc60a9a5318af523c187c2a2416377d2 - name: Print forge version run: forge --version diff --git a/test/ERC20CompatibilityTest.t.sol b/test/ERC20CompatibilityTest.t.sol index 77dc2bb8..0de702f5 100644 --- a/test/ERC20CompatibilityTest.t.sol +++ b/test/ERC20CompatibilityTest.t.sol @@ -6,6 +6,7 @@ import {DefaultTestData} from "test/utils/BaseTest.t.sol"; import {PrepareEachFunctionSuccessfulExecution} from "test/administration/PrepareEachFunctionSuccessfulExecution.sol"; import {WhitelistRegistry} from "src/elements/WhitelistRegistry.sol"; +// forge-lint: disable-start contract ERC20CompatibilityTest is PrepareEachFunctionSuccessfulExecution { struct CallWithCaller { bytes callData; @@ -118,3 +119,4 @@ contract ERC20CompatibilityTest is PrepareEachFunctionSuccessfulExecution { require(success); } } +// forge-lint: disable-end \ No newline at end of file diff --git a/test/ERC4626CompatibilityTest.t.sol b/test/ERC4626CompatibilityTest.t.sol index cdc1bf96..2dd47ecb 100644 --- a/test/ERC4626CompatibilityTest.t.sol +++ b/test/ERC4626CompatibilityTest.t.sol @@ -7,6 +7,7 @@ import {DefaultTestData} from "test/utils/BaseTest.t.sol"; import {PrepareEachFunctionSuccessfulExecution} from "test/administration/PrepareEachFunctionSuccessfulExecution.sol"; import {WhitelistRegistry} from "src/elements/WhitelistRegistry.sol"; +// forge-lint: disable-start contract ERC4626CompatibilityTest is PrepareEachFunctionSuccessfulExecution { struct CallWithCaller { bytes callData; @@ -192,3 +193,4 @@ contract ERC4626CompatibilityTest is PrepareEachFunctionSuccessfulExecution { ltv.redeemCollateral(10000, testUser, testUser); } } +// forge-lint: disable-end diff --git a/test/invariant/findings/DecimalsPrecision.t.sol b/test/invariant/findings/DecimalsPrecision.t.sol index c85d94ba..31ab1d04 100644 --- a/test/invariant/findings/DecimalsPrecision.t.sol +++ b/test/invariant/findings/DecimalsPrecision.t.sol @@ -11,8 +11,8 @@ contract DecimalsPrecision is BaseTest { address internal user = address(42); function setUp() public { - BaseTestInitWithSpecificDecimals memory init = BaseTestInitWithSpecificDecimals( - BaseTestInit({ + BaseTestInitWithSpecificDecimals memory init = BaseTestInitWithSpecificDecimals({ + baseTestInit: BaseTestInit({ owner: address(1), guardian: address(2), governor: address(3), @@ -45,9 +45,9 @@ contract DecimalsPrecision is BaseTest { softLiquidationLtvDividend: 1, softLiquidationLtvDivider: 1 }), - 20, - 6 - ); + collateralTokenDecimals: 20, + borrowTokenDecimals: 6 + }); initializeTestWithSpecificDecimals(init); From 01c746ac9f92cd4a56a53afd4926f9fa79a6be77 Mon Sep 17 00:00:00 2001 From: "vlad.burtsevych" Date: Sun, 9 Nov 2025 22:29:14 -0300 Subject: [PATCH 06/11] fix: linter hack --- .github/workflows/ci.yml | 2 ++ foundry.toml | 5 ++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5381b2a1..c132d524 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -27,6 +27,8 @@ jobs: - name: Forge build run: forge build + - name: Drop problem files + run: rm -rf lib/transparent_upgradeable_beacon_proxy script/ltv_elements/DeployLTVBeaconProxy.s.sol - name: Run lint run: FOUNDRY_DISABLE_NIGHTLY_WARNING=1 forge lint && $([ -n "$(forge lint -q 2>&1)" ] && exit 1 || exit 0) diff --git a/foundry.toml b/foundry.toml index 9df34a4d..ce34ffca 100644 --- a/foundry.toml +++ b/foundry.toml @@ -12,4 +12,7 @@ extra_output = ["storageLayout"] fs_permissions = [{ access = "read", path = "./script/ghost/data"}] [invariant] -fail_on_revert=true \ No newline at end of file +fail_on_revert=true + +[lint] +lint_on_build = false \ No newline at end of file From 7085e86f3e9901adb3f5fa7749a17713be11b1b1 Mon Sep 17 00:00:00 2001 From: "vlad.burtsevych" Date: Sun, 9 Nov 2025 22:29:54 -0300 Subject: [PATCH 07/11] fix: fmt --- test/ERC20CompatibilityTest.t.sol | 2 +- test/invariant/findings/DecimalsPrecision.t.sol | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/test/ERC20CompatibilityTest.t.sol b/test/ERC20CompatibilityTest.t.sol index 0de702f5..9adbddc2 100644 --- a/test/ERC20CompatibilityTest.t.sol +++ b/test/ERC20CompatibilityTest.t.sol @@ -119,4 +119,4 @@ contract ERC20CompatibilityTest is PrepareEachFunctionSuccessfulExecution { require(success); } } -// forge-lint: disable-end \ No newline at end of file +// forge-lint: disable-end diff --git a/test/invariant/findings/DecimalsPrecision.t.sol b/test/invariant/findings/DecimalsPrecision.t.sol index 31ab1d04..bc84f38d 100644 --- a/test/invariant/findings/DecimalsPrecision.t.sol +++ b/test/invariant/findings/DecimalsPrecision.t.sol @@ -47,7 +47,7 @@ contract DecimalsPrecision is BaseTest { }), collateralTokenDecimals: 20, borrowTokenDecimals: 6 - }); + }); initializeTestWithSpecificDecimals(init); From 5589049c77608eacef1fc6fbd1fd10995b8ed1ee Mon Sep 17 00:00:00 2001 From: "vlad.burtsevych" Date: Sun, 9 Nov 2025 22:31:23 -0300 Subject: [PATCH 08/11] Revert "fix: foundry version" This reverts commit 393e0e443dd1da4bff2e9986d96aed0655001acc. --- .github/workflows/ci.yml | 6 +++--- test/ERC20CompatibilityTest.t.sol | 2 -- test/ERC4626CompatibilityTest.t.sol | 2 -- test/invariant/findings/DecimalsPrecision.t.sol | 10 +++++----- 4 files changed, 8 insertions(+), 12 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c132d524..1f2b0ad3 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -16,7 +16,7 @@ jobs: - name: Install Foundry uses: foundry-rs/foundry-toolchain@v1 with: - version: nightly-cca5d6f7dc60a9a5318af523c187c2a2416377d2 + version: nightly-567ac47f2b4bf6e295c9ab876a781c563da7b3f1 - name: Print forge version run: forge --version @@ -40,7 +40,7 @@ jobs: - name: Install Foundry uses: foundry-rs/foundry-toolchain@v1 with: - version: nightly-cca5d6f7dc60a9a5318af523c187c2a2416377d2 + version: nightly-567ac47f2b4bf6e295c9ab876a781c563da7b3f1 - name: Print forge version run: forge --version @@ -56,7 +56,7 @@ jobs: - name: Install Foundry uses: foundry-rs/foundry-toolchain@v1 with: - version: nightly-cca5d6f7dc60a9a5318af523c187c2a2416377d2 + version: nightly-567ac47f2b4bf6e295c9ab876a781c563da7b3f1 - name: Print forge version run: forge --version diff --git a/test/ERC20CompatibilityTest.t.sol b/test/ERC20CompatibilityTest.t.sol index 9adbddc2..77dc2bb8 100644 --- a/test/ERC20CompatibilityTest.t.sol +++ b/test/ERC20CompatibilityTest.t.sol @@ -6,7 +6,6 @@ import {DefaultTestData} from "test/utils/BaseTest.t.sol"; import {PrepareEachFunctionSuccessfulExecution} from "test/administration/PrepareEachFunctionSuccessfulExecution.sol"; import {WhitelistRegistry} from "src/elements/WhitelistRegistry.sol"; -// forge-lint: disable-start contract ERC20CompatibilityTest is PrepareEachFunctionSuccessfulExecution { struct CallWithCaller { bytes callData; @@ -119,4 +118,3 @@ contract ERC20CompatibilityTest is PrepareEachFunctionSuccessfulExecution { require(success); } } -// forge-lint: disable-end diff --git a/test/ERC4626CompatibilityTest.t.sol b/test/ERC4626CompatibilityTest.t.sol index 2dd47ecb..cdc1bf96 100644 --- a/test/ERC4626CompatibilityTest.t.sol +++ b/test/ERC4626CompatibilityTest.t.sol @@ -7,7 +7,6 @@ import {DefaultTestData} from "test/utils/BaseTest.t.sol"; import {PrepareEachFunctionSuccessfulExecution} from "test/administration/PrepareEachFunctionSuccessfulExecution.sol"; import {WhitelistRegistry} from "src/elements/WhitelistRegistry.sol"; -// forge-lint: disable-start contract ERC4626CompatibilityTest is PrepareEachFunctionSuccessfulExecution { struct CallWithCaller { bytes callData; @@ -193,4 +192,3 @@ contract ERC4626CompatibilityTest is PrepareEachFunctionSuccessfulExecution { ltv.redeemCollateral(10000, testUser, testUser); } } -// forge-lint: disable-end diff --git a/test/invariant/findings/DecimalsPrecision.t.sol b/test/invariant/findings/DecimalsPrecision.t.sol index bc84f38d..c85d94ba 100644 --- a/test/invariant/findings/DecimalsPrecision.t.sol +++ b/test/invariant/findings/DecimalsPrecision.t.sol @@ -11,8 +11,8 @@ contract DecimalsPrecision is BaseTest { address internal user = address(42); function setUp() public { - BaseTestInitWithSpecificDecimals memory init = BaseTestInitWithSpecificDecimals({ - baseTestInit: BaseTestInit({ + BaseTestInitWithSpecificDecimals memory init = BaseTestInitWithSpecificDecimals( + BaseTestInit({ owner: address(1), guardian: address(2), governor: address(3), @@ -45,9 +45,9 @@ contract DecimalsPrecision is BaseTest { softLiquidationLtvDividend: 1, softLiquidationLtvDivider: 1 }), - collateralTokenDecimals: 20, - borrowTokenDecimals: 6 - }); + 20, + 6 + ); initializeTestWithSpecificDecimals(init); From ec4052720b1c29b78b5420724b92d60a2782b70c Mon Sep 17 00:00:00 2001 From: "vlad.burtsevych" Date: Sun, 9 Nov 2025 23:14:28 -0300 Subject: [PATCH 09/11] add: params file for upgradeable beacon proxy deploy --- deploy/sepolia/aave/permissionless.json | 2 +- .../aave/upgradeable_beacon_proxy.json | 38 +++++++++++++++++++ 2 files changed, 39 insertions(+), 1 deletion(-) create mode 100644 deploy/sepolia/aave/upgradeable_beacon_proxy.json diff --git a/deploy/sepolia/aave/permissionless.json b/deploy/sepolia/aave/permissionless.json index a389433b..f09be1be 100644 --- a/deploy/sepolia/aave/permissionless.json +++ b/deploy/sepolia/aave/permissionless.json @@ -34,5 +34,5 @@ "WHITELIST_SIGNER": "0x6caf55c49fd07cc63d9acc108979c4c806246510", "BEACON": "0xfE8f068568Cc84c3818406765da285e7f57B8A80", "LTV_BEACON_PROXY": "0xAa707a2a0e38DE55cA0b61dd32468e357b55b15f", - "ACTIVATE_WHITELIST": true + "ACTIVATE_WHITELIST": false } \ No newline at end of file diff --git a/deploy/sepolia/aave/upgradeable_beacon_proxy.json b/deploy/sepolia/aave/upgradeable_beacon_proxy.json new file mode 100644 index 00000000..f09be1be --- /dev/null +++ b/deploy/sepolia/aave/upgradeable_beacon_proxy.json @@ -0,0 +1,38 @@ +{ + "LENDING_CONNECTOR_NAME": "AaveV3", + "BEACON_OWNER": "0xde1d9ff8d1396a98688d7e07eda88a19cf2bb6cf", + "BEACON_PROXY_OWNER": "0xde1d9ff8d1396a98688d7e07eda88a19cf2bb6cf", + "WHITELIST_OWNER": "0xdbd5bcfd943e7666fcd3585382ca808bef61c8ae", + "NAME": "weth/wbtc x4 on Aave v3", + "SYMBOL": "WETH_WBTC_x4_AAVEV3", + "COLLATERAL_ASSET": "0xc558dbdd856501fcd9aaf1e62eae57a9f0629a3c", + "BORROW_ASSET": "0x29f2D40B0605204364af54EC677bD022dA425d03", + "MAX_SAFE_LTV_DIVIDEND": 7, + "MAX_SAFE_LTV_DIVIDER": 9, + "MIN_PROFIT_LTV_DIVIDEND": 11, + "MIN_PROFIT_LTV_DIVIDER": 15, + "TARGET_LTV_DIVIDEND": 3, + "TARGET_LTV_DIVIDER": 4, + "MAX_GROWTH_FEE_DIVIDEND": 1, + "MAX_GROWTH_FEE_DIVIDER": 5, + "MAX_TOTAL_ASSETS_IN_UNDERLYING": 160000000000000000000000, + "BORROW_SLIPPAGE": 5000000000000000, + "COLLATERAL_SLIPPAGE": 5000000000000000, + "AUCTION_DURATION": 1024, + "MAX_DELEVERAGE_FEE_DIVIDEND": 1, + "MAX_DELEVERAGE_FEE_DIVIDER": 50, + "OWNER": "0xde1d9ff8d1396a98688d7e07eda88a19cf2bb6cf", + "GUARDIAN": "0xa90470360eab40447ffda22eb9bc4090f145e03d", + "GOVERNOR": "0x6e274b4f3be2431591477ab96607a2226e6ca043", + "EMERGENCY_DELEVERAGER": "0xdc8a33d04fc0742de2b8ba1b76e4f7541c6ca312", + "FEE_COLLECTOR": "0x39d43daa78ad3509733f25afea04facdf62ba0d6", + "EMODE": 0, + "SOFT_LIQUIDATION_FEE_DIVIDEND": 1, + "SOFT_LIQUIDATION_FEE_DIVIDER": 100, + "SOFT_LIQUIDATION_LTV_DIVIDEND": 92, + "SOFT_LIQUIDATION_LTV_DIVIDER": 100, + "WHITELIST_SIGNER": "0x6caf55c49fd07cc63d9acc108979c4c806246510", + "BEACON": "0xfE8f068568Cc84c3818406765da285e7f57B8A80", + "LTV_BEACON_PROXY": "0xAa707a2a0e38DE55cA0b61dd32468e357b55b15f", + "ACTIVATE_WHITELIST": false +} \ No newline at end of file From 1f88ecc18d6cc582be8c88c57671acc8b4dece5f Mon Sep 17 00:00:00 2001 From: "vlad.burtsevych" Date: Sun, 9 Nov 2025 23:15:08 -0300 Subject: [PATCH 10/11] refactor: renaming --- deploy/sepolia/aave/upgradeable_beacon_proxy.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/deploy/sepolia/aave/upgradeable_beacon_proxy.json b/deploy/sepolia/aave/upgradeable_beacon_proxy.json index f09be1be..6946b6d5 100644 --- a/deploy/sepolia/aave/upgradeable_beacon_proxy.json +++ b/deploy/sepolia/aave/upgradeable_beacon_proxy.json @@ -3,8 +3,8 @@ "BEACON_OWNER": "0xde1d9ff8d1396a98688d7e07eda88a19cf2bb6cf", "BEACON_PROXY_OWNER": "0xde1d9ff8d1396a98688d7e07eda88a19cf2bb6cf", "WHITELIST_OWNER": "0xdbd5bcfd943e7666fcd3585382ca808bef61c8ae", - "NAME": "weth/wbtc x4 on Aave v3", - "SYMBOL": "WETH_WBTC_x4_AAVEV3", + "NAME": "weth/wbtc x4 on Aave v3 new beacon proxy", + "SYMBOL": "WETH_WBTC_x4_AAVEV3_NEW_BEACON_PROXY", "COLLATERAL_ASSET": "0xc558dbdd856501fcd9aaf1e62eae57a9f0629a3c", "BORROW_ASSET": "0x29f2D40B0605204364af54EC677bD022dA425d03", "MAX_SAFE_LTV_DIVIDEND": 7, From 7b5dd1a875f50482fad1dfd8cfb2dcc541955812 Mon Sep 17 00:00:00 2001 From: "vlad.burtsevych" Date: Mon, 10 Nov 2025 00:27:43 -0300 Subject: [PATCH 11/11] fix: better deterministic deployment --- foundry.toml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/foundry.toml b/foundry.toml index ce34ffca..d3d6927e 100644 --- a/foundry.toml +++ b/foundry.toml @@ -3,6 +3,10 @@ src = "src" out = "out" libs = ["lib"] optimizer=true +solc = "0.8.28" +evm_version = "prague" +bytecode_hash = "none" +cbor_metadata = false # See more config options https://github.com/foundry-rs/foundry/blob/master/crates/config/README.md#all-options ffi = true