Open pegahcarter opened 2 weeks ago
May I work on this issue?
great idea, @pegahcarter. perhaps we could add a new modifier (e., nonreentrant()
) to the library that allows for transient reentrancy protection as you described. @ShubhSensei you can definitely make a PR!
@0xfuturistic There are 2 ways to do it
1) Modify the current modifier in the TransientReentrancyAware
by using a transient lock with a specific key
increment
and decrement
functions have to be deleted2) Make a new modifier in the TransientContext
contract itself
what should I do?
@ShubhSensei let's keep everything as-is and add this feature as a new modifier (2).
agreed with you @pegahcarter, and thanks for the PR @ShubhSensei! just left a comment re:tests
The current solution is a minimal reentrant modifier with some get/set helpers. With the state of the code today, a project which imports this repo would be required to add a few LoC to properly protect against reentrancy.
I propose implementing something similar to https://soliditylang.org/blog/2024/01/26/transient-storage/ to give inheritance flexibility in locking functions with particular keys. This should work similarly to how vyper provides reentrancy protection.