This repository demonstrates the integration of Venn Firewall with the Zerolend protocol.
-
Clone this repository
-
Install dependencies:
npm i
-
Set up your environment variables (see Environment Setup)
-
Follow the deployment and execution flow below
./setup-test-env.sh
npx hardhat deploy --network holesky
This deploys the ZeroLend contracts to the network.
# Install Venn CLI globally
npm i -g @vennbuild/cli
Set up your environment variables and create venn.config.json (see Environment Setup) and (Venn Configuration)
venn enable --network holesky
Add the generated policy address to your venn.config.json under the "ApprovedCalls" field.
Use the Venn dApp SDK to execute transactions. See the Venn Documentation for more information.
The following files have been customized to incorporate Venn Firewall:
contracts/protocol/configuration/ACLManager.sol
contracts/protocol/configuration/PoolAddressesProvider.sol
contracts/protocol/configuration/PoolAddressesProviderRegistry.sol
contrracts/protocol/libraries/aave-upgradeability/BaseImmutableAdminUpgradeabilityProxy.sol
contracts/protocol/pool/Pool.sol
contracts/protocol/pool/PoolConfigurator.sol
contracts/protocol/tokenization/AToken.sol
contracts/protocol/tokenization/DelegationAwareAToken.sol
contracts/protocol/tokenization/StableDebtToken.sol
contracts/protocol/tokenization/VariableDebtToken.sol
contracts/protocol/tokenization/base/DebtTokenBase.sol
contracts/protocol/tokenization/base/IncentivizedERC20.sol
View example transactions demonstrating different scenarios of the integration on Holesky testnet:
-
Attempt without Venn dApp SDK
Transaction fails when trying to interact directly without the SDK
View on Etherscan -
Attempt with SDK but no approved calls
Transaction fails when using SDK but without proper call approvals
View on Etherscan
-
Call Approval
Successfully approving calls for the integration
View on Etherscan -
Supply Through Venn dApp SDK
Successful supply operation using properly configured Venn dApp SDK
View on Etherscan
Note: Successful transactions are only possible when:
- Necessary calls are properly approved
- Transactions are sent through the Venn dApp SDK
Create a .env
file in the contracts
directory with the following:
# Network
PRIVATE_KEY=your_private_key
USER_PRIVATE_KEY=your_user_private_key // for signing orders
RPC_URL=your_holesky_rpc_url
VENN_NODE_URL=venn_node_url
VENN_PRIVATE_KEY=your_venn_api_key // should be the same as deployer private key
Create a venn.config.json
file containing firewall configurations for:
{
"networks": {
"holesky": {
"Contract1": "...", // Contract1 address
"Contract2": "..." // Contract2 address
},
"ApprovedCalls": "..." // address of the deployed policy
}
}
- This is a demonstration project - test thoroughly before production use
- Ensure proper environment variables are set
- Monitor Venn Firewall logs for security alerts
- All transactions are executed through Venn's secure infrastructure
For any questions or support, reach out to our integrator on telegram - @x0b501e7e