-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: update README.md with project overview, structure, features, an…
…d setup instructions for Cross-Chain Rebase Token Protocol
- Loading branch information
1 parent
1514e6f
commit 19716c1
Showing
1 changed file
with
99 additions
and
42 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,66 +1,123 @@ | ||
## Foundry | ||
# Cross-Chain Rebase Token Protocol | ||
|
||
This project is a self-learning project for developing a cross-chain rebase token protocol. Built using [Chainlink's CCIP framework](https://chain.link/cross-chain) and the Foundry smart contract development framework, it explores dynamic token supply adjustment and secure cross-chain communication. | ||
|
||
## Table of Contents | ||
|
||
- [Overview](#overview) | ||
- [Project Structure](#project-structure) | ||
- [Features](#features) | ||
- [Installation](#installation) | ||
- [Testing](#testing) | ||
- [Deployment](#deployment) | ||
- [Contributing](#contributing) | ||
- [License](#license) | ||
|
||
## Overview | ||
|
||
The Cross-Chain Rebase Token Protocol implements an automated rebase mechanism, allowing dynamic adjustments of token supply based on pre-defined rules. It leverages Chainlink's CCIP for decentralized cross-chain communications and uses Foundry for streamlined development, testing, and deployment. | ||
|
||
## Project Structure | ||
|
||
The project is organized as follows: | ||
|
||
```sh | ||
. | ||
├── src/ | ||
│ ├── Constants.sol # Global constants used across contracts | ||
│ ├── Errors.sol # Custom error definitions | ||
│ ├── Events.sol # Event declarations | ||
│ ├── RebaseToken.sol # Core token logic including rebase mechanism | ||
│ ├── RebaseTokenPool.sol # Liquidity pool management for the token | ||
│ ├── Vault.sol # Secure vault contract for funds management | ||
│ └── interfaces/ # Solidity interfaces (e.g., IRebaseToken.sol) | ||
├── script/ | ||
│ ├── BridgeTokens.s.sol # Script for bridging tokens across chains | ||
│ ├── ConfigurePool.s.sol # Script to configure the token pool parameters | ||
│ └── Deploy.s.sol # Deployment script for the contracts | ||
├── test/ | ||
│ ├── CrossChain.t.sol # Test suite for cross-chain operations | ||
│ └── VaultAndRebaseToken.t.sol # Integrated tests for vault and rebase functionality | ||
├── lib/ | ||
│ ├── chainlink/ # Chainlink contracts and utilities for CCIP integration | ||
├── chainlink-local/ # Chainlink contracts and utilities for CCIP integration and testing | ||
│ ├── forge-std/ # Foundry standard library for smart contract testing | ||
│ └── openzeppelin-contracts/ # OpenZeppelin contracts for secure contract modules | ||
├── foundry.toml # Foundry configuration file (compiler settings, networks, etc.) | ||
└── remappings.txt # Solidity dependency remappings | ||
``` | ||
|
||
**Foundry is a blazing fast, portable and modular toolkit for Ethereum application development written in Rust.** | ||
## Features | ||
|
||
Foundry consists of: | ||
- **Cross-Chain Communication:** Secure and reliable messaging across blockchains using Chainlink CCIP. | ||
- **Automated Rebase Mechanism:** Dynamic supply adjustments based on economic triggers. | ||
- **Modular Architecture:** Clean separation of contract logic for token, pool, and vault management. | ||
- **Foundry Integration:** Rapid development, testing, and deployment with Foundry. | ||
- **Self-Learning Platform:** An environment to experiment with advanced DeFi concepts and Solidity programming. | ||
|
||
- **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. | ||
## Installation | ||
|
||
## Documentation | ||
### Prerequisites | ||
|
||
https://book.getfoundry.sh/ | ||
- [Foundry](https://github.com/foundry-rs/foundry) | ||
- [Node.js](https://nodejs.org/) | ||
- Git | ||
|
||
## Usage | ||
### Setup Steps | ||
|
||
### Build | ||
1. Clone the repository: | ||
|
||
```shell | ||
$ forge build | ||
``` | ||
```bash | ||
git clone https://github.com/sumit03guha/ccip-rebase-token | ||
``` | ||
|
||
### Test | ||
2. Navigate to the project directory: | ||
|
||
```shell | ||
$ forge test | ||
``` | ||
```bash | ||
cd ccip-rebase-token | ||
``` | ||
|
||
### Format | ||
3. Install Foundry (if not installed): | ||
|
||
```shell | ||
$ forge fmt | ||
``` | ||
```bash | ||
curl -L https://foundry.paradigm.xyz | bash | ||
foundryup | ||
``` | ||
|
||
### Gas Snapshots | ||
4. Compile the contracts: | ||
|
||
```shell | ||
$ forge snapshot | ||
``` | ||
```bash | ||
forge build | ||
``` | ||
|
||
## Testing | ||
|
||
### Anvil | ||
Run the tests with Foundry using: | ||
|
||
```shell | ||
$ anvil | ||
```bash | ||
forge test | ||
``` | ||
|
||
### Deploy | ||
## Deployment | ||
|
||
```shell | ||
$ forge script script/Counter.s.sol:CounterScript --rpc-url <your_rpc_url> --private-key <your_private_key> | ||
Deployment scripts are available in the `script/` directory. To deploy the contracts, run a deployment script such as: | ||
|
||
```bash | ||
forge script script/Deploy.s.sol --broadcast --verify | ||
``` | ||
|
||
### Cast | ||
Ensure your network settings are configured in `foundry.toml`. | ||
|
||
```shell | ||
$ cast <subcommand> | ||
``` | ||
## Contributing | ||
|
||
### Help | ||
Contributions are welcome. Please fork the repository and create a pull request with your proposed changes. For major changes, please open an issue first to discuss what you would like to modify. | ||
|
||
```shell | ||
$ forge --help | ||
$ anvil --help | ||
$ cast --help | ||
``` | ||
## License | ||
|
||
This project is licensed under the MIT License. | ||
|
||
## Acknowledgements | ||
|
||
- **Chainlink CCIP:** For providing a robust framework for cross-chain communication. | ||
- **Foundry:** For enabling rapid development and testing through its powerful toolset. | ||
- **The Blockchain Community:** For continuous inspiration and support. |