Platform: Code4rena
Start Date: 30/11/2021
Pot Size: $30,000 USDC
Total HM: 0
Participants: 21
Period: 3 days
Judge: pauliax
Id: 63
League: ETH
Rank: 3/21
Findings: 2
Award: $4,747.40
🌟 Selected for report: 1
🚀 Solo Findings: 0
🌟 Selected for report: cmichel
3272.101 USDC - $3,272.10
cmichel
The preMergeCirculatingTribe
value of TRIBERagequit.sol
is supposed to be 619,605,725.325389147000000000
according to this post.
But it's 711,206,739.862133
.
Set preMergeCirculatingTribe = 619605725325389147000000000
#0 - elee1766
2021-12-06T04:24:30Z
ack. number is still subject to change. will be set to final value later
#1 - pauliax
2021-12-07T20:01:04Z
Valid low-level finding: function incorrect as to spec, issues with comments.
cmichel
The TRIBERagequit.ngmi
function takes in TRIBE
and gives out FEI
tokens at a dynamic price (token1OutBase
) that involves the protocol equity, see requery
.
This price can change and be updated by anyone by calling requery()
.
The price is adjusted down, meaning it's possible to receive less token1
s than expected.
token1OutBase
price and wants to exit their position and submits a ngmi
transactionngmi
transaction by calling requery
which can lower the token1OutBase
price if the newProtocolEquity
has decreasedUsers can receive fewer tokens than expected when calling ngmi
.
Add minimum return amount checks.
Accept a function parameter minToken1Amount
that can be chosen by the transaction sender, then check that the actually received amount token1GivenTotal
is greater or equal to this parameter, and reverts otherwise.
#0 - elee1766
2021-12-06T04:23:46Z
#131
#1 - pauliax
2021-12-11T13:02:37Z
A duplicate of #131
cmichel
The TRIBERagequit.recalculate
function is public and can be called by anyone.
It only uses already cached values and therefore there's no reason for anyone to actually call it. Note that when minProtocolEquity
changes, this function is always called afterwards.
It should be internal
instead and only be called by requery
.
#0 - elee1766
2021-12-06T04:23:09Z
#27
#1 - pauliax
2021-12-11T11:30:48Z
No valid attack path is provided, thus grouping this issue together with other gas improvement issues: #38