FirewallConsumer.sol

A parent contract (i.e. you inherit from this contract) which enables your smart contracts to become a Firewall Consumer.

For usage example, please see our Using Function Modifiers guide.

Properties

NameTypeDescription

firewallAdmin

address

the address of the Firewall Admin that manages this Firewall Consumer

Modifiers

onlyFirewallAdmin()

Only allows the modified function to run if it was called by the Firewall Admin (see setFirewallAdmin()) .

firewallProtected()

Protects the modified function, so that any calls to it would go through the Firewall's Pre Execution and Post Execution hooks.

firewallProtectedCustom(bytes memory data)

For cases where you want to use policies that provide advanced inspections based on custom data you pass to it, which may differ from msg.data. All calls to modified functions will go through Firewall's Pre Execution and Post Execution hooks.

firewallProtectedSigHash(bytes4 selector)

Designed for policies that track and protect calls to internal functions, use this modifier by passing in the function's signature hash.All calls to the modified function will go through the Firewall's Pre Execution and Post Execution hooks.

invariantProtected()

Coupled with our Private Invariants Policy, this modifier will allow the policy to check for changes in the state of internal data that is controlled / updated when the modified function is called. Any calls to the modified function will go through the Firewall's Pre Execution and Post Execution hooks.

Methods

setFirewall()

function setFirewall(address _firewall)

Callable only by the Firewall Admin, changes the address of the Firewall that will be used by this Firewall Consumer.

Parameter NameTypeDescription

_firewall

address

the new Firewall address

setFirewallAdmin()

function setFirewallAdmin(address _firewallAdmin)

Callable only by the Firewall Admin, it changes the address of the Firewall Admin who manages the Firewall.

Parameters NameTypeDescription

_firewallAdmin

address

the new Firewall Admin address

Source Code

On our GitLab repository: FirewallConsumer.sol

Last updated