Installation
Overview
To protect your protocols with Venn, you'll need the to:
Make sure you've integrated the Firewall SDK with your smart contracts
Registered your smart contracts onchain with Venn
Install the DApp SDK on your Frontend
We've build tools and SDKs to streamline each of these steps, providing the ultimate developer experience without compromising security.
Quick Setup
1. Venn CLI
To kick things off, start by installing the Venn CLI by running:
You will use this CLI to add the Firewall SDK to your smart contracts, as well as register your smart contracts onchain with Venn.
The CLI will make the venn
command available globally.
2. Firewall SDK
This integration will add the Firewall SDK to your smart contracts, making sure that they import the relevant modifiers, and apply the modifiers on external functions.
Run the following command from the root folder of your project:
This command will scan all your smart contracts under the contracts
folder, and add an import of the VennFirewallConsumer
Firewall SDK.
Before
After
Now that your smart contracts include the Firewall SDK, deploy them as you normally would onto any network, and you're ready to move on to registering them onchain with Venn.
3. Register With Venn
This step will connect your Firewall protected smart contracts to the Venn Network onchain. It does this by sending setup transactions onchain to register your smart contracts with Venn.
Before You Begin
Make sure your smart contracts are deployed and that you have completed the Firewall SDK setup above
You will need your private key for this step
Configuration
Create a new file called
venn.config.json
Add the following configuration snippet to it:
Each key in the
contracts
object is the Name of the contractEach value in the
contracts
object is the Address of the contract
Create a new environment variable called
VENN_PRIVATE_KEY
with the private key that deployed your smart contracts
IMPORTANT: This key must be the same key that deployed the smart contracts
Connect To Venn
Run the following command to connect your Firewall protected smart contracts to Venn:
Your Venn Policy
After successfully connecting to Venn, a new Venn Security Policy will have been created for you.
The address of the policy will be saved in venn.config.json
:
You will use the policyAddress
in the next step when setting up your DApp Frontend
4. DApp SDK
Now that your smart contracts are protected by Venn, only approved transactions can be executed onchain.
Setup
To streamline the process of approving transactions from a DApp Frontend, install the DApp SDK:
Create An Instance
vennURL:
a URL pointing to a Venn node operatorvennPolicyAddress
: the policyAddress you got from the "Register With Venn" step above
Approving Transactions
Reference Documentation
Last updated