Using Function Modifiers

Step By Step

  1. Install the Ironblocks CLI Tool into your project by running: npm install @ironblocks/cli

  2. From your project's root directory, run the Firewall Integration command: npx ib fw integ -d ./contracts

    1. fw integ runs the Integration command for the Firewall module of our tool

    2. -d ./contracts points to your smart contracts directory

  3. Running the command above will make the following changes in your project:

    1. Auto-Install the Firewall's dependencies

    2. Make your contracts inherit from FirewallConsumer

    3. Add the firewallProtected modifier to any external function (excluding view functions)

  4. That's it! Your smart contracts are now ready to use Ironblocks' Firewall.

Example

The following smart contract shows a typical integration of our Firewall into a consumer protocol:

Next Steps

Last updated