You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
For the longest time, we were unable to derive a PDA. Fix the derivation logic to correctly derive a PDA.
Tasks
invoke these surrogate functions to derive a PDA:
in the Rust contract use Pubkey::create_program_address()?
in the TypeScript client use PublicKey.findProgramAddress()
hard code PDA seeds in both Rust and Typescript files (seeds must match up!)
the TypeScript client passes some program instruction, and the program instructions contain a ProgramId. That ProgramId is the address of the Rust smart contract (program) after being deployed to devnet. So, you must first deploy the Rust contract, secondly you must fetch the deployed ProgramId, and lastly you'll pass that ProgramId to the .ts client
the signer of the call to the TypeScript client, will be the signer of the blockchain transaction to derive the PDA, who will also be the funding account sponsoring the PDA derivation
whenever you derive a PDA, consol.log these 3 pieces of info, which you'll need to interact with the PDA later on:
PDA public key
PDA seeds
PDA bump
The text was updated successfully, but these errors were encountered:
Description
For the longest time, we were unable to derive a PDA. Fix the derivation logic to correctly derive a PDA.
Tasks
Pubkey::create_program_address()?
PublicKey.findProgramAddress()
The text was updated successfully, but these errors were encountered: