Use Truffle Suite for Simple Web3 — and earn POAP proof of your contribution. by Michael Bogan | November, 2022

Boost your social proof today

Unsplash. Photo by Abby Whidt on

One of the promises of Web3 is openness, versatility and interoperability at the application level. A paradigm where open source software and tooling enables others to contribute to projects they find valuable, while projects provide transparency by publicly hosting their codebases. Another Web3 initiative provides on-chain proof of contribution – the ability to prove that you can do what you say you have done.

One company embodying these Web3 principles is Truffle. Not only is most of its tooling open source so anyone can contribute, but they also provide PoAP for those who do.

This article will explore Truffle’s suite of open source tools, what PoAPs are, and teach you how to make your first contribution to proving that you are a Web3 builder with Truffle.

Truffle: The most comprehensive suite of tools for smart contract development

As the image above shows, Truffle is a suite of tools for smart contract development. Additionally, it was one of the first DevNets created for Ethereum. From writing to deployment and everything in between, Truffle Suite makes the process easy and secure. And the best part? Most of the tools are open source. So you can customize these tools to suit your needs and share your changes with the wider Web3 community.

Truffle Suites include the following:

Let’s look at each of these tools to understand them better.

Truffle, the key tool in the kit, is a development environment that simplifies the creation of smart contract projects. The tools include automated testing, configurable build pipelines, scriptable deployment, built-in network management, and more.

Getting started with Truffle is easy. To install the tool, type the following command in your terminal and then initialize a new project:

$ npm install -g truffle
$ truffle init

truffle init The command creates a blank project with the required folder structure and a configuration file so that you can start building quickly.

Once you have a smart contract running, you need to test it on the blockchain. This is where ganache comes in. Ganache is a locally hosted blockchain that emulates Ethereum on your machine. it allows you to use console.log In Solidity, fork mainnet (or any other Ethereum network), set mining options, and impersonate real accounts, among other things.

Ganache testing smart contracts is essential to understand how they will behave when you deploy to a testnet or mainnet.

Install Ganache and then run it with the following commands:

$ npm install ganache --global
$ ganache

Comment: You can start ganache with various options using the following format:

$ ganache --namespace.option="value"

Additionally, you can run Ganache in your browser by including the following in your HTML code: {VERSION} With your installed version of Ganache:

<script src="https://cdn.jsdelivr.net/npm/ganache@{VERSION}/dist/web/ganache.min.js"></scrip

If Visual Studio Code is your editor of choice, Truffle has a useful extension that enables you to build, build, debug, and deploy your projects without leaving the editor. It also includes direct integration with your Infura account, so you can easily deploy your projects using custom RPC endpoints and all the observable Infura features provide.

After installing the Truffle for VS Code extension, you can start a new project or run other commands by opening the command palette ctrl + shift + P and typing truffle,

One of the riskiest aspects of developing smart contract projects is accidentally exposing your wallet’s private key or mnemonic phrase. Truffle Dashboard eliminates this risk by abstracting that part of the process, while instead providing a GUI to interact with.

After installing the latest version of Truffle, all you have to do is configure your truffle-config.js To include the following inside the file networks Thing:

networks: {
dashboard: {
port: 24012,
}
},

then start dashboard with command truffle dashboard GUI will display on http://localhost:24012/rpcs in your browser. From there, you can connect your MetaMask wallet and select the network you want to deploy to. When you are ready to deploy your smart contract, type the following command to start the deployment on the connected network:

$ truffle migrate --network dashboard

Truffle boxes are the boilerplate or starter that sets your project in a specific direction. They contain code to get you moving quickly, so you don’t have to reinvent the wheel every time. Some useful boxes include nft-box, optimism, arbitrum, react, and polygon. You can even make your own truffle boxes!

Select a box from the list of available Truffle Boxes and run the command:

$ truffle unbox <box_name>

This creates a new truffle project with all the boilerplate from the truffle box selected.

Now that you are familiar with the Truffle suite of tools, let’s explore how we can contribute to their documentation and earn PoAP.

What is POAP?

