I get the strange EvmError: NotActivated when I put the nonReentrant modifier, like the OZ one, on the fallback function. I need it there because I am working with Diamond Proxies which redirect all the logic to the fallback.

I tried messing around a little, and I spotted that this error comes when the modifier sets the status flag to ENTERED before the function begins, i.e. here. When I removed this line, the fallback worked just fine, but it's not reentrancy protected via the guard.

Any thoughts or ideas why this happens?

Edit: I recognized that this happens more generally when modifying any variable in the fallback function. I added a simple counter to my contract and the execution fails on counter++.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.