Allow Optional Accounts in Anchor Programs #2090
anoushk1234
started this conversation in
Ideas
Replies: 4 comments 4 replies
-
Much needed. The current way to circumvent this limitation AFAIK is to use remaining_accounts along with manual security checks. |
Beta Was this translation helpful? Give feedback.
0 replies
-
I'm currently working on this! |
Beta Was this translation helpful? Give feedback.
0 replies
-
#2094 here's the draft PR |
Beta Was this translation helpful? Give feedback.
0 replies
-
Has there been a followup on this? |
Beta Was this translation helpful? Give feedback.
4 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Let's say I have a mint instruction in my program and I allow paying for the mint using native tokens and custom tokens I have two options:
A more elegant and efficient solution would be to allow Optional accounts in the accounts struct using
Option<>
❌Current Scenario
✅ Improved scenario
Currently if you wrap accounts with Option this error pops up
Beta Was this translation helpful? Give feedback.
All reactions