Git Product home page Git Product logo

cryptopunks's Introduction

Cryptopunks Lending & Renting Protocol

With utmost respect,

reNFT-logo

Contributions

Our issues are split into 2 categories

  • ๐ŸŽจ denotes predominantly works pertaining to front-end spec below
  • ๐Ÿง  denotes predominantly works pertaining to protocol spec / subgraph

Issue format is the following

{emoji} - {if front: endpoint} - {description}

To contribute, create a branch with the id of the issue you are tackling. One PR per one issue only, please!

We are using tailwindcss for our front-end for 10x development. If you are working on a front-end task, have a look here to pick which components you need

https://tailwindui.com/components

Then, drop all the required components in the issue you are working in and I will share the HTML code snippet with you.

When submitting a PR, ensure all checks pass. Only PRs that are fully checked out can be merged.

Spec

Protocol Spec

We propose to construct the minSalePriceInWei argument in the offerPunkForSaleToAddress and offerPunkForSale in a particular way to be able to achieve the v0 Cryptopunk gifting feature. Find below the explanation

protocol-spec

  1. ff is to ensure noone can accept the bid. These two hex characters at the front ensure that the number we end up with is at least: 115339776388732929035197660848497720713218148788040405586178452820382218977280 that is how much someone would have to pay to accept the offer you can verify this here https://www.rapidtables.com/convert/number/hex-to-decimal.html by inputting 0xff00000000000000000000000000000000000000000000000000000000000000
  2. 8e is the checksum. This is to ensure that during the price transmission no data was lost in a message. Standard computer science trick https://en.wikipedia.org/wiki/Checksum#:~:text=A%20checksum%20is%20a%20small,upon%20to%20verify%20data%20authenticity.
  3. 00 is the protocol version. This will help people correctly parse the messages we send. It is conceivable that extension of the gifting protocol will require new data to be specified. Such as the rent price. This new data, will be packed into all or some of the remaining 54 hexbytes we have left. Therefore, developers will be able to say: "oh, this is version 00 so I know I have to parse it as per the spec here" this will be incremented +1 on each new version release, obviously
  4. 000e is the lease length. e in hexadecimal is 14, denoting days

Frontend Spec

  • Filtering in Cryptopunks

    • requires filters
    • view all cryptopunks gifted (superset of the below)
    • view cryptopunks gifted to me (subset of the above)
    • view cryptopunks I gifted (subset of all, by definition lol)
    • under each punk view extra info (current owner, current tenant, tenancy dates)
  • Click on a punk, modal window opens

    • requires subgraph
    • details on a punk
    • owner
    • tenant
    • tenancy dates
    • provenance history
    • if owner: lend the punk (created the offer to address or plain offer to as per protocol)
  • FAQ

    • section about how it works
    • section about responsibilities of the renter and the lender
  • Optional

    • little notes section for yourself, to remind you where you have used the cryptopunks this is useful for when the renting period ends to remind you where you need to take it off
    • email notification for when the due date is coming up
    • ability to view lender's address
    • filtering / sorting
    • highly useful. API to change all / some of your social avatars with the cryptopunk you have just rented out. Likewise, enable unsetting. (we can do this super easily with Next.js)
    • only owner can change details about the punk. When clicking on a punk, show the punk's provenance + owners' details. (plural)
  • Future

    • view cryptopunks available for rent
    • web3 call to og crypto punks. create bid. 4 1s. This will accept tenancy rights.

Services

  • subgraph
    • pull all cryptopunks currently gifted to someone
  • pull all cryptopunks (there is an image). There should be an API, too

Communications

  • renft cryptopunk leasing support channel?

Tech

Next.js

This is a Next.js project bootstrapped with create-next-app.

Getting Started

# Fork the repo on Github & clone it
git clone [email protected]:re-nft/cryptopunks.git
cd cryptopunks

# Install NPM modules
yarn

# Start the development server
yarn dev

Open http://localhost:3000 in your browser to see the website.

Deployment

Deployed on Vercel.

cryptopunks's People

Contributors

dependabot[bot] avatar eenagy avatar monte9 avatar nazariyv avatar sunguru98 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

cryptopunks's Issues

๐ŸŽจ - /cryptopunks - punk modal disappears

at a certain breakpoint, think it is 760 px the modal will just fly to the bottom of the page, it will appear as if it is gone. keep shrinking that bastard, now it is back where it needs to be. naughty

๐ŸŽจ - /cryptopunks - view all cryptopunks I gifted

Taken from the punks context. These are the punks that you own and gifted the tenancy rights to someone. Once again, on the front-end this is a filter option, and from context perspective this is a simple subgraph query that will be implemented by naz

๐Ÿง  - tenancyDates end can't be computed in the graph - Sprint #2

During the first sprint I have come across a prbolem whereby I could not compute the tenancy end date. This problem arises due to invalid parsing of Number.parseInt('0x000e', 16). For some, unknown reason, this returns null. Instead of the expected 14. I have tried this parsing in webassembly.studio and it works as expected there. The graph's runtime uses its own Number?

๐ŸŽจ - / - request a punk for rent

  1. Implement being able to see all of the punks.
  2. Request the punk for rent (any punk). This goes into the firebase db.
  3. A filter/tab to be able to see all of the requested punks.
  4. If you are an owner of the punk, being able to accept the request.
  5. Once accepted follow the new protocol version. Thus, this issue depends on the issue of implementing a new version of the protocol

๐ŸŽจ - /cryptopunks - add a filter to see all the cryptopunks **you** own

right now we are tracking:

  1. all punks ever gifted through our protocl
  2. punks gifted to me
  3. punks I gifted

But how would a user that has punks gift one of his own? He can't. There is no filter for all the punks that the user owns. This requires adding another query to our subgraph. Follow the patterns in the code. Look into the contexts folder. You will find a utils folder in there. Within it there is a queries.js file that shows two queries. Yours will look similar. Integrate the new query and fetched results into the front.

The end result is that we have another tab / filter that says "My punk". Here the punk owners will be able to gift their punks. You will find the graph endpoint in the code too.

๐ŸŽจ - /cryptopunks - impletement renting

This will require adding a bunch of input fields. Conditional logic. If you are an owner and there is no tenant right now (this requires you to see the punks that you have, so another query for that...)

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.