# Greetings to Concha Docs

Welcome to Concha Docs, your gateway to the vibrant world of decentralized consumer apps!

Concha stands at the forefront as a state-of-the-art modular chain, firmly rooted in the reliable Bitcoin network. With the focus on empowering consumer apps, Concha spearheads the path towards widespread adoption of blockchain. Dive into our documentation to delve deeper into Concha's features along with the technologies it leverages and discover how Concha can open the new horizon for decentralized apps’ utilities, accessibilities and performances.


# What is Concha?

Concha is a modular zk-rollup layer 3 on top of Rootstock (layer 2 on Bitcoin), built with Polygon CDK and Celestia DA. It addresses the critical challenges of scalability, interoperability, and user experience that have hindered blockchain's mainstream adoption. Concha envisions and supports a burgeoning ecosystem of consumer applications ranging from on-chain gaming and social media to work platforms, e-commerce and education.


# Consumer chain as Layer 3 on Bitcoin

Consumer apps represent a pivotal shift in blockchain technology, catering to the needs of everyday users. It aims to turn decentralized apps once considered niche to only crypto enthusisatics to a solution easy-to-use and attractive to mainstream adoption.<br>

Concha is built as a Layer 3 (L3) solution on Bitcoin for several reasons. Firstly, leveraging Bitcoin's secure and well-established network provides a solid foundation for Concha's operations. Secondly, by synchronizing its state with Rootstock, a trusted Bitcoin Layer 2 (L2) solution, Concha enhances its scalability and interoperability while maintaining the security of the Bitcoin network. Additionally, positioning Concha as a consumer-focused L3 solution on Bitcoin allows for fast and cost-effective transactions, paving the way for widespread adoption of decentralized applications (dApps) among mainstream users.


# Concha Features

* **Modular Layer:** By harnessing advanced technologies like Polygon CDK and Celestia DA, Concha's modular design facilitates adaptable and scalable deployment of consumer applications, fostering swift innovation and expansion.
* **Seamless UX:** Concha uses Stackup for its AA bundler. With intuitive user interfaces and streamlined onboarding processes, Concha prioritizes usability, ensuring a seamless experience for both developers and end-users.&#x20;
* **MUD Compatible:** MUD is a useful framework to build ambitious onchain applications and autonomous worlds. Despite MUD's current incompatibility with zkEVM, Concha have developed a fork to ensure MUD’s compatibility with Concha chain. We're committed to refining this adaptation and collaborating with the MUD team to make Concha compatible with the original MUD in the future.&#x20;
* **Advanced ZK Tech:** The underlying structure of Concha's zk rollup layer greatly enhances the scalability of the network. By leveraging a modular design and being built on top of Rootstock (RSK), a layer 2 protocol on the Bitcoin Network, Concha facilitates fast transaction processing with minimal fees, paving the path for broad adoption.
* **Lightning Speed, Low Cost**: Concha utilizes zkEVM, which enables smooth integration with established Ethereum tools and the Solidity programming language. This ensures that developers can effortlessly migrate and develop decentralized applications (dApps) across various blockchains, promoting interoperability across the ecosystem. Moreover, Concha leverages Polygon CDK for enhanced scalability and efficiency, while Celestia DA bolsters data availability and security. This comprehensive approach guarantees robust blockchain solutions and fosters seamless interoperability among diverse networks.<br>


# Onboarding


# Install MetaMask

\* If you have already installed Metamask please skip this tutorial.

## **Setting up MetaMask** <a href="#setting-up-metamask" id="setting-up-metamask"></a>

**Step 1.** Head over to <https://metamask.io/>.

**Step 2.** Download and install the MetaMask version compatible with your browser.

**Step 3.** After it's finished downloading, click *Create a new wallet*.

