Multiple repos need the same script/CopyArtifacts.sol + script/lib/LibCopyArtifacts.sol pair to commit a deterministic ABI subset for Rust consumption:
rain.math.float has its own copy at script/lib/LibCopyArtifacts.sol.
rain.interpreter (rainlang) is now adding the same in #498.
- Any other repo with both Solidity contracts and Rust crates using
alloy::sol! will need it.
The implementation is the same up to the contract list and the committed output path. Right now we're forking the same Solidity per repo, which means a fix or improvement to extractStable (e.g. tightening the deterministic subset, switching off jq) has to land N times.
What to ship in rainix
LibCopyArtifacts.sol — a library with livePath(name) and extractStable(vm, name). The downstream committedPath differs per repo (where the abi files live), so leave that to the consumer.
- An optional
CopyArtifacts.sol runnable script that consumers can either reuse via inheritance or copy-paste.
Each consumer ships only:
- A small script that defines its contract list and committed path.
- A repo-side workflow that calls the upstream
rainix-copy-artifacts.yaml reusable (separate work item; pair this with adding that reusable to rainix's .github/workflows/).
Migration plan
Once the shared lib is shipped in rainix:
- Bump rainix dep in
rain.math.float, replace its script/lib/LibCopyArtifacts.sol with the rainix import, keep its contract list + committed path.
- Same in
rain.interpreter (rainlang).
- New repos pick it up from rainix from day one.
Both repos must end up consuming the shared lib — leaving either on a local copy defeats the purpose.
Notes
- The
extractStable jq is non-trivial — exactly which keys are deterministic across machines is the kind of thing that should live in one place.
committedPath differs per repo (crates/float/abi/ vs crates/abi/), so it stays consumer-side.
Multiple repos need the same
script/CopyArtifacts.sol+script/lib/LibCopyArtifacts.solpair to commit a deterministic ABI subset for Rust consumption:rain.math.floathas its own copy atscript/lib/LibCopyArtifacts.sol.rain.interpreter(rainlang) is now adding the same in #498.alloy::sol!will need it.The implementation is the same up to the contract list and the committed output path. Right now we're forking the same Solidity per repo, which means a fix or improvement to
extractStable(e.g. tightening the deterministic subset, switching offjq) has to land N times.What to ship in rainix
LibCopyArtifacts.sol— a library withlivePath(name)andextractStable(vm, name). The downstreamcommittedPathdiffers per repo (where the abi files live), so leave that to the consumer.CopyArtifacts.solrunnable script that consumers can either reuse via inheritance or copy-paste.Each consumer ships only:
rainix-copy-artifacts.yamlreusable (separate work item; pair this with adding that reusable to rainix's.github/workflows/).Migration plan
Once the shared lib is shipped in rainix:
rain.math.float, replace itsscript/lib/LibCopyArtifacts.solwith the rainix import, keep its contract list + committed path.rain.interpreter(rainlang).Both repos must end up consuming the shared lib — leaving either on a local copy defeats the purpose.
Notes
extractStablejq is non-trivial — exactly which keys are deterministic across machines is the kind of thing that should live in one place.committedPathdiffers per repo (crates/float/abi/vscrates/abi/), so it stays consumer-side.