GithubHelp home page GithubHelp logo

dinaris / keoken Goto Github PK

View Code? Open in Web Editor NEW

This project forked from bocha-io/keoken

0.0 0.0 0.0 12.47 MB

ETHGlobal 2023 - Hackathon entry

License: MIT License

Shell 0.10% JavaScript 4.98% TypeScript 91.57% CSS 0.42% HTML 0.53% Solidity 2.39%

keoken's Introduction

Keoken

Bridging Communities through NFT Ownership

ETHGlobal 2023 - Hackathon entry

Stack

The webpage was built using:

  • React
  • MUD
  • NFTScan
  • Ankr infra
  • Hosted on Netlify

Idea

To give more value to the NFTs that are resting in the user wallets, we created a proof of concept that gives rewards inside an Autonomous World to NFT holders.

This was thought to bootstrap fully on-chain gaming communities but can be used for any dApp built on top of the MUD engine.

The rewards generated after the claiming process can be anything that the developer wants to offer to the community, in our case we are just giving points, but it could be any in-game item or even tokens.

Built process

We started by creating a simple MUD project to spin up an Autonomous World.

After having the Autonomous World set up we connected it to the "external" world (the rest of the blockchain state) to be able to read the NFT balances from the user wallet.

The contract created verifies that the user is the owner of the NFT, marks the NFT as claimed (inside the Autonomous World) and gives the user some in-game coins.

We bridge some coins to Gnosis-Mainnet from Ethereum.

We deployed the contract to Gnosis-Mainnet, but we found a bug in the MUD's deployment script and the rpcs. Luckily when we tried again, the Autonomous World was deployed correctly.

After that, we added tailwind to the frontend and started to create a simple webpage.

We realized that we needed to display all the users' NFT to bring some usability to the site, so we created an account in NFTScan. We needed to secure that API key, so we created a simple backend to proxy the requests (the backend is in the /backend folder)

To test that everything was working fine, we needed to send the transaction to the Autonomous World using Metamask, we had some issues with the configuration between localnet and mainnet that was hardcoded by the Autonomous World template, but after some debugging, we were able to make it work.

The last step was to read the state of the Autonomous World and display that information to the user, we had some problems with the rpc configuration, but after proxying some requests using our server, we were able to see the correct information.

How to run it

You need to create 2 files:

  • backend/constants.ts and set the line export const api_key = with your NFTScan API key.
  • packages/client/src/mud/constants.ts and set your RPC keys: export const GNOSIS_MAIN_HTTP = "" export const GNOSIS_MAIN_WS = ""

World deployed to Gnosis-Mainnet

0x7fe5ed4d250c5a57c85471fd3addfe840c00988a

keoken's People

Contributors

hanchon avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.