Illuminate contest - Bnke0x0's results

Your Sole Source For Fixed-Yields.

General Information

Platform: Code4rena

Start Date: 21/06/2022

Pot Size: $55,000 USDC

Total HM: 29

Participants: 88

Period: 5 days

Judge: gzeon

Total Solo HM: 7

Id: 134

League: ETH

Illuminate

Findings Distribution

Researcher Performance

Rank: 49/88

Findings: 2

Award: $142.90

🌟 Selected for report: 0

πŸš€ Solo Findings: 0

[G-01] [N-01] ADDING A RETURN STATEMENT WHEN THE FUNCTION DEFINES A NAMED RETURN VARIABLE, IS REDUNDANT :-

1.File: 2022-06-illuminate/marketplace/Safe.sol (line 108):

`return result;`

2.File: 2022-06-illuminate/marketplace/Safe.sol (line 172):

`return result;`

3.File: 022-06-illuminate/redeemer/Safe.sol (line 108):

`return result;`

4.File: 022-06-illuminate/redeemer/Safe.sol (line 172):

`return result;`

3.File: 2022-06-illuminate/lender/Safe.sol (line 108):

`return result;`

4.File: 2022-06-illuminate/lender/Safe.sol (line 172):

`return result;`

[G-01] STATE VARIABLES ONLY SET IN THE CONSTRUCTOR SHOULD BE DECLARED IMMUTABLE:-

1.File: 2022-06-illuminate/lender/Lender.sol (line 26):

`address public admin;`

2.File: 2022-06-illuminate/lender/Lender.sol (line 28):

`address public marketPlace;`

3.File: 2022-06-illuminate/lender/Lender.sol (line 33):

`address public swivelAddr;`

4.File: 2022-06-illuminate/lender/Lender.sol (line 35):

`address public immutable pendleAddr;`

5.File: 2022-06-illuminate/lender/Lender.sol (line 37):

`address public immutable tempusAddr;`

6.File: 2022-06-illuminate/lender/Lender.sol (line 40):

`uint256 public feenominator;`

7.File: 2022-06-illuminate/marketplace/MarketPlace.sol (line 41):

`address public admin;`

8.File: 2022-06-illuminate/marketplace/MarketPlace.sol (line 43):

`address public immutable redeemer;`

9.File: 2022-06-illuminate/marketplace/MarketPlace.sol (line 45):

`address public immutable lender;`

10.File: 2022-06-illuminate/redeemer/Redeemer.sol (line 19):

`address public admin;`

11.File: 2022-06-illuminate/redeemer/Redeemer.sol (line 21):

`address public marketPlace;`

12.File: 2022-06-illuminate/redeemer/Redeemer.sol (line 23):

`address public lender;`

13.File: 22022-06-illuminate/redeemer/Redeemer.sol (line 27):

`address public swivelAddr;`

14.File: 2022-06-illuminate/redeemer/Redeemer.sol (line 29):

`address public immutable pendleAddr;`

15.File: 2022-06-illuminate/redeemer/Redeemer.sol (line 31):

`address public immutable tempusAddr;`

16.File: 2022-06-illuminate/redeemer/Redeemer.sol (line 33):

`address public apwineAddr;`

[G-02] REQUIRE()/REVERT() STRINGS LONGER THAN 32 BYTES COST EXTRA GAS:-

1.File: 2022-06-illuminate/lender/Safe.sol (line 89):

`revert(0, returnDataSize)`

2.File: 2022-06-illuminate/lender/Safe.sol (line 153):

`revert(0, returnDataSize)`

3.File: 2022-06-illuminate/lender/Cast.sol(line 9):

`require(n <= type(uint128).max, '');`

4.File: 2022-06-illuminate/lender/Safe.sol (line 41):

`require(success(result), 'transfer failed');`

5.File: 2022-06-illuminate/lender/Safe.sol (line 71):

`require(success(result), 'transfer from failed');`

6.File: 2022-06-illuminate/lender/Safe.sol (line 134):

`require(didLastOptionalReturnCallSucceed(callStatus), 'APPROVE_FAILED');`

7.File: 2022-06-illuminate/redeemer/Safe.sol (line 89):

`revert(0, returnDataSize)`

8.File: 2022-06-illuminate/marketplace/Safe.sol (line 84):

