GithubHelp home page GithubHelp logo

Comments (5)

gagliardetto avatar gagliardetto commented on July 17, 2024 3

from solana-go.

yifanes avatar yifanes commented on July 17, 2024

Wow, thank you for replying to me so seriously. Based on your reply, I learned some relevant knowledge points, but I'm sorry I encountered new problems again.

Suppose I have a Solana account. When I want to receive a token transfer, I must first create an associated account. Does that mean that the transferor must do this for the receiver? From the perspective of programming, do I have to judge whether this address is a token address? Then it depends on whether I want to create an associated account or not?

I noticed that Solana cli has a parameter --allow unfunded recipient --fund recipient. If the target address is a token address that has been created, this parameter will be ignored

I look forward to your valuable reply.

from solana-go.

gagliardetto avatar gagliardetto commented on July 17, 2024

I'm no expert on this topic (and you're better off asking/searching that question in the solana documentation, discord, or even better on solana stackoverflow).

The Sollet solana wallet is opensource, and you can see the code implementation of this and other dynamics: https://github.com/project-serum/spl-token-wallet

They are fairly easily portable to solana-go (often).


  • From my limited knowledge on the topic, yes the sender must create the associated-token-account for the recipient if the associated-token-account doesn't exist.
  • What is an "associated token account"? It's an account derived from the owner of the parent wallet (in your case the recipient) and the mint of the token.
  • Something like this: (wallet + mint) => associated_token_account (because it's an inextricably associated token account with the wallet it's for.)
  • Knowing the wallet and the mint, you can find the atok account.
  • Knowing the atok account, you can find the owner wallet and the mint.
  • AFAIK anyone can create an associate token account for anyone else, but the owner is always the wallet it was created for.
  • The --allow unfunded recipient --fund recipient flags (I think) are there because if the atok account doesn't exist, you need to create it. To create an account on solana, you need to fund it with enough SOL so that it can pay rent and won't get deleted (evicted). (or even better, be funded enough so that it becomes rent-exempt so it can exist forever.)

Anyway, you're better off going to look into the documentation and the source code:

from solana-go.

gagliardetto avatar gagliardetto commented on July 17, 2024

You need an atok for storing and transfering for anything that's a token (which means everything, except for SOL).

  • NFTs are tokens.
  • USDC is a token.
  • Your meme coin is a token.
  • Wrapped SOL is a token.

Basically everything is a token (also called "SPL token").

from solana-go.

yifanes avatar yifanes commented on July 17, 2024

Thank you for your serious reply. With your help, I have a new understanding of Solana access transaction. Thank you again

from solana-go.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.