Skip to content

Commit a9d4593

Browse files
committed
fea: add BatchManagementUtils deploy scripts
1 parent e1967cc commit a9d4593

1 file changed

Lines changed: 44 additions & 0 deletions

File tree

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
pragma solidity ^0.8.10;
2+
3+
import { Script, console } from "forge-std/Script.sol";
4+
import { ERC1967Proxy } from "@openzeppelin/contracts/proxy/ERC1967/ERC1967Proxy.sol";
5+
import { BatchManagementUtils } from "../../../contracts/utils/BatchManagementUtils.sol";
6+
7+
contract BatchManagementUtilsDeploy is Script {
8+
address admin = 0x07D274a68393E8b8a2CCf19A2ce4Ba3518735253;
9+
address manager = 0x8d388136d578dCD791D081c6042284CED6d9B0c6;
10+
address distributor1 = 0x81a62B329CC8939494d8613F614171a9955A46e8;
11+
address distributor2 = 0x8b7d334d243b74D63C4b963893267A0F5240F990;
12+
13+
function run() public {
14+
uint256 deployerPrivateKey = vm.envUint("PRIVATE_KEY");
15+
address deployer = vm.addr(deployerPrivateKey);
16+
console.log("Deployer: ", deployer);
17+
vm.startBroadcast(deployerPrivateKey);
18+
19+
// Deploy implementation
20+
BatchManagementUtils impl = new BatchManagementUtils();
21+
console.log("Implementation: ", address(impl));
22+
23+
ERC1967Proxy proxy = new ERC1967Proxy(
24+
address(impl),
25+
abi.encodeWithSelector(impl.initialize.selector, deployer, deployer)
26+
);
27+
28+
console.log("Proxy: ", address(proxy));
29+
30+
BatchManagementUtils batchManagementUtils = BatchManagementUtils(address(proxy));
31+
32+
batchManagementUtils.setDistributor(distributor1, true);
33+
batchManagementUtils.setDistributor(distributor2, true);
34+
35+
batchManagementUtils.grantRole(batchManagementUtils.DEFAULT_ADMIN_ROLE(), admin);
36+
batchManagementUtils.grantRole(batchManagementUtils.MANAGER(), manager);
37+
38+
batchManagementUtils.revokeRole(batchManagementUtils.MANAGER(), deployer);
39+
batchManagementUtils.grantRole(batchManagementUtils.DEFAULT_ADMIN_ROLE(), deployer);
40+
41+
console.log("Deployment and setup complete.");
42+
vm.stopBroadcast();
43+
}
44+
}

0 commit comments

Comments
 (0)