Rebase tokens are type of cryptocurrency that have a changing circulating supply, either growing larger (more coins being created/minted) or decreasing (coins get destroyed or 'burnt'), usually to maintain a stable price or achieve a specific target price.
-
Traditional tokens:
- This have a fixed supply set at the creation of the token. The price of these tokens is determined purely by
market demand and supply dynamics
- This have a fixed supply set at the creation of the token. The price of these tokens is determined purely by
-
Rebase tokens:
- This are type of crypto-currency. Also called as Elastic token.
- have a changing circulating supply
- either growing larger price (more coins being created/minted)
- Or, decreasing price (coins get destroyed or 'burnt')
- can
increase or decrease their supplyautomatically!!!
-
Target Price & Supply Adjustment:
- designed to maintain a
target price(e.g., $1 per token). - If the price goes above the target,
the supply increases(minting). - If the price drops below the target,
the supply decreases(burning).
- designed to maintain a
-
Rebasing Mechanism:
- At fixed time interval, protocol will check the token price
- Contract automatically adjusts the total supply of the token depending on the token market price!!!
- If a rebase reduces supply ->
Users balance decreases - If a rebase increases supply ->
Users balance increases - but their share of the total supply remains the same
-
Positive Rebasing:
- When the price of token is high relative to its target (say, $1.00)
- the protocol automatically increases the supply, distributing more token to all holders proportionally!!!
which theoretically should lower the price
-
Negative Rebasing:
- if the price of token falls below the dollar mark($1)
- Protocol reducing the number of tokens in each holder's wallet
attempting to increase the price per token
Example rebase tokens:
- Ampleforth (AMPL)
- Yam Finance (YAM)
- Base Protocol (BASE)
- Olympus DAO (OHM)
- A protocol that enables the
transfer of tokens/NFTs and information between different blockchain networks. - A
blockchain bridgeallows assets, data, or smart contract instructions to move betweendifferent blockchain networks. - Bridging enables DApps and DeFi protocol work on different blockchain network.
Example:
- You have ETH on Ethereum but want to use it on Polygon.
- A bridge helps you move ETH from Ethereum to Polygon by
locking ETHon one chain andminting wrapped ETHon the other.
The main concept we can consider in bridging is:
Locking-upassets on source chain using contract and thenminting their wrapped versionon destination chain!!!
Transfering data or tokens are done with contract:
- Source chain and Destination Chain contracts
-
Burn and Mint bridging:
- Tokens are burned on the source blockchain
- an equivalent amount of tokens are minted on the destination blockchain.
- total supply of token remain constant
-
Lock and Mint Bridging:
- tokens are locked on the source/issuing blockchain
- And,
wrapped versionof this tokens is minted in destination chain!!! - This wrapped version can be transferred across other non-issuing blockchains using the Burn and Mint mechanism.
-
Burn and Unlock Bridging:
- Tokens are burned on the source blockchain (which is the non-issuing blockchain)
- an equivalent amount of tokens are released on the destination blockchain
- applies when you send tokens back to their issuing source blockchain
-
Lock and Unlock Bridging:
- Tokens are locked on the source blockchain
- an equivalent amount of tokens are released on the destination blockchain
- This method is not recommended because, it can result in fragmented liquidity
- A
Cross-Chain Token Standardis a set of rules that ensures tokens can move between different blockchains safely and efficiently by leveraging the chainlink CCIP for security Cross-chain token standardsare just set of rules and instructions that should be followed during transferring tokens cross chain.
Example: A stablecoin that seamlessly moves between Ethereum and Polygon.
- Ensures all tokens moving across chains follow the same secure protocol.
CCT standardprovides different mechanism for transferring tokens likeburn/mint, lock/unlock
Chainlink CCIPis a system/process that allows smart contracts totransfer data/assets/tokenscross-chainCCIP is the bridgethat connects separate blockchains, allowing them to exchange information securely and efficiently.- It uses
defense-in-depth securityfor transfering data/assets cross chain CCIPuses Decentralized Oracle network(DON) and Risk management network(RMN) to check security and transparency for transfering data- CCIP also inclide
rate limitsfor transferring data/assets for security.
Note: CCIP is performing blockchain bridging in more secure and efficient way as compare to traditional blockchain bridging!!!
- Ethereum, Binance Smart Chain, and Solana cannot directly exchange tokens or data.
- Traditional blockchain bridges are more
centralizedand need trust on third parties. - Smart contracts are locked to their chain and cannot access data from other chains.
CCIP solves this by providing a universal, decentralized, and secure way for blockchains to interact with each other
-
Arbitrary Messaging
- is the ability to
send arbitrary data (encoded as bytes)to a receiving smart contract on a different blockchain. - Send msg from one contract on one chain to other contract on diff chain
- is the ability to
-
Token Transfer:
- You can transfer tokens to a smart contract or directly to an metamask wallet(EOA) on a different blockchain.
-
Programmable Token Transfer:
- simultaneously
transfer tokens and arbitrary data (encoded as bytes)within a single transaction - Data can be instructions on what to do with those tokens.
- simultaneously
CCIPwill specifically look for bridging tokens cross-chain- We will bridge rebase token from eth-sepolia to base-sepolia
- will follow the below flow for bridging:
-
Deploy Rebase Tokens:
RebaseToken Contractis ERC20 compatible contract- Deploy rebase token on eth-sepolia and base-sepolia
- Contains mint,burn,grantMintAndBurnRole function
-
Deploying Token Pools:
- Deploy
RebaseTokenPool contracton both eth-sepolia and base-sepolia chain - These pools are essential for minting and burning tokens during cross-chain bridging.
- Each token will be linked to a pool, which will manage token transfers
- Contains lockOrBurn and UnlockOrMint function
- Deploy
-
Deploy Vault contract:
- Deploy vault contract
- Contains depositCollateral,redeemCollateral functions
-
Claiming Mint and Burn Roles:
- Grant mint and burn role to
Vault and Pool contract
- Grant mint and burn role to
-
Claiming and Accepting the Admin Role:
registerAdminViaOwner functionto register our EOA as the token admin and register our token onCCIPacceptAdminRole functionto complete the registration process.
-
Linking Tokens to Pools:
setPool functionto associate each token with its respective token pool.
-
Configuring Token Pools:
applyChainUpdates functionon your token pools to configure each pool by setting cross-chain transfer parameters to enable chain
-
Deploy token on vault:
- On Vault contract -> call depositCollateral to borrow rebase token
- This will be done before bridging.
- We will bridge the rebase token from eth-sepolia to base-sepolia
-
Transferring/Bridging Tokens:
- Will use
EVM2AnyMessage(), getFee(), ccipSend() functionto bridge token cross-chain CCIPwill take care of bridging token
- Will use
- CCIP is basically
performing blockchain bridgingin more secure,decentralized and transparent way!!! - It works on
DON and RMNwhich relay and validate cross-chain messages. - It enables
token transfers, smart contract interactions, and seamless multi-chain applications. - It's more secure than traditional bridges
- CCIP is like an advanced version of blockchain bridges, but built for security, scalability, and true interoperability!!!
forge install smartcontractkit/ccip@v2.17.0-ccip1.5.16
- These pool contract are essential for minting and burning tokens during cross-chain transfers.
- Each token will be linked to a pool ,which will manage token transfers and ensure proper handling of assets across chains.
- Pool contract will be granted access for minting and burning during cross-chain transfers.
- Will follow
burnAndMint mechanismwhere- burn tokens -> source chain
- mint token -> destination chain