Skip to content

Commit

Permalink
Gumdrop Merge (metaplex-foundation#946)
Browse files Browse the repository at this point in the history
* Initial commit

* Add basic merkle-distributor creation

* Create ATA for distributor and transfer tokens automatically

* Implement claim endpoint

* Read claim params from url query

* Fix tree generation for odd length layers

- potentially we could encode them as a special array of 32-null bytes
  too so that the indices of empty layers are also known...

* Some visual improvements and add buttons from main landing page

- spacing between elements and extra between button
- fix scrollview by using padding-top instead of margin-top on app

* Use file upload for tree specification

* Streamline creation workflow; add distribution list

* Notify user of airdrop transaction success

* Disable claim editing by default

- Values should be derived from URL params in almost all cases

* Add basic integration with mailchimp API

* Update homepage

* Try using hash router for gh pages

* Add deploy build to .gitignore

* Reorganize create and claim components and clean lint warnings

* Add nav buttons and about blurb

* Fix disabled button color (use palette)

* Use notify instead of alert and add more robust parsing on upload

* Add button to download all claim URLs after creation

* Wallet modal and button rounding

* Add short-circuit re-send if distribution last has claim URLs

- This just effectively wraps a loop around the distribution

* Improve centering for about page

- Depend on table centering of a fixed-sized div (large enough to hold
  the about information)
- This also affects create/claim and makes the resizing a bit awkward in
  case the window is smaller

* Add more uniform modal confirmation and airdrop creation preview

* Fix typo

* Claim page UX tweaks

- move editing field to top and enable editing by default if not all
  params (fields) are populated
- disable claim button while not all values are populated

* Add example distribution list following schema

* Fix about page button sizing

* Denormalize merkle distributor program id

* Add button to download base key for distributor

* Use existing ATA account create instruction

* Expose ability for creator to close distributor state

* Reorganize merkle tree files and update idl

* Add AWS SES distribution

* Coordinate with AWS lambda for OTP claim signature

* Add stepper and completion screen for claim

* Display loading icon while processing create / claim

* Tweak Create UI

- modal width change and button rearrangement
- remove "merkle' from main button

* Add AWS lambda source and point to new credentials

* Send OTP in email from lambda

* Don't log OTP in lambda

* Fix lambda handling and slightly better error messages

- Also don't clear transaction while verifying OTP. In case of typo
  allow the user to try again... Potentially need some retry delay
  on the server?

* Add mint to merkle tree data and remove need for distributor ATA

- step towards usage for NFTs
- just approve the distributor as a delegate for the creators token
  accounts by default

* Update description and tweak UI and colors

- show disabled airdrop creation button instead of hiding
- fix light mode color for uploaded file
- use normal info buttons

* Make app-bar opaque

- Scrolling on shorter screens looks funky if transparent

* Spike tie of merkle create with candy machine cranks

* Spike support for candy machine minting in claim

* Transfer candy machine authority to distributor for presale minting

* Expect distributor contract to transfer from wallet

- so that claimers are required to pay regardless of lamport balance in
  PDA wallet

* Pass candy machine authority transfer args on distributor close

* Reword about page for candy machine support

* Spike allowance of multiple cranks of candy machine

* Distributor must create claim_count account since its a PDA

* Use latched claimant after initial candy mint to avoid unnecessary OTP verification

* Display pin as a single number

* Fix reupload of same-named files and drag box dragging color

* Temporal signer workflow improvements

- allow default Pubkey temporal signer to skip check
- display to claimant whether temporal signing is necessary on first
  page (hide stepper if so)

* Fix temporal signer check and remove unnecessary claim succeeded display

- rely on the notification

* Rename to gumdrop

* Fix temporal signer check

* Fix OTP and more gumdrop renaming

* Add amount to NFT notification email

* Fix typo

* Allow claimant to sign directly if merkle tree was built with their public key

- through emails / off-chain handles we build a PDA so there should be
  no overlap

* More renaming

* Use API gateway endpoint instead of lambda credentials directly

- more kosher than just directly encoding keys...
- also include api gateway setup so hopefully it's less painful for
  later setups

* Implement edition claiming through gumdrop

- uses wrapper for metadata edition minting through master edition token
- expects claimants to be assigned specific editions. amount should
  always be 1 in the current schema and users can be given multiple
  editions by several entries

* Add some more creation safeties and show edition in preview

* Automatically download base key with creation preview approval

* More renaming to gumdrop

* Spike cli gumdrop creation

- Mostly moving sub-routines of gumdrop creation to separate functions /
  files

* Split transaction sending and remove some unused functions

- for re-use with cli
- prompted by some strangeness when working with some of the node
  modules (wallet-adapter) through cli...

* Support claim_edition in aws otp lambda

* Misc fixes for cli

- functionality was pretty much correct but some node module
  interactions weren't working
- claimInfo.candyMachine -> claimInfo.candyMachineKey
- write claims to a file also

* Add gumdrop close to cli

* Wait for claims to be fully built before logging

* Add more validation for taken editions

- read marker information from metadata accounts
- also expects the range to be [0, max_supply) though it seems like we
  can actually set max_supply...

* Clean up now-unused imports

* Add back transaction link log on failure

* Add cli wrapper to create sesv2 contact list

* Use sesv2 for email subscription and list management

* Add explicit notification after off-chain distribution succeeds

* Fix claimant pda finding for handles longer than 32 characters

- longest email is 254 characters which fits in 8 seed values (max seeds
  is 16)...

* Tweak wording in emails

* Simplify downloaded claim URLs shown to creator

* Explicitly hide pin field in case of direct wallet drops

* Change disabled text color more selectively

- was previously messing with disabled text field borders
- also disable input label when non-editable as well

* Log distribution responses and avoid reorder resend and validation

- validation should fail in case of resend for candy and edition at
  least since we no longer have the authority / token required. skip the
  check by resending first

* Edition zero is invalid

* Add discord as distribution method

- requires a bot and limited to users a bot can direct-message (i.e
  within a guild/server)

* Update yarn.lock

* Attempt to clean up env config slightly

- downgrade discord.js to before they switched to node 16... could not
  get babel to correctly transpile the lib down
- remove some paths and lower target so our source code could do it at
  least

* Discord bot doesn't work from browser

- move discord.js import into cli only to limit the scope of that lib
- get fucked

* Fix distribute response await

* Add on-chain program to git

* Point to about page in README

* Simplify page layout

- Don't bother with floating appbar and just have it be another div.
  This greatly simplifies centering of content below
- Also let appbar scroll when screen width is too small

* Update title and favicon

* Limit preview length for performance

* Change about twitter -> discord

* Add basic csv parsing for phone numbers

* Encode handle for URI when building claim link

* Spike CLI sms distribution

- doesn't work with existing credentials b/c various aws provisioning
  that needs to happen e.g origination numbers

* Add basic email parsing for csv files

* Update torus project id

* Be more explicit on assignment-as-conditional

* Fix some UI squishing on small displays

* Remove explicit widths in subcomponents

- step towards better mobile view. just control it in the parent

* More relative widths

- Modals don't seem to grow larger than screen size even when specified
  explicitly so leave at 70ch for now...

* Scale to window width below 60ch

- also slightly reduces spacing between nav header and body to
  compromise distance on smaller screens. not sure if a step-wise jump
  would be better

* Use Drawer when screen is too narrow

- currently switches at an arbitrary width but perhaps it can do
  something smarter...

* Stylize Drawer and add som alternative text

* Add missing react list keys

* Try BrowserRouter for oauth redirect urls

- fragments (hash and after) aren't passed back to the server so maybe
  we get smacked for that...
- wraps the Header in the BrowserRouter also so that we can use the
  packaged Link internally

* Add shortened address to narrow view

* Use torus redirect first by default

- works for mobile so for consistency I suppose...

* Store claim params in localStorage for use after redirect

- a hack until some state can be passed through that (torus)

* Add loading display for web close

* Fix sidebar link click area

* Fix cli default url

* Add OTP through discord DM

* Update otp check message

* Add aws lambda spec

- some environment variables are redacted

* Move gumdrop program to new vanity address

* Fix claim url extra params

* Expect transfer mint on gumdrop close for safety

- mostly so that we don't close a gumdrop holding a candy / edition
  authority accidentally... i suppose one could be recreated with the
  same base key but...

* Make gumdrop opt-in by default

- otherwise we get somewhat spurious bounces after the initial drop

* Add aws get-contact wrapper

* Fix null maxSupply compare

* Cleanup for metaplex merge

* Use common utilities and remove unused files

* Fix typescript complaints and imports

* Clean up rust deps

- point to metaplex-metadata
- remove saber-hq/vipers dep (used only for `assert_owner`)

* Fix package name and prep for independent gumdrop cli

* Split gumdrop cli into separate cli package

- now self-contained so it's a much simpler config setup and not a pita
  to get running
- some code is duplicated which is unfortunate but...

* Misc fixes

- fix bad copy-paste of candy-machine program-id
- remove unused dep now that cli is split
- fix typo

* Remove unused discord deps and remove gumdrop yarn.lock

* Fix gumdrop eslint

* Fix eslint in web actions

* Add AWS configuration README

* Fix gumdrop wallet-adapter-base for type checking

- something about fair-launch using [email protected] was causing issues

Co-authored-by: Lawrence <[email protected]>
  • Loading branch information
lwus and la-wu authored Nov 14, 2021
1 parent aa6a07c commit 133e7c5
Show file tree
Hide file tree
Showing 66 changed files with 14,798 additions and 139 deletions.
618 changes: 618 additions & 0 deletions js/packages/cli/src/gumdrop-cli.ts

Large diffs are not rendered by default.

6 changes: 6 additions & 0 deletions js/packages/cli/src/helpers/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,12 @@ export const TOKEN_ENTANGLEMENT_PROGRAM_ID = new PublicKey(
export const WRAPPED_SOL_MINT = new PublicKey(
'So11111111111111111111111111111111111111112',
);
export const GUMDROP_DISTRIBUTOR_ID = new PublicKey(
'gdrpGjVffourzkdDRrQmySw4aTHr8a3xmQzzxSwFD1a'
);
export const GUMDROP_TEMPORAL_SIGNER = new PublicKey(
'MSv9H2sMceAzccBganUXwGq3GXgqYAstmZAbFDZYbAV'
);

export const CONFIG_ARRAY_START =
32 + // authority
Expand Down
Loading

0 comments on commit 133e7c5

Please sign in to comment.