From 3f248189dfd003c75133a567e4310ab64c539135 Mon Sep 17 00:00:00 2001 From: Harsh Pandey Date: Wed, 22 Nov 2023 16:22:58 +0530 Subject: [PATCH] chore: bnb deploy script --- Makefile | 1 + foundry.toml | 2 ++ lib/aave-address-book | 2 +- lib/aave-helpers | 2 +- scripts/Deploy.s.sol | 15 ++++++++++++++- src/lib/AugustusRegistry.sol | 2 +- 6 files changed, 20 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index 44247e7..5cae5a1 100644 --- a/Makefile +++ b/Makefile @@ -26,3 +26,4 @@ ethereumv2 :; make deploy-ledger contract=scripts/Deploy.s.sol:EthereumV2 chain= ethereumv3 :; make deploy-ledger contract=scripts/Deploy.s.sol:EthereumV3 chain=mainnet basev3 :; make deploy-ledger contract=scripts/Deploy.s.sol:BaseV3 chain=base +bnbv3 :; make deploy-ledger contract=scripts/Deploy.s.sol:BNBV3 chain=bnb diff --git a/foundry.toml b/foundry.toml index ec8deb5..761715a 100644 --- a/foundry.toml +++ b/foundry.toml @@ -17,6 +17,7 @@ arbitrum = "${RPC_ARBITRUM}" fantom = "${RPC_FANTOM}" harmony = "${RPC_HARMONY}" base = "${RPC_BASE}" +bnb = "${RPC_BNB}" [etherscan] mainnet={key="${ETHERSCAN_API_KEY_MAINNET}",chainId=1} @@ -26,5 +27,6 @@ polygon={key="${ETHERSCAN_API_KEY_POLYGON}",chainId=137} arbitrum={key="${ETHERSCAN_API_KEY_ARBITRUM}",chainId=42161} fantom={key="${ETHERSCAN_API_KEY_FANTOM}",chainId=250} base={key="${ETHERSCAN_API_KEY_BASE}",chainId=8453} +bnb={key="${ETHERSCAN_API_KEY_BNB}",chainId=56,url='https://api.bscscan.com/api'} # See more config options https://github.com/gakonst/foundry/tree/master/config diff --git a/lib/aave-address-book b/lib/aave-address-book index 9f5c33d..8edb874 160000 --- a/lib/aave-address-book +++ b/lib/aave-address-book @@ -1 +1 @@ -Subproject commit 9f5c33da4813dbd885b9f888c1cf6234340f71e7 +Subproject commit 8edb874407adffc6e288d5b3869ed1421a2b7743 diff --git a/lib/aave-helpers b/lib/aave-helpers index dc6e80f..428dc96 160000 --- a/lib/aave-helpers +++ b/lib/aave-helpers @@ -1 +1 @@ -Subproject commit dc6e80ffafd43565376ba63cff43659e6fc249d4 +Subproject commit 428dc96fb23d5858e3c5ecb6bd5e24d236613efc diff --git a/scripts/Deploy.s.sol b/scripts/Deploy.s.sol index e619a31..e3e7c56 100644 --- a/scripts/Deploy.s.sol +++ b/scripts/Deploy.s.sol @@ -2,7 +2,7 @@ pragma solidity ^0.8.0; import {IPoolAddressesProvider} from '@aave/core-v3/contracts/interfaces/IPoolAddressesProvider.sol'; -import {ArbitrumScript, EthereumScript, PolygonScript, AvalancheScript, OptimismScript, BaseScript} from 'aave-helpers/ScriptUtils.sol'; +import {ArbitrumScript, EthereumScript, PolygonScript, AvalancheScript, OptimismScript, BaseScript, BNBScript} from 'aave-helpers/ScriptUtils.sol'; import {AaveGovernanceV2} from 'aave-address-book/AaveGovernanceV2.sol'; import {AaveV2Ethereum} from 'aave-address-book/AaveV2Ethereum.sol'; import {AaveV3Ethereum} from 'aave-address-book/AaveV3Ethereum.sol'; @@ -13,6 +13,8 @@ import {AaveV3Avalanche} from 'aave-address-book/AaveV3Avalanche.sol'; import {AaveV3Optimism} from 'aave-address-book/AaveV3Optimism.sol'; import {AaveV3Arbitrum} from 'aave-address-book/AaveV3Arbitrum.sol'; import {AaveV3Base} from 'aave-address-book/AaveV3Base.sol'; +import {AaveV3Bnb} from 'aave-address-book/AaveV3Bnb.sol'; +import {GovernanceV3BNB} from 'aave-address-book/GovernanceV3BNB.sol'; import {ParaSwapDebtSwapAdapterV3} from '../src/contracts/ParaSwapDebtSwapAdapterV3.sol'; import {ParaSwapDebtSwapAdapterV3GHO} from '../src/contracts/ParaSwapDebtSwapAdapterV3GHO.sol'; import {ParaSwapDebtSwapAdapterV2} from '../src/contracts/ParaSwapDebtSwapAdapterV2.sol'; @@ -116,3 +118,14 @@ contract BaseV3 is BaseScript { ); } } + +contract BNBV3 is BNBScript { + function run() external broadcast { + new ParaSwapDebtSwapAdapterV3( + IPoolAddressesProvider(address(AaveV3Bnb.POOL_ADDRESSES_PROVIDER)), + address(AaveV3Bnb.POOL), + AugustusRegistry.BNB, + GovernanceV3BNB.EXECUTOR_LVL_1 + ); + } +} diff --git a/src/lib/AugustusRegistry.sol b/src/lib/AugustusRegistry.sol index 226f568..bcaa468 100644 --- a/src/lib/AugustusRegistry.sol +++ b/src/lib/AugustusRegistry.sol @@ -18,7 +18,7 @@ library AugustusRegistry { IParaSwapAugustusRegistry public constant OPTIMISM = IParaSwapAugustusRegistry(0x6e7bE86000dF697facF4396efD2aE2C322165dC3); - IParaSwapAugustusRegistry public constant BSC = + IParaSwapAugustusRegistry public constant BNB = IParaSwapAugustusRegistry(0x05b4486f643914a818eD93Afc07457e9074be211); IParaSwapAugustusRegistry public constant BASE =