How to test nonReentrant modifier from ReentrancyGuard.sol

Hi, is there a straightforward way to write a hardhat chai test that verifies the nonReentrant modifier is working as expected in a function (correctly prevents reentrancy)? Is this test necessary and are there any best practices to follow in this case? Thanks.

There you go.

1 Like

Thanks. In this case I would create a new instance of

const attacker = await;

and use the attacker to call my function with the nonReentrant modifier?

This is removed, any reason? I need to test reentrancy on my contract

The new location of that file is here.