Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Receive and transfer Solana SPL token into smart contract #607

Closed
0xS0l opened this issue Dec 17, 2021 · 8 comments · Fixed by #761
Closed

Receive and transfer Solana SPL token into smart contract #607

0xS0l opened this issue Dec 17, 2021 · 8 comments · Fixed by #761
Labels
enhancement New feature or request

Comments

@0xS0l
Copy link

0xS0l commented Dec 17, 2021

I'm building a smart contract that can receive and send Solana SPL tokens, but I don't see any document mention about that or any example from doing that.

Have Solang supported that yet? If it is, please help me find it out. Thank you.

@0xS0l 0xS0l changed the title Transfer Solana SPL token into smart contract Receive and transfer Solana SPL token into smart contract Dec 17, 2021
@seanyoung seanyoung added the enhancement New feature or request label Dec 17, 2021
@seanyoung
Copy link
Contributor

This is not possible yet. I am working on this

@0xS0l
Copy link
Author

0xS0l commented Dec 18, 2021

Thanks. May I ask the ETA for that feature if you don't mind?

@seanyoung
Copy link
Contributor

I'm drawing up some plans now, there is quite a bit of plumbing involved. I think it should be done by the end of January.

@seanyoung
Copy link
Contributor

seanyoung commented Jan 3, 2022

I think three parts are needed:

  • Implement .writeUint16LE() and friends on bytes so we can encode the spl input
  • Make the accounts accessible so that we can extract the total supply via tx.accounts[] builtin
  • Make it possible to specify the accounts on a call

@DanBokhari98
Copy link

Is this still within your end of January Timeline? Thank you :)

@seanyoung
Copy link
Contributor

@DanBokhari98 some other issues came up with the parser. I'm afraid it will take a little longer.

Having said that, large parts have been implemented now. We need a method for passing in accounts to a CPI call. With that in place, all the spl-token glue code can be written.

Done by the end of Feb, promise :)

@javamr123
Copy link

@DanBokhari98 some other issues came up with the parser. I'm afraid it will take a little longer.

Having said that, large parts have been implemented now. We need a method for passing in accounts to a CPI call. With that in place, all the spl-token glue code can be written.

Done by the end of Feb, promise :)

Has it been completed?

@seanyoung
Copy link
Contributor

Has it been completed?

I am afraid not! 😬 All the new syntax is in place, but there is an issue where the array of accounts that needs to be passed into the CPI call is an array of pointers to structs, not just a plain array of structs. This is some difficult rework, which I've been working on here #685

The spl-token is top priority and I'm not working on anything else.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants