@agenticprimitives/contracts 1.0.0-alpha.21 → 1.0.0-alpha.22
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/package.json +1 -1
- package/src/AgentAccount.sol +20 -0
- package/src/AgentAccountFactory.sol +14 -3
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@agenticprimitives/contracts",
|
|
3
|
-
"version": "1.0.0-alpha.
|
|
3
|
+
"version": "1.0.0-alpha.22",
|
|
4
4
|
"description": "Solidity contracts + ABIs + flattened sources + per-network deployment addresses for the agenticprimitives stack.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
package/src/AgentAccount.sol
CHANGED
|
@@ -1112,6 +1112,17 @@ contract AgentAccount is
|
|
|
1112
1112
|
/// EntryPoint / self / DelegationManager; the guard hardens
|
|
1113
1113
|
/// against a malicious target re-entering through one of those
|
|
1114
1114
|
/// callers.
|
|
1115
|
+
///
|
|
1116
|
+
/// Slither reports `reentrancy-eth` here because `_delegationExecCtx`
|
|
1117
|
+
/// is written after the external calls. The write is `= false`, and the
|
|
1118
|
+
/// flag is RESTRICTIVE while set: `_rejectDelegatedGovernance` reverts a
|
|
1119
|
+
/// delegation-originated governance self-call only when it is true. A
|
|
1120
|
+
/// reentrant frame therefore observes the *more* restricted state, never
|
|
1121
|
+
/// a bypass — and the only readers of the flag are `execute` (guarded by
|
|
1122
|
+
/// `nonReentrant` on this very function) and `executeBatch`, whose own
|
|
1123
|
+
/// exemption is justified at its declaration. The flag is transient
|
|
1124
|
+
/// (EIP-1153), so it cannot survive the transaction either.
|
|
1125
|
+
// slither-disable-next-line reentrancy-eth
|
|
1115
1126
|
function execute(address target, uint256 value, bytes calldata data) external override nonReentrant whenNotPaused {
|
|
1116
1127
|
_requireForExecute();
|
|
1117
1128
|
|
|
@@ -1174,6 +1185,15 @@ contract AgentAccount is
|
|
|
1174
1185
|
/// OUTER `execute` already holds the guard, so external re-entry
|
|
1175
1186
|
/// is blocked; `_requireForExecute` restricts entry to
|
|
1176
1187
|
/// EntryPoint / self / DM (DM has its own `nonReentrant`).
|
|
1188
|
+
///
|
|
1189
|
+
/// Slither reports `reentrancy-eth` here for the same reason as
|
|
1190
|
+
/// `execute`, and it is a false positive for the same reason: the
|
|
1191
|
+
/// post-call write clears `_delegationExecCtx`, a transient flag that
|
|
1192
|
+
/// only ever *adds* a restriction while set. Note this function is
|
|
1193
|
+
/// deliberately un-guarded (see above), so the suppression is scoped to
|
|
1194
|
+
/// this detector on this declaration only — any other high-severity
|
|
1195
|
+
/// finding here still fails the build.
|
|
1196
|
+
// slither-disable-next-line reentrancy-eth
|
|
1177
1197
|
function executeBatch(Call[] calldata calls) external override whenNotPaused {
|
|
1178
1198
|
_requireForExecute();
|
|
1179
1199
|
|
|
@@ -357,8 +357,18 @@ contract AgentAccountFactory is GovernanceManaged {
|
|
|
357
357
|
if (thresholds[5] > sodCap) thresholds[5] = sodCap;
|
|
358
358
|
}
|
|
359
359
|
|
|
360
|
+
// DEV/TEST-CHAIN CARVE-OUT (local demo only): on a local development chain the T4 floor is lifted
|
|
361
|
+
// so a demo can drive an admin custody action's schedule→apply back-to-back without a real-time
|
|
362
|
+
// wait, and a zero override yields a ZERO T4 safety delay instead of the 1-hour production default.
|
|
363
|
+
// Gated strictly by `block.chainid` — anvil (31337/1337) and the local faithchain (34348). Every
|
|
364
|
+
// PRODUCTION and public TESTNET chain id (Base Sepolia 84532, mainnet, …) keeps the audited
|
|
365
|
+
// EXT-TL-FLOOR-1 invariant. T5 (24h) and T6 (recovery, 48h) are NOT relaxed even on dev — the
|
|
366
|
+
// CustodyPolicy requires a non-zero timelock for those tiers, and the demo only exercises T4.
|
|
367
|
+
bool devChain = block.chainid == 31337 || block.chainid == 1337 || block.chainid == 34348;
|
|
368
|
+
uint32 floor4 = devChain ? 0 : uint32(1 hours);
|
|
369
|
+
|
|
360
370
|
uint32[7] memory timelocks;
|
|
361
|
-
timelocks[4] = timelockOverrides[4] == 0 ?
|
|
371
|
+
timelocks[4] = timelockOverrides[4] == 0 ? floor4 : timelockOverrides[4];
|
|
362
372
|
timelocks[5] = timelockOverrides[5] == 0 ? uint32(24 hours) : timelockOverrides[5];
|
|
363
373
|
timelocks[6] = timelockOverrides[6] == 0 ? uint32(48 hours) : timelockOverrides[6];
|
|
364
374
|
|
|
@@ -366,8 +376,9 @@ contract AgentAccountFactory is GovernanceManaged {
|
|
|
366
376
|
// below the product floor. A zero override inherits the floor default above; a non-zero override below
|
|
367
377
|
// the floor reverts, so a mode>0 (custody-governed) account can never deploy with sub-floor T4/T5/T6
|
|
368
378
|
// (recovery = T6) delays. The "T5=24h / recovery=48h" guarantee becomes a protocol invariant, not a UI
|
|
369
|
-
// convention (spec 300 — raise-only).
|
|
370
|
-
|
|
379
|
+
// convention (spec 300 — raise-only). The T4 floor is `floor4` (production value on real chains, 0 on
|
|
380
|
+
// the dev-chain carve-out); T5/T6 keep their audited floors on every chain.
|
|
381
|
+
if (timelocks[4] < floor4) revert TimelockBelowFloor(4, timelocks[4], floor4);
|
|
371
382
|
if (timelocks[5] < 24 hours) revert TimelockBelowFloor(5, timelocks[5], uint32(24 hours));
|
|
372
383
|
if (timelocks[6] < 48 hours) revert TimelockBelowFloor(6, timelocks[6], uint32(48 hours));
|
|
373
384
|
|