`revert(0, returnDataSize)`

9.File: 2022-06-illuminate/redeemer/Safe.sol (line 44):

`require(success(result), 'transfer from failed');` 10.File: 2022-06-illuminate/redeemer/Safe.sol (line 71): `require(success(result), 'transfer failed');` 11.File: 2022-06-illuminate/marketplace/ERC20.sol (line 116): `require(_balanceOf[src] >= wad, "ERC20: Insufficient balance");` 12.File: 2022-06-illuminate/marketplace/ERC20.sol (line 152): `require(allowed >= wad, "ERC20: Insufficient approval");` 13.File: 2022-06-illuminate/marketplace/ERC20.sol (line 189): `require(_balanceOf[src] >= wad, "ERC20: Insufficient balance");` 14.File: 2022-06-illuminate/marketplace/ERC20Permit.sol (line 56): `require(deadline >= block.timestamp, "ERC20Permit: expired deadline");` 15.File: 2022-06-illuminate/marketplace/ERC5095.sol (line 100): `require(_allowance[holder][msg.sender] >= underlyingAmount, 'not enough approvals');` 16.File: 2022-06-illuminate/marketplace/ERC5095.sol (line 116): `require(_allowance[holder][msg.sender] >= underlyingAmount, 'not enough approvals');` 17.File: 2022-06-illuminate/marketplace/ERC5095.sol (line 139): `require(msg.sender == a, 'sender must be admin');` 16.File: 2022-06-illuminate/marketplace/Safe.sol (line 39): `require(success(result), 'approve failed');` 17.File: 2022-06-illuminate/marketplace/Safe.sol (line 66): `require(success(result), 'transfer failed');`

[G-03] UIT COSTS MORE GAS TO INITIALIZE VARIABLES TO ZERO THAN TO LET THE DEFAULT OF ZERO BE APPLIED :-

1.File: 2022-06-illuminate/lender/Lender.sol (line 265): `for (uint256 i = 0; i < o.length; ) {`

[G-03] ++I COSTS LESS GAS THAN ++I, ESPECIALLY WHEN IT’S USED IN FOR-LOOPS (--I/I-- TOO) :-

1.File: 2022-06-illuminate/lender/Lender.sol (line 265): `for (uint256 i = 0; i < o.length; ) {`

[G-04] ARITHMETICS ++i costs less gas compared to i++ or i += 1

`++i` costs less gas compared to i++ or i += 1 for unsigned integer, as pre-increment is cheaper (about 5 gas per iteration). This statement is true even with the optimizer enabled. 1.File: 2022-06-illuminate/lender/Lender.sol (line 96): `i++;` 2.File: 2022-06-illuminate/lender/Lender.sol (line 120): `i++;` 3.File: 2022-06-illuminate/lender/Lender.sol (line 289): `i++;`

[G-05] USAGE OF ERRORS CAN REDUCE GAS COST AND CONTRACT SIZE :-

1.File: 2022-06-illuminate/redeemer/Redeemer.sol (line 14): `error Invalid(string);` 2.File: 2022-06-illuminate/redeemer/Redeemer.sol (line 15): `error Unauthorized();` 3.File: 2022-06-illuminate/redeemer/Redeemer.sol (line 16): `error Exists(string);` 4.File: 2022-06-illuminate/marketplace/ERC5095.sol (line 19): `error Maturity(uint256 timestamp); ` 5.File: 2022-06-illuminate/marketplace/MarketPlace.sol (line 29): `error Exists(string);` 6.File: 2022-06-illuminate/marketplace/MarketPlace.sol (line 30): `error Unauthorized();` 7.File: 2022-06-illuminate/marketplace/MarketPlace.sol (line 31): `error Invalid(string);` 8.File: 2022-06-illuminate/lender/Lender.sol (line 17): `error Unauthorized();` 9.File: 2022-06-illuminate/lender/Lender.sol (line 18): `error NotEqual(string);` 10.File: 2022-06-illuminate/lender/Lender.sol (line 19): `error Exists(address);` 11.File: 2022-06-illuminate/lender/Lender.sol (line 2o): `error Invalid(string);`
AuditHub

A portfolio for auditors, a security profile for protocols, a hub for web3 security.

Built bymalatrax Β© 2024

Auditors

Browse

Contests

Browse

Get in touch

ContactTwitter