Writing The-rebase-token-contract

An essential setup guide to Building a Rebase Token: Initial Implementation in Solidity - Establish the foundation for a rebase token in Solidity using Foundry and OpenZeppelin. Define key state variables, handle fixed-point math, and implement the core dynamic balance calculation by overriding `balanceOf`.

Solidity Developer

Advanced Foundry

1. Introduction
An in-depth overview to Introduction to Building a Cross-Chain Rebase Token - Explore the design and implementation of a cross-chain rebase token utilizing Foundry and Chainlink CCIP for development and interoperability. Delve into rebase mechanics, burn-and-mint bridging, vault interactions, and advanced Foundry testing techniques like fork testing. Duration: 3min
2. What Is-a-rebase-token
A demystifying explanation to Understanding Rebase Tokens - Uncover why some token balances change automatically by exploring the mechanics of rebase tokens. Learn about automatic supply adjustments, different types, and real-world applications like Aave's yield-bearing aTokens. Duration: 2min
3. Rebase Token-code-structure
A foundational introduction to Introduction to Building a Rebase Token - Set up your development environment with Foundry and define core design principles for a rebase token. Covers vault mechanics, dynamic balance calculations, and a unique interest rate system favoring early adopters. Duration: 9min
4. Writing The-rebase-token-contract
An essential setup guide to Building a Rebase Token: Initial Implementation in Solidity - Establish the foundation for a rebase token in Solidity using Foundry and OpenZeppelin. Define key state variables, handle fixed-point math, and implement the core dynamic balance calculation by overriding `balanceOf`. Duration: 33min
5. Mintinterest And-burn-functions
A crucial look into Implementing Interest Accrual and Burning in a Rebase Token - Understand the necessity of synchronizing principal and actual balances via `_mintAccruedInterest` in rebase tokens, and learn to implement the `burn` function, leveraging the Max Uint Pattern for complete withdrawals. Duration: 9min
6. Finish Rebase-token-contract
An in-depth walkthrough to Finalizing the RebaseToken: Integrating ERC20 Functionality - Integrate standard ERC20 features into a custom RebaseToken, overriding key functions like `balanceOf` and `transfer` to account for accrued interest. Address the specific challenges and design choices for rebase token mechanics. Duration: 16min
7. Access Control
An essential lesson on Securing Smart Contracts with OpenZeppelin Access Control - Explore why access control is critical and implement robust security using `Ownable` and `AccessControl`. Master single-owner restrictions and flexible role-based permissions for your Solidity projects. Duration: 12min
8. Vault And-natspec
A foundational walkthrough to Building a Secure Vault Contract in Solidity - Learn to construct a Solidity Vault contract for managing ETH deposits/redemptions and interacting with a token contract. Implement key security patterns like Checks-Effects-Interactions and best practices for robust DeFi development. Duration: 14min
9. Rebase Token-tests-part-1
A foundational setup guide to Setting Up Foundry Tests for Your Rebase Token - Learn to create the initial test file and configure the Foundry environment using the `setUp` function, including contract deployment and resolving common type-casting issues. Outline the structure for testing linear interest accrual in a rebase token system. Duration: 11min
10. Rebase Token-test-part-2
An in-depth guide to Advanced Smart Contract Testing: Rebase Token Fuzzing and Debugging - Explore advanced Foundry techniques like fuzzing with `vm.bound`, debugging precision issues, and testing custom error reverts using `vm.expectPartialRevert`. Learn to build robust tests for deposit, redemption, and interest accrual logic in a rebase token. Duration: 43min
11. Vulnerabilities And-cross-chain-intro
An insightful introduction to Understanding RebaseToken Design Flaws and Introducing Cross-Chain Concepts - Delve into potential exploits and interest calculation issues within a sample RebaseToken. Explore bridging, Chainlink CCIP, and permissionless token standards for cross-chain applications. Duration: 6min
12. Bridging
A comprehensive explanation of Understanding Blockchain Bridges: Connecting the Islands - Explore how bridges link isolated blockchains, detailing mechanisms like burn-and-mint and lock-and-mint for asset transfers. Contrast native vs. third-party and centralized vs. decentralized models, outlining benefits and security implications. Duration: 8min
13. CCIP
A comprehensive introduction to Understanding Chainlink CCIP - Delve into the core architecture and security features of Chainlink's Cross-Chain Interoperability Protocol (CCIP). Discover how it tackles blockchain isolation, enabling secure token and data transfers via its unique components like the Risk Management Network. Duration: 12min
14. The CCT Standard
A comprehensive overview to Understanding the Cross Chain Token (CCT) Standard - Delve into Chainlink's Cross Chain Token (CCT) Standard, a CCIP-based solution tackling liquidity fragmentation and enhancing developer control. Discover its permissionless integration, advanced security features, programmable transfers, and architectural components. Duration: 13min
15. Circle CCTP
An informative exploration of Circle's Cross-Chain Transfer Protocol (CCTP) - Learn how CCTP facilitates secure, native USDC transfers across blockchains using its unique burn-and-mint mechanism. Understand its advantages over traditional bridges and key features like standard versus fast transfers. Duration: 12min
16. Pool Contract
A detailed walkthrough to Enabling Cross-Chain Rebasing Tokens with Custom CCIP Pools - Learn how to construct a bespoke Chainlink CCIP token pool using Foundry for rebasing tokens. Implement the Burn/Mint mechanism to securely transfer tokens while preserving user-specific data like interest rates. Duration: 31min
17. Finish Pool Contract
An iterative approach to Debugging and Compiling the RebaseTokenPool Contract - Learn how to use `forge build` to identify and resolve common Solidity compilation errors in Foundry projects. Follow an iterative process to fix issues like incorrect import paths, function argument mismatches, and type errors. Duration: 1min
18. Chainlink Local-and-fork-tests
A comprehensive introduction to Setting Up Local Fork Tests for Chainlink CCIP with Foundry - Master Foundry's fork testing cheatcodes to replicate multiple blockchain states locally for cross-chain development. Integrate Chainlink Local's simulator to test CCIP interactions realistically between these forked environments. Duration: 11min
19. Deploy Token-test
A foundational setup guide to Deploying Tokens in a Foundry CCIP Test Environment - Learn the initial steps of setting up a Foundry test for cross-chain token deployment using Chainlink CCIP. Deploy `RebaseToken` contracts on both Sepolia and Arbitrum Sepolia forks, managing forks and deployers. Duration: 4min
20. CCIP Setup-test
A foundational setup guide to Setting Up CCIP Burn & Mint Tokens in Foundry - Deploy custom rebase tokens and Chainlink Token Pools on forked testnets using Foundry setup scripts. Configure CCIP permissions, register tokens with the admin registry, and link them to their pools for Burn & Mint testing. Duration: 11min
21. Configure Pool-test
A crucial guide to Chainlink CCIP: Configuring Token Pools in Tests - Learn the vital configuration step after deploying Token Pools but before testing cross-chain transfers. Understand how to use `applyChainUpdates` in Hardhat/Foundry to link pools across chains. Duration: 10min
22. Bridge Function-test
A practical guide to Testing Cross-Chain Token Transfers with Chainlink CCIP and Foundry - Build and thoroughly test a reusable Solidity function for bridging tokens using Chainlink CCIP within a Foundry environment. Leverage the local simulator to verify cross-chain transfers and handle LINK fees between simulated networks. Duration: 21min
23. First Cross-chain-test
A hands-on implementation to Implementing Your First CCIP Cross-Chain Test in Foundry - Discover how to write a Foundry test for CCIP cross-chain transfers using a local simulator for forked networks. Implement and utilize a `bridgeTokens` helper function to test a complete round-trip bridging scenario. Duration: 11min
24. Vault Deployment-script
A practical Forge scripting guide to Creating a Vault Deployer Script with Forge - Learn to build a Solidity deployment script using Foundry/Forge to deploy a `Vault` contract. Covers structuring the script, using cheatcodes for broadcasting, and granting necessary permissions. Duration: 4min
25. Token And-pool-deployer
A comprehensive walkthrough to Deploying Rebase Tokens and CCIP Pools with Foundry - Learn how to create a Foundry script to deploy custom RebaseToken and RebaseTokenPool contracts. Automatically configure the necessary Chainlink CCIP settings to enable cross-chain token transfers using the Burn & Mint standard. Duration: 9min
26. Pool Config-script
A detailed guide to Configuring CCIP Token Pools with a Forge Script - Learn to write a Solidity Forge script (`ConfigurePool.s.sol`) for post-deployment Chainlink CCIP Token Pool setup. Configure inter-chain connections and crucial rate-limiting parameters by running the script on both chains. Duration: 8min
27. Bridging Script
A step-by-step guide to Creating a CCIP Token Bridging Script - Learn to build a Foundry script (`BridgeTokens.s.sol`) for Chainlink CCIP token bridging, focusing on token-only transfers. Understand how to construct the CCIP message, calculate fees, manage ERC20 approvals, and initiate the cross-chain send. Duration: 13min
28. Build Scripts
A foundational preparation to Preparing for Testnet Deployment and Testing - Correct Solidity build errors such as missing 'memory' keywords and address the Foundry `vm.warp`/`via_ir` testing bug. Solidify your project codebase, ensuring it compiles reliably for Sepolia and zkSync deployment. Duration: 4min
29. Run Scripts-on-testnet
A detailed deployment guide to Deploying Your Cross-Chain Application to Testnets - Master deploying smart contracts across Ethereum and zkSync testnets using a hybrid Bash and Foundry strategy. Secure testnet funds, configure environments, and initiate a token bridge via Chainlink CCIP. Duration: 15min
30. Cross Chain-message-sucess
An essential guide to Verifying Your Cross-Chain Token Transfer with CCIP Explorer and MetaMask - Learn how to use the CCIP Explorer to confirm successful cross-chain transfers and examine transaction specifics. Verify token arrival on the destination chain by importing the contract into your MetaMask wallet. Duration: 3min
31. Outro
A comprehensive overview to Building a Cross-Chain Rebase Token with CCIP - Recaps creating a custom Rebase Token with interest accrual and CCIP integration using Token Pools. Details the Foundry testing strategies, deployment scripting, and live cross-chain execution process. Duration: 3min

Course Overview

About the course

What you'll learn

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

Course Description

Who is this course for?

  • Engineers
  • Smart Contract Security researchers

Potential Careers

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)

Meet your instructors

Patrick Collins

Patrick Collins

Founder at Cyfrin

Web3 engineer, educator, and Cyfrin co-founder. Patrick's smart contract development and security courses have helped hundreds of thousands of engineers kickstarting their careers into web3.

Guest lecturers:

Juliette Chevalier

Juliette Chevalier

Lead Developer relations at Aragon

Ciara Nightingale

Ciara Nightingale

Developer relations at Cyfrin

Vasiliy Gualoto

Vasiliy Gualoto

Developer relations at ThirdWeb

Nader Dabit

Nader Dabit

Director of developer relations at EigenLayer

Ally Haire

Ally Haire

Developer relations at Protocol Labs

Harrison

Harrison

Founder at GasliteGG

Vitto Rivabella

Vitto Rivabella

CPO at Cyfrin

Last updated on April 4, 2025

Testimonials

Students Reviews

Read what our students have to say about this course.

Chainlink

Chainlink

Chainlink

Gustavo Gonzalez

Gustavo Gonzalez

Solutions Engineer at OpenZeppelin

Francesco Andreoli

Francesco Andreoli

Lead Devrel at Metamask

Albert Hu

Albert Hu

DeForm Founding Engineer

Radek

Radek

Senior Developer Advocate at Ceramic

Boidushya

Boidushya

WalletConnect

Idris

Idris

Developer Relations Engineer at Axelar

Cyfrin
Updraft
CodeHawks
Solodit
Resources