pragma solidity ^0.4.18; // extremely simple example illustrating how to use _slot suffix contract StorageSlotExample { uint256 uintStorage = 1337; // returns uintStorage by loading it directly from the appropriate storage slot function getStorageByPointer() external view returns (uint256) { uint256 _foundStorage; assembly { // use _slot suffix for any contract variable name to access _foundStorage := sload(uintStorage_slot) } return _foundStorage; } // sets storage by accessing the storage slot directly function setStorageByPointer(uint256 _newNumber) external returns (bool) { assembly { // _slot suffix can also be used to store storage at a variable's storage pointer sstore(uintStorage_slot, _newNumber) } return true; } }
0.4.18