Cover photo

How to deploy a Solidity smart contract on ParaState’s testnet

Configuring Metamask to interact with ParaState TestNet

Install Metamask, create account, configuring the wallet.

Select Settings from the dropdown menu.
Select Settings from the dropdown menu.

Select Settings from the dropdown menu.

post image

On the Settings page choose the Networks menu.

post image

Click Add Network.

Filling the Endpoint Information and click save button:

post image

Network Name: ParaState

New RPC URL: https://rpc.parastate.io:8545

Chain ID: 123

Currency Symbol (Optional): STATE

Block Explorer URL: http://scan.parastate.io/

After that, you need to get testnet STATE tokens. Go to http://faucet.parastate.io/ page, enter your ParaState address from Metamask and click the button “Get testnet STATE”.

post image

Configuring BUIDL online IDE

Go to the page https://buidl.secondstate.io. In the lower left corner, click “Providers”. Fill it in as shown in the screenshot.

post image

Endpoint: https://rpc.parastate.io:8545/

ChainId: 123

post image

In the lower left corner, click “Accounts”, import the private key from your testnet STATE address. Set the imported address as default. If you do not want to import your private key into BUIDL online IDE, then you need to send some Testnet STATE tokens to the address already existing in BUIDL.

Deploy a Solidity smart contract on ParaState’s testnet

First, you need to create your own smart contract, or find a ready-made one, for example on Github.

post image

I chose a simple contract: Ethereum voting dapp.

Open the Voting.sol file, copy and paste the contract code into BUIDL online IDE and click on the “Compile” button.

post image

Fill in additional fields if necessary. In my case, I need to add the names of the candidates [“Rama”, “Nick”, “Jose”]. Click the button “Deploy to the chain”.

post image

The contract is now deployed on the ParaState Chain, and you can call its functions directly from inside BUIDL. You can check this by entering the received transaction hash into the ParaState block explorer.

post image

That’s all. But if you want to see how a smart contract works in action, then you need to copy and paste HTML code from index.html into the HTML editor.

post image

Then copy and paste JavaScript code from index.js into the JS editor.

post image

Click on Run to see the dapp in action! You should see the following:

post image