art la flame
    • Create new note
    • Create a note from template
      • Sharing URL Link copied
      • /edit
      • View mode
        • Edit mode
        • View mode
        • Book mode
        • Slide mode
        Edit mode View mode Book mode Slide mode
      • Customize slides
      • Note Permission
      • Read
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Write
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Engagement control Commenting, Suggest edit, Emoji Reply
      • Invitee
    • Publish Note

      Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

      Your note will be visible on your profile and discoverable by anyone.
      Your note is now live.
      This note is visible on your profile and discoverable online.
      Everyone on the web can find and read all notes of this public team.
      See published notes
      Unpublish note
      Please check the box to agree to the Community Guidelines.
      View profile
    • Commenting
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
      • Everyone
    • Suggest edit
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
    • Emoji Reply
    • Enable
    • Versions and GitHub Sync
    • Note settings
    • Engagement control
    • Transfer ownership
    • Delete this note
    • Save as template
    • Insert from template
    • Import from
      • Dropbox
      • Google Drive
      • Gist
      • Clipboard
    • Export to
      • Dropbox
      • Google Drive
      • Gist
    • Download
      • Markdown
      • HTML
      • Raw HTML
Menu Note settings Sharing URL Create Help
Create Create new note Create a note from template
Menu
Options
Versions and GitHub Sync Engagement control Transfer ownership Delete this note
Import from
Dropbox Google Drive Gist Clipboard
Export to
Dropbox Google Drive Gist
Download
Markdown HTML Raw HTML
Back
Sharing URL Link copied
/edit
View mode
  • Edit mode
  • View mode
  • Book mode
  • Slide mode
Edit mode View mode Book mode Slide mode
Customize slides
Note Permission
Read
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Write
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Engagement control Commenting, Suggest edit, Emoji Reply
Invitee
Publish Note

Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

Your note will be visible on your profile and discoverable by anyone.
Your note is now live.
This note is visible on your profile and discoverable online.
Everyone on the web can find and read all notes of this public team.
See published notes
Unpublish note
Please check the box to agree to the Community Guidelines.
View profile
Engagement control
Commenting
Permission
Disabled Forbidden Owners Signed-in users Everyone
Enable
Permission
  • Forbidden
  • Owners
  • Signed-in users
  • Everyone
Suggest edit
Permission
Disabled Forbidden Owners Signed-in users Everyone
Enable
Permission
  • Forbidden
  • Owners
  • Signed-in users
Emoji Reply
Enable
Import from Dropbox Google Drive Gist Clipboard
   owned this note    owned this note      
Published Linked with GitHub
3
Subscribed
  • Any changes
    Be notified of any changes
  • Mention me
    Be notified of mention me
  • Unsubscribe
