Skip to content

Commit

Permalink
Remove header, update version.
Browse files Browse the repository at this point in the history
  • Loading branch information
palkeo committed Feb 17, 2020
1 parent bf23468 commit 568f9d3
Showing 1 changed file with 8 additions and 17 deletions.
25 changes: 8 additions & 17 deletions panoramix.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
from pano.contract import Contract
from pano.prettify import pprint_trace, pretty_type, pprint_repr, explain

VER = '4 Oct 2019'
VER = '17 Feb 2020'

addr_shortcuts = {
'kitties': '0x06012c8cf97BEaD5deAe237070F9587f8E7A266d',
Expand Down Expand Up @@ -147,8 +147,8 @@ def decompile(this_addr, only_func_name=None):
Function class constructor figures out it's kind (e.g. read-only, getter, etc),
and some other things.
contract = Contract(addr=this_addr,
network=loader.network,
contract = Contract(addr=this_addr,
network=loader.network,
ver=VER,
problems=problems,
functions=functions)
Expand All @@ -159,13 +159,13 @@ def decompile(this_addr, only_func_name=None):
Figures out storage structure (you have to do it for the whole contract at once, not function by function)
And folds the trace (that is, changes series of ifs into simpler forms)
Finally...
loader.disasm() -- contains disassembled version
contract.json() -- contains json version of the contract
Decompiled, human-readable version of the contract is done within this .py file,
Decompiled, human-readable version of the contract is done within this .py file,
starting from `with redirect_stdout...`
Expand Down Expand Up @@ -211,7 +211,7 @@ def decompile(this_addr, only_func_name=None):

if '--silent' not in sys.argv:
print(open(this_fname).read())

return

'''
Expand Down Expand Up @@ -284,8 +284,8 @@ def dec():
'''

contract = Contract(addr=this_addr,
network=loader.network,
contract = Contract(addr=this_addr,
network=loader.network,
ver=VER,
problems=problems,
functions=functions)
Expand Down Expand Up @@ -326,15 +326,6 @@ def dec():

print(C.gray+"#")
print(f"# Panoramix {VER} ")

if loader.network != 'mainnet':
pretty_addr = f"{C.end + C.okgreen}{loader.network}:{loader.addr}{C.end + C.gray}"
else:
pretty_addr = f'{C.end}{loader.addr}{C.gray}'

print("# Decompiled source of "+pretty_addr)
print("# ")
print("# Let's make the world open source ")
print("# " + C.end)

if len(problems)>0:
Expand Down

0 comments on commit 568f9d3

Please sign in to comment.