diff --git a/EIPS/eip-2535.md b/EIPS/eip-2535.md index f7145015..a4ba5e40 100644 --- a/EIPS/eip-2535.md +++ b/EIPS/eip-2535.md @@ -42,17 +42,15 @@ Here is a simple example of a diamond's fallback function: // Find facet for function that is called and execute the // function if a facet is found and return any value. fallback() external payable { - address facet = selectorTofacet[msg.sig]; - require(facet != address(0), "Function does not exist."); + address facet = selectorTofacet[msg.sig]; // Execute external function from facet using delegatecall and return any value. assembly { calldatacopy(0, 0, calldatasize()) let result := delegatecall(gas(), facet, 0, calldatasize(), 0, 0) - let size := returndatasize() - returndatacopy(0, 0, size) + returndatacopy(0, 0, returndatasize()) switch result - case 0 {revert(0, size)} - default {return (0, size)} + case 0 {revert(0, returndatasize())} + default {return (0, returndatasize())} } } ```