ContractInfo

Composite 545 v393

pallet_contracts::storage::ContractInfo

About This Type

Structured type: ContractInfo.

A struct-like type where each field is encoded in declaration order.

Encoding: Fields encoded consecutively in declaration order, no field names or separators.

Fields (8)

#NameType
0trie_idBoundedVec
1code_hashH256
2storage_bytesu32
3storage_itemsu32
4storage_byte_depositu64
5storage_item_depositu64
6storage_base_depositu64
7delegate_dependenciesBoundedBTreeMap

SCALE Encoding

Rule
8 fields encoded consecutively in declaration order. No field names or delimiters.
Size
sum of field sizes

Examples

Struct with 8 fields = trie_id: BoundedVec, code_hash: H256, storage_bytes: u32, storage_items: u32, storage_byte_deposit: u64, storage_item_deposit: u64, storage_base_deposit: u64, delegate_dependencies: BoundedBTreeMap
0x<field0><field1><field2><field3><field4><field5><field6><field7>
field 0 trie_id: BoundedVec
field 1 code_hash: H256
field 2 storage_bytes: u32
field 3 storage_items: u32
field 4 storage_byte_deposit: u64
field 5 storage_item_deposit: u64
field 6 storage_base_deposit: u64
field 7 delegate_dependencies: BoundedBTreeMap

Code Examples

import { TypeRegistry } from "@polkadot/types";

const registry = new TypeRegistry();

// Encode ContractInfo
const value = registry.createType("ContractInfo", {
  trie_id: 0,
  code_hash: 0,
  storage_bytes: 1000000,
  storage_items: 1000000,
  storage_byte_deposit: 1_000_000_000n,
  storage_item_deposit: 1_000_000_000n,
  storage_base_deposit: 1_000_000_000n,
  delegate_dependencies: 0
});
console.log("Hex:", value.toHex());

Type Parameters

T

Type Information

Type ID
545
Kind
Composite
Path
pallet_contracts::storage::ContractInfo
Runtime
v393