1/5
## Introduction to Rebase Tokens We are going to create a cross-chain rebase token and will be using CCIP. Let's start by making a directory: ```bash mkdir ccip-rebase-token ``` Now, let's go inside this directory and create a Forge: ```bash cd ccip-rebase-token forge init ``` We will walk through the smart contract step by step. In the `README.md` file, we will first write out the basic concept of our rebase token. It will consist of three key points: 1. A protocol that allows users to deposit into a vault and in return, receive rebase tokens that represent their underlying balance. 2. The rebase token's balance of function is dynamic to show the changing balance with time. 3. The protocol sets an interest rate for each user based on some global interest rate of the protocol at the time the user deposits into the vault. We will set the interest rate such that the global interest rate can only decrease over time to incentivize early adopters. A user deposits into the vault smart contract, the vault contract calls the rebase token and the rebase token mints rebase tokens for the user equal to the amount that they deposited. The user's interest rate is set based on the global interest rate. Let's say the global interest rate is 0.05% per day and a user deposits. They are given an interest rate of 0.05%. Then, let's say the global interest rate drops to 0.04%. A second user makes a deposit. They inherit the global interest rate of 0.04%, but the first user maintains their interest rate of 0.05%. Now that we have a basic understanding of our rebase token design, let's go ahead and write the smart contract.
A detailed guide to building a cross-chain rebase token. This lesson covers the basics of rebase tokens, including how to design a contract that accrues interest dynamically, how to set an individual interest rate for users, and how to update the global interest rate.
Previous lesson
Previous
Next lesson
Next
Give us feedback
Course Overview
About the course
Advanced smart contract development
How to develop a stablecoin
How to develop a DeFi protocol
How to develop a DAO
Advanced smart contracts testing
Fuzz testing
Manual verification
Web3 Developer Relations
$85,000 - $125,000 (avg. salary)
Web3 developer
$60,000 - $150,000 (avg. salary)
Smart Contract Engineer
$100,000 - $150,000 (avg. salary)
Smart Contract Auditor
$100,000 - $200,000 (avg. salary)
Security researcher
$49,999 - $120,000 (avg. salary)
Guest lecturers:
Juliette Chevalier
Lead Developer relations at Aragon
Nader Dabit
Director of developer relations at Avara
Ally Haire
Developer relations at Protocol Labs
Harrison
Founder at GasliteGG
Last updated on March 11, 2025
Solidity Developer
Advanced FoundryDuration: 36min
Duration: 3h 06min
Duration: 5h 02min
Duration: 6h 02min
Duration: 2h 47min
Duration: 1h 23min
Duration: 4h 28min
Duration: 1h 19min
Duration: 1h 10min
Course Overview
About the course
Advanced smart contract development
How to develop a stablecoin
How to develop a DeFi protocol
How to develop a DAO
Advanced smart contracts testing
Fuzz testing
Manual verification
Web3 Developer Relations
$85,000 - $125,000 (avg. salary)
Web3 developer
$60,000 - $150,000 (avg. salary)
Smart Contract Engineer
$100,000 - $150,000 (avg. salary)
Smart Contract Auditor
$100,000 - $200,000 (avg. salary)
Security researcher
$49,999 - $120,000 (avg. salary)
Guest lecturers:
Juliette Chevalier
Lead Developer relations at Aragon
Nader Dabit
Director of developer relations at Avara
Ally Haire
Developer relations at Protocol Labs
Harrison
Founder at GasliteGG
Last updated on March 11, 2025
Testimonials
Read what our students have to say about this course.
Chainlink
Chainlink
Gustavo Gonzalez
Solutions Engineer at OpenZeppelin
Francesco Andreoli
Lead Devrel at Metamask
Albert Hu
DeForm Founding Engineer
Radek
Senior Developer Advocate at Ceramic
Boidushya
WalletConnect
Idris
Developer Relations Engineer at Axelar