File tree Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Original file line number Diff line number Diff line change 11#!/usr/bin/env python3
22
3+ import argparse
34import copy
45import json
56import re
67import subprocess
78from enum import Enum as PyEnum
9+ from pathlib import Path
810from typing import Callable
911from urllib import request
1012
2628
2729
2830def 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 ()
3041 contract = Cheatcodes .from_json (json_str )
3142
3243 ccs = contract .cheatcodes
You can’t perform that action at this time.
0 commit comments