-
-
Notifications
You must be signed in to change notification settings - Fork 48
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add "SetPermission" bootstrap script
docs: change license in BaseScript
- Loading branch information
Showing
2 changed files
with
21 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters