Public functions can be called by external transactions or other contracts. They must return a `response` type.
clarity
(define-public (set-value (val uint))
(begin
(var-set counter val)
(ok val)))100 XP to Apprentice
Callable entry points for transactions.
AI translates the explanation and quiz text while preserving code and answer scoring.
Public functions can be called by external transactions or other contracts. They must return a `response` type.
clarity
(define-public (set-value (val uint))
(begin
(var-set counter val)
(ok val)))1. What return type is mandatory for define-public functions?
2. Can anyone invoke a public function?