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

How to use beneficiary to find member address? #403

Closed
yuhao-git-star opened this issue Jun 17, 2021 · 2 comments
Closed

How to use beneficiary to find member address? #403

yuhao-git-star opened this issue Jun 17, 2021 · 2 comments

Comments

@yuhao-git-star
Copy link
Contributor

yuhao-git-star commented Jun 17, 2021

Hey, I use and study this example.
I have some trouble, How to use beneficiary to find member address? or any find beneficiary's member address method?

Thank you for your time, Solana is great.

lockup

@armaniferrante
Copy link
Member

armaniferrante commented Jun 17, 2021

Good way that's not implemented

  • use a deterministic program derived address with the beneficiary address as the seed.

Bad way that's implemented:

Use getProgramAccounts with a filter. In anchor you can do this with: program.account.member.all(Buffer.concat([registarar.toBuffer(), beneficiary.toBuffer()]));, where the registrar and beneficiary are public keys.

@armaniferrante
Copy link
Member

Closing since issues are for dev related purposes.

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

No branches or pull requests

2 participants