Hi Finance team!
I have a template that implements Fungible interface.
In order to Merge or Split I need to work with ContractId Fungible
type.
Imagine that my input is ContractId Holding.I
type.
Is it right that in order to cast from ContractId Holding.I
to ContractId Fungible
I have to go through three steps. Like this:
holdingCid = fromInterfaceContractId @Holding holdingIcid -- holdingIcid : Holding.I
fungibleIcid = toInterfaceContractId @Fungible.I holdingCid
fungibleCid = fromInterfaceContractId @Fungible fungibleIcid
I tested it in the Update context and it works. Is it the only way, or I missing something?
Iām asking mostly for the sake of understanding. This is not a production code.
Thanks!