The DEToken should not be transferable to prevent Rtoken from becoming stuck in the StabilityPool. The current implementation allows DEToken transfers, which disrupts the underlying accounting logic of the StabilityPool. This can lead to situations where users cannot withdraw their Rtoken from the pool, causing financial losses and operational issues.
Transferable DEToken Breaks Accounting
The StabilityPool relies on a 1:1 mapping between DEToken balances and Rtoken deposits. When DEToken is transferred, this mapping is broken because the userDeposits mapping in the StabilityPool is tied to the original depositor (msg.sender), not the current DEToken holder.
Example Scenario
User A deposits 100 Rtoken and receives 100 DEToken.
User A transfers 100 DEToken to User B.
User B attempts to withdraw Rtoken from the StabilityPool.
The StabilityPool checks userDeposits[msg.sender], which is tied to User A. Since User B has no deposit record, the withdrawal fails.
User A cannot withdraw either because they no longer hold the DEToken required for the withdrawal process.
No one can withdraw the Rtokens of already transffered DEToken.
Override Transfer Functions
Modify the DEToken contract to override the transfer and transferFrom functions, preventing transfers entirely:
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.