Function X January Hash Out

Understanding EVM, Web3 Apps and how to add Function X testnet to Metamask

Dear Function X Members,

As the f(x)Core upgrade to be EVM-compatible is round the corner, we’d like to give you an introduction on EVM and how to set up the testnet network on MetaMask. Here is a guide for the uninitiated to start interacting with Web3 Applications, often called decentralized applications (dapps). This article will cover the following topics:

  • Brief explanation of EVM-compatibility
  • MetaMask and EVM-compatible blockchain
  • Add f(x)Core Testnet to MetaMask
  • Connect MetaMask Wallet to Dapps
  • Disconnect MetaMask Wallet from Dapps
  • Connect f(x)Wallet to Dapps
  • Disconnect f(x)Wallet from Dapps

EVM-Compatibility

EVM stands for Ethereum Virtual Machine, the simplest way to understand the EVM is that it is a software platform that developers can use to deploy smart contracts which are the underlying programs in dapps. EVM-compatibility allows smart contracts written in Solidity to be deployed on the network, also it allows developers to use existing Ethereum clients and tools. This means that most of the existing dapps on Ethereum and other EVM-compatible chains can be deployed on f(x)Core too.

MetaMask

MetaMask is a non-custodial wallet, which means users hold their own private keys and have full control over their own funds. It is a crypto wallet that can be used in a web browser and on mobile devices to interact with any EVM-compatible blockchain. It allows the user to run and interact with dapps right in your browser without running a blockchain node.

To download, install and set up MetaMask you can either head over to our documentation for a step-by-step guide, or to theMetaMask website.

Add f(x)Core Testnet to MetaMask

As of writing only the f(x)Core Testnet is available, but the process flow is the same for when the Mainnet is available. In order to interact with dapps that have been built and deployed on the f(x)Core Network, users will need to add the network to MetaMask. The steps are as follow:

  1. Click on the Network selection dropdown and then click on ‘Add Network’
  2. Fill in the fields as follow

Network Name: Fxcore Dhobyghaut
New RPC URL: https://testnet-fx-json-web3.functionx.io:8545
Chain ID: 90001
Currency Symbol: FX
Block Explorer URL: https://testnet-fxscan.functionx.io/

3. Click ‘Save’

Users will be directly switched to f(x)Core’s Dhobyghaut-Testnet in the network dropdown list which means that users have successfully added f(x)Core Dhobyghaut-Testnet Network to MetaMask!

Click on the network selection dropdown then click on ‘Add Network’
Fill in the fields as shown and click ‘Save’
Successfully added f(x)Core Dhobyghaut-Testnet to MetaMask!

Connect MetaMask Wallet to Dapps

Now that the network have been set up on MetaMask, users can now use MetaMask to interact with dapps. The steps below will be using a forked Uniswap on our Testnet as the dapp we want to interact with as an example, the process should be similar with any dapp.

⚠️ Only connect to websites that you trust. Always check that the URL is correct, and bookmark dapps that you regularly visit/use.

  1. Click on ‘Connect Wallet’ or ‘Connect to a wallet’. Other Dapps will have similar buttons for the user to connect their wallet to start using the application.
  2. Select ‘MetaMask’
  3. The MetaMask extension will prompt you to select which Account to connect to. Select the account you want to connect and click ‘Next’
  4. The MetaMask extension will take you to another page showing you what the site is requesting for, click ‘Connect’.
  5. It will show that MetaMask is connecting for a short moment and the extension will automatically close.
  6. Now, you will see your address of the account at the top right hand corner instead of ‘Connect to a wallet’
  7. You can now start using the application! When you open the MetaMask extension, you will see on the top left that it is ‘Connected’
Click on ‘Connect Wallet’
Select ‘MetaMask’
Select the account to connect and click ‘Next’
Click ‘Connect’
Once connected the address of the account will be shown and the MetaMask extension will show it is ‘Connected’

Disconnect MetaMask Wallet from Dapp

By disconnecting MetaMask from the websites that you have connected to, the sites will no longer have the ability to read or access your wallet information. It is a good practice to have when you are no longer using the dapps.

Sometimes dapps have an option to disconnect your wallet. You are still strongly encouraged to disconnect via MetaMask

From ‘Connected sites’ List

The ‘Connected sites’ lists the dapps that your account is connected to.

  1. Click on the ‘three dots’ icons
  2. Click on ‘Connected sites’
  3. Click on the ‘trash bin’ icon by the website url
  4. Click on ‘Disconnect’
Click on the ‘three dots’ icons and click on ‘Connected sites’
Click on the ‘thrash bin’ icon
Click on ‘Disconnect’

While on Dapp webpage

MetaMask will show whether it is connected to the current website that is open. While you are on the website and have already connected to it, open MetaMask and you will see ‘Connected’ near the top left corner.

  1. Click on ‘Connected’
  2. Click on the ‘three dots’ icon
  3. Click on ‘Disconnect this account’
Click on ‘Connected’
Click on the ‘three dots’ icon
Click on ‘Disconnect this account’

f(x)Wallet

The f(x)Wallet was developed by Pundi X Labs and is a non-custodial wallet for the f(x)Core blockchain, Pundi X blockchain as well as ERC20 tokens. As of writing it also supports Binance Smart Chain, Polygon Mainnet and Tron Mainnet. Head to these links (iOS and Android) to download them on your mobile device.

The f(x)Wallet can be used to interact with dapps via the WalletConnect protocol.

Connect f(x)Wallet to Dapps

When you create an account on the f(x)Wallet application, it automatically generates an Ethereum address. This address can be used to interact with Dapps via Wallet Connect. In the steps below iOS is used, the process is similar on Android.

⚠️ Only connect to websites that you trust. Always check that the URL is correct, and bookmark dapps that you regularly visit/use.

  1. Click on ‘Connect Wallet’ or ‘Connect to a wallet’. Other Dapps will have similar buttons for the user to connect their wallet to start using the application.
  2. Select ‘WalletConnect’
  3. A QR code will appear
  4. Open f(x)Wallet, and click on the blue button at the bottom.
  5. Select ‘Scan’
  6. Scan the QR code
  7. The wallet will show it is connecting for a brief moment
  8. Select the address you want to connect to the Dapp
  9. Click on ‘Authorize’
  10. Now, you will see your address of the account at the top right hand corner instead of ‘Connect to a wallet’
Click on ‘WalletConnect’
A QR code will appear
On your mobile in f(x)Wallet, press on the blue button, then press ‘Scan’ and scan the QR code
Wait for it to connect, then select the address to connect and press on ‘Authorize’
Connected via WalletConnect!

Disconnect f(x)Wallet from Dapps

WalletConnect only allows you to connect to one Dapp at a time. You will have to disconnect from the previous Dapp before connecting to another Dapp. It is good practice to disconnect your account from the Dapp when you are done using it.

  1. You will see a tab appear on your f(x)wallet home screen, click on it and it will open up the page for you to disconnect
  2. Click on ‘Disconnect’
  3. It will prompt you once more, click on ‘Disconnect’ again
Press on the ‘tab’ and ‘Disconnect’

The dapp will now show that you are not connected anymore.

We hope that this article helps you to understand how to use another decentralized wallet to access f(x)Core testnet and understand EVM. If you have more questions, please feel free to reach us on Function X Forum. See you there!

Leave a comment