Skip to content

Commit

Permalink
Refactor migration script for better readability by adjusting spacing…
Browse files Browse the repository at this point in the history
… and line breaks in function calls.
  • Loading branch information
ylv-io committed Oct 24, 2024
1 parent b729980 commit 467324c
Showing 1 changed file with 19 additions and 8 deletions.
27 changes: 19 additions & 8 deletions script/migrations/139-transfer-treasury-ownership.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ contract DeployScript is MigrationHelper {
function run() public override {
super.run();

AccessManager accessManager = AccessManager(_getChainDeployment("AccessManager"));
address treasury =_getChainDeployment("Treasury");
address governor =_getChainDeployment("NioGovernor ");
AccessManager accessManager = AccessManager(_getChainDeployment("AccessManager"));
address treasury = _getChainDeployment("Treasury");
address governor = _getChainDeployment("NioGovernor ");

_whitelistApp(address(accessManager));

Expand All @@ -28,11 +28,22 @@ contract DeployScript is MigrationHelper {
selectors[1] = Treasury.sendETH.selector;
selectors[2] = Treasury.batchSendFunds.selector;

_handleOps(abi.encodeWithSelector(AccessManager.setTargetFunctionRole.selector, treasury, selectors, NIO_GOVERNOR_ROLE), address(accessManager));

_handleOps(abi.encodeWithSelector(AccessManager.grantRole.selector, NIO_GOVERNOR_ROLE, governor, uint32(NIO_EXECUTION_DELAY)), address(accessManager));

_handleOps(abi.encodeWithSelector(AccessManager.labelRole.selector, NIO_GOVERNOR_ROLE, 'NIO_GOVERNOR_ROLE'), address(accessManager));
_handleOps(
abi.encodeWithSelector(AccessManager.setTargetFunctionRole.selector, treasury, selectors, NIO_GOVERNOR_ROLE),
address(accessManager)
);

_handleOps(
abi.encodeWithSelector(
AccessManager.grantRole.selector, NIO_GOVERNOR_ROLE, governor, uint32(NIO_EXECUTION_DELAY)
),
address(accessManager)
);

_handleOps(
abi.encodeWithSelector(AccessManager.labelRole.selector, NIO_GOVERNOR_ROLE, "NIO_GOVERNOR_ROLE"),
address(accessManager)
);

_handleOps(abi.encodeWithSelector(Ownable.transferOwnership.selector, accessManager), address(treasury));

Expand Down

0 comments on commit 467324c

Please sign in to comment.