-
Notifications
You must be signed in to change notification settings - Fork 1.3k
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Add easy functions for token transfers #2586
Labels
Comments
I think creating a function might work you can try following code :
|
Yeah, this is what I've been doing: example. It would just be nice if we could include this in anchor-spl so I don't need to copypasta into each new repo |
If you haven't already, you can make a new pull request for that, and I'm sure they'll integrate it eventually. |
metaproph3t
added a commit
to metaproph3t/anchor
that referenced
this issue
Aug 10, 2023
I was about to work on a PR to address coral-xyz#2586 and was trying to get my tests set up so that I could test locally. I found it pretty cumbersome to copy all of the commands from the ci files in `.github` (maybe there's a better way? in which case, this isn't necessary), so I threw them in a `justfile` in case it'd be helpful for others.
This was referenced Aug 10, 2023
Closing for now: #2596 (comment) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
When you want to do a token transfer today within Anchor, it looks something like this (sorry for leading spaces):
This is pretty verbose and requires 3 levels of nesting. Not ideal, especially when you compare it with Solidity's
ERC20.transferFrom(from, to, amount)
It would be nice to replace the function with something like this:
The text was updated successfully, but these errors were encountered: