mirror of
https://github.com/logos-blockchain/lssa.git
synced 2026-04-12 22:23:11 +00:00
Programs can now verify that input accounts are owned by themselves,
preventing spoofing attacks where malicious programs pass fake accounts
with matching data layouts.
Changes:
- Add optional owner_program_id field to AccountWithMetadata
- Add with_owner_program_id() builder method
- Backward compatible: serde(default) = None for existing data
Usage in programs:
if let Some(owner) = account.owner_program_id {
assert_eq!(owner, SELF_PROGRAM_ID, 'account not owned by this program');
}
Fixes #347