This document explains how to add “LockupSettings” to a candy machine.

LockupSettings allows for specifying a time-based lockup after mint. It supports duration, locking the token for X seconds after it is minted, or expiration allowing for a set datetime for all tokens to be released.

This makes use of a different protocol called token-manager to handle the lockup and release. More info can be found here: https://github.com/cardinal-labs/cardinal-token-manager.

There are a few use cases for this:

  1. Collections that do NOT want their collection being listed on marketplaces before the mint is over.
  2. Long term lockups forcing projects to deliver on their promises before collecting royalties and have the project actually produce value for holders before they sell.
  3. Having pre-sale and public-sale be released at the same time. This allows for public and WL minters to get equal chance at listing.

PR to Metaplex: https://github.com/metaplex-foundation/metaplex-program-library/pull/511/files

Deployed Candy Machine: https://explorer.solana.com/address/ccmpgw68x3NJmNPePFrTm6TsKCEYUVhF8rEAVL9rSDd

JS Package for using Freeze Authority CM: @cardinal/mpl-candy-machine-utils

https://www.npmjs.com/package/@cardinal/mpl-candy-machine-utils

Example code snippets and scripts

https://github.com/cardinal-labs/mpl-candy-machine-utils

Implementing Freeze Authority CM:

High level steps

  1. Create candy machine pointed to the new address — this is compatible with existing candy machine tooling just a new program address
  2. Set lockup settings using the new “setLockupSettings” instruction
  3. Add remaining accounts required during minting

Creating candy machine

The candy machine can be created in the same exact way but the programId should be as specified above.

https://github.com/cardinal-labs/mpl-candy-machine-utils/blob/main/create-candy-machine-with-lockup-settings.ts

Script for adding lockup settings