This project is a self-learning project for developing a cross-chain rebase token protocol. Built using Chainlink's CCIP framework and the Foundry smart contract development framework, it explores dynamic token supply adjustment and secure cross-chain communication.
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.
The project is organized as follows:
.
├── 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
- 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.
-
Clone the repository:
git clone https://github.com/sumit03guha/ccip-rebase-token
-
Navigate to the project directory:
cd ccip-rebase-token
-
Install Foundry (if not installed):
curl -L https://foundry.paradigm.xyz | bash foundryup
-
Compile the contracts:
forge build
Run the tests with Foundry using:
forge test
Deployment scripts are available in the script/
directory. To deploy the contracts, run a deployment script such as:
forge script script/Deploy.s.sol --broadcast --verify
Ensure your network settings are configured in foundry.toml
.
This project is licensed under the MIT License.