From 2642288aae5ba5b5bd9f3e4b2f383516398de15c Mon Sep 17 00:00:00 2001 From: Reetik Rajan Date: Wed, 26 Jun 2024 17:40:32 +0530 Subject: [PATCH 1/7] chore: updated README --- .github/assets/garden_horizontal_white.svg | 10 ++ .github/assets/garden_logomark.svg | 4 + README.md | 128 ++++++++++++++------- 3 files changed, 103 insertions(+), 39 deletions(-) create mode 100644 .github/assets/garden_horizontal_white.svg create mode 100644 .github/assets/garden_logomark.svg diff --git a/.github/assets/garden_horizontal_white.svg b/.github/assets/garden_horizontal_white.svg new file mode 100644 index 0000000..6a68c68 --- /dev/null +++ b/.github/assets/garden_horizontal_white.svg @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/.github/assets/garden_logomark.svg b/.github/assets/garden_logomark.svg new file mode 100644 index 0000000..b9a9868 --- /dev/null +++ b/.github/assets/garden_logomark.svg @@ -0,0 +1,4 @@ + + + + diff --git a/README.md b/README.md index 5c9f810..e9483a8 100644 --- a/README.md +++ b/README.md @@ -1,52 +1,102 @@ -## Solidity Smart Contracts for Garden Finance +# Garden Finance - Blockchain Assets -**Introduction** +
+ GitKeeper logo +

the first instant liquidity +layer for bitcoin

+
-This repository contains the solidity smart contracts for the Garden Finance project. These contracts are designed to facilitate payment channels, HTLCs, and staking functionalities within the ethereum ecosystem. +--- -**Smart Contract Breakdown** +[Garden](https://garden.finance) supercharges your Bitcoin to capture DeFi value across any chain, with blazing speeds and deep liquidity. -The contracts are organized into the following directories, each containing related functionalities: +## About Repository -- **Contracts:** - - [**Flower.sol:**](./contracts/Flower.sol) This contract Follows ERC721 NFT standard and is responsible for minting Flower NFTs. - - [**SEED.sol:**](./contracts/SEED.sol) This contract follows ERC20 standard and is the base token used across all garden decentralized applications. -- [**fee:**](./contracts/fee/README.md) - - [**FeeAccount.sol:**](./contracts/fee/FeeAccount.sol) This contract is used to manage the funds of a channel between a funder and a recipient using `Payment Channel` Architecture along with `HTLC`. - - [**FeeAccountFactory.sol:**](./contracts/fee/FeeAccountFactory.sol) This contract is used to deploy and manage the fee channels per signer. -- [**htlc:**](./contracts/htlc/Readme.md) - - [**HTLC.sol:**](./contracts/htlc/HTLC.sol) This contract is used to settle an order which is committed offchain. -- [**stake:**](./contracts/stake/README.md) - - [**BaseStaker.sol:**](./contracts/stake/BaseStaker.sol) Serves as Base Class for GardenStaker, Contains all State for FillerManager and DelegateManager. - - [**DelegateManager.sol:**](./contracts/stake/DelegateManager.sol) This contract is responsible for managing the delegation of voting power to fillers. - - [**FillerManager.sol:**](./contracts/stake/FillerManager.sol) This contract is responsible for managing the fillers. - - [**GardenStaker.sol:**](./contracts/stake/GardenStaker.sol) Acts as Entry point for staking functionalities. +This repository contains the Smart Contracts and Bitcoin scripts for Garden Finance. The Garden blockchain assets are building blocks for the Garden ecosystem, enabling **cross-chain atomic swaps**, **SEED staking** and **off-chain payment channels**. All the Smart Contracts are written in Solidity and Bitcoin Scripts are written in TypeScript. The Garden blockchain assets are organized into the following directories with logical separation as per their functionality: +`bitcoin/`: Bitcoin Scripts for Atomic Swaps. +`contracts/`: Smart Contracts for SEED token and Garden NFT. +`contracts/stake/`: Smart Contracts for SEED staking. +`contracts/htlc/`: Smart Contracts for Atomic Swaps. +`contracts/fee/`: Smart Contracts for off-chain Payment Channels. -## Prerequisites -- [Hardhat](https://hardhat.org/) -- [Solidity](https://docs.soliditylang.org/) -- Node >= 20 -- Slither [https://github.com/crytic/slither] -- Uses TypeChain +Audits are an important part of the development process for Garden. We have engaged with several security firms to audit the Garden contracts and here are the reports: -**Getting Started** +- [OtterSec](https://github.com/catalogfi/audits/blob/main/OtterSec.pdf) +- [Trail of Bits](https://github.com/catalogfi/audits/blob/main/TrailOfBits.pdf) -For developers familiar with Hardhat and Solidity, follow these steps to set up the development environment: +## Usage -1. **Install dependencies:** - ```bash - yarn install - ``` +### Prerequisites -2. Compile the contracts - ```bash - npx hardhat compile - ``` +There are a few things you need to have installed before you can setup Garden locally: -3. **Run the tests:** - ```bash - npx hardhat test - ``` +- [Node.js](https://nodejs.org/en/download/) +- [Yarn](https://yarnpkg.com/getting-started/install/) +- [HardHat](https://hardhat.org/hardhat-runner/docs/getting-started/) +- [Docker](https://docs.docker.com/get-docker/) (optional) + +Now that you have all the prerequisites installed, you can setup Garden locally. So let's get started! + +### Setup + +#### Hardhat Network + +```bash +# Clone the repository +git clone https://github.com/gardenfi/garden-sol.git +cd garden-sol + +# Install dependencies +yarn install + +# Start the Hardhat network in another terminal +npx hardhat node + +# Deploy the contracts +npx hardhat ignition deploy ignition/modules/fullDeploy.ts --network hardhat --reset +``` + +#### Docker + +```bash +# Clone the repository +git clone https://github.com/gardenfi/garden-sol.git +cd garden-sol + +# Build the Docker image +docker build -t garden-sol . + +# Run the Docker container +docker run -it garden-sol +``` + +### Testing + +```bash +# Clone the repository +git clone https://github.com/gardenfi/garden-sol.git +cd garden-sol + +# Install dependencies +yarn install + +# Run the tests +npx hardhat test + +# Run the coverage (optional) +npx hardhat coverage +``` + +## Contributing + +If you would like to contribute to Garden, please take a look at our [Contributing Guidelines](./CONTRIBUTING.md). + +## Security + +If you discover a security vulnerability within Garden, please send an e-mail to [security@garden.finance](mailto:security@garden.finance). We take these issues very seriously and will respond promptly. + +You may view our full security and bug bounty policy [here](https://docs.garden.finance/home/security/bug-bounty). ## License -This project is licensed under the MIT License. \ No newline at end of file + +This project is licensed under the [MIT License](./LICENSE). From 8c635fdec62faee7d31e6357882f37b68e4ffac7 Mon Sep 17 00:00:00 2001 From: Reetik Rajan Date: Wed, 26 Jun 2024 17:42:54 +0530 Subject: [PATCH 2/7] chore: Organize repository assets into separate directories --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index e9483a8..c95a4c6 100644 --- a/README.md +++ b/README.md @@ -12,7 +12,8 @@ layer for bitcoin

## About Repository -This repository contains the Smart Contracts and Bitcoin scripts for Garden Finance. The Garden blockchain assets are building blocks for the Garden ecosystem, enabling **cross-chain atomic swaps**, **SEED staking** and **off-chain payment channels**. All the Smart Contracts are written in Solidity and Bitcoin Scripts are written in TypeScript. The Garden blockchain assets are organized into the following directories with logical separation as per their functionality: +This repository contains the Smart Contracts and Bitcoin scripts for Garden Finance. The Garden blockchain assets are building blocks for the Garden ecosystem, enabling **cross-chain atomic swaps**, **SEED staking** and **off-chain payment channels**. All the Smart Contracts are written in Solidity and Bitcoin Scripts are written in TypeScript. The Garden blockchain assets are organized into the following directories with logical separation as per their functionality: + `bitcoin/`: Bitcoin Scripts for Atomic Swaps. `contracts/`: Smart Contracts for SEED token and Garden NFT. `contracts/stake/`: Smart Contracts for SEED staking. From f6aba8c508df3dcee4cf5a60ecd982bb12d88641 Mon Sep 17 00:00:00 2001 From: Reetik Rajan Date: Wed, 26 Jun 2024 17:46:42 +0530 Subject: [PATCH 3/7] chore: Update README --- README.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/README.md b/README.md index c95a4c6..f358df1 100644 --- a/README.md +++ b/README.md @@ -40,6 +40,10 @@ Now that you have all the prerequisites installed, you can setup Garden locally. ### Setup +Garden can be setup locally using Hardhat Network or Docker. You can choose the method that suits you best. + +Note: The Docker method is recommended for users who do not want to install the prerequisites on their local machine. + #### Hardhat Network ```bash @@ -73,6 +77,8 @@ docker run -it garden-sol ### Testing +Garden has a comprehensive test suite that covers all the Smart Contracts and Bitcoin Scripts. It ensures that the code is working as expected and there are no regressions. + ```bash # Clone the repository git clone https://github.com/gardenfi/garden-sol.git From 7f5fbadbee6664806f004b5599cf14688211f635 Mon Sep 17 00:00:00 2001 From: Reetik Rajan Date: Wed, 26 Jun 2024 17:48:04 +0530 Subject: [PATCH 4/7] chore: Update README to recommend Docker method for setup --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index f358df1..cec0f7c 100644 --- a/README.md +++ b/README.md @@ -42,7 +42,7 @@ Now that you have all the prerequisites installed, you can setup Garden locally. Garden can be setup locally using Hardhat Network or Docker. You can choose the method that suits you best. -Note: The Docker method is recommended for users who do not want to install the prerequisites on their local machine. +> The Docker method is recommended for users who do not want to install the prerequisites on their local machine. #### Hardhat Network From bfa691f7269d47ded019d77eebc1b4e84f41e9f6 Mon Sep 17 00:00:00 2001 From: Reetik Rajan Date: Wed, 26 Jun 2024 17:49:22 +0530 Subject: [PATCH 5/7] chore: copy fix --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index cec0f7c..bf5dce7 100644 --- a/README.md +++ b/README.md @@ -42,7 +42,7 @@ Now that you have all the prerequisites installed, you can setup Garden locally. Garden can be setup locally using Hardhat Network or Docker. You can choose the method that suits you best. -> The Docker method is recommended for users who do not want to install the prerequisites on their local machine. +> The Docker method is helpful for users who do not want to install the prerequisites on their local machine. #### Hardhat Network From bfa331c3b47476b480940a8bd4d5b0280d6d9061 Mon Sep 17 00:00:00 2001 From: Reetik Rajan Date: Wed, 3 Jul 2024 11:50:19 +0530 Subject: [PATCH 6/7] chore: Remove .DS_Store from .gitignore and update logo in README.md --- .gitignore | 1 + README.md | 6 +----- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/.gitignore b/.gitignore index 17adbfb..92c89df 100644 --- a/.gitignore +++ b/.gitignore @@ -24,6 +24,7 @@ yarn-debug.log* yarn-error.log* lerna-debug.log* .pnpm-debug.log* +.DS_Store # Diagnostic reports (https://nodejs.org/api/report.html) report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json diff --git a/README.md b/README.md index bf5dce7..2b04304 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # Garden Finance - Blockchain Assets
- GitKeeper logo + GitKeeper logo

the first instant liquidity layer for bitcoin

@@ -94,10 +94,6 @@ npx hardhat test npx hardhat coverage ``` -## Contributing - -If you would like to contribute to Garden, please take a look at our [Contributing Guidelines](./CONTRIBUTING.md). - ## Security If you discover a security vulnerability within Garden, please send an e-mail to [security@garden.finance](mailto:security@garden.finance). We take these issues very seriously and will respond promptly. From 702cf2c24bb68f7cdf9c1f24d90810bedb2e2efc Mon Sep 17 00:00:00 2001 From: Reetik Rajan Date: Wed, 3 Jul 2024 11:51:12 +0530 Subject: [PATCH 7/7] Update logo size in README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 2b04304..f871069 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # Garden Finance - Blockchain Assets
- GitKeeper logo + GitKeeper logo

the first instant liquidity layer for bitcoin