> 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

How to Deploy Smart Contract on Phoenix using Remix

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="https://4167953707-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuZnUB48XwnXYRY63FieU%2Fuploads%2FjnuEVlpWVuBoeCQzOIIE%2Fremix1.webp?alt=media&amp;token=b5ae0540-043a-4ce5-9b82-cc1f2371c666" 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="https://4167953707-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuZnUB48XwnXYRY63FieU%2Fuploads%2FuyKirsZ669sqCfd7RvWU%2Fremix2.webp?alt=media&amp;token=47418afb-6516-4b83-97d7-15eaaccffa96" 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="https://4167953707-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuZnUB48XwnXYRY63FieU%2Fuploads%2FGz4l9rGrEzekGVn3cxuj%2Fremix3.webp?alt=media&amp;token=ef624674-74b9-4f4c-bd76-ff3c31f6b265" alt=""><figcaption></figcaption></figure>

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

<figure><img src="https://4167953707-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuZnUB48XwnXYRY63FieU%2Fuploads%2FYze2lJa5a9Nb7YfoyjEy%2Fremix4.webp?alt=media&amp;token=bd14aa1f-7596-4c49-9bd3-badd9935870e" 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="https://4167953707-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuZnUB48XwnXYRY63FieU%2Fuploads%2FE0UaJBTvnsdF0sQF8uka%2Fremix5.webp?alt=media&amp;token=1b95c81a-a862-45cf-912f-fa4fdf8ddb13" 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="https://4167953707-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuZnUB48XwnXYRY63FieU%2Fuploads%2FUVxoJxQAoPHYc3PgsVlq%2Fremix6.webp?alt=media&amp;token=74322ac3-0736-430c-9d34-f9bff342242e" alt=""><figcaption></figcaption></figure>

* Click ‘**Deploy**’.

<figure><img src="https://4167953707-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuZnUB48XwnXYRY63FieU%2Fuploads%2FcmfPpsE2qBXIkmF3aT4w%2Fremix7.webp?alt=media&amp;token=72938bf4-808b-4158-9dfc-1fc573bec504" alt=""><figcaption></figcaption></figure>

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

<figure><img src="https://4167953707-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuZnUB48XwnXYRY63FieU%2Fuploads%2FpAKDFhrYhzHXBxbLz6e4%2Fremix8.webp?alt=media&amp;token=9557963f-7648-45e4-b778-fa4e2464b041" alt=""><figcaption></figcaption></figure>

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

<figure><img src="https://4167953707-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuZnUB48XwnXYRY63FieU%2Fuploads%2FdiiY6S6tAsw1OyGD2cQG%2Fremix9.webp?alt=media&amp;token=7ac33ffd-0d33-468d-8cae-05fc1f65103c" alt=""><figcaption></figcaption></figure>

* MetaMask will prompt that the transaction has been confirmed.

<figure><img src="https://4167953707-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuZnUB48XwnXYRY63FieU%2Fuploads%2FXtMhCwp4jSmRk9eUXiAG%2Fremix10.webp?alt=media&amp;token=09e14065-f2e9-4702-bd79-6754c7362624" 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="https://4167953707-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuZnUB48XwnXYRY63FieU%2Fuploads%2Fp6jnRYD3qWrE6vzX8PGT%2Fremix11.webp?alt=media&amp;token=eef991b9-6a70-4457-83d1-4f8bda277a5a" 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>
