Create atoms
Create an atom on a selected MultiVault deployment and use its receipt to verify the bytes and any context URIs you registered.
Prompt for your agentPrepare an atom creation and verify its receipt
Goal: create one atom on Intuition testnet and verify the result from its receipt.
Read https://docs.intuition.systems/docs/build/create-atoms.md, https://docs.intuition.systems/docs/contracts/multivault.md and https://docs.intuition.systems/docs/contracts/configuration.md.
Use exact package versions from https://docs.intuition.systems/intuition-release.json and public entry points only.
Input: the atom data [exact bytes or the builder input] and optional context URIs.
Resolve MultiVault for chain 13579 and check the RPC chain ID first. Read the current atom cost and URI limits, and check the data and URIs against them.
Prepare the call, then stop. Show me the chain, contract, signer, data, URIs, value and expected atom ID, and wait for my approval. Never sign or send it yourself.
After I submit it, read the receipt and confirm that the atom ID, stored bytes and any context URIs match what I approved.
Report the checks you actually ran and anything you could not verify.
Paste this into your coding agent. It points the agent at the Markdown version of each page and leaves every signature to you.
Before you start
Follow Install and pin the packages and the first on-chain write for an interactive testnet setup. Use a funded signing account, a public client and a wallet client configured for the same chain. Resolve MultiVault with getMultiVaultAddressFromChainId from @0xintuition/deployments or supply your compatible local deployment. Check the selected address and chain against your deployment record. Contract deployments
The complete example exports createAtom(session, data, contextUris?). Its session contains address (MultiVault), publicClient, walletClient, the expected chainId and the expected signer. Use it from an interactive Node terminal. The helper checks the client chains and wallet account and asks you to type the displayed operation before submitting it. Example source
Steps
1. Choose the identity bytes
Encode the primary payload as nonempty bytes. For text, use viem’s stringToHex so the input and its encoding are explicit. Compute calculateAtomId(data) and check multiVaultIsTermCreated on the chosen MultiVault. If that ID exists, reuse it. If the atom represents a content URI, making the URI itself the primary payload makes its exact bytes part of the ID. An optional context URI is a separate pointer and leaves the ID unchanged. Atom identity
2. Size the payment and context
Read multiVaultGetAtomCost in native wei. The example pays that exact cost for one atom on the default curve. Paying only the creation cost can leave the creator with zero shares. Keep gas separate. In a batch, each allocation must cover its own cost and the transaction value must equal their sum.
For ordinary creation, use the data and asset arrays. To register context, supply one URI array per atom, including an empty array for any atom without pointers. Encode each URI as bytes. The live maxUriCount limits pointers per atom and maxUriLength limits bytes per URI. Check the independent atomDataMaxLength for the primary payload. The example uses the signer as creator. A different creator must have approved the caller for creation.
3. Submit the reviewed call
Review the chain, MultiVault address, signer, creator, identity bytes, term ID, URI arrays, calldata and native payment. Pick one branch for a given atom. Each protocol wrapper simulates that call and submits through the wallet after your confirmation.
if (uris) {
const [maxUriCount, maxUriLength] = await multiVaultGetAtomUriConfig(s);
const input = {
args: [s.signer, [data], [cost], [uris]] as const,
value: cost,
uriLimits: { maxUriCount, maxUriLength },
};
const calldata = multiVaultCreateAtomsWithUrisEncode(input);
await review(s, 'CREATE WITH URIS', {
to: s.address,
termId,
...input,
calldata,
});
hash = await multiVaultCreateAtomsWithUris(s, input);
} else {
const args = [[data], [cost]] as const;
const calldata = multiVaultCreateAtomsEncode([data], [cost]);
await review(s, 'CREATE ATOM', {
to: s.address,
creator: s.signer,
termId,
args,
value: cost,
calldata,
});
hash = await multiVaultCreateAtoms(s, { args, value: cost });
}
Check the result
Save the returned hash immediately and wait for a successful receipt whose transaction hash matches it. Filter its logs by the selected MultiVault address. Match AtomCreated on creator, term ID and exact data. A nonempty URI list also produces AtomContextRegistered with the same term ID, registrant and URI bytes. These pointers are emitted in logs. The receipt establishes their registration, while any content retrieval is a separate operation. MultiVault creation implementation
Troubleshooting
A duplicate atom, oversized payload, exceeded URI count or byte length, insufficient per-atom payment, missing creation approval or paused contract can prevent execution. Re-read the relevant state before changing the call. For a timeout or replacement, inspect the original hash, replacement and current term state before considering another submission.
Related
Create triples · Deposit and redeem · URI creation wrapper
Applies to V2 · @0xintuition/protocol 4.1.0 · @0xintuition/sdk 4.1.0 · @0xintuition/deployments 0.1.1