@sherwoodagent/cli 0.85.0 → 0.85.1
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/dist/{chunk-ILHOW6IA.js → chunk-FPB23SDH.js} +191 -59
- package/dist/chunk-FPB23SDH.js.map +1 -0
- package/dist/{identity-RMEPBFOL.js → identity-3A2D7DGS.js} +2 -2
- package/dist/index.js +3 -3
- package/package.json +1 -1
- package/dist/chunk-ILHOW6IA.js.map +0 -1
- /package/dist/{identity-RMEPBFOL.js.map → identity-3A2D7DGS.js.map} +0 -0
|
@@ -321,6 +321,25 @@ var SYNDICATE_VAULT_ABI = [
|
|
|
321
321
|
],
|
|
322
322
|
outputs: [{ name: "requestId", type: "uint256" }]
|
|
323
323
|
},
|
|
324
|
+
// Lane B deposit escrow. Assets are held OFF-vault by the queue so they
|
|
325
|
+
// neither inflate totalAssets nor get swept into the strategy.
|
|
326
|
+
{
|
|
327
|
+
name: "requestDeposit",
|
|
328
|
+
type: "function",
|
|
329
|
+
stateMutability: "nonpayable",
|
|
330
|
+
inputs: [
|
|
331
|
+
{ name: "assets", type: "uint256" },
|
|
332
|
+
{ name: "receiver", type: "address" }
|
|
333
|
+
],
|
|
334
|
+
outputs: [{ name: "requestId", type: "uint256" }]
|
|
335
|
+
},
|
|
336
|
+
{
|
|
337
|
+
name: "withdrawalQueue",
|
|
338
|
+
type: "function",
|
|
339
|
+
stateMutability: "view",
|
|
340
|
+
inputs: [],
|
|
341
|
+
outputs: [{ name: "", type: "address" }]
|
|
342
|
+
},
|
|
324
343
|
// Reads
|
|
325
344
|
{
|
|
326
345
|
name: "asset",
|
|
@@ -441,12 +460,15 @@ var SYNDICATE_VAULT_ABI = [
|
|
|
441
460
|
outputs: []
|
|
442
461
|
},
|
|
443
462
|
{
|
|
463
|
+
// ARGUMENT ORDER IS (agentId, agentAddress), NOT the reverse. The flipped
|
|
464
|
+
// tuple is a DIFFERENT function (0x3543ad58) that no deployed vault has —
|
|
465
|
+
// it reverts with empty returndata, giving the caller no signal (SHE-185).
|
|
444
466
|
name: "registerAgent",
|
|
445
467
|
type: "function",
|
|
446
468
|
stateMutability: "nonpayable",
|
|
447
469
|
inputs: [
|
|
448
|
-
{ name: "
|
|
449
|
-
{ name: "
|
|
470
|
+
{ name: "agentId", type: "uint256" },
|
|
471
|
+
{ name: "agentAddress", type: "address" }
|
|
450
472
|
],
|
|
451
473
|
outputs: []
|
|
452
474
|
},
|
|
@@ -812,13 +834,8 @@ var SYNDICATE_GOVERNOR_ABI = [
|
|
|
812
834
|
}
|
|
813
835
|
]
|
|
814
836
|
},
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
type: "function",
|
|
818
|
-
stateMutability: "view",
|
|
819
|
-
inputs: [],
|
|
820
|
-
outputs: [{ name: "", type: "address" }]
|
|
821
|
-
},
|
|
837
|
+
// protocolFeeRecipient() is NOT on the governor — fees moved to
|
|
838
|
+
// ProtocolConfig (#421). Read it off PROTOCOL_CONFIG_ABI instead (SHE-185).
|
|
822
839
|
{
|
|
823
840
|
name: "FeeClamped",
|
|
824
841
|
type: "event",
|
|
@@ -958,7 +975,43 @@ var PROTOCOL_CONFIG_ABI = [
|
|
|
958
975
|
}
|
|
959
976
|
];
|
|
960
977
|
var GUARDIAN_REGISTRY_ABI = [
|
|
961
|
-
// Guardian stake
|
|
978
|
+
// Guardian staking, unstaking and stake reads are NOT on this contract —
|
|
979
|
+
// the sWOOD split moved them to StakedWood, which is the sole WOOD
|
|
980
|
+
// custodian. They lived here until SHE-185; sending stakeAsGuardian /
|
|
981
|
+
// requestUnstakeGuardian / cancelUnstakeGuardian / claimUnstakeGuardian /
|
|
982
|
+
// guardianStake / isActiveGuardian to the registry reverts with empty
|
|
983
|
+
// returndata. Use STAKED_WOOD_ABI against `sherwood.stakedWood`.
|
|
984
|
+
// Guardian review vote — 3 args, no slashBps. Selector 0x3ad95b6d.
|
|
985
|
+
// GuardianVoteType: None=0, Approve=1, Block=2 (uint8).
|
|
986
|
+
{
|
|
987
|
+
name: "voteOnProposal",
|
|
988
|
+
type: "function",
|
|
989
|
+
stateMutability: "nonpayable",
|
|
990
|
+
inputs: [
|
|
991
|
+
{ name: "governor", type: "address" },
|
|
992
|
+
{ name: "proposalId", type: "uint256" },
|
|
993
|
+
{ name: "support", type: "uint8" }
|
|
994
|
+
],
|
|
995
|
+
outputs: []
|
|
996
|
+
},
|
|
997
|
+
// Cached review flags. Returns THREE bools (opened, resolved, blocked).
|
|
998
|
+
// A fourth output is the SHE-88 arity break: viem refuses the 96-byte returndata.
|
|
999
|
+
{
|
|
1000
|
+
name: "getReviewState",
|
|
1001
|
+
type: "function",
|
|
1002
|
+
stateMutability: "view",
|
|
1003
|
+
inputs: [
|
|
1004
|
+
{ name: "governor", type: "address" },
|
|
1005
|
+
{ name: "proposalId", type: "uint256" }
|
|
1006
|
+
],
|
|
1007
|
+
outputs: [
|
|
1008
|
+
{ name: "opened", type: "bool" },
|
|
1009
|
+
{ name: "resolved", type: "bool" },
|
|
1010
|
+
{ name: "blocked", type: "bool" }
|
|
1011
|
+
]
|
|
1012
|
+
}
|
|
1013
|
+
];
|
|
1014
|
+
var STAKED_WOOD_ABI = [
|
|
962
1015
|
{
|
|
963
1016
|
name: "stakeAsGuardian",
|
|
964
1017
|
type: "function",
|
|
@@ -969,6 +1022,8 @@ var GUARDIAN_REGISTRY_ABI = [
|
|
|
969
1022
|
],
|
|
970
1023
|
outputs: []
|
|
971
1024
|
},
|
|
1025
|
+
// Self-stake unstake flow. Moved off GUARDIAN_REGISTRY_ABI in SHE-185 —
|
|
1026
|
+
// the registry holds zero WOOD and implements none of these.
|
|
972
1027
|
{
|
|
973
1028
|
name: "requestUnstakeGuardian",
|
|
974
1029
|
type: "function",
|
|
@@ -990,9 +1045,6 @@ var GUARDIAN_REGISTRY_ABI = [
|
|
|
990
1045
|
inputs: [],
|
|
991
1046
|
outputs: []
|
|
992
1047
|
},
|
|
993
|
-
// Delegation and commission fragments removed (SHE-86): delegateStake,
|
|
994
|
-
// requestUnstakeDelegation, cancelUnstakeDelegation, claimUnstakeDelegation
|
|
995
|
-
// and setCommission do not exist on the post-audit contracts.
|
|
996
1048
|
// Reads
|
|
997
1049
|
{
|
|
998
1050
|
name: "guardianStake",
|
|
@@ -1007,47 +1059,6 @@ var GUARDIAN_REGISTRY_ABI = [
|
|
|
1007
1059
|
stateMutability: "view",
|
|
1008
1060
|
inputs: [{ name: "guardian", type: "address" }],
|
|
1009
1061
|
outputs: [{ name: "", type: "bool" }]
|
|
1010
|
-
},
|
|
1011
|
-
// Guardian review vote — 3 args, no slashBps. Selector 0x3ad95b6d.
|
|
1012
|
-
// GuardianVoteType: None=0, Approve=1, Block=2 (uint8).
|
|
1013
|
-
{
|
|
1014
|
-
name: "voteOnProposal",
|
|
1015
|
-
type: "function",
|
|
1016
|
-
stateMutability: "nonpayable",
|
|
1017
|
-
inputs: [
|
|
1018
|
-
{ name: "governor", type: "address" },
|
|
1019
|
-
{ name: "proposalId", type: "uint256" },
|
|
1020
|
-
{ name: "support", type: "uint8" }
|
|
1021
|
-
],
|
|
1022
|
-
outputs: []
|
|
1023
|
-
},
|
|
1024
|
-
// Cached review flags. Returns THREE bools (opened, resolved, blocked).
|
|
1025
|
-
// A fourth output is the SHE-88 arity break: viem refuses the 96-byte returndata.
|
|
1026
|
-
{
|
|
1027
|
-
name: "getReviewState",
|
|
1028
|
-
type: "function",
|
|
1029
|
-
stateMutability: "view",
|
|
1030
|
-
inputs: [
|
|
1031
|
-
{ name: "governor", type: "address" },
|
|
1032
|
-
{ name: "proposalId", type: "uint256" }
|
|
1033
|
-
],
|
|
1034
|
-
outputs: [
|
|
1035
|
-
{ name: "opened", type: "bool" },
|
|
1036
|
-
{ name: "resolved", type: "bool" },
|
|
1037
|
-
{ name: "blocked", type: "bool" }
|
|
1038
|
-
]
|
|
1039
|
-
}
|
|
1040
|
-
];
|
|
1041
|
-
var STAKED_WOOD_ABI = [
|
|
1042
|
-
{
|
|
1043
|
-
name: "stakeAsGuardian",
|
|
1044
|
-
type: "function",
|
|
1045
|
-
stateMutability: "nonpayable",
|
|
1046
|
-
inputs: [
|
|
1047
|
-
{ name: "amount", type: "uint256" },
|
|
1048
|
-
{ name: "agentId", type: "uint256" }
|
|
1049
|
-
],
|
|
1050
|
-
outputs: []
|
|
1051
1062
|
}
|
|
1052
1063
|
];
|
|
1053
1064
|
var ERC20_ABI = [
|
|
@@ -1176,6 +1187,126 @@ var STRATEGY_FACTORY_ABI = [
|
|
|
1176
1187
|
}
|
|
1177
1188
|
];
|
|
1178
1189
|
|
|
1190
|
+
// ../sdk/dist/protocol-selectors.js
|
|
1191
|
+
var PROTOCOL_SELECTORS = {
|
|
1192
|
+
propose: {
|
|
1193
|
+
iface: "ISyndicateGovernor",
|
|
1194
|
+
signature: "propose(address,address,string,uint256,(uint256,uint16),(address,bytes,uint256)[],uint256[],(address,bytes,uint256)[],uint256[],(address,uint256)[])",
|
|
1195
|
+
selector: "0x784ea274"
|
|
1196
|
+
},
|
|
1197
|
+
proposeWithSandbox: {
|
|
1198
|
+
iface: "ISyndicateGovernor",
|
|
1199
|
+
signature: "proposeWithSandbox((uint256,(address,bytes)[],address[]),address,address,string,uint256,(uint256,uint16),(address,bytes,uint256)[],uint256[],(address,bytes,uint256)[],uint256[],(address,uint256)[])",
|
|
1200
|
+
selector: "0x16c0fa9c"
|
|
1201
|
+
},
|
|
1202
|
+
voteOnProposal: {
|
|
1203
|
+
iface: "IGuardianRegistry",
|
|
1204
|
+
signature: "voteOnProposal(address,uint256,uint8)",
|
|
1205
|
+
selector: "0x3ad95b6d"
|
|
1206
|
+
},
|
|
1207
|
+
getReviewState: {
|
|
1208
|
+
iface: "IGuardianRegistry",
|
|
1209
|
+
signature: "getReviewState(address,uint256)",
|
|
1210
|
+
selector: "0x043bd8b9"
|
|
1211
|
+
},
|
|
1212
|
+
runSandbox: {
|
|
1213
|
+
iface: "ISyndicateVault",
|
|
1214
|
+
signature: "runSandbox(uint256,(address,bytes)[],address[],uint256)",
|
|
1215
|
+
selector: "0xb0f4c59d"
|
|
1216
|
+
},
|
|
1217
|
+
sweep: {
|
|
1218
|
+
iface: "ICallSandbox",
|
|
1219
|
+
signature: "sweep()",
|
|
1220
|
+
selector: "0x35faa416"
|
|
1221
|
+
}
|
|
1222
|
+
};
|
|
1223
|
+
var API_CALLDATA_SELECTORS = {
|
|
1224
|
+
deposit: [
|
|
1225
|
+
{ target: "erc20", selector: "0x095ea7b3", signature: "approve(address,uint256)", external: true },
|
|
1226
|
+
{ target: "vault", selector: "0x6e553f65", signature: "deposit(uint256,address)" }
|
|
1227
|
+
],
|
|
1228
|
+
redeem: [
|
|
1229
|
+
{ target: "vault", selector: "0xba087652", signature: "redeem(uint256,address,address)" }
|
|
1230
|
+
],
|
|
1231
|
+
"request-redeem": [
|
|
1232
|
+
{ target: "vault", selector: "0x107703ab", signature: "requestRedeem(uint256,address)" }
|
|
1233
|
+
],
|
|
1234
|
+
"request-deposit": [
|
|
1235
|
+
{ target: "erc20", selector: "0x095ea7b3", signature: "approve(address,uint256)", external: true },
|
|
1236
|
+
{ target: "vault", selector: "0x29344f08", signature: "requestDeposit(uint256,address)" }
|
|
1237
|
+
],
|
|
1238
|
+
"queue-claim": [
|
|
1239
|
+
{ target: "queue", selector: "0x379607f5", signature: "claim(uint256)" }
|
|
1240
|
+
],
|
|
1241
|
+
"queue-cancel": [
|
|
1242
|
+
{ target: "queue", selector: "0x40e58ee5", signature: "cancel(uint256)" }
|
|
1243
|
+
],
|
|
1244
|
+
"strategy-deploy": [
|
|
1245
|
+
{ target: "strategyFactory", selector: "0x26ab0cd4", signature: "cloneAndInitDeterministic(address,address,address,bytes,bytes32)" }
|
|
1246
|
+
],
|
|
1247
|
+
propose: [
|
|
1248
|
+
{ target: "governor", selector: "0x784ea274", signature: PROTOCOL_SELECTORS.propose.signature }
|
|
1249
|
+
],
|
|
1250
|
+
"propose-with-sandbox": [
|
|
1251
|
+
{ target: "governor", selector: "0x16c0fa9c", signature: PROTOCOL_SELECTORS.proposeWithSandbox.signature }
|
|
1252
|
+
],
|
|
1253
|
+
vote: [
|
|
1254
|
+
{ target: "governor", selector: "0x943e8216", signature: "vote(uint256,uint8)" }
|
|
1255
|
+
],
|
|
1256
|
+
"vote-on-proposal": [
|
|
1257
|
+
{ target: "guardianRegistry", selector: "0x3ad95b6d", signature: PROTOCOL_SELECTORS.voteOnProposal.signature }
|
|
1258
|
+
],
|
|
1259
|
+
execute: [
|
|
1260
|
+
{ target: "governor", selector: "0x0d61b519", signature: "executeProposal(uint256)" }
|
|
1261
|
+
],
|
|
1262
|
+
settle: [
|
|
1263
|
+
{ target: "governor", selector: "0x2473ad34", signature: "settleProposal(uint256)" }
|
|
1264
|
+
],
|
|
1265
|
+
cancel: [
|
|
1266
|
+
{ target: "governor", selector: "0xe0a8f6f5", signature: "cancelProposal(uint256)" }
|
|
1267
|
+
],
|
|
1268
|
+
veto: [
|
|
1269
|
+
{ target: "governor", selector: "0x6f65108c", signature: "vetoProposal(uint256)" }
|
|
1270
|
+
],
|
|
1271
|
+
unstick: [
|
|
1272
|
+
{ target: "governor", selector: "0x83170f05", signature: "unstick(uint256)" }
|
|
1273
|
+
],
|
|
1274
|
+
"emergency-settle": [
|
|
1275
|
+
{ target: "governor", selector: "0xf1f21adc", signature: "emergencySettleWithCalls(uint256,(address,bytes,uint256)[])" }
|
|
1276
|
+
],
|
|
1277
|
+
"governor-set": [
|
|
1278
|
+
{ target: "governor", selector: "0xea0217cf", signature: "setVotingPeriod(uint256)" }
|
|
1279
|
+
],
|
|
1280
|
+
"create-fund": [
|
|
1281
|
+
{ target: "factory", selector: "0xd902f450", signature: "createSyndicate(uint256,(string,address,string,string,bool,string))" }
|
|
1282
|
+
],
|
|
1283
|
+
"approve-depositor": [
|
|
1284
|
+
{ target: "vault", selector: "0x8e6a1bb3", signature: "approveDepositor(address)" }
|
|
1285
|
+
],
|
|
1286
|
+
// (agentId, agentAddress). The flipped tuple is
|
|
1287
|
+
// KNOWN_BREAKAGE_SELECTORS.registerAgentFlipped and exists on no deployed vault.
|
|
1288
|
+
"register-agent": [
|
|
1289
|
+
{ target: "vault", selector: "0x047d4c27", signature: "registerAgent(uint256,address)" }
|
|
1290
|
+
],
|
|
1291
|
+
"approve-agent": [
|
|
1292
|
+
{ target: "vault", selector: "0x047d4c27", signature: "registerAgent(uint256,address)" },
|
|
1293
|
+
{ target: "eas", selector: "0xf17325e7", signature: "attest((bytes32,(address,uint64,bool,bytes32,bytes,uint256)))", external: true }
|
|
1294
|
+
],
|
|
1295
|
+
join: [
|
|
1296
|
+
{ target: "eas", selector: "0xf17325e7", signature: "attest((bytes32,(address,uint64,bool,bytes32,bytes,uint256)))", external: true }
|
|
1297
|
+
],
|
|
1298
|
+
"identity-mint": [
|
|
1299
|
+
{ target: "identityRegistry", selector: "0x8ea42286", signature: "register(string,(string,bytes)[])", external: true }
|
|
1300
|
+
],
|
|
1301
|
+
// sWOOD, not the registry — see the note above.
|
|
1302
|
+
"guardian-stake": [
|
|
1303
|
+
{ target: "stakedWood", selector: "0xfc1d6c63", signature: "stakeAsGuardian(uint256,uint256)" }
|
|
1304
|
+
],
|
|
1305
|
+
"guardian-unstake": [
|
|
1306
|
+
{ target: "stakedWood", selector: "0xf4714817", signature: "requestUnstakeGuardian()" }
|
|
1307
|
+
]
|
|
1308
|
+
};
|
|
1309
|
+
|
|
1179
1310
|
// ../sdk/dist/addresses.js
|
|
1180
1311
|
var ZERO_ADDRESS = "0x0000000000000000000000000000000000000000";
|
|
1181
1312
|
var ZERO_BYTES32 = "0x0000000000000000000000000000000000000000000000000000000000000000";
|
|
@@ -1584,7 +1715,8 @@ function encodeRegisterAgent(args, chainId) {
|
|
|
1584
1715
|
data: encodeFunctionData({
|
|
1585
1716
|
abi: SYNDICATE_VAULT_ABI,
|
|
1586
1717
|
functionName: "registerAgent",
|
|
1587
|
-
|
|
1718
|
+
// (agentId, agentAddress) — the protocol's order. See abis.ts.
|
|
1719
|
+
args: [id, agentAddress]
|
|
1588
1720
|
}),
|
|
1589
1721
|
value: ZERO_VALUE,
|
|
1590
1722
|
chainId
|
|
@@ -2404,15 +2536,15 @@ function encodeGuardianUnstake(args, chainId) {
|
|
|
2404
2536
|
throw usage(`\`action\` must be one of: ${Object.keys(GUARDIAN_UNSTAKE_FN).join(", ")}`);
|
|
2405
2537
|
}
|
|
2406
2538
|
const data = encodeFunctionData7({
|
|
2407
|
-
abi:
|
|
2539
|
+
abi: STAKED_WOOD_ABI,
|
|
2408
2540
|
functionName: fn,
|
|
2409
2541
|
args: []
|
|
2410
2542
|
});
|
|
2411
2543
|
return {
|
|
2412
|
-
txs: [
|
|
2544
|
+
txs: [swoodTx(chainId, data)],
|
|
2413
2545
|
preconditions: [],
|
|
2414
2546
|
description: `Guardian unstake ${args.action}.`,
|
|
2415
|
-
note: args.action === "request" ? "Starts a 7-day cooldown. After it elapses, call again with action=claim to withdraw." : args.action === "claim" ? "Withdraws the unstake amount once the 7-day cooldown has elapsed." : "Cancels a pending unstake request and re-activates the guardian."
|
|
2547
|
+
note: args.action === "request" ? "Targets sWOOD (StakedWood), not the guardian registry. Starts a 7-day cooldown. After it elapses, call again with action=claim to withdraw." : args.action === "claim" ? "Withdraws the unstake amount once the 7-day cooldown has elapsed." : "Cancels a pending unstake request and re-activates the guardian."
|
|
2416
2548
|
};
|
|
2417
2549
|
}
|
|
2418
2550
|
function encodeVoteOnProposal(args, chainId) {
|
|
@@ -2968,4 +3100,4 @@ export {
|
|
|
2968
3100
|
lookupAgentIdByWallet,
|
|
2969
3101
|
registerIdentityCommands
|
|
2970
3102
|
};
|
|
2971
|
-
//# sourceMappingURL=chunk-
|
|
3103
|
+
//# sourceMappingURL=chunk-FPB23SDH.js.map
|