Platform: Code4rena
Start Date: 22/09/2022
Pot Size: $30,000 USDC
Total HM: 12
Participants: 133
Period: 3 days
Judge: 0xean
Total Solo HM: 2
Id: 165
League: ETH
Rank: 84/133
Findings: 1
Award: $28.07
🌟 Selected for report: 0
🚀 Solo Findings: 0
🌟 Selected for report: rotcivegaf
Also found by: 0x040, 0x1f8b, 0x4non, 0xNazgul, 0xSmartContract, 0xf15ers, 8olidity, Aymen0909, B2, Bahurum, Bnke0x0, Ch_301, CodingNameKiki, Deivitto, Diana, Funen, IllIllI, JC, JLevick, KIntern_NA, Lambda, OptimismSec, PaludoX0, RockingMiles, Rolezn, Sm4rty, Soosh, Tagir2003, Tointer, TomJ, Triangle, Trust, V_B, Waze, Yiko, __141345__, a12jmx, ajtra, asutorufos, ayeslick, aysha, bbuddha, bharg4v, bobirichman, brgltd, bytera, c3phas, cryptostellar5, cryptphi, csanuragjain, datapunk, delfin454000, durianSausage, exd0tpy, gogo, got_targ, jag, joestakey, karanctf, ladboy233, leosathya, lukris02, mics, millersplanet, natzuu, neko_nyaa, obront, oyc_109, parashar, peritoflores, rbserver, ret2basic, rokinot, ronnyx2017, rvierdiiev, sach1r0, seyni, sikorico, slowmoses, tnevler, yasir, yongskiws
28.0705 USDC - $28.07
submitAndGive()
in frxETHMinter.sol
submitAndGive() expects recipient address. It is a good practice to check for address(0) to protect from unnecessary complications.
Consider adding require(recipient != address(0));
In https://github.com/code-423n4/2022-09-frax/blob/main/src/frxETHMinter.sol#L159
In the setWithholdRatio
function, the withhold ratio can be set to 100%, When the ratio is 100%, if someone makes a very large ETH deposit then the entirity of the ETH will be added to currentWithheldETH
and non will be added for validators.
It is recommended to set the withHeld ratio is limited to some reasonable amount rather than 100%.
In https://github.com/code-423n4/2022-09-frax/blob/main/src/frxETHMinter.sol#L38-L39
Some constants used for internal calculation are made public. It is recommended to set them to private since they dont need to be exposed through public funcitons. This also increases codesize.
in https://github.com/code-423n4/2022-09-frax/blob/main/src/ERC20/ERC20PermitPermissionedMint.sol#L86
When calling removeMinter, the minter is not removed from minters_array
, instead it is replaced by zero address. this will cause the array to grow very large as more minters are added and removed.
In https://github.com/code-423n4/2022-09-frax/blob/main/src/OperatorRegistry.sol#L61
It is generally recommended to put a reasonable limit on the loop size rather than having unbounded loop as argument on a function.