@@ -8,6 +8,7 @@ import "@openzeppelin/contracts/utils/cryptography/ECDSA.sol";
88contract PythLazer is OwnableUpgradeable , UUPSUpgradeable {
99 TrustedSignerInfo[100 ] internal trustedSigners;
1010 uint256 public verification_fee;
11+ mapping (address => uint256 ) trustedSignerToExpiresAtMapping;
1112
1213 constructor () {
1314 _disableInitializers ();
@@ -36,6 +37,7 @@ contract PythLazer is OwnableUpgradeable, UUPSUpgradeable {
3637 if (trustedSigners[i].pubkey == trustedSigner) {
3738 trustedSigners[i].pubkey = address (0 );
3839 trustedSigners[i].expiresAt = 0 ;
40+ delete trustedSignerToExpiresAtMapping[trustedSigner];
3941 return ;
4042 }
4143 }
@@ -44,6 +46,7 @@ contract PythLazer is OwnableUpgradeable, UUPSUpgradeable {
4446 for (uint8 i = 0 ; i < trustedSigners.length ; i++ ) {
4547 if (trustedSigners[i].pubkey == trustedSigner) {
4648 trustedSigners[i].expiresAt = expiresAt;
49+ trustedSignerToExpiresAtMapping[trustedSigner] = expiresAt;
4750 return ;
4851 }
4952 }
@@ -52,6 +55,7 @@ contract PythLazer is OwnableUpgradeable, UUPSUpgradeable {
5255 if (trustedSigners[i].pubkey == address (0 )) {
5356 trustedSigners[i].pubkey = trustedSigner;
5457 trustedSigners[i].expiresAt = expiresAt;
58+ trustedSignerToExpiresAtMapping[trustedSigner] = expiresAt;
5559 return ;
5660 }
5761 }
@@ -60,12 +64,7 @@ contract PythLazer is OwnableUpgradeable, UUPSUpgradeable {
6064 }
6165
6266 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];
6968 }
7069
7170 function verifyUpdate (
0 commit comments