Skip to content

bug(lint): unwrap modifier doesn't handle var assignments properly #12724

@0xrusowsky

Description

@0xrusowsky

Component

Forge

Have you ensured that all of these are up to date?

  • Foundry
  • Foundryup

What version of Foundry are you on?

No response

What version of Foundryup are you on?

No response

What command(s) is the bug in?

No response

Operating System

None

Describe the bug

repro:

           - modifier payMeSubsidizedGas(uint256 amount) {
           -     uint256 pre = gasLeft();
           -     _;
           -     _payMeSubsidizedGasAfter(pre, amount);
           - }
           + modifier payMeSubsidizedGas(uint256 amount) {
           +     _payMeSubsidizedGas(amount);
           +     _;
           + }
           + 
           + function _payMeSubsidizedGas(uint256 amount) internal {
           +     uint256 pre = gasLeft();
           + }

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

Status

Backlog

Relationships

None yet

Development

No branches or pull requests

Issue actions