.cryptocash-token-trait

This doc is wip of v1 .cryptocash-token-trait contract - for CryptoCash needs

;; CryptoCash Token Trait

(define-trait cryptocash-token
  (
    (activate-token (principal uint)
      (response bool uint)
    )

    (set-token-uri ((optional (string-utf8 256)))
      (response bool uint)
    )

    (mint (uint principal)
      (response bool uint)
    )

    (burn (uint principal)
      (response bool uint)
    )

    (send-many ((list 200 { to: principal, amount: uint, memo: (optional (buff 34)) }))
      (response bool uint)
    )
  )
)
  1. activate-token: This function seems to activate a token for a given principal (possibly a user). It takes a principal and a uint parameter and returns a boolean indicating success or failure, along with a uint.

  2. set-token-uri: This function sets the URI for the token. It takes an optional string parameter and returns a boolean indicating success or failure, along with a uint.

  3. mint: This function mints tokens for a given principal. It takes a uint parameter (possibly representing the number of tokens) and a principal parameter and returns a boolean indicating success or failure, along with a uint.

  4. burn: This function burns tokens for a given principal. It takes a uint parameter (possibly representing the number of tokens to burn) and a principal parameter and returns a boolean indicating success or failure, along with a uint.

  5. send-many: This function sends tokens to multiple recipients. It takes a list of up to 200 entries, each containing a 'to' principal, an 'amount' uint, and an optional 'memo' buffer parameter. It returns a boolean indicating success or failure, along with a uint.

Last updated