The Cross-Chain Rebase Token Protocol is an innovative blockchain solution designed to enable users to deposit assets into a vault and receive dynamically rebasing tokens in return. These tokens continuously reflect the user's underlying balance growth based on a predetermined interest rate. Additionally, the protocol supports cross-chain interoperability, allowing seamless asset transfers between networks such as Ethereum Sepolia Testnet and ZkSync.
⦁ Rebase Token ($RBT): An ERC-20 token with a dynamic balanceOf function that increases a user’s balance linearly over time.
⦁ Vault Mechanism: Users deposit native ETH (or testnet Sepolia ETH) into a vault and receive $RBT in return, tied to the vault's global interest rate.
⦁ Interest Rate System:
◾ Users are assigned an interest rate equal to the global rate at the time of deposit.
◾ The global interest rate is designed to only decrease over time, incentivizing early adopters.
⦁ Cross-Chain Bridging:
◾ $RBT tokens can be transferred between supported networks.
◾ The bridgeToZkSync.sh script facilitates cross-chain bridging between Sepolia Testnet ETH and ZkSync.
⦁ Dynamic Token Growth:
◾ Rebase tokens increase based on a linear time function.
◾ Users receive additional tokens when performing actions such as minting, burning, transferring, or bridging.
⦁ Implements a modified balanceOf(address user) function that dynamically calculates the user's balance based on elapsed time and interest rate.
⦁ Allows minting and burning by the vault and other authorized contracts.
⦁ Accepts deposits of native ETH (or testnet ETH) and mints $RBT to users.
⦁ Assigns interest rates to users at the time of deposit.
⦁ Manages global interest rate adjustments.
⦁ Utilizes Chainlink CCIP or other bridge solutions to facilitate seamless asset transfers between Ethereum Sepolia Testnet and ZkSync.
⦁ The bridgeToZkSync.sh script automates the bridging process.
⦁ git
⦁ Foundry
foundryup⦁ Foundry-zksync: For ZKSync implementation
curl -L https://raw.githubusercontent.com/matter-labs/foundry-zksync/main/install-foundry-zksync | bashgit clone https://github.com//Preciousbas/Crosschain-rebase-token
cd Crosschain-rebase-token
forge install
forge buildInstead of scripts, we can directly use the cast command to interact with the contract.
For example, on Sepolia:
1. Get some RebaseTokens
cast send <vault-contract-address> "deposit()" --value 0.1ether --rpc-url $SEPOLIA_RPC_URL --wallet2. Redeem RebaseTokens for ETH
cast send <vault-contractaddress> "redeem(uint256)" 10000000000000000 --rpc-url $SEPOLIA_RPC_URL --walletRun the following command to bridge ETH from Sepolia Testnet to ZkSync:
./bridgeToZkSync.sh⦁ Reentrancy Protection: Implemented in the vault to prevent unauthorized withdrawals.
⦁ Interest Rate Limits: Prevents malicious actors from manipulating global interest rates.
⦁ Chain Selector Verification: Ensures correct cross-chain transactions by verifying chain selectors before execution.
For questions, open an issue on GitHub or reach out via [email protected]