-
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
The error message is describing the object you are trying to retrieve does not exist, this may have to do with a mistake during collection creation. To fully debug you error would be difficult to do without access to your entire codebase, I would attempt to reference this example during collection creation (cc @0xaptosj): https://github.com/aptos-labs/move-by-examples/blob/main/nft-launchpad/aptos/move/sources/launchpad.move#L161-L282 And reference this code during minting: https://github.com/aptos-labs/move-by-examples/blob/main/nft-launchpad/aptos/move/sources/launchpad.move#L286-L313 |
Beta Was this translation helpful? Give feedback.
-
I've updated the minting function as provided by @bwdotcom.. This is my latest minting code - public entry fun mint_character(creator: &signer, type: u64) acquires Characters, OnChainConfig
{
let resource_publisher = cryptara_conquest_publisher_signer::get_signer();
let characters = borrow_global<Characters>(signer::address_of(&resource_publisher)).characters;
let character = vector::borrow(&characters, type);
let on_chain_config = borrow_global<OnChainConfig>(signer::address_of(&resource_publisher));
let constructor_ref = token::create(
&resource_publisher,
on_chain_config.collection,
character.description,
character.name,
option::none(),
character.uri
);
let nft = object::object_from_constructor_ref<Token>(&constructor_ref);
object::transfer(&resource_publisher, nft, signer::address_of(creator));
if(character.price > 0)
{
cryptara_conquest_token::burn(signer::address_of(creator), character.price);
}
} It compiles fine. But it's not running, when I try to run it in the explorer, it gives me Generic Error Error in transaction - here is the explorer if anyone wanna play with it and check - https://explorer.aptoslabs.com/account/0x0465b1cf749e60c26f1a21ab6d3b33422785b6f2c42a3e226e24690b9a587301/modules/run/cryptara_conquest_characters/mint_character?network=testnet |
Beta Was this translation helpful? Give feedback.
This issue is fixed, it was due to mismatching accounts