Automatically merged updates to draft EIP(s) 2535 (#2905)

Hi, I'm a bot! This change was automatically merged because:

 - It only modifies existing Draft or Last Call EIP(s)
 - The PR was approved or written by at least one author of each modified EIP
 - The build is passing
This commit is contained in:
Nick Mudge 2020-08-25 08:13:36 -04:00 committed by GitHub
parent 904b6c8297
commit 62db579932
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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())}
}
}
```