Skip to content

Conversation

grod220
Copy link
Member

@grod220 grod220 commented Jul 24, 2025

This change refactors the CreateMint instruction processor to accept a generic MintCustomizer trait. This allows developers to more easily fork the program and implement custom logic for creating the wrapped mint (specific extensions, freeze auth choice, etc).

/// `MintCustomizer` trait definition
pub mod interface;
/// No extensions version of the mint
pub mod no_extensions;
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Upcoming PRs will add additional mint customizers here

@grod220 grod220 force-pushed the mint-customizer-trait branch 2 times, most recently from e23bd28 to e9adc74 Compare July 24, 2025 17:21
@grod220 grod220 force-pushed the mint-customizer-trait branch from e9adc74 to c5a04d5 Compare July 24, 2025 17:23
@grod220 grod220 requested review from joncinque and buffalojoec July 24, 2025 17:49
Copy link
Contributor

@joncinque joncinque left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense to me!

} else {
vec![]
};
let space = ExtensionType::try_calculate_account_len::<Mint>(&extensions)?;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This works for now, but it'll need some extra logic for metadata in the future, since metadata has a variable length

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah! Instead of requesting a list of extensions, I'll swap the interface to return space instead 👍

Copy link

@buffalojoec buffalojoec left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Based

@grod220 grod220 merged commit 0c2795a into main Jul 25, 2025
10 checks passed
@grod220 grod220 deleted the mint-customizer-trait branch July 25, 2025 09:53
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

Successfully merging this pull request may close these issues.

3 participants