HomeAirdropHow to Deploy a Contract On Scroll

How to Deploy a Contract On Scroll

-

Welcome to cryptomarketblog, the number one blog for crypto education. Here we explain the topics of the cryptocurrency using examples so that anyone can easily understand them. In this article we are going to show how to Deploy a Contract On Scroll.

What is Scroll?

Scroll is a zkEVM network. Scroll receives regular bytecodes from Layer 1 smart contracts, generates zk proofs off-chain using GPU power, then verifies the new states back on Ethereum Layer 1. They raised $30 Million In Series A funding from many reputable global enterprises.

Deploy a Contract On Scroll

Here is a step-by-step guide on how to Deploy a Contract On Scroll.

Requirement:

Need a wallet, with ETH on Scroll Testnet. If you don’t have a test ETH follow this guide.

Step 1: Go to https://remix.ethereum.org/

Step 2: Go to Workspace from the left-panel menu and choose the Create New File icon and name it as “cryptomarketblog.sol” (Give any name with .sol extension).

Step 3: Copy & Paste the below code in cryptomarketblog.sol

pragma solidity 0.8.17;


// SPDX-License-Identifier: MIT


contract CryptoMarketBlog {
  string public name = "Crypto Market Blog";
  string public symbol = "CMB";
  uint8 public decimals = 18;
  uint256 public totalSupply = 10000000;


  mapping (address => uint256) public balances;
  address public owner;


  constructor() {
    owner = msg.sender;
    balances[owner] = totalSupply;
  }


  function transfer(address recipient, uint256 amount) public {
    require(balances[msg.sender] >= amount, "Insufficient balance.");
    balances[msg.sender] -= amount;
    balances[recipient] += amount;
  }
}

Step 4: Compilation

Go to the Solidity Compiler from the left-panel -> click on 'Compile cryptomarketblog.sol' -> If there is no error you'll see a green tick on solidity compiler button

Step 5: Deployment

I am deploying this on Scroll testnet, So we need some testnet ETH for Gas, If you don’t have test ETH on your MetaMask, follow this guide.

Go to the Deploy & Run Transactions sidebar from the left-panel -> Select environment as 'Injected Provider - MetaMask'then you will get a MetaMask pop-up -> Click on connect -> Click on Deploy -> confirm MetaMask transaction
Contract Deployment on Scroll

Step 6: Verify Contract

Visit the Scroll contract you deployed on scroll explorer -> click on ‘Code’ tab -> click on ‘Verify & Publish’ -> select ‘Via flattened source code’ -> click on ‘Next’ -> enter Contract Name -> select compiler same as remix compiler -> select optimization as ‘No’ -> Enter the Solidity Contract Code -> enter the solidity contract code -> click on ‘Verify & Publish’

That’s it, You have successfully completed Contract Deployment On Scroll.

LEAVE A REPLY

Please enter your comment!
Please enter your name here

LATEST POSTS

MELD Airdrop

MELD is a non-custodial DeFi protocol for web3 finance, providing cross-chain lending, borrowing and staking on the MELD blockchain supporting the six leading blockchains as...

Omni Network Airdrop Guide

What is Omni Network? Omni Network is a layer 1 blockchain that operates as an EVM-compatible infrastructure layer using the EigenLayer technology. It allows for the...

Mist Chain Testnet Guide – Potential Airdrop

Mist Chain Testnet is now LIVE now! With all required blockchain capabilities, including token transactions and smart contract deployment, you can now explore and test...

Lamina1 Airdrop Guide

What is Lamina1? Lamina1 is a layer-1 blockchain that is optimized for the metaverse, and it is based on a fork of Avalanche blockchain. This blockchain...

Most Popular