ContractInfo
Composite 545 v393pallet_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)
| # | Name | Type |
|---|---|---|
| 0 | trie_id | BoundedVec |
| 1 | code_hash | H256 |
| 2 | storage_bytes | u32 |
| 3 | storage_items | u32 |
| 4 | storage_byte_deposit | u64 |
| 5 | storage_item_deposit | u64 |
| 6 | storage_base_deposit | u64 |
| 7 | delegate_dependencies | BoundedBTreeMap |
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: BoundedVecfield 1 code_hash: H256field 2 storage_bytes: u32field 3 storage_items: u32field 4 storage_byte_deposit: u64field 5 storage_item_deposit: u64field 6 storage_base_deposit: u64field 7 delegate_dependencies: BoundedBTreeMapCode 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