![](https://2005740386-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F86DOhBfNrLlWRaDcVIZ3%2Fuploads%2FRDVYvtjNLFp1Lb3rHJ9d%2Fimage.png?alt=media\&token=a0a349c4-bb48-48fd-8e7e-68f65c97c8d9)

**Step 4.** Agree or disagree to information collection.

**Step 5.** Create password.

**Step 6.** Click *Secure my wallet. You will be given your backup phrase, also known as your "private key," which is made up of 12 words. It is good practice to write this down somewhere safe and never show or tell anyone these words. Anyone who has this phrase can access your assets and do as they please with them, so don't ever give it to anyone!*

![](https://2005740386-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F86DOhBfNrLlWRaDcVIZ3%2Fuploads%2FFH77B4ItCiqzjA3IDomJ%2Fimage.png?alt=media\&token=4d447ed8-5d38-4574-8ead-c2ed608cb159)

**Step 7.** Confirm your *Secret Recovery Phrase.*

**Step 8.** Congratulations, your wallet has successfully been created! Your account number or wallet address will look something like this: 0x279a8EeEC1E9139dE18Db3E5A57463695D424172 or as seen in the photo below: 0x279...4172. If you click on this number (abbreviated below "Account 1"), your computer will automatically copy the address.

![](https://2005740386-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F86DOhBfNrLlWRaDcVIZ3%2Fuploads%2FXHp8pjCCEmWzs3y0FScL%2Fimage.png?alt=media\&token=c3cb3c71-7a65-4435-aeab-f0b940b7ddd1)


# Add to MetaMask

## Using Concha Bridge

You can add Concha Testnet to MetaMask with one click.

**Step 1:** Access the Concha Bridge <https://bridge.concha.network>

**Step 2:** Click on button "**Add to MetaMask**". Then accept on MetaMask popup.

<figure><img src="/files/2CiKNCZD7E9gsfunvsiT" alt=""><figcaption></figcaption></figure>

## Add manually

**Step 1.**  Click *Ethereum Mainnet* in the top left corner.

<div align="left"><figure><img src="/files/BW6Ics3RXHp5vfzhwPcL" alt=""><figcaption></figcaption></figure></div>

**Step 2.** Click *Add network*.

<div align="left"><figure><img src="/files/4aIiWGGRvu385fCdnAKh" alt=""><figcaption></figcaption></figure></div>

**Step 3.** Click *Add a network manually* at the bottom of the page.

![](https://2005740386-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F86DOhBfNrLlWRaDcVIZ3%2Fuploads%2FX23mh9QmF0eBydcDr6U1%2Fimage.png?alt=media\&token=e676fda5-78b1-4944-ac70-67e577fb8e9a)

**Step 4.** Enter the informations below.

<div align="left"><figure><img src="/files/ctmMlrpcVv0s5ZPt0ao5" alt=""><figcaption></figcaption></figure></div>

## Concha Testnet

Network name: Concha Testnet

RPC URL: <https://testnet-rpc.concha.network>

Chain ID: 11118

Currency symbol: tBTC

Block explorer URL: <https://explorer.concha.network>


# Bridge assets

Concha Bridge is a bridge that allows you to transfer assets between the Rootstock and the Concha.

## From Rootstock to Concha

**Step 1:** Faucet BTC on Rootstock Testnet.

Faucet links:

{% embed url="<https://faucet.rootstock.io/>" %}

**Step 2**: Connect to Concha Bridge

Access to Concha Bridge [https://bridge.concha.network](https://bridge.concha.network/)

Click "Add to MetaMask" if you haven't added the network to the MetaMask.

Click icon MetaMask "Connect using web wallet".

<figure><img src="/files/HEFwBpiytb0iMfOqKGp1" alt=""><figcaption></figcaption></figure>

**Step 3:** Bridge tBTC to Concha Testnet

Select source network (Rootstock Testnet), set tBTC amount. Click "Continue".

<figure><img src="/files/VRL03lSodu8elJomczRt" alt=""><figcaption></figcaption></figure>

Confirm the information and click on "Bridge". Then confirm transaction on MetaMask popup

<figure><img src="/files/HLtm8BozojruL8bVLAB8" alt=""><figcaption></figcaption></figure>

## From Concha to Rootstock

Select source network (Concha Testnet), set tBTC amount. Click "Continue".

<figure><img src="/files/oHZft2KbCsQKawjxbZZ6" alt=""><figcaption></figcaption></figure>

Confirm the information and click on "Bridge". Then confirm transaction on MetaMask popup

<figure><img src="/files/7DXe3lLr7bfd8ifjTePB" alt=""><figcaption></figcaption></figure>


# Faucet tBTC

Access the faucet link below and input your Ethereum address, then click "Give me 0.5 tBTC".

{% embed url="<https://faucet.concha.network>" %}

<figure><img src="/files/X2xEgkHvgZFgRa5CLVrw" alt=""><figcaption></figcaption></figure>


# Community

Don't miss out on the opportunity to be a part of the blockchain revolution! Follow us on Twitter and join our Telegram community today:

* Twitter:[ ](https://twitter.com/CONCHA_network)<https://twitter.com/ConchaNetwork>
* Telegram Chat: <https://t.me/ConchaNetwork>
* Telegram Channel:[ ](https://t.me/Concha_Annoucement)<https://t.me/ConchaNetwork_News>


# Quick start


# Connect to Concha

Connecting to Concha mainnet or testnet.

#### Mainnet - Coming soon <a href="#mainnet" id="mainnet"></a>

Network name: Concha Mainnet

#### Testnet <a href="#testnet" id="testnet"></a>

Network name: Concha Testnet

RPC URL: <https://testnet-rpc.concha.network>

Chain ID: 11118

Currency symbol: tBTC

Block explorer URL: <https://explorer.concha.network>


# Bridge assets

This section has been introduced in the [Onboarding section](/users/onboarding). Please see the link below:

{% content-ref url="/pages/rOgPDGyo2YqoCE3d61Eo" %}
[Bridge assets](/users/onboarding/bridge-assets)
{% endcontent-ref %}


# Faucet tBTC

This section has been introduced in the [Onboarding section](/users/onboarding). Please see the link below:

{% content-ref url="/pages/45OLbG4vrxv659tbIg4B" %}
[Faucet tBTC](/developers/quick-start/faucet-tbtc)
{% endcontent-ref %}


# Fully on-chain games


# MUD framework

MUD is a framework for ambitious onchain applications. It reduces the complexity of building [Ethereum](https://ethereum.org/) apps with a tightly integrated software stack. It's [open source](https://github.com/latticexyz/mud) and [free to use](https://github.com/latticexyz/mud/blob/main/LICENSE).

{% embed url="<https://mud.dev/introduction#why-mud>" %}

## Deploy MUD to Concha Network

{% hint style="warning" %}
Update to the latest foundry version.

```bash
foundryup
```

{% endhint %}

At present, MUD does not fully support zkEVM version. We have modified some packages to be able to deploy MUD contracts to zkEVM. If you are using the MUD framework, please see the instructions below to deploy your game to Concha testnet:

Step 1: Move to `packages/contracts` folder and clean the [`node_modules`](#user-content-fn-1)[^1] folder.

Step 2: Edit the `package.json` file, then replace the dependencies below:

```
"@latticexyz/cli": "npm:@concha-network/cli@2.0.0-next.17-batched",
"@latticexyz/world": "npm:@concha-network/world@2.0.0-next.17",
"@latticexyz/world-modules": "npm:@concha-network/world-modules@2.0.0-next.17"
```

Step 3: Install the dependencies

```bash
pnpm install
```

Step 4: Add Concha network profile. Edit the `foundry.toml` file, then add configurations below:

```
solc = "0.8.24" // upgrade solidity version to 0.8.24

// Add the Concha testnet profile
[profile.concha-testnet]
eth_rpc_url = "https://testnet-rpc.concha.network"
```

Step 4: Deploy to Concha testnet. Faucet native token [here](/users/onboarding/faucet-tbtc).

```bash
pnpm run build && mud deploy --profile=concha-testnet
```

Wait for the contracts to be deployed.

[^1]:


# dApp


# Write a contract

This document explains how to automatically write a smart contract using the OpenZeppelin Wizard. The resulting smart contract code can either be integrated with Remix by Clicking the **Open in Remix** button, or copied to a clipboard and pasted in the user’s intended IDE.

## Getting started <a href="#getting-started" id="getting-started"></a>

Navigate to the [OpenZeppelin Wizard](https://wizard.openzeppelin.com/) in your browser. First thing to notice is the **Solidity Wizard** and **Cairo Wizard** buttons.

One can choose any of the following tabs to begin creating an out-of-box smart contract code in either Solidity (for EVM chains) or Cairo (useful for Starknet). These are:

* **ERC20** for writing an ERC-20 token smart contract.
* **ERC721** for writing an NFT token smart contract.
* **ERC1155** for writing an ERC-1155 token smart contract.
* **Governor** for creating a DAO.
* **Custom** for writing a customized smart contract.

## Writing an NFT contract <a href="#writing-an-nft-contract" id="writing-an-nft-contract"></a>

For illustration purposes, we will be creating a NFT smart contract.

Suppose you wanted to create a `Mintable`, `Burnable` ERC721 token and specify an appropriate license for it.

1. Select the **ERC721** tab.
2. Give your NFT a name and a symbol by filling the `Name` and `Symbol` fields.
3. Use the check-boxes on the left to select features of your token.
4. Put a tick on the `Mintable` check-box.
5. Put a tick on the `Auto Increment Ids` check-box, this ensures uniqueness of each minted NFT.
6. Put a tick on the `Burnable` check-box.
7. Either leave the **default MIT license** or type the license of your choice.

Notice that new lines of code are automatically written each time a feature is selected.

## Contract is ready <a href="#voila-contract-is-ready" id="voila-contract-is-ready"></a>

With the resulting lines of code, you now have the NFT token contract written in Solidity. As mentioned above, this source code can now be ported to an IDE of your choice or opened directly in Remix.

The below figure depicts the auto-written NFT smart contract code.

<figure><img src="/files/n6VzY0qGpy8iG7msOplG" alt=""><figcaption><p>The end-product NFT source code</p></figcaption></figure>


# Deploy with Foundry

Any smart contract deployable to the Ethereum network can be deployed easily to the Concha network. In this guide, we will demonstrate how to deploy an ERC-721 token contract on the Concha network using Foundry.

## Set up the environment <a href="#set-up-the-environment" id="set-up-the-environment"></a>

Foundry is a smart contract development toolchain. It can be used to manage dependencies, compile a project, run tests and deploy smart contracts. It also lets one interact with the blockchain from the CLI or via Solidity scripts.

## **Install Foundry**

If you have not installed Foundry, Go to [book.getfoundry](https://book.getfoundry.sh/) and select **Installation** from the side menu. Follow the instructions to download **Using Foundryup**.

Next, select **Creating a New Project** from the sidebar. Initialize and give your new project a name: `forge init zkevm-sbt`

In case of a `library not loaded error`, you should run below command and then repeat the above process again:

Copy

```
brew install libusb
```

If you never installed Rust or need an update, visit the website [here](https://www.rust-lang.org/tools/install).

## **Build a project and test**

Run the command `forge build` to build the project. The output should look something like this:

<figure><img src="/files/jdDra8bm8S9uL2z3HMXI" alt=""><figcaption><p>Successful forge build command</p></figcaption></figure>

Now, test the build with `forge test`

<figure><img src="/files/mSP5E7SiR8sYLKVMbAQ8" alt=""><figcaption><p>Testing Forge Build</p></figcaption></figure>

You can check out the contents of the newly built project by switching to your IDE. In case of VSCode, just type: `code .`

## Writing the smart contract <a href="#writing-the-smart-contract" id="writing-the-smart-contract"></a>

1. Find the [OpenZeppelin Wizard](https://wizard.openzeppelin.com/) in your browser, and use the wizard to create an out-of-the-box NFT contract.
   * Select the `ERC721` tab for an NFT smart contract.
   * Name the NFT and give it an appropriate symbol. Example: Name `SoEarly` and Symbol `SOE`.
   * Go ahead and select features for your token. Simply tick the relevant boxes.
   * You can tick the **URI Storage** box if you wish to attach some image or special text to the token.
2. Open your CLI and install dependencies with this command:

   Copy

   ```
   npm install @openzeppelin/contracts-upgradeable
   ```
3. Remap dependencies to easy-to-read filenames with the command:

   Copy

   ```
   forge remappings > remappings.txt
   ```
4. Inside the new `remapping.txt` file, rename the referencing `openzeppelin-contracts` to `openzeppelin`, which is the name used when importing. That is, change `openzeppelin-contracts/=lib/openzeppelin-contracts` → `openzeppelin/=lib/openzeppelin-contracts`.
5. Copy the smart contract code in OpenZeppelin: **Copy to Clipboard**
6. In the IDE, open a new `.sol` file, name it and paste the copied code to this file. This is in fact the actual smart contract for the NFT.

## Add control on token transfers <a href="#add-control-on-token-transfers" id="add-control-on-token-transfers"></a>

The aim here is to put rules in place stipulating that the token cannot be transferred without burning it.

* Go to the [OpenZeppelin documentation](https://docs.openzeppelin.com/).
* Look up the signature by searching for `_beforetokentransfererc721`.
* Scroll down to `ERC 721` and copy the corresponding text on the right side:

  Copy

  ```
  _beforeTokenTransfer(address from, address to, uint256 firstTokenId, uint256 batchSize) internal
  ```
* Create a new function in the code for the smart contract token called `_beforeTokenTransfer`

  Copy

  ```
  function _beforeTokenTransfer (address from, address to, uint256 firstTokenId, uint256 batchSize) internal override {
      require(from==address(0) || to==address(0), "Soulbound: cannot transfer");
      super._beforeTokenTransfer(from, to, firstTokenId, batchSize);
  }
  ```

## Set a token URI (optional) <a href="#set-a-token-uri-optional" id="set-a-token-uri-optional"></a>

A token URI is a function that returns the address where the metadata of a specific token is stored. The metadata is a `. json` file where all the data associated with the NFT is stored. Our aim here is to attach some image to the created token.

The stored data typically consists of the name of the token, brief description and URL where the image is stored.

* Choose an image and give it a name relatable to the token
* Find some free of charge IPFS storage for the image, like [NFT.STORAGE](https://nft.storage/)
* Upload the image to the storage using your GitHub account

## Add URI json file <a href="#add-uri-json-file" id="add-uri-json-file"></a>

This is the file that contains the metadata for the token which includes the image address (i.e., the IPFS address of the image).

* In the IDE, create a new `.json` file which you can call `tokenuri.json`
* Populate the `tokenuri.json` file with the token-name, description and URL where the image is stored:

  Copy

  ```
  {
      "title": "So Early",
      "description": "I was super duper early to the Concha Network",
      "image": "<IPFS address>" /* remove the forward-slash at the end of the URL, if any */
  }
  ```
* Upload the `tokenuri.json` file to the same storage where the image was uploaded
* Copy the address to the `Sbt.sol` inside the `safeMint` function
* Remove the `uri` parameter so as to hardcode it. This makes all tokens to have the same `uri` image, but every consecutively minted pair of tokens will differ by 1 in numerical value of their `tokenId`.

## Populate the `.env` file <a href="#populate-the-env-file" id="populate-the-env-file"></a>

In order to deploy on the Concha Testnet, populate the `.env` file in the usual way. That is,

* Create a `.env.sample` file within the `src` folder
* Populate `.env.sample` file with your `ACCOUNT_PRIVATE_KEY` and the Concha Testnet’s `RPC URL` found [here](/developers/quick-start/connect-to-concha#testnet). So the `.env.sample` file will look like this:

  Copy

  ```
  RPC_URL="https://testnet-rpc.concha.network"
  PVTKEY="<insert private key here>"
  ```
* Copy the contents of the `.env.sample` file to the `.env` file,

  Copy

  ```
  cp .env.sample .env
  ```

Warning

Make sure `.env` is in the `.gitignore` file to avoid uploading your `ACCOUNT_PRIVATE_KEY`.

## Deploy your contract <a href="#deploy-your-contract" id="deploy-your-contract"></a>

1. In the CLI, use the following command to ensure grabbing variables from `.env`:

   Copy

   ```
   source .env
   ```
2. Check if the correct `RPC URL` is read from the `.env` file:

   Copy

   ```
   echo $RPC_URL
   ```
3. You can now use the next command:

   Copy

   ```
   forge create --rpc-url $RPC_URL --private-key $PRIVATE_KEY src/{ContractFile.sol}:{ContractName} --legacy
   ```

   which executes the following:

   * Does a `forge create`.
   * Passes the `RPC_URL` and `PVTKEY`.
   * References the actual smart contract.

   For example, when deploying the `Sbt.sol` contract, the command will look like this:

   Copy

   ```
   forge create --rpc-url $RPC_URL --private-key $PRIVATE_KEY src/Sbt.sol:SoEarly --legacy
   ```

The above command compiles and deploys the contract to the Concha Testnet. The output on the CLI looks like this one below.

<figure><img src="/files/xvAYDy9stN3OcawnIshR" alt=""><figcaption><p>Successful Deploy Sbt.sol</p></figcaption></figure>

## Check deployed contract in explorer <a href="#check-deployed-contract-in-explorer" id="check-deployed-contract-in-explorer"></a>

* Copy the address of your newly deployed contract (i.e. the `Deployed to:` address as in the above example output).
* Go to the [Concha Testnet Explorer](https://explorer.concha.network), and paste the address in the `Search by address` field.
* Check `Transaction Details` reflecting the `From` address, which is the owner’s address and the `To` address, which is the same `Deployed to:` address seen in the CLI.


# Deploy with Hardhat

Hardhat is one of the popular smart contract development frameworks.&#x20;

This document is a guide on how to deploy a smart contract on the Concha network using Hardhat.

## Hardhat smart contract <a href="#hardhat-smart-contract" id="hardhat-smart-contract"></a>

* `mkdir <project-name>;cd <project-name>`
* Initialize a project with Hardhat: `npx hardhat`.
* Next, (… *To avoid failure … please go slow with this cli dialogue*…),

  So then,
* Press `<ENTER>` to set the project root.
* Press `<ENTER>` again to accept addition of `.gitignore`.
* Type `n` to reject installing `sample project's dependencies`.

  The idea here is to postpone installing dependencies to later steps due to a possible version-related bug.
* Open the `hardhat.config.js` file and paste the below code:

  Copy

  ```
  require("dotenv").config();
  require("@nomicfoundation/hardhat-toolbox");

  /** @type import('hardhat/config').HardhatUserConfig */
  module.exports = {
  solidity: "0.8.9",
  paths: {
      artifacts: "./src",
  },
  networks: {
      concha-testnet: {
      url: `https://testnet-rpc.concha.network`,
      accounts: [process.env.ACCOUNT_PRIVATE_KEY],
      },
  },
  };
  ```

  Note that a different path to artifacts is added so that the React app will be able to read the contract ABI within the `src` folder.

## Add scripts <a href="#add-scripts" id="add-scripts"></a>

* Create a new file, in the contracts folder, named `Counter.sol`: `touch contracts/Counter.sol`.
* Copy the below code and paste it in the Counter contract code:

  Copy

  ```
  //SPDX-License-Identifier: MIT
  pragma solidity ^0.8.9;

  contract Counter {
  uint256 currentCount = 0;

      function increment() public {
          currentCount = currentCount + 1;
      }

      function retrieve() public view returns (uint256){
          return currentCount;
      }
  }
  ```
* Create a new file in the scripts folder `deploy-counter.js`: `touch scripts/deploy-counter.js`.
* Add the code below to the `deploy-counter.js` file:

  Copy

  ```
  const hre = require("hardhat");

  async function main() {
      const deployedContract = await hre.ethers.deployContract("Counter");
      await deployedContract.waitForDeployment();
      console.log(
          `Counter contract deployed to https://explorer.concha.network/address/${deployedContract.target}`
      );
  }

  main().catch((error) => {
      console.error(error);
      process.exitCode = 1;
  });
  ```
* Before compiling the contract, you need to install the toolbox. You may need to change directory to install outside the project. Use this command:

  Copy

  ```
  npm install --save-dev @nomicfoundation/hardhat-toolbox
  ```
* Compile your contract code (i.e., go back to the project root in the CLI):

  Copy

  ```
  npx hardhat compile
  ```
* Now run the scripts:

  Copy

  ```
  npx hardhat run scripts/deploy-counter.js --network concha-testnet
  ```

  ​Here’s an output example:

  `Counter contract deployed to https://explorer.concha.network/address/0x5FbDB2315678afecb367f032d93F642f64180aa3`

## Update frontend <a href="#update-frontend" id="update-frontend"></a>

The next step is to turn `Counter.sol` into a dApp by importing the `ethers` and the `Counter` file, as well as logging the contract’s ABI.

* Include the below code in the `App.js` file:

  Copy

  ```
  import { ethers } from "ethers";
  import Counter from "./contracts/Counter.sol/Counter.json";
  const counterAddress = "your-contract-address"
  console.log(counterAddress, "Counter ABI: ", Counter.abi);
  ```
* Update the `counterAddress` to your deployed address.
  * It is the hexadecimal number found at the tail-end of the output of the last `npx hardhat run ...` command and looks like this `0x5FbDB2315678afecb367f032d93F642f64180aa3`.
  * It must be pasted in the `App.js` to replace `your-contract-address`. Be sure to use the deployed address from your own implementation!
* Update frontend counter to read from blockchain. Include the below code in the `App.js` file:

  Copy

  ```
  useEffect(() => {
      // declare the data fetching function
      const fetchCount = async () => {
      const data = await readCounterValue();
      return data;
      };

      fetchCount().catch(console.error);
  }, []);

  async function readCounterValue() {
      if (typeof window.ethereum !== "undefined") {
          const provider = new ethers.providers.Web3Provider(window.ethereum);

          console.log("provider", provider);

          const contract = new ethers.Contract(
              counterAddress,
              Counter.abi,
              provider
          );

          console.log("contract", contract);

          try {
              const data = await contract.retrieve();
              console.log(data);
              console.log("data: ", parseInt(data.toString()));
              setCount(parseInt(data.toString()));
          } catch (err) {
              console.log("Error: ", err);
              alert(
                  "Switch your MetaMask network to Concha Testnet and refresh this page!"
              );
          }
      }
  }
  ```
* Also, to import `useEffect`, insert it like this:

  Copy

  ```
  import { useState, useEffect } from "react";
  ```
* To be able to track a loader, add this to your state:

  Copy

  ```
  const [isLoading, setIsLoading] = useState(false);
  ```

  * This is within the `App()` function.
* Let frontend counter write to the blockchain by adding the below `requestAccount` and `updateCounter` functions:

  Copy

  ```
  async function requestAccount() {
  await window.ethereum.request({ method: "eth_requestAccounts" });
  }

  async function updateCounter() {
  if (typeof window.ethereum !== "undefined") {
      await requestAccount();
      const provider = new ethers.providers.Web3Provider(window.ethereum);
      console.log({ provider });
      const signer = provider.getSigner();
      const contract = new ethers.Contract(counterAddress, Counter.abi, signer);
      const transaction = await contract.increment();
      setIsLoading(true);
      await transaction.wait();
      setIsLoading(false);
      readCounterValue();
  }
  }
  ```

  Place these two functions above the `readCounterValue()` function in the `App.js` file.
* Replace the `incrementCounter` function with this one:

  Copy

  ```
  const incrementCounter = async () => {
  await updateCounter();
  };
  ```
* Update the increment button code to:

  Copy

  ```
  <Button
  onClick={incrementCounter}
  variant="outlined"
  disabled={isLoading}
  >
  {isLoading ? "loading..." : "+1"}
  </Button>
  ```

Now, run the Counter dApp by simply using `npm start` in CLI at the project root.

You have successfully deployed a dApp on the Concha testnet.


# Verify a contract

Coming soon


# Polygon CDK

<table data-card-size="large" data-view="cards" data-full-width="true"><thead><tr><th></th><th></th><th data-hidden data-card-cover data-type="files"></th><th data-hidden data-card-target data-type="content-ref"></th></tr></thead><tbody><tr><td>Polygon Chain Development Kit (CDK) is a modular, open source software toolkit allowing blockchain developers to launch new zero-knowledge proof (zkEVM plus optional validium) L2 chains on Ethereum.</td><td></td><td></td><td></td></tr><tr><td></td><td></td><td><a href="/files/KMB022aT2OW7j65GGpbS">/files/KMB022aT2OW7j65GGpbS</a></td><td></td></tr><tr><td><strong>Polygon Type 1 Prover</strong></td><td><p></p><p>Find out about the Polygon Type 1 Prover component.</p></td><td></td><td><a href="https://docs.polygon.technology/cdk/architecture/type-1-prover/intro-t1-prover">https://docs.polygon.technology/cdk/architecture/type-1-prover/intro-t1-prover</a></td></tr><tr><td><strong>CDK rollups</strong></td><td><p></p><p>Get started with the CDK zkRollup stack.</p></td><td></td><td><a href="https://docs.polygon.technology/cdk/get-started/quickstart-rollup">https://docs.polygon.technology/cdk/get-started/quickstart-rollup</a></td></tr><tr><td>CDK validiums</td><td><p></p><p>Get started with the CDK validium stack.</p></td><td></td><td><a href="https://docs.polygon.technology/cdk/get-started/quickstart-validium">https://docs.polygon.technology/cdk/get-started/quickstart-validium</a></td></tr><tr><td><strong>Rollup versus validium</strong></td><td><p></p><p>Discover the key differences between the rollup and validium infrastructure options.</p></td><td></td><td><a href="https://docs.polygon.technology/cdk/spec/validium-vs-rollup">https://docs.polygon.technology/cdk/spec/validium-vs-rollup</a></td></tr></tbody></table>


# Celestia

Celestia is a modular data availability (DA) network that securely scales with the number of users, making it easy for anyone to launch their own blockchain.

{% embed url="<https://celestia.org/what-is-celestia/>" %}

{% embed url="<https://celestia.org/what-is-da/>" %}

{% embed url="<https://docs.celestia.org/>" %}


# ERC-4337:  Account Abstraction

An account abstraction proposal which completely avoids the need for consensus-layer protocol changes

{% embed url="<https://www.erc4337.io/docs>" %}


