File tree 1 file changed +12
-1
lines changed
1 file changed +12
-1
lines changed Original file line number Diff line number Diff line change 1
1
#!/usr/bin/env python3
2
2
3
+ import argparse
3
4
import copy
4
5
import json
5
6
import re
6
7
import subprocess
7
8
from enum import Enum as PyEnum
9
+ from pathlib import Path
8
10
from typing import Callable
9
11
from urllib import request
10
12
26
28
27
29
28
30
def main ():
29
- json_str = request .urlopen (CHEATCODES_JSON_URL ).read ().decode ("utf-8" )
31
+ parser = argparse .ArgumentParser (
32
+ description = "Generate Vm.sol based on the cheatcodes json created by Foundry" )
33
+ parser .add_argument (
34
+ "--from" ,
35
+ metavar = "PATH" ,
36
+ dest = "path" ,
37
+ required = False ,
38
+ help = "path to a json file containing the Vm interface, as generated by Foundry" )
39
+ args = parser .parse_args ()
40
+ json_str = request .urlopen (CHEATCODES_JSON_URL ).read ().decode ("utf-8" ) if args .path is None else Path (args .path ).read_text ()
30
41
contract = Cheatcodes .from_json (json_str )
31
42
32
43
ccs = contract .cheatcodes
You can’t perform that action at this time.
0 commit comments