Skip to content

verifier_program: Add shielded_transfer_second method#17

Merged
ananas-block merged 2 commits intomainfrom
michal-verifier-transfer-second-noop
Feb 24, 2023
Merged

verifier_program: Add shielded_transfer_second method#17
ananas-block merged 2 commits intomainfrom
michal-verifier-transfer-second-noop

Conversation

@vadorovsky
Copy link
Contributor

This new method gets the message from the temporary PDA, sends it to noop program and closes the PDA.

@ananas-block
Copy link
Contributor

ananas-block commented Feb 19, 2023

a couple of things:

  • npm test doesn't run pls add verifier_program to light-system-programs/runTest.sh
  • let's rename verifier program to verifier_program_storage to make it more general
  • pls generate a new program id other than the anchor standard id you can use the solana cli: solana-keygen new --outfile ./id.json
    change the program id in anchor etc., to deploy your program to this address place the json id file in target/deploy/verifier_program_storage.json
  • pls store the json file as backup on notion https://www.notion.so/Program-Ids-83ec1218827c47b392365115e0667050

This new method gets the message from the temporary PDA, sends it to
noop program and closes the PDA.
@vadorovsky vadorovsky force-pushed the michal-verifier-transfer-second-noop branch from eb43f0b to e52be26 Compare February 23, 2023 11:19
@vadorovsky
Copy link
Contributor Author

@ananas-block All points are addressed now (with one pending PR #22), PTAL

@ananas-block
Copy link
Contributor

ananas-block commented Feb 24, 2023

in light-system-programs:
npm test does not work because the program name is still verifier_program and the address is still the old one
https://github.com/Lightprotocol/light-protocol-onchain/blob/main/light-system-programs/runTest.sh#L2

@ananas-block
Copy link
Contributor

to catch things like this pls run sh test.sh in the root dir

@ananas-block
Copy link
Contributor

just updated it because I want to merge sth soon then you ld have to rebase again

@ananas-block ananas-block merged commit 9223ad2 into main Feb 24, 2023
@vadorovsky vadorovsky deleted the michal-verifier-transfer-second-noop branch April 24, 2023 11:43
vadorovsky pushed a commit to vadorovsky/light-protocol that referenced this pull request May 1, 2024
…r-transfer-second-noop

verifier_program: Add `shielded_transfer_second` method
ananas-block added a commit that referenced this pull request Feb 6, 2026
Audit issue #17 (CRITICAL): Token::new_zero_copy only sets mint, owner,
and state fields without zeroing amount, delegate, delegated_amount,
is_native, or close_authority. An attacker could pre-set the amount
field via IDL buffer. Zero all 165 base token bytes before initialization.
ananas-block added a commit that referenced this pull request Feb 9, 2026
…2248)

* fix: zero base token bytes before init to prevent IDL buffer attack

Audit issue #17 (CRITICAL): Token::new_zero_copy only sets mint, owner,
and state fields without zeroing amount, delegate, delegated_amount,
is_native, or close_authority. An attacker could pre-set the amount
field via IDL buffer. Zero all 165 base token bytes before initialization.

* fix: fail explicitly when token account data < 165 bytes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants