3 ms·
Does anyone have a good solution for bugfixing and updating defective smart contracts yet, other than "fork the entire blockchain" Ethereum DAO passim? If they
by pjc50 10y ago
Does anyone have a good solution for bugfixing and updating defective smart contracts yet, other than "fork the entire blockchain" Ethereum DAO passim?
If they are to be immutable then you're going to have to code to NASA standards.
- Hermel 10y agoYou can implement a function that migrates all of the contract's assets and data to the new version. Obviously, you need to be careful about who can call this function, maybe requiring the agreement of all (or at least a majority) of stakeholders. Also, there is a risk of hitting the gas limit, preventing you from executing a "heavy" migration.
- buckie 10y agoPact[1], the language we've built, has the idea of an `admin keyset` that enables admins with the right number of signatures from the right number of keys to migrate contracts. Our approach is rather different from the EVM's as smart contracts interact with/guard a table in a DB (think stored procedures accessing a table) and the system has modules. This way, if a bug is found, the admin can update the smart contract module guarding the DB table directly vs having to track down the on-chain contracts for migration (if it's even possible). From a normal user's pov, they don't see a difference (unless the admin decides to change the namespace or something). It's a subtle but important difference. When someone using Pact sends the transaction `(payments.transfer "me" "you" <amt>)` the transaction (after doing a bunch of auth with ppk-sigs) looks up the `payments.transfer` command from the on-chain smart contract and executes it with the provided args. As such, the admin can update buggy contracts without issue (and roll-back, fix tables that have bad data). [1]: http://kadena.io/pact/ http://kadena.io/pact/