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

Allocation guard is not registered in the SDK #506

Open
sohrab- opened this issue May 5, 2023 · 3 comments
Open

Allocation guard is not registered in the SDK #506

sohrab- opened this issue May 5, 2023 · 3 comments

Comments

@sohrab-
Copy link

sohrab- commented May 5, 2023

There is a 20th guard, called allocation, in the on-chain program but it is not registered in the SDK.

Let's say I add a 21st custom guard, below allocation, to the on-chain program and register it with the SDK, when trying to create the Candy Machine, the SDK seems to serialise the settings for this new custom guard into the allocation guard settings, i.e. off-by-one.

  • Should allocation be registered by default?
  • Is there a workaround with the SDK that let us proceed without registering allocation?
    • Create a guard manifest for allocation and register it myself?
    • Can I somehow fudge the feature flag list so I don't have to register allocation?
@sohrab-
Copy link
Author

sohrab- commented May 5, 2023

Here is the manifest if anyone needs the work-around:

import {
  CandyGuardManifest,
  createSerializerFromBeet,
} from "@metaplex-foundation/js";
import {
  Allocation,
  allocationBeet,
} from "@metaplex-foundation/mpl-candy-guard";

export const allocationGuardManifest: CandyGuardManifest<Allocation> = {
  name: "allocation",
  settingsBytes: 5,
  settingsSerializer: createSerializerFromBeet(allocationBeet),
};

Btw this ☝️ is not enough if you are planning to use the allocation guard. That's just enough to skip it to get to our custom guards

@lorisleiva
Copy link
Contributor

Hi there, thanks for that. Would you be able to PR this into the SDK?

@sohrab-
Copy link
Author

sohrab- commented May 7, 2023

Lemme see if I can understand what it does. The manifest is easy enough but need to know what it does to write the proper unit tests 😅

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants