How to Upgrade a Smart Contract

Upgrading a smart contract is quite simple, although the effects might not be very clear. Just run this command to upgrade it:

docker run -it --rm --user "$(id -u):$(id -g)" \
    -v $(pwd):/opt/klever-blockchain \
    --network=host \
    --entrypoint=/usr/local/bin/operator \
    kleverapp/klever-go:latest  --key-file=KEY_FILE \
    cc upgrade SC_ADDRESS --wasm=WASM_PATH \
    --vmType=0500 --arguments example --payable --payableBySC --readable --upgradeable

Replace SC_ADDRESS, KEY_FILE and WASM_PATH accordingly. If needs arguments, add --arguments VALUE.

Check your flags --payable --payableBySC --readable --upgradeable to make sure they are correct.

Was this page helpful?