Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Status update missing prompt #11

Open
mingbaile opened this issue Mar 1, 2025 · 1 comment
Open

Status update missing prompt #11

mingbaile opened this issue Mar 1, 2025 · 1 comment
Assignees

Comments

@mingbaile
Copy link

Hi, we are a research group on programming languages and software engineering. We recently conducted a systematic study on the causes, effects, and fixes of the inconsistent state update vulnerability in solidity. We are attempting to build a tool to detect bugs about state updates based on our findings. We have tried our prototype tool on some popular Github solidity repositories, and for your repository, we found that there are status updates that may have been missed.
When we declare a state variable in a contract, if the variable is not reassigned throughout the project, then it may be a missing status update, including the balance, order number, counter, contract status flag, and so on.
For your repository, we found the following state variables that may need attention:

CarbonOffsetBatchesStorage.sol
State variable: DEPRECATED_URIs, DEPRECATED_VERIFIERS

    mapping(string => bool) private DEPRECATED_URIs;
    mapping(address => bool) private DEPRECATED_VERIFIERS;

PoolStorage.sol
State variable: DEPRECATED_regions, DEPRECATED_standards, DEPRECATED_methodologies

    mapping(string => bool) private DEPRECATED_regions;
    //slither-disable-next-line constable-states
    mapping(string => bool) private DEPRECATED_standards;
    //slither-disable-next-line constable-states
    mapping(string => bool) private DEPRECATED_methodologies;

Do you find our results useful? Your reply and invaluable suggestions would be greatly appreciated, and are vital for improving our tool. Thanks a lot for your time!

@aspiers
Copy link
Member

aspiers commented Mar 1, 2025

Hey @mingbaile, interesting work on this tool. As you can see from the findings here, all of the unused variables are deprecated, so this is something we were already aware of. The variables cannot be removed because we have to preserve storage layout during upgrades for backwards compatibility. So I think your tool should incorporate a mechanism for taking this type of scenario into account, in order to avoid these false positives.

@aspiers aspiers added the Type: tech debt label Mar 1, 2025 — with Linear
@aspiers aspiers self-assigned this Mar 1, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants