Skip to content

Commit

Permalink
[Updated] mini button
Browse files Browse the repository at this point in the history
  • Loading branch information
dev7tech committed May 22, 2024
0 parents commit cca89b6
Show file tree
Hide file tree
Showing 42 changed files with 25,072 additions and 0 deletions.
12 changes: 12 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Enter the Candy Machine Address below
NEXT_PUBLIC_CANDY_MACHINE_ID=
# Show box to choose how many NFTs to mint.
NEXT_PUBLIC_MULTIMINT=true
NEXT_PUBLIC_MAXMINTAMOUNT=15
# Is provided to you by the ui when initializing
NEXT_PUBLIC_LUT=
NEXT_PUBLIC_ENVIRONMENT=devnet
NEXT_PUBLIC_RPC=https://api.devnet.solana.com
NEXT_PUBLIC_BUYMARKBEER=true
#NEXT_PUBLIC_ENVIRONMENT=mainnet-beta
#NEXT_PUBLIC_RPC=https://solana-mainnet.rpc.extrnode.com
7 changes: 7 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"extends": "next",
"rules": {
"react/no-unescaped-entities": "off",
"@next/next/no-page-custom-font": "off"
}
}
65 changes: 65 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
name: Bug report
title: "[Bug]: "
description: Report incorrect or unexpected behavior
labels: [bug, needs tests]
body:
- type: markdown
attributes:
value: |
Use Discord for questions: https://discord.gg/metaplex
- type: textarea
id: description
attributes:
label: Issue description
description: |
Describe the issue in as much detail as possible.
Tip: You can attach images or log files by clicking this area to highlight it and then dragging files into it.
placeholder: |
Steps to reproduce with:
1. do thing
2. observe behavior
3. see error logs below
validations:
required: true
- type: textarea
id: logs
attributes:
label: Relevant log output
description: Please copy and paste any relevant log output. This will be automatically formatted into code, so no need for backticks.
render: shell
validations:
required: false
- type: input
id: os
attributes:
label: Operating system
description: Which OS are you using?
validations:
required: true
- type: input
id: browser
attributes:
label: Browser
description: Which browser are you using?
validations:
required: true
- type: dropdown
id: priority
attributes:
label: Priority this issue should have
description: Please be realistic. If you need to elaborate on your reasoning, please use the Issue description field above.
options:
- Low (slightly annoying)
- Medium (should be fixed soon)
- High (immediate attention needed)
validations:
required: true
- type: checkboxes
id: docs
attributes:
label: Check the Docs First
description: Make sure you check our docs first at https://docs.metaplex.com
options:
- label: I have checked the docs and it didn't solve my issue
required: true
8 changes: 8 additions & 0 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
blank_issues_enabled: false
contact_links:
- name: Metaplex Docs
url: https://docs.metaplex.com
about: Please check our docs if you haven't already
- name: Discord server
url: https://discord.gg/metaplex
about: Please visit our Discord server for questions and support requests.
30 changes: 30 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Feature request
description: Request a new feature
title: "[Feature]: "
labels: [enhancement]
body:
- type: textarea
id: description
attributes:
label: Feature
description: A clear and concise description of what the problem is, or what feature you want to be implemented.
placeholder: I'm always frustrated when..., A good addition would be...
validations:
required: true
- type: textarea
id: solution
attributes:
label: Ideal solution or implementation
description: A clear and concise description of what you want to happen.
validations:
required: true
- type: textarea
id: alternatives
attributes:
label: Alternative solutions or implementations
description: A clear and concise description of any alternative solutions or features you have considered.
- type: textarea
id: additional-context
attributes:
label: Other context
description: Any other context, screenshots, or file uploads that help us understand your feature request.
15 changes: 15 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
## NOTE
Its much easier for us to read and review a PR that is small, linted, and contains only one material enhancement. If your PR is very large and encompasing many features consider breaking it up in to a few PRs so we can digest the information in each pr with more accuracy.

## Description

_Describe the purpose of and changes within this Pull Request._

## References

_List links to any related tasks (GitHub Issues, Pull Requests, 3rd part task managers)_

## Testing

_How was this tested? If manually tested, list all steps necessary for the reviewer to confirm._

13 changes: 13 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
version: 2
updates:
- package-ecosystem: cargo
directory: "/"
schedule:
interval: daily
time: "04:00"
timezone: America/Los_Angeles
labels:
- "automerge"
open-pull-requests-limit: 3
ignore:
- dependency-name: "cbindgen"
20 changes: 20 additions & 0 deletions .github/workflows/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: 'Close stale issues and PRs'
on:
workflow_dispatch:
schedule:
- cron: '14 3 * * *'
jobs:
stale:
runs-on: ubuntu-latest
steps:
- uses: actions/stale@v4
with:
stale-issue-message: 'This Issue has received no activity for 30 days. We will close it in 2 days, please reopen if you are still experiencing this issue.'
stale-pr-message: 'This PR has received no activity for 30 days. We will close it in 2 days, please reopen if you would still like to get this change in.'
days-before-stale: 30
days-before-close: 3
exempt-pr-labels: 'wip,reviewing'
operations-per-run: 500
permissions:
issues: write
pull-requests: write
27 changes: 27 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Lint JavaScript

on:
workflow_dispatch:
push:
branches: [main]
pull_request:
branches: [main]

jobs:
eslint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1

- uses: actions/cache@v2
with:
path: "node_modules"
key: ${{ runner.os }}-modules-${{ hashFiles('yarn.lock') }}

- name: Install modules
run: yarn install
working-directory: .

- name: Run formatting/lint
run: yarn lint
working-directory: .
16 changes: 16 additions & 0 deletions .github/workflows/needs-information-issue.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: Remove needs more information
on:
issue_comment:
types: [created]
jobs:
issue_commented:
if: ${{ !github.event.issue.pull_request && github.event.issue.user.login == github.event.comment.user.login }}
runs-on: ubuntu-latest
steps:
- uses: andymckay/labeler@e6c4322d0397f3240f0e7e30a33b5c5df2d39e90
with:
remove-labels: "needs more information"
repo-token: ${{ secrets.GITHUB_TOKEN }}
permissions:
issues: write

26 changes: 26 additions & 0 deletions .github/workflows/yarn-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Yarn build

on:
push:
branches: [main]
pull_request:
branches: [main]

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1

- uses: actions/cache@v2
with:
path: 'node_modules'
key: ${{ runner.os }}-modules-${{ hashFiles('yarn.lock') }}

- name: Install modules
run: yarn install
working-directory: .

- name: Build all packages
run: yarn build
working-directory: .
38 changes: 38 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.

# dependencies
/node_modules
/.pnp
.pnp.js

# testing
/coverage

# next.js
/.next/
/out/

# production
/build

# misc
.DS_Store
*.pem

# debug
npm-debug.log*
yarn-debug.log*
yarn-error.log*
.pnpm-debug.log*

# local env files
.env*.local

# vercel
.vercel

# typescript
*.tsbuildinfo
next-env.d.ts

.env
89 changes: 89 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
[![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat-square)](https://makeapullrequest.com)

# Deploy your own Candy Machine easily
This repository is for Candy Machine V3, Account Version V2. (This is what you have when using the latest sugar version to create the candy machine)

Visible to the user:

- Mint Page:
![image](https://github.com/MarkSackerberg/umi-cmv3-ui-inofficial/assets/93528482/0ac70bda-5eee-4f6a-8035-ccf127fffc80)

- Successful mint confirmation:
![image](https://github.com/MarkSackerberg/umi-cmv3-ui-inofficial/assets/93528482/7e671345-914a-4d22-bf9f-763006a66560)

Visible to the admin:
![image](https://github.com/MarkSackerberg/umi-cmv3-ui-inofficial/assets/93528482/560f29bd-3d25-411a-b099-9609820ca223)

# What does this repo support?
You can use this repo to deploy your own candy machine UI.
- It supports multiple candy machine groups, but also just using a default group
- It creates a Lookup table for you to allow more active guards at the same time
- The initializer shows you the merkle root for your groups
- The users see NFTs left, start and end countdowns, reasons for not being able to mint and more
- Combining most of these guards is possible since we are lookup tables. For example using `allowlist`,`nftBurn`, `nftPayment`, `solPayment`, `startDate` and `endDate`
- For larger allowlists this UI will automatically split the mint into two transactions to avoid hitting the transaction size limit
- It supports most of the existing guards:
- `addressGate`
- `allocation`
- `allowlist`
- `endDate`
- `freezeSolPayment`
- `freezeTokenPayment`
- `mintLimit`
- `nftBurn`
- `nftGate`
- `nftPayment`
- `redeemedAmount`
- `solPayment`
- `startDate`
- `token2022Payment`
- `tokenBurn`
- `tokenGate`
- `tokenPayment`
- Multimint (can be deactivated by adding `NEXT_PUBLIC_MULTIMINT=false` to `.env`)
![image](https://github.com/MarkSackerberg/umi-cmv3-ui-inofficial/assets/93528482/0deada11-73c5-4b81-967d-6313b78739a5)

# How to use
## Prerequisites
- [pnpm](https://pnpm.io/installation) as package manager - I used 8.1.0
- [sugar](https://docs.metaplex.com/developer-tools/sugar/guides/sugar-for-cmv3) to create your candy machine

## How to use
1. Clone this repo
2. Run `pnpm install`
3. copy the `.env.example` file to a new `.env` file and fill in the NEXT_PUBLIC_CANDY_MACHINE_ID value. You should have this value after creating your candy machine with sugar.
3. Run `pnpm run dev`
4. Open your browser at `http://localhost:3000`
5. Connect your wallet which you used to create the candy machine
6. You should see a red `initialize` button. Click it and then click `create LUT`
7. Copy the LUT address that you see in the green success box and paste it into the `.env` file as the value for `NEXT_PUBLIC_LUT`
8. Add your candy machine groups to the `settings.tsx` file. E.g. if one of your groups is called `WL` you should have an entry for it in there, too
9. Deploy your Candy Machine e.g. to Vercel or Cloudflare Pages

Done!

### customization
You can customize the UI by changing the code. If you just want to modify some values you can instead
- modify `settings.tsx` to change the texts and Image.
- `image` is the main image that is shown. You could change it to your project logo.
- `headerText` is the website header. You could change it to your project name.
- Decide if you want to allow multiple mints by a single user at the same time and in your `.env` file set `NEXT_PUBLIC_MULTIMINT` accordingly to `true` or `false`. By default a maximum of 15 NFTs can be minted at the same time this is because of wallet limitations. If you want to have less change `NEXT_PUBLIC_MAXMINTAMOUNT` in `.env`.

### Fees
This ui has a buy me a beer feature. Each mint will transfer a very small amount (0.005) of SOL to a tip wallet. If you do not want to support me feel free to change the NEXT_PUBLIC_BUYMARKBEER variable to false. I would appreachiate it though if you leave it on. 🍻

# To do
- Add NFT Picker of `nftBurn` and `nftPayment` guards

# Contact / Support
If you need help with this repo, you can contact me. Also feel free to create an issue or a pull request.
- [Discord](https://discordapp.com/users/marksackerberg)
- [Twitter](https://twitter.com/MarkSackerberg)

If you want to work together on projects let me know!

# Disclaimer
This is not an official project by the Metaplex team. You can use that code at your own risk. I am not responsible for any losses that you might incur by using this code.

# Thank you!
Thanks to the metaplex team for creating NFTs on Solana, Candy Machine and Umi. Special Thanks to @lorisleiva for creating Umi and being so helpful. Also thanks to @tonyboylehub !
Loading

0 comments on commit cca89b6

Please sign in to comment.