I'm trying to write a ICO contract with Anchor, and stuck with deposit method, which supposed to transfer SOL from user to protocol treasury, and receives corresponding ico token.
the problem is, I cannot transfer token from protocol to user, since this 'deposit' method is supposed to executed with only user authority, which suppposed to be provided by wallet adapter connected from client side.
I found a suggestion to use a PDA to sign the transaction, but now it throws an owner error, and I'm not sure if this is the right approach.
Am I missing something here?
I'd appreciate any guide or advice on this issue, or if I'm on the right track
Thanks in advance!
Below is the link to the current codebase.