Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade Contract Code #154

Open
ajlopez opened this issue Dec 19, 2019 · 0 comments
Open

Upgrade Contract Code #154

ajlopez opened this issue Dec 19, 2019 · 0 comments

Comments

@ajlopez
Copy link
Contributor

ajlopez commented Dec 19, 2019

Although the concept of smart contract is based on inmutability of the logic, the alternative upgradable contract is gaining momentum. There are many implementations in Ethereum, most of them using a proxy contract.

This improvement proposal allows that any contract could be upgradble, given a control logic to accept the change.

The idea is based on invoke a defined public method:

function upgradeCode(bytes memory newcode) public returns (bytes memory)

In this function, explicitly added by the contract author, the logic could accept or not the new code (the bytes sent in the parameter). The bytes returned ARE THE NEW ACCEPTED code. So, the logic could control the sender account, or some freeze logic in the contract that reject the change.

The virtual machine execution code should be modified so the return of this invocation (if the returned value is not the empty byte array) changes the code of the contract account.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant