# Using Execute Messages

## What are Execute Messages?

Execute messages are transactions sent to a smart contract, instructing it to perform specific actions or operations. These messages can trigger functions defined within the smart contract code, enabling users to interact with the contract's functionality. In short, execute messages are the messages we use to interact with an ADO.&#x20;

Each of our ADOs has two sets of execute messages:

* **Base ADO Execute:** A set of execute messages common to all our ADOs that provide basic information about the ADO. Examples of base executes include transfering ownership of an ADO or setting permissions for an ADO. The list of base executes can be found [here](https://docs.andromedaprotocol.io/andromeda/platform-and-framework/ado-base/andromedamsg).
* **Custom Execute messages:** A set of execute messages unique to each ADO. These execute depends on the use of the ADO  and are specific to that use. Examples of custom executes include minting an NFT in an CW721, bidding on an NFT in an Auction, sending some tokens in a CW20.

The execute messages can be found in the ADO's panel in the assets page by pressing on the three dots as seen in the image below:

{% hint style="info" %}
You can also use execute messages from our [CLI ](https://docs.andromedaprotocol.io/andromeda/andromeda-cli/introduction)but we will be focusing on executing from the web-app in this example.
{% endhint %}

<figure><img src="https://3919035805-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FaNGg2pluC6LG4475Lq89%2Fuploads%2FklvX3mnsaGvrdqsf1eUJ%2FScreen%20Shot%202024-04-25%20at%206.25.45%20PM.png?alt=media&#x26;token=8626fce6-e282-45f8-9b58-948df6299e64" alt=""><figcaption></figcaption></figure>

This will display the list of execute messages available for that component. Each execute will perform a different action on the ADO. You can read about each ADO's execute messages [here](https://docs.andromedaprotocol.io/andromeda/andromeda-digital-objects/introduction-to-ados). Selecting the execute message that you want to perform, will take you to a new page where you can set up the message.&#x20;

### Example

{% hint style="warning" %}
If you dont have any assets yet, it is fine to just read and understand how an execute message works for now. You will get plenty of hands on examples in our [ADO Builder](https://docs.andromedaprotocol.io/guides/guides-and-examples/ado-builder) guides.
{% endhint %}

Let us perform an execute message to mint some NFTs. On any CW721 ADO I will select the three dots and choose the **Mint** execute message from the list:

<figure><img src="https://3919035805-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FaNGg2pluC6LG4475Lq89%2Fuploads%2FuO4eaEMC6xWVt4Oordno%2FScreen%20Shot%202024-04-25%20at%206.32.45%20PM.png?alt=media&#x26;token=090b5238-e63b-4e8e-9552-14764f6d4c31" alt=""><figcaption></figcaption></figure>

<figure><img src="https://3919035805-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FaNGg2pluC6LG4475Lq89%2Fuploads%2FOs3hJwhRs0I443AOGONh%2FScreen%20Shot%202024-04-25%20at%207.26.35%20PM.png?alt=media&#x26;token=21fe81d7-62ee-4c44-9a0d-f0b0dfe95ab8" alt=""><figcaption></figcaption></figure>

Here, you can set up the minting options to mint an NFT:

<figure><img src="https://3919035805-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FaNGg2pluC6LG4475Lq89%2Fuploads%2FkIMBF0tAlbkMe8WN3kAk%2FScreen%20Shot%202024-04-25%20at%207.28.55%20PM.png?alt=media&#x26;token=1b8d7b28-3248-498d-aeed-f215e73e70c3" alt=""><figcaption></figcaption></figure>

Once you have configured your execute message, you can press the publish button to send the message to the chain and have the ADO execute the mint. Once published, your CW721 ADO will have 1 minted NFT. You can check this by performing a query which we will cover in the next section.

### Multi Execute

To make life easier, we have created a multi-execute option for our users which allows them to send multiple execute messages in one go:

<figure><img src="https://3919035805-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FaNGg2pluC6LG4475Lq89%2Fuploads%2FAGcG4sAdqeVT9E2tQpSw%2FScreen%20Shot%202024-05-01%20at%208.20.41%20PM.png?alt=media&#x26;token=809ef1ab-565f-4949-a9af-7b2e07441396" alt=""><figcaption></figcaption></figure>

<figure><img src="https://3919035805-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FaNGg2pluC6LG4475Lq89%2Fuploads%2F3YF89MJf7P3DxXpRMHGo%2FScreen%20Shot%202024-05-01%20at%208.35.32%20PM.png?alt=media&#x26;token=a9161d1f-00f5-428c-89f3-0325f59cdace" alt=""><figcaption></figcaption></figure>

Selecting "**Add Attachment**" will allow us to attach a new execute message. For the first message, I want to burn the NFT I minted earlier so I select the Burn message from the options:

<figure><img src="https://3919035805-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FaNGg2pluC6LG4475Lq89%2Fuploads%2FtVdy82yXiB1ImuQqGKEI%2FScreen%20Shot%202024-05-01%20at%208.37.47%20PM.png?alt=media&#x26;token=c025eb4d-ce0f-4c9e-9830-39bcf76385d1" alt=""><figcaption></figcaption></figure>

Next I want to mint a new NFT. So I select **Add Attachment** once more and select **Mint** from the list of execute messages:

<figure><img src="https://3919035805-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FaNGg2pluC6LG4475Lq89%2Fuploads%2FWwKR2dabfICluCDdtVJG%2FScreen%20Shot%202024-05-01%20at%208.39.40%20PM.png?alt=media&#x26;token=43adb603-d898-4609-a5a6-56d45c3716d4" alt=""><figcaption></figcaption></figure>

I can keep adding messages as I see fit. When done, I can publish all these messages to the chain in one go.

### Execute Message Attachments

In some cases, an execute message will require funds to be sent along with the message. For example, let us say you are buying an NFT on the **Andromeda** chain from a marketplace for 10000uandr, you cant just execute the **Buy**  message without sending any funds along with it to actually pay for the NFT. To do so, you select the Add Attachment:

<figure><img src="https://3919035805-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FaNGg2pluC6LG4475Lq89%2Fuploads%2FQ3ef5PRbojmH689ZFfWw%2FScreenshot%202024-08-19%20at%206.55.03%E2%80%AFPM.png?alt=media&#x26;token=3fc98508-3898-4b0c-9512-b37e3f687048" alt=""><figcaption></figcaption></figure>

Then select Add Fund:

<figure><img src="https://3919035805-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FaNGg2pluC6LG4475Lq89%2Fuploads%2FoVufW1lscld0CtaoQ6vv%2FScreenshot%202024-08-19%20at%206.56.46%E2%80%AFPM.png?alt=media&#x26;token=d2e8d49b-bbfc-429a-bfff-ad2a73223e0c" alt=""><figcaption></figcaption></figure>

Once selected, the following panel will show up:

<figure><img src="https://3919035805-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FaNGg2pluC6LG4475Lq89%2Fuploads%2Fy2Zv0lPIdMYEzoxjdQrg%2FScreenshot%202024-08-19%20at%206.58.19%E2%80%AFPM.png?alt=media&#x26;token=816d3062-2a84-477e-8d20-11c4424070b1" alt=""><figcaption></figcaption></figure>

Here you can sepcify:

* **Coin Denom:** The micro-denomination of the funds you are sending. This is usually the native funds used by the chain you are connected to. In the example we mentioned above we are on the **Andromeda** chain, so it would be "uandr".
* **Amount:** The amount of funds to send which should be the price of the NFT in the case of a marketplace.&#x20;

{% hint style="warning" %}
Funds attachments are also used to pay off any fees that might be assosiated with an execute message.
{% endhint %}
