Derive Macro near_contract_tools_macros::Upgrade
source · #[derive(Upgrade)]
{
// Attributes available to this derive:
#[upgrade]
}
Expand description
Create an upgrade component. Does not expose any functions to the blockchain.
Fields may be specified in the #[upgrade(...)]
attribute.
Fields include:
hook
- If included, provides an implementation ofUpgradeHook
. An implementation must be explicity provided otherwise. Options include:"none"
- Empty upgrade hook."owner"
- The upgrade function may only be called by the owner of the contract as specified by anOwner
implementation."role(r)"
- The upgrade function may only be called by an account that has been assigned the roler
as determined by anRbac
implementation.
serializer
-"borsh"
or"jsonbase64"
(default). Indicates the serialization format of code theupgrade
function will accept.migrate_method_name
- The name of the method to call after the upgrade. Default"migrate"
.migrate_method_args
- The input to send to the migrate function. Default empty vector.migrate_minimum_gas
- How much gas to guarantee the migrate function, otherwise reject. Default 15T.