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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
use core::marker::PhantomData;
use fuel_storage::Mappable;
use fuel_tx::Contract;
use fuel_types::{AssetId, Bytes32, ContractId, Salt, Word};
mod interpreter;
mod memory;
mod predicate;
pub use interpreter::InterpreterStorage;
pub use memory::MemoryStorage;
pub use predicate::PredicateStorage;
pub struct ContractsRawCode;
impl Mappable for ContractsRawCode {
type Key = ContractId;
type SetValue = [u8];
type GetValue = Contract;
}
pub struct ContractsInfo;
impl Mappable for ContractsInfo {
type Key = ContractId;
type SetValue = (Salt, Bytes32);
type GetValue = Self::SetValue;
}
pub struct ContractsAssets<'a>(PhantomData<&'a ()>);
impl<'a> Mappable for ContractsAssets<'a> {
type Key = (&'a ContractId, &'a AssetId);
type SetValue = Word;
type GetValue = Self::SetValue;
}
pub struct ContractsState<'a>(PhantomData<&'a ()>);
impl<'a> Mappable for ContractsState<'a> {
type Key = (&'a ContractId, &'a Bytes32);
type SetValue = Bytes32;
type GetValue = Self::SetValue;
}