crytic / crytic/building-secure-contracts
The solution for the slither exercise 2 is not general enough
- 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
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