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

Place VoterWeightRecord and MaxVoterWeightRecord by default address #31

Open
s-medvedev opened this issue Apr 29, 2022 · 0 comments
Open
Assignees

Comments

@s-medvedev
Copy link
Contributor

s-medvedev commented Apr 29, 2022

spl-governance UI SDK expects that VoterWeightRecord and MaxVoterWeightRecord will be located by default address. These addresses calculate like this:

const [maxVoterWeightRecordAddress] = await PublicKey.findProgramAddress(
    [
      Buffer.from('max-voter-weight-record'),
      realm.toBuffer(),
      governingTokenMint.toBuffer(),
    ],
    programId,
  );

const [voterWeightRecordAddress] = await PublicKey.findProgramAddress(
    [
      Buffer.from('voter-weight-record'),
      realm.toBuffer(),
      governingTokenMint.toBuffer(),
      governingTokenOwner.toBuffer(),
    ],
    programId,
  );

┆Issue is synchronized with this Jira Task by Unito

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