Created
September 24, 2021 13:06
-
-
Save mudgen/ba20bd0795a25f3750112d57d5fec9b9 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| DiamondStorage storage ds = diamondStorage(); | |
| bytes4 functionSelector = bytes4(keccak256("myFunction(uint256)")); | |
| // get facet address of function | |
| address facet = ds.selectorToFacet[functionSelector]; | |
| bytes memory myFunctionCall = abi.encodeWithSelector(functionSelector, 4); | |
| (bool success, uint result) = address(facet).delegatecall(myFunctionCall); | |
| require(success, "myFunction failed"); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
FACET_A
FACET_B