1
- #[ cfg( not( target_os = "solana" ) ) ]
2
- use solana_zk_token_sdk:: encryption:: auth_encryption:: AeCiphertext ;
3
- pub use solana_zk_token_sdk:: {
4
- zk_token_proof_instruction:: * , zk_token_proof_state:: ProofContextState ,
1
+ pub use solana_zk_sdk:: zk_elgamal_proof_program:: {
2
+ instruction:: ProofInstruction , proof_data:: * , state:: ProofContextState ,
5
3
} ;
4
+
6
5
#[ cfg( feature = "serde-traits" ) ]
7
6
use {
8
7
crate :: serialization:: aeciphertext_fromstr,
@@ -638,7 +637,7 @@ pub fn initialize_mint(
638
637
mint : & Pubkey ,
639
638
authority : Option < Pubkey > ,
640
639
auto_approve_new_accounts : bool ,
641
- auditor_elgamal_pubkey : Option < ElGamalPubkey > ,
640
+ auditor_elgamal_pubkey : Option < PodElGamalPubkey > ,
642
641
) -> Result < Instruction , ProgramError > {
643
642
check_program_account ( token_program_id) ?;
644
643
let accounts = vec ! [ AccountMeta :: new( * mint, false ) ] ;
@@ -663,7 +662,7 @@ pub fn update_mint(
663
662
authority : & Pubkey ,
664
663
multisig_signers : & [ & Pubkey ] ,
665
664
auto_approve_new_accounts : bool ,
666
- auditor_elgamal_pubkey : Option < ElGamalPubkey > ,
665
+ auditor_elgamal_pubkey : Option < PodElGamalPubkey > ,
667
666
) -> Result < Instruction , ProgramError > {
668
667
check_program_account ( token_program_id) ?;
669
668
let mut accounts = vec ! [
@@ -693,11 +692,11 @@ pub fn inner_configure_account(
693
692
token_program_id : & Pubkey ,
694
693
token_account : & Pubkey ,
695
694
mint : & Pubkey ,
696
- decryptable_zero_balance : AeCiphertext ,
695
+ decryptable_zero_balance : PodAeCiphertext ,
697
696
maximum_pending_balance_credit_counter : u64 ,
698
697
authority : & Pubkey ,
699
698
multisig_signers : & [ & Pubkey ] ,
700
- proof_data_location : ProofLocation < PubkeyValidityData > ,
699
+ proof_data_location : ProofLocation < PubkeyValidityProofData > ,
701
700
) -> Result < Instruction , ProgramError > {
702
701
check_program_account ( token_program_id) ?;
703
702
@@ -748,11 +747,11 @@ pub fn configure_account(
748
747
token_program_id : & Pubkey ,
749
748
token_account : & Pubkey ,
750
749
mint : & Pubkey ,
751
- decryptable_zero_balance : AeCiphertext ,
750
+ decryptable_zero_balance : PodAeCiphertext ,
752
751
maximum_pending_balance_credit_counter : u64 ,
753
752
authority : & Pubkey ,
754
753
multisig_signers : & [ & Pubkey ] ,
755
- proof_data_location : ProofLocation < PubkeyValidityData > ,
754
+ proof_data_location : ProofLocation < PubkeyValidityProofData > ,
756
755
) -> Result < Vec < Instruction > , ProgramError > {
757
756
let mut instructions = vec ! [ inner_configure_account(
758
757
token_program_id,
@@ -777,9 +776,8 @@ pub fn configure_account(
777
776
return Err ( TokenError :: InvalidProofInstructionOffset . into ( ) ) ;
778
777
}
779
778
match proof_data {
780
- ProofData :: InstructionData ( data) => {
781
- instructions. push ( verify_pubkey_validity ( None , data) )
782
- }
779
+ ProofData :: InstructionData ( data) => instructions
780
+ . push ( ProofInstruction :: VerifyPubkeyValidity . encode_verify_proof ( None , data) ) ,
783
781
ProofData :: RecordAccount ( address, offset) => instructions. push (
784
782
ProofInstruction :: VerifyPubkeyValidity
785
783
. encode_verify_proof_from_account ( None , address, offset) ,
@@ -824,7 +822,7 @@ pub fn inner_empty_account(
824
822
token_account : & Pubkey ,
825
823
authority : & Pubkey ,
826
824
multisig_signers : & [ & Pubkey ] ,
827
- proof_data_location : ProofLocation < ZeroBalanceProofData > ,
825
+ proof_data_location : ProofLocation < ZeroCiphertextProofData > ,
828
826
) -> Result < Instruction , ProgramError > {
829
827
check_program_account ( token_program_id) ?;
830
828
let mut accounts = vec ! [ AccountMeta :: new( * token_account, false ) ] ;
@@ -869,7 +867,7 @@ pub fn empty_account(
869
867
token_account : & Pubkey ,
870
868
authority : & Pubkey ,
871
869
multisig_signers : & [ & Pubkey ] ,
872
- proof_data_location : ProofLocation < ZeroBalanceProofData > ,
870
+ proof_data_location : ProofLocation < ZeroCiphertextProofData > ,
873
871
) -> Result < Vec < Instruction > , ProgramError > {
874
872
let mut instructions = vec ! [ inner_empty_account(
875
873
token_program_id,
@@ -891,9 +889,10 @@ pub fn empty_account(
891
889
return Err ( TokenError :: InvalidProofInstructionOffset . into ( ) ) ;
892
890
}
893
891
match proof_data {
894
- ProofData :: InstructionData ( data) => instructions. push ( verify_zero_balance ( None , data) ) ,
892
+ ProofData :: InstructionData ( data) => instructions
893
+ . push ( ProofInstruction :: VerifyZeroCiphertext . encode_verify_proof ( None , data) ) ,
895
894
ProofData :: RecordAccount ( address, offset) => instructions. push (
896
- ProofInstruction :: VerifyZeroBalance
895
+ ProofInstruction :: VerifyZeroCiphertext
897
896
. encode_verify_proof_from_account ( None , address, offset) ,
898
897
) ,
899
898
} ;
@@ -1002,7 +1001,7 @@ pub fn withdraw(
1002
1001
mint : & Pubkey ,
1003
1002
amount : u64 ,
1004
1003
decimals : u8 ,
1005
- new_decryptable_available_balance : AeCiphertext ,
1004
+ new_decryptable_available_balance : PodAeCiphertext ,
1006
1005
authority : & Pubkey ,
1007
1006
multisig_signers : & [ & Pubkey ] ,
1008
1007
proof_data_location : ProofLocation < WithdrawData > ,
@@ -1261,7 +1260,7 @@ pub fn apply_pending_balance(
1261
1260
token_program_id : & Pubkey ,
1262
1261
token_account : & Pubkey ,
1263
1262
pending_balance_instructions : u64 ,
1264
- new_decryptable_available_balance : AeCiphertext ,
1263
+ new_decryptable_available_balance : PodAeCiphertext ,
1265
1264
authority : & Pubkey ,
1266
1265
multisig_signers : & [ & Pubkey ] ,
1267
1266
) -> Result < Instruction , ProgramError > {
@@ -1381,7 +1380,7 @@ pub fn inner_transfer_with_fee(
1381
1380
transfer_amount_ciphertext_validity_proof_data_location : ProofLocation <
1382
1381
BatchedGroupedCiphertext3HandlesValidityProofData ,
1383
1382
> ,
1384
- fee_sigma_proof_data_location : ProofLocation < FeeSigmaProofData > ,
1383
+ fee_sigma_proof_data_location : ProofLocation < PercentageWithCapProofData > ,
1385
1384
fee_ciphertext_validity_proof_data_location : ProofLocation <
1386
1385
BatchedGroupedCiphertext2HandlesValidityProofData ,
1387
1386
> ,
@@ -1507,7 +1506,7 @@ pub fn transfer_with_fee(
1507
1506
transfer_amount_ciphertext_validity_proof_data_location : ProofLocation <
1508
1507
BatchedGroupedCiphertext3HandlesValidityProofData ,
1509
1508
> ,
1510
- fee_sigma_proof_data_location : ProofLocation < FeeSigmaProofData > ,
1509
+ fee_sigma_proof_data_location : ProofLocation < PercentageWithCapProofData > ,
1511
1510
fee_ciphertext_validity_proof_data_location : ProofLocation <
1512
1511
BatchedGroupedCiphertext2HandlesValidityProofData ,
1513
1512
> ,
@@ -1574,11 +1573,10 @@ pub fn transfer_with_fee(
1574
1573
return Err ( TokenError :: InvalidProofInstructionOffset . into ( ) ) ;
1575
1574
}
1576
1575
match proof_data {
1577
- ProofData :: InstructionData ( data) => {
1578
- instructions. push ( ProofInstruction :: VerifyFeeSigma . encode_verify_proof ( None , data) )
1579
- }
1576
+ ProofData :: InstructionData ( data) => instructions
1577
+ . push ( ProofInstruction :: VerifyPercentageWithCap . encode_verify_proof ( None , data) ) ,
1580
1578
ProofData :: RecordAccount ( address, offset) => instructions. push (
1581
- ProofInstruction :: VerifyFeeSigma
1579
+ ProofInstruction :: VerifyPercentageWithCap
1582
1580
. encode_verify_proof_from_account ( None , address, offset) ,
1583
1581
) ,
1584
1582
} ;
0 commit comments