@@ -15,6 +15,7 @@ import {VaultManager} from "../src/vaults/VaultManager.sol";
15
15
import {CABPaymaster} from "../src/paymasters/CABPaymaster.sol " ;
16
16
import {InvoiceManager} from "../src/core/InvoiceManager.sol " ;
17
17
import {IPool} from "aave-v3-origin/core/contracts/interfaces/IPool.sol " ;
18
+ import {L2Encoder} from "aave-v3-origin/core/contracts/misc/L2Encoder.sol " ;
18
19
19
20
import {ICrossL2Prover} from "@vibc-core-smart-contracts/contracts/interfaces/ICrossL2Prover.sol " ;
20
21
@@ -29,8 +30,10 @@ contract DeployChainAbstractionSetup is Script, CheckOrDeployEntryPoint, CheckAa
29
30
address internal verifyingSigner = vm.envAddress ("VERIFYING_SIGNER " );
30
31
bytes32 internal versionSalt = vm.envBytes32 ("VERSION_SALT " );
31
32
33
+ address internal l2Encoder;
32
34
address internal aavePool = vm.envAddress ("AAVE_POOL " );
33
35
address internal protocolDataProvider = vm.envAddress ("AAVE_DATA_PROVIDER " );
36
+ bool internal isL2 = vm.envBool ("IS_L2 " );
34
37
35
38
function run (address [] calldata tokens ) public {
36
39
if (tokens.length == 0 ) {
@@ -84,6 +87,11 @@ contract DeployChainAbstractionSetup is Script, CheckOrDeployEntryPoint, CheckAa
84
87
vaultManager.addVault (baseVault);
85
88
86
89
if (isAaveToken (protocolDataProvider, token)) {
90
+ if (isL2) {
91
+ l2Encoder = address (new L2Encoder (IPool (aavePool)));
92
+ } else {
93
+ l2Encoder = address (0 );
94
+ }
87
95
address aTokenAddress = getATokenAddress (protocolDataProvider, address (token));
88
96
AaveVault aaveVault = AaveVault (
89
97
payable (
@@ -94,7 +102,9 @@ contract DeployChainAbstractionSetup is Script, CheckOrDeployEntryPoint, CheckAa
94
102
IVaultManager (address (vaultManager)),
95
103
IERC20 (token),
96
104
IERC20 (aTokenAddress),
97
- IPool (aavePool)
105
+ IPool (aavePool),
106
+ isL2,
107
+ l2Encoder
98
108
)
99
109
)
100
110
)
0 commit comments