piecrust
piecrust copied to clipboard
Contracts should be able to deploy contracts
Summary
Contracts writers should be able to instantiate contracts that have already been deployed as template contracts. This will ensure that bytecode is reused for instantiating multiple versions of the same contract, but using different metadata. Ownership should be transferred to the identifier of the current transaction.
Possible solution design or implementation
Contracts should have a host call available, so that contract writer can deploy these template modules.
Additional context
Some types of contracts, such as XSC, are built specifically to be instantiated multiple times with different parameters. Supporting this at the VM level will make this simpler, and less costly.