Deploy a Smart Contract on Polygon using GetBlock

GetBlock
3 min readMar 27, 2023

--

Overview

Polygon node connection is an advantage for any dApp: from on-chain games to trading bots. Polygon (MATIC) API endpoint by GetBlock is an instrument of choice for many early-stage teams. This is an easy step-by-step tutorial on how to create and deploy a smart contract on the Polygon test network using a virtual wallet (Metamask), Risk, and GetBlock.

What you will learn

To create a smart contract in this tutorial, you will learn how to use GetBlock to:

Create a smart contract on Polygon (Mumbai) using GetBlock endpoints.

What you will do

Following the tutorial, you will:

  1. Get started on GetBlock and access GetBlock test nodes
  2. Create a wallet address with Metamask
  3. Add balance to the wallet (using test tokens)
  4. Use Remix to compile and deploy a Smart Contract
  5. Check contract status

Preparatory Steps

  1. So the first step is to sign up with Getblock via wallet or email
GetBlock account

2. Create an endpoint for Polygon Tesnet (Mumbai)

Polygon Tesnet (Mumbai)

3. Then enter Metamask and choose to connect a network manually, connect your Metamask to the Polygon Testnet Network adding your GetBlock endpoint to the “RPC URL” line

If you have a no balance in your account, you can request tokens on Mumbai faucet here: https://mumbaifaucet.com/

Smart Contract Development

  1. Go to Remix (Remix is a web-base Integrated Development Environment (IDE) for Ethereum smart contract development in Solidity).
  2. Let’s take “Storage.sol” from Remix as an example of a contract

3. Proceed by deploying

4. Choose the Injected provider “Metamask”

Smart contract URL: https://mumbai.polygonscan.com/address/0xa4d552dce0e26564ec1737638705584ce9ed351b

Testing the Smart Contract

There were 12 in the storage. To check, change the value to 14.

In the “Store” field, enter the number 14 and save it on the network after confirming the operation in Metamask

Waiting for the transaction to be added to the network block.

Then we make sure that the saved value has changed from 12 to 14

All done! Congratulations on deploying your smart contract.

This is how you deploy an easy Smart Contract on Polygon using Remix and GetBlock.

If you have any additional questions or would like to share your experience, feel free to join our community of Web3 developers who are always ready to chat.

--

--

GetBlock

GetBlock is a service that provides fast and easy API connection to blockchain nodes of 50+ cryptocurrencies.