Bonfida / token-vesting

A Vesting Contract for the Solana Blockchain
https://vesting.bonfida.org/
Other
252 stars 167 forks source link

How to retrieve contract seed for the UI #12

Closed leofisG closed 2 years ago

leofisG commented 3 years ago

I am using the CLI to create vesting schedule, the output that I am seeing is:

RPC URL: "https://api.mainnet-beta.solana.com"
Program ID: CChTq6PthWU82YZkbveA3WDf7s97BWhBK4Vx9bmsT743
Vesting Seed: 8opHzTAnfzRpPEx21XtnrVTX28YQuCpAjcn1PczScQ4
Vesting Account Pubkey: 8bRHuxdPXHt5GiQeAFdqBhXM2Mr1qhyL1YXdHcWEsatF
Vesting Token Account Pubkey: A9DTYXGF9MNiWbcPYveEcKbDunSMNaHkc8SHtG5arZeN
Initialized: true
Mint Address: PoRTjZMPXb9T7dyU7tpLEZRQj7e6ssfAE62j2oQuc6y
Destination Token Address: 7tdfjrtxpJ3Epk1jghX7wCC3yeWnQ6Qy49JDvP5CCSQm

SCHEDULE 0
Release Height: 1
Amount: 2

SCHEDULE 1
Release Height: 28504431
Amount: 1

SCHEDULE 2
Release Height: 2850600000000000
Amount: 3

I wonder how do I go from the vesting seed of 8opHzTAnfzRpPEx21XtnrVTX28YQuCpAjcn1PczScQ4 to a number that is ready to use?

dr497 commented 3 years ago

I don't understand your question, what do you mean by a number that is ready to use?

leofisG commented 3 years ago

In the token vesting UI here: https://vesting.bonfida.org/#/unlock It asks us to input a contract seed, if I enter the vesting seed of 8opHzTAnfzRpPEx21XtnrVTX28YQuCpAjcn1PczScQ4, I can't see the vesting contract (an error saying Error loading contract info). So I am wondering how do I go from 8opHzTAnfzRpPEx21XtnrVTX28YQuCpAjcn1PczScQ4 to the format that is acceptable in the UI?

leofisG commented 3 years ago

@dr497 It will be great if we can use the vesting contract to distribute our tokens. Thanks!

leofisG commented 3 years ago

@dr497 bump.

syedshahzebhasnain commented 2 years ago

bump

dr497 commented 2 years ago

You can inspect vesting contract on the UI by using the key.

If you want to retrieve the seed for the contract use the data of the creation instruction and slice it to get the seed (.slice(1,32) https://github.com/Bonfida/token-vesting/blob/master/program/src/instruction.rs#L139