crytic / crytic/slither

slither-read-storage: add support for nested structs

Open
#2,077 1 comment 0 reactions 0 assignees View on GitHub
enhancement good first issue
Dominant language
Python
Stars
6.4k
Forks
1.1k
PR merge metrics
No merged PRs in 30d

Description

For example: https://github.com/OpenZeppelin/openzeppelin-contracts-upgradeable/blob/e6e6d73c6219a9e436cdc91ac4f943c7699831c0/contracts/utils/structs/EnumerableSetUpgradeable.sol#L233-L235

This needs to be updated to calculate the slot for `UserDefinedType`
https://github.com/crytic/slither/blob/3f90e86badfa956b5cc692e0421c2b8065c31d43/slither/tools/read_storage/read_storage.py#L593

Test case `slither-read-storage bsc:0x52Dcd80506bc421cae6927C73f306FD0d083e43a`

Contributor guide

Open the contributing guide

Research direction

Start in slither/tools/read_storage/read_storage.py around line 593 and inspect how slot calculation handles UserDefinedType. Run `slither-read-storage bsc:0x52Dcd80506bc421cae6927C73f306FD0d083e43a` as the test case; done means nested structs are supported and the command produces the expected storage reads.

Written by the indexing model from the issue text.

Assessment

Tech stack
python, solidity
Domain
cli, tooling
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.