Skip to content

Commit

Permalink
feat: add "SetPermission" bootstrap script
Browse files Browse the repository at this point in the history
docs: change license in BaseScript
  • Loading branch information
PaulRBerg committed Feb 24, 2023
1 parent 46a34c5 commit 653127b
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 1 deletion.
20 changes: 20 additions & 0 deletions script/bootstrap/SetPermission.s.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
// SPDX-License-Identifier: MIT
pragma solidity >=0.8.18 <0.9.0;

import { IPRBProxy } from "../../src/interfaces/IPRBProxy.sol";
import { IPRBProxyHelpers } from "../../src/interfaces/IPRBProxyHelpers.sol";

import { BaseScript } from "../shared/Base.s.sol";

/// @notice Bootstraps the proxy system by giving permission to an envoy and installing a plugin.
contract SetPermission is BaseScript {
function run(IPRBProxy proxy, IPRBProxyHelpers helpers, address target) public broadcaster {
// ABI encode the call to `setPermission`.
address envoy = vm.addr(vm.deriveKey(mnemonic, 1));
bool permission = true;
bytes memory data = abi.encodeCall(helpers.setPermission, (envoy, target, permission));

// Execute the call to the enshrined target.
proxy.execute(address(helpers), data);
}
}
2 changes: 1 addition & 1 deletion script/shared/Base.s.sol
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// SPDX-License-Identifier: BUSL-1.1
// SPDX-License-Identifier: MIT
pragma solidity >=0.8.18 <0.9.0;

import { Script } from "forge-std/Script.sol";
Expand Down

0 comments on commit 653127b

Please sign in to comment.