@@ -15,7 +15,7 @@ module pyth_lazer::pyth_lazer {
1515 const EINSUFFICIENT_FEE : u64 = 6 ;
1616
1717 /// Constants
18- const MAX_NUM_TRUSTED_SIGNERS : u8 = 5 ;
18+ const MAX_NUM_TRUSTED_SIGNERS : u8 = 2 ;
1919 const ED25519_PUBLIC_KEY_LENGTH : u64 = 32 ;
2020
2121 /// Stores information about a trusted signer including their public key and expiration
@@ -28,7 +28,7 @@ module pyth_lazer::pyth_lazer {
2828 struct Storage has key {
2929 top_authority: address ,
3030 treasury: address ,
31- single_update_fee: u64 , // Fee in APT token (1 wei)
31+ single_update_fee: u64 ,
3232 num_trusted_signers: u8 ,
3333 trusted_signers: vector <TrustedSignerInfo >,
3434 }
@@ -48,14 +48,14 @@ module pyth_lazer::pyth_lazer {
4848 let storage = Storage {
4949 top_authority,
5050 treasury,
51- single_update_fee: 1 , // 1 wei in Aptos native token
51+ single_update_fee: 1 , // Nominal fee
5252 num_trusted_signers: 0 ,
5353 trusted_signers: vector ::empty (),
5454 };
5555 move_to (account, storage);
5656 }
5757
58- /// Update a trusted signer's information or remove them
58+ /// Upsert a trusted signer's information or remove them
5959 public entry fun update_trusted_signer (
6060 account: &signer ,
6161 trusted_signer: vector <u8 >,
@@ -128,13 +128,5 @@ module pyth_lazer::pyth_lazer {
128128 let sig = ed25519::new_signature_from_bytes (signature);
129129 let pk = ed25519::new_unvalidated_public_key_from_bytes (public_key);
130130 assert !(ed25519::signature_verify_strict (&sig, &pk, message), EINVALID_SIGNATURE );
131- let signer_info = vector ::borrow (&storage.trusted_signers, (i as u64 ));
132- if (signer_info.pubkey == public_key && signer_info.expires_at > timestamp::now_seconds ()) {
133- valid = true ;
134- break
135- };
136- i = i + 1 ;
137- };
138- assert!(valid, EINVALID_SIGNER);
139131 }
140132}
0 commit comments