Skip to content

Commit fcab292

Browse files
craterface77Haypierre
authored andcommitted
Script: Adjusted deployment script + .env.example
1 parent 5bf9ed4 commit fcab292

File tree

3 files changed

+13
-2
lines changed

3 files changed

+13
-2
lines changed

.env.example

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,4 @@ VERSION_SALT=0xYourSalt
77
AAVE_POOL=0x6Ae43d3271ff6888e7Fc43Fd7321a503ff738951
88
AAVE_DATA_PROVIDER=0x3e9708d80f7B3e43118013075F7e95CE3AB31F31
99
UNDERLYING_TOKEN=0xFF34B3d4Aee8ddCd6F9AFFFB6Fe49bD371b8a357
10+
IS_L2=IS_L2_OR_NOT

script/deployChainAbstractionSetup.s.sol

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ import {VaultManager} from "../src/vaults/VaultManager.sol";
1515
import {CABPaymaster} from "../src/paymasters/CABPaymaster.sol";
1616
import {InvoiceManager} from "../src/core/InvoiceManager.sol";
1717
import {IPool} from "aave-v3-origin/core/contracts/interfaces/IPool.sol";
18+
import {L2Encoder} from "aave-v3-origin/core/contracts/misc/L2Encoder.sol";
1819

1920
import {ICrossL2Prover} from "@vibc-core-smart-contracts/contracts/interfaces/ICrossL2Prover.sol";
2021

@@ -29,8 +30,10 @@ contract DeployChainAbstractionSetup is Script, CheckOrDeployEntryPoint, CheckAa
2930
address internal verifyingSigner = vm.envAddress("VERIFYING_SIGNER");
3031
bytes32 internal versionSalt = vm.envBytes32("VERSION_SALT");
3132

33+
address internal l2Encoder;
3234
address internal aavePool = vm.envAddress("AAVE_POOL");
3335
address internal protocolDataProvider = vm.envAddress("AAVE_DATA_PROVIDER");
36+
bool internal isL2 = vm.envBool("IS_L2");
3437

3538
function run(address[] calldata tokens) public {
3639
if (tokens.length == 0) {
@@ -84,6 +87,11 @@ contract DeployChainAbstractionSetup is Script, CheckOrDeployEntryPoint, CheckAa
8487
vaultManager.addVault(baseVault);
8588

8689
if (isAaveToken(protocolDataProvider, token)) {
90+
if(isL2) {
91+
l2Encoder = address(new L2Encoder(IPool(aavePool)));
92+
} else {
93+
l2Encoder = address(0);
94+
}
8795
address aTokenAddress = getATokenAddress(protocolDataProvider, address(token));
8896
AaveVault aaveVault = AaveVault(
8997
payable(
@@ -94,7 +102,9 @@ contract DeployChainAbstractionSetup is Script, CheckOrDeployEntryPoint, CheckAa
94102
IVaultManager(address(vaultManager)),
95103
IERC20(token),
96104
IERC20(aTokenAddress),
97-
IPool(aavePool)
105+
IPool(aavePool),
106+
isL2,
107+
l2Encoder
98108
)
99109
)
100110
)

test/AaveVault/AaveVaultFork.t.sol

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ contract DeployAndTestAaveVaults is Test, Script, CheckAaveTokenStatus {
5353
underlyingToken,
5454
aToken,
5555
IPool(aavePool),
56-
isL2,
56+
false,
5757
address(0)
5858
)
5959
)

0 commit comments

Comments
 (0)