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: 47/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.5765 USDC - $33.58
previewRedeem calculates the amount by dividing by 18 decimal places, the amount will be incorrect if cToken had different decimals amount
2022-09-tribe/contracts/shutdown/fuse/RariMerkleRedeemer.sol 85: return (cTokenExchangeRates[cToken] * amount) / 1e18;
Avoid floating pragmas for non-library contracts.
While floating pragmas make sense for libraries to allow them to be included with multiple different versions of applications, it may be a security risk for application implementations.
A known vulnerable compiler version may accidentally be selected or security tools might fall-back to an older compiler version ending up checking a different EVM compilation that is ultimately deployed on the blockchain.
It is recommended to pin to a concrete compiler version.
2022-09-tribe/contracts/peg/SimpleFeiDaiPSM.sol::2 => pragma solidity ^0.8.4; 2022-09-tribe/contracts/shutdown/redeem/TribeRedeemer.sol::2 => pragma solidity ^0.8.4;
Use abi.encode() instead which will pad items to 32 bytes, which will prevent hash collisions (e.g. abi.encodePacked(0x123,0x456) => 0x123456 => abi.encodePacked(0x1,0x23456), but abi.encode(0x123,0x456) => 0x0...1230...456). Unless there is a compelling reason, abi.encode should be preferred. If there is only one argument to abi.encodePacked() it can often be cast to bytes() or bytes32() instead.
2022-09-tribe/contracts/shutdown/fuse/RariMerkleRedeemer.sol::174 => bytes32 leafHash = keccak256(abi.encodePacked(msg.sender, _amount));
Zero-address checks are a best practice for input validation of critical address parameters. While the codebase applies this to most cases, there are many places where this is missing in constructors and setters. Impact: Accidental use of zero-addresses may result in exceptions, burn fees/tokens, or force redeployment of contracts.
2022-09-tribe/contracts/shutdown/redeem/TribeRedeemer.sol::32 => redeemedToken = _redeemedToken;
Use a solidity version of at least 0.8.12 to get string.concat() instead of abi.encodePacked(<str>,<str>) Use a solidity version of at least 0.8.13 to get the ability to use using for with a list of free functions
2022-09-tribe/contracts/peg/SimpleFeiDaiPSM.sol::2 => pragma solidity ^0.8.4; 2022-09-tribe/contracts/shutdown/fuse/MerkleRedeemerDripper.sol::2 => pragma solidity =0.8.10; 2022-09-tribe/contracts/shutdown/fuse/RariMerkleRedeemer.sol::2 => pragma solidity =0.8.10; 2022-09-tribe/contracts/shutdown/redeem/TribeRedeemer.sol::2 => pragma solidity ^0.8.4;
Each event should use three indexed fields if there are three or more fields
2022-09-tribe/contracts/peg/SimpleFeiDaiPSM.sol::27 => event Redeem(address to, uint256 amountFeiIn, uint256 amountAssetOut); 2022-09-tribe/contracts/peg/SimpleFeiDaiPSM.sol::29 => event Mint(address to, uint256 amountIn, uint256 amountFeiOut);
It is not necessary to have both a named return and a return statement.
2022-09-tribe/contracts/shutdown/fuse/RariMerkleRedeemer.sol::81 => function previewRedeem(address cToken, uint256 amount) public view override returns (uint256 baseTokenAmount) {