What if a user has 2 token accounts for same token?
What if a user has 2 token accounts for same token?
Loading saved threads...
Yellow Wolf · External communityPost link
External question — Solana Stack Exchange
Author: Yellow Wolf
Original post: https://solana.stackexchange.com/questions/24499
License: CC BY-SA 4.0 — https://creativecommons.org/licenses/by-sa/4.0/
Adaptation: HTML converted to plain text; contact email addresses removed.
docs says a user can have multiple token accounts for same wallet, so suppose I made a custom token and user holds suppose 10 of those in his ATA(or a token account) and when he called a function of my contract, out of 10, 4 went to another token account(owned by same wallet), how will the explorer and wallets show this? Ps can a wallet own a pda or have full auth over it? And what does decimals for tokens mean?
Quote
Report
hammad Shabir · External communityPost link
External answer — Solana Stack Exchange
Author: hammad Shabir
Original post: https://solana.stackexchange.com/a/24533
License: CC BY-SA 4.0 — https://creativecommons.org/licenses/by-sa/4.0/
Adaptation: HTML converted to plain text; contact email addresses removed.
That’s not possible. Token accounts are derived from the wallet address, and each token has one associated ATA for a specific wallet. Therefore, the same wallet cannot have multiple ATAs for the same token.
Quote
Report
Aseneca · External communityPost link
External answer — Solana Stack Exchange
Author: Aseneca
Original post: https://solana.stackexchange.com/a/24534
License: CC BY-SA 4.0 — https://creativecommons.org/licenses/by-sa/4.0/
Adaptation: HTML converted to plain text; contact email addresses removed.
A wallet can own multiple token accounts for the same mint. A token account holds units of one mint and has one token-account owner; its owner field identifies the authority over the tokens. Thus, if 4 tokens are transferred from one account to another account owned by the same wallet, the two token-account balances change, while the wallet still owns both accounts. I can’t say for sure how a particular explorer or wallet will display that transfer or whether it will combine the balances.
A PDA is a deterministically derived address. A PDA can be the owner/authority of a token account that a program can use to authorize transfers by signing with the PDA’s seeds during a CPI. I do not agree that a wallet can own a PDA or have full authority over it. PDA-controlled token account is program-controlled, not described as wallet-controlled.
Token decimals specify the number of base-10 digits to the right of the decimal place. For example, with 2 decimals, an amount of 100 base units represents 1 token.
Quote
Report
Post Reply
Quoted from Forex.com.bd-Editorial External answer — Solana Stack Exchange Author: hammad Shabir Source score (net votes, not local likes): 0 Original post: https://solana.stackexchange.com/a/24533 License: CC BY-SA 4.0 — https://creativecommons.org/licenses/by-sa/4.0/ Adaptation: HTML converted to plain text; contact email addresses removed. That’s not possible. Token accounts are derived from the wallet address, and each token has one associated ATA for a specific wallet. Therefore, the same wallet cannot have multiple ATAs for the same token.
Checking account access…