> For the complete documentation index, see [llms.txt](https://docs.metaproprotocol.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.metaproprotocol.com/developer-documentation/smart-contracts/metaproreferral/read-contract.md).

# Read Contract

## Link to the Smart Contract:&#x20;

{% embed url="<https://bscscan.com/address/0x5078ef87Afb28e24936a16Fd3FBac27867549626#readContract>" %}

### getReferral

The getReferral method is responsible for returning the upline address (referrer) for a given address within the referral system.

<figure><img src="https://t26441698.p.clickup-attachments.com/t26441698/8443217b-2d02-48d1-a036-4c27e3a21a87/image.png" alt=""><figcaption></figcaption></figure>

a. Input Address&#x20;

b. Responses upline referral

### getReferralContractDeposits

The getReferralContractDeposits function is used to retrieve information about deposits related to the referral system for a specified contract address and referrer address. The function is public and read-only. The function returns an array of ReferralDeposits\[] containing information about the deposits made by the referrer associated with the given contract address.

<figure><img src="https://t26441698.p.clickup-attachments.com/t26441698/352b74b9-12cd-4487-9fb4-488bb979b547/image.png" alt=""><figcaption></figcaption></figure>

a. The address of the referrer.&#x20;

b. The address of the contract for which referral deposits are being retrieved.&#x20;

c. An array containing information about referral deposits made by the specified referrer for the given contract address.

### getReferralContractEearnings

The getReferralContractEearnings function is used to retrieve information about earnings from the referral system for a specified contract address and referrer address. The function is public and read-only. The function returns earnings information from the referral system, including the total earnings (all), earnings at level 1 (level1), earnings at level 2 (level2), and earnings at level 3 (level3) for the specified referrer address associated with the given contract address.a. The address of the referrer.b. The address of the contract for which referral earnings information is being retrieved.c. Total earnings from referrals for the specified referrer and contract address.

<figure><img src="https://t26441698.p.clickup-attachments.com/t26441698/e10b5b5e-26cb-402a-b643-07d8d5105a95/image.png" alt=""><figcaption></figcaption></figure>

a. The address of the referrer.&#x20;

b. The address of the contract for which referral earnings information is being retrieved.&#x20;

c. Total earnings from referrals for the specified referrer and contract address.

### getReferralDeposits

The getReferralDeposits method is responsible for returning the referral history for a given address. It provides information about referrals, including the contract address, token amount, ID number, buyer's address, purchased token quantity, and equivalent value received through the referral.

<figure><img src="https://t26441698.p.clickup-attachments.com/t26441698/98c8e229-55c1-4d09-b22f-9bc40324efb5/image.png" alt=""><figcaption></figcaption></figure>

a. Input address&#x20;

b. Shows the history of an address referral earnings

### getReferralEarnings

The getReferralEarnings method is responsible for calculating and returning the total earnings generated by the referral system for specific levels.a. Input addressb. Shows the Earning, of the referral levels

<figure><img src="https://t26441698.p.clickup-attachments.com/t26441698/df867093-8c49-4c9c-a231-0dc25f140c34/image.png" alt=""><figcaption></figcaption></figure>

a. Input address

b. Shows the Earning, of the referral levels

### getReferralStructure

The getReferralStructure method is responsible for providing a detailed referral structure for each level, including the wallet address associated with each level

<figure><img src="https://t26441698.p.clickup-attachments.com/t26441698/8c1d4628-d6c9-4656-82c6-e4534415435c/image.png" alt=""><figcaption></figcaption></figure>

a. Input address&#x20;

b. Shows the User Structure of Referrals

### isAdmin

The isAdmin method serves to verify whether the given address possesses administrative permissions. The method returns a boolean value, where true indicates that the address has admin privileges, and false indicates the absence of such privileges.

<figure><img src="https://t26441698.p.clickup-attachments.com/t26441698/73a6abd3-1648-457b-8e96-4ed4899a436e/image.png" alt=""><figcaption></figcaption></figure>

a. Input address&#x20;

b. Return True or False

### owner

The method allows obtaining the address of the individual or entity that deployed and owns the smart contract. The contract owner has special privileges and permissions to perform certain administrative tasks or manage critical functionalities of the contract.

<figure><img src="https://t26441698.p.clickup-attachments.com/t26441698/06b23200-c6b8-45b6-9ff2-e6320ab1c80c/image.png" alt=""><figcaption></figcaption></figure>

### referralStructure

The referralStructure method is responsible for retrieving the upline address of a referral within the referral structure.

<figure><img src="https://t26441698.p.clickup-attachments.com/t26441698/5d5925d8-4aa7-43a1-b309-f32f89aa9af3/image.png" alt=""><figcaption></figcaption></figure>

a. Input address

b. Shows the upline Referrer address

### referredCount

The referredCount method is responsible for retrieving the count of individuals registered in both the downline and upline for a given user.

<figure><img src="https://t26441698.p.clickup-attachments.com/t26441698/efca4e2b-7b1d-47ed-b837-403645f05a09/image.png" alt=""><figcaption></figcaption></figure>

a. Input address&#x20;

b. Shows the Count of the referral structure of an address


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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.metaproprotocol.com/developer-documentation/smart-contracts/metaproreferral/read-contract.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.
