ewasm / design

Ewasm Design Overview and Specification
Apache License 2.0
1.02k stars 125 forks source link

Replace code for system contracts #158

Open axic opened 6 years ago

axic commented 6 years ago

This is not a fully explored idea yet, and it can be considered quite dangerous, but it would interesting to see how we can have mutable code.

One example is a replaceCode instruction, which replaces the code of the current account.

My use case (probably a bad one) is to have a tiny piece of code in the genesis for the system contracts, which can replace itself after the genesis. For example the Sentinel could be deployed like this on the testnet.

Perhaps the consequences outside of the testnet are too big to consider this feature.