crytic / crytic/building-secure-contracts

The solution for the slither exercise 2 is not general enough

Open
#12 0 comments 0 reactions 0 assignees View on GitHub
question Slither
Dominant language
Solidity
Stars
2.5k
Forks
391
PR merge metrics
No merged PRs in 30d

Description

The [proposed solution](https://github.com/crytic/building-secure-contracts/blob/master/program-analysis/slither/exercises/exercise2/solution.py) fails to work when there is a modifier shadowing (which solidity does not report). To avoid this, could be a good idea to use `canonical_name` of the modifier (`'Owned.onlyOwner()'`), instead of the `full_name`.

Contributor guide

Open the contributing guide

Research direction

Open program-analysis/slither/exercises/exercise2/solution.py and locate where the modifier full_name is used. Compare that lookup with the issue's canonical_name example, then verify the solution against a modifier-shadowing case in the exercise. Done means the exercise 2 solution handles shadowed modifiers without breaking the existing case.

Written by the indexing model from the issue text.

Assessment

Tech stack
solidity
Domain
security
Issue type
Bug
Difficulty
1/5
Estimated time
Under an hour
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.