Functions like depawsitMeowllateral
, whiskdrawMeowllateral
, and purrgeBadPawsition
interact with external contracts (vaults). Ensure that these interactions are safe from reentrancy attacks, especially if they call external contracts that could re-enter the KittyPool contract.
Reentrancy is a vulnerability where an attacker repeatedly calls a function before the previous execution is complete, potentially draining funds or causing inconsistent states.
Fund Drain: Attackers can repeatedly withdraw funds, draining the contract.
State Inconsistency: Reentrant calls can lead to incorrect balances or states.
Security Breach: Compromises the integrity and security of the contract.
Reentrancy attacks can have severe financial and operational impacts on smart contracts. Implementing reentrancy guards and best practices is essential for security.
Audit Wizard
Reading the code
Reentrancy Guards: Use nonReentrant
modifier from OpenZeppelin's ReentrancyGuard
to prevent reentrancy attacks.
Checks-Effects-Interactions Pattern: Update state variables before making external calls.
Example using nonReentrant
.
Reasoning for the meowint function:
State Update: The function updates the kittyCoinMeownted
mapping.
External Call: The function calls the mint
method on the KittyCoin
contract.
Reentrancy Risk: Without nonReentrant
, an attacker could exploit the external call to re-enter the function and manipulate state updates.
Medium to High Risk: Given the critical nature of minting a stablecoin and the involvement of external contract calls, the function is susceptible to reentrancy attacks. An attacker could potentially exploit this to mint more KittyCoin than they are entitled to or bypass collateral checks.
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.