Open sujithsomraaj opened 5 months ago
There is a variety of use cases that require a receive
function. e.g. if we swap from ERC20 to Native prior to bridging as well as in case of potential refunds.
Our diamond has a receive function so usually it is covered by that and facets dont need their own.
However, the facet contract is not (fully) usable as standalone contract if it doesnt have that receive function (although we are not using it standalone).
Therefore I would leave it in there since it makes the contract "complete" (and doesnt cost much more to deploy).
Other opinions? @maxklenk
As the facets should not be called directly we don't really need that. Also we don't have it in our Facets as far as I know. Funds sent directly to the facets would not be recoverable. I would remove it.
Removed
Context: StargateFacetV2.sol#L165
Description: The
receive
function accepts native token transfers to the contract. However, there is no direct use case for the functions in theStargateFacetV2
contract; if so, they could be well documented. Since most functions arepayable,
there is no explicit requirement for an additional receiving function.Recommendation: Add relevant documentation on why the
receive
function is required. Else consider removing it if not explicitly required to avoid handling unexpected native token transfers into the diamond contract.LI.FI:
Researcher: