Near-One / near-plugins

Implementation of common patterns used for NEAR smart contracts.
Creative Commons Zero v1.0 Universal
27 stars 12 forks source link

Upgradeability: add delay on code upgrade #20

Closed sept-en closed 1 year ago

sept-en commented 1 year ago

The functionality of staging and deploying the code is implemented by the Upgradable part of NEAR plugins. As the code is being staged and deployed in separate functions, it allows for implementing delayed upgrades. So to achieve this, an additional storage variable could be introduced that will contain a value for the delayed upgrade. However, it's worth noting that in this case, changing the value of this variable should also be allowed only via contract upgrade or delayed-value-upgrade (so to change the delay-upgrade period, you need to wait for the same expected delay).