Commit abf92a92 authored by Hero Bird's avatar Hero Bird

[pdsl_model] Add note to clarify current Key([0x0; 32]) usage

parent 905a71be
......@@ -233,6 +233,17 @@ where
},
};
let state: State = unsafe {
// Note that it is totally fine here to start with a key
// offset of `0x0` as long as we only consider having one
// contract instance per execution. Otherwise their
// associated storage could overlap.
//
// This can later be solved by having an implementation for
// `AllocateUsing` for `ContractDecl` to actually instantiate
// them using an already existing allocator. Note that then
// all contracts always have to be allocated in the same
// order which could be achieved by simply putting all contracts
// into a contract struct that itself implements `AllocateUsing`.
let mut alloc = BumpAlloc::from_raw_parts(Key([0x0; 32]));
AllocateUsing::allocate_using(&mut alloc)
};
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment