> For the complete documentation index, see [llms.txt](https://docs.5sky.io/ecosystem/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.5sky.io/ecosystem/products/5sky-nft-project/5sky-lti-core.md).

# 5SKY LTI (Core)

5Sky LTI Smart Contract Analysis

We will now delve into the `5Sky LTI` smart contract, known within our team as the 'core' of phase two. The contract's interrelation with other contracts will also be discussed.

**Contract Functions**

1. **Create Function**: This function allows the creation of a new artistic token and lists it for sale.
2. **Purchase Function**: Users can purchase an NFT token using a unique invitation code. Any additional funds sent will be returned to the buyer. Each `purchase` transaction creates a maximum of 28 logs, which can generally be segmented into three transaction parts and five log sections. Notably, in the `Interacted With (To)` section of a transaction initiated via the `purchase` function, you will observe a reward distribution to the senior team members amounting to 55% of the transaction value, a 20% transfer to the PancakeSwap exchange for securing 5Sky tokens, and a 25% division among the various departments of the 5Sky development and marketing team. All these distributions are conducted using the BNB cryptocurrency.
3. **Upgrade Function**: This allows the NFT token holder to elevate the design associated with their token to a more valuable one. Users must pay the price difference between the two designs, and any surplus funds are returned.

In simpler terms, when a user makes a purchase of an NFT, the `purchase` function is called. The BEP-20 Tokens Transferred section of the transaction page shows the transfer of the purchased token from [PancakeSwap](https://pancakeswap.finance/) to the token sharing contract. Upon this transfer, 25% of the tokens instantly go to the lottery contract, and the remaining 75% go to the user who invoked the function.

**Data Structure**: The `NFTData` structure encapsulates information about an NFT token, including its associated design, invitation code, number of subsets, and parent token ID.

A notable point is that 5% of the total 5SKY tokens reside in the contract address [`0xad94A9B78b2B97DB6492a5504D4524e4DAFdf74f`](https://bscscan.com/address/0xad94A9B78b2B97DB6492a5504D4524e4DAFdf74f). This is set up in this manner since transactions on the 5Sky token involve certain fees for burning, administrative purposes, and charity. The details can be found in the [5Sky token project's](/ecosystem/products/5sky-token-project.md) description. We ensure that these fees aren't deducted from the reward tokens given to the user invoking the function. Instead, the deductions are made from the 5% reserve in the aforementioned contract address.

To clarify further, the reason this contract isn't exempted from fees, like the `owner` role in many token contracts, is to prevent potential misuse and to ensure future contract modifications don't compromise the added value principles.

Lastly, in the BEP-721 Tokens Transferred section, we can observe the transfer of the purchased NFT from an `owner` or [`supervisor`](https://bscscan.com/address/0xc00db80b5535054f9b99887f871cb652c465d1e2) wallet to the user invoking the function.

The same process, with a few modifications, applies when the `upgrade` function is called. However, the [BEP-721](https://academy.binance.com/en/glossary/bep-721) Tokens Transferred section would not be present as only the NFT holder can invoke this function.

{% hint style="info" %}

#### **Benefit Sharing during NFT Upgrade**

Members of our team will also profit from the "upgrade" of an NFT, in the same manner as they do from its "purchase". The reward distribution process remains identical to the "purchase" procedure. This means that whenever a user opts to upgrade their NFT, the associated benefits are shared amongst team members according to predefined protocols.
{% endhint %}

{% hint style="success" %}

#### **Upgrade Transaction Costs**

It's important to note that during the upgrade of an NFT, the user will be charged based on the price difference between their current and new plan. However, this fee strictly pertains to the upgrade difference and will not encompass any additional costs, nor will it include a fee of 5 USDT (Tether). This ensures that the upgrade remains as cost-effective as possible for the user, while still allowing the team to gain the intended benefits.
{% endhint %}

For more intricate details on invoking functions and examining logs, kindly refer to the technical details section under 'developer'.
