Commit 5f5901c
committed
refactor trait
refactor
remove fetch-accounts
renaming, simplify trait
fomat
excl photon-api submodule
fix: multi-pass cold account lookup in test indexer RPC
Align get_account_interface and get_multiple_account_interfaces with
Photon's lookup strategy: search compressed_accounts by onchain_pubkey,
then by PDA seed derivation, then token_compressed_accounts, then by
token_data.owner. Also fix as_mint() to accept ColdContext::Account
since Photon returns mints as generic compressed accounts.
Co-authored-by: Cursor <cursoragent@cursor.com>
lint
fix lint
fix: reject rent sponsor self-referencing the token account (#2257)
* fix: reject rent sponsor self-referencing the token account
Audit issue #9 (INFO): The rent payer could be the same account as
the target token account being created. Add a check that rejects
this self-reference to prevent accounting issues.
* test: add failing test rent sponsor self reference
fix: process metadata add/remove actions in sequential order (#2256)
* fix: process metadata add/remove actions in sequential order
Audit issue #16 (LOW): should_add_key checked for any add and any
remove independently, ignoring action ordering. An add-remove-add
sequence would incorrectly remove the key. Process actions
sequentially so the final state reflects the actual order.
* chore: format
* test: add randomized test for metadata action processing
Validates that process_extensions_config_with_actions produces correct
AdditionalMetadataConfig for random sequences of UpdateMetadataField
and RemoveMetadataKey actions, covering the add-remove-add bug from
audit issue #16.
* test: add integration test for audit issue #13 (no double rent charge)
Verifies that two compress operations targeting the same compressible
CToken account in a single Transfer2 instruction do not double-charge
the rent top-up budget.
* chore: format extensions_metadata test
fix: validate authority on self-transfer early return (#2252)
* fix: handle self-transfer in ctoken transfer and transfer_checked
Validate that the authority is a signer and is the owner or delegate
before allowing self-transfer early return. Previously the self-transfer
path returned Ok(()) without any authority validation.
* fix: simplify map_or to is_some_and per clippy
* fix: use pubkey_eq for self-transfer check
* refactor: extract self-transfer validation into shared function
Extract duplicate self-transfer check from default.rs and checked.rs
into validate_self_transfer() in shared.rs with cold path for authority
validation.
* chore: format
* fix: deduplicate random metadata keys in test_random_mint_action
Random key generation could produce duplicate keys, causing
DuplicateMetadataKey error (18040) with certain seeds.
fix: enforce mint extension checks in cToken-to-cToken decompress (#2246)
* fix: enforce mint extension checks in cToken-to-cToken decompress hot path
Add enforce_extension_state() to MintExtensionChecks and call it in the
Decompress branch when decompress_inputs is None (hot-path, not
CompressedOnly restore). This prevents cToken-to-cToken transfers from
bypassing pause, transfer fee, and transfer hook restrictions.
* fix test
chore: reject compress for mints with restricted extensions in build_mint_extension_cache (#2240)
* chore: reject compress for mints with restricted extensions in mint check
* Update programs/compressed-token/program/src/compressed_token/transfer2/check_extensions.rs
Co-authored-by: 0xa5df-c <172008956+0xa5df-c@users.noreply.github.com>
* fix: format else-if condition for lint
---------
Co-authored-by: 0xa5df-c <172008956+0xa5df-c@users.noreply.github.com>
fix: token-pool index 0 check (#2239)
fix(programs): add MintCloseAuthority as restricted extension (M-03) (#2263)
* fix: add MintCloseAuthority as restricted extension (M-03)
A mint with MintCloseAuthority can be closed and re-opened with
different extensions. Treating it as restricted ensures compressed
tokens from such mints require CompressedOnly mode.
* test: add MintCloseAuthority compression_only requirement tests
Add test coverage for MintCloseAuthority requiring compression_only mode,
complementing the fix in f2da063.
refactor: light program pinocchio macro (#2247)
* refactor: light program pinocchio macro
* fix: address CodeRabbit review comments on macro codegen
- Fix account order bug in process_update_config (config=0, authority=1)
- Use backend-provided serialize/deserialize derives in LightAccountData
- Remove redundant is_pinocchio() branch for has_le_bytes unpack fields
- DRY doc attribute generation across 4 struct generation methods
- Unify unpack_data path using account_crate re-export for both backends
chore(libs): bump versions (#2272)
fix(programs): allow account-level delegate to compress CToken (M-02) (#2262)
* fix: allow account-level delegate to compress tokens from CToken (M-02)
check_ctoken_owner() only checked owner and permanent delegate.
An account-level delegate (approved via CTokenApprove) could not
compress tokens. Added delegate check after permanent delegate.
* test: compress by delegate
fix: accumulate delegated amount at decompression (#2242)
* fix: accumulate delegated amount at decompression
* fix lint
* refactor: simplify apply_delegate to single accumulation path
* fix: ignore delegated_amount without delegate
* restore decompress amount check
fix programtest, wallet owner tracking for ata
fmt and lint1 parent 9edc093 commit 5f5901c
50 files changed
Lines changed: 3689 additions & 4455 deletions
File tree
- program-libs
- compressed-account
- token-interface/src
- program-tests
- compressed-token-test/tests
- compress_only
- light_token
- mint
- utils/src
- programs/compressed-token
- anchor/src
- program
- docs
- src
- compressed_token/transfer2
- compression/ctoken
- ctoken/transfer
- extensions
- tests
- scripts/release
- sdk-libs
- client
- src
- interface
- rpc
- event
- macros/src/light_pdas
- accounts
- program
- program-test
- src
- indexer
- program_test
- token-client
- sdk-tests
- csdk-anchor-full-derived-test-sdk
- src
- tests
- csdk-anchor-full-derived-test/tests
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
200 | 200 | | |
201 | 201 | | |
202 | 202 | | |
203 | | - | |
204 | | - | |
| 203 | + | |
| 204 | + | |
205 | 205 | | |
206 | 206 | | |
207 | 207 | | |
| |||
213 | 213 | | |
214 | 214 | | |
215 | 215 | | |
216 | | - | |
| 216 | + | |
217 | 217 | | |
218 | 218 | | |
219 | 219 | | |
| |||
233 | 233 | | |
234 | 234 | | |
235 | 235 | | |
236 | | - | |
| 236 | + | |
237 | 237 | | |
238 | 238 | | |
239 | 239 | | |
| |||
244 | 244 | | |
245 | 245 | | |
246 | 246 | | |
247 | | - | |
| 247 | + | |
248 | 248 | | |
249 | 249 | | |
250 | 250 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
9 | | - | |
| 9 | + | |
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
| 15 | + | |
15 | 16 | | |
16 | 17 | | |
17 | 18 | | |
| |||
53 | 54 | | |
54 | 55 | | |
55 | 56 | | |
| 57 | + | |
56 | 58 | | |
57 | 59 | | |
58 | 60 | | |
| |||
71 | 73 | | |
72 | 74 | | |
73 | 75 | | |
| 76 | + | |
| 77 | + | |
74 | 78 | | |
75 | 79 | | |
76 | 80 | | |
| |||
152 | 156 | | |
153 | 157 | | |
154 | 158 | | |
| 159 | + | |
155 | 160 | | |
156 | 161 | | |
0 commit comments