rmrk-ink icon indicating copy to clipboard operation
rmrk-ink copied to clipboard

Unable to mint "asset ready" tokens in one call

Open boyswan opened this issue 2 years ago • 0 comments

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

boyswan avatar May 18 '23 20:05 boyswan