The smart contracts for the Folks Finance Cross-Chain Lending Protocol.
The repository uses both Hardhat and Foundry.
To setup:
- Clone the repo
- Run
npm install
- Run
forge install
To build:
- (Optional) run
npm run clean
- Run
npm run build
The smart contracts are split into 4 distinct folders:
contracts/bridge
contains all the smart contracts relating to sending messages (data and token) between the spoke chains and hub chain. Unless named specifically, they are deployed both in the spoke chains and hub chain.contracts/hub
contains the smart contracts relating to the core business logic of the protocol. They are deployed only in the hub chain.contracts/oracle
contains the smart contracts relating to the oracle for token price information. They are deployed only in the hub chain.contracts/spoke
contains the smart contracts relating to the user entry point into the protocol. They are deployed only in the spoke chains (the hub chain may also be a spoke chain).
Within each you can also find test
folder which contains smart contracts used for testing. These are not part of the protocol and won't be deployed.
To run all tests npm run test
.
To run specific tests npm run test ${PATH_TO_FILE}
.
If there is a license in a sub folder e.g. at /contracts/oracle
then that applies for all files under it, otherwise refer to the license in the root folder.