Skip to content

Conversation

@IMEF-FEMI
Copy link
Contributor

Summary:

  • Introduce an ACCOUNT_FROZEN flag on MarginfiAccount plus a new admin-only instruction marginfi_account_set_freeze that toggles it,
    emitting MarginfiAccountFreezeEvent.
  • Enforce frozen-state semantics across all major account operations (deposit, withdraw, borrow, repay, close balance, close account,
    emissions, flashloans, account transfers, Kamino deposit/withdraw): account authorities are blocked with AccountFrozen (6103) while
    the group admin remains authorized to act.

@IMEF-FEMI IMEF-FEMI changed the title Admin transfer account (for KYC/AML compliance) Admin transfer/freeze account (for KYC/AML compliance) Nov 30, 2025
marginfi_account.get_flag(ACCOUNT_FROZEN) && group_admin == signer
}

#[inline(always)]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: probably doesn't need to be inlined

return true;
}

marginfi_account.get_flag(ACCOUNT_FROZEN) && group_admin == signer
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it makes sense that the group admin can only sign after first freezing!

nit: I think it's a little odd that the "not frozen" case is handled above should probably be like if(frozen) check group admin (else not frozen) check authority

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants