File tree Expand file tree Collapse file tree 1 file changed +25
-2
lines changed Expand file tree Collapse file tree 1 file changed +25
-2
lines changed Original file line number Diff line number Diff line change @@ -8,6 +8,28 @@ import {IPoolAddressesProvider} from "@aave-v3-core/interfaces/IPoolAddressesPro
88import {TransparentUpgradeableProxy} from "@openzeppelin/proxy/transparent/TransparentUpgradeableProxy.sol " ;
99import {ATokenVault} from "./ATokenVault.sol " ;
1010
11+ /**
12+ * @title ATokenVaultImplDeploymentLib
13+ * @author Aave Protocol
14+ * @notice Library that handles the deployment of the ATokenVault implementation contract
15+ * @dev This library is a helper to avoid holding the ATokenVault bytecode in the factory contract avoiding exceeding
16+ * the contract size limit.
17+ */
18+ library ATokenVaultImplDeploymentLib {
19+ function deployVaultImpl (
20+ bytes32 salt ,
21+ address underlying ,
22+ uint16 referralCode ,
23+ IPoolAddressesProvider poolAddressesProvider
24+ ) external returns (address vault ) {
25+ return address (new ATokenVault {salt: salt}(
26+ underlying,
27+ referralCode,
28+ poolAddressesProvider
29+ ));
30+ }
31+ }
32+
1133/**
1234 * @title ATokenVaultFactory
1335 * @author Aave Protocol
@@ -124,11 +146,12 @@ contract ATokenVaultFactory {
124146 currentCounter
125147 ));
126148
127- address implementation = address (new ATokenVault {salt: salt}(
149+ address implementation = ATokenVaultImplDeploymentLib.deployVaultImpl (
150+ salt,
128151 params.underlying,
129152 params.referralCode,
130153 params.poolAddressesProvider
131- )) ;
154+ );
132155
133156 vault = address (new TransparentUpgradeableProxy {salt: salt}(
134157 implementation,
You can’t perform that action at this time.
0 commit comments