Skip to content

Instantly share code, notes, and snippets.

@mudgen
Last active August 29, 2022 21:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mudgen/a2f20211a2ba8a0d4bc81362bb782bc4 to your computer and use it in GitHub Desktop.
Save mudgen/a2f20211a2ba8a0d4bc81362bb782bc4 to your computer and use it in GitHub Desktop.
//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