File tree 4 files changed +93
-11
lines changed
4 files changed +93
-11
lines changed Original file line number Diff line number Diff line change @@ -82,6 +82,11 @@ export const VESTING_ADMIN_KEYPAIR = loadKeypair(
82
82
homedir ( ) + VESTING_ADMIN_PATH ,
83
83
) ;
84
84
85
+ export const NEW_VESTING_ADMIN_PATH = "/.config/solana/newVestingAdmin.json" ;
86
+ export const NEW_VESTING_ADMIN_KEYPAIR = loadKeypair (
87
+ homedir ( ) + NEW_VESTING_ADMIN_PATH ,
88
+ ) ;
89
+
85
90
export const USER_AUTHORITY_PATH = "/.config/solana/user.json" ;
86
91
export const USER_AUTHORITY_KEYPAIR = loadKeypair (
87
92
homedir ( ) + USER_AUTHORITY_PATH ,
Original file line number Diff line number Diff line change
1
+ // Usage: npx ts-node app/deploy/devnet/update/claimVestingAdmin.ts
2
+
3
+ import { AnchorProvider , Program , Wallet } from "@coral-xyz/anchor" ;
4
+ import { Connection } from "@solana/web3.js" ;
5
+ import {
6
+ RPC_NODE ,
7
+ NEW_VESTING_ADMIN_KEYPAIR ,
8
+ } from "../constants" ;
9
+ import { Staking } from "../../../../target/types/staking" ;
10
+ import fs from "fs" ;
11
+
12
+ async function main ( ) {
13
+ try {
14
+ const connection = new Connection ( RPC_NODE ) ;
15
+ const provider = new AnchorProvider (
16
+ connection ,
17
+ new Wallet ( NEW_VESTING_ADMIN_KEYPAIR ) ,
18
+ { } ,
19
+ ) ;
20
+
21
+ let program : Program < Staking > ;
22
+ program = new Program (
23
+ JSON . parse ( fs . readFileSync ( "./target/idl/staking.json" ) . toString ( ) ) ,
24
+ provider ,
25
+ ) ;
26
+
27
+ await program . methods
28
+ . claimVestingAdmin ( )
29
+ . accounts ( { newVestingAdmin : NEW_VESTING_ADMIN_KEYPAIR . publicKey } )
30
+ . signers ( [ NEW_VESTING_ADMIN_KEYPAIR ] )
31
+ . rpc ( ) ;
32
+ } catch ( err ) {
33
+ console . error ( "Error:" , err ) ;
34
+ }
35
+ }
36
+
37
+ main ( ) ;
Original file line number Diff line number Diff line change
1
+ // Usage: npx ts-node app/deploy/devnet/update/updateAndClaimVestingAdmin.ts
2
+
3
+ import { AnchorProvider , Program , Wallet } from "@coral-xyz/anchor" ;
4
+ import { Connection } from "@solana/web3.js" ;
5
+ import {
6
+ DEPLOYER_AUTHORITY_KEYPAIR ,
7
+ RPC_NODE ,
8
+ VESTING_ADMIN_KEYPAIR ,
9
+ } from "../constants" ;
10
+ import { Staking } from "../../../../target/types/staking" ;
11
+ import fs from "fs" ;
12
+
13
+ async function main ( ) {
14
+ try {
15
+ const connection = new Connection ( RPC_NODE ) ;
16
+ const provider = new AnchorProvider (
17
+ connection ,
18
+ new Wallet ( DEPLOYER_AUTHORITY_KEYPAIR ) ,
19
+ { } ,
20
+ ) ;
21
+
22
+ let program : Program < Staking > ;
23
+ program = new Program (
24
+ JSON . parse ( fs . readFileSync ( "./target/idl/staking.json" ) . toString ( ) ) ,
25
+ provider ,
26
+ ) ;
27
+
28
+ await program . methods
29
+ . updateVestingAdmin ( )
30
+ . accounts ( { newVestingAdmin : VESTING_ADMIN_KEYPAIR . publicKey } )
31
+ . rpc ( ) ;
32
+
33
+ await program . methods
34
+ . claimVestingAdmin ( )
35
+ . accounts ( { newVestingAdmin : VESTING_ADMIN_KEYPAIR . publicKey } )
36
+ . signers ( [ VESTING_ADMIN_KEYPAIR ] )
37
+ . rpc ( ) ;
38
+ } catch ( err ) {
39
+ console . error ( "Error:" , err ) ;
40
+ }
41
+ }
42
+
43
+ main ( ) ;
Original file line number Diff line number Diff line change 1
1
// Usage: npx ts-node app/deploy/devnet/update/updateVestingAdmin.ts
2
2
3
3
import { AnchorProvider , Program , Wallet } from "@coral-xyz/anchor" ;
4
- import { Connection } from "@solana/web3.js" ;
4
+ import { Connection , PublicKey } from "@solana/web3.js" ;
5
5
import {
6
- DEPLOYER_AUTHORITY_KEYPAIR ,
7
- RPC_NODE ,
8
6
VESTING_ADMIN_KEYPAIR ,
7
+ RPC_NODE ,
9
8
} from "../constants" ;
10
9
import { Staking } from "../../../../target/types/staking" ;
11
10
import fs from "fs" ;
@@ -15,7 +14,7 @@ async function main() {
15
14
const connection = new Connection ( RPC_NODE ) ;
16
15
const provider = new AnchorProvider (
17
16
connection ,
18
- new Wallet ( DEPLOYER_AUTHORITY_KEYPAIR ) ,
17
+ new Wallet ( VESTING_ADMIN_KEYPAIR ) ,
19
18
{ } ,
20
19
) ;
21
20
@@ -25,15 +24,13 @@ async function main() {
25
24
provider ,
26
25
) ;
27
26
28
- await program . methods
29
- . updateVestingAdmin ( )
30
- . accounts ( { newVestingAdmin : VESTING_ADMIN_KEYPAIR . publicKey } )
31
- . rpc ( ) ;
27
+ const NEW_VESTING_ADMIN_ADDRESS = new PublicKey (
28
+ "E1R3XdHgEYmsoLdZSQmhWrcD979bn5qK1bzr7pqMn2UQ" ,
29
+ ) ;
32
30
33
31
await program . methods
34
- . claimVestingAdmin ( )
35
- . accounts ( { newVestingAdmin : VESTING_ADMIN_KEYPAIR . publicKey } )
36
- . signers ( [ VESTING_ADMIN_KEYPAIR ] )
32
+ . updateVestingAdmin ( )
33
+ . accounts ( { newVestingAdmin : NEW_VESTING_ADMIN_ADDRESS } )
37
34
. rpc ( ) ;
38
35
} catch ( err ) {
39
36
console . error ( "Error:" , err ) ;
You can’t perform that action at this time.
0 commit comments