-
Notifications
You must be signed in to change notification settings - Fork 77
/
Copy path012.portal_transfer_ownership.ts
53 lines (44 loc) · 1.47 KB
/
012.portal_transfer_ownership.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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
import { ZeroHash as DEFAULT_ADMIN_ROLE } from 'ethers';
import type { HardhatRuntimeEnvironment } from 'hardhat/types';
import type { DeployFunction } from 'hardhat-deploy/dist/types';
import { MAINNET_MULTISIG_ADDRESS } from '../../protocol/constants';
import { FuelMessagePortalV3__factory } from '../../typechain';
const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) {
const { ethers, deployments } = hre;
const [deployer] = await ethers.getSigners();
const { address: portalAddress } = await deployments.get('FuelMessagePortal');
const portal = FuelMessagePortalV3__factory.connect(
portalAddress,
ethers.provider
);
const PAUSER_ROLE = await portal.PAUSER_ROLE();
const RATE_LIMITER_ROLE = await portal.SET_RATE_LIMITER_ROLE();
// Give admin role to multisig
await deployments.execute(
'FuelMessagePortal',
{ log: true, from: deployer.address },
'grantRole',
DEFAULT_ADMIN_ROLE,
MAINNET_MULTISIG_ADDRESS
);
// Give pauser role to multisig
await deployments.execute(
'FuelMessagePortal',
{ log: true, from: deployer.address },
'grantRole',
PAUSER_ROLE,
MAINNET_MULTISIG_ADDRESS
);
// Give rate limit role to multisig
await deployments.execute(
'FuelMessagePortal',
{ log: true, from: deployer.address },
'grantRole',
RATE_LIMITER_ROLE,
MAINNET_MULTISIG_ADDRESS
);
return true;
};
func.tags = ['portal_ownership'];
func.id = 'portal_ownership';
export default func;