This repository contains Solidity contracts implementing ERC3156 Flash Loans along with tests.
This contract implements a simple ERC20 token named MyStableToken with the symbol USDM and an initial supply of 1,000,000 tokens.
This contract acts as a lender for MyStableToken. It provides functions to lend tokens to borrowers and retrieve tokens from borrowers.
This contract represents a borrower for MyStableToken. It interacts with FlashLender to borrow tokens, perform actions depending on data, and return the borrowed tokens.
- Deploy the contracts to a Ethereum-compatible blockchain network.
- Interact with the contracts using Ethereum wallets or scripts.
- Ensure that appropriate permissions and allowances are set for borrowing and lending tokens.
- Follow the ERC3156 standard for flash loan execution.
To run tests, you'll need Hardhat and a development blockchain environment set up. Follow these steps:
- Install dependencies:
npm install
- Compile contracts:
npx hardhat compile
- Run tests:
npx hardhat test
Ensure all tests pass before deploying the contracts to a live network.
This project is licensed under the MIT License - see the LICENSE file for details.