DEV Community

Cover image for From Zero To Crypto Hero (Week 3) - Further Work on Web3 Pokemon Project
Luftie The Anonymous
Luftie The Anonymous

Posted on

From Zero To Crypto Hero (Week 3) - Further Work on Web3 Pokemon Project

Hello Dev.to Community !

It's almost a month as I have started writing articles on Dev.to. Candidly speaking it's a mesmerising, how much fun and knowledge can writing and reading articles bring to ones life. And I want to express my gratefulness to all of my readers until now.

⚠️ WARNING: Next couple of paragraphs will not be related to coding and my week effort's specifically. If you want the gritty details, scroll down to Introduction section.

Ofc there is a jeopardy that I might be feeding a infinitely hungry dragon called "AI" with the data about my efforts and daily workflow and I might be targeted by the ads.

However...... SCREW THAT, coz as I mentioned in my post about AI (Although there were mentioned more topics from AI 🦾 to React and homo-sapiens species root of behaviour 🦍).

Humanity seems already to be at the verge of its existence, given the blazingly fast changes in the world, all of unsettling occurances, that it's tough to catch up with.

Tech CEOs (for me those are dumb assholes, not from the intellectual side, rather what they say publicly and how they influent others) and media spreading fear and uncertainty, willing you only to watch another clickbait video under label of "geopolitics", "development" across all of the people,only to get money for ads, simultaneously killing ambitions and eagerness to grow.

sammy

And in the end you've got linkedin posters (which are managed likely by an agent, given the quality of those posts) and triggering me to puke with rainbow on them all.

rainbow-puke

So, imo it's high-key better to have an attitude as though world would end up tomorrow, than caring about when will the next bomb blow in Iran and what causes will it bring to all of us at all.

Answering however finally why SCREW THAT, and isn't it self-hypocrisy, as I used to define myself as privacy first ? Well not really, I genuinely like the way it's been described in Cypherpunk Manifesto by Eric Hughes

Privacy is not secrecy. A private matter is something one doesn’t want the whole world to know, but a secret matter is something one doesn’t want anybody to know. Privacy is the power to selectively reveal oneself to the world.

And thus I do not expose it to the entire world per se, coz my post will likely have less than 25 views and 2 likes from people I met on dev.to, 5 likes from me and that's it.

Introduction

Ok, enough of general prattling and I hope you didn't leave me at this time (Thank you :D) and perhaps I managed to bring you laugh. Let's go into nitty-gritty details.

What have I been doing actually ?

As you might know I'm still working on my web3 pokemon-themed protocol or should I call it ecosystem, because it already has a mechanism for random card drawing ability 1 per day for each user, staking protocol for the cards, marketplace and yet in-build but there will be a pokemon battle mode, based on socket.io.

All of the sudden, getting rid of the most mundane part of coding for me throughout those years, which was designing and frontend UI-building, allowed my brain to fall back onto an idea to implement ZKP (Zero-Knowledge Proofs) to this project for Pokemon Trades, like e.g. users want to swap Pokemon with each other and there could be a proof that a user has the pokemon without a need to reveal it to the actual 3rd party.

Here you have links to particular parts of my project:

Smart-Contracts

GitHub logo LuftieTheAnonymous / PokeStake_Protocol

A Staking protocol with usage of Chainlink VRF for drawing a random pokemon Card

Foundry

Foundry is a blazing fast, portable and modular toolkit for Ethereum application development written in Rust.

Foundry consists of:

  • Forge: Ethereum testing framework (like Truffle, Hardhat and DappTools).
  • Cast: Swiss army knife for interacting with EVM smart contracts, sending transactions and getting chain data.
  • Anvil: Local Ethereum node, akin to Ganache, Hardhat Network.
  • Chisel: Fast, utilitarian, and verbose solidity REPL.

Documentation

https://book.getfoundry.sh/

Usage

Build

$ forge build
Enter fullscreen mode Exit fullscreen mode

Test

$ forge test
Enter fullscreen mode Exit fullscreen mode

Format

$ forge fmt
Enter fullscreen mode Exit fullscreen mode

Gas Snapshots

$ forge snapshot
Enter fullscreen mode Exit fullscreen mode

Anvil

$ anvil
Enter fullscreen mode Exit fullscreen mode

Deploy

$ forge script script/Counter.s.sol:CounterScript --rpc-url <your_rpc_url> --private-key <your_private_key>
Enter fullscreen mode Exit fullscreen mode

Cast

$ cast <subcommand>
Enter fullscreen mode Exit fullscreen mode

Help

$ forge --help
$ anvil --help
$ cast --help
Enter fullscreen mode Exit fullscreen mode



Web-app

GitHub logo LuftieTheAnonymous / PokeStake-Dapp

A Pokemon themed staking protocol with usage of Chainlink VRF

PokeStake 🎴⛓️

PokeStake Banner

A decentralized staking protocol where you can lock Pokemon cards and draw random rewards daily. Built on-chain with verifiable randomness and IPFS storage.

Overview

PokeStake is a Web3 staking protocol that lets users stake Pokemon cards and participate in daily random draws. Each day, stakers can claim a random card from the pool—powered by Chainlink VRF for cryptographically secure randomness and Pinata for decentralized card metadata storage.


Tech Stack

Technology Purpose Version
Next.js Frontend framework & API routes Latest
TypeScript Type-safe development Latest
Solidity Smart contract logic ^0.8.0
Foundry Smart contract development & testing Latest
RainbowKit Wallet connection & UI Latest
Wagmi Ethereum hooks & contract interaction Latest
TanStack Query Server state management Latest
Chainlink VRF Verifiable randomness v2
Pinata SDK IPFS pinning & card metadata Latest

Features

  • 🎴 Stake Pokemon Cards - Lock your cards into the protocol
  • 🎰 Daily Random Draws - Once per day, draw…

Backend

This week I focused on handling the UI display of the onchain data to the user, with error and loading states, improving the smart-contract tests and implementing the marketplace. The tests had to be conducted from scratch because there's been some issues with the initial code split I approached to build.

I also finally grasped how socket.io works, I had huge issue with understanding it and was having mind-fuck after mind-fuck, whenever I approached to learn it. But I guess many factors have impacted the fact I was not able to learn it, nevermind.

I visited this week also the university, that I'm likely to be a student of, here a link to the post with my impressions and a bit of linux-propaganda :D

I will not lie, that I would really like to integrate ZK into this project, however I also know that 17th of April is incoming with giant steps and I have to be ready to select a project I want to build and no theme has been announced yet. Thus I decided to build the project as long as the theme is not announced.

Current focus

  • Pokestake PVP mode implementation with socket.io with ability to win some SNORLIEs (in-app token)

  • Keeping an eye on the theme announcement for the ETHSilesia Hackathon and drafting a plan on what to build as a project on the hackathon.

Honestly I also have to say, that this project is by far the most engaging and perhaps not the most complex in terms of logic, but in case of tools you though. And it's weird that all of that happens, all of those experiences are emerging while I decided to leave web-dev and smart-contracts to delve into cryptography and so will it be.

How about your week ?

Feel free to share how has your week been going and share it in the comments ?

Cheerio, your Luftie !

Top comments (1)

Collapse
 
benjamin_nguyen_8ca6ff360 profile image
Benjamin Nguyen

nice!