Developers Forum for XinFin XDC Network

Omkar Mestry
Omkar Mestry

Posted on

How to Deploy a smart contract with XinFin Remix IDE by connecting Metamask through D'CENT Wallet Software App.

The MetaMask is a wallet that supports EVM blockchains and is utilised on numerous DApp websites. The MetaMask includes a QR-based mechanism for connecting with accounts in hardware wallets in addition to its own account.

The D’CENT App offers a feature that uses the QR-based protocol to connect D’CENT accounts (EVM) with Metamask. Users can create Solidity smart contracts using XinFin Remix, a web browser-based Integrated Development Environment (IDE), and then compile, deploy, and execute those smart contracts on the XinFin Blockchain Network.

The steps to deploy a smart contract with the XinFin Remix IDE by connecting Metamask via the DCENT wallet software app will now be covered.

Let’s start with Metamask.

Once you have unlocked your Metamask wallet, click on the Network button and select XDC Apothem Network.

Note: If you have not added the Apothem Network, you can add it through the ‘Add Network’ button below the network list.

Image description

Image description

Here are the details that need to be entered while adding the network:

Network Name: XDC Apothem Network
New RPC URL: https://rpc.apothem.network
Chain ID: 51
Currency Symbol: TXDC
Block Explorer URL: https://apothem.blocksscan.io/

After adding the network, you will be notified that “XDC Apothem Network” was successfully added.

Image description

How to connect D’CENT Wallet with MetaMask

Note:

  1. This function is supported only in Biometric Wallet and App Wallet(Software) mode. Minimum supported version.
  2. Biometric Wallet firmware version: 2.19.7 or higher
  3. D’CENT App version: Android (5.16.1 or higher) / iOS (5.16.2 or higher)

  4. The QR-based protocol supported by the MetaMask can only be used when a camera is installed on the computer.

Image description

After running the D’CENT App, enter the Discovery tab and Select MetaMask Integration from the list or type.

Image description

Image description

Click on the Go button. On the MetaMask integration screen, click on Connect Metamask account button.

Image description

Image description

Select the account to be linked from the account selection list and click on Connect button. Once the QR code gets generated, Proceed to further steps.

Image description

Image description

Click on the Account icon at the top right of the MetaMask main page. Now, Click on Connect Hardware Wallet button.

Image description

After selecting QR-based, click the Continue button at the bottom. It switches to the QR code scanning page. (Place the QR code in front of your Camera, The screen will be blurred, but it will not affect the reading.)

Image description

When the QR code scan is completed normally, it will be converted to the account selection page, Now, select the First account and click Unlock.

Image description

You can check the page where the account of the D’CENT wallet and the MetaMask are linked.

Image description

Let’s deploy a smart contract using XinFin Remix:

Step 1: Access the XinFin Remix and enter the smart contract to compile it.

Used Contract code:

// My First Smart Contract

pragma solidity >=0.5.0 <0.7.0;

contract HelloWorld {

function get()public pure returns (string memory){

return ‘Hello World’;

}

}
Enter fullscreen mode Exit fullscreen mode

Step 2: Select the respective compiler version and Compile it.

Image description

Step 3: After successful compilation, Go to the Deploy & Run Transaction screen.

Now, Select the environment as ‘Injected Web3’ to connect with Metamask.

On the Metamask screen, select ‘Connected DCENT wallet’ account and click on the Next button.

Image description

Step 4: Confirm the address and account balance, and Click on the Connect button.

Image description

Once the connected DCENT wallet is connected to the Remix successfully then, it will fetch the address of the DCENT wallet through Metamask like this:

Image description

Step 5: Now click on the Deploy button; Metamask will ask to Confirm the transaction. Click on Confirm button to complete the transaction.

Image description

Step 6: After checking the transaction details, click the Confirm button. It switches to the signature request page in QR code format.

Image description

Step 7: Now, open the DCENT wallet and access the Metamask link (https://qrbase.dcentwallet.com).

Scan the Metamask QR code through DCENT App.

(There are two ways to scan the signature request QR.)

i. From D’CENT App, go to the Discovery tab and Click on the Metamask QR Scan button.
Image description

ii. Or, click the QR Scan button at the top left of the Discovery tab.
Image description

Step 8: Scan the signature request QR code generated in Step 6. After scanning, check the from address and click on the Continue button.
Image description

Step 9: Now, check the Network and other details and click on the Signing button to complete the transaction.
Image description

After signing, you can check the signature in QR code format.
Image description

Step 10: Now you need to send signed data to MetaMask, for that Click the Get Signature button on the signature request page completed in Step 6.
Image description

Step 11: Once you click the Get Signatures button, you must scan the QR code prepared in Step 9.

Image description

This is how you can Deploy your smart contract with XinFin Remix IDE by connecting Metamask through DCENT Software App
Image description

Deploy your smart contract using DCENT Wallet with XinFin Remix and Metamask, and share your feedback.

Relatable links:

  1. XDC Network
  2. XinFin Remix
  3. XDC Network Explorer
  4. XDC BlocksScan Explorer
  5. Matamask Plugin
  6. XDC Dev Forum

Discussion (0)