From d6ed787fb0c01b56b80df11813338d793ff823db Mon Sep 17 00:00:00 2001 From: Noah Prince <83885631+ChewingGlass@users.noreply.github.com> Date: Tue, 5 Dec 2023 09:54:26 -0600 Subject: [PATCH] Add MOBILE proposals (#92) --- .github/workflows/create-proposals.yaml | 11 ++++++++++- mobile-proposals.json | 20 ++++++++++++++++++++ scripts/bootstrap.ts | 20 ++++++++++---------- 3 files changed, 40 insertions(+), 11 deletions(-) create mode 100644 mobile-proposals.json diff --git a/.github/workflows/create-proposals.yaml b/.github/workflows/create-proposals.yaml index 8b93d70..7c80e58 100644 --- a/.github/workflows/create-proposals.yaml +++ b/.github/workflows/create-proposals.yaml @@ -43,4 +43,13 @@ jobs: --file ./helium-proposals.json \ --wallet ./deploy-keypair.json \ --orgName Helium \ - --multisig ${{ secrets.MULTISIG }} \ No newline at end of file + --multisig ${{ secrets.MULTISIG }} + + - name: Run Bulk Create Mobile Proposals + run: | + ./node_modules/.bin/ts-node ./bin/helium-vote.ts bulk-create-proposal \ + -u "https://solana-rpc.web.helium.io?session-key=Pluto" \ + --file ./mobile-proposals.json \ + --wallet ./deploy-keypair.json \ + --orgName "Helium MOBILE" \ + --multisig ${{ secrets.MULTISIG }} diff --git a/mobile-proposals.json b/mobile-proposals.json new file mode 100644 index 0000000..11d5f99 --- /dev/null +++ b/mobile-proposals.json @@ -0,0 +1,20 @@ +[ + { + "name": "MOBILE Working Group (Even Class) Elections - Q4 2023", + "uri": "https://gist.githubusercontent.com/hiptron/036867431eb2153a52babe30fb5dbdf3/raw/ebbe80bc2d992e5d9c64530391523683c67c8c0e/2023Q4__MOBILE__00__Summary.md", + "maxChoicesPerVoter": 5, + "tags": ["working-group"], + "choices": [ + { "uri": null, "name": "Heated Lime" }, + { "uri": null, "name": "Keith Rettig" }, + { "uri": null, "name": "Max Gold" }, + { "uri": null, "name": "Kennyy" }, + { "uri": null, "name": "cheflifeworld" }, + { "uri": null, "name": "Erfanjhan" }, + { "uri": null, "name": "Unikt39" }, + { "uri": null, "name": "Brainstormer" }, + { "uri": null, "name": "KΞ7IN" }, + { "uri": null, "name": "greenz" } + ] + } +] diff --git a/scripts/bootstrap.ts b/scripts/bootstrap.ts index 18c6b36..15116f7 100644 --- a/scripts/bootstrap.ts +++ b/scripts/bootstrap.ts @@ -48,22 +48,22 @@ export async function run(args: any = process.argv) { describe: "Authority index for squads. Defaults to 1", default: 1, }, + threshold: { + type: "number", + default: "10000000000000000", + }, }); const argv = await yarg.argv; process.env.ANCHOR_WALLET = argv.wallet; process.env.ANCHOR_PROVIDER_URL = argv.url; anchor.setProvider(anchor.AnchorProvider.local(argv.url)); - const registrarK = registrarKey( - PublicKey.findProgramAddressSync( - [ - Buffer.from("governance", "utf-8"), - Buffer.from(argv.realmName, "utf-8"), - ], - new PublicKey("hgovkRU6Ghe1Qoyb54HdSLdqN7VtxaifBzRmh9jtd3S") - )[0], - new PublicKey(argv.mint) + const realmKey = PublicKey.findProgramAddressSync( + [Buffer.from("governance", "utf-8"), Buffer.from(argv.realmName, "utf-8")], + new PublicKey("hgovkRU6Ghe1Qoyb54HdSLdqN7VtxaifBzRmh9jtd3S") )[0]; + console.log("Realm is", realmKey.toBase58()) + const registrarK = registrarKey(realmKey, new PublicKey(argv.mint))[0]; const provider = anchor.getProvider() as anchor.AnchorProvider; const walletKP = loadKeypair(argv.wallet); const wallet = new anchor.Wallet(walletKP); @@ -79,7 +79,7 @@ export async function run(args: any = process.argv) { settings().and( settings().choicePercentage(67), // 100,000,000 veHNT - settings().choiceVoteWeight(new anchor.BN("10000000000000000")) + settings().choiceVoteWeight(new anchor.BN(argv.threshold)) ) ), settings().offsetFromStartTs(new anchor.BN(60 * 60 * 24 * 7))