Created
August 2, 2022 02:55
-
-
Save hihiben/886ee64a267e4d12bf329b19d9a9a8eb to your computer and use it in GitHub Desktop.
Created using remix-ide: Realtime Ethereum Contract Compiler and Runtime. Load this file by pasting this gists URL or ID at https://remix.ethereum.org/#version=soljson-v0.6.12+commit.27d51765.js&optimize=false&runs=200&gist=
This file contains 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
library LibFacet1 { | |
bytes32 constant storagePosition = keccak256("diamond.storage.LibFacet1"); | |
struct DiamondStorage { | |
uint256 n; | |
} | |
function diamondStorage() internal pure returns (DiamondStorage storage ds) { | |
bytes32 position = storagePosition; | |
assembly { | |
ds.slot := position | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment