> For the complete documentation index, see [llms.txt](https://mainnet-doc.phoenix.global/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://mainnet-doc.phoenix.global/guides/deploy-smart-contract.md).

# Deploy Smart Contract

1. **Navigate to** [**remix.ethereum.org**](http://remix.ethereum.org/)

* Ensure that MetaMask is open, and you have PhoenixMainNet selected.
* Locate the button/icon for ‘**Deploy & run transactions**’ on the left-hand navigation. Currently, this is the 4th icon down.
* This will prompt a connection between Remix & Phoenix Mainnet in MetaMask. Select the wallet you want to connect.
* Under the **Environment** drop down, choose **Injected Web3**

<figure><img src="/files/XzmdtL8sDqYGqbjX3cwF" alt=""><figcaption></figcaption></figure>

2. **Create a new file**

* Click on the 2nd icon/button on the left side ‘File Explorer’
* Locate the icon/button to ‘**Create New File**’
* Enter the file name: **SimpleStorage.sol**

3. **Create the smart contract**

Copy the following smart contract into the main text field on the right-hand side.

```solidity
//SPDX-License-Identifier: UNLINCESED

pragma solidity >=0.4.0 <0.7.0;

contract SimpleStorage {
    uint storedData;

    function set(uint x) public {
        storedData = x;
    }

    function get() public view returns (uint) {
        return storedData;
    }
}
```

<figure><img src="/files/n0zgYU01a0XOScixJ3iR" alt=""><figcaption></figcaption></figure>

Let’s take a look at this contract….

> **SimpleStorage.sol**
>
> This smart contract has:
>
> * A variable storedData to store a number
> * A function get() to return the number stored at variable storedData
> * A function set() to change the number stored at variable storedData

4. **Compile the smart contract**

* Select 3rd icon/button at left side ‘**Solidity compiler**’

<figure><img src="/files/cpLdpUF9LFJXNyToi8FN" alt=""><figcaption></figcaption></figure>

{% hint style="info" %}
It is useful to enable auto-compile
{% endhint %}

<figure><img src="/files/NGzSKNCMEMgh1v6HNuLV" alt=""><figcaption></figcaption></figure>

* Click ‘**Compile SimpleStorage.sol**’

If everything is entered correctly, you should see a green check-mark next to the 3rd icon/button with the message ‘**Compilation successful**’.

<figure><img src="/files/VkWQeB4FA62fiFCj6Znf" alt=""><figcaption></figcaption></figure>

5. **Deploy a smart contract**

{% hint style="info" %}
To submit the transaction, you’ll need PHB tokens for gas. A form will be made available shortly to request PHB to support developer tasks.
{% endhint %}

* Navigate back to the icon/button ‘Deploy & run transactions’
* Since we have only one smart contract so far, it is automatically selected in the dropdown.

<figure><img src="/files/hHoTMWYCilq3tpQjeEmB" alt=""><figcaption></figcaption></figure>

* Click ‘**Deploy**’.

<figure><img src="/files/SyfogxXvcGTrmoddvRot" alt=""><figcaption></figcaption></figure>

* This will send the transaction to Metamask, requesting confirmation to create the smart contract SimpleStorage.sol

<figure><img src="/files/WqzI6XqiW16wJNCHWSfK" alt=""><figcaption></figcaption></figure>

* Click on confirm.
* At bottom right, we can check the message: creation of SimpleStorage pending…

<figure><img src="/files/j4z680WmhliMICFMT6aR" alt=""><figcaption></figcaption></figure>

* MetaMask will prompt that the transaction has been confirmed.

<figure><img src="/files/tErO7FbZqxZJGbBREaCr" alt=""><figcaption></figcaption></figure>

* In Remix, click on the transaction line or the debug button (at the right side) to see more details of the transaction:

<figure><img src="/files/9z0Ubxg58bDoH365e1Jl" alt=""><figcaption></figcaption></figure>

In this example, the transaction hash is: 0x604c0512e3bf41c3dca7a57ffe30ad0d232759b0a3cdc579a28871ede2cc0950

You can also view the example hash in Phoenix Explorer: <https://explorer.phoenix.global/transactions/0x604c0512e3bf41c3dca7a57ffe30ad0d232759b0a3cdc579a28871ede2cc0950>

6. **Success!**

You’ve successfully deployed a smart contract on Phoenix Mainnet. Congratulations!

If you have any questions, comments, or need further assistance, join us over on our Telegram <https://t.me/APEXcommunity>
