Module iota::derived_object
Enables the creation of objects with deterministic addresses derived from a parent object's UID.
use iota::address;
use iota::dynamic_field;
use iota::hex;
use iota::object;
use iota::tx_context;
use std::ascii;
use std::bcs;
use std::option;
use std::string;
use std::vector;
Module Functions
pub derive_address
Given an ID and a Key, it calculates the derived address.
public fun derive_address<K: copy, drop, store>(parent: iota::object::ID, key: K): address
Implementation
public fun derive_address<K: copy + drop + store>(parent: ID, key: K): address {
iota::dynamic_field::hash_type_and_key(parent.to_address(), DerivedObjectKey(key))
}
Structs
struct DerivedObjectKey
An internal key to protect from generating the same UID twice (e.g. collide with DFs)
public struct DerivedObjectKey<K: copy, drop, store> has copy, drop, store
Fields
0: K