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

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-24 11:31:09 -04:00 committed by GitHub
parent 500b7c7132
commit b839584451
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -41,15 +41,14 @@ fallback() external payable {
address facet = selectorTofacet[msg.sig];
require(facet != address(0), "Function does not exist.");
// Execute external function from facet using delegatecall and return any value.
assembly {
let ptr := 0
calldatacopy(ptr, 0, calldatasize())
let result := delegatecall(gas(), facet, ptr, calldatasize(), 0, 0)
assembly {
calldatacopy(0, 0, calldatasize())
let result := delegatecall(gas(), facet, 0, calldatasize(), 0, 0)
let size := returndatasize()
returndatacopy(ptr, 0, size)
returndatacopy(0, 0, size)
switch result
case 0 {revert(ptr, size)}
default {return (ptr, size)}
case 0 {revert(0, size)}
default {return (0, size)}
}
}
```