-
Notifications
You must be signed in to change notification settings - Fork 38
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
Burn to Mint #585
Burn to Mint #585
Conversation
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## main #585 +/- ##
==========================================
+ Coverage 59.20% 63.04% +3.83%
==========================================
Files 80 84 +4
Lines 4246 4662 +416
==========================================
+ Hits 2514 2939 +425
+ Misses 1732 1723 -9
☔ View full report in Codecov by Sentry. |
Is this PR ready to review? |
Cosm-Orc Gas Usage
Raw Report for 5d2c5b8
|
The creators will probably want to select which collection(s) the token(s) should be burned from in order for a token to be minted from their collection. I think we need to update the Also not sure if we should update |
Using this functionality with the 1/1 collections (base factory/minter) may not be ideal because the tokens are minted to the collection owner's wallet anyway. The current mint price is 5 STARS/token. Not sure if there is a use case for that. |
As discussed in Discord, we will leave the code in the base minter, not because it is likely to be used but because it will be easier to refactor in the future if the code is consistent across minters. |
As discussed in Discord:
|
@@ -568,6 +611,62 @@ pub fn execute_mint_for( | |||
) | |||
} | |||
|
|||
fn _pay_mint_if_not_contract( | |||
this_contract: Addr, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also seems like duplicate code that's in other contracts.
// Create mint msgs | ||
let mint_msg = Sg721ExecuteMsg::<Extension, Empty>::Mint { | ||
token_id: increment_token_index(deps.storage)?.to_string(), | ||
owner: info.sender.to_string(), | ||
owner: collection_info.creator, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the NFT owner would be the collection creator?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the NFT owner would be the collection creator?
So now that the contract can call itself through the execute_burn_to_mint messages, we can't just assume the the sender is always creator, and therefore info.sender won't cut it.
Actually looking at the name of this function execute_mint_sender
I'm not entirely sure what is the intention of this function. It sounds like a mint is being performed on behalf of the sender? But here I am just putting back the collection creator because that's all I have access to to figure out who should be the owner. Unless I do a query for owner here? Thoughts?
e81212c
to
ec21097
Compare
ec21097
to
1f35da3
Compare
@@ -57,8 +73,7 @@ fn check_custom_create_minter_denom() { | |||
.ok(); | |||
|
|||
setup_block_time(&mut router, GENESIS_MINT_START_TIME + 100, None); | |||
|
|||
// Mint succeeds | |||
// // Mint succeeds |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
// // Mint succeeds | |
// Mint succeeds |
Closing in favor of #610 due to rebase errors on this branch
This PR has several modules to it:
The amount() function has an implicit check:
execute_burn_to_mint
function to respond to the receive NFT messagecheck_minter_caller
added to s721-base: We need this assertion check because, when an NFT is received, that contract will burn that NFT and then itself call a collection for a mint. The check minter caller, allows an sg721-base collection to call itself.burn_to_mint tests: burn_to_mint.rs was added to vending-minter, open-edition-minter and base-minter tests. A send nft is sent like so: