=====================================
Public function definition
=====================================

(define-public (hello-world (name (string-ascii 32)))
  (let
    (
      (foo (+ 3 1))
      (bar u5)
      (user tx-sender)
    )
    (ok 1)
  )
)

---
    (source
      (function_definition
        (public_function
          (function_signature
            (identifier)
            (function_parameter
              (identifier)
              (parameter_type
                (native_type
                  (ascii_string_type)))))
          (let_expression
            (local_binding
              (identifier)
              (basic_native_form
                (native_identifier)
                (int_lit)
                (int_lit)))
            (local_binding
              (identifier)
              (uint_lit))
            (local_binding
              (identifier)
              (global))
            (response_lit
              (int_lit))))))





=====================================
Private function definition
=====================================

(define-private (hello-world (name (string-ascii 32)))
  (let
    (
      (foo (+ 3 1))
      (bar u5)
      (user tx-sender)
    )
    (ok 1)
  )
)

---

    (source
      (function_definition
        (private_function
          (function_signature
            (identifier)
            (function_parameter
              (identifier)
              (parameter_type
                (native_type
                  (ascii_string_type)))))
          (let_expression
            (local_binding
              (identifier)
              (basic_native_form
                (native_identifier)
                (int_lit)
                (int_lit)))
            (local_binding
              (identifier)
              (uint_lit))
            (local_binding
              (identifier)
              (global))
            (response_lit
              (int_lit))))))


=====================================
Trait definition
=====================================

;; mainnet principal: 'M0R8C3RD1EHAP2A37ERSSSZSWCS9T2GY5FGXNALC.sip-010-trait

(define-trait sip-010-trait
  (
    ;; Transfer from the caller to a new principal
    (transfer (uint principal principal (optional (buff 34))) (response bool uint))
  )
)

---

    (source
      (comment)
      (trait_definition
        (identifier)
        (comment)
        (function_signature_for_trait
          (identifier)
          (parameter_type
            (native_type))
          (parameter_type
            (native_type))
          (parameter_type
            (native_type))
          (parameter_type
            (native_type
              (optional_type
                (native_type
                  (buffer_type)))))
          (native_type
            (response_type
              (native_type))))))
