OpenZeppelin / OpenZeppelin/openzeppelin-upgrades

Show stacktrace for unsafe delegatecall/selfdestruct errors

Open
#762 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
658
Forks
286
PR merge metrics
No merged PRs in 30d

Description

If a contract directly or indirectly depends on some code that has a delegatecall or selfdestruct, the plugin gives an error like:

 Error: Contract `contracts/MyContract.sol:MyContract` is not upgrade safe

@openzeppelin/contracts/utils/Address.sol:191: Use of delegatecall is not allowed
    https://zpl.in/upgrades/error-002

It would be helpful to show a stacktrace including the line in MyContract and intermediate contracts that led to the unsafe code, so that the user can determine if they should fix the issue or add an ignore annotation.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start from the plugin's reporting path for unsafe delegatecall and selfdestruct errors, then trace how MyContract and intermediate contracts are analyzed. Done means the error includes the relevant contract stacktrace while still helping users choose between fixing the issue and adding an ignore annotation.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.