Skip to content

The receive() function must be external payable #6

@bitbart

Description

@bitbart

The receive() function must be declared as external and payable:

https://docs.soliditylang.org/en/latest/contracts.html#receive-ether-function

For example, the following contracts should not pass typechecking:

contract C {
    receive() public payable { }
}
contract C {
    receive() external { }
}

Additionally, the receive() function cannot take parameters. For example the following contract should not pass type checking:

contract C {
    receive(int x) external payable { }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions