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

Unable to mint "asset ready" tokens in one call #72

Open
boyswan opened this issue May 18, 2023 · 0 comments
Open

Unable to mint "asset ready" tokens in one call #72

boyswan opened this issue May 18, 2023 · 0 comments

Comments

@boyswan
Copy link
Contributor

boyswan commented May 18, 2023

Currently the only way to mint a token which has an accepted asset is through multiple methods. This is due to the fact only the token owner can add an asset without it being in pending state. This is problematic especially when minting via cross-contract calls.

The current workaround:

let to: AccountId = ...
let id = 1;

Minting::mint(self, id, self.env().caller())?;
MultiAsset::add_asset_to_token(self, id, asset_id, None)?;
PSP34::transfer(self, to, id, Default::default())?;

Will edit with possible solutions

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

No branches or pull requests

1 participant