@@ -15,7 +15,7 @@ module pyth_lazer::pyth_lazer {
15
15
const EINSUFFICIENT_FEE : u64 = 6 ;
16
16
17
17
/// Constants
18
- const MAX_NUM_TRUSTED_SIGNERS : u8 = 5 ;
18
+ const MAX_NUM_TRUSTED_SIGNERS : u8 = 2 ;
19
19
const ED25519_PUBLIC_KEY_LENGTH : u64 = 32 ;
20
20
21
21
/// Stores information about a trusted signer including their public key and expiration
@@ -28,7 +28,7 @@ module pyth_lazer::pyth_lazer {
28
28
struct Storage has key {
29
29
top_authority: address ,
30
30
treasury: address ,
31
- single_update_fee: u64 , // Fee in APT token (1 wei)
31
+ single_update_fee: u64 ,
32
32
num_trusted_signers: u8 ,
33
33
trusted_signers: vector <TrustedSignerInfo >,
34
34
}
@@ -48,14 +48,14 @@ module pyth_lazer::pyth_lazer {
48
48
let storage = Storage {
49
49
top_authority,
50
50
treasury,
51
- single_update_fee: 1 , // 1 wei in Aptos native token
51
+ single_update_fee: 1 , // Nominal fee
52
52
num_trusted_signers: 0 ,
53
53
trusted_signers: vector ::empty (),
54
54
};
55
55
move_to (account, storage);
56
56
}
57
57
58
- /// Update a trusted signer's information or remove them
58
+ /// Upsert a trusted signer's information or remove them
59
59
public entry fun update_trusted_signer (
60
60
account: &signer ,
61
61
trusted_signer: vector <u8 >,
@@ -128,13 +128,5 @@ module pyth_lazer::pyth_lazer {
128
128
let sig = ed25519::new_signature_from_bytes (signature);
129
129
let pk = ed25519::new_unvalidated_public_key_from_bytes (public_key);
130
130
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);
139
131
}
140
132
}
0 commit comments