Skip to content

This repository contains the core smart contracts of the ZeroLend protocol.

License

Notifications You must be signed in to change notification settings

ironblocks/zero-lend-core-contracts

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🛡️ Zerolend + Venn Firewall Integration Demo

This repository demonstrates the integration of Venn Firewall with the Zerolend protocol.

🚀 Quick Start

  1. Clone this repository

  2. Install dependencies:

    npm i
  3. Set up your environment variables (see Environment Setup)

  4. Follow the deployment and execution flow below

🔄 Deployment and Execution Flow

1. Deploy Contracts

./setup-test-env.sh
npx hardhat deploy --network holesky

This deploys the ZeroLend contracts to the network.

2. Set up Venn CLI and Environment

# 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)

3. Enable Venn Policy

venn enable --network holesky

Add the generated policy address to your venn.config.json under the "ApprovedCalls" field.

4. Execute Transactions

Use the Venn dApp SDK to execute transactions. See the Venn Documentation for more information.

📁 Modified Files with Venn Integration

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

🔗 Example Transactions (Holesky Testnet)

View example transactions demonstrating different scenarios of the integration on Holesky testnet:

Failed Transactions

  1. Attempt without Venn dApp SDK
    Transaction fails when trying to interact directly without the SDK
    View on Etherscan

  2. Attempt with SDK but no approved calls
    Transaction fails when using SDK but without proper call approvals
    View on Etherscan

Successful Transactions

  1. Call Approval
    Successfully approving calls for the integration
    View on Etherscan

  2. 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

⚙️ Environment Setup

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

🔐 Venn Configuration

Create a venn.config.json file containing firewall configurations for:

{
  "networks": {
    "holesky": {
        "Contract1": "...", // Contract1 address
        "Contract2": "..." // Contract2 address
    },
    "ApprovedCalls": "..." // address of the deployed policy
  }
}

📚 Resources

⚠️ Important Notes

  • 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

📧 Contact

For any questions or support, reach out to our integrator on telegram - @x0b501e7e

About

This repository contains the core smart contracts of the ZeroLend protocol.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • TypeScript 59.5%
  • Solidity 40.3%
  • Other 0.2%