Firewall Documentation
Home
  • Overview
  • Quick Start
    • Using Function Modifiers
    • Using Proxy Patterb
  • Concepts
  • Configuration
    • Governance
    • Firewall Configuration
    • Policy Administration
  • How It Works
  • Smart Contracts
    • Firewall.sol
    • FirewallConsumer.sol
    • FirewallProxyAdmin.sol
    • FirewallTransparentUpgradableProxy.sol
  • Policies
    • Admin Notary
    • Whitelist
    • Approved Calls
    • Approved Patterns
    • Balance Guard
    • EOA Only
    • Method Block
    • Custom Protector
    • Non Reentrant
    • Combined Policies
  • Addresses
  • Glossary
  • Support
  • FAQ
Powered by GitBook
On this page
  • Overview
  • Protected Attack Vector
  • How It Works
  • Properties
  • Security Lifecycle
  • Source Code
  1. Policies

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

  1. When a transaction reaches the policy, it keeps track of the fact that the consumer has visited the method currently being executed.

  2. If the method is called again by the consumer before exiting, the policy will block the transaction.

  3. If not, once the currently-executing method has finished, we clear the visitation count for the consumer.

Properties

Name
Type
Description

hasEnteredConsumer

mapping

(address => bool)

a mapping of consumers that have visited the currently-executing method

Security Lifecycle

Source Code

PreviousCustom ProtectorNextCombined Policies

Last updated 11 months ago

This policy runs during both the Firewall's and the hooks.

On our GitHub repository:

NonReentrantPolicy.sol
Pre Execution
Post Execution