Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Web3 App #1603

Merged
merged 50 commits into from Feb 1, 2022
Merged

Web3 App #1603

merged 50 commits into from Feb 1, 2022

Conversation

edanfesi
Copy link
Contributor

written by @yuvd

What does this PR do?

Adds a new feature - Crypto Events. Users can now create events that require anyone wanting to book this type of event to own a token belonging to a certain smart contract. Whether the user owns a token or not is checked through Cal.

Example journey: as user A, I create a new event called "Bored Apes Trading Meeting". In the event's advanced options, I set the smart contract address belonging to the BAYC NFT collection. As user B, I'd like to trade some BAYC with user A. I go to to cal.com/usera. Before I can proceed to seeing availability, I will be presented with an option to verify my wallet through a "Verify wallet" button. After I click "Verify wallet", Cal.com will check whether I own any BAYC or not. If so, I am able to click on the event card and proceed as usual. If not, I will see an error.

To use this feature you must have Metamask installed, as the verification mechanism only supports Metamask at the moment.

Important!
This was written as just an MVP and is missing tons of security features and optimizations. This should only be used as a demo or a POC.

Type of change

  • New feature (non-breaking change which adds functionality)

How should this be tested?

  • In /[user], if I wanna book a crypto event, I can only click on the event's card and proceed further after I click "Verify wallet", and actually have a token belonging to the event's required SC on my currently selected wallet on Metamask
  • If I click on the "Verify wallet" button, and my currently selected wallet on Metamask has no token belonging to the event's required SC, I get an error
  • In the event type editing/creation page, a list of the most popular NFTs and ERC-20s is correctly fetched and set to tokensList (data only).

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code and corrected any misspellings
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes

yuvd and others added 16 commits January 12, 2022 16:59
* update schemas, functions & ui to allow creating and updating events with a smart contract property

* remove adding sc address in the dialog that first pops-up when creating a new event, since its an advanced option

* add sc to booking ui

* some more ts && error handling

* fetch erc20s and nfts list in event-type page

* some cleanup within time limit

* ts fix 1

* more ts fixes
Change comment from // to /** as @zomars suggested

Co-authored-by: Omar López <zomars@me.com>
@vercel
Copy link

vercel bot commented Jan 24, 2022

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://vercel.com/cal/calendso/Ffm5BAJkwsRRcrE6q3aatXVKFU9h
✅ Preview: https://calendso-git-web3withoutrename-cal.vercel.app

@edanfesi edanfesi changed the title Web3 without rename Web3 without credentials rename Jan 24, 2022
@vercel vercel bot temporarily deployed to Preview January 24, 2022 19:54 Inactive
@vercel vercel bot temporarily deployed to Preview January 25, 2022 13:00 Inactive
@PeerRich PeerRich changed the title Web3 without credentials rename Web3 App Jan 25, 2022
@PeerRich PeerRich mentioned this pull request Jan 25, 2022
11 tasks
@PeerRich PeerRich added this to the v.1.3 milestone Jan 25, 2022
@PeerRich PeerRich added the ✨ feature New feature or request label Jan 25, 2022
@vercel vercel bot temporarily deployed to Preview January 25, 2022 16:29 Inactive
@vercel vercel bot temporarily deployed to Preview January 25, 2022 18:30 Inactive
@vercel vercel bot temporarily deployed to Preview January 25, 2022 19:26 Inactive
@vercel vercel bot temporarily deployed to Preview January 25, 2022 20:08 Inactive
@vercel vercel bot temporarily deployed to Preview January 25, 2022 21:48 Inactive
Peer Richelsen added 2 commits February 1, 2022 18:05
@vercel vercel bot temporarily deployed to Preview February 1, 2022 18:09 Inactive
@vercel vercel bot temporarily deployed to Preview February 1, 2022 18:24 Inactive
@vercel vercel bot temporarily deployed to Preview February 1, 2022 20:04 Inactive
@vercel vercel bot temporarily deployed to Preview February 1, 2022 20:14 Inactive
@vercel vercel bot temporarily deployed to Preview February 1, 2022 20:37 Inactive
@vercel vercel bot temporarily deployed to Preview February 1, 2022 21:05 Inactive
@vercel vercel bot temporarily deployed to Preview February 1, 2022 21:18 Inactive
@vercel vercel bot temporarily deployed to Preview February 1, 2022 21:27 Inactive
Peer Richelsen added 2 commits February 1, 2022 21:28
@vercel vercel bot temporarily deployed to Preview February 1, 2022 21:32 Inactive
@vercel vercel bot temporarily deployed to Preview February 1, 2022 21:40 Inactive
@vercel vercel bot temporarily deployed to Preview February 1, 2022 21:46 Inactive
@PeerRich PeerRich merged commit 1d10874 into main Feb 1, 2022
@PeerRich PeerRich deleted the web3_without_rename branch February 1, 2022 21:48
buschco pushed a commit to buschco/calendso that referenced this pull request Mar 27, 2022
* Crypto events (calcom#1390)

* update schemas, functions & ui to allow creating and updating events with a smart contract property

* remove adding sc address in the dialog that first pops-up when creating a new event, since its an advanced option

* add sc to booking ui

* some more ts && error handling

* fetch erc20s and nfts list in event-type page

* some cleanup within time limit

* ts fix 1

* more ts fixes

* added web3 section to integrations

* added web3 wrapper, needs connection to user_settings db

* extract to api

* Update eventType.ts

* Update components/CryptoSection.tsx

Change comment from // to /** as @zomars suggested

Co-authored-by: Omar López <zomars@me.com>

* convert axios to fetch, change scAddress to smartContractAddress, load bloxy from next_public_env

* Fix branch conflict

* add enable/disable btn web3

* fixed away user causing duplicate entries

* Remove web3 validation

* renamed web3 button in integrations

* remove unused variable

* Add metadata column

* added loader and showToast to the web3 btn

* fix: remove smartContractAddress from info sended

* send to user events when the contract is missing

* use window.web3 instead of web3

* use NEXT_PUBLIC_WEB3_AUTH_MSG

* remove web3 auth from .env

* wip

* wip

* Add metamask not installed msg and success redirect

* add redirect when verified

* styled web3 button and added i18n to web3

* fixed redirect after verification

* wip

* wip

* moved crypto section to ee

Co-authored-by: Yuval Drori <53199044+yuvd@users.noreply.github.com>
Co-authored-by: Peer Richelsen <peeroke@richelsen.net>
Co-authored-by: Yuval Drori <yuvald29@protonmail.com>
Co-authored-by: Omar López <zomars@me.com>
Co-authored-by: Edward Fernandez <edward.fernandez@rappi.com>
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
Co-authored-by: Peer Richelsen <peeroke@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
✨ feature New feature or request ❗️ migrations contains migration files
Projects
No open projects
Archived in project
Development

Successfully merging this pull request may close these issues.

None yet

5 participants