Custom Predicates
- You can create your own predicates for reusability and better readability:
// SYNTAX
predicate_name :- predicate_body
// EXAMPLE
get_token_owner(OwnerAddress) :-
call_fn(hyperdapp, owner, [OwnerAddress]).
prompt :-
get_token_owner(OwnerAddress),
show [
text('Welcome ', OwnerAddress)
].
The output value of the
owner
method is stored in the OwnerAddress
variable. To expose this value outside of your predicate, we just need to add it as an input.Last modified 1yr ago