Skip to content

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

@boyswan

Description

@boyswan

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions