Skip to content

Commit d7c7a3e

Browse files
authored
Merge pull request #16 from lens-protocol/feat/4626-deploy-script
Feat: ERC4626FeeCollect Deploy Script
2 parents 897d054 + 37dd257 commit d7c7a3e

File tree

1 file changed

+36
-0
lines changed

1 file changed

+36
-0
lines changed
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
import '@nomiclabs/hardhat-ethers';
2+
import { task } from 'hardhat/config';
3+
import { HardhatRuntimeEnvironment } from 'hardhat/types';
4+
import { deployWithVerify } from '../../helpers/utils';
5+
import { ERC4626FeeCollectModule__factory, LensHub__factory } from '../../../typechain';
6+
7+
export let runtimeHRE: HardhatRuntimeEnvironment;
8+
9+
task(
10+
'deploy-ERC4626-fee-collect-module',
11+
'Deploys, verifies and whitelists the ERC4626 fee collect module'
12+
)
13+
.addParam('hub')
14+
.addParam('globals')
15+
.setAction(async ({ hub, globals }, hre) => {
16+
runtimeHRE = hre;
17+
const ethers = hre.ethers;
18+
const accounts = await ethers.getSigners();
19+
const deployer = accounts[0];
20+
const governance = accounts[1];
21+
22+
console.log('\n\n- - - - - - - - Deploying ERC4626 fee collect module\n\n');
23+
const erc4626FeeCollectModule = await deployWithVerify(
24+
new ERC4626FeeCollectModule__factory(deployer).deploy(hub, globals),
25+
[hub, globals],
26+
'contracts/collect/ERC4626FeeCollectModule.sol:ERC4626FeeCollectModule'
27+
);
28+
29+
if (process.env.HARDHAT_NETWORK !== 'matic') {
30+
console.log('\n\n- - - - - - - - Whitelisting ERC4626 fee collect module\n\n');
31+
await LensHub__factory.connect(hub, governance).whitelistCollectModule(
32+
erc4626FeeCollectModule.address,
33+
true
34+
);
35+
}
36+
});

0 commit comments

Comments
 (0)