Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
382 changes: 299 additions & 83 deletions .ai/categories/smart-contracts.md

Large diffs are not rendered by default.

382 changes: 299 additions & 83 deletions .ai/categories/tooling.md

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -1,5 +1,81 @@
---
title: Deploy and Interact with Smart Contracts Using Remix IDE
description: Learn how to deploy smart contracts to the Polkadot Hub network and interact with them using the Remix IDE and wallet providers, covering deployment and state.
categories: Smart Contracts, Tooling
url: https://docs.polkadot.com/smart-contracts/dev-environments/remix/deploy-a-contract/
---

TODO
# Deploy Smart Contracts Using Remix IDE

## Overview

After compiling your smart contract in Remix IDE, the next step is to deploy it to the Polkadot Hub network. This guide will walk you through the deployment process using a wallet provider and show you how to interact with your deployed contracts directly from the Remix interface.

## Prerequisites

Before deploying your contract, ensure you have:

- Completed the [Remix IDE setup](/smart-contracts/dev-environments/remix/get-started/){target=\_blank} and have a compiled contract ready
- A compatible wallet extension installed (e.g., [MetaMask](https://metamask.io/){target=\_blank} or [Talisman](https://www.talisman.xyz/){target=\_blank})
- Your wallet connected to the Polkadot Hub network. Check the [Connect to Polkadot](/smart-contracts/connect/){target=\_blank} guide for more information.
- Test tokens in your wallet to cover deployment and transaction fees (available from the [Polkadot faucet](/smart-contracts/faucet/){target=\_blank})

## Deploying Contracts

1. To deploy your contract, you need to:

1. Navigate to the **Deploy & Run Transactions** tab.
2. Click the **Environment** dropdown.
3. Select **Browser Extension**.
4. Click on the **Injected Provider - MetaMask** option.

2. Click the **Deploy** button and then click **Confirm** in the wallet popup.

3. Once your contract is deployed successfully, you will see the deployment confirmation in the Remix terminal.

![](/images/smart-contracts/dev-environments/remix/deploy-a-contract/remix-1.gif)

## Interacting with Contracts

Once deployed, your contract appears in the **Deployed/Unpinned Contracts** section:

1. Expand the contract to view available methods.

!!! tip
Pin your frequently used contracts to the **Pinned Contracts** section for easy access.

2. To interact with the contract, you can select any of the exposed methods.

In this way, you can interact with your deployed contract by reading its state or writing to it. The button color indicates the type of interaction available:

- **Red**: Modifies state and is payable.
- **Orange**: Modifies state only.
- **Blue**: Reads state.

3. Click the **GetCount** button to read the current count value.

4. Click the **Increment** button to increment the count value.

5. Submit the transaction and click the **Confirm** button in the wallet pop-up.

6. Once the transaction is confirmed, you will see the updated count value in the Remix terminal.

![](/images/smart-contracts/dev-environments/remix/deploy-a-contract/remix-2.gif)

## Where to Go Next

You've successfully deployed and interacted with your smart contract on Polkadot Hub using Remix IDE. Continue enhancing your development workflow with these resources:

<div class="grid cards" markdown>



- <span class="badge guide">Guide</span> __Troubleshooting and FAQs__

---

Find solutions to common issues when working with Remix IDE.

[:octicons-arrow-right-24: Get Started](/smart-contracts/dev-environments/remix/troubleshooting-faq/)

</div>
115 changes: 32 additions & 83 deletions .ai/pages/smart-contracts-dev-environments-remix-get-started.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,17 @@
---
title: Use the Polkadot Remix IDE
description: Explore the smart contract development and deployment process on Asset Hub using Remix IDE, a visual IDE for blockchain developers.
title: Use the Remix IDE on Polkadot Hub
description: Explore the smart contract development and deployment process on Polkadot Hub using Remix IDE, a visual IDE for blockchain developers.
categories: Smart Contracts, Tooling
url: https://docs.polkadot.com/smart-contracts/dev-environments/remix/get-started/
---

# Remix IDE

!!! smartcontract "PolkaVM Preview Release"
PolkaVM smart contracts with Ethereum compatibility are in **early-stage development and may be unstable or incomplete**.
## Introduction

<<<<<<< HEAD
Remix IDE is a robust browser-based development environment for smart contracts. This guide will walk you through the essentials of the [Remix IDE](https://remix.ethereum.org/){target=\_blank} to understand the processes of compiling, developing, and deploying smart contracts on Polkadot Hub.
=======
<div class="grid cards" markdown>
- :octicons-code-16:{ .lg .middle } __Deploy NFTs Using Remix IDE__

Expand All @@ -35,40 +38,35 @@ url: https://docs.polkadot.com/smart-contracts/dev-environments/remix/get-starte
## Overview

Remix IDE is a robust browser-based development environment for smart contracts. This guide will walk you through the essentials of the [Polkadot Remix IDE](https://remix.polkadot.io/){target=\_blank} to understand the processes of compiling, developing, and deploying smart contracts on Asset Hub.
>>>>>>> staging/product-ia

## Prerequisites

Before getting started, ensure you have:

- A web browser with [Talisman](https://talisman.xyz/){target=\_blank} extension installed.
- A web browser with the [MetaMask](https://metamask.io/){target=\_blank} extension installed.
- Basic understanding of Solidity programming.
- Some WND test tokens to cover transaction fees (easily obtainable from the [Polkadot faucet](https://faucet.polkadot.io/westend?parachain=1000){target=\_blank}).
- Some test tokens to cover transaction fees (easily obtainable from the [Polkadot faucet](/smart-contracts/faucet/){target=\_blank}).

## Accessing Remix IDE
## Access Remix IDE

Navigate to [https://remix.polkadot.io/](https://remix.polkadot.io/){target=\_blank}. The interface will load with a default workspace containing sample contracts.
Navigate to [https://remix.ethereum.org/](https://remix.ethereum.org/){target=\_blank}. The interface will load with a default workspace containing sample contracts.

![](/images/smart-contracts/dev-environments/remix/get-started/remix-1.webp)

In this interface, you can access a file explorer, edit your code, interact with various plugins for development, and use a terminal.
In this interface, you can access a file explorer, edit your code, interact with various development plugins, and use a terminal.

## Creating a New Contract
## Create a New Contract

To create a new contract using the Polkadot Remix IDE, you can follow these steps:
To create a new contract using the Remix IDE, you can follow these steps:

1. Select the **Create a new file** button in the `contracts` folder.

![](/images/smart-contracts/dev-environments/remix/get-started/remix-2.webp)

2. Name your file with a `.sol` extension, in this case, `Counter.sol`.

![](/images/smart-contracts/dev-environments/remix/get-started/remix-3.webp)

3. Write your Solidity code in the editor.

You can use the following code as an example:
3. Write your Solidity code in the editor. You can use the following code as an example:

???- "Counter.sol"
??? code "Counter.sol"

```solidity
// SPDX-License-Identifier: MIT
Expand All @@ -91,95 +89,46 @@ To create a new contract using the Polkadot Remix IDE, you can follow these step
}
```

![](/images/smart-contracts/dev-environments/remix/get-started/remix-4.webp)
![](/images/smart-contracts/dev-environments/remix/get-started/remix-2.gif)


## Compiling Your Contract
## Compile Your Contract

1. To compile your contract, you need to:
To compile your contract, you need to:

1. Navigate to the **Solidity Compiler** tab (third icon in the left sidebar).
2. Select **Compile** or use `Ctrl+S`.
1. Navigate to the **Solidity Compiler** tab.
2. Select **Compile** or use `Ctrl+S`.

![](/images/smart-contracts/dev-environments/remix/get-started/remix-5.webp)

!!! note
Compilation errors and warnings appear in the terminal panel at the bottom of the screen.
!!! note
Compilation errors and warnings appear in the terminal panel at the bottom of the screen.

1. After compiling your contract, you can navigate to the **File Explorer** tab (first icon in the left sidebar) and check that:
1. The `artifact` folder is present.
3. After compiling your contract, you can navigate to the **File Explorer** tab and check that:
1. The **artifacts** folder is present.
2. The `Counter_metadata.json` and the `Counter.json` files have been generated.

![](/images/smart-contracts/dev-environments/remix/get-started/remix-6.webp)

## Deploying Contracts

1. To deploy your contract, you need to:

1. Navigate to the **Deploy & Run Transactions** tab (fourth icon in the left sidebar).
2. Click the **Environment** dropdown.
3. Select **Customize this list**.

![](/images/smart-contracts/dev-environments/remix/get-started/remix-7.webp)

2. Enable the **Injected Provider - Talisman** option.

![](/images/smart-contracts/dev-environments/remix/get-started/remix-8.webp)

4. Click again the **Environment** dropdown and select **Injected Provider - Talisman**.

![](/images/smart-contracts/dev-environments/remix/get-started/remix-9.webp)

4. Click the **Deploy** button and then click **Approve** in the Talisman wallet popup.

![](/images/smart-contracts/dev-environments/remix/get-started/remix-10.webp)

5. Once your contract is deployed successfully, you will see the following output in the Remix terminal:

![](/images/smart-contracts/dev-environments/remix/get-started/remix-11.webp)

## Interacting with Contracts

Once deployed, your contract appears in the **Deployed/Unpinned Contracts** section:

1. Expand the contract to view available methods.

![](/images/smart-contracts/dev-environments/remix/get-started/remix-12.webp)

!!! tip
Pin your frequently used contracts to the **Pinned Contracts** section for easy access.

2. To interact with the contract, you can select any of the exposed methods.

![](/images/smart-contracts/dev-environments/remix/get-started/remix-13.webp)

In this way, you can interact with your deployed contract by reading its state or writing to it. The button color indicates the type of interaction available:

- **Red**: Modifies state and is payable.
- **Orange**: Modifies state only.
- **Blue**: Reads state.
![](/images/smart-contracts/dev-environments/remix/get-started/remix-3.gif)

## Where to Go Next

The Polkadot Remix IDE offers an environment for developing, compiling, and deploying smart contracts on Asset Hub. Its intuitive interface allows developers to easily write Solidity code, compile contracts, and interact with them directly in the browser.
Remix offers an environment for developing, compiling, and deploying smart contracts on Polkadot Hub. Its intuitive interface allows developers to easily write Solidity code, compile contracts, and interact with them directly in the browser.

Explore more about smart contracts through these resources:

<div class="grid cards" markdown>

- <span class="badge guide">Guide</span> __Smart Contracts on Polkadot__
- <span class="badge guide">Guide</span> __Deploy a Contract__

---

Dive into advanced smart contract concepts.
Learn how to deploy smart contracts using Remix IDE.

[:octicons-arrow-right-24: Get Started](/smart-contracts/)
[:octicons-arrow-right-24: Get Started](/smart-contracts/dev-environments/remix/deploy-a-contract)

- <span class="badge external">External</span> __OpenZeppelin Contracts__

---

Test your skills by deploying a simple contracts with prebuilt templates.
Test your skills by deploying simple contracts using prebuilt templates.

[:octicons-arrow-right-24: Get Started](https://www.openzeppelin.com/solidity-contracts){target=\_blank}

Expand Down
Loading
Loading