{"devdoc":{"kind":"dev","title":"WeightManifest","author":"plebeth","details":"Lifecycle: deploy (empty) -> {setConfig} -> {addChunk} (repeat) -> {seal}. The constructor takes no arguments, so the deployed bytecode — and therefore a CREATE2 address — is independent of the model; the same salt yields the same address for any weights.","methods":{"config()":{"returns":{"_0":"The stored {ModelConfig}."}},"constructor":{"details":"Owner is `tx.origin`, not `msg.sender`: deploys go through a CREATE2 factory (so the model-independent address holds), and we want the relaying EOA — not the factory — to own the manifest. Safe here: it's a one-time init, never used for auth."},"getChunks()":{"returns":{"_0":"The SSTORE2 pointer addresses."}},"chunkCount()":{"returns":{"_0":"The number of stored chunks."}},"artifactHash()":{"returns":{"_0":"SHA-256 of the uncompressed artifact (see {ModelConfig})."}},"addChunk(bytes)":{"params":{"data":"Raw chunk bytes; stored verbatim as a data contract."},"returns":{"pointer":"The address of the newly written SSTORE2 data contract."}},"getChunk(uint256)":{"params":{"index":"Zero-based chunk index, in [0, chunkCount)."},"returns":{"_0":"The decompressed-on-write bytes originally passed to {addChunk}."}},"chunkSize(uint256)":{"params":{"index":"Zero-based chunk index, in [0, chunkCount)."},"returns":{"size":"The stored chunk length in bytes (excludes the SSTORE2 STOP prefix)."}},"transferOwnership(address)":{"params":{"newOwner":"The account that will be able to set config, add chunks, and seal."}},"setConfig((string,uint8,uint16,uint32,uint16,bytes32))":{"params":{"config_":"The {ModelConfig} to store (name, quant, vocab, params, chunk cap, hash)."}}},"version":1,"stateVariables":{"_chunks":{"details":"SSTORE2 data-contract pointers, one per chunk, in insertion order."},"MAX_CHUNK_BYTES":{"details":"Hard ceiling on a single chunk: EIP-170 caps contract code at 24576 bytes and SSTORE2 prepends one STOP byte, leaving 24575 usable."}}},"userdoc":{"kind":"user","notice":"An immutable, on-chain manifest for a machine-learning model's weights. The weights are stored as an ordered list of compressed byte \"chunks\", each persisted as its own data contract (SSTORE2 style). Once `seal`ed the artifact can never change, making it a permanent, verifiable reference.","methods":{"seal()":{"notice":"Freeze the manifest so the artifact becomes immutable."},"owner()":{"notice":"The account allowed to set config, add chunks, and seal the manifest."},"config()":{"notice":"Read the model configuration (name, quant, vocab, params, chunk cap, hash)."},"isSealed()":{"notice":"Whether the manifest is frozen. When true, no more chunks may be added."},"constructor":{"notice":"Deploy an empty manifest owned by the deployer; call {setConfig} next."},"getChunks()":{"notice":"List every chunk's data-contract pointer address, in order."},"chunkCount()":{"notice":"How many chunks have been stored so far."},"artifactHash()":{"notice":"The integrity hash the client checks after reassembling the model."},"addChunk(bytes)":{"notice":"Store one compressed chunk on-chain. Keep data <= 24575 bytes."},"getChunk(uint256)":{"notice":"Read back the raw bytes of a single chunk by index."},"chunkSize(uint256)":{"notice":"Stored byte length of a chunk (cheap; reads code size, not data)."},"transferOwnership(address)":{"notice":"Transfer ownership of the manifest to a new account."},"setConfig((string,uint8,uint16,uint32,uint16,bytes32))":{"notice":"Set the static model configuration. Owner-only, before sealing."}},"version":1},"abi":[{"type":"constructor","inputs":[],"stateMutability":"nonpayable"},{"name":"AlreadySealed","type":"error","inputs":[]},{"name":"ChunkTooLarge","type":"error","inputs":[{"name":"size","type":"uint256","internalType":"uint256"},{"name":"max","type":"uint256","internalType":"uint256"}]},{"name":"EmptyChunk","type":"error","inputs":[]},{"name":"IndexOutOfBounds","type":"error","inputs":[{"name":"index","type":"uint256","internalType":"uint256"},{"name":"length","type":"uint256","internalType":"uint256"}]},{"name":"NotOwner","type":"error","inputs":[]},{"name":"WriteFailed","type":"error","inputs":[]},{"name":"ZeroAddress","type":"error","inputs":[]},{"name":"ChunkAdded","type":"event","inputs":[{"name":"index","type":"uint256","indexed":true,"internalType":"uint256"},{"name":"pointer","type":"address","indexed":false,"internalType":"address"},{"name":"size","type":"uint256","indexed":false,"internalType":"uint256"}],"anonymous":false},{"name":"ConfigSet","type":"event","inputs":[{"name":"artifactHash","type":"bytes32","indexed":false,"internalType":"bytes32"}],"anonymous":false},{"name":"OwnershipTransferred","type":"event","inputs":[{"name":"previousOwner","type":"address","indexed":true,"internalType":"address"},{"name":"newOwner","type":"address","indexed":true,"internalType":"address"}],"anonymous":false},{"name":"Sealed","type":"event","inputs":[],"anonymous":false},{"name":"addChunk","type":"function","inputs":[{"name":"data","type":"bytes","internalType":"bytes"}],"outputs":[{"name":"pointer","type":"address","internalType":"address"}],"stateMutability":"nonpayable"},{"name":"artifactHash","type":"function","inputs":[],"outputs":[{"name":"","type":"bytes32","internalType":"bytes32"}],"stateMutability":"view"},{"name":"chunkCount","type":"function","inputs":[],"outputs":[{"name":"","type":"uint256","internalType":"uint256"}],"stateMutability":"view"},{"name":"chunkSize","type":"function","inputs":[{"name":"index","type":"uint256","internalType":"uint256"}],"outputs":[{"name":"size","type":"uint256","internalType":"uint256"}],"stateMutability":"view"},{"name":"config","type":"function","inputs":[],"outputs":[{"name":"","type":"tuple","components":[{"name":"name","type":"string","internalType":"string"},{"name":"quant","type":"uint8","internalType":"uint8"},{"name":"vocabSize","type":"uint16","internalType":"uint16"},{"name":"paramCount","type":"uint32","internalType":"uint32"},{"name":"maxChunkBytes","type":"uint16","internalType":"uint16"},{"name":"artifactHash","type":"bytes32","internalType":"bytes32"}],"internalType":"struct WeightManifest.ModelConfig"}],"stateMutability":"view"},{"name":"getChunk","type":"function","inputs":[{"name":"index","type":"uint256","internalType":"uint256"}],"outputs":[{"name":"","type":"bytes","internalType":"bytes"}],"stateMutability":"view"},{"name":"getChunks","type":"function","inputs":[],"outputs":[{"name":"","type":"address[]","internalType":"address[]"}],"stateMutability":"view"},{"name":"isSealed","type":"function","inputs":[],"outputs":[{"name":"","type":"bool","internalType":"bool"}],"stateMutability":"view"},{"name":"owner","type":"function","inputs":[],"outputs":[{"name":"","type":"address","internalType":"address"}],"stateMutability":"view"},{"name":"seal","type":"function","inputs":[],"outputs":[],"stateMutability":"nonpayable"},{"name":"setConfig","type":"function","inputs":[{"name":"config_","type":"tuple","components":[{"name":"name","type":"string","internalType":"string"},{"name":"quant","type":"uint8","internalType":"uint8"},{"name":"vocabSize","type":"uint16","internalType":"uint16"},{"name":"paramCount","type":"uint32","internalType":"uint32"},{"name":"maxChunkBytes","type":"uint16","internalType":"uint16"},{"name":"artifactHash","type":"bytes32","internalType":"bytes32"}],"internalType":"struct WeightManifest.ModelConfig"}],"outputs":[],"stateMutability":"nonpayable"},{"name":"transferOwnership","type":"function","inputs":[{"name":"newOwner","type":"address","internalType":"address"}],"outputs":[],"stateMutability":"nonpayable"}],"matchId":"30258521","creationMatch":"exact_match","runtimeMatch":"exact_match","verifiedAt":"2026-06-02T01:38:20Z","match":"exact_match","chainId":"11155111","address":"0xBA2D82930b2F74B1319Fd326bdF43b567Ac03720"}