Skip to content

loggedAssert

loggedAssert(condition, code, options?): asserts condition

Defined in: util.ts:40

Asserts that condition is truthy, logging a formatted error message before failing if the condition is false.

The logged output follows the format {prefix}:{code} or {prefix}:{code}:{message} and is compatible with ARC-56 and ARC-32 clients.

Note that this will generate extra bytecode, so it is strongly advised to keep your messages and error codes short.

unknown

The condition to assert; if false, logs an error and fails.

string

An error code. Must not contain :. Should be alphanumeric.

An optional object containing the message and prefix for the error.

string

Message appended after the code. Must not contain :. Defaults to no message.

"ERR" | "AER"

Error prefix, either "ERR" or "AER". Defaults to "ERR".

asserts condition

loggedAssert(condition, code, message): asserts condition

Defined in: util.ts:59

Asserts that condition is truthy, logging a formatted error message before failing if the condition is false.

The logged output follows the format ERR:{code}:{message} and is compatible with ARC-56 and ARC-32 clients.

Note that this will generate extra bytecode, so it is strongly advised to keep your messages and error codes short.

unknown

The condition to assert; if false, logs an error and fails.

string

An error code. Must not contain :. Should be alphanumeric.

string

Message appended after the code. Must not contain :.

asserts condition