You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: smart-contracts/dev-environments/remix/deploy-a-contract.md
+28-26Lines changed: 28 additions & 26 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,5 @@
1
1
---
2
-
title: Deploy and Interact with Smart Contracts Using Remix IDE
2
+
title: Deploy Contracts Using Remix IDE
3
3
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.
4
4
categories: Smart Contracts, Tooling
5
5
---
@@ -14,52 +14,54 @@ After compiling your smart contract in Remix IDE, the next step is to deploy it
14
14
15
15
Before deploying your contract, ensure you have:
16
16
17
-
- Completed the [Remix IDE setup](/smart-contracts/dev-environments/remix/get-started/){target=\_blank} and have a compiled contract ready
18
-
- A compatible wallet extension installed (e.g., [MetaMask](https://metamask.io/){target=\_blank} or [Talisman](https://www.talisman.xyz/){target=\_blank})
17
+
- Completed the [Remix IDE setup](/smart-contracts/dev-environments/remix/get-started/){target=\_blank} and have a compiled contract ready.
18
+
- A compatible wallet extension installed (e.g., [MetaMask](https://metamask.io/){target=\_blank} or [Talisman](https://www.talisman.xyz/){target=\_blank}).
19
19
- Your wallet connected to the Polkadot Hub network. Check the [Connect to Polkadot](/smart-contracts/connect/){target=\_blank} guide for more information.
20
-
- Test tokens in your wallet to cover deployment and transaction fees (available from the [Polkadot faucet](/smart-contracts/faucet/){target=\_blank})
20
+
- Test tokens in your wallet to cover deployment and transaction fees (available from the [Polkadot faucet](/smart-contracts/faucet/){target=\_blank}).
21
21
22
-
## Deploying Contracts
22
+
## Deploy Contracts
23
23
24
-
1. To deploy your contract, you need to:
24
+
The steps use Remix IDE to deploy a contract to Polkadot Hub are as follows:
25
25
26
-
1. Navigate to the **Deploy & Run Transactions** tab.
27
-
2. Click the **Environment** dropdown.
28
-
3. Select **Browser Extension**.
29
-
4. Click on the **Injected Provider - MetaMask** option.
26
+
1. Navigate to [Remix](https://remix.ethereum.org/){target=\_blank} in your web browser.
27
+
2. Locate the **Deploy & Run Transactions** tab.
28
+
3. Select the **Environment** dropdown.
29
+
4. Select **Browser Extension**.
30
+
5. Select the **Injected Provider - MetaMask** option.
31
+
6. Click the **Deploy** button and then click **Confirm** in the wallet popup.
30
32
31
-
2. Click the **Deploy** button and then click **Confirm**in the wallet popup.
33
+
Once your contract is deployed successfully, you will see the deployment confirmation in the Remix terminal.
32
34
33
-
3. Once your contract is deployed successfully, you will see the deployment confirmation in the Remix terminal.
Once deployed, your contract appears in the **Deployed/Unpinned Contracts** section:
39
+
Deployed contracts appear in the **Deployed/Unpinned Contracts** section. Follow these steps to interact with the deployed contract:
40
40
41
41
1. Expand the contract to view available methods.
42
42
43
43
!!! tip
44
44
Pin your frequently used contracts to the **Pinned Contracts** section for easy access.
45
45
46
-
2. To interact with the contract, you can select any of the exposed methods.
46
+
2. Select any of the exposed methods to interact with the contract.
47
+
48
+
You can use these methods to interact with your deployed contract by reading or writing to its state. Remix IDE uses a color-coding scheme for method buttons to help differentiate between types of available methods as follows:
47
49
48
-
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:
50
+
-**Blue buttons**: indicate `view` or `pure` functions which read state only. Interactions do not create a new transaction and will not result in gas fees.
51
+
-**Orange buttons**: label `non-payable` functions which change contract state but don't accept any value (ETH or other tokens) being sent with the transaction.
52
+
-**Red buttons**: designate `payable` functions which create a transaction and can accept a value (ETH or other tokens) to send with the transaction.
49
53
50
-
-**Red**: Modifies state and is payable.
51
-
-**Orange**: Modifies state only.
52
-
-**Blue**: Reads state.
54
+
If you deployed the `Counter.sol` contract from [Remix IDE setup](/smart-contracts/dev-environments/remix/get-started/){target=\_blank}, you can try interacting with the exposed methods as follows:
53
55
54
-
3. Click the **GetCount** button to read the current count value.
56
+
1. Select the **GetCount** button to read the current count value.
55
57
56
-
4. Click the **Increment** button to increment the count value.
58
+
2. Select the **Increment** button to increment the count value.
57
59
58
-
5. Submit the transaction and click the **Confirm** button in the wallet pop-up.
60
+
3. Submit the transaction and click the **Confirm** button in the wallet pop-up.
59
61
60
-
6.Once the transaction is confirmed, you will see the updated count value in the Remix terminal.
62
+
Once the transaction is confirmed, you will see the updated count value in the Remix terminal.
0 commit comments