Platform: Code4rena
Start Date: 09/09/2022
Pot Size: $42,000 USDC
Total HM: 2
Participants: 101
Period: 3 days
Judge: hickuphh3
Total Solo HM: 2
Id: 161
League: ETH
Rank: 86/101
Findings: 1
Award: $33.58
🌟 Selected for report: 0
🚀 Solo Findings: 0
🌟 Selected for report: GalloDaSballo
Also found by: 0x040, 0x1f8b, 0x4non, 0x52, 0x85102, 0xNazgul, 0xSky, 0xSmartContract, Aymen0909, Bnke0x0, CertoraInc, Chandr, Chom, CodingNameKiki, Deivitto, Diana, Funen, JC, Jeiwan, Junnon, KIntern_NA, Lambda, Mohandes, Noah3o6, Ocean_Sky, Picodes, R2, Randyyy, RaymondFam, ReyAdmirado, Rohan16, Rolezn, Samatak, Sm4rty, SnowMan, SooYa, StevenL, Tagir2003, Tointer, TomJ, Tomo, V_B, Waze, _Adam, __141345__, a12jmx, ajtra, ak1, asutorufos, bharg4v, bobirichman, brgltd, c3phas, cccz, cryptonue, cryptostellar5, cryptphi, csanuragjain, d3e4, datapunk, delfin454000, dipp, djxploit, durianSausage, erictee, fatherOfBlocks, gogo, got_targ, hansfriese, horsefacts, hyh, ignacio, innertia, izhuer, karanctf, ladboy233, leosathya, lucacez, lukris02, mics, oyc_109, pashov, pauliax, prasantgupta52, rbserver, ret2basic, rfa, robee, rokinot, rotcivegaf, rvierdiiev, sach1r0, scaraven, sikorico, simon135, smiling_heretic, sorrynotsorry, unforgiven, wagmi, yixxas
33.5761 USDC - $33.58
During the audit, 2 low and 5 non-critical issues were found.
â„– | Title | Risk Rating |
---|---|---|
L-1 | Misleading comments | Low |
L-2 | Functions return input | Low |
NC-1 | Constants at the end of the contract | Non-Critical |
NC-2 | Constants may be used | Non-Critical |
NC-3 | Missing NatSpec | Non-Critical |
NC-4 | Floating pragma | Non-Critical |
NC-5 | Incorrect comment | Non-Critical |
Put comments before functions, not after.
/// @notice calculate the amount of FEI out for a given `amountIn` of underlying function getMintAmountOut(uint256 amountIn) external pure returns (uint256) { return amountIn; } /// @notice calculate the amount of underlying out for a given `amountFeiIn` of FEI function getRedeemAmountOut(uint256 amountIn) external pure returns (uint256) { return amountIn; }
Inside each contract, library or interface, use the following order:
Constants may be used instead of literal values.
return (cTokenExchangeRates[cToken] * amount) / 1e18;
(for 1e18)require(_cTokens.length == 27, "Must provide exactly 27 exchange rates.");
(for 27)_exchangeRates[i] > 1e10,
(for 1e10)require(_cTokens.length == 27, "Must provide exactly 27 merkle roots");
(for 27)Define constant variables, especially, for repeated values.
NatSpec is missing in 1 contract.
Add NatSpec for all functions.
Contracts should be deployed with the same compiler version. It helps to ensure that contracts do not accidentally get deployed using, for example, an outdated compiler version that might introduce bugs that affect the contract system negatively.
According to SWC-103, pragma version should be locked.
Not only public but also external.
/** ---------- Public State-Changing Funcs ----------------- **/