Sparkn

CodeFox Inc.
DeFiFoundryProxy
15,000 USDC
View results
Submission Details
Severity: medium

fallback function lack payable

Description

Due to the lack of the payable modifier, contracts that sent value as well as a message would revert when triggering the fallback.

While this could have been very severe for Smart Contracts, because the contract in question is for Account Abstraction, and that could break only certain transfers.

fallback() external {
address implementation = _implementation;
assembly {
let ptr := mload(0x40)
calldatacopy(ptr, 0, calldatasize())
let result := delegatecall(gas(), implementation, ptr, calldatasize(), 0, 0)
let size := returndatasize()
returndatacopy(ptr, 0, size)
switch result
case 0 { revert(ptr, size) }
default { return(ptr, size) }
}

Recommendations

Add payable with fallback function

fallback() external payable {

Support

FAQs

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