# 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:

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

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

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

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

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

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).

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

### Connect Remix and PMetamask

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

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

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

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

Click ‘connect’ on the popup PMetamask Notification dialog

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

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

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

### 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）：

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

compile smart contract

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

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

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

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.

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

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