# .derupt-core-yyyymmdd

{% hint style="info" %}
The core maybe require or receive upgrades/updates from time to time, for that we follow a simple date based naming convention to track versions. &#x20;
{% endhint %}

{% hint style="info" %}
**General:**

* **.derupt-core-yyyymmdd** contract is for handling public message & action logic.&#x20;
* **.derupt-core-yyyymmdd** contract receives calls from **.derupt-profile** contracts and proceeds to process them accordingly.
  {% endhint %}

{% hint style="warning" %}
**Warning:**

* **users should deploy a** `.derupt-profile`contract in app before using core features.
* **users should call**`.derupt-profile`
* **users should not call**`.derupt-core-yyyymmdd (nor logging contracts)`
  {% endhint %}

{% hint style="info" %}
**Functions Process Transactions Overview:**

What happens in a process depends on the function the user is calling.&#x20;

* **send-message**: mine-citycoin is called during this process.&#x20;
* **like-message**: transfer-citycoin is called during this process.
* **dislike-message**: stack-citycoin is called during this process.
* **favorable-reply-message**: mine-citycoin & transfer-citycoin is called during this process.
* **unfavorable-reply-message**: mine-citycoin & stack-citycoin is called during this process.&#x20;
  {% endhint %}

The five core functions and arguments in the `.derupt-core-yyyymmdd` contract:

<details>

<summary><mark style="color:orange;">send-message</mark> </summary>

<mark style="color:orange;">Broadcast Send Message to the Stacks Blockchain</mark>

**Data Flow of the Function:**\
1\)`.derupt-profile`\
2\)`.derupt-core-yyyymmdd` \
3\)`.derupt-feed (&.derupt-miners)`

**Arguments:**

* content
  * required || string-utf8 || Max: 256 || *Message Body*
* attachment-uri
  * optional || string-utf8 || Max: 256 || *Message Attachment* \
    *(example: 'bns\://1679121920338.mp3')*
* thumbnail-uri
  * optional || string-utf8 || Max: 256 || *Attachment Preview* \
    *(example: 'bns\://1679121920589.png')*
* reply-to
  * optional || string-utf8 || Max: 256 || *Stacks Transaction ID*
* cityName
  * required || string-ascii || Max: 10 || *Example: 'mia' or 'nyc'*
* alt-origin
  * required || string-utf8 || Max: 256 || *Alternative Origin*
* extras
  * optional || tuple || Max: 256 (per) || *10 Additional Arguments*&#x20;

**Responses:**

* Successful Stacks Transaction
* Unsuccessful Stacks Transaction

</details>

<details>

<summary><mark style="color:orange;">like-message</mark></summary>

<mark style="color:orange;">Broadcast Like Message to Stacks Blockchain</mark>

**Data Flow of the Function:**\
1\) `.derupt-profile`\
2\) `.derupt-core-yyyymmdd` \
3\) `.derupt-sentiment`

**Arguments:**

* author-principal
  * required || principal || principal || *The Liked Message Author Principal*
* liked-txid
  * required || string-utf8 || Max: 256 || *Stacks Transaction ID (of Liked Message)*
* contractId
  * required || trait\_reference || trait\_reference || *CityCoin Contract Reference*&#x20;

**Responses:**

* Successful Stacks Transaction
* Unsuccessful Stacks Transaction

</details>

<details>

<summary><mark style="color:orange;">dislike-message</mark></summary>

<mark style="color:orange;">Broadcast Dislike Message to Stacks Blockchain</mark>

**Data Flow of the Function:**\
1\) `.derupt-profile`\
2\) `.derupt-core-yyyymmdd` \
3\) `.derupt-sentiment (&.derupt-stackers)`

**Arguments:**

* author-principal
  * required || principal || principal || *The Liked Message Author Principal*
* disliked-txid
  * required || string-utf8 || Max: 256 || *Stacks Transaction ID (of Disliked Message)*
* cityName
  * required || string-ascii || Max: 10 || *Example: 'mia' or 'nyc'*
* contractId
  * required || trait\_reference || trait\_reference || *CityCoin Contract Reference*

**Responses:**

* Successful Stacks Transaction
* Unsuccessful Stacks Transaction

</details>

<details>

<summary><mark style="color:orange;">favorable-reply-message</mark></summary>

<mark style="color:orange;">Broadcast Favorable Reply Message to Stacks Blockchain</mark>

**Data Flow of the Function:**\
1\) `.derupt-profile`\
2\) `.derupt-core-yyyymmdd` \
3\) `.derupt-feed (&.derupt-sentiment &.derupt-miners)`

**Arguments:**

* content
  * required || string-utf8 || Max: 256 || *Message Body*
* author-principal
  * required || principal || principal || *The Liked Message Author Principal*
* attachment-uri
  * optional || string-utf8 || Max: 256 || *Message Attachment* \
    *(example: 'bns\://1679121920338.mp3')*
* thumbnail-uri
  * optional || string-utf8 || Max: 256 || *Attachment Preview* \
    *(example: 'bns\://1679121920589.png')*
* reply-to
  * optional || string-utf8 || Max: 256 || *Stacks Transaction ID*
* liked-txid
  * required || string-utf8 || Max: 256 || *Stacks Transaction ID (of Liked Message)*
* cityName
  * required || string-ascii || Max: 10 || *Example: 'mia' or 'nyc'*
* alt-origin
  * required || string-utf8 || Max: 256 || *Alternative Origin*
* contractId
  * required || trait\_reference || trait\_reference || *CityCoin Contract Reference*
* extras
  * optional || tuple || Max: 256 (per) || *10 Additional Arguments*

**Responses:**

* Successful Stacks Transaction
* Unsuccessful Stacks Transaction

</details>

<details>

<summary><mark style="color:orange;">unfavorable-reply-message</mark></summary>

<mark style="color:orange;">Broadcast Unfavorable Reply Message to Stacks Blockchain</mark>

**Data Flow of the Function:**\
1\) `.derupt-profile`\
2\) `.derupt-core-yyyymmdd` \
3\) `.derupt-feed (&.derupt-sentiment &.derupt-miners &.derupt-stackers)`

**Arguments:**

* content
  * required || string-utf8 || Max: 256 || *Message Body*
* author-principal
  * required || principal || principal || *The Liked Message Author Principal*
* attachment-uri
  * optional || string-utf8 || Max: 256 || *Message Attachment*
* thumbnail-uri
  * optional || string-utf8 || Max: 256 || *Attachment Preview*
* reply-to
  * optional || string-utf8 || Max: 256 || *Stacks Transaction ID*
* disliked-txid
  * required || string-utf8 || Max: 256 || *Stacks Transaction ID (of Disliked Message)*
* cityName
  * required || string-ascii || Max: 10 || *Example: 'mia' or 'nyc'*
* contractId
  * required || trait\_reference || trait\_reference || *CityCoin Contract Reference*
* alt-origin
  * required || string-utf8 || Max: 256 || *Alternative Origin*
* extras
  * optional || tuple || Max: 256 (per) || *10 Additional Arguments*

**Responses:**

* Successful Stacks Transaction
* Unsuccessful Stacks Transaction

</details>
