From 570831d290c66c88da98a32300a10d58644b9310 Mon Sep 17 00:00:00 2001 From: Tom Rpl Date: Tue, 5 Dec 2023 15:51:42 +0100 Subject: [PATCH] feat(readme): adding readme and License --- LICENSE | 21 +++++++++++ README.md | 104 ++++++++++++++++++++++++++++++++---------------------- 2 files changed, 82 insertions(+), 43 deletions(-) create mode 100644 LICENSE diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..b373e29 --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2016 + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. \ No newline at end of file diff --git a/README.md b/README.md index 9265b45..412a8dd 100644 --- a/README.md +++ b/README.md @@ -1,66 +1,84 @@ -## Foundry +# Morpho-Blue snippets -**Foundry is a blazing fast, portable and modular toolkit for Ethereum application development written in Rust.** +## Typescript & Solidity based snippets related to Morpho Protocols. -Foundry consists of: +IMPORTANT +This repository contains smart contracts that have been developed for educational, experimental, or demonstration purposes only. By using or interacting with these smart contracts, you acknowledge and accept the following: -- **Forge**: Ethereum testing framework (like Truffle, Hardhat and DappTools). -- **Cast**: Swiss army knife for interacting with EVM smart contracts, sending transactions and getting chain data. -- **Anvil**: Local Ethereum node, akin to Ganache, Hardhat Network. -- **Chisel**: Fast, utilitarian, and verbose solidity REPL. +1. The smart contracts in this repository have not been audited and are provided "as is" with no guarantees, warranties, or assurances of any kind. The authors and maintainers of this repository are not responsible for any damages, losses, or liabilities that may arise from the use or deployment of these smart contracts. -## Documentation +2. The smart contracts in this repository are not intended for use in production environments or for the management of real-world assets, funds, or resources. Any use or deployment of these smart contracts for such purposes is done entirely at your own risk. -https://book.getfoundry.sh/ +3. The smart contracts are provided for reference and learning purposes, and you are solely responsible for understanding, modifying, and deploying them as needed. -## Usage +## Morpho-Blue related functions in Solidity: -### Build +One can use the logic provided in the following: -```shell -$ forge build -``` +1. functions to get data: -### Test +- supplyAPY +- borrowAPY +- supplyAssetsUser +- borrowAssetsUser +- collateralAssetsUser +- marketTotalSupply +- marketTotalBorrow +- userHealthFactor -```shell -$ forge test -``` +2. functions to modify state: -### Format +- supply +- supplyCollateral +- withdrawCollateral +- withdrawAmount +- withdraw50Percent +- withdrawAll -```shell -$ forge fmt -``` +3. functions using callbacks: -### Gas Snapshots +- leverageMe +- deLeverageMe -```shell -$ forge snapshot -``` +## MetaMorpho related functions in Solidity: -### Anvil +One can use the logic provided in the following: -```shell -$ anvil -``` +1. functions to get data: -### Deploy +- totalDepositVault +- vaultAssetsInMarket +- totalSharesUserVault +- supplyQueueVault +- withdrawQueueVault +- totalCapCollateral +- supplyAPYMarket +- supplyAPYVault -```shell -$ forge script script/Counter.s.sol:CounterScript --rpc-url --private-key -``` +2. functions to modify state -### Cast +- depositInVault +- withdrawFromVaultAmount +- redeemAllFromVault -```shell -$ cast -``` +## Getting Started + +- Install Foundry. +- Install yarn +- Run foundryup +- Run forge install +- Create a .env file according to the .env.example file. + +## Testing with Foundry 🔨 -### Help +You can run the test by running the command: -```shell -$ forge --help -$ anvil --help -$ cast --help +```bash +forge test ``` + +Questions & Feedback +For any question or feedback you can send an email to merlin@morpho.xyz. + +Licensing +The code is under the MIT License. See License.