Platform: Code4rena
Start Date: 14/06/2022
Pot Size: $50,000 USDC
Total HM: 19
Participants: 99
Period: 5 days
Judge: HardlyDifficult
Total Solo HM: 4
Id: 136
League: ETH
Rank: 80/99
Findings: 1
Award: $48.98
🌟 Selected for report: 0
🚀 Solo Findings: 0
🌟 Selected for report: joestakey
Also found by: 0x1f8b, 0x29A, 0x52, 0xDjango, 0xNazgul, 0xNineDec, 0xf15ers, 0xkowloon, 0xmint, 8olidity, BowTiedWardens, Chom, Cityscape, Czar102, ElKu, FSchmoede, Funen, GimelSec, GreyArt, IllIllI, KIntern, Kaiziron, Kenshin, Lambda, MadWookie, MiloTruck, PPrieditis, Picodes, Ruhum, Sm4rty, StErMi, TerrierLover, TomJ, Treasure-Seeker, VAD37, WatchPug, Wayne, _Adam, a12jmx, abhinavmir, antonttc, apostle0x01, asutorufos, berndartmueller, cccz, cloudjunky, codexploder, cryptphi, csanuragjain, defsec, delfin454000, fatherOfBlocks, georgypetrov, hake, hansfriese, horsefacts, hyh, k, kenta, nxrblsrpr, oyc_109, peritoflores, rajatbeladiya, reassor, rfa, robee, sach1r0, saian, samruna, shenwilly, simon135, sorrynotsorry, sseefried, throttle, unforgiven, wagmi, zzzitron
48.9769 USDC - $48.98
_transferFees()
- Found here
While this is in an internal function, it is being called a few times earlier. The require functions to protect this internal function seem to focus on metadata of currency and such. A require function that whitelists who can and cannot access _transferFees()
will probably add an extra layer of security. Related details here (SWC-105).
This is a low level severity, but can be exploited in specific scenarios. Since the variable dependency runs deep, there is added layer of ambiguity.
Instances found -
epochsPassedSinceLastAdvance
- depends on division before multiplication and block.timestamp - both unreliable in the right circumstance (although, latter is practically a non-threat on main-net Ethereum due to chain maturity). Found here.Usually, it is a good idea to emit events whenever variables that act as parameters later are changed. updateStakeLevelThreshold
and updatePenalties
both have this property as seen here.
This is probably fundamentally necessary to Infinity, but with some rearchitecting/using the frontend, is it possible to reduce this? Ref. this.
Another thing to keep in mind is that Ethereum usually prefers pull over push when giving out NFTs.
There are around 12 instances of this - maybe all multiple calls have no other option. Anyway, listed as follows-
external
keywordgetUserTotalStaked() uses public, which could instead be external (since it isn't used anywhere else in the codebase). Saves you a small amount of gas. This is also true for getUserTotalVested().
#0 - nneverlander
2022-06-23T12:43:02Z
Thanks