Platform: Code4rena
Start Date: 28/09/2023
Pot Size: $36,500 USDC
Total HM: 5
Participants: 115
Period: 6 days
Judge: 0xDjango
Total Solo HM: 1
Id: 290
League: ETH
Rank: 86/115
Findings: 1
Award: $4.37
🌟 Selected for report: 0
🚀 Solo Findings: 0
🌟 Selected for report: Bauchibred
Also found by: 0x3b, 0xDetermination, 0xMosh, 0xScourgedev, 0xTheC0der, 0xTiwa, 0xWaitress, 0xdice91, 0xfusion, 0xpiken, 0xprinc, 0xweb3boy, ArmedGoose, Aymen0909, Breeje, Brenzee, Daniel526, DavidGiladi, DeFiHackLabs, Flora, Fulum, HChang26, Hama, IceBear, J4X, Krace, KrisApostolov, Maroutis, Mirror, MohammedRizwan, Norah, PwnStars, SPYBOY, TangYuanShen, Testerbot, ThreeSigma, Tricko, al88nsk, alexweb3, ast3ros, berlin-101, bin2chen, blutorque, btk, d3e4, deth, e0d1n, ether_sky, ge6a, gkrastenov, glcanvas, hals, imare, inzinko, jkoppel, jnforja, joaovwfreire, josephdara, kutugu, lotux, lsaudit, mahdirostami, merlin, n1punp, nadin, neumo, nisedo, nobody2018, oakcobalt, orion, peanuts, pep7siup, pina, ptsanev, rokinot, rvierdiiev, said, santipu_, sashik_eth, seerether, squeaky_cactus, terrancrypt, tonisives, twicek, vagrant, xAriextz, y4y
4.3669 USDC - $4.37
In the Markets of tokens in the Venus protocol, we might have some being powered by rebasing tokens, This are tokens that uses elastic supply mechanisms, which means the amount of tokens in circulation depends on the supply and demand of the tokens in the ecosystem, examples of this token is the AmpleForth (AMPL) which initiative a rebase every 24 hours, the implementation of the markets to be qualified for the Prime Program can have a huge impact on the state of the Contrats, which in turn will have an effect on how the rewards are distributed.
Tracking States : The state of the Markets, which tracks how many scores for all holder have based on their actions on the protocol, may greatly differ when the assets actually rebase, causing the contract Market Struct to be using an incorrect state, this means if the rebase tokens actually increase the supply or the borrow also increases, this means that the score in which the Prime Token contracts stores, will either be lower than the actual score or higher than the actual score
This issue can also grow a lot higher than this, if you have a situation in which there are 1000+ users Prime token holders who also supply Rebasing tokens, in could have high impact on the distribution if rewards throughout the Prime Program, as users who supply or borrow normal tokens can be greatly affected, in this kind of situations
struct Market { uint256 supplyMultiplier; uint256 borrowMultiplier; uint256 rewardIndex; uint256 sumOfMembersScore; bool exists; }
Let's dive in deeper, This are some of the operations which can be affected in a rebasing effect
uint256 score = _calculateScore(market, account); interests[market][account].score = score; markets[market].sumOfMembersScore = markets[market].sumOfMembersScore + score;
Individual and Total scores Of Users : The total scores of the whole Prime Tokens Holders will be affected by a rebase This can affect individual user scores because the value of assets supplied and borrowed may fluctuate due to the rebasing mechanism. If the total supply of the asset increases significantly, it could lead to a decrease in individual scores, assuming other factors remain constant. The total sum of scores for all participants in the protocol may fluctuate as the total value of assets supplied and borrowed changes with the rebasing asset's supply adjustments.
User and Total Rewards Distributed As the score, which is a major determining factor for determining how much rewards each user gets, will be affected, it may impact the share of rewards users receive.
This situation highlights a challenge when dealing with rebasing assets in DeFi protocols. The rebasing nature of tokens can lead to discrepancies between the tracked state and the actual value of assets. To address this, protocols need to implement mechanisms to account for and adjust scores and rewards based on the actual value of assets, especially when rebasing events occur. Or Choose Not to Use Rebasing Tokens in the assets in the Venus Protocols Markets, as the problems are much more than the advantages.
ERC20
#0 - c4-pre-sort
2023-10-05T04:46:51Z
0xRobocop marked the issue as low quality report
#1 - 0xRobocop
2023-10-05T04:47:02Z
Consider QA
#2 - c4-judge
2023-11-01T15:49:29Z
fatherGoose1 changed the severity to QA (Quality Assurance)
#3 - fatherGoose1
2023-11-01T15:49:46Z
QA. Supporting rebasing tokens is a design decision.
#4 - c4-judge
2023-11-03T02:48:50Z
fatherGoose1 marked the issue as grade-b