|
|
@ -1,9 +1,9 @@ |
|
|
|
import os |
|
|
|
|
|
|
|
import logging |
|
|
|
import logging |
|
|
|
import argparse |
|
|
|
import argparse |
|
|
|
import sys |
|
|
|
import sys |
|
|
|
|
|
|
|
|
|
|
|
from slither import Slither |
|
|
|
from slither import Slither |
|
|
|
|
|
|
|
from crytic_compile import cryticparser |
|
|
|
|
|
|
|
|
|
|
|
from .compare_variables_order import compare_variables_order_implementation, compare_variables_order_proxy |
|
|
|
from .compare_variables_order import compare_variables_order_implementation, compare_variables_order_proxy |
|
|
|
from .compare_function_ids import compare_function_ids |
|
|
|
from .compare_function_ids import compare_function_ids |
|
|
@ -28,7 +28,8 @@ def parse_args(): |
|
|
|
|
|
|
|
|
|
|
|
parser.add_argument('--new-version', help='New implementation filename') |
|
|
|
parser.add_argument('--new-version', help='New implementation filename') |
|
|
|
parser.add_argument('--new-contract-name', help='New contract name (if changed)') |
|
|
|
parser.add_argument('--new-contract-name', help='New contract name (if changed)') |
|
|
|
parser.add_argument('--solc', help='solc path', default='solc') |
|
|
|
|
|
|
|
|
|
|
|
cryticparser.init(parser) |
|
|
|
|
|
|
|
|
|
|
|
if len(sys.argv) == 1: |
|
|
|
if len(sys.argv) == 1: |
|
|
|
parser.print_help(sys.stderr) |
|
|
|
parser.print_help(sys.stderr) |
|
|
@ -40,11 +41,11 @@ def main(): |
|
|
|
args = parse_args() |
|
|
|
args = parse_args() |
|
|
|
|
|
|
|
|
|
|
|
proxy_filename = vars(args)['proxy.sol'] |
|
|
|
proxy_filename = vars(args)['proxy.sol'] |
|
|
|
proxy = Slither(proxy_filename, solc=args.solc, disable_solc_warnings=True, truffle_ignore_compile=True, embark_ignore_compile=True) |
|
|
|
proxy = Slither(proxy_filename, **vars(args)) |
|
|
|
proxy_name = args.ProxyName |
|
|
|
proxy_name = args.ProxyName |
|
|
|
|
|
|
|
|
|
|
|
v1_filename = vars(args)['implem.sol'] |
|
|
|
v1_filename = vars(args)['implem.sol'] |
|
|
|
v1 = Slither(v1_filename, solc=args.solc, disable_solc_warnings=True, truffle_ignore_compile=True, embark_ignore_compile=True) |
|
|
|
v1 = Slither(v1_filename, **vars(args)) |
|
|
|
v1_name = args.ContractName |
|
|
|
v1_name = args.ContractName |
|
|
|
|
|
|
|
|
|
|
|
check_initialization(v1) |
|
|
|
check_initialization(v1) |
|
|
@ -53,7 +54,7 @@ def main(): |
|
|
|
compare_function_ids(v1, v1_name, proxy, proxy_name) |
|
|
|
compare_function_ids(v1, v1_name, proxy, proxy_name) |
|
|
|
compare_variables_order_proxy(v1, v1_name, proxy, proxy_name) |
|
|
|
compare_variables_order_proxy(v1, v1_name, proxy, proxy_name) |
|
|
|
else: |
|
|
|
else: |
|
|
|
v2 = Slither(args.new_version, solc=args.solc, disable_solc_warnings=True, truffle_ignore_compile=True, embark_ignore_compile=True) |
|
|
|
v2 = Slither(args.new_version, **vars(args)) |
|
|
|
v2_name = v1_name if not args.new_contract_name else args.new_contract_name |
|
|
|
v2_name = v1_name if not args.new_contract_name else args.new_contract_name |
|
|
|
check_initialization(v2) |
|
|
|
check_initialization(v2) |
|
|
|
compare_function_ids(v2, v2_name, proxy, proxy_name) |
|
|
|
compare_function_ids(v2, v2_name, proxy, proxy_name) |
|
|
|