From 93269fe6dbe180dc8e92971823e128c9c0a8ca8a Mon Sep 17 00:00:00 2001 From: guibescos <59208140+guibescos@users.noreply.github.com> Date: Fri, 13 Oct 2023 18:05:03 +0200 Subject: [PATCH] Update constants (#244) * Update constants * Prettier * Add realm address * Revert to 0.3.26 --- frontend/README.md | 2 +- package-lock.json | 114 +++++++--------------- staking/Anchor.toml | 12 +-- staking/app/constants.ts | 14 +-- staking/app/deploy/1_create_realm.ts | 14 ++- staking/app/deploy/2_create_governance.ts | 4 +- staking/app/deploy/3_init_staking.ts | 9 +- staking/app/deploy/devnet.ts | 2 - staking/app/deploy/mainnet_beta.ts | 4 +- staking/package.json | 2 +- staking/programs/staking/src/lib.rs | 4 +- staking/tests/utils/before.ts | 4 +- 12 files changed, 62 insertions(+), 123 deletions(-) diff --git a/frontend/README.md b/frontend/README.md index 563966a4..ccb6df2c 100644 --- a/frontend/README.md +++ b/frontend/README.md @@ -27,7 +27,7 @@ npm run localnet ``` This command spawns a validator at `http://localhost:8899` with the staking program deployed in the genesis block at the address : -`sta99txADjRfwHQQMNckb8vUN4jcAAhN2HBMTR2Ah6d` +`pytS9TjG1qyAZypk7n8rw8gfW9sUaqqYyMhJQ4E7JCQ` Additionally it will : diff --git a/package-lock.json b/package-lock.json index 438171f6..13b4ce3b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -6228,35 +6228,6 @@ "ieee754": "^1.2.1" } }, - "node_modules/@solana/spl-governance": { - "version": "0.3.15", - "resolved": "https://registry.npmjs.org/@solana/spl-governance/-/spl-governance-0.3.15.tgz", - "integrity": "sha512-VSrzmIXGq5hlCm1JHFCIJGJ2fujqH3GVstyDNTvquxMZioWckmDO5Q/X9oSDft7sziY12tkOW9FDA3Z5m45hBg==", - "dependencies": { - "@solana/web3.js": "^1.22.0", - "bignumber.js": "^9.0.1", - "bn.js": "^5.1.3", - "borsh": "^0.3.1", - "bs58": "^4.0.1", - "superstruct": "^0.15.2" - } - }, - "node_modules/@solana/spl-governance/node_modules/base-x": { - "version": "3.0.9", - "resolved": "https://registry.npmjs.org/base-x/-/base-x-3.0.9.tgz", - "integrity": "sha512-H7JU6iBHTal1gp56aKoaa//YUxEaAOUiydvrV/pILqIHXTtqxSkATOnDA2u+jZ/61sD+L/412+7kzXRtWukhpQ==", - "dependencies": { - "safe-buffer": "^5.0.1" - } - }, - "node_modules/@solana/spl-governance/node_modules/bs58": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/bs58/-/bs58-4.0.1.tgz", - "integrity": "sha512-Ok3Wdf5vOIlBrgCvTq96gBkJw+JUEzdBgyaza5HLtPm7yTHkjRy8+JzNyHF7BHa0bNWOQIp3m5YF0nnFcOIKLw==", - "dependencies": { - "base-x": "^3.0.2" - } - }, "node_modules/@solana/spl-token": { "version": "0.1.8", "resolved": "https://registry.npmjs.org/@solana/spl-token/-/spl-token-0.1.8.tgz", @@ -9253,8 +9224,7 @@ "node_modules/asynckit": { "version": "0.4.0", "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", - "integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==", - "dev": true + "integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==" }, "node_modules/atomic-sleep": { "version": "1.0.0", @@ -9325,7 +9295,6 @@ "version": "1.5.0", "resolved": "https://registry.npmjs.org/axios/-/axios-1.5.0.tgz", "integrity": "sha512-D4DdjDo5CY50Qms0qGQTTw6Q44jl7zRwY7bthds06pUGfChBCTcQs+N743eFWGEd6pRTMd6A+I87aWyFV5wiZQ==", - "dev": true, "dependencies": { "follow-redirects": "^1.15.0", "form-data": "^4.0.0", @@ -10571,7 +10540,6 @@ "version": "1.0.8", "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==", - "dev": true, "dependencies": { "delayed-stream": "~1.0.0" }, @@ -11249,7 +11217,6 @@ "version": "1.0.0", "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", "integrity": "sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==", - "dev": true, "engines": { "node": ">=0.4.0" } @@ -12317,7 +12284,6 @@ "version": "4.0.0", "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.0.tgz", "integrity": "sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww==", - "dev": true, "dependencies": { "asynckit": "^0.4.0", "combined-stream": "^1.0.8", @@ -18331,8 +18297,7 @@ "node_modules/proxy-from-env": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/proxy-from-env/-/proxy-from-env-1.1.0.tgz", - "integrity": "sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg==", - "dev": true + "integrity": "sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg==" }, "node_modules/public-encrypt": { "version": "4.0.3", @@ -22251,7 +22216,7 @@ "license": "MIT", "dependencies": { "@project-serum/anchor": "0.24.2", - "@solana/spl-governance": "0.3.15", + "@solana/spl-governance": "0.3.26", "@solana/spl-token": "^0.1.8", "@solana/web3.js": "^1.36.0", "encoding": "^0.1.13", @@ -22298,6 +22263,20 @@ "node": ">=11" } }, + "staking/node_modules/@solana/spl-governance": { + "version": "0.3.26", + "resolved": "https://registry.npmjs.org/@solana/spl-governance/-/spl-governance-0.3.26.tgz", + "integrity": "sha512-L84AWKcAmEMIWhh5gcfasfDesOMT+IU4i+s0ELgKCN0O9MC/hVrSjTkn68vBhDfCElnJyJTFMAN7NqSbrweD9A==", + "dependencies": { + "@solana/web3.js": "^1.22.0", + "axios": "^1.1.3", + "bignumber.js": "^9.0.1", + "bn.js": "^5.1.3", + "borsh": "^0.3.1", + "bs58": "^4.0.1", + "superstruct": "^0.15.2" + } + }, "staking/node_modules/@types/node": { "version": "17.0.45", "resolved": "https://registry.npmjs.org/@types/node/-/node-17.0.45.tgz", @@ -26751,37 +26730,6 @@ "bignumber.js": "^9.0.1" } }, - "@solana/spl-governance": { - "version": "0.3.15", - "resolved": "https://registry.npmjs.org/@solana/spl-governance/-/spl-governance-0.3.15.tgz", - "integrity": "sha512-VSrzmIXGq5hlCm1JHFCIJGJ2fujqH3GVstyDNTvquxMZioWckmDO5Q/X9oSDft7sziY12tkOW9FDA3Z5m45hBg==", - "requires": { - "@solana/web3.js": "^1.22.0", - "bignumber.js": "^9.0.1", - "bn.js": "^5.1.3", - "borsh": "^0.3.1", - "bs58": "^4.0.1", - "superstruct": "^0.15.2" - }, - "dependencies": { - "base-x": { - "version": "3.0.9", - "resolved": "https://registry.npmjs.org/base-x/-/base-x-3.0.9.tgz", - "integrity": "sha512-H7JU6iBHTal1gp56aKoaa//YUxEaAOUiydvrV/pILqIHXTtqxSkATOnDA2u+jZ/61sD+L/412+7kzXRtWukhpQ==", - "requires": { - "safe-buffer": "^5.0.1" - } - }, - "bs58": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/bs58/-/bs58-4.0.1.tgz", - "integrity": "sha512-Ok3Wdf5vOIlBrgCvTq96gBkJw+JUEzdBgyaza5HLtPm7yTHkjRy8+JzNyHF7BHa0bNWOQIp3m5YF0nnFcOIKLw==", - "requires": { - "base-x": "^3.0.2" - } - } - } - }, "@solana/spl-token": { "version": "0.1.8", "resolved": "https://registry.npmjs.org/@solana/spl-token/-/spl-token-0.1.8.tgz", @@ -29171,8 +29119,7 @@ "asynckit": { "version": "0.4.0", "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", - "integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==", - "dev": true + "integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==" }, "atomic-sleep": { "version": "1.0.0", @@ -29207,7 +29154,6 @@ "version": "1.5.0", "resolved": "https://registry.npmjs.org/axios/-/axios-1.5.0.tgz", "integrity": "sha512-D4DdjDo5CY50Qms0qGQTTw6Q44jl7zRwY7bthds06pUGfChBCTcQs+N743eFWGEd6pRTMd6A+I87aWyFV5wiZQ==", - "dev": true, "requires": { "follow-redirects": "^1.15.0", "form-data": "^4.0.0", @@ -30162,7 +30108,6 @@ "version": "1.0.8", "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==", - "dev": true, "requires": { "delayed-stream": "~1.0.0" } @@ -30696,8 +30641,7 @@ "delayed-stream": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", - "integrity": "sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==", - "dev": true + "integrity": "sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==" }, "delegates": { "version": "1.0.0", @@ -31553,7 +31497,6 @@ "version": "4.0.0", "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.0.tgz", "integrity": "sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww==", - "dev": true, "requires": { "asynckit": "^0.4.0", "combined-stream": "^1.0.8", @@ -36161,8 +36104,7 @@ "proxy-from-env": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/proxy-from-env/-/proxy-from-env-1.1.0.tgz", - "integrity": "sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg==", - "dev": true + "integrity": "sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg==" }, "public-encrypt": { "version": "4.0.3", @@ -36204,7 +36146,7 @@ "@metaplex-foundation/js": "^0.17.5", "@metaplex-foundation/mpl-token-metadata": "^2.5.1", "@project-serum/anchor": "0.24.2", - "@solana/spl-governance": "0.3.15", + "@solana/spl-governance": "0.3.26", "@solana/spl-token": "^0.1.8", "@solana/web3.js": "^1.36.0", "@types/bn.js": "^5.1.0", @@ -36244,6 +36186,20 @@ "toml": "^3.0.0" } }, + "@solana/spl-governance": { + "version": "0.3.26", + "resolved": "https://registry.npmjs.org/@solana/spl-governance/-/spl-governance-0.3.26.tgz", + "integrity": "sha512-L84AWKcAmEMIWhh5gcfasfDesOMT+IU4i+s0ELgKCN0O9MC/hVrSjTkn68vBhDfCElnJyJTFMAN7NqSbrweD9A==", + "requires": { + "@solana/web3.js": "^1.22.0", + "axios": "^1.1.3", + "bignumber.js": "^9.0.1", + "bn.js": "^5.1.3", + "borsh": "^0.3.1", + "bs58": "^4.0.1", + "superstruct": "^0.15.2" + } + }, "@types/node": { "version": "17.0.45", "resolved": "https://registry.npmjs.org/@types/node/-/node-17.0.45.tgz", diff --git a/staking/Anchor.toml b/staking/Anchor.toml index 22052dd0..c5823ef2 100644 --- a/staking/Anchor.toml +++ b/staking/Anchor.toml @@ -7,17 +7,17 @@ seeds = true members = ["programs/staking"] [programs.localnet] -staking = "sta99txADjRfwHQQMNckb8vUN4jcAAhN2HBMTR2Ah6d" -governance = "GovFUVGZWWwyoLq8rhnoVWknRFkhDSbQiSoREJ5LiZCV" +staking = "pytS9TjG1qyAZypk7n8rw8gfW9sUaqqYyMhJQ4E7JCQ" +governance = "pytGY6tWRgGinSCvRLnSv4fHfBTMoiDGiCsesmHWM6U" chat = "gCHAtYKrUUktTVzE4hEnZdLV4LXrdBf6Hh9qMaJALET" [programs.devnet] -staking = "sta99txADjRfwHQQMNckb8vUN4jcAAhN2HBMTR2Ah6d" -governance = "GovFUVGZWWwyoLq8rhnoVWknRFkhDSbQiSoREJ5LiZCV" +staking = "pytS9TjG1qyAZypk7n8rw8gfW9sUaqqYyMhJQ4E7JCQ" +governance = "pytGY6tWRgGinSCvRLnSv4fHfBTMoiDGiCsesmHWM6U" [programs.mainnet] -staking = "sta99txADjRfwHQQMNckb8vUN4jcAAhN2HBMTR2Ah6d" -governance = "GovFUVGZWWwyoLq8rhnoVWknRFkhDSbQiSoREJ5LiZCV" +staking = "pytS9TjG1qyAZypk7n8rw8gfW9sUaqqYyMhJQ4E7JCQ" +governance = "pytGY6tWRgGinSCvRLnSv4fHfBTMoiDGiCsesmHWM6U" [registry] url = "https://anchor.projectserum.com" diff --git a/staking/app/constants.ts b/staking/app/constants.ts index c74e3d80..bcec724d 100644 --- a/staking/app/constants.ts +++ b/staking/app/constants.ts @@ -1,24 +1,16 @@ import { PublicKey } from "@solana/web3.js"; import { wasm } from "./StakeConnection"; -export const MAINNET_ENDPOINT = "https://api.mainnet-beta.solana.com"; -export const DEVNET_ENDPOINT = "https://api.devnet.solana.com"; - export function GOVERNANCE_ADDRESS() { return new PublicKey(wasm.Constants.GOVERNANCE_PROGRAM()); } export const STAKING_ADDRESS = new PublicKey( - "sta99txADjRfwHQQMNckb8vUN4jcAAhN2HBMTR2Ah6d" + "pytS9TjG1qyAZypk7n8rw8gfW9sUaqqYyMhJQ4E7JCQ" ); export const REALM_ID = new PublicKey( - "A1f6LNEymJSSJsEVCL1FSgtS1jA9dNTC4ni8SkmbwQjG" + "4ct8XU5tKbMNRphWy4rePsS9kBqPhDdvZoGpmprPaug4" ); -export const MAINNET_PYTH_MINT = new PublicKey( - "3ho8ZM4JVqJzD56FADKdW7NTG5Tv6GiBPFUvyRXMy35Q" -); -export const DEVNET_PYTH_MINT = new PublicKey( - "7Bd6bEH4wHTMmov8D2WTXgxzLJcxJYczqE5NaDtZdhF6" -); +export const EPOCH_DURATION = 3600 * 24 * 7; diff --git a/staking/app/deploy/1_create_realm.ts b/staking/app/deploy/1_create_realm.ts index 4c60b2a1..3a2710cf 100644 --- a/staking/app/deploy/1_create_realm.ts +++ b/staking/app/deploy/1_create_realm.ts @@ -1,19 +1,17 @@ import { GoverningTokenType, MintMaxVoteWeightSource, - PROGRAM_VERSION_V2, + PROGRAM_VERSION, withCreateRealm, } from "@solana/spl-governance"; import { Transaction, Connection } from "@solana/web3.js"; import { BN } from "bn.js"; -import { AUTHORITY_KEYPAIR, PYTH_TOKEN, RPC_NODE } from "./mainnet_beta"; - +import { AUTHORITY_KEYPAIR, PYTH_TOKEN, RPC_NODE } from "./devnet"; import { STAKING_ADDRESS, GOVERNANCE_ADDRESS } from "../constants"; -import { Constants } from "pyth-staking-wasm"; // Actual transaction hash : // mainnet-beta : 3es1jwFLTwMBSSyVyRJ6kcJK9MmYgoJxBqBLVv6D8iKYJ1Jj2jQ9UA24ZDnJ1jqU3BVvLGMifgaGdhnhsturdtTF -// devnet : NjowaS5ApGYkGr19ge2ikQnggJJ4x8DyMcQu3pyzPPyJJ7orL3CY8FJToAMcupP8uCKh288fpBBEH6yPbqQDjiA +// devnet (10/12/23): ZoyuaKQbahuWcUkbvY4R5Cn8do8Ra1sjdKKHNQ3oVeorcn5xU7fz5uGKDAHAazD792LNytkeJz4cUu7eun8hrHr async function main() { const tx = new Transaction(); @@ -21,7 +19,7 @@ async function main() { await withCreateRealm( tx.instructions, GOVERNANCE_ADDRESS(), // Address of the governance program - PROGRAM_VERSION_V2, // Version of the on-chain governance program + PROGRAM_VERSION, // Version of the on-chain governance program "Pyth Governance", // `name` of the realm AUTHORITY_KEYPAIR.publicKey, // Address of the realm authority PYTH_TOKEN, // Address of the Pyth token @@ -29,12 +27,12 @@ async function main() { undefined, // No council mint MintMaxVoteWeightSource.FULL_SUPPLY_FRACTION, // Irrelevant because we use the max voter weight plugin new BN( - Constants.MAX_VOTER_WEIGHT().toString() // Create governance requires realm authority + "18446744073709551615" // u64::MAX ), { voterWeightAddin: STAKING_ADDRESS, // Voter weight plugin maxVoterWeightAddin: STAKING_ADDRESS, // Max voter weight plugin - tokenType: GoverningTokenType.Liquid, // Liquid token + tokenType: GoverningTokenType.Dormant, // Users should never deposit tokens but instead use the staking program }, undefined // No council mint ); diff --git a/staking/app/deploy/2_create_governance.ts b/staking/app/deploy/2_create_governance.ts index ef2f88b2..01541c80 100644 --- a/staking/app/deploy/2_create_governance.ts +++ b/staking/app/deploy/2_create_governance.ts @@ -9,9 +9,9 @@ import { import { Transaction, Connection, PublicKey } from "@solana/web3.js"; import { BN } from "bn.js"; import { Constants } from "pyth-staking-wasm"; -import { EPOCH_DURATION, AUTHORITY_KEYPAIR, RPC_NODE } from "./mainnet_beta"; +import { AUTHORITY_KEYPAIR, RPC_NODE } from "./mainnet_beta"; -import { GOVERNANCE_ADDRESS, REALM_ID } from "../constants"; +import { GOVERNANCE_ADDRESS, REALM_ID, EPOCH_DURATION } from "../constants"; // Actual transaction hash : // mainnet-beta : vjUE28suh1yt42aRtsj8mwYpz4zM17WQo4ujfXCDGQ5WK1z5G2JATYvEduh1vdMt2pT9auVLJnoCQMtiyEP3aYC // devnet : 3gKKKPGAfV15yV1Ce6Tn9vmwbeRnMHcyrvDxDpPhHAEr6L8VAe4N3rkNizhLGa7cM19xQaJykt6rxjx651fFRqXM diff --git a/staking/app/deploy/3_init_staking.ts b/staking/app/deploy/3_init_staking.ts index b5001c18..aa5b34f5 100644 --- a/staking/app/deploy/3_init_staking.ts +++ b/staking/app/deploy/3_init_staking.ts @@ -1,14 +1,9 @@ import { Wallet, AnchorProvider, Program } from "@project-serum/anchor"; import { Connection } from "@solana/web3.js"; import { getTargetAccount } from "../../tests/utils/utils"; -import { - AUTHORITY_KEYPAIR, - PYTH_TOKEN, - RPC_NODE, - EPOCH_DURATION, -} from "./mainnet_beta"; +import { AUTHORITY_KEYPAIR, PYTH_TOKEN, RPC_NODE } from "./devnet"; import { BN } from "bn.js"; -import { STAKING_ADDRESS, REALM_ID } from "../constants"; +import { STAKING_ADDRESS, REALM_ID, EPOCH_DURATION } from "../constants"; // Actual transaction hash : // mainnet-beta : KrWZD8gbH6Afg6suwHrmUi1xDo25rLDqqMAoAdunXmtUmuVk5HZgQvDqxFHC2uidL6TfXSmwKdQnkbnbZc8BZam diff --git a/staking/app/deploy/devnet.ts b/staking/app/deploy/devnet.ts index bdd0fb68..6482e4cf 100644 --- a/staking/app/deploy/devnet.ts +++ b/staking/app/deploy/devnet.ts @@ -13,5 +13,3 @@ export const PYTH_TOKEN = new PublicKey( ); export const RPC_NODE = "https://api.devnet.solana.com"; - -export const EPOCH_DURATION = 3600; diff --git a/staking/app/deploy/mainnet_beta.ts b/staking/app/deploy/mainnet_beta.ts index add1a740..51f02c82 100644 --- a/staking/app/deploy/mainnet_beta.ts +++ b/staking/app/deploy/mainnet_beta.ts @@ -9,9 +9,7 @@ export const MULTISIG_AUTHORITY = new PublicKey( ); export const PYTH_TOKEN = new PublicKey( - "3ho8ZM4JVqJzD56FADKdW7NTG5Tv6GiBPFUvyRXMy35Q" + "HZ1JovNiVvGrGNiiYvEozEVgZ58xaU3RKwX8eACQBCt3" ); export const RPC_NODE = "https://api.mainnet-beta.solana.com"; - -export const EPOCH_DURATION = 3600 * 24 * 7; diff --git a/staking/package.json b/staking/package.json index 90ebe435..a18d30b6 100644 --- a/staking/package.json +++ b/staking/package.json @@ -7,7 +7,7 @@ "license": "MIT", "dependencies": { "@project-serum/anchor": "0.24.2", - "@solana/spl-governance": "0.3.15", + "@solana/spl-governance": "0.3.26", "@solana/spl-token": "^0.1.8", "@solana/web3.js": "^1.36.0", "encoding": "^0.1.13", diff --git a/staking/programs/staking/src/lib.rs b/staking/programs/staking/src/lib.rs index 6e178f1e..5980386a 100644 --- a/staking/programs/staking/src/lib.rs +++ b/staking/programs/staking/src/lib.rs @@ -50,8 +50,8 @@ mod utils; #[cfg(feature = "wasm")] pub mod wasm; -declare_id!("sta99txADjRfwHQQMNckb8vUN4jcAAhN2HBMTR2Ah6d"); -pub const GOVERNANCE_PROGRAM: Pubkey = pubkey!("GovFUVGZWWwyoLq8rhnoVWknRFkhDSbQiSoREJ5LiZCV"); +declare_id!("pytS9TjG1qyAZypk7n8rw8gfW9sUaqqYyMhJQ4E7JCQ"); +pub const GOVERNANCE_PROGRAM: Pubkey = pubkey!("pytGY6tWRgGinSCvRLnSv4fHfBTMoiDGiCsesmHWM6U"); #[program] diff --git a/staking/tests/utils/before.ts b/staking/tests/utils/before.ts index 8476d1f0..5eac8de7 100644 --- a/staking/tests/utils/before.ts +++ b/staking/tests/utils/before.ts @@ -371,7 +371,7 @@ export async function withCreateDefaultGovernance( }), minCommunityTokensToCreateProposal: PythBalance.fromNumber(200).toBN(), minInstructionHoldUpTime: 1, - maxVotingTime: maxVotingTime, + baseVotingTime: maxVotingTime, minCouncilTokensToCreateProposal: new BN(1), councilVoteThreshold: new VoteThreshold({ type: VoteThresholdType.YesVotePercentage, @@ -386,6 +386,8 @@ export async function withCreateDefaultGovernance( value: 0, }), councilVoteTipping: VoteTipping.Strict, + votingCoolOffTime: 0, + depositExemptProposalCount: 255, }); const governance = await withCreateGovernance( tx.instructions,