pub fn _set_metadata(
    metadata_key: StorageKey<StorageMetadata>,
    asset: AssetId,
    key: String,
    metadata: Metadata,
) 
Expand description

Unconditionally stores metadata for a specific asset and key pair.

Arguments

  • metadata_key: [StorageKey] - The storage location for metadata.
  • asset: [AssetId] - The asset for the metadata to be stored.
  • metadata: [Option] - The metadata which to be stored.
  • key: [String] - The key for the metadata to be stored.

Number of Storage Accesses

  • Writes: 2

Example

use standards::src7::Metadata;
use sway_libs::asset::metadata::*;
use std::string::String;

storage {
    metadata: StorageMetadata = StorageMetadata {}
}

fn foo(asset: AssetId, key: String, metadata: Option<Metadata>) {
    _set_metadata(storage.metadata, asset, metadata, key);
}