@agenticprimitives/contracts 1.0.0-alpha.48 → 1.0.0-alpha.49
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/AUDIT.md +36 -4
- package/dist/abi/AccountBootstrap.json +99 -0
- package/dist/abi/AgentAccount.json +95 -56
- package/dist/abi/AgentAccountFactory.json +189 -0
- package/dist/abi/AgentNameAttributeResolver.json +188 -0
- package/dist/abi/AgentNameRegistry.json +170 -0
- package/dist/abi/AgentNameUniversalResolver.json +188 -0
- package/dist/abi/AgentProfileResolver.json +188 -0
- package/dist/abi/AgentRegistryBase.json +193 -0
- package/dist/abi/AgentRelationship.json +193 -0
- package/dist/abi/AgenticGovernance.json +123 -0
- package/dist/abi/AgreementRegistry.json +193 -0
- package/dist/abi/AllowedMethodsEnforcer.json +193 -0
- package/dist/abi/AllowedTargetsEnforcer.json +193 -0
- package/dist/abi/ApprovedHashRegistry.json +220 -0
- package/dist/abi/AttestationRegistry.json +193 -0
- package/dist/abi/CallDataHashEnforcer.json +193 -0
- package/dist/abi/CustodyPolicy.json +195 -80
- package/dist/abi/DelegationManager.json +185 -0
- package/dist/abi/DigestBindingEnforcer.json +188 -0
- package/dist/abi/Eip7702.json +13 -0
- package/dist/abi/EstateProjectionRegistry.json +193 -0
- package/dist/abi/Generation5Bridge.json +355 -0
- package/dist/abi/GeoFeatureRegistry.json +193 -0
- package/dist/abi/ICustodyEpochView.json +28 -0
- package/dist/abi/IDelegationManager.json +18 -0
- package/dist/abi/IGeneration4Reads.json +143 -0
- package/dist/abi/IGeneration5Account.json +33 -0
- package/dist/abi/IGeneration5Voucher.json +26 -0
- package/dist/abi/IMoveAccountView.json +57 -0
- package/dist/abi/IMoveCustodyView.json +169 -0
- package/dist/abi/IMoveFactoryView.json +41 -0
- package/dist/abi/ITimelockVeto.json +93 -0
- package/dist/abi/OntologyTermRegistry.json +211 -0
- package/dist/abi/PayloadClassesEnforcer.json +193 -0
- package/dist/abi/PaymentEnforcer.json +188 -0
- package/dist/abi/PaymentEscrow.json +177 -0
- package/dist/abi/PaymentReceiptRegistry.json +206 -0
- package/dist/abi/PermissionlessSubregistry.json +188 -0
- package/dist/abi/PricedSubregistry.json +215 -0
- package/dist/abi/QuorumEnforcer.json +193 -0
- package/dist/abi/ReceiptAnchorRegistry.json +193 -0
- package/dist/abi/RelationshipTypeRegistry.json +211 -0
- package/dist/abi/ShapeRegistry.json +211 -0
- package/dist/abi/SignatureVerifier.json +196 -0
- package/dist/abi/SkillDefinitionRegistry.json +193 -0
- package/dist/abi/SmartAgentPaymaster.json +236 -1
- package/dist/abi/StableProxyGoverned.json +190 -0
- package/dist/abi/StableProxyGovernedOneShot.json +172 -0
- package/dist/abi/TimestampEnforcer.json +193 -0
- package/dist/abi/TreasurySpendPolicy.json +193 -0
- package/dist/abi/UpgradeVoucher.json +156 -4
- package/dist/abi/ValueEnforcer.json +193 -0
- package/dist/abi/index.d.ts +14 -0
- package/dist/abi/index.js +14 -0
- package/package.json +1 -1
- package/src/AccountBootstrap.sol +38 -0
- package/src/AgentAccount.sol +149 -41
- package/src/AgentAccountFactory.sol +52 -13
- package/src/ApprovedHashRegistry.sol +98 -9
- package/src/SmartAgentPaymaster.sol +96 -12
- package/src/UniversalSignatureValidator.sol +7 -0
- package/src/UpgradeVoucher.sol +16 -3
- package/src/agency/DelegationManager.sol +106 -32
- package/src/agency/IDelegationManager.sol +28 -0
- package/src/agreement/AgreementRegistry.sol +16 -15
- package/src/attestation/AttestationRegistry.sol +39 -16
- package/src/custody/CustodyPolicy.sol +36 -35
- package/src/custody/TreasurySpendPolicy.sol +10 -1
- package/src/enforcers/AllowedMethodsEnforcer.sol +7 -1
- package/src/enforcers/AllowedTargetsEnforcer.sol +7 -1
- package/src/enforcers/CallDataHashEnforcer.sol +7 -1
- package/src/enforcers/DigestBindingEnforcer.sol +5 -2
- package/src/enforcers/PayloadClassesEnforcer.sol +7 -1
- package/src/enforcers/PaymentEnforcer.sol +5 -2
- package/src/enforcers/QuorumEnforcer.sol +7 -1
- package/src/enforcers/TimestampEnforcer.sol +7 -1
- package/src/enforcers/ValueEnforcer.sol +7 -1
- package/src/geo/GeoFeatureRegistry.sol +15 -1
- package/src/governance/AgenticGovernance.sol +145 -0
- package/src/governance/GovernanceManaged.sol +2 -0
- package/src/governance/StableProxyGoverned.sol +79 -0
- package/src/governance/StableProxyGovernedOneShot.sol +93 -0
- package/src/identity/AgentProfileResolver.sol +11 -2
- package/src/libraries/Eip7702.sol +36 -0
- package/src/libraries/SignatureSlotRecovery.sol +4 -0
- package/src/libraries/SignatureVerifier.sol +52 -0
- package/src/libraries/WebAuthnLib.sol +3 -0
- package/src/migration/Generation5Bridge.sol +364 -0
- package/src/naming/AgentNameAttributeResolver.sol +12 -2
- package/src/naming/AgentNameRegistry.sol +84 -10
- package/src/naming/AgentNameUniversalResolver.sol +9 -2
- package/src/naming/PermissionlessSubregistry.sol +13 -2
- package/src/naming/PricedSubregistry.sol +59 -3
- package/src/ontology/OntologyTermRegistry.sol +30 -2
- package/src/ontology/ShapeRegistry.sol +30 -2
- package/src/payments/PaymentEscrow.sol +16 -1
- package/src/payments/PaymentReceiptRegistry.sol +28 -3
- package/src/provenance/ReceiptAnchorRegistry.sol +13 -1
- package/src/registry/AgentRegistryBase.sol +21 -1
- package/src/registry/EstateProjectionRegistry.sol +15 -1
- package/src/relationships/AgentRelationship.sol +17 -1
- package/src/relationships/RelationshipTypeRegistry.sol +30 -2
- package/src/skills/SkillDefinitionRegistry.sol +15 -1
|
@@ -2,11 +2,14 @@
|
|
|
2
2
|
pragma solidity ^0.8.28;
|
|
3
3
|
|
|
4
4
|
import "account-abstraction/core/BasePaymaster.sol";
|
|
5
|
+
import {Eip7702} from "./libraries/Eip7702.sol";
|
|
5
6
|
import "account-abstraction/interfaces/IEntryPoint.sol";
|
|
6
7
|
import "account-abstraction/interfaces/PackedUserOperation.sol";
|
|
7
8
|
import "@openzeppelin/contracts/utils/cryptography/ECDSA.sol";
|
|
8
9
|
import "@openzeppelin/contracts/utils/cryptography/MessageHashUtils.sol";
|
|
9
10
|
import "./governance/IGovernance.sol";
|
|
11
|
+
import "@openzeppelin/contracts/proxy/utils/Initializable.sol";
|
|
12
|
+
import "@openzeppelin/contracts/proxy/utils/UUPSUpgradeable.sol";
|
|
10
13
|
|
|
11
14
|
/**
|
|
12
15
|
* @title SmartAgentPaymaster
|
|
@@ -70,6 +73,12 @@ import "./governance/IGovernance.sol";
|
|
|
70
73
|
* to allowlist is fail-closed: every userOp reverts with
|
|
71
74
|
* `SenderNotAccepted` until governance explicitly opts a sender
|
|
72
75
|
* in. That is the documented safe state.
|
|
76
|
+
* WHAT ALLOWLIST MODE TRUSTS (audit 2026-12-02 C2-5): nobody signs an
|
|
77
|
+
* allowlisted operation's fees, so each accepted sender — any ONE of
|
|
78
|
+
* its credentials — can spend the deposit on itself, bounded only by
|
|
79
|
+
* `allowlistMaxCostPerOp` PER OPERATION (zero = nothing is sponsored;
|
|
80
|
+
* governance sets it with the first `setAccepted`). There is no
|
|
81
|
+
* per-sender budget: prefer verifying mode wherever the deposit matters.
|
|
73
82
|
* 2. Monitor `getDeposit()` and alert below a runway threshold.
|
|
74
83
|
* 3. PM-2 — hand the Ownable owner to the governance TimelockController via
|
|
75
84
|
* `Ownable2Step` (`transferOwnership(governance)` then a timelocked
|
|
@@ -90,7 +99,21 @@ import "./governance/IGovernance.sol";
|
|
|
90
99
|
* and `withdrawTo` from `BasePaymaster`. Ownable owner is set in
|
|
91
100
|
* the constructor (Ownable2Step pattern).
|
|
92
101
|
*/
|
|
93
|
-
|
|
102
|
+
/// @dev Spec 447 (generation 5) — deployable behind an ERC-1967 UUPS proxy at an address that never changes (the
|
|
103
|
+
/// address every sponsored user operation names in `paymasterAndData`, and the EntryPoint deposit's holder).
|
|
104
|
+
/// `governance` moved from an immutable to `StableProxyGoverned`'s ERC-7201 slot
|
|
105
|
+
/// (`agenticprimitives.stable-proxy-governed.v1`; same `governance()` getter, same `onlyGovernance` /
|
|
106
|
+
/// `NotGovernance`); it is the admin of the paymaster AND the only upgrade authority. The paymaster does not
|
|
107
|
+
/// inherit `StableProxyGoverned` itself only because it already declares `NotGovernance` (a published
|
|
108
|
+
/// selector its callers and tests name as `SmartAgentPaymaster.NotGovernance`); it implements the same rule
|
|
109
|
+
/// in the same slot.
|
|
110
|
+
/// The linear layout (and `__gap`) is unchanged. A DIRECT deployment is initialized in the constructor and can
|
|
111
|
+
/// never be upgraded (`onlyProxy`); behind a proxy, `initialize(governance_, initialOwner, devMode_,
|
|
112
|
+
/// verifyingSigner_)` sets everything the constructor sets, including the `Ownable` owner (slot 0).
|
|
113
|
+
/// `_entryPoint` (in `BasePaymaster`) stays an immutable: the EntryPoint is a fixed singleton address.
|
|
114
|
+
/// Validation reads only the proxy's own storage (`_dev`, `_acceptList`, `verifyingSigner`, `_pausedMirror`)
|
|
115
|
+
/// through a DELEGATECALL to a deployed implementation — ERC-7562's own-storage rule still holds.
|
|
116
|
+
contract SmartAgentPaymaster is BasePaymaster, Initializable, UUPSUpgradeable {
|
|
94
117
|
using ECDSA for bytes32;
|
|
95
118
|
using MessageHashUtils for bytes32;
|
|
96
119
|
|
|
@@ -105,9 +128,11 @@ contract SmartAgentPaymaster is BasePaymaster {
|
|
|
105
128
|
/// the production check). Set via governance.
|
|
106
129
|
address public verifyingSigner;
|
|
107
130
|
|
|
108
|
-
/// @
|
|
109
|
-
///
|
|
110
|
-
|
|
131
|
+
/// @dev Spec 447 — `governance` (the Governance contract whose pause flag halts paymaster validation, and the
|
|
132
|
+
/// upgrade authority) lives in `StableProxyGoverned`'s ERC-7201 slot; it was an immutable.
|
|
133
|
+
/// keccak256(abi.encode(uint256(keccak256("agenticprimitives.stable-proxy-governed.v1")) - 1)) & ~bytes32(uint256(0xff))
|
|
134
|
+
bytes32 private constant STABLE_PROXY_GOVERNED_SLOT =
|
|
135
|
+
0x775756232dfd963ad243ed4c7335d3b32889ad6784e2c9e947c9804ba981fb00;
|
|
111
136
|
|
|
112
137
|
/// @notice PM-1 — local mirror of the governance pause flag. This is the
|
|
113
138
|
/// ONLY pause signal read during ERC-4337 validation. Reading the
|
|
@@ -149,6 +174,8 @@ contract SmartAgentPaymaster is BasePaymaster {
|
|
|
149
174
|
uint64 public constant DEPOSIT_WITHDRAWAL_TIMELOCK = 48 hours;
|
|
150
175
|
|
|
151
176
|
error SenderNotAccepted(address sender);
|
|
177
|
+
/// @dev Allowlist mode: the operation's maximum cost exceeds the per-operation ceiling (C2-5).
|
|
178
|
+
error SponsoredCostAboveCeiling(uint256 maxCost, uint256 ceiling);
|
|
152
179
|
error SystemPaused();
|
|
153
180
|
error ZeroGovernance();
|
|
154
181
|
error NotGovernance();
|
|
@@ -160,8 +187,10 @@ contract SmartAgentPaymaster is BasePaymaster {
|
|
|
160
187
|
error WithdrawalAmountZero();
|
|
161
188
|
error WithdrawalToZero();
|
|
162
189
|
|
|
190
|
+
event GovernanceSet(address indexed governance);
|
|
163
191
|
event DevModeSet(bool dev);
|
|
164
192
|
event SenderAcceptedSet(address indexed sender, bool accepted);
|
|
193
|
+
event AllowlistMaxCostPerOpSet(uint256 ceilingWei);
|
|
165
194
|
event VerifyingSignerSet(address indexed oldSigner, address indexed newSigner);
|
|
166
195
|
/// @notice PM-1 — emitted whenever the local pause mirror is updated.
|
|
167
196
|
event PauseMirrorSynced(bool paused, address indexed by);
|
|
@@ -170,10 +199,15 @@ contract SmartAgentPaymaster is BasePaymaster {
|
|
|
170
199
|
event DepositWithdrawalExecuted(address indexed to, uint256 amount);
|
|
171
200
|
event DepositWithdrawalCancelled(address indexed to, uint256 amount);
|
|
172
201
|
|
|
202
|
+
/// @notice Audit 2026-12-02 C2-5 — the most one ALLOWLIST-mode operation may cost the deposit (wei; the
|
|
203
|
+
/// EntryPoint's `maxCost`). Zero until governance sets it: allowlist mode then sponsors nothing.
|
|
204
|
+
/// Not a per-sender budget: an accepted sender can still repeat operations, each within the ceiling.
|
|
205
|
+
uint256 public allowlistMaxCostPerOp;
|
|
206
|
+
|
|
173
207
|
/// @dev Storage gap reserves slots for future state. Phase A.5 §3.1.
|
|
174
208
|
/// PM-1/PM-2 consumed 3 slots (`_pausedMirror` packs into 1;
|
|
175
|
-
/// `PendingWithdrawal` is 2) — gap reduced 49 → 46
|
|
176
|
-
uint256[
|
|
209
|
+
/// `PendingWithdrawal` is 2) — gap reduced 49 → 46; `allowlistMaxCostPerOp` took the first gap slot → 45.
|
|
210
|
+
uint256[45] private __gap;
|
|
177
211
|
|
|
178
212
|
/// @dev Length of the paymaster-data tail when in verifying mode:
|
|
179
213
|
/// 6 (validUntil) + 6 (validAfter) + 65 (sig) = 77 bytes.
|
|
@@ -197,9 +231,46 @@ contract SmartAgentPaymaster is BasePaymaster {
|
|
|
197
231
|
address governance_,
|
|
198
232
|
bool devMode_,
|
|
199
233
|
address verifyingSigner_
|
|
200
|
-
) BasePaymaster(entryPointAddr, initialOwner) {
|
|
234
|
+
) BasePaymaster(entryPointAddr, initialOwner) initializer {
|
|
235
|
+
_initPaymaster(governance_, devMode_, verifyingSigner_);
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
/// @notice Spec 447 — the proxy's initializer: what the constructor sets, once per proxy. The implementation is
|
|
239
|
+
/// built with the same `entryPointAddr` (its immutable); the `Ownable` owner, which the constructor sets
|
|
240
|
+
/// through `BasePaymaster`, is set here for the proxy's storage.
|
|
241
|
+
function initialize(address governance_, address initialOwner, bool devMode_, address verifyingSigner_)
|
|
242
|
+
external
|
|
243
|
+
initializer
|
|
244
|
+
{
|
|
245
|
+
if (initialOwner == address(0)) revert OwnableInvalidOwner(address(0));
|
|
246
|
+
_transferOwnership(initialOwner);
|
|
247
|
+
_initPaymaster(governance_, devMode_, verifyingSigner_);
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
/// @notice The Governance contract: the paymaster's admin, its pause source and (spec 447) its only upgrade
|
|
251
|
+
/// authority.
|
|
252
|
+
function governance() public view returns (address gov) {
|
|
253
|
+
bytes32 slot = STABLE_PROXY_GOVERNED_SLOT;
|
|
254
|
+
assembly {
|
|
255
|
+
gov := sload(slot)
|
|
256
|
+
}
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
/// @dev As before spec 447: a paymaster needs a governance.
|
|
260
|
+
function _initializeGovernance(address governance_) private {
|
|
201
261
|
if (governance_ == address(0)) revert ZeroGovernance();
|
|
202
|
-
|
|
262
|
+
bytes32 slot = STABLE_PROXY_GOVERNED_SLOT;
|
|
263
|
+
assembly {
|
|
264
|
+
sstore(slot, governance_)
|
|
265
|
+
}
|
|
266
|
+
emit GovernanceSet(governance_);
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
/// @dev Spec 447 — only governance replaces the code behind the proxy (a direct deployment: never, `onlyProxy`).
|
|
270
|
+
function _authorizeUpgrade(address) internal view override onlyGovernance {}
|
|
271
|
+
|
|
272
|
+
function _initPaymaster(address governance_, bool devMode_, address verifyingSigner_) private {
|
|
273
|
+
_initializeGovernance(governance_);
|
|
203
274
|
_dev = devMode_;
|
|
204
275
|
emit DevModeSet(devMode_);
|
|
205
276
|
if (verifyingSigner_ != address(0)) {
|
|
@@ -211,7 +282,8 @@ contract SmartAgentPaymaster is BasePaymaster {
|
|
|
211
282
|
// ─── Admin (governance-only) ────────────────────────────────────────
|
|
212
283
|
|
|
213
284
|
modifier onlyGovernance() {
|
|
214
|
-
|
|
285
|
+
Eip7702.refuseDelegatedEOA(msg.sender); // spec 448 §0 (EIP-7702)
|
|
286
|
+
if (msg.sender != governance()) revert NotGovernance();
|
|
215
287
|
_;
|
|
216
288
|
}
|
|
217
289
|
|
|
@@ -225,6 +297,12 @@ contract SmartAgentPaymaster is BasePaymaster {
|
|
|
225
297
|
emit SenderAcceptedSet(sender, accepted);
|
|
226
298
|
}
|
|
227
299
|
|
|
300
|
+
/// @notice Set the allowlist-mode per-operation cost ceiling (see `allowlistMaxCostPerOp`).
|
|
301
|
+
function setAllowlistMaxCostPerOp(uint256 ceilingWei) external onlyGovernance {
|
|
302
|
+
allowlistMaxCostPerOp = ceilingWei;
|
|
303
|
+
emit AllowlistMaxCostPerOpSet(ceilingWei);
|
|
304
|
+
}
|
|
305
|
+
|
|
228
306
|
function setAcceptedBatch(address[] calldata senders, bool accepted) external onlyGovernance {
|
|
229
307
|
for (uint256 i = 0; i < senders.length; i++) {
|
|
230
308
|
_acceptList[senders[i]] = accepted;
|
|
@@ -282,8 +360,9 @@ contract SmartAgentPaymaster is BasePaymaster {
|
|
|
282
360
|
/// than fail-open sponsoring. Only a clean, decodable `false` permits sponsorship.
|
|
283
361
|
function _governanceIsPaused() internal view returns (bool) {
|
|
284
362
|
// Unconfigured governance (unset, or an EOA with no code) → not paused (legacy/test path).
|
|
285
|
-
|
|
286
|
-
(
|
|
363
|
+
address gov = governance();
|
|
364
|
+
if (gov == address(0) || gov.code.length == 0) return false;
|
|
365
|
+
(bool ok, bytes memory data) = gov.staticcall(
|
|
287
366
|
abi.encodeWithSelector(IGovernanceView.isPaused.selector)
|
|
288
367
|
);
|
|
289
368
|
// Configured but faulted (call failed or undecodable) → fail closed (paused).
|
|
@@ -400,7 +479,7 @@ contract SmartAgentPaymaster is BasePaymaster {
|
|
|
400
479
|
function _validatePaymasterUserOp(
|
|
401
480
|
PackedUserOperation calldata userOp,
|
|
402
481
|
bytes32 /*userOpHash*/,
|
|
403
|
-
uint256
|
|
482
|
+
uint256 maxCost
|
|
404
483
|
) internal view override returns (bytes memory context, uint256 validationData) {
|
|
405
484
|
// PM-1 / H7-C.10 / EXT3-010: gated behind the system-wide governance
|
|
406
485
|
// pause — but read from the LOCAL mirror (`_pausedMirror`), never the
|
|
@@ -447,6 +526,11 @@ contract SmartAgentPaymaster is BasePaymaster {
|
|
|
447
526
|
|
|
448
527
|
// Fallback: allowlist mode.
|
|
449
528
|
if (!_acceptList[userOp.sender]) revert SenderNotAccepted(userOp.sender);
|
|
529
|
+
// Audit 2026-12-02 C2-5: nobody signs an allowlisted operation's fees or gas limits, so an accepted
|
|
530
|
+
// sender (any one of its credentials) could size them to the whole deposit and collect it as its own
|
|
531
|
+
// bundler. `maxCost` is the EntryPoint's own figure — every gas limit of the operation times its
|
|
532
|
+
// `maxFeePerGas` — and it must fit the ceiling governance set. Unset (0) sponsors nothing.
|
|
533
|
+
if (maxCost > allowlistMaxCostPerOp) revert SponsoredCostAboveCeiling(maxCost, allowlistMaxCostPerOp);
|
|
450
534
|
return ("", 0);
|
|
451
535
|
}
|
|
452
536
|
|
|
@@ -4,6 +4,7 @@ pragma solidity ^0.8.28;
|
|
|
4
4
|
import "@openzeppelin/contracts/interfaces/IERC1271.sol";
|
|
5
5
|
import "@openzeppelin/contracts/utils/cryptography/ECDSA.sol";
|
|
6
6
|
import "@openzeppelin/contracts/utils/cryptography/MessageHashUtils.sol";
|
|
7
|
+
import {Eip7702} from "./libraries/Eip7702.sol";
|
|
7
8
|
|
|
8
9
|
/**
|
|
9
10
|
* @title UniversalSignatureValidator
|
|
@@ -56,6 +57,9 @@ contract UniversalSignatureValidator {
|
|
|
56
57
|
bytes32 hash,
|
|
57
58
|
bytes calldata sig
|
|
58
59
|
) external returns (bool) {
|
|
60
|
+
// Spec 448 §0 (EIP-7702): a delegated EOA is an EOA here — ECDSA only, never its attached code, and
|
|
61
|
+
// never through an ERC-6492 wrapper (which would reach the same code).
|
|
62
|
+
if (Eip7702.isDelegatedEOA(signer)) return _ecdsaRecover(signer, hash, sig);
|
|
59
63
|
if (_has6492Magic(sig)) {
|
|
60
64
|
(address factory, bytes memory factoryCalldata, bytes memory innerSig) =
|
|
61
65
|
_decode6492(sig[:sig.length - 32]);
|
|
@@ -79,6 +83,9 @@ contract UniversalSignatureValidator {
|
|
|
79
83
|
bytes32 hash,
|
|
80
84
|
bytes calldata sig
|
|
81
85
|
) external view returns (bool) {
|
|
86
|
+
// Spec 448 §0 (EIP-7702): a delegated EOA is an EOA here — ECDSA only, never its attached code, and
|
|
87
|
+
// never through an ERC-6492 wrapper (which would reach the same code).
|
|
88
|
+
if (Eip7702.isDelegatedEOA(signer)) return _ecdsaRecover(signer, hash, sig);
|
|
82
89
|
if (_has6492Magic(sig)) {
|
|
83
90
|
(, , bytes memory innerSig) = _decode6492(sig[:sig.length - 32]);
|
|
84
91
|
if (signer.code.length == 0) return false;
|
package/src/UpgradeVoucher.sol
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// SPDX-License-Identifier: MIT
|
|
2
2
|
pragma solidity ^0.8.28;
|
|
3
3
|
|
|
4
|
-
import "./governance/
|
|
4
|
+
import "./governance/StableProxyGoverned.sol";
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* @title UpgradeVoucher — which implementations, with which migration data, an AgentAccount may upgrade to
|
|
@@ -38,12 +38,14 @@ import "./governance/GovernanceManaged.sol";
|
|
|
38
38
|
* at initialization and has no setter; an account upgraded in place still names its original factory.
|
|
39
39
|
* A vouching view on a new factory would never be consulted by an existing account.
|
|
40
40
|
*/
|
|
41
|
-
contract UpgradeVoucher is
|
|
41
|
+
contract UpgradeVoucher is StableProxyGoverned {
|
|
42
42
|
/// @notice `keccak256("")` — the `dataHash` of a plain upgrade (no migration call).
|
|
43
43
|
bytes32 public constant PLAIN_UPGRADE = 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470;
|
|
44
44
|
|
|
45
45
|
/// implementation => keccak256(migration data) => vouched
|
|
46
46
|
mapping(address => mapping(bytes32 => bool)) private _vouched;
|
|
47
|
+
/// @dev Storage gap (spec 447: behind a proxy; layout gated by `check:storage-layouts`).
|
|
48
|
+
uint256[49] private __gap;
|
|
47
49
|
|
|
48
50
|
event UpgradeVouched(address indexed implementation, bytes32 indexed dataHash);
|
|
49
51
|
event UpgradeUnvouched(address indexed implementation, bytes32 indexed dataHash);
|
|
@@ -51,7 +53,18 @@ contract UpgradeVoucher is GovernanceManaged {
|
|
|
51
53
|
/// @dev Vouching for an address with no code would vouch for whatever is later deployed there.
|
|
52
54
|
error ImplementationHasNoCode(address implementation);
|
|
53
55
|
|
|
54
|
-
|
|
56
|
+
/// @dev A voucher with no governance could never vouch, so every account holding it could never upgrade.
|
|
57
|
+
error ZeroGovernance();
|
|
58
|
+
|
|
59
|
+
/// @notice A direct deployment, initialized here. Behind a proxy (spec 447), `initialize(governance_)` instead.
|
|
60
|
+
constructor(address governance_) initializer {
|
|
61
|
+
_initializeGovernance(governance_);
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
function _initializeGovernance(address governance_) internal override {
|
|
65
|
+
if (governance_ == address(0)) revert ZeroGovernance();
|
|
66
|
+
super._initializeGovernance(governance_);
|
|
67
|
+
}
|
|
55
68
|
|
|
56
69
|
/// @notice Vouch for upgrading to `implementation` with migration data hashing to `dataHash`.
|
|
57
70
|
function vouch(address implementation, bytes32 dataHash) external onlyGovernance {
|
|
@@ -2,9 +2,12 @@
|
|
|
2
2
|
pragma solidity ^0.8.28;
|
|
3
3
|
|
|
4
4
|
import "@openzeppelin/contracts/utils/cryptography/ECDSA.sol";
|
|
5
|
+
import {Eip7702} from "../libraries/Eip7702.sol";
|
|
5
6
|
import "@openzeppelin/contracts/utils/cryptography/MessageHashUtils.sol";
|
|
6
7
|
import "@openzeppelin/contracts/utils/ReentrancyGuard.sol";
|
|
7
8
|
import "@openzeppelin/contracts/interfaces/IERC1271.sol";
|
|
9
|
+
import "@openzeppelin/contracts/proxy/utils/Initializable.sol";
|
|
10
|
+
import "@openzeppelin/contracts/proxy/utils/UUPSUpgradeable.sol";
|
|
8
11
|
import "./IDelegationManager.sol";
|
|
9
12
|
import "./ICaveatEnforcer.sol";
|
|
10
13
|
import "../governance/IGovernance.sol";
|
|
@@ -34,7 +37,7 @@ import "../governance/IGovernance.sol";
|
|
|
34
37
|
* - Execute through delegator account, not direct target.call
|
|
35
38
|
* - Open delegations: delegate = address(0xa11) allows any redeemer
|
|
36
39
|
*/
|
|
37
|
-
contract DelegationManager is IDelegationManager, ReentrancyGuard {
|
|
40
|
+
contract DelegationManager is IDelegationManager, ReentrancyGuard, Initializable, UUPSUpgradeable {
|
|
38
41
|
using ECDSA for bytes32;
|
|
39
42
|
using MessageHashUtils for bytes32;
|
|
40
43
|
|
|
@@ -71,13 +74,22 @@ contract DelegationManager is IDelegationManager, ReentrancyGuard {
|
|
|
71
74
|
// contract that breaks freezes redemptions until a new DelegationManager is
|
|
72
75
|
// deployed (this contract is a re-deploy-on-bug singleton, SC4 § 4.3.4) — the
|
|
73
76
|
// same posture `SmartAgentPaymaster._governanceIsPaused` already takes (L1).
|
|
74
|
-
|
|
77
|
+
//
|
|
78
|
+
// Spec 447 (generation 5): no longer immutable. The manager is deployed behind a UUPS proxy at an address
|
|
79
|
+
// that never changes, so the EIP-712 domain (`verifyingContract` = the proxy), every signed delegation and the
|
|
80
|
+
// revocation set survive a fix; `governance` is storage, set once by the constructor (a direct deployment) or
|
|
81
|
+
// by `initialize` (behind a proxy), and is also the only upgrade authority ({_authorizeUpgrade}).
|
|
82
|
+
function governance() public view returns (address) {
|
|
83
|
+
return _governance;
|
|
84
|
+
}
|
|
75
85
|
|
|
76
86
|
error SystemPaused();
|
|
77
87
|
/// @dev DLG-7: constructor refused a non-zero governance address with no code.
|
|
78
88
|
error GovernanceHasNoCode(address governance);
|
|
79
89
|
/// @dev DLG-7: the configured governance did not answer `isPaused()` with one boolean word.
|
|
80
90
|
error GovernanceReadFailed();
|
|
91
|
+
/// @dev Spec 450 §6: {redemptionDepth} read while no caveat hook of a redemption is running.
|
|
92
|
+
error NotInCaveatHook();
|
|
81
93
|
/// @dev Spec 445 / audit DLG-2: a redemption whose `target` is the account that executes it
|
|
82
94
|
/// (the root delegator). See {redeemDelegation}.
|
|
83
95
|
error SelfTargetedRedemption();
|
|
@@ -88,11 +100,10 @@ contract DelegationManager is IDelegationManager, ReentrancyGuard {
|
|
|
88
100
|
/// @dev Open delegation sentinel — any address can redeem
|
|
89
101
|
address public constant OPEN_DELEGATION = address(0xa11);
|
|
90
102
|
|
|
91
|
-
/// @dev
|
|
92
|
-
|
|
93
|
-
///
|
|
94
|
-
|
|
95
|
-
uint256 private immutable _CACHED_CHAIN_ID;
|
|
103
|
+
/// @dev Spec 447: an upgrade by anything but this manager's governance.
|
|
104
|
+
error NotGovernance();
|
|
105
|
+
/// @dev Spec 447: a manager with no governance cannot be upgraded (it is frozen at its implementation).
|
|
106
|
+
error UpgradeWithoutGovernance();
|
|
96
107
|
|
|
97
108
|
/// @dev The root delegator of the redemption in flight (zero outside one). Transient
|
|
98
109
|
/// (EIP-1153): set and cleared inside the non-reentrant {redeemDelegation}. Lets a
|
|
@@ -101,6 +112,13 @@ contract DelegationManager is IDelegationManager, ReentrancyGuard {
|
|
|
101
112
|
/// which for a derived mandate is an intermediary, not the payer (audit DLG-8c).
|
|
102
113
|
address private transient _redemptionRoot;
|
|
103
114
|
|
|
115
|
+
/// @dev Spec 450 §6 — the chain context behind {redemptionDepth}. Transient (EIP-1153), never authority.
|
|
116
|
+
/// `_redemptionLinks` is the length of the chain being redeemed (0 outside a redemption);
|
|
117
|
+
/// `_redemptionLinkPlusOne` is the root-first index of the link whose caveat hooks are running, plus
|
|
118
|
+
/// one (0 while no hook runs: during validation, execution, and outside a redemption).
|
|
119
|
+
uint256 private transient _redemptionLinks;
|
|
120
|
+
uint256 private transient _redemptionLinkPlusOne;
|
|
121
|
+
|
|
104
122
|
/// @dev Delegation type hash for EIP-712.
|
|
105
123
|
///
|
|
106
124
|
/// **R1 / CROSS-STACK-001 closure (2026-05-31):** converged to
|
|
@@ -155,27 +173,48 @@ contract DelegationManager is IDelegationManager, ReentrancyGuard {
|
|
|
155
173
|
/// path. Migrate callers to `revokeDelegationByOwner(Delegation)`.
|
|
156
174
|
error LegacyRevocationDisabled();
|
|
157
175
|
|
|
158
|
-
/// @dev
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
///
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
///
|
|
166
|
-
///
|
|
167
|
-
/// `AgenticGovernance` address
|
|
168
|
-
|
|
176
|
+
/// @dev The pause source and upgrade authority (see {governance}). Spec 447: storage, not an immutable.
|
|
177
|
+
address private _governance;
|
|
178
|
+
|
|
179
|
+
/// @dev Storage gap. Spec 447: the manager is upgradeable behind a proxy from generation 5, so this layout is
|
|
180
|
+
/// gated by `check:storage-layouts`; a new field takes a slot from here and the gap shrinks by one.
|
|
181
|
+
uint256[49] private __gap;
|
|
182
|
+
|
|
183
|
+
/// @notice A DIRECT deployment (tests, a one-off instance): initialized here, so the instance works on its own
|
|
184
|
+
/// and nobody can initialize it later. Pass `address(0)` for `governance_` to opt out of the H7-C.10
|
|
185
|
+
/// pause gate (legacy / test deploys). Production deploys pass an `AgenticGovernance` address and put
|
|
186
|
+
/// the manager behind an ERC-1967 proxy, initialized with {initialize} (spec 447).
|
|
187
|
+
constructor(address governance_) initializer {
|
|
188
|
+
_initializeManager(governance_);
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
/// @notice The proxy's initializer (spec 447). Runs once per proxy.
|
|
192
|
+
function initialize(address governance_) external initializer {
|
|
193
|
+
_initializeManager(governance_);
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
function _initializeManager(address governance_) private {
|
|
169
197
|
// DLG-7 rule 1: zero is the explicit opt-out; anything else must already be a contract.
|
|
170
198
|
if (governance_ != address(0) && governance_.code.length == 0) revert GovernanceHasNoCode(governance_);
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
_CACHED_DOMAIN_SEPARATOR = _buildDomainSeparator();
|
|
199
|
+
Eip7702.refuseDelegatedEOA(governance_); // "has code" is not "is a contract" (spec 448 §0)
|
|
200
|
+
_governance = governance_;
|
|
174
201
|
}
|
|
175
202
|
|
|
176
|
-
/// @
|
|
203
|
+
/// @dev Spec 447: only this manager's governance (the `AgenticGovernance` contract, acting through its
|
|
204
|
+
/// timelock) upgrades it. A manager with no governance is never upgraded. UUPS's `onlyProxy` already
|
|
205
|
+
/// refuses an upgrade of a direct deployment.
|
|
206
|
+
function _authorizeUpgrade(address) internal view override {
|
|
207
|
+
address gov = _governance;
|
|
208
|
+
if (gov == address(0)) revert UpgradeWithoutGovernance();
|
|
209
|
+
Eip7702.refuseDelegatedEOA(msg.sender); // spec 448 §0 (EIP-7702)
|
|
210
|
+
if (msg.sender != gov) revert NotGovernance();
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
/// @notice EIP-712 domain separator for the CURRENT chain id (audit DLG-10), with `verifyingContract` the
|
|
214
|
+
/// address callers use — the proxy's when behind one. Computed per call, never cached in an immutable:
|
|
215
|
+
/// an immutable would carry the implementation's address, not the proxy's (spec 447).
|
|
177
216
|
function DOMAIN_SEPARATOR() public view returns (bytes32) {
|
|
178
|
-
return
|
|
217
|
+
return _buildDomainSeparator();
|
|
179
218
|
}
|
|
180
219
|
|
|
181
220
|
function _buildDomainSeparator() private view returns (bytes32) {
|
|
@@ -198,9 +237,16 @@ contract DelegationManager is IDelegationManager, ReentrancyGuard {
|
|
|
198
237
|
return _redemptionRoot;
|
|
199
238
|
}
|
|
200
239
|
|
|
240
|
+
/// @inheritdoc IDelegationManager
|
|
241
|
+
function redemptionDepth() external view returns (uint256 links, uint256 position) {
|
|
242
|
+
uint256 p = _redemptionLinkPlusOne;
|
|
243
|
+
if (p == 0) revert NotInCaveatHook();
|
|
244
|
+
return (_redemptionLinks, p - 1);
|
|
245
|
+
}
|
|
246
|
+
|
|
201
247
|
/// @dev DLG-7 — the pause gate. See the rule at `governance`.
|
|
202
248
|
function _requireNotPaused() internal view {
|
|
203
|
-
address gov =
|
|
249
|
+
address gov = _governance;
|
|
204
250
|
if (gov == address(0) || gov.code.length == 0) return;
|
|
205
251
|
(bool ok, bytes memory ret) = gov.staticcall(abi.encodeWithSelector(IGovernanceView.isPaused.selector));
|
|
206
252
|
if (!ok || ret.length != 32) revert GovernanceReadFailed();
|
|
@@ -245,20 +291,34 @@ contract DelegationManager is IDelegationManager, ReentrancyGuard {
|
|
|
245
291
|
if (target == rootDelegator) revert SelfTargetedRedemption();
|
|
246
292
|
_redemptionRoot = rootDelegator;
|
|
247
293
|
|
|
248
|
-
//
|
|
249
|
-
|
|
294
|
+
// Spec 450 §6: the chain context {redemptionDepth} reports. `nonReentrant` makes a nested redemption
|
|
295
|
+
// unreachable today; the context is still saved and restored (not cleared) so an inner redemption could
|
|
296
|
+
// never leave the outer one reading the inner chain's numbers.
|
|
297
|
+
uint256 n = delegations.length;
|
|
298
|
+
uint256 savedLinks = _redemptionLinks;
|
|
299
|
+
uint256 savedLink = _redemptionLinkPlusOne;
|
|
300
|
+
_redemptionLinks = n;
|
|
301
|
+
|
|
302
|
+
// Phase 1: Validate chain + run beforeHooks (leaf to root). Leaf-first index i is root-first n-1-i.
|
|
303
|
+
for (uint256 i = 0; i < n; i++) {
|
|
250
304
|
_validateDelegation(delegations, i);
|
|
305
|
+
_redemptionLinkPlusOne = n - i;
|
|
251
306
|
_runBeforeHooks(delegations[i], target, value, data);
|
|
307
|
+
_redemptionLinkPlusOne = 0;
|
|
252
308
|
}
|
|
253
309
|
|
|
254
310
|
// Phase 2: Execute through the root delegator's smart account
|
|
255
311
|
_executeFromDelegator(rootDelegator, target, value, data);
|
|
256
312
|
|
|
257
313
|
// Phase 3: After-hooks (root to leaf, per DeleGator convention)
|
|
258
|
-
for (uint256 i =
|
|
314
|
+
for (uint256 i = n; i > 0; i--) {
|
|
315
|
+
_redemptionLinkPlusOne = n - i + 1;
|
|
259
316
|
_runAfterHooks(delegations[i - 1], target, value, data);
|
|
317
|
+
_redemptionLinkPlusOne = 0;
|
|
260
318
|
}
|
|
261
319
|
_redemptionRoot = address(0);
|
|
320
|
+
_redemptionLinks = savedLinks;
|
|
321
|
+
_redemptionLinkPlusOne = savedLink;
|
|
262
322
|
}
|
|
263
323
|
|
|
264
324
|
/// @inheritdoc IDelegationManager
|
|
@@ -393,6 +453,8 @@ contract DelegationManager is IDelegationManager, ReentrancyGuard {
|
|
|
393
453
|
Delegation[] calldata delegations,
|
|
394
454
|
address sender
|
|
395
455
|
) external view returns (bool ok, string memory reason) {
|
|
456
|
+
// Spec 450 §6: never answered from inside a caveat hook (see {verifyAuthorizationForCall}).
|
|
457
|
+
if (_redemptionLinkPlusOne != 0) return (false, "in-redemption");
|
|
396
458
|
if (delegations.length == 0) return (false, "empty-chain");
|
|
397
459
|
|
|
398
460
|
for (uint256 i = 0; i < delegations.length; i++) {
|
|
@@ -432,6 +494,9 @@ contract DelegationManager is IDelegationManager, ReentrancyGuard {
|
|
|
432
494
|
uint256 value,
|
|
433
495
|
bytes calldata data
|
|
434
496
|
) external view returns (bool ok, string memory reason) {
|
|
497
|
+
// Spec 450 §6: while a caveat hook of a redemption is running, {redemptionDepth} reports THAT chain's
|
|
498
|
+
// context, so an enforcer evaluated here would judge this chain by the outer one's numbers. Refused.
|
|
499
|
+
if (_redemptionLinkPlusOne != 0) return (false, "in-redemption");
|
|
435
500
|
if (delegations.length == 0) return (false, "empty-chain");
|
|
436
501
|
// DLG-2: identical to redemption — the executing account is never the target.
|
|
437
502
|
if (target == delegations[delegations.length - 1].delegator) return (false, "self-target");
|
|
@@ -488,6 +553,9 @@ contract DelegationManager is IDelegationManager, ReentrancyGuard {
|
|
|
488
553
|
if (d.delegate != OPEN_DELEGATION && d.delegate != sender) {
|
|
489
554
|
return (false, "invalid-delegate");
|
|
490
555
|
}
|
|
556
|
+
if (d.delegate != OPEN_DELEGATION && Eip7702.isDelegatedEOA(sender)) {
|
|
557
|
+
return (false, "delegated-eoa-redeemer");
|
|
558
|
+
}
|
|
491
559
|
} else {
|
|
492
560
|
if (d.delegate != OPEN_DELEGATION && d.delegate != delegations[i - 1].delegator) {
|
|
493
561
|
return (false, "invalid-delegate-chain");
|
|
@@ -520,8 +588,8 @@ contract DelegationManager is IDelegationManager, ReentrancyGuard {
|
|
|
520
588
|
bytes32 digest,
|
|
521
589
|
bytes calldata signature
|
|
522
590
|
) internal view returns (bool) {
|
|
523
|
-
// ERC-1271 path for smart accounts
|
|
524
|
-
if (signer.code.length > 0) {
|
|
591
|
+
// ERC-1271 path for smart accounts; a 7702-delegated EOA signs by ECDSA only (spec 448 §0)
|
|
592
|
+
if (signer.code.length > 0 && !Eip7702.isDelegatedEOA(signer)) {
|
|
525
593
|
try IERC1271(signer).isValidSignature(digest, signature) returns (bytes4 result) {
|
|
526
594
|
return result == IERC1271.isValidSignature.selector;
|
|
527
595
|
} catch {
|
|
@@ -552,7 +620,12 @@ contract DelegationManager is IDelegationManager, ReentrancyGuard {
|
|
|
552
620
|
|
|
553
621
|
// Validate delegate
|
|
554
622
|
if (i == 0) {
|
|
555
|
-
if (d.delegate != OPEN_DELEGATION
|
|
623
|
+
if (d.delegate != OPEN_DELEGATION) {
|
|
624
|
+
if (d.delegate != msg.sender) revert InvalidDelegate();
|
|
625
|
+
// Spec 448 §0 (EIP-7702): a named delegate that is a delegated EOA is refused as the redeemer —
|
|
626
|
+
// anyone can make its attached code call, so its `msg.sender` proves nothing about its key.
|
|
627
|
+
Eip7702.refuseDelegatedEOA(msg.sender);
|
|
628
|
+
}
|
|
556
629
|
} else {
|
|
557
630
|
if (d.delegate != OPEN_DELEGATION && d.delegate != delegations[i - 1].delegator) revert InvalidDelegate();
|
|
558
631
|
}
|
|
@@ -652,8 +725,9 @@ contract DelegationManager is IDelegationManager, ReentrancyGuard {
|
|
|
652
725
|
bytes32 digest,
|
|
653
726
|
bytes calldata signature
|
|
654
727
|
) internal view {
|
|
655
|
-
// ERC-1271 for smart accounts
|
|
656
|
-
|
|
728
|
+
// ERC-1271 for smart accounts. Spec 448 §0 (EIP-7702): a delegated EOA's attached code is never asked
|
|
729
|
+
// "is this signature yours?" — it signs by ECDSA below, like any EOA.
|
|
730
|
+
if (signer.code.length > 0 && !Eip7702.isDelegatedEOA(signer)) {
|
|
657
731
|
bytes4 result = IERC1271(signer).isValidSignature(digest, signature);
|
|
658
732
|
if (result != IERC1271.isValidSignature.selector) revert DelegationManager_InvalidSignature();
|
|
659
733
|
return;
|
|
@@ -65,6 +65,31 @@ interface IDelegationManager {
|
|
|
65
65
|
/// present a struct whose signature verifies, so it cannot revoke a forged hash.
|
|
66
66
|
function revokeDelegationByOwner(Delegation calldata delegation) external;
|
|
67
67
|
|
|
68
|
+
/// @notice The chain context of the caveat hook now running (spec 450 §6): `links` is the number of
|
|
69
|
+
/// delegations in the chain being redeemed, `position` the root-first index of the delegation whose
|
|
70
|
+
/// caveat is being checked (0 = the root grant, `links - 1` = the leaf the redeemer holds). With both,
|
|
71
|
+
/// an enforcer can bound a chain's length (`links`) or the re-delegations made below its own link
|
|
72
|
+
/// (`links - 1 - position`).
|
|
73
|
+
/// @dev An OBSERVATION for caveat enforcers, valid only while one of THIS manager's `beforeHook` /
|
|
74
|
+
/// `afterHook` calls is running inside {redeemDelegation}. It is not an authority and grants nothing,
|
|
75
|
+
/// and it is not a count of redemptions. Outside a hook — no redemption in flight, during chain
|
|
76
|
+
/// validation or the executed call — it REVERTS `NotInCaveatHook()`; there is no sentinel that could
|
|
77
|
+
/// be mistaken for "depth 0". The view verifiers hold no context of their own: called outside a hook,
|
|
78
|
+
/// a caveat that reads this reverts and {verifyAuthorizationForCall} returns `(false,
|
|
79
|
+
/// "caveat-failed")`; called while a hook is running, both verifiers return `(false,
|
|
80
|
+
/// "in-redemption")` without evaluating anything, so they never judge a chain by another chain's
|
|
81
|
+
/// numbers. An enforcer must let the revert propagate (fail closed) and read this only from
|
|
82
|
+
/// `msg.sender`, the manager that called its hook; a manager without this function reverts too.
|
|
83
|
+
///
|
|
84
|
+
/// The rule for a depth enforcer (`links` alone is NOT it — it counts ancestors the link does not
|
|
85
|
+
/// control): in `beforeHook`, take `maxBelow` from the signed `terms`, never from the
|
|
86
|
+
/// redeemer-supplied `args`; read `(links, position)` from `msg.sender` and let a revert propagate;
|
|
87
|
+
/// revert unless `links - 1 - position <= maxBelow` (the re-delegations made below this link — the
|
|
88
|
+
/// chain is hash-linked, so an intermediary can neither change that count nor drop the caveat). Every
|
|
89
|
+
/// link carrying the caveat is checked, so the strictest ancestor wins; `maxBelow = 0` forbids any
|
|
90
|
+
/// re-delegation.
|
|
91
|
+
function redemptionDepth() external view returns (uint256 links, uint256 position);
|
|
92
|
+
|
|
68
93
|
/// @notice Check if a delegation has been revoked.
|
|
69
94
|
function isRevoked(bytes32 delegationHash) external view returns (bool);
|
|
70
95
|
|
|
@@ -76,6 +101,7 @@ interface IDelegationManager {
|
|
|
76
101
|
/// @dev ⚠️ DANGER — chain-only; does NOT evaluate caveats. `true` is NOT permission for any
|
|
77
102
|
/// specific call. Use {verifyAuthorizationForCall} (fail-closed, evaluates caveats) or live
|
|
78
103
|
/// redemption to authorize a concrete (target, value, calldata).
|
|
104
|
+
/// Returns `(false, "in-redemption")` while a caveat hook of a redemption on this manager is running.
|
|
79
105
|
/// @param delegations Delegation chain, leaf first
|
|
80
106
|
/// @param sender The address that would be the redeemer
|
|
81
107
|
/// @return ok True if the chain verifies
|
|
@@ -91,6 +117,8 @@ interface IDelegationManager {
|
|
|
91
117
|
/// and every caveat passes under `staticcall`; a denied OR non-view-evaluable caveat
|
|
92
118
|
/// yields `false` ("use live redemption"). Lets a registry bind consent to the exact
|
|
93
119
|
/// call inside its own transaction. Caveat evaluation mirrors `redeemDelegation`.
|
|
120
|
+
/// Returns `(false, "in-redemption")` while a caveat hook of a redemption on this manager is
|
|
121
|
+
/// running (spec 450 §6, see {redemptionDepth}); callable from the executed call.
|
|
94
122
|
/// @param delegations Delegation chain, leaf first
|
|
95
123
|
/// @param sender The address that would be the redeemer
|
|
96
124
|
/// @param target The exact target of the delegated call
|