From 075972c5d8127b8b47fb31df08c758290af25de1 Mon Sep 17 00:00:00 2001 From: andrewsource147 <31321699+andrewsource147@users.noreply.github.com> Date: Sat, 17 Sep 2022 05:55:44 +0700 Subject: [PATCH] Obligation_owner should be readonly (#87) Issue: As in description `WithdrawObligationCollateralAndRedeemReserveCollateral` combines `WithdrawObligationCollateral` and `RedeemReserveCollateral`. While `obligation_owner` in `WithdrawObligationCollateral` is readonly, it is writable in `WithdrawObligationCollateralAndRedeemReserveCollateral` is writable. Solution: Update `obligation_owner` readonly in `WithdrawObligationCollateralAndRedeemReserveCollateral` --- token-lending/program/src/instruction.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/token-lending/program/src/instruction.rs b/token-lending/program/src/instruction.rs index 4e19b069c35..70d31481976 100644 --- a/token-lending/program/src/instruction.rs +++ b/token-lending/program/src/instruction.rs @@ -1160,7 +1160,7 @@ pub fn withdraw_obligation_collateral_and_redeem_reserve_collateral( AccountMeta::new(destination_liquidity_pubkey, false), AccountMeta::new(reserve_collateral_mint_pubkey, false), AccountMeta::new(reserve_liquidity_supply_pubkey, false), - AccountMeta::new(obligation_owner_pubkey, true), + AccountMeta::new_readonly(obligation_owner_pubkey, true), AccountMeta::new_readonly(user_transfer_authority_pubkey, true), AccountMeta::new_readonly(spl_token::id(), false), ],