Remove references to instruction parsing in SPL Token -> Depositing section (#23161)

This commit is contained in:
Tyera Eulberg 2022-02-15 16:45:00 -07:00 committed by GitHub
parent 43393ea45d
commit 917113914d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 10 additions and 9 deletions

View File

@ -714,14 +714,12 @@ wallets using the
scheme and that _only_ deposits from ATA addresses be accepted. scheme and that _only_ deposits from ATA addresses be accepted.
Monitoring for deposit transactions should follow the [block polling](#poll-for-blocks) Monitoring for deposit transactions should follow the [block polling](#poll-for-blocks)
method described above. Each new block should be scanned for successful transactions method described above. Each new block should be scanned for successful
issuing SPL Token [Transfer](https://github.com/solana-labs/solana-program-library/blob/fc0d6a2db79bd6499f04b9be7ead0c400283845e/token/program/src/instruction.rs#L105) transactions referencing user token-account derived addresses. The
or [TransferChecked](https://github.com/solana-labs/solana-program-library/blob/fc0d6a2db79bd6499f04b9be7ead0c400283845e/token/program/src/instruction.rs#L268) `preTokenBalance` and `postTokenBalance` fields from the transaction's metadata
instructions referencing user accounts. It is possible that a transfer is initiated must then be used to determine the effective balance change. These fields will
by a smart contract via [Cross Program Invocation](/developing/programming-model/calling-between-programs#cross-program-invocations), identify the token mint and account owner (main wallet address) of the affected
so [inner instructions](/terminology#inner-instruction) must be checked as well. account.
The `preTokenBalance` and `postTokenBalance` fields from the transaction's metadata
must then be used to determine the effective balance change.
### Withdrawing ### Withdrawing
@ -730,7 +728,10 @@ The withdrawal address a user provides must be the that of their SOL wallet.
Before executing a withdrawal [transfer](#token-transfers), Before executing a withdrawal [transfer](#token-transfers),
the exchange should check the address as the exchange should check the address as
[described above](#validating-user-supplied-account-addresses-for-withdrawals). [described above](#validating-user-supplied-account-addresses-for-withdrawals).
Additionally this address must be owned by the System Program and have no account data. If the address has no SOL balance, user confirmation should be obtained before proceeding with the withdrawal. All other withdrawal addresses must be rejected. Additionally this address must be owned by the System Program and have no
account data. If the address has no SOL balance, user confirmation should be
obtained before proceeding with the withdrawal. All other withdrawal addresses
must be rejected.
From the withdrawal address, the [Associated Token Account](https://spl.solana.com/associated-token-account) From the withdrawal address, the [Associated Token Account](https://spl.solana.com/associated-token-account)
(ATA) for the correct mint is derived and the transfer issued to that account via a (ATA) for the correct mint is derived and the transfer issued to that account via a