Skip to content

Instantly share code, notes, and snippets.

@mudgen
Created July 23, 2021 20:29
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/a1e41180bad2aa90be6dd002b3dd3608 to your computer and use it in GitHub Desktop.
Save mudgen/a1e41180bad2aa90be6dd002b3dd3608 to your computer and use it in GitHub Desktop.
// AppStorage.sol
struct AppStorage {
uint256 secondVar;
uint256 firstVar;
uint256 lastVar;
...
}
// StakingFacet.sol
import "./AppStorage.sol"
contract Staking {
AppStorage internal s;
function myFacetFunction() external {
s.lastVar = s.firstVar + s.secondVar;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment