@agenticprimitives/contracts 0.1.0-alpha.2 → 1.0.0-alpha.4
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
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@agenticprimitives/contracts",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "1.0.0-alpha.4",
|
|
4
4
|
"description": "Solidity contracts + ABIs + flattened sources + per-network deployment addresses for the agenticprimitives stack.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -28,6 +28,9 @@
|
|
|
28
28
|
"dist/flat",
|
|
29
29
|
"deployments-*.json"
|
|
30
30
|
],
|
|
31
|
+
"publishConfig": {
|
|
32
|
+
"access": "public"
|
|
33
|
+
},
|
|
31
34
|
"scripts": {
|
|
32
35
|
"setup": "bash setup.sh",
|
|
33
36
|
"build": "forge build && pnpm run build:abi",
|
|
@@ -41,8 +44,5 @@
|
|
|
41
44
|
"deploy:paymaster:anvil": "DEPLOY_NETWORK=anvil forge script script/DeployPaymaster.s.sol --rpc-url http://127.0.0.1:8545 --broadcast --private-key 0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80 --sig 'run()'",
|
|
42
45
|
"verify:base-sepolia": "bash scripts/verify-base-sepolia.sh",
|
|
43
46
|
"clean": "rm -rf out cache broadcast dist"
|
|
44
|
-
},
|
|
45
|
-
"publishConfig": {
|
|
46
|
-
"access": "public"
|
|
47
47
|
}
|
|
48
|
-
}
|
|
48
|
+
}
|
|
@@ -51,12 +51,26 @@ import "./governance/IGovernance.sol";
|
|
|
51
51
|
* The hash deliberately omits `paymasterAndData` from the userOp
|
|
52
52
|
* because the signature lives there.
|
|
53
53
|
*
|
|
54
|
+
* Construction modes (R5.7 / PKG-PAYMASTER-002 closure — external audit P0-2):
|
|
55
|
+
* The constructor takes `bool devMode_` + `address verifyingSigner_`
|
|
56
|
+
* EXPLICITLY. There is no implicit fail-open default; pre-R5.7 the
|
|
57
|
+
* constructor forcibly set `_dev = true` and production deploys had to
|
|
58
|
+
* remember to call `setDevMode(false) + setVerifyingSigner(...)` AFTER
|
|
59
|
+
* the broadcast, which left a window where the paymaster would sponsor
|
|
60
|
+
* any userOp on the freshly-deployed network. Now: testnet deploys pass
|
|
61
|
+
* `devMode_=true`; production deploys pass `devMode_=false` with a
|
|
62
|
+
* verifying signer (or allowlist seed). See `Deploy.s.sol`.
|
|
63
|
+
*
|
|
54
64
|
* Production checklist:
|
|
55
|
-
* 1.
|
|
56
|
-
*
|
|
57
|
-
*
|
|
58
|
-
*
|
|
59
|
-
*
|
|
65
|
+
* 1. Construct with `devMode_=false` AND either:
|
|
66
|
+
* - a non-zero `verifyingSigner_` for verifying-paymaster mode
|
|
67
|
+
* (preferred — Pimlico/Stackup/Alchemy pattern), OR
|
|
68
|
+
* - `verifyingSigner_=address(0)` to start in allowlist mode (no
|
|
69
|
+
* sender is sponsored until `setAccepted` runs). The fall-back
|
|
70
|
+
* to allowlist is fail-closed: every userOp reverts with
|
|
71
|
+
* `SenderNotAccepted` until governance explicitly opts a sender
|
|
72
|
+
* in. That is the documented safe state.
|
|
73
|
+
* 2. Monitor `getDeposit()` and alert below a runway threshold.
|
|
60
74
|
*
|
|
61
75
|
* @dev Inherits `addStake`, `unlockStake`, `withdrawStake`, `deposit`,
|
|
62
76
|
* and `withdrawTo` from `BasePaymaster`. Ownable owner is set in
|
|
@@ -102,15 +116,28 @@ contract SmartAgentPaymaster is BasePaymaster {
|
|
|
102
116
|
/// begins: 20 (paymaster addr) + 16 (verifGas) + 16 (postOpGas).
|
|
103
117
|
uint256 private constant PM_DATA_OFFSET = 52;
|
|
104
118
|
|
|
119
|
+
/// @param devMode_ true → accept-all (dev/anvil); false → require
|
|
120
|
+
/// verifying-signer or allowlist. R5.7 removed
|
|
121
|
+
/// the implicit fail-open default.
|
|
122
|
+
/// @param verifyingSigner_ EOA that signs paymaster envelopes when
|
|
123
|
+
/// `devMode_=false`. Pass `address(0)` to start
|
|
124
|
+
/// in allowlist mode (fail-closed until
|
|
125
|
+
/// `setAccepted` runs).
|
|
105
126
|
constructor(
|
|
106
127
|
IEntryPoint entryPointAddr,
|
|
107
128
|
address initialOwner,
|
|
108
|
-
address governance_
|
|
129
|
+
address governance_,
|
|
130
|
+
bool devMode_,
|
|
131
|
+
address verifyingSigner_
|
|
109
132
|
) BasePaymaster(entryPointAddr, initialOwner) {
|
|
110
133
|
if (governance_ == address(0)) revert ZeroGovernance();
|
|
111
134
|
governance = governance_;
|
|
112
|
-
_dev =
|
|
113
|
-
emit DevModeSet(
|
|
135
|
+
_dev = devMode_;
|
|
136
|
+
emit DevModeSet(devMode_);
|
|
137
|
+
if (verifyingSigner_ != address(0)) {
|
|
138
|
+
verifyingSigner = verifyingSigner_;
|
|
139
|
+
emit VerifyingSignerSet(address(0), verifyingSigner_);
|
|
140
|
+
}
|
|
114
141
|
}
|
|
115
142
|
|
|
116
143
|
// ─── Admin (governance-only) ────────────────────────────────────────
|
package/deployments-anvil.json
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"agentAccountFactory":"0xCf7Ed3AccA5a467e9e704C703E8D87F634fB0Fc9","agentAccountImplementation":"0xd8058efe0198ae9dD7D563e1b4938Dcbc86A1F81","agentNameRegistry":"0x9A676e781A523b5d0C0e43731313A708CB607508","agentNameResolver":"0x0B306BF915C4d645ff596e518fAf3F9669b97016","agentNameUniversalResolver":"0x959922bE3CAee4b8Cd9a407cc3ac1C251C2007B1","agentProfileResolver":"0x9E545E3C0baAB3E08CdfD552C960A1050f373042","agentRelationship":"0x7a2088a1bFc9d81c55368AE168C2C02570cB814F","allowedMethodsEnforcer":"0x0165878A594ca255338adfa4d48449f69242Eb8F","allowedTargetsEnforcer":"0x5FC8d32690cc91D4c39d9d3abcBD16989F875707","approvedHashRegistry":"0x8A791620dd6260079BF849Dc5567aDC3F2FdC318","chainId":31337,"custodyPolicy":"0x9fE46736679d2D9a65F0992F2272dE9f3c7fa6e0","delegationManager":"0xe7f1725E7734CE288F8367e1Bb143E90bb3F0512","deployer":"0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266","entryPoint":"0x5FbDB2315678afecb367f032d93F642f64180aa3","ontologyTermRegistry":"0xA51c1fc2f0D1a1b8494Ed1FE312d7C3a78Ed91C0","permissionlessSubregistry":"0x322813Fd9A801c5507c9de605d63CEA4f2CE6c44","quorumEnforcer":"0x2279B7A0a67DB372996a5FaB50D91eAA73d2eBe6","relationshipTypeRegistry":"0x4A679253410272dd5232B3Ff7cF5dbB88f295319","shapeRegistry":"0x0DCd1Bf9A1b36cE34237eEaFef220932846BCD82","smartAgentPaymaster":"0x610178dA211FEF7D417bC0e6FeD39F05609AD788","timestampEnforcer":"0xDc64a140Aa3E981100a9becA4E685f962f0cF6C9","universalSignatureValidator":"0xB7f8BC63BbcaD18155201308C8f3540b07f84F5e","valueEnforcer":"0xa513E6E4b8f2a923D98304ec87F64353C4D5C853"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"agentAccountFactory":"0x7Aac638824014210349497440D3CE631A95b466c","agentAccountImplementation":"0x235FD455040874B224A671456DA06221868a9CA1","agentNameRegistry":"0xE9Bf4f67701Ba6eD7843b9848c3fe0C6e0212427","agentNameResolver":"0x6EB256475EeC2B6A64a2a2b4dC0D23718c8e6fD8","agentNameUniversalResolver":"0xb66a4829606C4E1C5eB424314b681343c747b4B2","agentProfileResolver":"0xe899C0Cca981e3e5dA44e8E0d8f1f447436cb773","agentRelationship":"0xB85BA211d6528BE2561a41b629537e5054B648DF","allowedMethodsEnforcer":"0x0229763ACb6AAaC5e99DFf20d0c44B6E34D5503D","allowedTargetsEnforcer":"0xe16f0185348283574500a6721A91526ec27da83f","approvedHashRegistry":"0x51cad9dBd1437CaC53604750c09ffD3745f6cA6a","chainId":84532,"custodyPolicy":"0xfdbCB192182712C996a1Ed2FB74D0FE6e7d9db26","delegationManager":"0xaEb6191FFa086a0288A6367eC5D816344A6089f2","deployer":"0x31ed17fb99e82E02085Ab4B3cbdaB05489098b44","entryPoint":"0x094700EB9F743F462b0E59a68084d6be56F3Ed96","ontologyTermRegistry":"0x79964Fb5475F1Acf5865613Ce32de22D5E3964B6","permissionlessSubregistry":"0xC5060624c6C8Ed9E453b6693111eC8f40eDe8110","quorumEnforcer":"0x1DED75C0E7e12C59305130dC43AAE3C08E1f66AF","relationshipTypeRegistry":"0x3954E220166fd3BDE53D283ebE13FfC9Be84fF46","shapeRegistry":"0x5071d2c6Fc351acD44766dd69dBbC2760567FEb8","smartAgentPaymaster":"0x2b825942d733B72DeD8125EBec022b39F16EB6d3","timestampEnforcer":"0xb164Cc23A37b7EB84b2788F8906C506b12EFEc99","universalSignatureValidator":"0x1a8740E1590aA71306F2b611b9cBE3A00D449732","valueEnforcer":"0xeC1365428bbF42Ab8dEE80a3C1aba21Fc3014f60"}
|