Skip to content
This repository was archived by the owner on Mar 11, 2025. It is now read-only.

Commit bba4651

Browse files
authored
token-2022: [I-01] Assert that a transfer fee always includes mint decimals (#6864)
token-2022: Assert that a transfer fee always includes mint decimals
1 parent 8536f6f commit bba4651

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

token/program-2022/src/processor.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -296,6 +296,9 @@ impl Processor {
296296
let expected_mint_info = if let Some(expected_decimals) = expected_decimals {
297297
Some((next_account_info(account_info_iter)?, expected_decimals))
298298
} else {
299+
// Transfer must not be called with an expected fee but no mint,
300+
// otherwise it's a programmer error.
301+
assert!(expected_fee.is_none());
299302
None
300303
};
301304

0 commit comments

Comments
 (0)