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

Fixes for nft example launchpad.move #277

Merged
merged 1 commit into from
Feb 24, 2025

Conversation

arjanjohan
Copy link
Contributor

This PR solves 2 issues in the launchpad.move example.

Mint stage index from token-minter module

When using this example template, we ran into an issue with the mint stages from token-minter.
minter::execute_earliest_stage loops over the mint stages, and removes any inactive indexes from the mint_stages vector, until it finds and active stage and then returns that index. Since the inactive indexes have been removed, the returned index does not match the active mint stage. The active mint stage will always have index 0, since all earlier indexes have been removed for being inactive.

The launchpad.move module uses returned value from execute_earliest_stage as input for index when calling minter::find_mint_stage_by_index. It should just use 0 as input for index, as that is now the index for the active mint stage.

Check on collection_uri

Also there is no check on collection_uri when creating a collection. This can cause problems later in construct_nft_metadata_uri, where /collection.json is replaced by {next_nft_id}.json. I added a check in create_collection to ensure the collection_uri ends with .json.

@0xaptosj
Copy link
Contributor

taking a look now

@0xaptosj
Copy link
Contributor

0xaptosj commented Feb 24, 2025

@arjanjohan thanks for the fix! do you have twitter? would love to give you a shout-out and buy you a coffee (send you some USDT hehe

@0xaptosj 0xaptosj merged commit b87fbc7 into aptos-labs:main Feb 24, 2025
1 of 8 checks passed
@0xaptosj 0xaptosj mentioned this pull request Feb 24, 2025
@arjanjohan
Copy link
Contributor Author

@arjanjohan thanks for the fix! do you have twitter? would love to give you a shout-out and buy you a coffee (send you some USDT hehe
yes im arjanjohan on twitter as well. thanks!

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.

2 participants