Proof of Attendance Protocol (PoAP) is a platform and infrastructure in Web3 that issues tokens to prove that someone has done something. It could be participating in an event, voting in a community or contributing to a project. PoAPs are NFTs molded under Proof of Attendance Protocol smart contracts and are digital records kept by collectors, usually to prove that they have attended a virtual or physical event. In our case, we’ll earn POAP for contributing to Truffle’s documentation.

In the next section of this article, we will walk you through the steps to earn an Annual Contributor POAP and become a 2022 Truffle Contributor. Truffle is collaborating with GitPOAP to release POAP to contributors. GitPOAP is a contributor recognition platform that easily integrates POAP issuances into GitHub. Once we make a meaningful contribution to Truffle’s documentation, we can submit a pull request (PR) to Truffle’s repository (repo) to merge our contributions. Afterwards, we can sign into GitPOAP through GitHub, claim our POAP, and view collectibles on our profile page.

Open a new tab and visit Truffle’s GitHub page.

We will review the documentation to see where we can contribute. I immediately see where we can be useful. The opening sentence in Truffle’s readme file outlines three different value propositions of Truffle Software. However, to emphasize this it is missing something grammatically important: the lovely Oxford comma. Oxford commas allow for each item in an array to have a namespace. While they are stylistic (like the AP-style writing you see in magazines and newspapers), they are perfectly useful in technical documentation.

The opening sentence of Truffle read: “Truffle is a development environment, testing framework, and asset pipeline for Ethereum, aimed at making life easier as an Ethereum developer.” In my opinion, this sentence would be better if it were said, “Truffle is a development environment, testing framework, and asset pipeline for Ethereum that aims to make life easier as an Ethereum developer.” The test framework and asset pipeline are separate offerings, so a comma would be helpful to add a degree of separation. Let’s submit a PR to the team at Truffle. The process is the same no matter what your operating system is.

First, “fork” Truffle’s repo on GitHub. A fork is a different but similar version of truffle’s repo that we can use to submit our PR. We can work in this fork without affecting the main repo.

From here, we can make our own fork of truffle. I’ve already made one, as you can see below:

After this, we can “clone” our new repo to our machine. This will allow us to work on the repo in our chosen IDE, which for me would be VS Code. Making sure we’re in the correct (our own) repository fork, let’s copy the URL, e.g. git@github.com:daviddoswell/truffle.git and paste it in our terminal window.

Once we do that, we can open the project in our chosen IDE.

Inside VS Code, I go to the README.md file and find the first sentence I want to update. I change it and then push the changes from my local copy to my remote (upstream) copy. You can see my oxford comma on line 11:

Let’s move on to these changes:

The software is now asking us to make a pull request (PR). We can navigate back to our repo and observe the changes. Sometimes you can contact the repo maintainer in advance and let them know that you are working on the project, especially if it is open source. In our case, a truffle maintainer immediately saw our PR and approved it.

Most projects require two or more approvals for accountability. do not worry. We got that too.

They can merge my PR after some checks to make sure my repo passes all security, programmatic and other assurances. For larger projects this usually takes about two hours, but it can happen sooner or later.

Now, we can go to GitPOAP to see if Truffle has issued us POAP for our contribution. First, we need to connect our MetaMask wallet. Click the Sign In button and then select MetaMask.

Next, we have the option to add our Github account.

Unfortunately, we can’t mint anything just yet. We need to first submit our contribution to GitPOAP. So, let’s start the onboarding process.

Follow the prompts to submit a contribution successfully.

Now, we wait.

Once our POAP is visible, we can mint it. Boom!

Now, we can go back to our profile on the GitPOAP website and see that we are the official POAP holders.

And we guys!

In this article, you learned about the Truffle suite of tools, what PoAP is, and how to earn it by contributing to Truffle’s documentation. As you can see, earning proof of contribution through PoAP can be useful to prove your abilities.

In addition, companies like ConsenSys, which makes some of their tools open source and rewards participants for contributions, are helping to build an ecosystem built on trust and openness. Although Web3 is still in its infancy, its direction is promising for developers and users.

To learn more about Truffle Suite or to start building with their tools, check out their docs or GitHub repo.

Leave a Comment