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

Upgradable Smart contract #9

Open
AnandK-2024 opened this issue Sep 12, 2022 · 1 comment
Open

Upgradable Smart contract #9

AnandK-2024 opened this issue Sep 12, 2022 · 1 comment
Assignees
Labels
documentation Improvements or additions to documentation enhancement New feature or request help wanted Extra attention is needed medium difficulty level of difficulty question Further information is requested

Comments

@AnandK-2024
Copy link
Owner

Smart contracts in Ethereum are immutable by default. Once you create them there is no way to alter them, effectively acting as an unbreakable contract among participants.

However, for some scenarios, it is desirable to be able to modify them. Think of a traditional contract between two parties: if they both agreed to change it, they would be able to do so. On Ethereum, they may desire to alter a smart contract to fix a bug they found (which might even lead to a hacker stealing their funds!), to add additional features, or simply to change the rules enforced by it.

Here’s what you’d need to do to fix a bug in a contract you cannot upgrade:

  1. Deploy a new version of the contract
  2. Manually migrate all state from the old one contract to the new one (which can be very expensive in terms of gas fees!)
  3. Update all contracts that interacted with the old contract to use the address of the new one
  4. Reach out to all your users and convince them to start using the new deployment (and handle both contracts being used simultaneously, as users are slow to migrate)

To avoid going through this mess, we have built contract upgrades directly into our plugins. This allows us to change the contract code, while preserving the state, balance, and address.


for more information about upgradable smart contract reach out this

openzeppelin-contracts-upgradeable

@AnandK-2024 AnandK-2024 added documentation Improvements or additions to documentation enhancement New feature or request help wanted Extra attention is needed question Further information is requested medium difficulty level of difficulty labels Sep 12, 2022
@AnandK-2024 AnandK-2024 self-assigned this Sep 12, 2022
@AnandK-2024
Copy link
Owner Author

For more informative article related to Upgradibility of smart contract

go carefully how to make contracts upgradeable

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation enhancement New feature or request help wanted Extra attention is needed medium difficulty level of difficulty question Further information is requested
Projects
None yet
Development

No branches or pull requests

1 participant