Parastate. Deploy a Solidity Smart Contract on testnet

Parastate

ParaState aims to become a Polkadot parachain that extends the frontier of Ethereum with substrate framework. By supporting 20+ programming languages to create Ethereum-compatible smart contracts, we can unite a larger developer community to boost the cross-chain interoperability.

Write Ethereum-compatible smart contracts in popular programming
languages, & run them much faster, on Polkadot.

A decentralized open source business model funded by developer
treasuries on participating parachains.

Tutorial.

Deploying simple calculator smart contract to the test netowrk.

First of all add Parastate test network to metamask:

  1. Network name: Parastate testnet
  2. New RPC URL: https://rpc.parastate.io:8545/
  3. Chain ID: 123
  4. Currency symbol: STATE

After that switch to the newly added network and create new wallet in metamask (you will be asked to import a private key for it later) and request test tokens here: http://faucet.parastate.io/

Deloying

Go to http://buidl.secondstate.io/parastate and import your wallet with STATE tokens using your private key (could be exported from metamask).

Paste our smart contract code:

pragma solidity ^0.4.24;

contract Calculator {

int private lastValue = 0;

function Add(int a, int b) public returns (int) {

lastValue = a + b;

return lastValue;

}

function Subtract(int a, int b) public returns (int) {

lastValue = a - b;

return lastValue;

}

function LastOperation() public constant returns (int) {

return lastValue;

}

}

And compile it:

Now deploy it to the chain:

Wait for the confirmation of transaction:

After the smart contract has been successfully deployed, you can call its functions. Go to the Deployed tab.

Let’s interact with our smart contract:

Press Transact and wait till confirmation. After that press Call under the LastOperation and you will see the result:

The same way you can test all other functions. Super easy!

Thank for reading. Happy codding!

Links

Website — https://www.parastate.io
Twitter — https://twitter.com/parastate
Github — https://github.com/ParaState/
Telegram — https://t.me/parastateofficial
Discord — https://discord.gg/DgKNeJFBXA
Medium — https://medium.com/ethereum-on-steroids

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store