fuel_vm/storage/
contracts_assets.rs

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
use crate::double_key;
use fuel_storage::Mappable;
use fuel_types::{
    AssetId,
    ContractId,
    Word,
};

/// The storage table for contract's assets balances.
///
/// Lifetime is for optimization to avoid `clone`.
pub struct ContractsAssets;

impl Mappable for ContractsAssets {
    type Key = Self::OwnedKey;
    type OwnedKey = ContractsAssetKey;
    type OwnedValue = Self::Value;
    type Value = Word;
}

double_key!(
    ContractsAssetKey,
    ContractId,
    contract_id,
    AssetId,
    asset_id
);