Building A Cross-Chain Borrow Lend Application

This repository contains solidity contracts (Hub.sol and Spoke.sol) that - if the Hub contract is deployed onto one chain and the Spoke contract is deployed onto many chains - form a fully working cross-chain borrow lending application!

caveat: Demo/example purposes only - there are many things missing from this implementation that would be crucial for a real borrow lending protocol

Getting Started

Included in this repository is:

  • Example Solidity Code
  • Example Forge local testing setup
  • Testnet Deploy Scripts
  • Example Testnet testing setup

Environment Setup

Testing Locally

npm run build
forge test

Deploying to Testnet

You will need a wallet with some testnet AVAX and testnet CELO.

EVM_PRIVATE_KEY=your_wallet_private_key npm run deploy

Testing on Testnet

You will need a wallet with some testnet AVAX and testnet CELO - see above section for links to obtain this.

You must have also deployed contracts onto testnet (as described in the above section).

To test the cross chain borrow lending application, execute the test as such:

EVM_PRIVATE_KEY=your_wallet_private_key npm run test

WARNING: This repository has not been audited, so it may contain bugs and should be used for example purposes only. If you intend to use or build on this example to perform actual lending, it's highly recommended that you have the final code commit audited by a smart contract auditing firm.