Assessment reports>BPF Stake Program>Threat Model>Instruction: SetLockup

Instruction: SetLockup

This instruction updates the lockup information of a stake account. If the lockup is active, the lockup custodian may update the lockup parameters. If the lockup is not active, the withdraw authority may set a new lockup.

Input structure

pub struct LockupArgs { pub unix_timestamp: Option, pub epoch: Option, pub custodian: Option, } pub enum StakeInstruction { /// # Account references /// 0. `[WRITE]` Initialized stake account /// 1. `[SIGNER]` Lockup authority or withdraw authority SetLockup(LockupArgs), }

Parameters

  • unix_timestamp: Unix timestamp when the lockup expires.

  • epoch: Epoch when the lockup expires.

  • custodian: Custodian key on a transaction exempts the operation from lockup constraints.

Accounts

  • stake_account: The initialized stake account whose lockup information will be updated.

    • Signer: No.

    • Init: No.

    • PDA: No.

    • Writable: Yes.

    • Rent checks: None.

    • Ownership checks: The account must be owned by the program.

    • Address checks: None.

  • lockup_or_withdraw_authority: The lockup authority or withdraw authority account must be a signer.

    • Signer: Yes.

    • Init: No.

    • PDA: No.

    • Writable: No.

    • Rent checks: None.

    • Ownership checks: None.

    • Address checks: None.

Additional checks and behavior

  • Only the lockup custodian can update the lockup while it is in force.

  • Only the withdraw authority can set a new lockup if the lockup is not in force.

Zellic © 2025Back to top ↑