Summary
RegistryEntry.keys_xdr holds XDR-encoded ScVal ledger keys and is never decoded on-chain. The
repository documents that rule but never shows an adopter how to produce the values. Working them
out currently means writing a throwaway test that runs ScVal::try_from_val and to_xdr and
prints the hex — which is what produced the three constants in scripts/init_testnet.sh.
That is a real barrier to adoption: the first thing a new contract has to do is the one thing
nothing explains.
Acceptance Criteria
Tech Stack
Rust (edition 2021, toolchain 1.93.0 pinned in rust-toolchain.toml), soroban-sdk 27.0.4,
target wasm32v1-none. Build with stellar contract build, never cargo build. Tests are
#[cfg(test)] modules on Env::default(); run them with cargo test --all.
Summary
RegistryEntry.keys_xdrholds XDR-encodedScValledger keys and is never decoded on-chain. Therepository documents that rule but never shows an adopter how to produce the values. Working them
out currently means writing a throwaway test that runs
ScVal::try_from_valandto_xdrandprints the hex — which is what produced the three constants in
scripts/init_testnet.sh.That is a real barrier to adoption: the first thing a new contract has to do is the one thing
nothing explains.
Acceptance Criteria
keys_xdris: the XDR of theScValform of astorage key, hex-encoded.
ScVal::LedgerKeyContractInstance,00000014).#[contracttype]unit enum variant case and explains why it encodes asScVal::Vec([Symbol(name)]).scripts/init_testnet.share cross-referenced as a worked example.Tech Stack
Rust (edition 2021, toolchain 1.93.0 pinned in
rust-toolchain.toml),soroban-sdk27.0.4,target
wasm32v1-none. Build withstellar contract build, nevercargo build. Tests are#[cfg(test)]modules onEnv::default(); run them withcargo test --all.