Skip to content

Commit af20940

Browse files
committed
Add GrantRegisterRole script
1 parent 5ba88b6 commit af20940

1 file changed

Lines changed: 32 additions & 0 deletions

File tree

script/GrantRegisterRole.s.sol

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
// SPDX-License-Identifier: MIT
2+
pragma solidity ^0.8.29;
3+
4+
import {Script} from "forge-std/Script.sol";
5+
import {console} from "forge-std/console.sol";
6+
import {ERC1967Proxy} from "openzeppelin-contracts/proxy/ERC1967/ERC1967Proxy.sol";
7+
8+
import {BuilderCodes} from "../src/BuilderCodes.sol";
9+
10+
/// @notice Script for granting a Builder Codes register role to an account
11+
contract GrantRegisterRole is Script {
12+
// production
13+
// BuilderCodes public builderCodes = BuilderCodes(0x000000BC7E6457e610fe52Dcc0ca5b3ce59C8E80);
14+
15+
// development
16+
BuilderCodes public builderCodes = BuilderCodes(0xf20b8A32C39f3C56bBD27fe8438090B5a03b6381);
17+
18+
function run() external {
19+
vm.startBroadcast();
20+
21+
bytes32 role = builderCodes.REGISTER_ROLE();
22+
address account = 0x6Bd08aCF2f8839eAa8a2443601F2DeED892cd389; // Spindl dev server wallet
23+
24+
builderCodes.grantRole(role, account);
25+
26+
assert(builderCodes.hasRole(role, account));
27+
28+
console.log("Granted REGISTER_ROLE to", account);
29+
30+
vm.stopBroadcast();
31+
}
32+
}

0 commit comments

Comments
 (0)