PMetamask

PMetamask is a plug-in wallet.

Installation

First, download PMetamask installation package from here. Then open Chrome and input chrome://extensions/ to enter extensions page:

../_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.

../_images/developermode.png

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

../_images/pmetamaskehello.png

PCHAIN’s smart contract can only be deployed on child chain. We choose the child chain 1 on PCHAIN testnet to deploy smart contract. You can get free tPI on this child chain from here.

../_images/choosenetwork.png

Connect Remix and PMetamask

Keep PMetamask opening,open Remix【http://remix.ethereum.org】 the page is look like this:

../_images/remix.png

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

../_images/selectenv.png

Click ‘connect’ on the popup PMetamask Notification dialog

../_images/connecttometamask.png

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

../_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):

../_images/selectversion.png

compile smart contract

../_images/compile.png

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

../_images/deploy.png

After click the ‘deploy’ button,click the ‘confirm’ button on PMetamask Notification dialog:

../_images/confirm.png

After deployed successfully, you can debug the contract

../_images/interact1.png ../_images/interact2.png
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.