Solidity memory libraries — pointer arithmetic, byte-level copying, and dynamic arrays/matrices that don't go through Solidity's safety-checked allocator.
| Library | What it does |
|---|---|
LibPointer |
Raw memory pointer arithmetic, with explicit Pointer user-defined type. |
LibMemCpy |
Word-aligned and byte-aligned memcpy between memory pointers. |
LibBytes |
In-place mutation, slicing, and pointer-level access for bytes. |
LibUint256Array |
Dynamic uint256[] operations: extend, copy, dedup-sort, truncate. |
LibBytes32Array |
Dynamic bytes32[] mirror of LibUint256Array. |
LibUint256Matrix |
uint256[][] operations. |
LibBytes32Matrix |
bytes32[][] operations. |
LibStackPointer |
Stack-style push/pop on a memory region accessed via Pointer. |
LibStackSentinel |
Sentinel-terminated stack walks for unknown-length data. |
These libraries assume the caller knows what they're doing with memory. Out-of- bounds access, double-frees, and aliasing are the caller's responsibility.
Via soldeer (in your foundry project's root):
forge soldeer install rain-solmem~<version>Versioned remappings end up in dependencies/rain-solmem-<version>/. Add the
remapping to remappings.txt or foundry.toml.
This repo uses nix for its dev shell. The
default shell is the slim Solidity-only sol-shell from
rainix — no rust, node, or chromium.
nix develop # enter the shell
forge soldeer install # install dependencies declared in foundry.toml
forge testTasks exposed via the shell (delegate to rainix):
rainix-sol-test—forge testrainix-sol-static— slitherrainix-sol-legal—reuse lintrainix-sol-artifacts—forge build
Use the nix-pinned forge for all development to keep versions consistent.
Tag v<x.y.z> on main. The
Publish to Soldeer workflow runs
forge soldeer push rain-solmem~<x.y.z> on every v* tag. The package name is
derived from the repo name with . substituted for -.
DecentraLicense 1.0 (DCL-1.0) — full text in
LICENSES/. Roughly CAL-1.0
(opensource.org) plus user-data
disclosure obligations consistent with permissionless-blockchain assumptions.
"Not your keys, not your coins" aware, in legalese.
This repo is REUSE 3.2 compliant. Verify locally:
nix develop -c rainix-sol-legalWelcome under the same license. Contributors warrant that their contributions are compliant.