Erik Trautman
Erik Trautman

Reputation: 6029

How do you upgrade NEAR smart contracts?

If I've deployed a smart contract on NEAR, how do I upgrade it to a new version? How can I tell if an existing smart contract can still be upgraded or has been frozen?

Upvotes: 3

Views: 438

Answers (2)

Vlad Frolov
Vlad Frolov

Reputation: 7756

In addition to the answer Erik already provided, I want to mention that even when there is no full-access keys on the account, the contract code can be re-deployed by the contract implementation itself (obviously, it should have a built-in support for that). You may also want to combine that with DAO to make the upgrade process backed by a voting process.

Upvotes: 2

Erik Trautman
Erik Trautman

Reputation: 6029

Upgrading is done with access keys. If you want to be upgrading, you keep a full access key to the account, which allows you to deploy or delete/recreate/deploy.

Anyone can view the upgradeability of a contract (eg whether it can still be changed by the original owner) by viewing its keys to make sure that all full access keys have been removed using:

NEAR_ENV=mainnet near keys contract_name.near

Upvotes: 1

Related Questions