Skip to main content

klend_interface/state/
permissioning.rs

1use bitflags::bitflags;
2
3bitflags! {
4    /// Mirror of the on-chain `PermissionedOp` bitmask
5    /// (see `programs/klend/src/utils/permissioning.rs`).
6    ///
7    /// Stored as a raw `u64` on `LendingMarket.permissioned_ops` and
8    /// `ReserveConfig.permissioned_ops`. Bit values must stay in lockstep
9    /// with the program; the `permissioned_op_bits` test in
10    /// `tests/alignment.rs` pins them.
11    #[derive(Copy, Clone, Debug, PartialEq, Eq)]
12    pub struct PermissionedOp: u64 {
13        const DEPOSIT   = 1 << 0;
14        const BORROW    = 1 << 1;
15        const LIQUIDATE = 1 << 2;
16        // REPAY and WITHDRAW are never permissioned.
17
18        const NONE = 0;
19    }
20}