Skip to content

Commit

Permalink
adds role setup
Browse files Browse the repository at this point in the history
  • Loading branch information
WalidOfNow committed May 29, 2024
1 parent 1d62e95 commit fc1664c
Showing 1 changed file with 18 additions and 1 deletion.
19 changes: 18 additions & 1 deletion script/DeployL2XPufETH.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import { NoImplementation } from "../src/NoImplementation.sol";
import { Timelock } from "../src/Timelock.sol";
import { ERC1967Proxy } from "openzeppelin/proxy/ERC1967/ERC1967Proxy.sol";
import { AccessManager } from "openzeppelin/access/manager/AccessManager.sol";
import { ROLE_ID_DAO, ROLE_ID_OPERATIONS_MULTISIG } from "./Roles.sol";

/**
* @title DeployL2XPufETH
Expand All @@ -25,7 +26,7 @@ import { AccessManager } from "openzeppelin/access/manager/AccessManager.sol";
*
* BaseScript.sol holds the private key logic, if you don't have `PK` ENV variable, it will use the default one PK from `makeAddr("pufferDeployer")`
*
* PK=${deployer_pk} forge script script/DeployL2XPufETH.s.sol:DeployL2XPufETH -vvvv --rpc-url=... --broadcast
* PK=a990c824d7f6928806d93674ef4acd4b240ad60c9ce575777c87b36f9a3c32a8 forge script script/DeployL2XPufETH.s.sol:DeployL2XPufETH -vvvv --rpc-url=https://holesky.gateway.tenderly.co/5ovlGAOeSvuI3UcQD2PoSD --broadcast
*/
contract DeployL2XPufETH is BaseScript {
address operationsMultisig = vm.envOr("OPERATIONS_MULTISIG", makeAddr("operationsMultisig"));
Expand Down Expand Up @@ -57,5 +58,21 @@ contract DeployL2XPufETH is BaseScript {
NoImplementation(payable(address(xPufETH))).upgradeToAndCall(
address(newImplementation), abi.encodeCall(XERC20PufferVault.initialize, (address(accessManager)))
);

bytes4[] memory selectors = new bytes4[](2);
selectors[0] = XERC20PufferVault.setLockbox.selector;
selectors[1] = XERC20PufferVault.setLimits.selector;

// Setup Access
accessManager.setTargetFunctionRole(address(xPufETH), selectors, ROLE_ID_DAO);

accessManager.grantRole(accessManager.ADMIN_ROLE(), address(timelock), 0);

// replace with dao and ops multisigs for mainnet
accessManager.grantRole(ROLE_ID_DAO, _broadcaster, 0);
accessManager.grantRole(ROLE_ID_OPERATIONS_MULTISIG, _broadcaster, 0);

// revoke on mainnet
// accessManager.revokeRole(accessManager.ADMIN_ROLE(), _broadcaster);
}
}

0 comments on commit fc1664c

Please sign in to comment.