Skip to main content
added 465 characters in body
Source Link

I want to build a counter program using anchor where each transactions increment the count of the specific usertransfer-hooks that does thecreates(or get) a PDA when a user makes a transaction rather thanusing the signer public key as a global oneseed.

Seems transfer-hooks only let'sI'm using this code as a template : https://github.com/0ximalice/spl-token-2022-transfer-hook-anchor/blob/main/programs/transferhook/src/lib.rs

Issue is that you work with static derivedhave to hardcode the accounts and add them to your list of extra_accounts_meta. Is it

I'm unsure it's possible to achieve it using, so I am asking if there is work around that lets the signer ofdynamically add the transactioncorrect accounts needed for the transfer?

There is a small section mentioning it (I think) here, but I have trouble understanding it : https://github.com/solana-labs/solana-program-library/blob/master/libraries/tlv-account-resolution/README.md#types-of-required-accounts

I want to build a counter program using anchor where each transactions increment the count of the specific user that does the transaction rather than a global one.

Seems transfer-hooks only let's you work with static derived accounts. Is it possible to achieve it using the signer of the transaction?

I want to build a program using transfer-hooks that creates(or get) a PDA when a user makes a transaction using the signer public key as a seed.

I'm using this code as a template : https://github.com/0ximalice/spl-token-2022-transfer-hook-anchor/blob/main/programs/transferhook/src/lib.rs

Issue is that you have to hardcode the accounts and add them to your list of extra_accounts_meta.

I'm unsure it's possible, so I am asking if there is work around that lets the dynamically add the correct accounts needed for the transfer?

There is a small section mentioning it (I think) here, but I have trouble understanding it : https://github.com/solana-labs/solana-program-library/blob/master/libraries/tlv-account-resolution/README.md#types-of-required-accounts

added 66 characters in body
Source Link

I want to build a counter program using anchor where each transactions increment the count of the specific user that does the transaction rather than a global one.

Seems transfer-hooks only let's you work with static derived accounts. Is it possible to achieve it using the signer of the transaction?

I want to build a counter program using anchor where each transactions increment the count of the specific user that does the transaction rather than a global one.

Seems transfer-hooks only let's you work with static derived accounts.

I want to build a counter program using anchor where each transactions increment the count of the specific user that does the transaction rather than a global one.

Seems transfer-hooks only let's you work with static derived accounts. Is it possible to achieve it using the signer of the transaction?

Source Link

Dynamically use PDA with transfer-hooks

I want to build a counter program using anchor where each transactions increment the count of the specific user that does the transaction rather than a global one.

Seems transfer-hooks only let's you work with static derived accounts.