slither icon indicating copy to clipboard operation
slither copied to clipboard

[Bug-Candidate]: custom errors in require statements trigger error when used inside a modifier

Open Sergei-Liakh opened this issue 1 year ago • 1 comments

Describe the issue:

Custom errors within require statements work correctly when used inside functions, but they trigger an error when placed inside a modifier.

Code example to reproduce the issue:

pragma solidity 0.8.27;

error SomeError();

contract Test {
    modifier onlySomething() {
        require(false, SomeError());
        _;
    }
}

Version:

0.10.4

Relevant log output:

ERROR:ContractSolcParsing:Missing modifier Variable not found: require(bool,error) (context Test src/Test.sol#5-11 (1 - 0))

Sergei-Liakh avatar Oct 21 '24 10:10 Sergei-Liakh

Support for custom errors in a require statement has been added in https://github.com/crytic/slither/pull/2550. It's merged in the dev branch and will be in the next slither release. If you need it right now please use slither from the dev branch.

smonicas avatar Oct 21 '24 11:10 smonicas

Support for custom errors in a require statement has been added in #2550. It's merged in the dev branch and will be in the next slither release. If you need it right now please use slither from the dev branch.

When's the official release coming? It's been a while.

igorroncevic avatar Dec 16 '24 11:12 igorroncevic