First Flight #12: Kitty Connect

First Flight #12: Kitty Connect
Beginner FriendlyFoundryNFTGameFi
100 EXP
View results
Submission Details
Severity: low
Invalid

Missing Event Emission When Changing Storage Variable `KittyBridge::gasLimit` in `KittyBridge::updateGaslimit` Function

[L-2] Missing Event Emission When Changing Storage Variable KittyBridge::gasLimit in KittyBridge::updateGaslimit Function

Description: The KittyBridge::updateGaslimit function is designed to update the gasLimit storage variable within the NFT bridge protocol. However, it appears that there is no event emission when this variable is changed.

function updateGaslimit(uint256 gasLimit) external onlyOwner {
gaslimit = gasLimit;
@>
}

Impact: This omission can make it difficult for external observers, such as front-end applications or other smart contracts, to track changes to the gas limit, which is crucial for monitoring and debugging purposes.

Proof of Concept:

Recommended Mitigation: To mitigate this issue, an event should be emitted whenever the gasLimit variable is changed within the updateGaslimit function. This event should include the new gas limit value, allowing external observers to easily track changes to the gas limit.
Here's an example of how you might define and emit an event for this purpose within the updateGaslimit function:

  1. Add event declaration to KittyBridgeBase.sol:

+ event GaslimitChanged(
+ uint256 indexed GasLimit,
+ );
  1. Emit event in updateGaslimit function:

function updateGaslimit(uint256 gasLimit) external onlyOwner {
gaslimit = gasLimit;
+ emit GaslimitChanged(gasLimit);
}
Updates

Lead Judging Commences

inallhonesty Lead Judge about 1 year ago
Submission Judgement Published
Invalidated
Reason: Non-acceptable severity

Support

FAQs

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