Skip to content

Commit caf2587

Browse files
chore: interface update (#66)
1 parent e863b59 commit caf2587

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

src/interfaces/IAccountKeychain.sol

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ interface IAccountKeychain {
4040
struct KeyInfo {
4141
SignatureType signatureType; // Signature type of the key
4242
address keyId; // The key identifier (address)
43-
uint64 expiry; // Unix timestamp when key expires (0 = never)
43+
uint64 expiry; // Unix timestamp when key expires (use type(uint64).max for never)
4444
bool enforceLimits; // Whether spending limits are enforced for this key
4545
bool isRevoked; // Whether this key has been revoked
4646
}
@@ -72,6 +72,7 @@ interface IAccountKeychain {
7272
error SpendingLimitExceeded();
7373
error InvalidSignatureType();
7474
error ZeroPublicKey();
75+
error ExpiryInPast();
7576
error UnauthorizedCaller();
7677

7778
/*//////////////////////////////////////////////////////////////
@@ -84,7 +85,7 @@ interface IAccountKeychain {
8485
* The protocol enforces this restriction by checking transactionKey[msg.sender]
8586
* @param keyId The key identifier (address) to authorize
8687
* @param signatureType Signature type of the key (0: Secp256k1, 1: P256, 2: WebAuthn)
87-
* @param expiry Unix timestamp when key expires (0 = never expires)
88+
* @param expiry Unix timestamp when key expires (use type(uint64).max for never expires)
8889
* @param enforceLimits Whether to enforce spending limits for this key
8990
* @param limits Initial spending limits for tokens (only used if enforceLimits is true)
9091
*/

src/interfaces/IValidatorConfig.sol

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,8 +80,15 @@ interface IValidatorConfig {
8080
/// @notice Change validator active status (owner only)
8181
/// @param validator The validator address
8282
/// @param active Whether the validator should be active
83+
/// @dev Deprecated: Use changeValidatorStatusByIndex to prevent front-running attacks
8384
function changeValidatorStatus(address validator, bool active) external;
8485

86+
/// @notice Change validator active status by index (owner only) - T1+
87+
/// @param index The validator index in the validators array
88+
/// @param active Whether the validator should be active
89+
/// @dev Added in T1 to prevent front-running attacks where a validator changes its address
90+
function changeValidatorStatusByIndex(uint64 index, bool active) external;
91+
8592
/// @notice Get the owner of the precompile
8693
/// @return The owner address
8794
function owner() external view returns (address);

0 commit comments

Comments
 (0)