-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.ts
31 lines (27 loc) · 1.12 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
28
29
30
31
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 migrator = await task.deployAndVerify(
'TimelockAuthorizerMigrator',
[
input.Root,
input.Authorizer,
input.AuthorizerAdaptorEntrypoint,
input.RootTransferDelay,
await input.getRoles(),
input.Granters,
input.Revokers,
input.ExecuteDelays,
input.GrantDelays,
],
from,
force
);
const authorizer = await task.instanceAt('TimelockAuthorizer', await migrator.newAuthorizer());
const authorizerArgs = [migrator.address, input.Root, input.AuthorizerAdaptorEntrypoint, input.RootTransferDelay];
await task.verify('TimelockAuthorizer', authorizer.address, authorizerArgs);
task.save({ TimelockAuthorizer: authorizer });
const executor = await task.instanceAt('TimelockExecutionHelper', await authorizer.getTimelockExecutionHelper());
await task.verify('TimelockExecutionHelper', executor.address, []);
};