Skip to content

Commit

Permalink
Merge pull request #384 from crytic/dev-contract-summary-fix
Browse files Browse the repository at this point in the history
Fix contract summary printer bug
  • Loading branch information
montyly authored Dec 10, 2019
2 parents de0f437 + 40c5ea3 commit e5717ea
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions slither/printers/summary/contract.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,8 @@ def output(self, _filename):

# Order the function with
# contract_declarer -> list_functions
public = [(f.contract_declarer.name, f) for f in c.functions if (not f.is_shadowed)]
public = [(f.contract_declarer.name, f) for f in c.functions if (not f.is_shadowed and
not f.is_constructor_variables)]
collect = collections.defaultdict(list)
for a, b in public:
collect[a].append(b)
Expand All @@ -61,14 +62,14 @@ def output(self, _filename):

for function in functions:
if function.visibility in ['external', 'public']:
txt += green(" - {} ({})\n".format(function, function.visibility))
txt += green(" - {} ({})\n".format(function.full_name, function.visibility))
if function.visibility in ['internal', 'private']:
txt += magenta(" - {} ({})\n".format(function, function.visibility))
txt += magenta(" - {} ({})\n".format(function.full_name, function.visibility))
if function.visibility not in ['external', 'public', 'internal', 'private']:
txt += " - {}  ({})\n".format(function, function.visibility)
txt += " - {}  ({})\n".format(function.full_name, function.visibility)

additional_fields.add(function, additional_fields={"visibility":
function.visibility,})
function.visibility})

all_contracts.append((c, additional_fields.data))

Expand Down

0 comments on commit e5717ea

Please sign in to comment.