File tree Expand file tree Collapse file tree 2 files changed +59
-0
lines changed
Expand file tree Collapse file tree 2 files changed +59
-0
lines changed Original file line number Diff line number Diff line change 1+ // SPDX-License-Identifier: UNLICENSED
2+ pragma solidity ^ 0.8.23 ;
3+
4+ import {Script} from "forge-std/Script.sol " ;
5+
6+ import {IBytecodeRepository} from "@gearbox-protocol/permissionless/contracts/interfaces/IBytecodeRepository.sol " ;
7+ import {Domain} from "@gearbox-protocol/permissionless/contracts/libraries/Domain.sol " ;
8+
9+ contract AllowPublicContracts is Script {
10+ function run () external {
11+ string memory csvPath = vm.envString ("CSV_PATH " );
12+ IBytecodeRepository bcr = IBytecodeRepository (vm.envAddress ("BYTECODE_REPOSITORY " ));
13+
14+ vm.startBroadcast ();
15+ while (true ) {
16+ string memory line = vm.readLine (csvPath);
17+ if (bytes (line).length == 0 ) break ;
18+ string [] memory fields = vm.split (line, ", " );
19+
20+ bytes32 bytecodeHash = vm.parseBytes32 (fields[0 ]);
21+ bytes32 domain = Domain.extractDomain (bcr.getBytecode (bytecodeHash).contractType);
22+ if (bcr.isPublicDomain (domain)) bcr.allowPublicContract (bytecodeHash);
23+ }
24+ vm.stopBroadcast ();
25+ }
26+ }
Original file line number Diff line number Diff line change 1+ // SPDX-License-Identifier: UNLICENSED
2+ pragma solidity ^ 0.8.23 ;
3+
4+ import {Script} from "forge-std/Script.sol " ;
5+
6+ import {
7+ IBytecodeRepository,
8+ AuditReport
9+ } from "@gearbox-protocol/permissionless/contracts/interfaces/IBytecodeRepository.sol " ;
10+
11+ contract SubmitAuditReports is Script {
12+ function run () external {
13+ string memory csvPath = vm.envString ("CSV_PATH " );
14+ IBytecodeRepository bcr = IBytecodeRepository (vm.envAddress ("BYTECODE_REPOSITORY " ));
15+
16+ vm.startBroadcast ();
17+ while (true ) {
18+ string memory line = vm.readLine (csvPath);
19+ if (bytes (line).length == 0 ) break ;
20+ string [] memory fields = vm.split (line, ", " );
21+
22+ bytes32 bytecodeHash = vm.parseBytes32 (fields[0 ]);
23+ AuditReport memory auditReport = AuditReport ({
24+ auditor: vm.parseAddress (fields[1 ]),
25+ reportUrl: fields[2 ],
26+ signature: vm.parseBytes (fields[3 ])
27+ });
28+
29+ bcr.submitAuditReport (bytecodeHash, auditReport);
30+ }
31+ vm.stopBroadcast ();
32+ }
33+ }
You can’t perform that action at this time.
0 commit comments