Opcodes
CLOAD
contract PrivateBalance {
suint256 private balance;
function getBalance() external view returns (suint256) {
return balance;
// Compiler generates:
// CLOAD slot(balance) → returns the value (works for both private and public slots)
}
}function cloadExample(uint256 slot) internal view returns (uint256 value) {
assembly {
// 0xB0 = CLOAD opcode
// Reads from `slot` only if is_private = true
value := cload(slot)
}
}CSTORE
SLOAD / SSTORE (Standard)
TIMESTAMP_MS
FlaggedStorage Access Rules
Load
Operation
Result
Store
Operation
Result
Example: Mixed Public and Private Storage
Gas
Related
Last updated

