Skip to content

Commit

Permalink
Add finalizeProposal script
Browse files Browse the repository at this point in the history
  • Loading branch information
metaproph3t committed Feb 10, 2024
1 parent ae2d2fe commit 882bc3c
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions scripts/finalizeProposal.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import { autocratProgram, finalizeProposal } from "./main";
import * as anchor from "@coral-xyz/anchor";
import { MEMO_PROGRAM_ID } from "@solana/spl-memo";

const { PublicKey, Keypair, SystemProgram } = anchor.web3;
const { BN, Program } = anchor;

const PROPOSAL_NUMBER = 3;

async function main() {
const proposals = await autocratProgram.account.proposal.all();
const proposal = proposals.find((proposal) => proposal.account.number == PROPOSAL_NUMBER);

await finalizeProposal(proposal.publicKey);
}

main();

0 comments on commit 882bc3c

Please sign in to comment.