- Protocol that allows user to deposit into a vault and in return. receiver rebase tokens that represent their their underlying balance
- Rebase token -> balanceOf function is dynamic to show the chaging balance with time.
- Balnce increases linearly with time.
- Mint tokens to our users every time they perform an action (minting, burning, transferring, or.... bridging)
- Interest rate
- Indivaully set an interet rate or each user based on some global interest rate of the protocol at the time the user deposits into the vault.
- This global interest rate can only decrease to incentivise/reward early adopters.
- Increase token adoption!
- 当调用ERC20.sol里的totalSupply函数(也就是Rebasetoken.sol里面的principleBalanceOf函数)时,它只会显示已经铸造的代币,而不包括其产生的利息。
- Owner可以将"MINT_AND_BURN_ROLE"的权限给任何人,包括他自己,这有点中心化。(RebaseToken.sol里面的grantMintAndBurnRole函数)
- 假如我们想转账给alice,但是alice并没有往这个协议里存入任何代币,那么Alice就会继承我们的利率(RebaseToken.sol-transfer-if(balanceOf(_recipient == 0)),如果没有这个if语句,就会导致我们转给Alice的代币的利率为0.当然,也可以将s_userInterestRate[msg.sender]设置为当前利率,这时候就需要权衡一下两种方案的利弊了)。
- 当调用Rebasetoken.sol里的transfer函数时,账户A转给账户B,假如账户B的利率更低,那么账户A转给账户B的钱将会以账户B的利率存储,那么反过来,如果账户B转给账户A,假如账户A的利率更高,则账户B转给账户A的钱将会以账户A的利率存储。