Skip to content

Rename Asset Hub to Polkadot / Westend Hub #572

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: staging-ah-smart-contracts
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
},
{
"title": "Get Network Configuration Details",
"content": "Configure your development environment with the appropriate network settings for your chosen platform: <br><br> - **PolkaVM** - [Connect to Asset Hub](/develop/smart-contracts/connect-to-asset-hub/){target=_blank} <br> - **EVM** - [Moonbeam Documentation](https://docs.moonbeam.network/){target=_blank}, [Astar Documentation](https://docs.astar.network/){target=_blank}, [Acala Documentation](https://wiki.acala.network/){target=_blank} <br> - **Wasm (ink!)** - depends on those parachains that implement `pallet-contracts`, for more information check the [ink! documentation](https://use.ink/how-it-works#why-include-pallet-contracts-on-a-parachain){target=_blank}",
"content": "Configure your development environment with the appropriate network settings for your chosen platform: <br><br> - **PolkaVM** - [Connect to Asset Hub](/develop/smart-contracts/connect-to-polkadot/){target=_blank} <br> - **EVM** - [Moonbeam Documentation](https://docs.moonbeam.network/){target=_blank}, [Astar Documentation](https://docs.astar.network/){target=_blank}, [Acala Documentation](https://wiki.acala.network/){target=_blank} <br> - **Wasm (ink!)** - depends on those parachains that implement `pallet-contracts`, for more information check the [ink! documentation](https://use.ink/how-it-works#why-include-pallet-contracts-on-a-parachain){target=_blank}",
"icon": ":fontawesome-solid-2:"
},
{
Expand Down
2 changes: 1 addition & 1 deletion develop/smart-contracts/.pages
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ title: Smart Contracts
nav:
- index.md
- 'Overview': overview.md
- 'Connect to Asset Hub': connect-to-asset-hub.md
- 'Connect to Polkadot': connect-to-polkadot.md
- dev-environments
- libraries
- 'JSON-RPC APIs': json-rpc-apis.md
Original file line number Diff line number Diff line change
@@ -1,25 +1,23 @@
---
title: Connect to Asset Hub
description: Explore how to connect to different Asset Hub networks, configure your wallet, and obtain test tokens for developing and testing smart contracts.
title: Connect to Polkadot
description: Explore how to connect to Polkadot Hub, configure your wallet, and obtain test tokens for developing and testing smart contracts.
---

# Connect to Asset Hub
# Connect to Polkadot

<div class="button-wrapper">
<a href="#" class="md-button connectMetaMask" value="westendAssetHub">Connect to Westend Asset Hub</a>
<a href="#" class="md-button connectMetaMask" value="westendAssetHub">Connect to Westend Hub</a>
</div>

## Networks
## Networks Details

Developers can leverage Asset Hub across diverse networks, from TestNets to MainNet. This section outlines the network specifications and connection details for each environment.

### Specifications
Developers can leverage smart contracts across diverse networks, from TestNets to MainNet. This section outlines the network specifications and connection details for each environment.

=== "Westend Asset Hub"

Network name
```
Asset-Hub Westend TestNet
Westend Asset Hub
```

---
Expand Down Expand Up @@ -50,34 +48,6 @@ Developers can leverage Asset Hub across diverse networks, from TestNets to Main
https://assethub-westend.subscan.io
```

### Endpoints

=== "Westend Asset Hub"
Dwellir
```
https://westend-asset-hub-rpc.polkadot.io
```
---
Dwellir Tunisia
```
https://westmint-rpc.polkadot.io
```
---
IBP1
```
https://rpc.ibp.network/asset-hub-westend
```
---
IBP2
```
https://asset-hub-westend.dotters.network
```
---
Parity
```
https://westend-asset-hub-rpc.polkadot.io
```

## Connect your Wallet

### Metamask
Expand All @@ -86,9 +56,9 @@ Developers can leverage Asset Hub across diverse networks, from TestNets to Main

To get started with MetaMask, you need to install the [MetaMask extension](https://metamask.io/download/){target=\_blank} and add it to the browser. Once you install MetaMask, you can set up a new wallet and securely store your seed phrase. This phrase is crucial for recovery in case you lose access.

For example, to connect to the Westend Asset Hub TestNet via MetaMask, you need to follow these steps:
For example, to connect to the Westend Hub TestNet via MetaMask, you need to follow these steps:

1. Open the MetaMask extension and click on the network icon to switch to the Asset Hub Westend TestNet
1. Open the MetaMask extension and click on the network icon to switch to the Westend Hub TestNet

![](/images/develop/smart-contracts/connect-to-asset-hub/connect-to-asset-hub-1.webp){: .browser-extension}

Expand All @@ -104,23 +74,23 @@ For example, to connect to the Westend Asset Hub TestNet via MetaMask, you need

![](/images/develop/smart-contracts/connect-to-asset-hub/connect-to-asset-hub-4.webp){: .browser-extension}

The steps in the preceding section can be used to connect to any Asset Hub chain by modifying the network specification and endpoint parameters.
The steps in the preceding section can be used to connect to any chain by modifying the network specification and endpoint parameters.

## Test Tokens

You will need testnet tokens to perform transactions and engage with smart contracts on any Asset Hub chain. Here's how to obtain Westend Asset Hub (WND) tokens for testing purposes:
You will need testnet tokens to perform transactions and engage with smart contracts on any chain. Here's how to obtain Westend (WND) tokens for testing purposes:

1. Navigate to the [Polkadot Faucet](https://faucet.polkadot.io){target=\_blank}. If the desired network is not already selected, choose it from the Network drop-down

2. Copy your MetaMask address linked to Westend Asset Hub and paste it into the designated field
2. Copy your MetaMask address linked to Westend and paste it into the designated field

![](/images/develop/smart-contracts/connect-to-asset-hub/connect-to-asset-hub-5.webp)

3. Click the **Get Some WND** button to request free test WND tokens. These tokens will be sent to your MetaMask wallet shortly

![](/images/develop/smart-contracts/connect-to-asset-hub/connect-to-asset-hub-6.webp)

Now that you have obtained WND tokens in your MetaMask wallet, you’re ready to deploy and interact with smart contracts on the Westend Asset Hub! These tokens will allow you to pay for gas fees when executing transactions, deploying contracts, and testing your dApp functionality in a secure testnet environment.
Now that you have obtained WND tokens in your MetaMask wallet, you’re ready to deploy and interact with smart contracts on Westend Hub! These tokens will allow you to pay for gas fees when executing transactions, deploying contracts, and testing your dApp functionality in a secure testnet environment.

## Where to Go Next

Expand All @@ -132,7 +102,7 @@ For your next steps, explore the various smart contract guides demonstrating how

---

Explore the smart contract development and deployment process on Asset Hub using the Remix IDE.
Explore the smart contract development and deployment process on Polkadot Hub using the Remix IDE.

[:octicons-arrow-right-24: Build with Remix IDE](/develop/smart-contracts/dev-environments/remix/)

Expand Down
22 changes: 11 additions & 11 deletions develop/smart-contracts/connect-your-wallet.md
Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@
---
title: Connect Your Wallet to Asset Hub
description: Learn to connect MetaMask to the Asset Hub blockchain. Set up your wallet, switch networks, and request test tokens for development.
title: Connect Your Wallet to Polkadot
description: Learn to connect MetaMask to Polkadot Hub. Set up your wallet, switch networks, and request test tokens for development.
---

# Connect Your Wallet

## Connect to Asset Hub Using MetaMask
## Connect to Polkadot Hub Using MetaMask

MetaMask is a popular wallet for interacting with Ethereum-compatible chains. It allows users to connect to test networks that support Ethereum-based smart contracts. This article guides setting up MetaMask, connecting to the contracts deployed on the Ethereum-compatible test network, the Westend Asset Hub, and requesting test tokens for development purposes.
MetaMask is a popular wallet for interacting with Ethereum-compatible chains. It allows users to connect to test networks that support Ethereum-based smart contracts. This article guides setting up MetaMask, connecting to the contracts deployed on the Ethereum-compatible test network, Westend Hub, and requesting test tokens for development purposes.

It's important to emphasize that MetaMask primarily facilitates interactions with smart contracts, giving you access to various chain functionalities.

## Prerequisites

To get started with MetaMask, you need to install the [MetaMask extension](https://metamask.io/download/){target=\_blank} and add it to the browser. Once you install MetaMask, you can set up a new wallet and securely store your seed phrase. This phrase is crucial for recovery in case you lose access.

## Connect to the Asset Hub Westend TestNet
## Connect to the Westend Hub TestNet

To connect to the Westend Asset Hub TestNet via MetaMask, you need to follow these steps:
To connect to the Westend Hub TestNet via MetaMask, you need to follow these steps:

1. Open the MetaMask extension and click on the network icon to switch to the Asset Hub Westend TestNet
1. Open the MetaMask extension and click on the network icon to switch to the Westend Hub TestNet

![](/images/develop/smart-contracts/evm-toolkit/connect-your-wallet/connect-your-wallet-1.webp){: .browser-extension}

Expand Down Expand Up @@ -81,16 +81,16 @@ To connect to the Westend Asset Hub TestNet via MetaMask, you need to follow the

## Request Test Tokens

To start conducting transactions and interacting with smart contracts on the Asset Hub Westend TestNet, you'll need WND test tokens. Here's how to get them:
To start conducting transactions and interacting with smart contracts on the Westend Hub TestNet, you'll need WND test tokens. Here's how to get them:

1. Navigate to the [Westend Asset Hub Faucet](https://faucet.polkadot.io/westend?parachain=1000){target=\_blank}
1. Navigate to the [Westend Hub Faucet](https://faucet.polkadot.io/westend?parachain=1000){target=\_blank}

2. Copy your MetaMask address linked to the Westend Asset Hub and paste it into the designated field
2. Copy your MetaMask address linked to Westend Hub and paste it into the designated field

![](/images/develop/smart-contracts/evm-toolkit/connect-your-wallet/connect-your-wallet-5.webp)

3. Click the **Get Some WND** button to request free test WND tokens. These tokens will be sent to your MetaMask wallet shortly

![](/images/develop/smart-contracts/evm-toolkit/connect-your-wallet/connect-your-wallet-6.webp)

Congratulations! You have successfully connected to the Westend Asset Hub using MetaMask and acquired test tokens. This setup allows you to experiment with the network's functionalities without using real ether or encountering financial risks. Remember to keep your MetaMask credentials secure and never share your wallet's private key or seed phrase with anyone.
Congratulations! You have successfully connected to Westend Hub using MetaMask and acquired test tokens. This setup allows you to experiment with the network's functionalities without using real ether or encountering financial risks. Remember to keep your MetaMask credentials secure and never share your wallet's private key or seed phrase with anyone.
22 changes: 11 additions & 11 deletions develop/smart-contracts/dev-environments/hardhat.md
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The line highlights are off for all the snippets in this file

Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: Use Hardhat with Asset Hub
description: Learn how to create, compile, test, and deploy smart contracts on Asset Hub using Hardhat, a powerful development environment for blockchain developers.
title: Use Hardhat with Polkadot Hub
description: Learn how to create, compile, test, and deploy smart contracts on Polkadot Hub using Hardhat, a powerful development environment for blockchain developers.
---

# Hardhat
Expand All @@ -19,16 +19,16 @@ description: Learn how to create, compile, test, and deploy smart contracts on A

## Overview

Hardhat is a robust development environment for Ethereum-compatible chains that makes smart contract development more efficient. This guide walks you through the essentials of using Hardhat to create, compile, test, and deploy smart contracts on Asset Hub.
Hardhat is a robust development environment for Ethereum-compatible chains that makes smart contract development more efficient. This guide walks you through the essentials of using Hardhat to create, compile, test, and deploy smart contracts on Polkadot Hub.

## Prerequisites

Before getting started, ensure you have:

- [Node.js](https://nodejs.org/){target=\_blank} (v16.0.0 or later) and npm 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}). To learn how to get test tokens, check out the [Test Tokens](/develop/smart-contracts/connect-to-asset-hub/#test-tokens){target=\_blank} section
- [MetaMask](https://metamask.io/){target=\_blank} installed and connected to [Westend Asset Hub](https://chainlist.org/chain/420420421){target=\_blank}. For more detailed instructions on connecting your wallet, see the [Connect Your Wallet](/develop/smart-contracts/connect-to-asset-hub/#connect-your-wallet){target=\_blank} section
- Some WND test tokens to cover transaction fees (easily obtainable from the [Polkadot faucet](https://faucet.polkadot.io/westend?parachain=1000){target=\_blank}). To learn how to get test tokens, check out the [Test Tokens](/develop/smart-contracts/connect-to-polkadot/#test-tokens){target=\_blank} section
- [MetaMask](https://metamask.io/){target=\_blank} installed and connected to [Westend Hub](https://chainlist.org/chain/420420421){target=\_blank}. For more detailed instructions on connecting your wallet, see the [Connect Your Wallet](/develop/smart-contracts/connect-to-polkadot/#connect-your-wallet){target=\_blank} section

## Setting Up Hardhat

Expand All @@ -51,7 +51,7 @@ Before getting started, ensure you have:
npm install --save-dev hardhat @nomicfoundation/hardhat-toolbox
```

To interact with Asset Hub, Hardhat requires the [`hardhat-resolc`](https://www.npmjs.com/package/hardhat-resolc){target=\_blank} plugin to compile contracts to PolkaVM bytecode and the [`hardhat-revive-node`](https://www.npmjs.com/package/hardhat-revive-node){target=\_blank} plugin to spawn a local node compatible with PolkaVM.
To interact with Polkadot Hub, Hardhat requires the [`hardhat-resolc`](https://www.npmjs.com/package/hardhat-resolc){target=\_blank} plugin to compile contracts to PolkaVM bytecode and the [`hardhat-revive-node`](https://www.npmjs.com/package/hardhat-revive-node){target=\_blank} plugin to spawn a local node compatible with PolkaVM.

```bash
npm install --save-dev hardhat-resolc hardhat-revive-node
Expand Down Expand Up @@ -127,7 +127,7 @@ To compile your project, follow these instructions:

## Testing Your Contract

When testing your contract, be aware that [`@nomicfoundation/hardhat-toolbox/network-helpers`](https://hardhat.org/hardhat-network-helpers/docs/overview){target=\_blank} is not fully compatible with Asset Hub's available RPCs. Specifically, Hardhat-only helpers like `time` and `loadFixture` may not work due to missing RPC calls in the node. For more details, refer to the [Compatibility](https://github.com/paritytech/hardhat-revive/tree/main/packages/hardhat-revive-node#compatibility){target=\_blank} section in the `hardhat-revive` docs.
When testing your contract, be aware that [`@nomicfoundation/hardhat-toolbox/network-helpers`](https://hardhat.org/hardhat-network-helpers/docs/overview){target=\_blank} is not fully compatible with Polkadot Hub's available RPCs. Specifically, Hardhat-only helpers like `time` and `loadFixture` may not work due to missing RPC calls in the node. For more details, refer to the [Compatibility](https://github.com/paritytech/hardhat-revive/tree/main/packages/hardhat-revive-node#compatibility){target=\_blank} section in the `hardhat-revive` docs.

You should avoid using helpers like `time` and `loadFixture` when writing tests. For example, for the `Lock.sol` contract, you can replace the default test file under `tests/Lock.js` with the following logic:

Expand Down Expand Up @@ -234,7 +234,7 @@ Before deploying to a live network, you can deploy your contract to a local node

## Deploying to a Live Network

After testing your contract locally, you can deploy it to a live network. This guide will use Westend Asset Hub as the target network. Here's how to configure and deploy:
After testing your contract locally, you can deploy it to a live network. This guide will use Westend Hub as the target network. Here's how to configure and deploy:

1. Fund your deployment account with enough tokens to cover gas fees. In this case, the needed tokens are WND (on Westend). You can use the [Polkadot faucet](https://faucet.polkadot.io/westend?parachain=1000){target=\_blank} to obtain testing tokens.

Expand Down Expand Up @@ -263,7 +263,7 @@ After testing your contract locally, you can deploy it to a live network. This g
--8<-- 'code/develop/smart-contracts/dev-environments/hardhat/hardhat.config.js:66:66'
```

5. Update your Hardhat configuration file with network settings for the Asset Hub network you want to target:
5. Update your Hardhat configuration file with network settings for the Polkadot network you want to target:

=== "Remix Configuration"

Expand All @@ -282,7 +282,7 @@ After testing your contract locally, you can deploy it to a live network. This g
--8<-- 'code/develop/smart-contracts/dev-environments/hardhat/hardhat.config.js:43:66'
```

4. Deploy your contract using Ignition:
6. Deploy your contract using Ignition:

```bash
npx hardhat ignition deploy ./ignition/modules/INSERT_IGNITION_MODULE_NAME.js --network westendAssetHub
Expand All @@ -308,7 +308,7 @@ npx hardhat run scripts/interact.js --network westendAssetHub

## Where to Go Next

Hardhat provides a powerful environment for developing, testing, and deploying smart contracts on Asset Hub. Its plugin architecture allows seamless integration with PolkaVM through the `hardhat-resolc` and `hardhat-revive-node` plugins.
Hardhat provides a powerful environment for developing, testing, and deploying smart contracts on Polkadot Hub. Its plugin architecture allows seamless integration with PolkaVM through the `hardhat-resolc` and `hardhat-revive-node` plugins.

Explore more about smart contracts through these resources:

Expand Down
Loading