#[repr(u8)]pub enum LoaderV4Instruction {
Write {
offset: u32,
bytes: Vec<u8>,
},
Truncate {
new_size: u32,
},
Deploy,
Retract,
TransferAuthority,
Finalize,
}
Variants§
Write
Write ELF data into an undeployed program account.
§Account references
[writable]
The program account to write to.[signer]
The authority of the program.
Truncate
Changes the size of an undeployed program account.
A program account is automatically initialized when its size is first increased. In this initial truncate, the program account needs to be a signer and it also sets the authority needed for subsequent operations. Decreasing to size zero closes the program account and resets it into an uninitialized state. Providing additional lamports upfront might be necessary to reach rent exemption. Superflous funds are transferred to the recipient account.
§Account references
[(signer), writable]
The program account to change the size of.[signer]
The authority of the program.[writable]
Optional, the recipient account.
Deploy
Verify the data of a program account to be a valid ELF.
If this succeeds the program becomes executable, and is ready to use. A source program account can be provided to overwrite the data before deployment in one step, instead retracting the program and writing to it and redeploying it. The source program is truncated to zero (thus closed) and lamports necessary for rent exemption are transferred, in case that the source was bigger than the program.
§Account references
[writable]
The program account to deploy.[signer]
The authority of the program.[writable]
Optional, an undeployed source program account to take data and lamports from.
Retract
Undo the deployment of a program account.
The program is no longer executable and goes into maintenance. Necessary for writing data and truncating.
§Account references
[writable]
The program account to retract.[signer]
The authority of the program.
TransferAuthority
Transfers the authority over a program account.
§Account references
[writable]
The program account to change the authority of.[signer]
The current authority of the program.[signer]
The new authority of the program.
Finalize
Finalizes the program account, rendering it immutable.
§Account references
[writable]
The program account to change the authority of.[signer]
The current authority of the program.[]
The next version of the program (can be itself).
Trait Implementations§
Source§impl Clone for LoaderV4Instruction
impl Clone for LoaderV4Instruction
Source§fn clone(&self) -> LoaderV4Instruction
fn clone(&self) -> LoaderV4Instruction
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more