Non Reentrant
Overview
This policy prevents a consumer from re-entering the same method of a your smart contracts in a single transaction - which is a well-known attack vector called Reentrancy.
Protected Attack Vector
This policy protects agains reentrancy attacks.
How It Works
When a transaction reaches the policy, it keeps track of the fact that the consumer has visited the method currently being executed.
If the method is called again by the consumer before exiting, the policy will block the transaction.
If not, once the currently-executing method has finished, we clear the visitation count for the consumer.
Properties
Name | Type | Description |
---|---|---|
|
| a mapping of consumers that have visited the currently-executing method |
Security Lifecycle
This policy runs during both the Firewall's Pre Execution and the Post Execution hooks.
Source Code
On our GitHub repository: NonReentrantPolicy.sol
Last updated