-
Notifications
You must be signed in to change notification settings - Fork 77
/
Copy path013.chain_state_transfer_ownership.ts
40 lines (32 loc) · 1.17 KB
/
013.chain_state_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
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 { FuelChainState__factory } from '../../typechain';
const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) {
const { ethers, deployments } = hre;
const [deployer] = await ethers.getSigners();
const { address: stateAddress } = await deployments.get('FuelChainState');
const state = FuelChainState__factory.connect(stateAddress, ethers.provider);
const PAUSER_ROLE = await state.PAUSER_ROLE();
// Give admin role to multisig
await deployments.execute(
'FuelChainState',
{ log: true, from: deployer.address },
'grantRole',
DEFAULT_ADMIN_ROLE,
MAINNET_MULTISIG_ADDRESS
);
// Give pauser role to multisig
await deployments.execute(
'FuelChainState',
{ log: true, from: deployer.address },
'grantRole',
PAUSER_ROLE,
MAINNET_MULTISIG_ADDRESS
);
return true;
};
func.tags = ['state_ownership'];
func.id = 'state_ownership';
export default func;