Last active
August 29, 2022 21:27
-
-
Save mudgen/a2f20211a2ba8a0d4bc81362bb782bc4 to your computer and use it in GitHub Desktop.
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
//SPDX-License-Identifier: MIT | |
pragma solidity =0.8.9; | |
library MyLib { | |
function appStorage() | |
internal | |
pure | |
returns (AppStorage storage ds) | |
{ | |
assembly { | |
ds.slot := 0 | |
} | |
} | |
function someFunction() internal { | |
AppStorage storage s = appStorage(); | |
... do stuff | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment