The Standard

The Standard
DeFiHardhat
20,000 USDC
View results
Submission Details
Severity: low
Invalid

No receive or fallback function

Summary

Contract cannot receive ether due to lack of receive or fallback function

Vulnerability Details

LiquidationPool contract cannot receive any as it lack receive() or fallback() function.
receive() is for receiving ether without calling data and fallback()is for receiving ether with calling data.

Impact

If someone sends ETH to a smart contract without passing calldata and there is a receive() function, the receive() function is executed. If there is no receive() function, then the fallback() is executed.

// is msg.data empty?
// / \
// yes no
// / \
// receive() exists? is the function selector fundMe()?
// / \ / \
// yes no no yes
// / \ / \
// receive() fallback() exists? fundMe()
// / \
// yes no
// / \
// fallback() transaction is reverted

As there is no receive nor fallback, then the transaction reverts and the contract will not be able to receive and ether.

Tools Used

Manual code Review

Recommendations

Implement receive or fallback function in the LiquidationPool contract.

Updates

Lead Judging Commences

hrishibhat Lead Judge over 1 year ago
Submission Judgement Published
Invalidated
Reason: Non-acceptable severity
Assigned finding tags:

informational/invalid

Support

FAQs

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