entropyxyz / programs

Source, toolchain, and examples for using programs on Entropy
https://docs.entropy.xyz/concepts/programs/
GNU Affero General Public License v3.0
19 stars 3 forks source link

Upload and Instantiate Workflow #39

Open HCastano opened 10 months ago

HCastano commented 10 months ago

Substrate's Contracts pallet has a distinction between uploading code and instantiating code.

The upload stage simply puts bytecode on chain, whereas the instantiate state takes existing bytecode and creates a usable/callable instance of it. Once code is uploaded it may be instantiated many times using different constructor parameters.

This provides a few advantages, like being able to upload an ERC-20 contract once and instantiating many contracts with differing token names, decimal amounts, etc. from it.

It's still a bit early for me to think about some concrete use cases here, but it may be advantageous to have this flow for Programs as well.