How to update existing published smart contract

I have published my smart contract to mainnet. But i want to make some changes to it. Is there a way to make new version of it. Can you please help me.


Do the changes you want and deploy the contract again but with a different name. You can add the version to your contract name, like my-contract-v2-0-0.

Thanks for you reploy @csgui and @unclemantis. I understood it.

Contrat principal has STX and NFT balance. How to manage these asserts?

Should we transfer to new contract(contract-v2) or how to handle this?

If your v1 has issues, the best thing to do is freeze deposits on v1 and transfer the assets.

You can transfer directly to v2 or even return the assets to senders.

But all of that should be as transparent as possible to the contract clients.

1 Like

CrashPunks and Bitcoin badgers recently discovered their initial contract had problems and had to do mass-scale migrations, asking all the users to ‘burn’ their tokens on the v1 contract to receive a token on the v2. It can be done!

But the fact it can’t be done without user’s permission is by design.

I was wondering if there’s some way to use delegated functions to remote traits, and then update the traits being called, but I don’t believe that’s possible either.

1 Like