mirror of
https://github.com/status-im/EIPs.git
synced 2025-02-23 12:18:16 +00:00
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:
parent
904b6c8297
commit
62db579932
@ -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())}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
Loading…
x
Reference in New Issue
Block a user