First Flight #21: KittyFi

First Flight #21
Beginner FriendlyDeFiFoundry
100 EXP
View results
Submission Details
Severity: low
Invalid

Lack of Events for Critical Function Calls in KittyPool.sol

Summary

The contract lacks event emissions for critical functions like meowintKittyCoin and burnKittyCoin, which are essential for monitoring and logging important state changes.

Vulnerability Details

  • Location: function meowintKittyCoin(uint256 _ameownt) external and function burnKittyCoin(address _onBehalfOf, uint256 _ameownt) external

  • Description: Emitting events is a standard best practice in Solidity to ensure transparency and traceability of state changes. Currently, these functions do not emit any events upon execution.

Impact

  • Severity: Low

  • Effect: This issue primarily affects the monitoring and auditability of the contract rather than its core functionality. It can hinder effective tracking and logging of critical state changes.

Tools Used

  • Manual code review

Recommendations

  • Add event declarations and emit the appropriate events in the meowintKittyCoin and burnKittyCoin functions.

+ event KittyCoinMinted(address indexed to, uint256 amount);
+ event KittyCoinBurned(address indexed from, uint256 amount);
function meowintKittyCoin(uint256 _ameownt) external {
kittyCoinMeownted[msg.sender] = kittyCoinMeownted[msg.sender].add(_ameownt);
i_kittyCoin.mint(msg.sender, _ameownt);
+ emit KittyCoinMinted(msg.sender, _ameownt);
require(_hasEnoughMeowllateral(msg.sender), KittyPool__NotEnoughMeowllateralPurrrr());
}
function burnKittyCoin(address _onBehalfOf, uint256 _ameownt) external {
kittyCoinMeownted[_onBehalfOf] = kittyCoinMeownted[_onBehalfOf].sub(_ameownt);
i_kittyCoin.burn(msg.sender, _ameownt);
+ emit KittyCoinBurned(_onBehalfOf, _ameownt);
}
Updates

Lead Judging Commences

shikhar229169 Lead Judge 11 months ago
Submission Judgement Published
Invalidated
Reason: Non-acceptable severity

Support

FAQs

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