Kelp DAO | rsETH - rumen's results

A collective DAO designed to unlock liquidity, DeFi and higher rewards for restaked assets through liquid restaking.

General Information

Platform: Code4rena

Start Date: 10/11/2023

Pot Size: $28,000 USDC

Total HM: 5

Participants: 185

Period: 5 days

Judge: 0xDjango

Id: 305

League: ETH

Kelp DAO

Findings Distribution

Researcher Performance

Rank: 90/185

Findings: 1

Award: $9.97

Gas:
grade-b

🌟 Selected for report: 0

🚀 Solo Findings: 0

Findings Information

Awards

9.97 USDC - $9.97

Labels

bug
G (Gas Optimization)
grade-b
sufficient quality report
G-16

External Links

GAS 01 - NodeDelegator.sol:110 -> cache IStrategy(strategies[i]): (Saves 118 gas)

110: assets[i] = address(IStrategy(strategies[i]).underlyingToken());
111: assetBalances[i] = IStrategy(strategies[i]).userUnderlyingView(address(this));

Suggested edit:

IStrategy strategy = IStrategy(strategies[i]);
assets[i] = address(strategy.underlyingToken());
assetBalances[i] = strategy.userUnderlyingView(address(this));
Function Nameminavgmedianmax# calls
getAssetBalances (Before)249532495324953249531
getAssetBalances (After)248352483524835248351

GAS 02 - LRTDepositPool.sol:83 -> cache nodeDelegatorQueue[i] as a variable (Saves 837 gas)

83: assetLyingInNDCs += IERC20(asset).balanceOf(nodeDelegatorQueue[i]);
84: assetStakedInEigenLayer += INodeDelegator(nodeDelegatorQueue[i]).getAssetBalance(asset);

Suggested edit:

address currentNdc = nodeDelegatorQueue[i];
assetLyingInNDCs += IERC20(asset).balanceOf(nodeDelegatorQueue[i]);
assetStakedInEigenLayer += INodeDelegator(nodeDelegatorQueue[i]).getAssetBalance(asset);
Function Nameminavgmedianmax# calls
getAssetDistributionData (Before)101531015310153101531
getAssetDistributionData (After)93169316931693161

GAS 03 - LRTOracle.sol:68 -> directly use getAssetPrice(asset) and ILRTDepositPool(lrtDepositPoolAddr).getTotalAssetDeposits(asset) instead of declaring variables (assetER, totalAssetAmt) which are used once -> saves 48 gas on average

67: address asset = supportedAssets[asset_idx];
68: uint256 assetER = getAssetPrice(asset);

70: uint256 totalAssetAmt = ILRTDepositPool(lrtDepositPoolAddr).getTotalAssetDeposits(asset);
71: totalETHInPool += totalAssetAmt * assetER;

Suggested edit:

address asset = supportedAssets[asset_idx];
            
totalETHInPool += ILRTDepositPool(lrtDepositPoolAddr).getTotalAssetDeposits(asset) * getAssetPrice(asset);
Function Nameminavgmedianmax# calls
getRSETHPrice (Before)154603655836558576562
getRSETHPrice (After)154603651036510575602

#0 - c4-pre-sort

2023-11-17T03:51:22Z

raymondfam marked the issue as sufficient quality report

#1 - c4-judge

2023-12-01T16:05:15Z

fatherGoose1 marked the issue as grade-b

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