> For the complete documentation index, see [llms.txt](https://pliangroup.gitbook.io/plian/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://pliangroup.gitbook.io/plian/using-the-blockchain/pmetamask.md).

# PMetamask

PMetamask is a web browser plug-in wallet.&#x20;

Currently, Plian is compatible with any EVM developer tools like Metamask, Remix, etc.  So we suggest you directly [use Metamask to deploy smart contract on Plian](https://pliangroup.gitbook.io/plian/for-developers/how-to-deploy-smart-contract-on-plian-via-metamask-+-remix).

### Installation

First, download PMetamask installation package from [here](https://github.com/pchain-org/pmetamask/releases/download/v0.0.1/Pmetamask-chrome-0.0.1.zip). Then open Chrome and input chrome://extensions/ to enter extensions page:

<figure><img src="/files/aF5KlFamWPRnh8oweBgT" alt=""><figcaption></figcaption></figure>

Switch to Developer mode on top right of the explorer and drag the PMetamask installation package into it to install the plug-in.

<figure><img src="/files/az85vkTISV9j9vimwWMb" alt=""><figcaption></figcaption></figure>

After create or import address by following the guide of PMetamask，you can see something look like this:

<figure><img src="/files/2JB1wDKiJjtTmNkRhvPv" alt=""><figcaption></figcaption></figure>

Plian's smart contract can only be deployed on subchain. We choose the subchain 1 on Plian testnet to deploy smart contract. You can get free tPI on this subchain from [here](https://testnet.pchain.org/vfaucet.html).

<figure><img src="/files/pYgMGQ23HOLVa8OgMxBI" alt=""><figcaption></figcaption></figure>

### Connect Remix and PMetamask

Keep PMetamask opening，open Remix【[http://remix.ethereum.org](http://remix.ethereum.org/)】 the page is look like this：

<figure><img src="/files/AmQNgLXsZzRKPQnjC57o" alt=""><figcaption></figcaption></figure>

Under Remix’s ‘Run’ menu，select the Environment as ‘Injected Web3’:

<figure><img src="/files/hiGk9TZvxGMo78tHDtUm" alt=""><figcaption></figcaption></figure>

Click ‘connect’ on the popup PMetamask Notification dialog

<figure><img src="/files/KsCS5X4AWkUdSkFzqaao" alt=""><figcaption></figcaption></figure>

After that，the default account’s address in PMetamask will shown in ‘Account’ field automatically.

<figure><img src="/files/U5kVSjc36JXjw58YBk8W" alt=""><figcaption></figcaption></figure>

### Deploy and interact with smart contract

Edit smart contract in Remix，e.g：

```
pragma solidity ^ 0.4.23 ;
contract PCHAINTest{

  uint public value = 0;
  function inc(uint v) public {
    value += v;
  }
}
```

select the proper version to compile（here we take version 0.4.23 as an example）：

<figure><img src="/files/I4YtPWjToEyarfJJmLu1" alt=""><figcaption></figcaption></figure>

compile smart contract

<figure><img src="/files/I88iAYY4GfpmbnMyq1yk" alt=""><figcaption></figcaption></figure>

Click the ‘Deploy’ button under ‘Run’ menu to deploy the smart contract just complied

<figure><img src="/files/Q68NjTtxcl4iAb6WINSJ" alt=""><figcaption></figcaption></figure>

After click the ‘deploy’ button，click the ‘confirm’ button on PMetamask Notification dialog：

![](https://pchaindoc.readthedocs.io/en/latest/_images/confirm.png)

After deployed successfully, you can debug the contract If there are operations need to spend Gas, you may need confirm in the pop-up PMetamask dialog or in PMetamask directly.If the transaction failed, you can try to resend it or change the gas fee according to the returned error.

<figure><img src="/files/TOly0QfimNTjdStG0o9e" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/vYNTn1bjXOfLZaRe93z5" alt=""><figcaption></figcaption></figure>
