@@ -8,6 +8,7 @@ import "@openzeppelin/contracts/utils/cryptography/ECDSA.sol";
8
8
contract PythLazer is OwnableUpgradeable , UUPSUpgradeable {
9
9
TrustedSignerInfo[100 ] internal trustedSigners;
10
10
uint256 public verification_fee;
11
+ mapping (address => uint256 ) trustedSignerToExpiresAtMapping;
11
12
12
13
constructor () {
13
14
_disableInitializers ();
@@ -36,6 +37,7 @@ contract PythLazer is OwnableUpgradeable, UUPSUpgradeable {
36
37
if (trustedSigners[i].pubkey == trustedSigner) {
37
38
trustedSigners[i].pubkey = address (0 );
38
39
trustedSigners[i].expiresAt = 0 ;
40
+ delete trustedSignerToExpiresAtMapping[trustedSigner];
39
41
return ;
40
42
}
41
43
}
@@ -44,6 +46,7 @@ contract PythLazer is OwnableUpgradeable, UUPSUpgradeable {
44
46
for (uint8 i = 0 ; i < trustedSigners.length ; i++ ) {
45
47
if (trustedSigners[i].pubkey == trustedSigner) {
46
48
trustedSigners[i].expiresAt = expiresAt;
49
+ trustedSignerToExpiresAtMapping[trustedSigner] = expiresAt;
47
50
return ;
48
51
}
49
52
}
@@ -52,6 +55,7 @@ contract PythLazer is OwnableUpgradeable, UUPSUpgradeable {
52
55
if (trustedSigners[i].pubkey == address (0 )) {
53
56
trustedSigners[i].pubkey = trustedSigner;
54
57
trustedSigners[i].expiresAt = expiresAt;
58
+ trustedSignerToExpiresAtMapping[trustedSigner] = expiresAt;
55
59
return ;
56
60
}
57
61
}
@@ -60,12 +64,7 @@ contract PythLazer is OwnableUpgradeable, UUPSUpgradeable {
60
64
}
61
65
62
66
function isValidSigner (address signer ) public view returns (bool ) {
63
- for (uint8 i = 0 ; i < trustedSigners.length ; i++ ) {
64
- if (trustedSigners[i].pubkey == signer) {
65
- return block .timestamp < trustedSigners[i].expiresAt;
66
- }
67
- }
68
- return false ;
67
+ return block .timestamp < trustedSignerToExpiresAtMapping[signer];
69
68
}
70
69
71
70
function verifyUpdate (
0 commit comments