Closed Buky33 closed 6 months ago
Hello!
In your contract, add the following:
#[endpoint]
fn upgrade(&self, new_value: BigUint) {
self.sum().set(new_value);
}
For example: https://github.com/multiversx/mx-contracts-rs/blob/main/contracts/adder/src/adder.rs
Make sure to follow the documentation here: https://docs.multiversx.com/developers/developer-reference/upgrading-smart-contracts/#sirius-mainnet-release---version-160
Thank you :pray:
Ohh yes! there is a new #[upgrade] type for upgrades! Many thanks my friend 🤝
Installed last versions :
Created an empty new contract with : $> mxpy contract new --name staking-contract --template empty
Deployed on devnet with classical : $> mxpy --verbose contract deploy ...
Then a simple upgrade on devnet : $> mxpy --verbose contract upgrade ... https://devnet-explorer.multiversx.com/transactions/3baaf39aa87392daaea535ede005af4340ccaf210dc23fe066a63218e38cbe9c
This produces an error "[invalid function (not found)] [upgradeContract]"