MorpheusAI

MorpheusAI
Foundry
22,500 USDC
View results
Submission Details
Severity: medium
Invalid

The contract lacks proper handling of gas-related parameters in the `sendDepositToken` function. This oversight may lead to failed transactions or excessive gas costs.

Summary

The contract lacks proper handling of gas-related parameters in the sendDepositToken function. This oversight may lead to failed transactions or excessive gas costs.

Vulnerability Details

Code Snippet

// SPDX-License-Identifier: MIT
pragma solidity ^0.8.20;
interface IL1Sender {
// ... (other code)
function sendDepositToken(
uint256 gasLimit_,
uint256 maxFeePerGas_,
uint256 maxSubmissionCost_
) external payable returns (bytes memory);
// ... (other code)
}

Impact

The absence of gas-related checks or handling in the sendDepositToken function can result in failed transactions due to insufficient gas or excessive gas costs. This may lead to unpredictable behavior and potential financial losses for users.

Tools Used

Manual code review.

Recommendations

Implement proper handling of gas-related parameters in the sendDepositToken function to ensure robust execution. Consider incorporating checks for gas limits and calculating gas fees within the function. Additionally, provide clear documentation on the expected gas-related parameters to guide users and avoid potential issues.

Code Snippet (Example Mitigation)

// SPDX-License-Identifier: MIT
pragma solidity ^0.8.20;
interface IL1Sender {
// ... (other code)
function sendDepositToken(
uint256 gasLimit_,
uint256 maxFeePerGas_,
uint256 maxSubmissionCost_
) external payable returns (bytes memory) {
require(gasleft() >= gasLimit_, "Insufficient gas provided");
// Add additional gas-related checks and handling as needed
// ...
// Function logic
// ...
return bytes("Transaction successful");
}
// ... (other code)
}

By adding a require statement to check if there is sufficient gas remaining, developers can ensure that transactions are not attempted with insufficient gas. Additional checks and handling can be included based on specific requirements and considerations.

Updates

Lead Judging Commences

inallhonesty Lead Judge
over 1 year ago
inallhonesty Lead Judge over 1 year ago
Submission Judgement Published
Invalidated
Reason: Known issue

Support

FAQs

Can't find an answer? Chat with us on Discord, Twitter or Linkedin.