Working tree is now the canonical repo. Off-chain play-money + trustless on-chain (FPMM AMM + CLOB via UMA settlement), AI market factory, creator/social/distribution, mobile shell + push, one-command demo + deploy-kit. Secrets excluded (see ENV-AND-KEYS.md). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1.4 KiB
1.4 KiB
LibStorage
Library for basic storage operations.
Structs
Bump
struct Bump {
uint256 _current;
}
Generates a storage slot that can be invalidated.
Ref
struct Ref {
uint256 value;
}
Pointer struct to a uint256 in storage.
We have opted for a uint256 as the inner type,
as it requires less casting to get / set specific bits.
Operations
slot(Bump)
function slot(Bump storage b) internal view returns (bytes32 result)
Returns the current storage slot pointed by the bump.
Use inline-assembly to cast the result to a desired custom data type storage pointer.
invalidate(Bump)
function invalidate(Bump storage b) internal
Makes the bump point to a whole new storage slot.
bump(bytes32)
function bump(bytes32 sSlot) internal pure returns (Bump storage $)
Returns a bump at the storage slot.
bump(uint256)
function bump(uint256 sSlot) internal pure returns (Bump storage $)
Returns a bump at the storage slot.
ref(bytes32)
function ref(bytes32 sSlot) internal pure returns (Ref storage $)
Returns a pointer to a uint256 in storage.
ref(uint256)
function ref(uint256 sSlot) internal pure returns (Ref storage $)
Returns a pointer to a uint256 in storage.