Skip to content

Commit 0e8d23d

Browse files
committed
Slither exercise 1 fixed
1 parent 0a764bb commit 0e8d23d

File tree

1 file changed

+3
-2
lines changed
  • program-analysis/slither/exercises/exercise1

1 file changed

+3
-2
lines changed

program-analysis/slither/exercises/exercise1/solution.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
if coin in contract.inheritance:
1010
# Get the function definition
1111
mint = contract.get_function_from_signature('_mint(address,uint256)')
12-
# If the function was not declarer by coin, there is a bug !
13-
if mint.contract != coin:
12+
# If the function was not declared by coin, there is a bug !
13+
# Detect error only for contracts overriding the '_mint' function
14+
if mint.contract_declarer == contract:
1415
print(f'Error, {contract} overrides {mint}')

0 commit comments

Comments
 (0)