This project implements a decentralized finance (DeFi) protocol with a focus on token creation, lending, borrowing, and staking. The project consists of three main smart contracts: MyToken
, ConcreteLendingBorrowing
, and ConcreteStaking
.
The DeFi Protocol allows users to mint tokens, lend and borrow assets, and participate in staking to earn rewards. The protocol is built using Solidity and follows best practices in smart contract development.
- Token Minting: Users can buy
MyToken
using Ether (ETH). - Lending and Borrowing: Users can deposit tokens to earn interest or take loans against their deposits.
- Staking: Users can stake tokens to earn rewards over time.
This is an ERC20 token with an initial supply of 1,000,000 tokens. The contract allows users to buy tokens with ETH.
This contract enables users to deposit tokens to earn interest and take loans. It inherits from an abstract LendingBorrowing
contract and implements all necessary methods.
This contract allows users to stake tokens and earn rewards. It inherits from an abstract Staking
contract and implements all necessary methods.
To deploy the smart contracts to the Sepolia testnet, follow these steps:
-
Install Truffle and dependencies:
npm install -g truffle npm install
-
Configure the
truffle-config.js
file with your Alchemy API key and private key. -
Compile and deploy the contracts:
truffle compile truffle migrate --network sepolia
- Interact with the deployed contracts using a web3 provider (e.g., MetaMask).
- Use the provided frontend (if available) or directly interact with the contracts via a script or Truffle console.
-
Clone the repository:
git clone https://github.com/llakterian/DeFi_Protocol.git cd DeFi_Protocol
-
Install dependencies:
npm install
-
Run tests:
truffle test
Contributions are welcome! Please open an issue or submit a pull request for any improvements or new features.
This project is licensed under the MIT License. See the LICENSE file for details.