CodeMetadataBinaryCodec class
Codec for CodeMetadata (2-byte flags) values.
CodeMetadata represents smart contract deployment flags as a 16-bit value. Used for specifying contract properties like upgradeable, payable, readable.
- Mixed-in types
Constructors
- CodeMetadataBinaryCodec()
-
const
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
decodeNested(
Uint8List buffer, int offset) → (CodeMetadataValue, int) - Decodes CodeMetadata from nested position. Returns (value, bytesConsumed).
-
decodeTopLevel(
Uint8List buffer) → CodeMetadataValue - Decodes CodeMetadata from top-level buffer.
-
encodeNested(
CodeMetadataValue value) → Uint8List - Encodes CodeMetadata for nested (2 bytes, big-endian).
-
encodeTopLevel(
CodeMetadataValue value) → Uint8List - Encodes CodeMetadata for top-level (2 bytes, big-endian).
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
requireBufferLength(
Uint8List buffer, int offset, int requiredBytes, [String? typeName]) → void -
Validates buffer has at least
requiredBytesstarting fromoffset.inherited -
requireBytesRead(
Uint8List buffer, int offset, int bytesRead) → void -
Validates bytes read don't exceed buffer bounds.
inherited
-
requireEndOffset(
Uint8List buffer, int offset, int length, [String? typeName]) → void -
Validates calculated end offset doesn't exceed buffer length.
inherited
-
requireExactLength(
Uint8List buffer, int requiredBytes, [String? typeName]) → void -
Validates buffer has exactly
requiredByteslength.inherited -
requireMaxLength(
Uint8List buffer, int maxLength) → void -
Validates buffer doesn't exceed maximum allowed length.
inherited
-
requireMinimumLength(
Uint8List buffer, int minLength, [String? typeName]) → void -
Validates buffer meets minimum length requirement.
inherited
-
requireOffsetInBounds(
Uint8List buffer, int offset, [String? context]) → void -
Validates offset is not at or beyond buffer end.
inherited
-
requireOffsetWithBytes(
Uint8List buffer, int offset, int requiredBytes) → void -
Validates offset with specific minimum required bytes.
inherited
-
requireValidOffset(
Uint8List buffer, int offset) → void -
Validates offset is within valid range for buffer.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Constants
- metadataLength → const int
- Size of CodeMetadata in bytes.