bool
Pebble 0.3.1 · all symbols on this page are stable.
Logical truth value: true or false. Maps to Plutus Core Bool.
const signed: bool = tx.signatories.includes(ownerHash);
if( signed && tx.outputs.length() > 0 ) {
trace("OK");
} else {
fail "Unauthorized";
}
Literals
true, false.
Operators
| Category | Operators |
|---|---|
| Logical | && (short-circuit AND), || (short-circuit OR), ! (NOT) |
| Equality | ==, != |
Short-circuit vs strict
&& and \|\| are short-circuit: the right operand is only evaluated if the left doesn't decide the result. If you need strict evaluation (rare — usually for higher-order use), see std.boolean.strictAnd and strictOr.
Methods
bool has no method-call surface. Use operators or the std.boolean namespace.
See also
std.boolean— function-call surfacestd.builtins—ifThenElse<T>is the strict polymorphic conditional