# .derupt-gifts

**The following function calls are only callable by .derupt-core-yyyymmdd:**

* log-gift

{% hint style="info" %}
Work in Progress
{% endhint %}

```
;; title: derupt-gifts
;; version: 1.3.1
;; summary: Gifts Contract
;; description: used to log Gifts

(use-trait sip-010-trait 'ST1ZK4MRVTQQJMVAAJQWBV2WPQ87QV2851YCTHD7X.sip-010-trait-ft-standard.sip-010-trait)
;; (use-trait sip-010-trait 'MAINNETADDRESS.sip-010-trait-ft-standard.sip-010-trait)

(use-trait derupt-ext-trait 'ST1ZK4MRVTQQJMVAAJQWBV2WPQ87QV2851YCTHD7X.derupt-ext-trait.derupt-ext)
;; (use-trait derupt-ext-trait 'MAINNETADDRESS.derupt-ext-trait.derupt-ext)

;; Error Constants
(define-constant ERR-UNAUTHORIZED (err u100))
(define-constant ERR-NOTFOUND (err u101))

;; Get Derupt core contract
(define-read-only (get-derupt-core-contract)
  (contract-call? .derupt-feed get-derupt-core-contract)
)

;; Log Gift
(define-public (log-gift (sender principal) 
  (recipient principal) (is-stx bool) 
  (contractId <sip-010-trait>) (amount uint) (memo (optional (buff 34))) (ext (optional <derupt-ext-trait>))
)
  (let 
    ((derupt-core-contract (unwrap! (get-derupt-core-contract) ERR-NOTFOUND))) 
    (asserts! (is-eq contract-caller derupt-core-contract) ERR-UNAUTHORIZED)
    (print { event: "gift", sender: sender, recipient: recipient, is-stx: is-stx, contractId: contractId, amount: amount, memo: memo, ext: ext})
    (ok true)
  )
)
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.derupt.io/latest/contracts/.derupt-gifts.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
