From c27d26f362e45e198f5ab62b4b8c4b615465dadb Mon Sep 17 00:00:00 2001 From: prxgr4mm3r Date: Mon, 11 Sep 2023 21:09:44 +0300 Subject: [PATCH] update link in upgradable --- docs/OpenBrush/smart-contracts/upgradeable.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/OpenBrush/smart-contracts/upgradeable.md b/docs/OpenBrush/smart-contracts/upgradeable.md index 1bc0967..4d879f0 100644 --- a/docs/OpenBrush/smart-contracts/upgradeable.md +++ b/docs/OpenBrush/smart-contracts/upgradeable.md @@ -7,7 +7,7 @@ title: Upgradeable contract ## Overview -Code of a smart contract deployed on chain is immutable, however, we can update the code hash of a contract to point to a different code (therefore changing the code of the smart contract). This functionality can be used for bug fixing and potential product improvements. To do this, we need to first deploy a smart contract with the new code to register its code hash to the chain, and then call the `ink::env::set_code_hash` function. This function needs to be exposed in the smart contract API. You can check an example [here](https://github.com/paritytech/ink/tree/master/examples/upgradeable-contracts/set-code-hash). Openbrush also provides `Upgradeable` trait, which exposes this function. When using this, be sure to add some access modifiers, so only the admin of the contract can call the function. +Code of a smart contract deployed on chain is immutable, however, we can update the code hash of a contract to point to a different code (therefore changing the code of the smart contract). This functionality can be used for bug fixing and potential product improvements. To do this, we need to first deploy a smart contract with the new code to register its code hash to the chain, and then call the `ink::env::set_code_hash` function. This function needs to be exposed in the smart contract API. You can check an example [here](https://github.com/paritytech/ink-examples/tree/main/set-code-hash). Openbrush also provides `Upgradeable` trait, which exposes this function. When using this, be sure to add some access modifiers, so only the admin of the contract can call the function. Upgradeability allows experimenting and deploying the product at the early stage, always leaving the chance to fix vulnerabilities and progressively add features. Upgradeable contracts are not a Bug if they are developed consciously with decentralization in mind.