1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
import { ethers } from "hardhat";
import { Module } from "../test/utils";
import {
Automate,
ProxyModule,
ResolverModule,
SingleExecModule,
TriggerModule,
Web3FunctionModule,
} from "../typechain";
export const setModules = async () => {
const [owner] = await ethers.getSigners();
const ownerAddress = await owner.getAddress();
console.log("Owner: ", ownerAddress);
const automateAddress = (await ethers.getContract("Automate")).address;
const automate = <Automate>(
await ethers.getContractAt("Automate", automateAddress)
);
const resolverModule = <ResolverModule>(
await ethers.getContract("ResolverModule")
);
const proxyModule = <ProxyModule>await ethers.getContract("ProxyModule");
const singleExecModule = <SingleExecModule>(
await ethers.getContract("SingleExecModule")
);
const web3FunctionModule = <Web3FunctionModule>(
await ethers.getContract("Web3FunctionModule")
);
const triggerModule = <TriggerModule>(
await ethers.getContract("TriggerModule")
);
const modules = [
Module.RESOLVER,
Module.PROXY,
Module.SINGLE_EXEC,
Module.WEB3_FUNCTION,
Module.TRIGGER,
];
const moduleAddresses = [
resolverModule.address,
proxyModule.address,
singleExecModule.address,
web3FunctionModule.address,
triggerModule.address,
];
await automate.setModule(modules, moduleAddresses);
};
setModules();