Closed tonton-sol closed 2 months ago
Thanks for your report! This is indeed an issue.
It looks like we'll need to do a few things to fix this properly.
offchain
helper (and probably an onchain
helper while we're at it) which also takes in the expected fee, something like create_transfer_checked_with_fee_instruction_with_extra_metas
, which could resolve to some common helper function with https://github.com/solana-labs/solana-program-library/blob/7d35ad2ed2bc1e6c7f2a841526711c47f5093438/token/program-2022/src/offchain.rs#L37transfer_with_fee
https://github.com/solana-labs/solana-program-library/blob/7d35ad2ed2bc1e6c7f2a841526711c47f5093438/token/client/src/token.rs#L1149, very similar to how the transfer
function works https://github.com/solana-labs/solana-program-library/blob/7d35ad2ed2bc1e6c7f2a841526711c47f5093438/token/client/src/token.rs#L992transfer_with_fee
, so that should Just Work afterwardsI will start on this!
Resolved by #7171, thanks!
I am trying to test using the transfer-fee extension in conjunction with the transfer-hook extension. The transfer-hook is the provided example program given in this repository. The transfer hook extra account metas account is initialized but empty. I am running this command:
It fails with error:
Program TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb failed: custom program error: 0x7dc8348c
My suspicion is that TransferCheckedWithFee is not correctly resolving the extra account metas.I have already confirmed that this same transfer-hook program works and successfully transfers a token with only the transfer-hook extension.
Solution: Fix TransferCheckedWithFee to correctly resolve the required extra account metas.