How to build a "Play to Earn" idle game on Polygon zkEVM
HTML-код
- Опубликовано: 30 июн 2024
- In this video, we'll go over how to create a play to earn idle game on Polygon zkEVM. This idle-like game is called Crypto Farm and allows you to stake tools to earn an ERC20 token. You can spend those tokens in the shop to buy more tools to earn more tokens.
Demo repo: github.com/watase-eth/polygon...
Polygon zkEVM Bridge:
wallet.polygon.technology/
Smart contracts:
ERC1155Drop - thirdweb.com/thirdweb.eth/Dro...
ERC20 - thirdweb.com/thirdweb.eth/Tok...
ERC115Staking - thirdweb.com/thirdweb.eth/Edi...
Join our Community of over 30,000 Web3 builders: / discord
thirdweb Official Site: thirdweb.com/dashboard
thirdweb Twitter: / thirdweb
Timestamps:
00:00 Introduction
01:09 Game demo
04:48 Polygon zkEVM bridge
06:50 Farmer NFT (ERC1155)
10:03 Tool NFTs (ERC1155)
11:42 $CARROT (ERC20)
12:57 Set claim conditions for Tool NFTs
14:50 Create ERC1155 staking contract
21:10 Setup Play to Earn app with thirdweb
25:00 Create Navbar
27:10 Store contract address
28:19 Claim a Farmer NFT
34:35 Game dashboard
50:25 Tools shop
55:48 Conclusion - Наука
Thank you for watching! Be sure to leave a comment with what you'd like to see us build next. 👇
If you haven't already, hit the subscribe button to be notified every time we drop a web3 development tutorial. 💫
can you upload picture of the farmer
Great video... an updated, streamlined version of Jarrod's P2E game from 8 months ago.
Amazing content, thank you very much!
Glad you liked it!
thanks for the video sir
WHAT A GREAT VIDEO ! YOU SHOULD DO THE SAME BUT WITH UNITY !
Awesome video!!
Glad you enjoyed it
You can then turn this whole project into an nft by going to unstoppable and creating a site under your crypto domain and upload your ipfs link you got when yarn deployed ..or upload the built files from the out/ directory created in your project
its compatible with swith network to bsc?
The shop nav button doesnt redirect once deployed so either remove the button or make sure it redirects the same as the inventory shop button so once deployed it leads to shop html ...not just shop or ipfs will say not found error ... However you can verify it does work when clicking the inventorys shop button it redirects no problem
Great Guide, i use it and all work good, but i got 1 problem, when i claim a new NFT, the token that i shoud paid is not getting discount it from wallet. i get the nft for free.
this is usefull, cool guide for game developer. could you show me how to make a ERC1155 items that have a life time please, ex: 24 hours use after buy. Thank you
i mean that, which funtions that i can use to make an item have a life time
So how can we make an ido launchpad, thanks in advance.
Very useful guide for me. i get the error: TypeError: Cannot read properties of undefined (reading '0') (components\Equipped.tsx (41:145) @ Equipped) when switching between different wallets. how to fix this error. Thanks
I can't build with "yarn build" . Error: No duplicate props allowed. how to fix it, thanks
Does zkEvm support other testnets like sepolia? Kinda hard to get gEth rn.
Polygon zkEVM currently support Goerli testnet.
I m using Polygon zkEVM Cardona chain ( 2442 ) instead of the old chain ( 1442 ) , how do I change the code to reflect this chain ??
I used the project in GitHub and ran it, but there are no images and you cannot get the farmer please can any one help me
what would i look up to find the "import {} for PolygonMainet instead of testnet?
Polygon is the mainnet and Mumbai is the testnet.
@@thirdweb_ Would there be a way to do a "Claim all" form the NFT tools staked instead of doing 1 at a time?
how to deploy it to hosting??
How much money would we need to start this with the in game currency
In this example you would only need to pay for the deployment cost, which is determined by the chain you deploy on and the gas at the time of deployment.
Hi.Can i create this play to earn game on the bnb testnet?
Yes. Just select the chain when deploying your smart contracts.
it says i gotta have eth on mainnet to get zkevm goerli
does it mean i need to like have REAL ETH inorder to get goerli on polygon ?
No the testnet bridge will only need Goerli ETH.
Hi, is this video outdated or can I still follow these instructions and be successful?
There are some updates since this video. The main one being thirdweb API keys, but everything else should be the same.
How to do the same with unity? any good tutorial or course?
We don't currently have a video on how to implement this with Unity. It can be done. But we will put this on our list of potential videos.
@@thirdweb_ will wait...thanks
sir can we make p2e game with core gaming engine?
Can you make a tutorial?
Yes this concept can be created with our Unity SDK. We will put this on our list of potential videos.
@@thirdweb_ I'm waiting for that video.Very happy to learning with thirdweb.😇😇
how do i get tokens on goerli?
if you join the thirdweb Discord our support team will gladly send you some!
chakra is not working.
Here is an updated version of this tutorial (does not use Chakra): ruclips.net/video/mtaf6VtgcRo/видео.html
Polygon zkEVM is too expansive compared to normal polygon
I woluld like to find a developer to do this for me. I could pay or be a partner as designer and 3d creator to make unique 3d models instead of generic Ai images.Write to me if you're interested.
Sir you need some updates on your repo , some depedencies not working anymore also thirdweb need apikey rn
Repo will be updated and a new version of this video will also be released soon.
You rock love these vids. Are you on twitter / x I want to follow you. I already following third web
Can you make another P2E tutorial for Unreal Engine game. It would be handy to see Lyra Starter game project by Epic Games implementing P2E @thirdweb_ framework.