This repository was archived by the owner on Mar 16, 2026. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathRevokeByRootAuthorized.s.sol
More file actions
36 lines (30 loc) · 1.51 KB
/
RevokeByRootAuthorized.s.sol
File metadata and controls
36 lines (30 loc) · 1.51 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
/*
* SPDX-FileCopyrightText: 2025 Black Cat Academy s. r. o.
* SPDX-License-Identifier: LicenseRef-BlackCat-Proprietary-1.0
*/
pragma solidity ^0.8.24;
import {BlackCatReleaseRegistryV1 as ReleaseRegistry} from "../src/ReleaseRegistry.sol";
import {FoundryVm} from "./FoundryVm.sol";
/// @notice Revoke a release by `root` via a relayer (EIP-712 signed by the registry owner).
/// @dev Usage:
/// 1) Set env:
/// - `PRIVATE_KEY` (relayer)
/// - `BLACKCAT_RELEASE_REGISTRY` (address)
/// - `BLACKCAT_RELEASE_ROOT` (bytes32; published root)
/// - `BLACKCAT_RELEASE_REVOKE_BY_ROOT_DEADLINE` (uint256; included in signed digest)
/// - `BLACKCAT_RELEASE_REVOKE_BY_ROOT_SIGNATURE` (bytes; signature by registry owner)
/// 2) Run:
/// - `forge script script/RevokeByRootAuthorized.s.sol:RevokeByRootAuthorized --rpc-url <RPC> --broadcast`
contract RevokeByRootAuthorized {
FoundryVm internal constant vm = FoundryVm(address(uint160(uint256(keccak256("hevm cheat code")))));
function run() external {
uint256 relayerPk = vm.envUint("PRIVATE_KEY");
address registry = vm.envAddress("BLACKCAT_RELEASE_REGISTRY");
bytes32 root = vm.envBytes32("BLACKCAT_RELEASE_ROOT");
uint256 deadline = vm.envUint("BLACKCAT_RELEASE_REVOKE_BY_ROOT_DEADLINE");
bytes memory signature = vm.envBytes("BLACKCAT_RELEASE_REVOKE_BY_ROOT_SIGNATURE");
vm.startBroadcast(relayerPk);
ReleaseRegistry(registry).revokeByRootAuthorized(root, deadline, signature);
vm.stopBroadcast();
}
}