@sherwoodagent/cli 0.11.0 → 0.12.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/{chat-2X5FQI5X.js → chat-3PQDDLVR.js} +4 -4
- package/dist/{chunk-DVWORPEY.js → chunk-LEQLX7XF.js} +1 -1
- package/dist/chunk-LEQLX7XF.js.map +1 -0
- package/dist/{chunk-6IUSJWAL.js → chunk-SQID2KF4.js} +5 -50
- package/dist/chunk-SQID2KF4.js.map +1 -0
- package/dist/{chunk-56W62BYY.js → chunk-TTGRYJYY.js} +2 -2
- package/dist/{chunk-IXMM3TT3.js → chunk-X34TJQ4P.js} +69 -96
- package/dist/chunk-X34TJQ4P.js.map +1 -0
- package/dist/{eas-HQ5OTAFW.js → eas-4GIQARSZ.js} +3 -3
- package/dist/index.js +84 -142
- package/dist/index.js.map +1 -1
- package/dist/{ipfs-P3NVJQCF.js → ipfs-LUJHZGKF.js} +2 -2
- package/dist/{research-PLYYYJ4F.js → research-O44AJLGZ.js} +4 -4
- package/dist/{session-QBWUWXCH.js → session-5FYVX2DW.js} +5 -6
- package/dist/{session-QBWUWXCH.js.map → session-5FYVX2DW.js.map} +1 -1
- package/dist/{xmtp-A5G2GEWF.js → xmtp-ZGW4KGC4.js} +3 -3
- package/package.json +1 -1
- package/dist/chunk-6IUSJWAL.js.map +0 -1
- package/dist/chunk-DVWORPEY.js.map +0 -1
- package/dist/chunk-IXMM3TT3.js.map +0 -1
- /package/dist/{chat-2X5FQI5X.js.map → chat-3PQDDLVR.js.map} +0 -0
- /package/dist/{chunk-56W62BYY.js.map → chunk-TTGRYJYY.js.map} +0 -0
- /package/dist/{eas-HQ5OTAFW.js.map → eas-4GIQARSZ.js.map} +0 -0
- /package/dist/{ipfs-P3NVJQCF.js.map → ipfs-LUJHZGKF.js.map} +0 -0
- /package/dist/{research-PLYYYJ4F.js.map → research-O44AJLGZ.js.map} +0 -0
- /package/dist/{xmtp-A5G2GEWF.js.map → xmtp-ZGW4KGC4.js.map} +0 -0
package/dist/index.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import {
|
|
3
3
|
fetchMetadata,
|
|
4
4
|
uploadMetadata
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-LEQLX7XF.js";
|
|
6
6
|
import {
|
|
7
7
|
createApproval,
|
|
8
8
|
createJoinRequest,
|
|
@@ -10,7 +10,7 @@ import {
|
|
|
10
10
|
queryApprovals,
|
|
11
11
|
queryJoinRequests,
|
|
12
12
|
revokeAttestation
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-TTGRYJYY.js";
|
|
14
14
|
import {
|
|
15
15
|
approveDepositor,
|
|
16
16
|
deposit,
|
|
@@ -20,15 +20,13 @@ import {
|
|
|
20
20
|
getVaultAddress,
|
|
21
21
|
getVaultInfo,
|
|
22
22
|
isAgent,
|
|
23
|
-
ragequit,
|
|
24
23
|
registerAgent,
|
|
25
24
|
removeDepositor,
|
|
26
25
|
resolveSyndicate,
|
|
27
26
|
resolveVaultSyndicate,
|
|
28
27
|
setTextRecord,
|
|
29
|
-
setVaultAddress
|
|
30
|
-
|
|
31
|
-
} from "./chunk-6IUSJWAL.js";
|
|
28
|
+
setVaultAddress
|
|
29
|
+
} from "./chunk-SQID2KF4.js";
|
|
32
30
|
import {
|
|
33
31
|
AGENT_REGISTRY,
|
|
34
32
|
EAS_SCHEMAS,
|
|
@@ -44,7 +42,7 @@ import {
|
|
|
44
42
|
UNISWAP_QUOTER_V2_ABI,
|
|
45
43
|
VENICE,
|
|
46
44
|
VENICE_STAKING_ABI
|
|
47
|
-
} from "./chunk-
|
|
45
|
+
} from "./chunk-X34TJQ4P.js";
|
|
48
46
|
import {
|
|
49
47
|
getAccount,
|
|
50
48
|
getPublicClient,
|
|
@@ -458,32 +456,6 @@ async function runLeveredSwap(opts) {
|
|
|
458
456
|
console.log(chalk.bold("Batch calls (6):"));
|
|
459
457
|
console.log(formatBatch(calls));
|
|
460
458
|
console.log();
|
|
461
|
-
const simSpinner = ora("Simulating via vault...").start();
|
|
462
|
-
try {
|
|
463
|
-
const results = await simulateBatch(calls);
|
|
464
|
-
const allSucceeded = results.every((r) => r.success);
|
|
465
|
-
if (allSucceeded) {
|
|
466
|
-
simSpinner.succeed("Simulation passed");
|
|
467
|
-
} else {
|
|
468
|
-
simSpinner.fail("Simulation: some calls failed");
|
|
469
|
-
for (let i = 0; i < results.length; i++) {
|
|
470
|
-
const status = results[i].success ? "\u2713" : "\u2717";
|
|
471
|
-
console.log(` ${status} Call ${i + 1}`);
|
|
472
|
-
}
|
|
473
|
-
if (!opts.execute) {
|
|
474
|
-
process.exit(1);
|
|
475
|
-
}
|
|
476
|
-
console.log(chalk.yellow("Continuing to execution despite simulation failure..."));
|
|
477
|
-
}
|
|
478
|
-
} catch (err) {
|
|
479
|
-
simSpinner.fail("Simulation failed");
|
|
480
|
-
const msg = err instanceof Error ? err.message : String(err);
|
|
481
|
-
console.error(chalk.red(msg));
|
|
482
|
-
if (!opts.execute) {
|
|
483
|
-
process.exit(1);
|
|
484
|
-
}
|
|
485
|
-
console.log(chalk.yellow("Continuing to execution despite simulation failure..."));
|
|
486
|
-
}
|
|
487
459
|
if (!opts.execute) {
|
|
488
460
|
console.log();
|
|
489
461
|
console.log(chalk.yellow("Dry run complete. Add --execute to submit on-chain."));
|
|
@@ -586,7 +558,7 @@ async function getActiveSyndicates() {
|
|
|
586
558
|
const result = await client.readContract({
|
|
587
559
|
address: getFactoryAddress(),
|
|
588
560
|
abi: SYNDICATE_FACTORY_ABI,
|
|
589
|
-
functionName: "
|
|
561
|
+
functionName: "getAllActiveSyndicates"
|
|
590
562
|
});
|
|
591
563
|
return result.map((s) => ({
|
|
592
564
|
id: s.id,
|
|
@@ -661,7 +633,7 @@ async function getActiveSyndicates2(creator) {
|
|
|
661
633
|
|
|
662
634
|
// src/lib/registry.ts
|
|
663
635
|
function getRegistryAddress() {
|
|
664
|
-
return
|
|
636
|
+
return "0x0000000000000000000000000000000000000000";
|
|
665
637
|
}
|
|
666
638
|
async function registerStrategy(implementation, strategyTypeId, name, metadataURI) {
|
|
667
639
|
const wallet = getWalletClient();
|
|
@@ -1023,27 +995,6 @@ function registerVeniceCommands(program2) {
|
|
|
1023
995
|
console.log(chalk2.bold(`Batch calls (${calls.length}):`));
|
|
1024
996
|
console.log(formatBatch(calls));
|
|
1025
997
|
console.log();
|
|
1026
|
-
const simSpinner = ora2("Simulating via vault...").start();
|
|
1027
|
-
try {
|
|
1028
|
-
const results = await simulateBatch(calls);
|
|
1029
|
-
const allSucceeded = results.every((r) => r.success);
|
|
1030
|
-
if (allSucceeded) {
|
|
1031
|
-
simSpinner.succeed("Simulation passed");
|
|
1032
|
-
} else {
|
|
1033
|
-
simSpinner.fail("Simulation: some calls failed");
|
|
1034
|
-
for (let i = 0; i < results.length; i++) {
|
|
1035
|
-
const status = results[i].success ? "ok" : "FAIL";
|
|
1036
|
-
console.log(` ${status} Call ${i + 1}`);
|
|
1037
|
-
}
|
|
1038
|
-
if (!opts.execute) process.exit(1);
|
|
1039
|
-
console.log(chalk2.yellow("Continuing to execution despite simulation failure..."));
|
|
1040
|
-
}
|
|
1041
|
-
} catch (err) {
|
|
1042
|
-
simSpinner.fail("Simulation failed");
|
|
1043
|
-
console.error(chalk2.red(err instanceof Error ? err.message : String(err)));
|
|
1044
|
-
if (!opts.execute) process.exit(1);
|
|
1045
|
-
console.log(chalk2.yellow("Continuing to execution despite simulation failure..."));
|
|
1046
|
-
}
|
|
1047
998
|
if (!opts.execute) {
|
|
1048
999
|
console.log();
|
|
1049
1000
|
console.log(chalk2.yellow("Dry run complete. Add --execute to submit on-chain."));
|
|
@@ -1436,27 +1387,6 @@ function registerAllowanceCommands(program2) {
|
|
|
1436
1387
|
console.log(chalk3.bold(`Batch calls (${calls.length}):`));
|
|
1437
1388
|
console.log(formatBatch(calls));
|
|
1438
1389
|
console.log();
|
|
1439
|
-
const simSpinner = ora3("Simulating via vault...").start();
|
|
1440
|
-
try {
|
|
1441
|
-
const results = await simulateBatch(calls);
|
|
1442
|
-
const allSucceeded = results.every((r) => r.success);
|
|
1443
|
-
if (allSucceeded) {
|
|
1444
|
-
simSpinner.succeed("Simulation passed");
|
|
1445
|
-
} else {
|
|
1446
|
-
simSpinner.fail("Simulation: some calls failed");
|
|
1447
|
-
for (let i = 0; i < results.length; i++) {
|
|
1448
|
-
const status = results[i].success ? "ok" : "FAIL";
|
|
1449
|
-
console.log(` ${status} Call ${i + 1}`);
|
|
1450
|
-
}
|
|
1451
|
-
if (!opts.execute) process.exit(1);
|
|
1452
|
-
console.log(chalk3.yellow("Continuing to execution despite simulation failure..."));
|
|
1453
|
-
}
|
|
1454
|
-
} catch (err) {
|
|
1455
|
-
simSpinner.fail("Simulation failed");
|
|
1456
|
-
console.error(chalk3.red(err instanceof Error ? err.message : String(err)));
|
|
1457
|
-
if (!opts.execute) process.exit(1);
|
|
1458
|
-
console.log(chalk3.yellow("Continuing to execution despite simulation failure..."));
|
|
1459
|
-
}
|
|
1460
1390
|
if (!opts.execute) {
|
|
1461
1391
|
console.log();
|
|
1462
1392
|
console.log(chalk3.yellow("Dry run complete. Add --execute to submit on-chain."));
|
|
@@ -1793,12 +1723,22 @@ async function hasVoted(proposalId, voter) {
|
|
|
1793
1723
|
args: [proposalId, voter]
|
|
1794
1724
|
});
|
|
1795
1725
|
}
|
|
1796
|
-
async function
|
|
1726
|
+
async function getExecuteCalls(proposalId) {
|
|
1797
1727
|
const client = getPublicClient();
|
|
1798
1728
|
const result = await client.readContract({
|
|
1799
1729
|
address: getGovernorAddress(),
|
|
1800
1730
|
abi: SYNDICATE_GOVERNOR_ABI,
|
|
1801
|
-
functionName: "
|
|
1731
|
+
functionName: "getExecuteCalls",
|
|
1732
|
+
args: [proposalId]
|
|
1733
|
+
});
|
|
1734
|
+
return result.map((c) => ({ target: c.target, data: c.data, value: c.value }));
|
|
1735
|
+
}
|
|
1736
|
+
async function getSettlementCalls(proposalId) {
|
|
1737
|
+
const client = getPublicClient();
|
|
1738
|
+
const result = await client.readContract({
|
|
1739
|
+
address: getGovernorAddress(),
|
|
1740
|
+
abi: SYNDICATE_GOVERNOR_ABI,
|
|
1741
|
+
functionName: "getSettlementCalls",
|
|
1802
1742
|
args: [proposalId]
|
|
1803
1743
|
});
|
|
1804
1744
|
return result.map((c) => ({ target: c.target, data: c.data, value: c.value }));
|
|
@@ -1820,7 +1760,7 @@ async function getCapitalSnapshot(proposalId) {
|
|
|
1820
1760
|
args: [proposalId]
|
|
1821
1761
|
});
|
|
1822
1762
|
}
|
|
1823
|
-
async function propose(vault, metadataURI, performanceFeeBps, strategyDuration,
|
|
1763
|
+
async function propose(vault, metadataURI, performanceFeeBps, strategyDuration, executeCalls, settlementCalls, coProposers = []) {
|
|
1824
1764
|
const wallet = getWalletClient();
|
|
1825
1765
|
const client = getPublicClient();
|
|
1826
1766
|
const hash = await wallet.writeContract({
|
|
@@ -1829,7 +1769,7 @@ async function propose(vault, metadataURI, performanceFeeBps, strategyDuration,
|
|
|
1829
1769
|
address: getGovernorAddress(),
|
|
1830
1770
|
abi: SYNDICATE_GOVERNOR_ABI,
|
|
1831
1771
|
functionName: "propose",
|
|
1832
|
-
args: [vault, metadataURI, performanceFeeBps, strategyDuration,
|
|
1772
|
+
args: [vault, metadataURI, performanceFeeBps, strategyDuration, executeCalls, settlementCalls, coProposers]
|
|
1833
1773
|
});
|
|
1834
1774
|
const receipt = await client.waitForTransactionReceipt({ hash });
|
|
1835
1775
|
let proposalId;
|
|
@@ -1882,20 +1822,6 @@ async function settleProposal(proposalId) {
|
|
|
1882
1822
|
const receipt = await client.waitForTransactionReceipt({ hash });
|
|
1883
1823
|
return receipt.transactionHash;
|
|
1884
1824
|
}
|
|
1885
|
-
async function settleByAgent(proposalId, calls) {
|
|
1886
|
-
const wallet = getWalletClient();
|
|
1887
|
-
const client = getPublicClient();
|
|
1888
|
-
const hash = await wallet.writeContract({
|
|
1889
|
-
account: getAccount(),
|
|
1890
|
-
chain: getChain(),
|
|
1891
|
-
address: getGovernorAddress(),
|
|
1892
|
-
abi: SYNDICATE_GOVERNOR_ABI,
|
|
1893
|
-
functionName: "settleByAgent",
|
|
1894
|
-
args: [proposalId, calls]
|
|
1895
|
-
});
|
|
1896
|
-
const receipt = await client.waitForTransactionReceipt({ hash });
|
|
1897
|
-
return receipt.transactionHash;
|
|
1898
|
-
}
|
|
1899
1825
|
async function emergencySettle(proposalId, calls) {
|
|
1900
1826
|
const wallet = getWalletClient();
|
|
1901
1827
|
const client = getPublicClient();
|
|
@@ -1966,7 +1892,7 @@ async function setExecutionWindow(seconds) {
|
|
|
1966
1892
|
const receipt = await client.waitForTransactionReceipt({ hash });
|
|
1967
1893
|
return receipt.transactionHash;
|
|
1968
1894
|
}
|
|
1969
|
-
async function
|
|
1895
|
+
async function setVetoThresholdBps(bps) {
|
|
1970
1896
|
const wallet = getWalletClient();
|
|
1971
1897
|
const client = getPublicClient();
|
|
1972
1898
|
const hash = await wallet.writeContract({
|
|
@@ -1974,7 +1900,7 @@ async function setQuorumBps(bps) {
|
|
|
1974
1900
|
chain: getChain(),
|
|
1975
1901
|
address: getGovernorAddress(),
|
|
1976
1902
|
abi: SYNDICATE_GOVERNOR_ABI,
|
|
1977
|
-
functionName: "
|
|
1903
|
+
functionName: "setVetoThresholdBps",
|
|
1978
1904
|
args: [bps]
|
|
1979
1905
|
});
|
|
1980
1906
|
const receipt = await client.waitForTransactionReceipt({ hash });
|
|
@@ -2022,6 +1948,20 @@ async function setCooldownPeriod(seconds) {
|
|
|
2022
1948
|
const receipt = await client.waitForTransactionReceipt({ hash });
|
|
2023
1949
|
return receipt.transactionHash;
|
|
2024
1950
|
}
|
|
1951
|
+
async function setProtocolFeeBps(bps) {
|
|
1952
|
+
const wallet = getWalletClient();
|
|
1953
|
+
const client = getPublicClient();
|
|
1954
|
+
const hash = await wallet.writeContract({
|
|
1955
|
+
account: getAccount(),
|
|
1956
|
+
chain: getChain(),
|
|
1957
|
+
address: getGovernorAddress(),
|
|
1958
|
+
abi: SYNDICATE_GOVERNOR_ABI,
|
|
1959
|
+
functionName: "setProtocolFeeBps",
|
|
1960
|
+
args: [bps]
|
|
1961
|
+
});
|
|
1962
|
+
const receipt = await client.waitForTransactionReceipt({ hash });
|
|
1963
|
+
return receipt.transactionHash;
|
|
1964
|
+
}
|
|
2025
1965
|
|
|
2026
1966
|
// src/lib/format.ts
|
|
2027
1967
|
function formatDurationShort(seconds) {
|
|
@@ -2075,7 +2015,7 @@ function parseCallsFile(path) {
|
|
|
2075
2015
|
}
|
|
2076
2016
|
function registerProposalCommands(program2) {
|
|
2077
2017
|
const proposal = program2.command("proposal").description("Governance proposals \u2014 create, vote, execute, settle");
|
|
2078
|
-
proposal.command("create").description("Submit a strategy proposal").requiredOption("--vault <address>", "Vault address the proposal targets").requiredOption("--name <name>", "Strategy name").requiredOption("--description <text>", "Strategy rationale and risk summary").requiredOption("--performance-fee <bps>", "Agent fee in bps (e.g. 1500 = 15%)").requiredOption("--duration <duration>", "Strategy duration (e.g. 7d, 24h, 3600)").requiredOption("--calls <path>", "Path to JSON file with Call[] array").requiredOption("--
|
|
2018
|
+
proposal.command("create").description("Submit a strategy proposal").requiredOption("--vault <address>", "Vault address the proposal targets").requiredOption("--name <name>", "Strategy name").requiredOption("--description <text>", "Strategy rationale and risk summary").requiredOption("--performance-fee <bps>", "Agent fee in bps (e.g. 1500 = 15%)").requiredOption("--duration <duration>", "Strategy duration (e.g. 7d, 24h, 3600)").requiredOption("--execute-calls <path>", "Path to JSON file with execute Call[] array").requiredOption("--settle-calls <path>", "Path to JSON file with settlement Call[] array").option("--metadata-uri <uri>", "Override \u2014 skip IPFS upload and use this URI directly").action(async (opts) => {
|
|
2079
2019
|
try {
|
|
2080
2020
|
const vault = opts.vault;
|
|
2081
2021
|
if (!isAddress4(vault)) {
|
|
@@ -2084,8 +2024,8 @@ function registerProposalCommands(program2) {
|
|
|
2084
2024
|
}
|
|
2085
2025
|
const performanceFeeBps = parseBigIntArg(opts.performanceFee, "performance-fee");
|
|
2086
2026
|
const strategyDuration = parseDuration(opts.duration);
|
|
2087
|
-
const
|
|
2088
|
-
const
|
|
2027
|
+
const executeCalls = parseCallsFile(opts.executeCalls);
|
|
2028
|
+
const settleCalls = parseCallsFile(opts.settleCalls);
|
|
2089
2029
|
let metadataURI = opts.metadataUri || "";
|
|
2090
2030
|
if (!metadataURI) {
|
|
2091
2031
|
const spinner2 = ora5({ text: W("Uploading metadata to IPFS..."), color: "green" }).start();
|
|
@@ -2097,7 +2037,7 @@ function registerProposalCommands(program2) {
|
|
|
2097
2037
|
description: opts.description,
|
|
2098
2038
|
chain: getNetwork(),
|
|
2099
2039
|
strategies: [],
|
|
2100
|
-
terms: {
|
|
2040
|
+
terms: {},
|
|
2101
2041
|
links: {}
|
|
2102
2042
|
};
|
|
2103
2043
|
const proposalMeta = {
|
|
@@ -2123,11 +2063,11 @@ function registerProposalCommands(program2) {
|
|
|
2123
2063
|
console.log(W(` Vault: ${G(vault)}`));
|
|
2124
2064
|
console.log(W(` Performance Fee: ${Number(performanceFeeBps) / 100}%`));
|
|
2125
2065
|
console.log(W(` Duration: ${formatDurationShort(strategyDuration)}`));
|
|
2126
|
-
console.log(W(` Calls: ${
|
|
2066
|
+
console.log(W(` Calls: ${executeCalls.length} execute + ${settleCalls.length} settle`));
|
|
2127
2067
|
console.log(W(` Metadata: ${DIM(metadataURI.length > 50 ? metadataURI.slice(0, 50) + "..." : metadataURI)}`));
|
|
2128
2068
|
SEP();
|
|
2129
2069
|
const spinner = ora5({ text: W("Submitting proposal..."), color: "green" }).start();
|
|
2130
|
-
const result = await propose(vault, metadataURI, performanceFeeBps, strategyDuration,
|
|
2070
|
+
const result = await propose(vault, metadataURI, performanceFeeBps, strategyDuration, executeCalls, settleCalls);
|
|
2131
2071
|
spinner.succeed(G("Proposal submitted"));
|
|
2132
2072
|
console.log();
|
|
2133
2073
|
console.log(LABEL(" \u25C6 Proposal Created"));
|
|
@@ -2202,12 +2142,11 @@ function registerProposalCommands(program2) {
|
|
|
2202
2142
|
const id = parseBigIntArg(idStr, "proposal ID");
|
|
2203
2143
|
const p = await getProposal(id);
|
|
2204
2144
|
const state = await getProposalState(id);
|
|
2205
|
-
const calls = await getProposalCalls(id);
|
|
2206
2145
|
const params = await getGovernorParams();
|
|
2207
2146
|
spinner.stop();
|
|
2208
2147
|
const stateLabel = PROPOSAL_STATES[state] || "Unknown";
|
|
2209
2148
|
const totalVotes = p.votesFor + p.votesAgainst;
|
|
2210
|
-
const quorumNeeded = totalVotes > 0n ? `${Number(params.
|
|
2149
|
+
const quorumNeeded = totalVotes > 0n ? `${Number(params.vetoThresholdBps) / 100}%` : "\u2014";
|
|
2211
2150
|
console.log();
|
|
2212
2151
|
console.log(LABEL(` \u25C6 Proposal #${p.id}`));
|
|
2213
2152
|
SEP();
|
|
@@ -2238,7 +2177,7 @@ function registerProposalCommands(program2) {
|
|
|
2238
2177
|
console.log(W(` For: ${formatShares(p.votesFor)}`));
|
|
2239
2178
|
console.log(W(` Against: ${formatShares(p.votesAgainst)}`));
|
|
2240
2179
|
console.log(W(` Abstain: ${formatShares(p.votesAbstain)}`));
|
|
2241
|
-
console.log(W(`
|
|
2180
|
+
console.log(W(` Veto Threshold: ${quorumNeeded}`));
|
|
2242
2181
|
if (state === PROPOSAL_STATE.Executed || state === PROPOSAL_STATE.Settled) {
|
|
2243
2182
|
try {
|
|
2244
2183
|
const cap = await getCapitalSnapshot(id);
|
|
@@ -2248,12 +2187,18 @@ function registerProposalCommands(program2) {
|
|
|
2248
2187
|
} catch {
|
|
2249
2188
|
}
|
|
2250
2189
|
}
|
|
2190
|
+
const execCalls = await getExecuteCalls(id);
|
|
2191
|
+
const settlCalls = await getSettlementCalls(id);
|
|
2251
2192
|
console.log();
|
|
2252
|
-
console.log(LABEL(` Calls (${
|
|
2253
|
-
for (let i = 0; i <
|
|
2254
|
-
|
|
2255
|
-
console.log(DIM(`
|
|
2256
|
-
|
|
2193
|
+
console.log(LABEL(` Execute Calls (${execCalls.length})`));
|
|
2194
|
+
for (let i = 0; i < execCalls.length; i++) {
|
|
2195
|
+
console.log(DIM(` [${i}] target=${execCalls[i].target}`));
|
|
2196
|
+
console.log(DIM(` data=${execCalls[i].data.slice(0, 20)}... value=${execCalls[i].value}`));
|
|
2197
|
+
}
|
|
2198
|
+
console.log(LABEL(` Settlement Calls (${settlCalls.length})`));
|
|
2199
|
+
for (let i = 0; i < settlCalls.length; i++) {
|
|
2200
|
+
console.log(DIM(` [${i}] target=${settlCalls[i].target}`));
|
|
2201
|
+
console.log(DIM(` data=${settlCalls[i].data.slice(0, 20)}... value=${settlCalls[i].value}`));
|
|
2257
2202
|
}
|
|
2258
2203
|
SEP();
|
|
2259
2204
|
console.log();
|
|
@@ -2348,11 +2293,10 @@ function registerProposalCommands(program2) {
|
|
|
2348
2293
|
const now = BigInt(Math.floor(Date.now() / 1e3));
|
|
2349
2294
|
const durationElapsed = p.executedAt > 0n && now >= p.executedAt + p.strategyDuration;
|
|
2350
2295
|
let hash;
|
|
2351
|
-
if (isProposer &&
|
|
2352
|
-
spinner.text = W("Settling
|
|
2353
|
-
|
|
2354
|
-
|
|
2355
|
-
spinner.succeed(G("Settled by agent"));
|
|
2296
|
+
if (isProposer && !durationElapsed) {
|
|
2297
|
+
spinner.text = W("Settling (proposer)...");
|
|
2298
|
+
hash = await settleProposal(proposalId);
|
|
2299
|
+
spinner.succeed(G("Settled by proposer"));
|
|
2356
2300
|
} else if (durationElapsed && !opts.calls) {
|
|
2357
2301
|
spinner.text = W("Settling (permissionless)...");
|
|
2358
2302
|
hash = await settleProposal(proposalId);
|
|
@@ -2363,7 +2307,7 @@ function registerProposalCommands(program2) {
|
|
|
2363
2307
|
hash = await emergencySettle(proposalId, calls);
|
|
2364
2308
|
spinner.succeed(G("Emergency settled"));
|
|
2365
2309
|
} else {
|
|
2366
|
-
spinner.fail("Cannot settle: duration not elapsed
|
|
2310
|
+
spinner.fail("Cannot settle: duration not elapsed and you are not the proposer.");
|
|
2367
2311
|
process.exit(1);
|
|
2368
2312
|
}
|
|
2369
2313
|
console.log(DIM(` ${getExplorerUrl(hash)}`));
|
|
@@ -2432,7 +2376,7 @@ function registerGovernorCommands(program2) {
|
|
|
2432
2376
|
console.log(W2(` Address: ${G2(getGovernorAddress())}`));
|
|
2433
2377
|
console.log(W2(` Voting Period: ${BOLD2(formatDurationLong(params.votingPeriod))}`));
|
|
2434
2378
|
console.log(W2(` Execution Window: ${BOLD2(formatDurationLong(params.executionWindow))}`));
|
|
2435
|
-
console.log(W2(`
|
|
2379
|
+
console.log(W2(` Veto Threshold: ${BOLD2(`${Number(params.vetoThresholdBps) / 100}%`)}`));
|
|
2436
2380
|
console.log(W2(` Max Performance Fee: ${BOLD2(`${Number(params.maxPerformanceFeeBps) / 100}%`)}`));
|
|
2437
2381
|
console.log(W2(` Max Strategy Duration:${BOLD2(` ${formatDurationLong(params.maxStrategyDuration)}`)}`));
|
|
2438
2382
|
console.log(W2(` Cooldown Period: ${BOLD2(formatDurationLong(params.cooldownPeriod))}`));
|
|
@@ -2477,14 +2421,14 @@ function registerGovernorCommands(program2) {
|
|
|
2477
2421
|
process.exit(1);
|
|
2478
2422
|
}
|
|
2479
2423
|
});
|
|
2480
|
-
governor.command("set-
|
|
2481
|
-
const spinner = ora6("Setting
|
|
2424
|
+
governor.command("set-veto-threshold").description("Set the veto threshold in bps (owner only)").requiredOption("--bps <n>", "New veto threshold in bps (e.g. 4000 = 40%)").action(async (opts) => {
|
|
2425
|
+
const spinner = ora6("Setting veto threshold...").start();
|
|
2482
2426
|
try {
|
|
2483
|
-
const hash = await
|
|
2484
|
-
spinner.succeed(G2(`
|
|
2427
|
+
const hash = await setVetoThresholdBps(parseBigIntArg(opts.bps, "bps"));
|
|
2428
|
+
spinner.succeed(G2(`Veto threshold updated to ${Number(opts.bps) / 100}%`));
|
|
2485
2429
|
console.log(DIM2(` ${getExplorerUrl(hash)}`));
|
|
2486
2430
|
} catch (err) {
|
|
2487
|
-
spinner.fail("Failed to set
|
|
2431
|
+
spinner.fail("Failed to set veto threshold");
|
|
2488
2432
|
console.error(chalk6.red(err instanceof Error ? err.message : String(err)));
|
|
2489
2433
|
process.exit(1);
|
|
2490
2434
|
}
|
|
@@ -2525,6 +2469,18 @@ function registerGovernorCommands(program2) {
|
|
|
2525
2469
|
process.exit(1);
|
|
2526
2470
|
}
|
|
2527
2471
|
});
|
|
2472
|
+
governor.command("set-protocol-fee").description("Set the protocol fee in bps (owner only)").requiredOption("--bps <n>", "New protocol fee in bps (e.g. 500 = 5%, max 1000 = 10%)").action(async (opts) => {
|
|
2473
|
+
const spinner = ora6("Setting protocol fee...").start();
|
|
2474
|
+
try {
|
|
2475
|
+
const hash = await setProtocolFeeBps(parseBigIntArg(opts.bps, "bps"));
|
|
2476
|
+
spinner.succeed(G2(`Protocol fee updated to ${Number(opts.bps) / 100}%`));
|
|
2477
|
+
console.log(DIM2(` ${getExplorerUrl(hash)}`));
|
|
2478
|
+
} catch (err) {
|
|
2479
|
+
spinner.fail("Failed to set protocol fee");
|
|
2480
|
+
console.error(chalk6.red(err instanceof Error ? err.message : String(err)));
|
|
2481
|
+
process.exit(1);
|
|
2482
|
+
}
|
|
2483
|
+
});
|
|
2528
2484
|
}
|
|
2529
2485
|
|
|
2530
2486
|
// src/index.ts
|
|
@@ -2533,7 +2489,7 @@ try {
|
|
|
2533
2489
|
} catch {
|
|
2534
2490
|
}
|
|
2535
2491
|
async function loadXmtp() {
|
|
2536
|
-
return import("./xmtp-
|
|
2492
|
+
return import("./xmtp-ZGW4KGC4.js");
|
|
2537
2493
|
}
|
|
2538
2494
|
async function loadCron() {
|
|
2539
2495
|
return import("./cron-RG46PYWA.js");
|
|
@@ -2664,7 +2620,6 @@ syndicate.command("create").description("Create a new syndicate via the factory
|
|
|
2664
2620
|
chain: getChain().name,
|
|
2665
2621
|
strategies: [],
|
|
2666
2622
|
terms: {
|
|
2667
|
-
ragequitEnabled: true,
|
|
2668
2623
|
feeModel: "none"
|
|
2669
2624
|
},
|
|
2670
2625
|
links: {}
|
|
@@ -2850,7 +2805,7 @@ syndicate.command("update-metadata").description("Update syndicate metadata (cre
|
|
|
2850
2805
|
description,
|
|
2851
2806
|
chain: getChain().name,
|
|
2852
2807
|
strategies: [],
|
|
2853
|
-
terms: {
|
|
2808
|
+
terms: {},
|
|
2854
2809
|
links: {}
|
|
2855
2810
|
};
|
|
2856
2811
|
metadataURI = await uploadMetadata(metadata);
|
|
@@ -3201,19 +3156,6 @@ vaultCmd.command("deposit").description("Deposit into a vault").option("--vault
|
|
|
3201
3156
|
process.exit(1);
|
|
3202
3157
|
}
|
|
3203
3158
|
});
|
|
3204
|
-
vaultCmd.command("ragequit").description("Withdraw all shares from a vault").option("--vault <address>", "Vault address (default: from config)").action(async (opts) => {
|
|
3205
|
-
resolveVault(opts);
|
|
3206
|
-
const spinner = ora7("Ragequitting...").start();
|
|
3207
|
-
try {
|
|
3208
|
-
const hash = await ragequit();
|
|
3209
|
-
spinner.succeed(`Ragequit: ${hash}`);
|
|
3210
|
-
console.log(chalk7.dim(` ${getExplorerUrl(hash)}`));
|
|
3211
|
-
} catch (err) {
|
|
3212
|
-
spinner.fail("Ragequit failed");
|
|
3213
|
-
console.error(chalk7.red(err instanceof Error ? err.message : String(err)));
|
|
3214
|
-
process.exit(1);
|
|
3215
|
-
}
|
|
3216
|
-
});
|
|
3217
3159
|
vaultCmd.command("info").description("Display vault state").option("--vault <address>", "Vault address (default: from config)").action(async (opts) => {
|
|
3218
3160
|
resolveVault(opts);
|
|
3219
3161
|
const spinner = ora7("Loading vault info...").start();
|
|
@@ -3341,7 +3283,7 @@ ${info.name} (${info.type})`);
|
|
|
3341
3283
|
}
|
|
3342
3284
|
});
|
|
3343
3285
|
try {
|
|
3344
|
-
const { registerChatCommands } = await import("./chat-
|
|
3286
|
+
const { registerChatCommands } = await import("./chat-3PQDDLVR.js");
|
|
3345
3287
|
registerChatCommands(program);
|
|
3346
3288
|
} catch {
|
|
3347
3289
|
program.command("chat <name> [action] [actionArgs...]").description("Syndicate chat (XMTP) \u2014 requires @xmtp/cli").action(() => {
|
|
@@ -3351,14 +3293,14 @@ try {
|
|
|
3351
3293
|
process.exit(1);
|
|
3352
3294
|
});
|
|
3353
3295
|
}
|
|
3354
|
-
var { registerSessionCommands } = await import("./session-
|
|
3296
|
+
var { registerSessionCommands } = await import("./session-5FYVX2DW.js");
|
|
3355
3297
|
registerSessionCommands(program);
|
|
3356
3298
|
registerVeniceCommands(program);
|
|
3357
3299
|
registerAllowanceCommands(program);
|
|
3358
3300
|
registerIdentityCommands(program);
|
|
3359
3301
|
registerProposalCommands(program);
|
|
3360
3302
|
registerGovernorCommands(program);
|
|
3361
|
-
var { registerResearchCommands } = await import("./research-
|
|
3303
|
+
var { registerResearchCommands } = await import("./research-O44AJLGZ.js");
|
|
3362
3304
|
registerResearchCommands(program);
|
|
3363
3305
|
var configCmd = program.command("config");
|
|
3364
3306
|
configCmd.command("set").description("Save settings to ~/.sherwood/config.json (persists across sessions)").option("--private-key <key>", "Wallet private key (0x-prefixed)").option("--vault <address>", "Default SyndicateVault address").option("--rpc <url>", "Custom RPC URL for the active --chain network").option("--notify-to <id>", "Destination for cron summaries (Telegram chat ID, phone, etc.)").action((opts) => {
|