Timeline for Anchor Program unable to sign a transfer with a PDA
Current License: CC BY-SA 4.0
4 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Jan 22 at 22:28 | comment | added | Jonas H. | You can invoke signed, but the system program expects accounts that are owned by the system program, so basically normal wallet addresses. Your PDA is owned by your program so only your program can change it. | |
Jan 22 at 22:27 | comment | added | Gregz | Thank you! After i replaced the invoke_signed() with directly manipulation lamports of the sender and the reciever and modifying the reviever to be a mutable account. #[derive(Accounts)] pub struct SendSol<'info> { #[account(mut)] pub reciever: AccountInfo<'info>, } The transfer worked. But im still very confused why the invoke_signed did not work. According to all the documents online, if i have the seeds for the PDA that is doing the signature. I should be able to invoke_signed. | |
Jan 22 at 22:24 | vote | accept | Gregz | ||
Jan 22 at 22:16 | history | answered | Jonas H. | CC BY-SA 4.0 |