Subscribe
NOTE: FAIR LAUNCH PROTOCOL HAS BEEN OFFICIALLY DEPRECATED OF DEVELOPMENT BY JORDAN. https://twitter.com/redacted_j/status/1471504082162442250 ALL OF THE BENEFITS AND CONCERNS GAINED FROM FAIR LAUNCH CAN BE REAPED FROM CANDY MACHINE V2, OF WHICH A GUIDE HAS BEEN WRITTEN HERE: https://hackmd.io/@MarkSackerberg/candyV2 However, I will leave this page up for those who still might be utilizing fair launch for a different reason. # Fair-Launch Protocol Firstly, huge shoutout to https://twitter.com/redacted_j and https://twitter.com/baalazamon for their amazing work so far in the community. They are enabling a very fast adoption rate with Solana, and should be treated with the greatest respect. Note: This tutorial is up to date with the latest tutorial from https://twitter.com/redacted_j 's office hours. Also Note: Fair Launch Protocol is still in testing. Be cautious. This is a tutorial on how to use Fair Launch Protocol integrated with Candy machine. This tutorial assumes you already have some working knowledge of how to use candy machine. If not, I find these to be the best resources to date: https://threadreaderapp.com/thread/1433816437525659658.html https://hackmd.io/@levicook/HJcDneEWF#Metaplex-Candy-Machine It's also useful to have an intuition for how Fair Launch Protocol works, best resource is this: https://scapesnft.medium.com/fair-launch-protocol-guide-72dc9609461e ### Prerequisites: Solana Tool-Suite: https://docs.solana.com/cli/install-solana-cli-tools Node: https://nodejs.org/ Yarn: https://yarnpkg.com/getting-started/install Github CLI: https://cli.github.com/manual/installation Working Knowledge of Candy Machine, Solana CLI and how Fair Launch Protocol works on a high level. ### Let's get started: Fork the latest metaplex repo & install dependencies. Github CLI: ```$ gh repo fork https://github.com/metaplex-foundation/metaplex --clone=true``` or you could fork manually on github here: https://github.com/metaplex-foundation/metaplex ![](https://i.imgur.com/iKymGS3.png) then run ```$ git clone https://github.com/username/metaplex``` --- We're going to cd into the js directory using ```$ cd metaplex/js/``` then run ```$ yarn``` This will install all dependencies. Now we will cd into the the cli directory using ```$ cd metaplex/js/packages/cli``` then run ```$ yarn watch``` Jordan highly recommends this approach over others. Enables you to run commands against the javascript. ### Create Fair Launch Protocol Flow --- High level explanation of the next steps: So if you understand how FLP works in this specific use case, we want Candy Machine only to accept as payment tokens (lottery tickets) that are given to users who won from the fair launch. But because candy machine needs to have the specific token mint address in its creation (defaults to SOL if none is specified), we will create the fair launch first, which will give us a token mint, then use the given token mint to set up candy machine, at which point they are connected. If this doesn't make sense, it will as you run through the tutorial. Let's create a new fair launch by first looking at its arguments. These can be viewed by opening:```fair-launch-cli.ts``` This is a glossary of options and what they mean, you may skip past if you want to copy & paste the exact command. We start every command with the prefix: `node build/fair-launch-cli.js` **-e, --env <string>** - Solana cluster env name, default is devnet, other options include mainnet-beta, testnet, & devnet **-k, --keypair <path>** - solana wallet location, I usually just go with /.config/solana/id.json **-u, --uuid <string>** - uuid of the fair launch. A 6 character alpha-numeric string that should be unique relative to your keypair. Your keypair can host multiple fair launches, therefore, each fair launch needs its own unique UUID. **-f, --fee <string>** - fee that each person needs to pay inorder to interact with your fair launch. In terms of SOL (0.001, .1, etc) **-s, --price-range-start <string>** - price range start, so in the fair launch, you can have a minimum bid and a maximum bid. We set the minimum here. **-pe, --price-range-end <string>** - price range end, we set the maximum bid here. **-arbp, --anti-rug-reserve-bp <string>** - optional anti-rug treasury reserve in units of basis points (1-10000). Essentially, if you as the product maker don't deliver, this is exactly how much as a % collectors will get back in refund. (eg 5000 = 50%, half of the treasury is refunded equally to everyone). This is very important for community building, as take into account a scenario where the price of Solana falls as well. Collectors could take losses of more than 50% since this is based on amount of sol pledged, not cash value at time of pledging. Do not set this value to 100% if you are doing something similar to a fundraise, as you need an access to some amount of the funds in order to build your product. **-atc, --anti-rug-token-requirement <string>** - optional anti-rug token requirement when reserve opens - 100 means 100 tokens remaining out of total supply. A way to program an obligation. In the case of a 10,000 NFT supply, if this option value was set to 1000, then that means in order for you to fully collect funds, there would need to be 1000 or less supply of the fair launch token mint, or said another way "You'd need to convince 9000 people to exchange their tokens into candy machine for your product in order to recieve all your funds." **Take into account that all of these can be seen publicly, so how you decide on these can affect sentiment about your project.** **-sd, --self-destruct-date <string>** - optional date when funds from anti-rug setting will be returned - eg "04 Dec 1995 00:12:00 GMT"', essentially the deadline for the you as the product maker to deliver, pass this deadline & people are **given the option** to refund, against your will. **-pos, --phase-one-start-date <string>** - phase one (bidding) start date. entered as a timestamp. eg "04 Dec 1995 00:12:00 GMT", **-poe, --phase-one-end-date <string>** - phase one end date, entered as a timestamp. eg "04 Dec 1995 00:12:00 GMT", **-pte, --phase-two-end-date <string>** - phase two (accept or reject price) end date. There is no start date argument because phase two automatically starts when phase one ends. Entered as a timestamp as well. eg "04 Dec 1995 00:12:00 GMT" **-ld, --lottery-duration <string>** - max duration of lottery, in units of seconds. If this passes, any person can permissionlessly call the `restart_phase_2` command from the cli which will bring the entire fair launch back to beginning of phase 2 for everyone to leave if they no longer trust the project. **-ts, --tick-size <string>** - tick size, so in the UI of the fair launch exists a slider, in which users can utilize to set bids. This essentially sets the increment value (eg, .1 means you can only increment in values of .1 so 1.2, 1.3,..., 2.2, 2.3,etc) **-n, --number-of-tokens <number>** - number of tokens (lottery tickets) to sell, in most cases, you'd want this to match the intended supply for use in candy machine. **-mint, --treasury-mint <string>** - token mint to take as payment instead of sol. If you want to enable only the users who own a custom SPL token to utilize this fair launch, you may set that here. `UI currently only works with SOL.` An example of a command to create a fair launch would look like this: `$ node build/fair-launch-cli.js new_fair_launch -e devnet -k ~/.config/solana/id.json -u test01 -f 0.1 -s 0.1 -pe 2 -pos "2021 Sep 22 12:30:00 CDT" -poe "2021 Sep 22 12:35:00 CDT" -pte "2021 Sep 22 12:45:00 CDT" -ts 0.1 -n 2 -arbp 5000 -atc 1 -sd "25 Sep 2021 09:00:00 GMT"` *This will give you a FairLaunchID, record it somewhere for use later.* Here, I recommend you create a notepad to store some of these variables, as you will need them for future commands and they can get lost in the shuffle. ##### We need to get our fair launch token mint by running: `$ node build/fair-launch-cli.js show -e devnet -k ~/.config/solana/id.json -f <fair-launch-id-here>` Note: Anyone (ANYONE) who knows the Fair Launch ID can execute this command. This was intentional, as it enables decentralization by allowing anyone to access the terms and conditions of your fair launch. ##### After running that command, you should get something like this in the output: `Token Mint <token mint address>` We will also need this for later, so record it. Create and Connect Candy Machine --- ##### We are now going to use this token mint to create a candy machine that only accepts this token as payment! (Isn't that so sick!?) First, ensure you've built a candy machine: `$ node build/candy-machine-cli.js upload -e devnet -k ~/.config/solana/id.json ~/directorywithimages` Second, we need to take a couple of steps to grab the value for a parameter in our next command called spl-token-account. It's a little tedious now, but expect it to be automated/ made easier in the future. #### For now the flow goes like this: 1. Log in to Phantom and ensure it's on devnet. 2. Click Manage Token List 3. Click on the plus sign to create a token account. 4. Grab your FLP Token Mint from earlier, and paste it inside mint address box. Enter any name & symbol, then click add. `Note that in order to have your token account show up, you must activate it by clicking the switch. However, it will be all the way at the bottom of the list so you may need to scroll.` 5. Go to [explorer.solana.com (Make sure its on devnet)](https://explorer.solana.com/?cluster=devnet) 6. Paste FLP Token Mint address into search bar. 7. Scroll down, find "distribution", click on it. 8. There should be an address there with rank #1 for the token, copy that account address & record it. We'll now create the candy machine. I assume you automatically know what most of these parameters mean, such as -e, -k, -p, and --date. So adjust as needed. `$ node build/candy-machine-cli.js create_candy_machine -e devnet -k ~/.config/solana/id.json -p 1 --spl-token <fair launch token mint here> --spl-token-account <token account from last step here> ` then `$ node build/candy-machine-cli.js update_candy_machine -e devnet -k ~/.config/solana/id.json --date "22 Sep 2021 17:30:00 CDT"` You can actually set the date for later if you are not ready to utilize candy machine and mint out your product. How this further affects Fair Launch is explained later. After running the command, we should finally recieve our Candy Machine ID. Record this somewhere as well. --- Open `metaplex/js/packages/fair-launch/.env` And enter the values into ther respective fields, ensure that the network & RPC host are what you have intended, in this case, devnet. REACT_APP_CANDY_MACHINE_ID= REACT_APP_SOLANA_NETWORK=devnet REACT_APP_SOLANA_RPC_HOST=https://api.devnet.solana.com \# Phase 1 REACT_APP_FAIR_LAUNCH_ID= save and exit file. Then: `$ cd js/packages/fair-launch` `$ yarn start` And Boom! We have successfully created a fair launch, but wait, there's more steps. We need to manually start the lottery process after phase two has ended. Before we run the lottery command that selects who has won a ticket, we need to run this: `$ node build/fair-launch-cli.js create_missing_sequences -e devnet -k ~/.config/solana/id.json -f <fair launch id here>` "This essentially makes sure there is a reverse look up for each ticket in existence so that the lottery can iterate from index 0 to the total number of tickets without knowing who owns each ticket."" ~ Jordan. Now to initiate the lottery: `$ node build/fair-launch-cli.js create_fair_launch_lottery -e devnet -k ~/.config/solana/id.json -f <fair launch id here>` If everything runs smoothly... ![](https://i.imgur.com/h0mMa6E.png) Note: Anyone with the fair launch ID can run this command as well to see how the lottery worked out. `$ node build/fair-launch-cli.js show_lottery -e devnet -k ~/.config/solana/id.json -f <fair-launch-id-here>` Now to start phase three and enable minting, we run: `$ node build/fair-launch-cli.js start_phase_three -e devnet -k ~/.config/solana/id.json -f <fair-launch-id-here>` You know it worked if you got the message: ![](https://i.imgur.com/KDnW5Wo.png) If your candy machine was set to start as soon as you started phase 3, then users would be able to immediately mint. If you set it to be much later, the option that would be there would be "Punch Ticket." Which would "mint" the ticket to them, enabling them to hold it in their wallets for later. --- Administration Commands: --- These are commands that the owner of the fair launch would likely find useful. `$ node build/fair-launch-cli.js punch_and_refund_all_outstanding -e devnet -k ~/.config/solana/id.json -f <fair-launch-id-here>` This automatically allows you to refund everyone who lost and give tickets to everyone who won without them ever having to interact with your UI. Clean UX if you ask me. This prevents people from forgetting to claim their refunds. `$ node build/fair-launch-cli.js withdraw_funds -e devnet -k ~/.config/solana/id.json -f <fair-launch-id-here>` This would enable you to withdraw all your funds. However, note that you cannot run this command until everyone has punched or been refunded, so it's a good idea to run the command above this first. That is the entire flow of setting up and utilzing a fair launch protocol. It's not actually too much, and once you get the hang of it it becomes very easy. End --- This post will be consistently updated as more information and more changes become available. This is still in testing, so errors may occur. If that's the case, head to the @metaplex discord for assistance. discord.com/invite/metaplex Thank you for reading my first blog post, feedback is appreciated! gn. \- Arte Twitter: https://twitter.com/artelaflame Bulls & Bears NFT: https://twitter.com/bullsbearsNFT Bonus: Setting the Token Metadata of the Ticket --- A really cool feature that was added is the ability to add metadata to your ticket so it looks like an NFT. (Imagine a golden ticket from polar express in your wallet) An example command looks like this: `node build/fair-launch-cli.js set_token_metadata -e mainnet-beta -k ~/.config/solana/id.json -f 7fP1DM1UK3xBgzXxQVwA3fFA4PPENaQ6YghJvFLeXFMz --name "Thanks For Testing" --symbol ALPHA1 --uri https://arweave.net/DJp9PoXrUfV60I-YjSo29zY4GD84eRi2EhMe8PMHoU8 -sfbp 500 -c 44kiGWWsSgdqPMvmqYgTS78Mx2BKCWzduATkfY4biU97,50,false,CduMjFZLBeg3A9wMP3hQCoU1RQzzCpgSvQNXfCi1GCSB,50,false` #### Let's break this down real quick: **-e, --env <string>** - Solana cluster network name, can be devnet, mainnet-beta, or testnet **-k, --keypair <path>** - Solana wallet location, mine is usually set to ~/.config/solana/id.json **-f, --fair-launch <string>** - fair launch id **-n, --name <string>** - token name **-s, --symbol <string>** - token symbol **-u, --uri <string>** - uri, note that this should be a uri that links to a json. **-sfbp, --seller-fee-basis-points <string>** - seller fee basis points, ranges (1 - 10000) **-c, --creators <string>** - comma separated creator wallets like wallet1,73,true,wallet2,27,false where it flows wallet, share, verified true/false. **-nm, --is_not_mutable** - set as immutable, meaning it cannot be changed ever again. Use cautiously, think about if its really necessary. A lot of artists have had issues because they marked the NFT as immutable, unable to make changes to the metadata when there were bugs/mistakes. (Ex. Sol Bears) And there you have it!

Import from clipboard

Paste your markdown or webpage here...

Advanced permission required

Your current role can only read. Ask the system administrator to acquire write and comment permission.

This team is disabled

Sorry, this team is disabled. You can't edit this note.

This note is locked

Sorry, only owner can edit this note.

Reach the limit

Sorry, you've reached the max length this note can be.
Please reduce the content or divide it to more notes, thank you!

Import from Gist

Import from Snippet

or

Export to Snippet

Are you sure?

Do you really want to delete this note?
All users will lose their connection.

Create a note from template

Create a note from template

Oops...
This template has been removed or transferred.
Upgrade
All
  • All
  • Team
No template.

Create a template

Upgrade

Delete template

Do you really want to delete this template?
Turn this template into a regular note and keep its content, versions, and comments.

This page need refresh

You have an incompatible client version.
Refresh to update.
New version available!
See releases notes here
Refresh to enjoy new features.
Your user state has changed.
Refresh to load new user state.

Sign in

Forgot password

or

By clicking below, you agree to our terms of service.

Sign in via Facebook Sign in via Twitter Sign in via GitHub Sign in via Dropbox Sign in with Wallet
Wallet ( )
Connect another wallet

New to HackMD? Sign up

Help

  • English
  • 中文
  • Français
  • Deutsch
  • 日本語
  • Español
  • Català
  • Ελληνικά
  • Português
  • italiano
  • Türkçe
  • Русский
  • Nederlands
  • hrvatski jezik
  • język polski
  • Українська
  • हिन्दी
  • svenska
  • Esperanto
  • dansk

