forked from balancer/balancer-deployments
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.ts
27 lines (22 loc) · 1.04 KB
/
index.ts
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
import { Task, TaskRunOptions } from '@src';
import { TimelockAuthorizerDeployment } from './input';
export default async (task: Task, { force, from }: TaskRunOptions = {}): Promise<void> => {
const input = task.input() as TimelockAuthorizerDeployment;
const args = [
input.Root,
input.Authorizer,
input.AuthorizerAdaptorEntrypoint,
input.Roles,
input.Granters,
input.Revokers,
input.ExecuteDelays,
input.GrantDelays,
];
const migrator = await task.deployAndVerify('TimelockAuthorizerMigrator', args, from, force);
const authorizer = await task.instanceAt('TimelockAuthorizer', await migrator.newAuthorizer());
const authorizerArgs = [migrator.address, input.AuthorizerAdaptorEntrypoint, await migrator.CHANGE_ROOT_DELAY()];
await task.verify('TimelockAuthorizer', authorizer.address, authorizerArgs);
await task.save({ TimelockAuthorizer: authorizer });
const executor = await task.instanceAt('TimelockExecutor', await authorizer.getExecutor());
await task.verify('TimelockExecutor', executor.address, []);
};