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

Ryder Mint V2 on Stacks #16

Merged
merged 12 commits into from
Jan 9, 2023
Merged

Ryder Mint V2 on Stacks #16

merged 12 commits into from
Jan 9, 2023

Conversation

MarvinJanssen
Copy link
Member

@MarvinJanssen MarvinJanssen commented Dec 16, 2022

You can try it in the console:

  1. Add the new contract to Ryder NFT as a minter.
  2. Enable it by calling set-mint-enabled.
  3. Mint some to the new contract by calling mint-to-contract. The buffer length defines how many to mint.
  4. Call buy to buy some.
  5. Advance the chain by a few blocks.
  6. Call claim to receive bought NFTs in random order.

Copy link
Contributor

@friedger friedger left a comment

Choose a reason for hiding this comment

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

Looks good.
Needs more testing.

backend-stacks/contracts/ryder-buy.clar Outdated Show resolved Hide resolved
backend-stacks/contracts/ryder-buy.clar Outdated Show resolved Hide resolved
backend-stacks/contracts/ryder-buy.clar Outdated Show resolved Hide resolved
@MarvinJanssen
Copy link
Member Author

@friedger per discussion, ryder-mint-v2 now follows a two-stage mechanism:

  1. Call buy with the amount of NFTs you want to buy. It locks in a block-height + const block-height to claim the NFTs. The function transfers STX and reserves that number of tokens for the buyer.
  2. Call claim at the previous block-height + const height to transfer NFTs from the contract to the buyer. Anyone can call claim for any buyer and block height.

@friedger
Copy link
Contributor

friedger commented Jan 2, 2023

claim-two, -five, -ten should be replaced with claim-many, because we have buy with an arbitrary number.

@MarvinJanssen
Copy link
Member Author

claim-two, -five, -ten should be replaced with claim-many, because we have buy with an arbitrary number.

How would you implement it given the claim logic?

@MarvinJanssen MarvinJanssen linked an issue Jan 3, 2023 that may be closed by this pull request
@MarvinJanssen MarvinJanssen requested a review from friedger January 6, 2023 23:29
@MarvinJanssen MarvinJanssen merged commit ee32e31 into dev Jan 9, 2023
MarvinJanssen added a commit that referenced this pull request Jan 9, 2023
* first concept

* return claimed token IDs from claim functions

* ryder-buy concept

* chore: change function names

* feat: ryder-mint-v2 now has a buy and claim mechanism

* fix: only admin can claim for others to prevent gaming

* fix: use correct payment recipient

* chore: add test for claim v2

* chore: replace claim-n with claim-many

* chore: delete ryder-buy

* chore: fix ryder-mint-v2 tests

* chore: use better error names

Co-authored-by: friedger <[email protected]>

Co-authored-by: friedger <[email protected]>
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.

New reveal mechanism
2 participants