Documents

Help & Tutorial

How to use Book mode

Slide Example

API Docs

Edit in VSCode

Install browser extension

Contacts

Feedback

Discord

Send us email

Resources

Releases

Pricing

Blog

Policy

Terms

Privacy

Cheatsheet

Syntax Example Reference
# Header Header 基本排版
- Unordered List
  • Unordered List
1. Ordered List
  1. Ordered List
- [ ] Todo List
  • Todo List
> Blockquote
Blockquote
**Bold font** Bold font
*Italics font* Italics font
~~Strikethrough~~ Strikethrough
19^th^ 19th
H~2~O H2O
++Inserted text++ Inserted text
==Marked text== Marked text
[link text](https:// "title") Link
![image alt](https:// "title") Image
`Code` Code 在筆記中貼入程式碼
```javascript
var i = 0;
```
var i = 0;
:smile: :smile: Emoji list
{%youtube youtube_id %} Externals
$L^aT_eX$ LaTeX
:::info
This is a alert area.
:::

This is a alert area.

Versions and GitHub Sync
Get Full History Access

  • Edit version name
  • Delete

revision author avatar     named on  

More Less

Note content is identical to the latest version.
Compare
    Choose a version
    No search result
    Version not found
Sign in to link this note to GitHub
Learn more
This note is not linked with GitHub
 

Feedback

Submission failed, please try again

Thanks for your support.

On a scale of 0-10, how likely is it that you would recommend HackMD to your friends, family or business associates?

Please give us some advice and help us improve HackMD.

 

Thanks for your feedback

Remove version name

Do you want to remove this version name and description?

Transfer ownership

Transfer to
    Warning: is a public team. If you transfer note to this team, everyone on the web can find and read this note.

      Link with GitHub

      Please authorize HackMD on GitHub
      • Please sign in to GitHub and install the HackMD app on your GitHub repo.
      • HackMD links with GitHub through a GitHub App. You can choose which repo to install our App.
      Learn more  Sign in to GitHub

      Push the note to GitHub Push to GitHub Pull a file from GitHub

        Authorize again
       

      Choose which file to push to

      Select repo
      Refresh Authorize more repos
      Select branch
      Select file
      Select branch
      Choose version(s) to push
      • Save a new version and push
      • Choose from existing versions
      Include title and tags
      Available push count

      Pull from GitHub

       
      File from GitHub
      File from HackMD

      GitHub Link Settings

      File linked

      Linked by
      File path
      Last synced branch
      Available push count

      Danger Zone

      Unlink
      You will no longer receive notification when GitHub file changes after unlink.

      Syncing

      Push failed

      Push successfully