I want to init a contract from another contract, but i can see that the InitContext
has a method init_origin
which returns AccountAddress
which i guess assumes that the contract can only be called by an address? If so, what is the reason? If not, how can i get the address of the caller which in this case is ContractAddress
?
A contract cannot create a new instance, which is why the init_origin
is always an account address.
I understand that on Ethereum this is relatively common to do, but it would be useful to understand what the underlying reason for wanting to do this is. The limitations and setup is a bit different on Concordium, so often it is better to not map things 1:1.