Deploy a Solidity smart contract on ParaState’s testnet

An Pudev
2 min readMay 1, 2021

ParaState is a Polkadot parachain that extends the frontier of Ethereum with Substrate framework. Providing Dapps L1 security without sacrificing composability.

Photo by Waldemar Brandt on Unsplash

Let’s write a contract for a quick and easy lottery and deploy it on a ParaState test network

Tools

Contact

  1. Import Your address from Metamask

2. Write Your contract

pragma solidity >=0.4.0 <0.6.0;contract FastLottery {  address public owner;  constructor() public {    owner = msg.sender;  }  function play() public payable {    require(msg.value > 0.001 ether);  }  function random() private view returns(uint){    return uint(keccak256(abi.encodePacked(msg.sender, now)));  }  function checkVictory(uint userNumber) public view returns (string) {    uint _random = random();    if (_random == userNumber) {      return ‘You win!’;    }    return ‘You loose!’;  }}

3. Compile

If you have no errors go to the last step

4. Deploy

Now you can try our contract in action. Enter any number and check the result in the LOG

Now you know how to create your contract in the ParaState network and you can create your contract.
Good luck!

Links

--

--