Platform: Code4rena
Start Date: 07/06/2022
Pot Size: $75,000 USDC
Total HM: 11
Participants: 77
Period: 7 days
Judge: gzeon
Total Solo HM: 7
Id: 124
League: ETH
Rank: 42/77
Findings: 2
Award: $135.59
馃専 Selected for report: 0
馃殌 Solo Findings: 0
馃専 Selected for report: berndartmueller
Also found by: 0x1f8b, 0x29A, 0xDjango, 0xNazgul, 0xNineDec, 0xf15ers, 0xkatana, 0xmint, Bronicle, Chom, Cityscape, Deivitto, Funen, GimelSec, GreyArt, IllIllI, JC, Lambda, Meera, Nethermind, Picodes, PierrickGT, Ruhum, Sm4rty, Tadashi, TerrierLover, TomJ, Trumpero, Waze, _Adam, antonttc, ayeslick, c3phas, catchup, cccz, cloudjunky, cryptphi, csanuragjain, delfin454000, dipp, ellahi, fatherOfBlocks, hake, hansfriese, hyh, joestakey, jonah1005, kenzo, minhquanym, oyc_109, sach1r0, saian, simon135, slywaters, sorrynotsorry, sseefried, unforgiven, xiaoming90, z3s, zzzitron
88.1603 USDC - $88.16
/// @dev Storage slot for fCash id. Read only and set on initialization @audit Read-only
proposed change:
/// @dev Storage slot for fCash id. Read-only and set on initialization
/// @notice Returns the components of the fCash idd @audit idd?
proposed change:
/// @notice Returns the components of the fCash ID
// but might be good safe guards @audit safeguards
proposed change:
// but might be good safeguards
* @dev MANGER ONLY: Initialize given SetToken with initial list of registered fCash positions @audit MANAGER ONLY?
proposed change:
* @dev MANAGER ONLY: Initialize given SetToken with initial list of registered fCash positions @audit MANAGER ONLY?
// Mapping for a set token, wether or not to redeem to underlying upon reaching maturity @audit whether
proposed change:
// Mapping for a set token, whether or not to redeem to underlying upon reaching maturity
// is more gas efficient (does not require and additional redeem call to asset tokens). If using cETH @audit and additional? doesn't seem right, maybe an additional
proposed change:
// is more gas efficient (does not require an additional redeem call to asset tokens). If using cETH
* @dev Checks if a given address is an fCash position that was deployed from the factory @audit a fCash
proposed change:
* @dev Checks if a given address is a fCash position that was deployed from the factory @audit a fCash
The constructor lacks a param natspec for _weth
/** * @dev Instantiate addresses * @param _controller Address of controller contract * @param _wrappedfCashFactory Address of fCash wrapper factory used to check and deploy wrappers */ constructor( IController _controller, IWrappedfCashFactory _wrappedfCashFactory, IERC20 _weth )
proposed change:
/** * @dev Instantiate addresses * @param _controller Address of controller contract * @param _wrappedfCashFactory Address of fCash wrapper factory used to check and deploy wrappers @param _weth Address of WETH contract */ constructor( IController _controller, IWrappedfCashFactory _wrappedfCashFactory, IERC20 _weth )
It is recommended to change the function name from getDecodedID to getDecodedId to maintain a level of naming consistency between all the Id functions
function getDecodedID() public view override returns (uint16 currencyId, uint40 maturity) {
proposed change:
function getDecodedId() public view override returns (uint16 currencyId, uint40 maturity) {
According to OZ documentation safeApproved is deprecated in favor of safeIncreaseAllowance: openzeppelin-contracts/SafeERC20.sol at bfff03c0d2a59bcd8e2ead1da9aed9edf0080d05 路 OpenZeppelin/openzeppelin-contracts 路 GitHub
assetToken.safeApprove(address(NotionalV2), type(uint256).max); if ( address(assetToken) != address(underlyingToken) && address(underlyingToken) != Constants.ETH_ADDRESS ) { underlyingToken.safeApprove(address(NotionalV2), type(uint256).max); }
馃専 Selected for report: IllIllI
Also found by: 0v3rf10w, 0x1f8b, 0x29A, 0xKitsune, 0xNazgul, 0xSolus, 0xf15ers, 0xkatana, 0xmint, 8olidity, Chom, Cityscape, DavidGialdi, Deivitto, ElKu, Fitraldys, Funen, GreyArt, Lambda, Meera, Picodes, PierrickGT, Sm4rty, Tadashi, TerrierLover, TomJ, Tomio, UnusualTurtle, Waze, _Adam, antonttc, asutorufos, berndartmueller, c3phas, catchup, csanuragjain, delfin454000, djxploit, ellahi, fatherOfBlocks, hake, hansfriese, hyh, joestakey, kaden, minhquanym, oyc_109, rfa, sach1r0, saian, samruna, simon135, slywaters, ynnad
47.4309 USDC - $47.43
for(uint256 i = 0; i < modules.length; i++) { try IDebtIssuanceModule(modules[i]).registerToIssuanceModule(_setToken) {} catch {} }
proposed change:
for(uint256 i; i < modules.length;) { try IDebtIssuanceModule(modules[i]).registerToIssuanceModule(_setToken) {} catch {} unchecked {++i;} }
for(uint256 i = 0; i < modules.length; i++) { if(modules[i].isContract()){ try IDebtIssuanceModule(modules[i]).unregisterFromIssuanceModule(setToken) {} catch {} } }
proposed change:
for(uint256 i; i < modules.length;) { if(modules[i].isContract()){ try IDebtIssuanceModule(modules[i]).unregisterFromIssuanceModule(setToken) {} catch {} } unchecked {++i;} }
for(uint256 i = 0; i < positionsLength; i++) { if(positions[i].unit > 0) { address component = positions[i].component; if(_isWrappedFCash(component)) { fCashPositions[j] = component; j++; } } }
proposed change:
for(uint256 i; i < positionsLength;) { if(positions[i].unit > 0) { address component = positions[i].component; if(_isWrappedFCash(component)) { fCashPositions[j] = component; j++; } } unchecked {++i;} }
for(uint256 i = 0; i < positionsLength; i++) { // Check that the given position is an equity position if(positions[i].unit > 0) { address component = positions[i].component; if(_isWrappedFCash(component)) { numFCashPositions++; } } }
proposed change:
for(uint256 i; i < positionsLength;) { // Check that the given position is an equity position if(positions[i].unit > 0) { address component = positions[i].component; if(_isWrappedFCash(component)) { numFCashPositions++; } } unchecked {++i;} }
uint32 minImpliedRate = 0;
proposed change:
uint32 minImpliedRate;
address[] memory modules = setToken.getModules(); for(uint256 i = 0; i < modules.length; i++)
proposed change:
address[] memory modules = setToken.getModules(); uint modulesLength = modules.length; for(uint256 i = 0; i < modulesLength; i++)
address[] memory modules = _setToken.getModules(); for(uint256 i = 0; i < modules.length; i++) {
proposed change:
address[] memory modules = _setToken.getModules(); uint modulesLength = modules.length; for(uint256 i = 0; i < modulesLength; i++) {