@sherwoodagent/cli 0.86.0 → 0.87.0
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/{abis-WVW2EBI3.js → abis-WJQ6IVYV.js} +2 -2
- package/dist/{agent-TBLC3WNJ.js → agent-A2JEYGQS.js} +7 -7
- package/dist/{chat-PRYOT3ZV.js → chat-OZAAN5LT.js} +8 -8
- package/dist/{chunk-I2BBOJNC.js → chunk-37GT3TJX.js} +5 -5
- package/dist/{chunk-45FELUWY.js → chunk-3UYGXGMF.js} +2 -2
- package/dist/{chunk-6N7EVSAZ.js → chunk-CU42ZD4K.js} +22 -9
- package/dist/chunk-CU42ZD4K.js.map +1 -0
- package/dist/{chunk-PVTZMRC6.js → chunk-G3FUEM5N.js} +2 -2
- package/dist/chunk-G3FUEM5N.js.map +1 -0
- package/dist/{chunk-5NFAEOFG.js → chunk-GR3GSU3I.js} +6 -6
- package/dist/{chunk-KVB5P2OE.js → chunk-IINWI3LD.js} +2 -2
- package/dist/{chunk-F3MDCUGO.js → chunk-J2IZWAEW.js} +75 -227
- package/dist/chunk-J2IZWAEW.js.map +1 -0
- package/dist/{chunk-ARSQ5UQA.js → chunk-JGD6A2Q4.js} +29 -82
- package/dist/chunk-JGD6A2Q4.js.map +1 -0
- package/dist/{chunk-QRMZRAMG.js → chunk-MIAMGVZ4.js} +8 -8
- package/dist/chunk-MIAMGVZ4.js.map +1 -0
- package/dist/{chunk-HODME7UJ.js → chunk-R6F57QQF.js} +14 -23
- package/dist/chunk-R6F57QQF.js.map +1 -0
- package/dist/{chunk-53W6CYYV.js → chunk-TTF5TDRV.js} +5 -5
- package/dist/{chunk-AM6MI2JF.js → chunk-UOIAY6ZG.js} +148 -58
- package/dist/chunk-UOIAY6ZG.js.map +1 -0
- package/dist/{chunk-LRUSZUEU.js → chunk-V7TNYHIK.js} +337 -490
- package/dist/chunk-V7TNYHIK.js.map +1 -0
- package/dist/{chunk-M4GX5PL2.js → chunk-W3XWRWML.js} +5 -5
- package/dist/{client-3SE632Q2.js → client-C6N2ASTH.js} +3 -3
- package/dist/{eas-D3BVHBJH.js → eas-VFTWEI4K.js} +6 -6
- package/dist/{governor-35IXAEDJ.js → governor-HVBSI6Z2.js} +10 -8
- package/dist/identity-OLD25QEP.js +18 -0
- package/dist/index.js +168 -316
- package/dist/index.js.map +1 -1
- package/dist/{network-FEHRFDPJ.js → network-7445KSCF.js} +2 -2
- package/dist/{price-I5T77X7Y.js → price-O3THX2HL.js} +6 -6
- package/dist/{providers-BMOHHVUN.js → providers-KZNCCUKT.js} +4 -4
- package/dist/{research-NKGP3M4J.js → research-ARFBFXIT.js} +7 -7
- package/dist/{session-LJT3SAED.js → session-A7CYZSSA.js} +14 -12
- package/dist/session-A7CYZSSA.js.map +1 -0
- package/dist/{trade-OTZ7UHDK.js → trade-ZCK332E4.js} +15 -15
- package/dist/{vault-7O4N6WZG.js → vault-CDI7BELZ.js} +8 -8
- package/dist/{xmtp-R25Q5GWY.js → xmtp-7LAWDKJT.js} +6 -6
- package/package.json +1 -1
- package/dist/chunk-6N7EVSAZ.js.map +0 -1
- package/dist/chunk-AM6MI2JF.js.map +0 -1
- package/dist/chunk-ARSQ5UQA.js.map +0 -1
- package/dist/chunk-F3MDCUGO.js.map +0 -1
- package/dist/chunk-HODME7UJ.js.map +0 -1
- package/dist/chunk-LRUSZUEU.js.map +0 -1
- package/dist/chunk-PVTZMRC6.js.map +0 -1
- package/dist/chunk-QRMZRAMG.js.map +0 -1
- package/dist/identity-XOAYQFUW.js +0 -15
- package/dist/session-LJT3SAED.js.map +0 -1
- /package/dist/{abis-WVW2EBI3.js.map → abis-WJQ6IVYV.js.map} +0 -0
- /package/dist/{agent-TBLC3WNJ.js.map → agent-A2JEYGQS.js.map} +0 -0
- /package/dist/{chat-PRYOT3ZV.js.map → chat-OZAAN5LT.js.map} +0 -0
- /package/dist/{chunk-I2BBOJNC.js.map → chunk-37GT3TJX.js.map} +0 -0
- /package/dist/{chunk-45FELUWY.js.map → chunk-3UYGXGMF.js.map} +0 -0
- /package/dist/{chunk-5NFAEOFG.js.map → chunk-GR3GSU3I.js.map} +0 -0
- /package/dist/{chunk-KVB5P2OE.js.map → chunk-IINWI3LD.js.map} +0 -0
- /package/dist/{chunk-53W6CYYV.js.map → chunk-TTF5TDRV.js.map} +0 -0
- /package/dist/{chunk-M4GX5PL2.js.map → chunk-W3XWRWML.js.map} +0 -0
- /package/dist/{client-3SE632Q2.js.map → client-C6N2ASTH.js.map} +0 -0
- /package/dist/{eas-D3BVHBJH.js.map → eas-VFTWEI4K.js.map} +0 -0
- /package/dist/{governor-35IXAEDJ.js.map → governor-HVBSI6Z2.js.map} +0 -0
- /package/dist/{identity-XOAYQFUW.js.map → identity-OLD25QEP.js.map} +0 -0
- /package/dist/{network-FEHRFDPJ.js.map → network-7445KSCF.js.map} +0 -0
- /package/dist/{price-I5T77X7Y.js.map → price-O3THX2HL.js.map} +0 -0
- /package/dist/{providers-BMOHHVUN.js.map → providers-KZNCCUKT.js.map} +0 -0
- /package/dist/{research-NKGP3M4J.js.map → research-ARFBFXIT.js.map} +0 -0
- /package/dist/{trade-OTZ7UHDK.js.map → trade-ZCK332E4.js.map} +0 -0
- /package/dist/{vault-7O4N6WZG.js.map → vault-CDI7BELZ.js.map} +0 -0
- /package/dist/{xmtp-R25Q5GWY.js.map → xmtp-7LAWDKJT.js.map} +0 -0
|
@@ -1,33 +1,34 @@
|
|
|
1
1
|
import {
|
|
2
2
|
COORDINATION_NETWORK
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-W3XWRWML.js";
|
|
4
4
|
import {
|
|
5
5
|
AGENT_REGISTRY
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-UOIAY6ZG.js";
|
|
7
7
|
import {
|
|
8
8
|
formatContractError,
|
|
9
9
|
getAccount,
|
|
10
10
|
getPublicClient,
|
|
11
11
|
sendTxWithRetry,
|
|
12
12
|
waitForReceipt
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-MIAMGVZ4.js";
|
|
14
14
|
import {
|
|
15
15
|
getChain,
|
|
16
|
-
getChainConfig,
|
|
17
|
-
getRpcUrl,
|
|
18
16
|
withNetwork
|
|
19
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-G3FUEM5N.js";
|
|
20
18
|
import {
|
|
21
19
|
getAgentId,
|
|
22
20
|
getIdentityChainId,
|
|
23
21
|
getIdentityProvider,
|
|
24
22
|
getVirtualsIdentity,
|
|
25
|
-
requirePrivateKey,
|
|
26
23
|
setAgentId,
|
|
27
24
|
setVirtualsIdentity
|
|
28
25
|
} from "./chunk-3TZIOAPH.js";
|
|
26
|
+
import {
|
|
27
|
+
resolveMetadataSummary
|
|
28
|
+
} from "./chunk-YMB4RJOR.js";
|
|
29
29
|
|
|
30
30
|
// src/commands/identity.ts
|
|
31
|
+
import { getAddress as getAddress9, isAddress as isAddress3 } from "viem";
|
|
31
32
|
import { generatePrivateKey } from "viem/accounts";
|
|
32
33
|
import chalk from "chalk";
|
|
33
34
|
import ora from "ora";
|
|
@@ -471,27 +472,6 @@ var SYNDICATE_VAULT_ABI = [
|
|
|
471
472
|
{ name: "agentAddress", type: "address" }
|
|
472
473
|
],
|
|
473
474
|
outputs: []
|
|
474
|
-
},
|
|
475
|
-
// Governor-only: mint + fund + run a single-use CallSandbox.
|
|
476
|
-
// ICallSandbox.Call is TWO fields (address,bytes). There is NO `value`.
|
|
477
|
-
{
|
|
478
|
-
name: "runSandbox",
|
|
479
|
-
type: "function",
|
|
480
|
-
stateMutability: "nonpayable",
|
|
481
|
-
inputs: [
|
|
482
|
-
{ name: "pid", type: "uint256" },
|
|
483
|
-
{
|
|
484
|
-
name: "calls",
|
|
485
|
-
type: "tuple[]",
|
|
486
|
-
components: [
|
|
487
|
-
{ name: "target", type: "address" },
|
|
488
|
-
{ name: "data", type: "bytes" }
|
|
489
|
-
]
|
|
490
|
-
},
|
|
491
|
-
{ name: "declaredTokens", type: "address[]" },
|
|
492
|
-
{ name: "funding", type: "uint256" }
|
|
493
|
-
],
|
|
494
|
-
outputs: [{ name: "sandbox", type: "address" }]
|
|
495
475
|
}
|
|
496
476
|
];
|
|
497
477
|
var SYNDICATE_GOVERNOR_ABI = [
|
|
@@ -553,74 +533,6 @@ var SYNDICATE_GOVERNOR_ABI = [
|
|
|
553
533
|
],
|
|
554
534
|
outputs: [{ name: "proposalId", type: "uint256" }]
|
|
555
535
|
},
|
|
556
|
-
// proposeWithSandbox — same 10 args as propose, prefixed with SandboxPayload.
|
|
557
|
-
// ICallSandbox.Call is TWO fields (address,bytes). There is NO `value`:
|
|
558
|
-
// native value would open a transfer channel with no metering story
|
|
559
|
-
// (ICallSandbox.sol:44-51). Aliasing BatchExecutorLib.Call would reintroduce it.
|
|
560
|
-
{
|
|
561
|
-
name: "proposeWithSandbox",
|
|
562
|
-
type: "function",
|
|
563
|
-
stateMutability: "nonpayable",
|
|
564
|
-
inputs: [
|
|
565
|
-
{
|
|
566
|
-
name: "sandbox",
|
|
567
|
-
type: "tuple",
|
|
568
|
-
components: [
|
|
569
|
-
{ name: "funding", type: "uint256" },
|
|
570
|
-
{
|
|
571
|
-
name: "calls",
|
|
572
|
-
type: "tuple[]",
|
|
573
|
-
components: [
|
|
574
|
-
{ name: "target", type: "address" },
|
|
575
|
-
{ name: "data", type: "bytes" }
|
|
576
|
-
]
|
|
577
|
-
},
|
|
578
|
-
{ name: "declaredTokens", type: "address[]" }
|
|
579
|
-
]
|
|
580
|
-
},
|
|
581
|
-
{ name: "vault", type: "address" },
|
|
582
|
-
{ name: "strategy", type: "address" },
|
|
583
|
-
{ name: "metadataURI", type: "string" },
|
|
584
|
-
{ name: "strategyDuration", type: "uint256" },
|
|
585
|
-
{
|
|
586
|
-
name: "envelope",
|
|
587
|
-
type: "tuple",
|
|
588
|
-
components: [
|
|
589
|
-
{ name: "maxCapital", type: "uint256" },
|
|
590
|
-
{ name: "maxDrawdownBps", type: "uint16" }
|
|
591
|
-
]
|
|
592
|
-
},
|
|
593
|
-
{
|
|
594
|
-
name: "executeCalls",
|
|
595
|
-
type: "tuple[]",
|
|
596
|
-
components: [
|
|
597
|
-
{ name: "target", type: "address" },
|
|
598
|
-
{ name: "data", type: "bytes" },
|
|
599
|
-
{ name: "value", type: "uint256" }
|
|
600
|
-
]
|
|
601
|
-
},
|
|
602
|
-
{ name: "executeCallCaps", type: "uint256[]" },
|
|
603
|
-
{
|
|
604
|
-
name: "settlementCalls",
|
|
605
|
-
type: "tuple[]",
|
|
606
|
-
components: [
|
|
607
|
-
{ name: "target", type: "address" },
|
|
608
|
-
{ name: "data", type: "bytes" },
|
|
609
|
-
{ name: "value", type: "uint256" }
|
|
610
|
-
]
|
|
611
|
-
},
|
|
612
|
-
{ name: "settlementCallCaps", type: "uint256[]" },
|
|
613
|
-
{
|
|
614
|
-
name: "coProposers",
|
|
615
|
-
type: "tuple[]",
|
|
616
|
-
components: [
|
|
617
|
-
{ name: "agent", type: "address" },
|
|
618
|
-
{ name: "splitBps", type: "uint256" }
|
|
619
|
-
]
|
|
620
|
-
}
|
|
621
|
-
],
|
|
622
|
-
outputs: [{ name: "proposalId", type: "uint256" }]
|
|
623
|
-
},
|
|
624
536
|
// Lifecycle writes
|
|
625
537
|
{
|
|
626
538
|
name: "vote",
|
|
@@ -714,9 +626,10 @@ var SYNDICATE_GOVERNOR_ABI = [
|
|
|
714
626
|
{ name: "metadataURI", type: "string" },
|
|
715
627
|
{ name: "performanceFeeBps", type: "uint256" },
|
|
716
628
|
{ name: "strategyDuration", type: "uint256" },
|
|
717
|
-
|
|
629
|
+
// Optimistic governance tallies only AGAINST weight; the For /
|
|
630
|
+
// Abstain counters were dropped at v1 and `votableSupply` (the
|
|
631
|
+
// veto denominator) is appended at the tail instead.
|
|
718
632
|
{ name: "votesAgainst", type: "uint256" },
|
|
719
|
-
{ name: "votesAbstain", type: "uint256" },
|
|
720
633
|
{ name: "snapshotTimestamp", type: "uint256" },
|
|
721
634
|
{ name: "voteEnd", type: "uint256" },
|
|
722
635
|
{ name: "reviewEnd", type: "uint256" },
|
|
@@ -756,36 +669,8 @@ var SYNDICATE_GOVERNOR_ABI = [
|
|
|
756
669
|
]
|
|
757
670
|
},
|
|
758
671
|
{ name: "proposerBondLedger", type: "address" },
|
|
759
|
-
{ name: "effectiveMaxCapital", type: "uint256" }
|
|
760
|
-
|
|
761
|
-
}
|
|
762
|
-
]
|
|
763
|
-
},
|
|
764
|
-
// sandboxPayload — ISyndicateGovernor.sol ~730 / SyndicateGovernor.sol:506.
|
|
765
|
-
// Returns SandboxPayload {funding, calls, declaredTokens}. Calls are
|
|
766
|
-
// ICallSandbox.Call = (address target, bytes data) ONLY — no `value`.
|
|
767
|
-
// Non-sandbox (and unknown) pids return the mapping default: zero funding,
|
|
768
|
-
// empty calls, empty declaredTokens. The contract does not revert.
|
|
769
|
-
{
|
|
770
|
-
name: "sandboxPayload",
|
|
771
|
-
type: "function",
|
|
772
|
-
stateMutability: "view",
|
|
773
|
-
inputs: [{ name: "proposalId", type: "uint256" }],
|
|
774
|
-
outputs: [
|
|
775
|
-
{
|
|
776
|
-
name: "payload",
|
|
777
|
-
type: "tuple",
|
|
778
|
-
components: [
|
|
779
|
-
{ name: "funding", type: "uint256" },
|
|
780
|
-
{
|
|
781
|
-
name: "calls",
|
|
782
|
-
type: "tuple[]",
|
|
783
|
-
components: [
|
|
784
|
-
{ name: "target", type: "address" },
|
|
785
|
-
{ name: "data", type: "bytes" }
|
|
786
|
-
]
|
|
787
|
-
},
|
|
788
|
-
{ name: "declaredTokens", type: "address[]" }
|
|
672
|
+
{ name: "effectiveMaxCapital", type: "uint256" },
|
|
673
|
+
{ name: "votableSupply", type: "uint256" }
|
|
789
674
|
]
|
|
790
675
|
}
|
|
791
676
|
]
|
|
@@ -944,19 +829,43 @@ var SYNDICATE_FACTORY_ABI = [
|
|
|
944
829
|
}
|
|
945
830
|
];
|
|
946
831
|
var PROTOCOL_CONFIG_ABI = [
|
|
832
|
+
// The two-number fee model exposes the SPLITS, not flat rates. The
|
|
833
|
+
// `protocolFeeBps` / `guardianFeeBps` scalars this ABI used to declare are
|
|
834
|
+
// on no deployed ProtocolConfig — every read through them reverted.
|
|
947
835
|
{
|
|
948
|
-
name: "
|
|
836
|
+
name: "mgmtSplit",
|
|
949
837
|
type: "function",
|
|
950
838
|
stateMutability: "view",
|
|
951
839
|
inputs: [],
|
|
952
|
-
outputs: [
|
|
840
|
+
outputs: [
|
|
841
|
+
{
|
|
842
|
+
name: "",
|
|
843
|
+
type: "tuple",
|
|
844
|
+
components: [
|
|
845
|
+
{ name: "agentBps", type: "uint16" },
|
|
846
|
+
{ name: "protocolBps", type: "uint16" },
|
|
847
|
+
{ name: "guardianBps", type: "uint16" }
|
|
848
|
+
]
|
|
849
|
+
}
|
|
850
|
+
]
|
|
953
851
|
},
|
|
954
852
|
{
|
|
955
|
-
name: "
|
|
853
|
+
name: "perfSplit",
|
|
956
854
|
type: "function",
|
|
957
855
|
stateMutability: "view",
|
|
958
856
|
inputs: [],
|
|
959
|
-
outputs: [
|
|
857
|
+
outputs: [
|
|
858
|
+
{
|
|
859
|
+
name: "",
|
|
860
|
+
type: "tuple",
|
|
861
|
+
components: [
|
|
862
|
+
{ name: "agentBps", type: "uint16" },
|
|
863
|
+
{ name: "protocolBps", type: "uint16" },
|
|
864
|
+
{ name: "guardianBps", type: "uint16" },
|
|
865
|
+
{ name: "ownerBps", type: "uint16" }
|
|
866
|
+
]
|
|
867
|
+
}
|
|
868
|
+
]
|
|
960
869
|
},
|
|
961
870
|
{
|
|
962
871
|
name: "protocolFeeRecipient",
|
|
@@ -965,12 +874,40 @@ var PROTOCOL_CONFIG_ABI = [
|
|
|
965
874
|
inputs: [],
|
|
966
875
|
outputs: [{ name: "", type: "address" }]
|
|
967
876
|
},
|
|
968
|
-
// Protocol-owner
|
|
877
|
+
// Protocol-owner setters.
|
|
969
878
|
{
|
|
970
|
-
name: "
|
|
879
|
+
name: "setMgmtSplit",
|
|
971
880
|
type: "function",
|
|
972
881
|
stateMutability: "nonpayable",
|
|
973
|
-
inputs: [
|
|
882
|
+
inputs: [
|
|
883
|
+
{
|
|
884
|
+
name: "s",
|
|
885
|
+
type: "tuple",
|
|
886
|
+
components: [
|
|
887
|
+
{ name: "agentBps", type: "uint16" },
|
|
888
|
+
{ name: "protocolBps", type: "uint16" },
|
|
889
|
+
{ name: "guardianBps", type: "uint16" }
|
|
890
|
+
]
|
|
891
|
+
}
|
|
892
|
+
],
|
|
893
|
+
outputs: []
|
|
894
|
+
},
|
|
895
|
+
{
|
|
896
|
+
name: "setPerfSplit",
|
|
897
|
+
type: "function",
|
|
898
|
+
stateMutability: "nonpayable",
|
|
899
|
+
inputs: [
|
|
900
|
+
{
|
|
901
|
+
name: "s",
|
|
902
|
+
type: "tuple",
|
|
903
|
+
components: [
|
|
904
|
+
{ name: "agentBps", type: "uint16" },
|
|
905
|
+
{ name: "protocolBps", type: "uint16" },
|
|
906
|
+
{ name: "guardianBps", type: "uint16" },
|
|
907
|
+
{ name: "ownerBps", type: "uint16" }
|
|
908
|
+
]
|
|
909
|
+
}
|
|
910
|
+
],
|
|
974
911
|
outputs: []
|
|
975
912
|
}
|
|
976
913
|
];
|
|
@@ -981,8 +918,11 @@ var GUARDIAN_REGISTRY_ABI = [
|
|
|
981
918
|
// requestUnstakeGuardian / cancelUnstakeGuardian / claimUnstakeGuardian /
|
|
982
919
|
// guardianStake / isActiveGuardian to the registry reverts with empty
|
|
983
920
|
// returndata. Use STAKED_WOOD_ABI against `sherwood.stakedWood`.
|
|
984
|
-
// Guardian review vote —
|
|
985
|
-
//
|
|
921
|
+
// Guardian review vote — 4 args. Selector 0x4915ace5. The 3-arg form
|
|
922
|
+
// (0x3ad95b6d) is on no deployed registry.
|
|
923
|
+
// GuardianVoteType: None=0, Approve=1, Block=2 (uint8). `lockWood` is the
|
|
924
|
+
// approver's declared WOOD lock, clamped to its free budget by the
|
|
925
|
+
// ExposureLedger and ignored on a Block vote.
|
|
986
926
|
{
|
|
987
927
|
name: "voteOnProposal",
|
|
988
928
|
type: "function",
|
|
@@ -990,7 +930,8 @@ var GUARDIAN_REGISTRY_ABI = [
|
|
|
990
930
|
inputs: [
|
|
991
931
|
{ name: "governor", type: "address" },
|
|
992
932
|
{ name: "proposalId", type: "uint256" },
|
|
993
|
-
{ name: "support", type: "uint8" }
|
|
933
|
+
{ name: "support", type: "uint8" },
|
|
934
|
+
{ name: "lockWood", type: "uint256" }
|
|
994
935
|
],
|
|
995
936
|
outputs: []
|
|
996
937
|
},
|
|
@@ -1194,30 +1135,15 @@ var PROTOCOL_SELECTORS = {
|
|
|
1194
1135
|
signature: "propose(address,address,string,uint256,(uint256,uint16),(address,bytes,uint256)[],uint256[],(address,bytes,uint256)[],uint256[],(address,uint256)[])",
|
|
1195
1136
|
selector: "0x784ea274"
|
|
1196
1137
|
},
|
|
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
1138
|
voteOnProposal: {
|
|
1203
1139
|
iface: "IGuardianRegistry",
|
|
1204
|
-
signature: "voteOnProposal(address,uint256,uint8)",
|
|
1205
|
-
selector: "
|
|
1140
|
+
signature: "voteOnProposal(address,uint256,uint8,uint256)",
|
|
1141
|
+
selector: "0x4915ace5"
|
|
1206
1142
|
},
|
|
1207
1143
|
getReviewState: {
|
|
1208
1144
|
iface: "IGuardianRegistry",
|
|
1209
1145
|
signature: "getReviewState(address,uint256)",
|
|
1210
1146
|
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
1147
|
}
|
|
1222
1148
|
};
|
|
1223
1149
|
var API_CALLDATA_SELECTORS = {
|
|
@@ -1247,14 +1173,11 @@ var API_CALLDATA_SELECTORS = {
|
|
|
1247
1173
|
propose: [
|
|
1248
1174
|
{ target: "governor", selector: "0x784ea274", signature: PROTOCOL_SELECTORS.propose.signature }
|
|
1249
1175
|
],
|
|
1250
|
-
"propose-with-sandbox": [
|
|
1251
|
-
{ target: "governor", selector: "0x16c0fa9c", signature: PROTOCOL_SELECTORS.proposeWithSandbox.signature }
|
|
1252
|
-
],
|
|
1253
1176
|
vote: [
|
|
1254
1177
|
{ target: "governor", selector: "0x943e8216", signature: "vote(uint256,uint8)" }
|
|
1255
1178
|
],
|
|
1256
1179
|
"vote-on-proposal": [
|
|
1257
|
-
{ target: "guardianRegistry", selector: "
|
|
1180
|
+
{ target: "guardianRegistry", selector: "0x4915ace5", signature: PROTOCOL_SELECTORS.voteOnProposal.signature }
|
|
1258
1181
|
],
|
|
1259
1182
|
execute: [
|
|
1260
1183
|
{ target: "governor", selector: "0x0d61b519", signature: "executeProposal(uint256)" }
|
|
@@ -1315,7 +1238,6 @@ var NO_GUARDIAN_ERA = {
|
|
|
1315
1238
|
protocolConfig: ZERO_ADDRESS,
|
|
1316
1239
|
priceRouter: ZERO_ADDRESS,
|
|
1317
1240
|
tierRegistry: ZERO_ADDRESS,
|
|
1318
|
-
callSandboxImpl: ZERO_ADDRESS,
|
|
1319
1241
|
exposureLedger: ZERO_ADDRESS,
|
|
1320
1242
|
proposerBondEscrow: ZERO_ADDRESS,
|
|
1321
1243
|
challengeGame: ZERO_ADDRESS,
|
|
@@ -1458,7 +1380,6 @@ var ROBINHOOD_L2 = {
|
|
|
1458
1380
|
protocolConfig: "0xC104Eb6a522d6718cA28F344B2373B29d57FF2E0",
|
|
1459
1381
|
priceRouter: "0xDd302ffcfA08071780eC1A2f12BccFB9ba6b6731",
|
|
1460
1382
|
tierRegistry: "0x99b8068Dc0F6093466964D581f72d947e3e380DB",
|
|
1461
|
-
callSandboxImpl: "0xf09f6AF7DeBB964eD731376C9Af389F2Ce3d872A",
|
|
1462
1383
|
// Not in chains/46630.json (econ-security stack not deployed there yet).
|
|
1463
1384
|
exposureLedger: ZERO_ADDRESS,
|
|
1464
1385
|
proposerBondEscrow: ZERO_ADDRESS,
|
|
@@ -1485,23 +1406,22 @@ var ROBINHOOD_FORK = {
|
|
|
1485
1406
|
name: "Robinhood Chain (fork)",
|
|
1486
1407
|
slug: "robinhood-fork",
|
|
1487
1408
|
sherwood: {
|
|
1488
|
-
factory: "
|
|
1489
|
-
guardianRegistry: "
|
|
1490
|
-
stakedWood: "
|
|
1491
|
-
vaultImpl: "
|
|
1492
|
-
batchExecutorLib: "
|
|
1493
|
-
strategyFactory: "
|
|
1409
|
+
factory: "0x619af1488F32B4797f6faDa3C3a8De72a5B693E0",
|
|
1410
|
+
guardianRegistry: "0xD8F9E7446E6d6c02198AAaF674A0C5e3d5D1BF72",
|
|
1411
|
+
stakedWood: "0xdDf2B4C52B9575e0e6D03a3A57D75D06a4a9e203",
|
|
1412
|
+
vaultImpl: "0xdaB4707c9997a84e931FE98F4688adaFc70b6B95",
|
|
1413
|
+
batchExecutorLib: "0x899FC2Cac572F64A233344115b488E71E0044f34",
|
|
1414
|
+
strategyFactory: "0xb06788F027268a9A06c3AD41a88559530D2E54b1",
|
|
1494
1415
|
// Guardian-era contracts from sherwood-protocol/chains/9994663.json (SHE-93).
|
|
1495
|
-
governorBeacon: "
|
|
1496
|
-
protocolConfig: "
|
|
1497
|
-
// Not in chains/9994663.json (no PriceRouter
|
|
1416
|
+
governorBeacon: "0x3CF45eFE9fBDdd6cB749384Bf5c1bA5Ec96af05d",
|
|
1417
|
+
protocolConfig: "0x8aDb5810B5bF8B9149BE3Ca45Cb441818a9679bB",
|
|
1418
|
+
// Not in chains/9994663.json (no PriceRouter on the fork).
|
|
1498
1419
|
priceRouter: ZERO_ADDRESS,
|
|
1499
|
-
tierRegistry: "
|
|
1500
|
-
|
|
1501
|
-
|
|
1502
|
-
|
|
1503
|
-
|
|
1504
|
-
tokenCourt: "0x5DC603881f5d77f41bbd4202F1d518263Dfd497f"
|
|
1420
|
+
tierRegistry: "0x4614f058920941A0a9a852e62485fbDE692D75E1",
|
|
1421
|
+
exposureLedger: "0x99D789E7C8E65dB5597dCa692F082B47BE30AB33",
|
|
1422
|
+
proposerBondEscrow: "0x7d25058c891d3AC5C8bc8Da6aA937DFeE648B5cF",
|
|
1423
|
+
challengeGame: "0x7046FececcA6c0f5E66Cc998099593ae71A1bbee",
|
|
1424
|
+
tokenCourt: "0xC30bA62727be65fd867385Ce27Ff7C78bd66A897"
|
|
1505
1425
|
},
|
|
1506
1426
|
// The fork is ephemeral, so attestation WRITES are disabled there (CLI
|
|
1507
1427
|
// enforces it). Reads still resolve against the 4663 coordination chain, so
|
|
@@ -1523,10 +1443,12 @@ var ROBINHOOD_FORK = {
|
|
|
1523
1443
|
// A Tenderly vnet scopes its blocks under /explorer/vnet/<id> — the bare
|
|
1524
1444
|
// dashboard host resolves to the caller's own dashboard, not this fork.
|
|
1525
1445
|
explorer: "https://dashboard.tenderly.co/explorer/vnet/6ad5961e-fbca-452f-939f-ca9a8c020933",
|
|
1526
|
-
// PUBLIC endpoint of vnet
|
|
1527
|
-
// surface. Admin/cheat RPCs stay private
|
|
1446
|
+
// PUBLIC endpoint of the vnet carrying the v1 redeploy: reads + tx
|
|
1447
|
+
// broadcast, no state-cheat surface. Admin/cheat RPCs stay private
|
|
1448
|
+
// (Tenderly dashboard). Retired vnets answer `not_found` rather than a
|
|
1449
|
+
// transport error, so the address book is the tell for which one is live.
|
|
1528
1450
|
rpcs: [
|
|
1529
|
-
"https://virtual.robinhood-chain.eu.rpc.tenderly.co/moonwell/wormhole-bridge/
|
|
1451
|
+
"https://virtual.robinhood-chain.eu.rpc.tenderly.co/moonwell/wormhole-bridge/f509bc-4fdefe"
|
|
1530
1452
|
]
|
|
1531
1453
|
};
|
|
1532
1454
|
var REGISTRY = {
|
|
@@ -1945,155 +1867,6 @@ function encodePropose(args, chainId) {
|
|
|
1945
1867
|
note: "Reverts if the vault has an active proposal (cooldown not elapsed). The strategy address is immutable post-propose; pass address(0) to opt out of live NAV. `coProposers[].splitBps` total must satisfy contract-side constraints."
|
|
1946
1868
|
};
|
|
1947
1869
|
}
|
|
1948
|
-
var MAX_SANDBOX_CALLS = 32;
|
|
1949
|
-
var MAX_SANDBOX_TOKENS = 16;
|
|
1950
|
-
function validateSandboxCall(call, idx) {
|
|
1951
|
-
if (!call || typeof call !== "object") {
|
|
1952
|
-
throw usage(`\`sandbox.calls[${idx}]\` must be an object of {target, data}`);
|
|
1953
|
-
}
|
|
1954
|
-
const c = call;
|
|
1955
|
-
if ("value" in c && c.value !== void 0 && c.value !== null) {
|
|
1956
|
-
throw usage(`\`sandbox.calls[${idx}]\` must be (address,bytes) only \u2014 ICallSandbox.Call has no \`value\` field (native value would open an unmetered transfer channel). Do not alias BatchExecutorLib.Call.`);
|
|
1957
|
-
}
|
|
1958
|
-
if (typeof c.target !== "string" || !isAddress2(c.target)) {
|
|
1959
|
-
throw usage(`\`sandbox.calls[${idx}].target\` must be a 0x-prefixed address`);
|
|
1960
|
-
}
|
|
1961
|
-
if (getAddress2(c.target) === ZERO_ADDRESS2) {
|
|
1962
|
-
throw usage(`\`sandbox.calls[${idx}].target\` must not be the zero address (the governor reverts ZeroSandboxTarget)`);
|
|
1963
|
-
}
|
|
1964
|
-
if (typeof c.data !== "string" || !/^0x[0-9a-fA-F]*$/.test(c.data)) {
|
|
1965
|
-
throw usage(`\`sandbox.calls[${idx}].data\` must be a 0x-prefixed hex string`);
|
|
1966
|
-
}
|
|
1967
|
-
return { target: getAddress2(c.target), data: c.data };
|
|
1968
|
-
}
|
|
1969
|
-
function validateSandboxPayload(sandbox, maxCapital) {
|
|
1970
|
-
if (!sandbox || typeof sandbox !== "object") {
|
|
1971
|
-
throw usage("`sandbox` must be an object of {funding, calls, declaredTokens}");
|
|
1972
|
-
}
|
|
1973
|
-
const s = sandbox;
|
|
1974
|
-
const funding = toBigInt(s.funding, "sandbox.funding");
|
|
1975
|
-
if (funding === 0n) {
|
|
1976
|
-
throw usage("`sandbox.funding` must be > 0 (the governor rejects zero as ZeroSandboxFunding)");
|
|
1977
|
-
}
|
|
1978
|
-
if (funding > maxCapital) {
|
|
1979
|
-
throw usage(`\`sandbox.funding\` (${funding}) exceeds \`envelope.maxCapital\` (${maxCapital}) \u2014 the sandbox is funded out of the declared envelope, not beside it`);
|
|
1980
|
-
}
|
|
1981
|
-
if (!Array.isArray(s.calls)) {
|
|
1982
|
-
throw usage("`sandbox.calls` must be an array of {target, data} objects (no value)");
|
|
1983
|
-
}
|
|
1984
|
-
if (s.calls.length === 0) {
|
|
1985
|
-
throw usage("`sandbox.calls` must be non-empty (the governor rejects empty as EmptySandboxCalls)");
|
|
1986
|
-
}
|
|
1987
|
-
if (s.calls.length > MAX_SANDBOX_CALLS) {
|
|
1988
|
-
throw usage(`\`sandbox.calls\` has ${s.calls.length} entries; max is ${MAX_SANDBOX_CALLS}`);
|
|
1989
|
-
}
|
|
1990
|
-
const calls = s.calls.map((c, i) => validateSandboxCall(c, i));
|
|
1991
|
-
const rawTokens = s.declaredTokens ?? [];
|
|
1992
|
-
if (!Array.isArray(rawTokens)) {
|
|
1993
|
-
throw usage("`sandbox.declaredTokens` must be an array of addresses");
|
|
1994
|
-
}
|
|
1995
|
-
if (rawTokens.length > MAX_SANDBOX_TOKENS) {
|
|
1996
|
-
throw usage(`\`sandbox.declaredTokens\` has ${rawTokens.length} entries; max is ${MAX_SANDBOX_TOKENS}`);
|
|
1997
|
-
}
|
|
1998
|
-
const declaredTokens = [];
|
|
1999
|
-
const seen = /* @__PURE__ */ new Set();
|
|
2000
|
-
for (let i = 0; i < rawTokens.length; i++) {
|
|
2001
|
-
const t = rawTokens[i];
|
|
2002
|
-
if (typeof t !== "string" || !isAddress2(t)) {
|
|
2003
|
-
throw usage(`\`sandbox.declaredTokens[${i}]\` must be a 0x-prefixed address`);
|
|
2004
|
-
}
|
|
2005
|
-
const addr = getAddress2(t);
|
|
2006
|
-
if (seen.has(addr.toLowerCase())) {
|
|
2007
|
-
throw usage(`\`sandbox.declaredTokens[${i}]\` duplicates ${addr} (the governor reverts DuplicateSandboxToken)`);
|
|
2008
|
-
}
|
|
2009
|
-
seen.add(addr.toLowerCase());
|
|
2010
|
-
declaredTokens.push(addr);
|
|
2011
|
-
}
|
|
2012
|
-
return { funding, calls, declaredTokens };
|
|
2013
|
-
}
|
|
2014
|
-
function encodeProposeWithSandbox(args, chainId) {
|
|
2015
|
-
const vault = getAddress2(args.vault);
|
|
2016
|
-
const governor = parseGovernor(args.governor);
|
|
2017
|
-
const strategy = args.strategy === ZERO_ADDRESS2 ? ZERO_ADDRESS2 : getAddress2(args.strategy);
|
|
2018
|
-
if (typeof args.metadataURI !== "string" || args.metadataURI.length === 0) {
|
|
2019
|
-
throw usage("`metadataURI` must be a non-empty string (e.g. ipfs://...)");
|
|
2020
|
-
}
|
|
2021
|
-
const strategyDuration = typeof args.strategyDuration === "bigint" ? args.strategyDuration : BigInt(args.strategyDuration);
|
|
2022
|
-
if (strategyDuration <= 0n) {
|
|
2023
|
-
throw usage("`strategyDuration` must be > 0 (seconds)");
|
|
2024
|
-
}
|
|
2025
|
-
if (!Array.isArray(args.executeCalls)) {
|
|
2026
|
-
throw usage("`executeCalls` must be an array of {target, data, value} objects");
|
|
2027
|
-
}
|
|
2028
|
-
if (!Array.isArray(args.settlementCalls)) {
|
|
2029
|
-
throw usage("`settlementCalls` must be an array of {target, data, value} objects");
|
|
2030
|
-
}
|
|
2031
|
-
const executeCalls = args.executeCalls.map((c, i) => validateBatchCall(c, "executeCalls", i));
|
|
2032
|
-
const settlementCalls = args.settlementCalls.map((c, i) => validateBatchCall(c, "settlementCalls", i));
|
|
2033
|
-
const coProposers = (args.coProposers ?? []).map((cp, i) => {
|
|
2034
|
-
if (!cp || typeof cp !== "object") {
|
|
2035
|
-
throw usage(`\`coProposers[${i}]\` must be an object`);
|
|
2036
|
-
}
|
|
2037
|
-
const agent = cp.agent;
|
|
2038
|
-
const splitBps = cp.splitBps;
|
|
2039
|
-
if (typeof agent !== "string" || !isAddress2(agent)) {
|
|
2040
|
-
throw usage(`\`coProposers[${i}].agent\` must be a 0x-prefixed address`);
|
|
2041
|
-
}
|
|
2042
|
-
let bps;
|
|
2043
|
-
if (typeof splitBps === "string" && /^\d+$/.test(splitBps)) {
|
|
2044
|
-
bps = BigInt(splitBps);
|
|
2045
|
-
} else if (typeof splitBps === "bigint") {
|
|
2046
|
-
bps = splitBps;
|
|
2047
|
-
} else if (typeof splitBps === "number" && Number.isInteger(splitBps) && splitBps >= 0) {
|
|
2048
|
-
bps = BigInt(splitBps);
|
|
2049
|
-
} else {
|
|
2050
|
-
throw usage(`\`coProposers[${i}].splitBps\` must be a non-negative integer (string, number, or bigint)`);
|
|
2051
|
-
}
|
|
2052
|
-
if (bps < 0n || bps > 10000n) {
|
|
2053
|
-
throw usage(`\`coProposers[${i}].splitBps\` must be in [0, 10000]`);
|
|
2054
|
-
}
|
|
2055
|
-
return { agent: getAddress2(agent), splitBps: bps };
|
|
2056
|
-
});
|
|
2057
|
-
if (!args.envelope || typeof args.envelope !== "object") {
|
|
2058
|
-
throw usage("`envelope` must be an object of {maxCapital, maxDrawdownBps}");
|
|
2059
|
-
}
|
|
2060
|
-
const maxCapital = toBigInt(args.envelope.maxCapital, "envelope.maxCapital");
|
|
2061
|
-
if (maxCapital === 0n) {
|
|
2062
|
-
throw usage("`envelope.maxCapital` must be > 0 (the governor rejects zero as ZeroMaxCapital)");
|
|
2063
|
-
}
|
|
2064
|
-
const maxDrawdownBps = args.envelope.maxDrawdownBps;
|
|
2065
|
-
if (!Number.isInteger(maxDrawdownBps) || maxDrawdownBps < 0 || maxDrawdownBps > 1e4) {
|
|
2066
|
-
throw usage("`envelope.maxDrawdownBps` must be an integer in [0, 10000]");
|
|
2067
|
-
}
|
|
2068
|
-
const executeCallCaps = validateCaps(args.executeCallCaps, executeCalls, maxCapital, "executeCallCaps");
|
|
2069
|
-
const settlementCallCaps = validateCaps(args.settlementCallCaps, settlementCalls, maxCapital, "settlementCallCaps");
|
|
2070
|
-
const sandbox = validateSandboxPayload(args.sandbox, maxCapital);
|
|
2071
|
-
const data = encodeFunctionData2({
|
|
2072
|
-
abi: SYNDICATE_GOVERNOR_ABI,
|
|
2073
|
-
functionName: "proposeWithSandbox",
|
|
2074
|
-
args: [
|
|
2075
|
-
sandbox,
|
|
2076
|
-
vault,
|
|
2077
|
-
strategy,
|
|
2078
|
-
args.metadataURI,
|
|
2079
|
-
strategyDuration,
|
|
2080
|
-
{ maxCapital, maxDrawdownBps },
|
|
2081
|
-
executeCalls,
|
|
2082
|
-
executeCallCaps,
|
|
2083
|
-
settlementCalls,
|
|
2084
|
-
settlementCallCaps,
|
|
2085
|
-
coProposers
|
|
2086
|
-
]
|
|
2087
|
-
});
|
|
2088
|
-
return {
|
|
2089
|
-
txs: [governorTx(governor, chainId, data)],
|
|
2090
|
-
preconditions: [
|
|
2091
|
-
{ type: "vault-not-locked", vault }
|
|
2092
|
-
],
|
|
2093
|
-
description: `Propose a sandbox strategy on ${vault} (funding ${sandbox.funding.toString()}, ${sandbox.calls.length} sandbox call(s), duration ${strategyDuration.toString()}s).`,
|
|
2094
|
-
note: "Reverts if the vault has an active proposal, has no CallSandbox implementation bound, or the payload fails propose-time sandbox gates (empty calls, zero funding, funding > maxCapital, zero target, duplicate declared tokens). ICallSandbox.Call is (address,bytes) only \u2014 no native value."
|
|
2095
|
-
};
|
|
2096
|
-
}
|
|
2097
1870
|
function encodeUnstick(args, chainId) {
|
|
2098
1871
|
const governor = parseGovernor(args.governor);
|
|
2099
1872
|
const id = parseProposalId(args.proposalId);
|
|
@@ -2172,22 +1945,64 @@ function encodeGovernorParam(args, chainId) {
|
|
|
2172
1945
|
note: "Vault-owner only. V1.5 has no on-chain parameter timelock \u2014 the change applies immediately on this call. Bounds are validated on-chain; out-of-range values revert."
|
|
2173
1946
|
};
|
|
2174
1947
|
}
|
|
2175
|
-
function
|
|
1948
|
+
function parseSplitBps(value, label) {
|
|
1949
|
+
const v = Number(parseUintArg(value, label));
|
|
1950
|
+
if (v > 1e4)
|
|
1951
|
+
throw usage(`\`${label}\` must be <= 10000 bps, got ${v}`);
|
|
1952
|
+
return v;
|
|
1953
|
+
}
|
|
1954
|
+
function requireSplitSum(legs) {
|
|
1955
|
+
const sum = Object.values(legs).reduce((a, b) => a + b, 0);
|
|
1956
|
+
if (sum !== 1e4) {
|
|
1957
|
+
const parts = Object.entries(legs).map(([k, v]) => `${k}=${v}`).join(", ");
|
|
1958
|
+
throw usage(`split legs must sum to 10000 bps, got ${sum} (${parts})`);
|
|
1959
|
+
}
|
|
1960
|
+
}
|
|
1961
|
+
function encodeMgmtSplit(args, chainId) {
|
|
1962
|
+
if (!isAddress2(args.protocolConfig)) {
|
|
1963
|
+
throw usage(`\`protocolConfig\` must be a valid address, got "${args.protocolConfig}"`);
|
|
1964
|
+
}
|
|
1965
|
+
const protocolConfig = getAddress2(args.protocolConfig);
|
|
1966
|
+
const s = {
|
|
1967
|
+
agentBps: parseSplitBps(args.agentBps, "agentBps"),
|
|
1968
|
+
protocolBps: parseSplitBps(args.protocolBps, "protocolBps"),
|
|
1969
|
+
guardianBps: parseSplitBps(args.guardianBps, "guardianBps")
|
|
1970
|
+
};
|
|
1971
|
+
requireSplitSum(s);
|
|
1972
|
+
const data = encodeFunctionData2({
|
|
1973
|
+
abi: PROTOCOL_CONFIG_ABI,
|
|
1974
|
+
functionName: "setMgmtSplit",
|
|
1975
|
+
args: [s]
|
|
1976
|
+
});
|
|
1977
|
+
return {
|
|
1978
|
+
txs: [governorTx(protocolConfig, chainId, data)],
|
|
1979
|
+
preconditions: [],
|
|
1980
|
+
description: `Set ProtocolConfig mgmtSplit = agent ${s.agentBps} / protocol ${s.protocolBps} / guardian ${s.guardianBps} bps.`,
|
|
1981
|
+
note: "Protocol-owner only (the protocol multisig), NOT the vault owner. Targets the protocol-wide ProtocolConfig contract; in-flight proposals keep the split snapshotted at propose time."
|
|
1982
|
+
};
|
|
1983
|
+
}
|
|
1984
|
+
function encodePerfSplit(args, chainId) {
|
|
2176
1985
|
if (!isAddress2(args.protocolConfig)) {
|
|
2177
1986
|
throw usage(`\`protocolConfig\` must be a valid address, got "${args.protocolConfig}"`);
|
|
2178
1987
|
}
|
|
2179
1988
|
const protocolConfig = getAddress2(args.protocolConfig);
|
|
2180
|
-
const
|
|
1989
|
+
const s = {
|
|
1990
|
+
agentBps: parseSplitBps(args.agentBps, "agentBps"),
|
|
1991
|
+
protocolBps: parseSplitBps(args.protocolBps, "protocolBps"),
|
|
1992
|
+
guardianBps: parseSplitBps(args.guardianBps, "guardianBps"),
|
|
1993
|
+
ownerBps: parseSplitBps(args.ownerBps, "ownerBps")
|
|
1994
|
+
};
|
|
1995
|
+
requireSplitSum(s);
|
|
2181
1996
|
const data = encodeFunctionData2({
|
|
2182
1997
|
abi: PROTOCOL_CONFIG_ABI,
|
|
2183
|
-
functionName: "
|
|
2184
|
-
args: [
|
|
1998
|
+
functionName: "setPerfSplit",
|
|
1999
|
+
args: [s]
|
|
2185
2000
|
});
|
|
2186
2001
|
return {
|
|
2187
2002
|
txs: [governorTx(protocolConfig, chainId, data)],
|
|
2188
2003
|
preconditions: [],
|
|
2189
|
-
description: `Set ProtocolConfig
|
|
2190
|
-
note: "Protocol-owner only (the protocol multisig), NOT the vault owner. Targets the protocol-wide ProtocolConfig contract
|
|
2004
|
+
description: `Set ProtocolConfig perfSplit = agent ${s.agentBps} / protocol ${s.protocolBps} / guardian ${s.guardianBps} / owner ${s.ownerBps} bps.`,
|
|
2005
|
+
note: "Protocol-owner only (the protocol multisig), NOT the vault owner. Targets the protocol-wide ProtocolConfig contract; in-flight proposals keep the split snapshotted at propose time."
|
|
2191
2006
|
};
|
|
2192
2007
|
}
|
|
2193
2008
|
|
|
@@ -2559,17 +2374,21 @@ function encodeVoteOnProposal(args, chainId) {
|
|
|
2559
2374
|
throw usage("`vote` must be one of: Approve, Block");
|
|
2560
2375
|
}
|
|
2561
2376
|
const proposalId = parseUint(args.proposalId, "proposalId");
|
|
2377
|
+
if (typeof args.lockWood !== "bigint" || args.lockWood < 0n) {
|
|
2378
|
+
throw usage("`lockWood` must be a non-negative bigint of WOOD base units");
|
|
2379
|
+
}
|
|
2380
|
+
const lockWood = args.lockWood;
|
|
2562
2381
|
const data = encodeFunctionData7({
|
|
2563
2382
|
abi: GUARDIAN_REGISTRY_ABI,
|
|
2564
2383
|
functionName: "voteOnProposal",
|
|
2565
|
-
args: [governor, proposalId, support]
|
|
2384
|
+
args: [governor, proposalId, support, lockWood]
|
|
2566
2385
|
});
|
|
2567
|
-
const underwriting = args.vote === "Approve" ?
|
|
2386
|
+
const underwriting = args.vote === "Approve" ? ` APPROVE books coverage against the CALLER'S OWN slashable guardian bond (ExposureLedger.recordApproval): you declare ${lockWood.toString()} WOOD, the ledger locks that clamped to your free budget. If this proposal is later challenged or slashed, your WOOD stake is at risk \u2014 not another guardian's. An over-exposed guardian books nothing rather than reverting; the vote still lands.` : " Block votes do not book coverage, and `lockWood` is ignored. Slash severity is computed at resolveReview from block-side decisiveness.";
|
|
2568
2387
|
return {
|
|
2569
2388
|
txs: [registryTx(chainId, data)],
|
|
2570
2389
|
preconditions: [],
|
|
2571
2390
|
description: `Guardian review vote ${args.vote} on proposal ${proposalId.toString()} (governor ${governor}).`,
|
|
2572
|
-
note: `voteOnProposal(governor, proposalId, vote) \u2014
|
|
2391
|
+
note: `voteOnProposal(governor, proposalId, vote, lockWood) \u2014 4 args, selector 0x4915ace5.${underwriting}`
|
|
2573
2392
|
};
|
|
2574
2393
|
}
|
|
2575
2394
|
|
|
@@ -2577,6 +2396,7 @@ function encodeVoteOnProposal(args, chainId) {
|
|
|
2577
2396
|
import { getAddress as getAddress8 } from "viem";
|
|
2578
2397
|
|
|
2579
2398
|
// src/commands/identity.ts
|
|
2399
|
+
var COORDINATION_CHAIN_ID = 4663;
|
|
2580
2400
|
var IDENTITY_REGISTRY_ABI2 = [
|
|
2581
2401
|
{
|
|
2582
2402
|
name: "balanceOf",
|
|
@@ -2591,63 +2411,77 @@ var IDENTITY_REGISTRY_ABI2 = [
|
|
|
2591
2411
|
stateMutability: "view",
|
|
2592
2412
|
inputs: [{ name: "tokenId", type: "uint256" }],
|
|
2593
2413
|
outputs: [{ name: "", type: "address" }]
|
|
2414
|
+
},
|
|
2415
|
+
{
|
|
2416
|
+
name: "tokenURI",
|
|
2417
|
+
type: "function",
|
|
2418
|
+
stateMutability: "view",
|
|
2419
|
+
inputs: [{ name: "tokenId", type: "uint256" }],
|
|
2420
|
+
outputs: [{ name: "", type: "string" }]
|
|
2594
2421
|
}
|
|
2595
2422
|
];
|
|
2596
|
-
function
|
|
2597
|
-
const
|
|
2598
|
-
const
|
|
2599
|
-
const
|
|
2600
|
-
|
|
2601
|
-
|
|
2602
|
-
|
|
2603
|
-
|
|
2604
|
-
|
|
2605
|
-
|
|
2606
|
-
|
|
2607
|
-
|
|
2608
|
-
|
|
2609
|
-
|
|
2610
|
-
|
|
2423
|
+
async function ownedAgentIds(wallet) {
|
|
2424
|
+
const client = getPublicClient();
|
|
2425
|
+
const registry = AGENT_REGISTRY().IDENTITY_REGISTRY;
|
|
2426
|
+
const balance = await client.readContract({
|
|
2427
|
+
address: registry,
|
|
2428
|
+
abi: IDENTITY_REGISTRY_ABI2,
|
|
2429
|
+
functionName: "balanceOf",
|
|
2430
|
+
args: [wallet]
|
|
2431
|
+
});
|
|
2432
|
+
if (balance === 0n) return [];
|
|
2433
|
+
const logs = await client.getLogs({
|
|
2434
|
+
address: registry,
|
|
2435
|
+
event: {
|
|
2436
|
+
type: "event",
|
|
2437
|
+
name: "Transfer",
|
|
2438
|
+
inputs: [
|
|
2439
|
+
{ indexed: true, name: "from", type: "address" },
|
|
2440
|
+
{ indexed: true, name: "to", type: "address" },
|
|
2441
|
+
{ indexed: true, name: "tokenId", type: "uint256" }
|
|
2442
|
+
]
|
|
2443
|
+
},
|
|
2444
|
+
args: { from: "0x0000000000000000000000000000000000000000", to: wallet },
|
|
2445
|
+
fromBlock: 0n
|
|
2446
|
+
});
|
|
2447
|
+
const minted = [...new Set(logs.map((l) => l.args?.tokenId).filter((id) => id != null))];
|
|
2448
|
+
const owned = [];
|
|
2449
|
+
for (const id of minted) {
|
|
2450
|
+
try {
|
|
2451
|
+
const owner = await client.readContract({
|
|
2452
|
+
address: registry,
|
|
2453
|
+
abi: IDENTITY_REGISTRY_ABI2,
|
|
2454
|
+
functionName: "ownerOf",
|
|
2455
|
+
args: [id]
|
|
2456
|
+
});
|
|
2457
|
+
if (owner.toLowerCase() === wallet.toLowerCase()) owned.push(id);
|
|
2458
|
+
} catch {
|
|
2459
|
+
}
|
|
2611
2460
|
}
|
|
2612
|
-
return
|
|
2461
|
+
return owned;
|
|
2462
|
+
}
|
|
2463
|
+
async function lookupAgentIdsByWallet(wallet) {
|
|
2464
|
+
return withNetwork(COORDINATION_NETWORK, () => ownedAgentIds(wallet));
|
|
2613
2465
|
}
|
|
2614
2466
|
async function lookupAgentIdByWallet(wallet) {
|
|
2615
|
-
|
|
2616
|
-
|
|
2617
|
-
|
|
2618
|
-
|
|
2619
|
-
|
|
2620
|
-
|
|
2621
|
-
|
|
2622
|
-
|
|
2623
|
-
|
|
2624
|
-
|
|
2625
|
-
outputs: [{ name: "", type: "uint256" }]
|
|
2626
|
-
}],
|
|
2627
|
-
functionName: "balanceOf",
|
|
2628
|
-
args: [wallet]
|
|
2629
|
-
});
|
|
2630
|
-
if (balance === 0n) return null;
|
|
2631
|
-
const logs = await client.getLogs({
|
|
2632
|
-
address: registry,
|
|
2633
|
-
event: {
|
|
2634
|
-
type: "event",
|
|
2635
|
-
name: "Transfer",
|
|
2636
|
-
inputs: [
|
|
2637
|
-
{ indexed: true, name: "from", type: "address" },
|
|
2638
|
-
{ indexed: true, name: "to", type: "address" },
|
|
2639
|
-
{ indexed: true, name: "tokenId", type: "uint256" }
|
|
2640
|
-
]
|
|
2641
|
-
},
|
|
2642
|
-
args: { from: "0x0000000000000000000000000000000000000000", to: wallet },
|
|
2643
|
-
fromBlock: 0n
|
|
2467
|
+
const ids = await lookupAgentIdsByWallet(wallet);
|
|
2468
|
+
return ids[ids.length - 1] ?? null;
|
|
2469
|
+
}
|
|
2470
|
+
async function readIdentityMetadata(tokenId) {
|
|
2471
|
+
try {
|
|
2472
|
+
const uri = await getPublicClient().readContract({
|
|
2473
|
+
address: AGENT_REGISTRY().IDENTITY_REGISTRY,
|
|
2474
|
+
abi: IDENTITY_REGISTRY_ABI2,
|
|
2475
|
+
functionName: "tokenURI",
|
|
2476
|
+
args: [tokenId]
|
|
2644
2477
|
});
|
|
2645
|
-
|
|
2646
|
-
|
|
2647
|
-
|
|
2478
|
+
return await resolveMetadataSummary(uri);
|
|
2479
|
+
} catch {
|
|
2480
|
+
return null;
|
|
2481
|
+
}
|
|
2648
2482
|
}
|
|
2649
2483
|
function registerIdentityCommands(program) {
|
|
2650
|
-
const identity = program.command("identity").description("Manage ERC-8004 agent identity (
|
|
2484
|
+
const identity = program.command("identity").description("Manage ERC-8004 agent identity (on Robinhood mainnet, chain 4663)");
|
|
2651
2485
|
identity.command("mint").description("Register a new ERC-8004 agent identity (required before creating/joining vaults)").requiredOption("--name <name>", "Agent name (e.g. 'Alpha Seeker Agent')").option("--description <desc>", "Agent description", "Sherwood vault agent").option("--image <uri>", "Agent image URI (IPFS recommended)").action(async (opts) => {
|
|
2652
2486
|
if (isCalldataOnly()) {
|
|
2653
2487
|
emitCalldata(
|
|
@@ -2657,7 +2491,7 @@ function registerIdentityCommands(program) {
|
|
|
2657
2491
|
description: opts.description,
|
|
2658
2492
|
image: opts.image
|
|
2659
2493
|
},
|
|
2660
|
-
|
|
2494
|
+
COORDINATION_CHAIN_ID
|
|
2661
2495
|
)
|
|
2662
2496
|
);
|
|
2663
2497
|
return;
|
|
@@ -2681,7 +2515,7 @@ function registerIdentityCommands(program) {
|
|
|
2681
2515
|
}
|
|
2682
2516
|
const action = encodeIdentityMint(
|
|
2683
2517
|
{ name: opts.name, description: opts.description, image: opts.image },
|
|
2684
|
-
|
|
2518
|
+
COORDINATION_CHAIN_ID
|
|
2685
2519
|
);
|
|
2686
2520
|
const tx = action.txs[0];
|
|
2687
2521
|
const hash = await sendTxWithRetry({
|
|
@@ -2742,7 +2576,7 @@ function registerIdentityCommands(program) {
|
|
|
2742
2576
|
process.exit(1);
|
|
2743
2577
|
}
|
|
2744
2578
|
});
|
|
2745
|
-
identity.command("link-virtuals").description("Link a Virtuals economyOS agent identity (ERC-8004 on Base) to this Sherwood install").option("--wallet <address>", "economyOS agent wallet (default: auto-detect via `acp wallet address`)").option("--agent-id <tokenId>", "ERC-8004 token ID on the issuing chain (default: resolve
|
|
2579
|
+
identity.command("link-virtuals").description("Link a Virtuals economyOS agent identity (ERC-8004 on Robinhood Chain or Base) to this Sherwood install").option("--wallet <address>", "economyOS agent wallet (default: auto-detect via `acp wallet address`)").option("--agent-id <tokenId>", "ERC-8004 token ID on the issuing chain (default: resolve from that chain's registry)").option("--chain-id <id>", "Issuing chain ID (4663 = Robinhood Chain, 8453 = Base, 84532 = Base Sepolia)", String(DEFAULT_ISSUING_CHAIN_ID)).option("--binding-sig <hex>", "EIP-191 signature of the binding message by the economyOS wallet").option("--wallet-only", "Link without an ERC-8004 registration \u2014 the economyOS wallet + binding signature are the identity (agentId 0)").action(async (opts) => {
|
|
2746
2580
|
const account = getAccount();
|
|
2747
2581
|
const issuingChainId = opts.walletOnly ? WALLET_ONLY_CHAIN_ID : parseInt(opts.chainId, 10);
|
|
2748
2582
|
if (!opts.walletOnly && !ISSUING_CHAINS[issuingChainId]) {
|
|
@@ -2771,6 +2605,24 @@ function registerIdentityCommands(program) {
|
|
|
2771
2605
|
tokenId = 0n;
|
|
2772
2606
|
} else if (opts.agentId) {
|
|
2773
2607
|
tokenId = BigInt(opts.agentId);
|
|
2608
|
+
} else if (issuingChainId === COORDINATION_CHAIN_ID) {
|
|
2609
|
+
spinner.text = `Searching the ERC-8004 registry on Robinhood mainnet (${COORDINATION_CHAIN_ID}) for ${virtualsWallet}...`;
|
|
2610
|
+
const ids = await lookupAgentIdsByWallet(virtualsWallet);
|
|
2611
|
+
if (ids.length === 0) {
|
|
2612
|
+
spinner.fail(`No ERC-8004 registration found for ${virtualsWallet} on chain ${issuingChainId}`);
|
|
2613
|
+
console.error(chalk.dim(" Register first via the Virtuals CLI:"));
|
|
2614
|
+
console.error(chalk.dim(` acp agent register-erc8004 --agent-id ${virtualsAgentId ?? "<id>"} --chain-id ${issuingChainId}`));
|
|
2615
|
+
console.error(chalk.dim(" Then re-run this command (or pass --agent-id <tokenId> directly)."));
|
|
2616
|
+
console.error(chalk.dim(" No registration possible yet? Link without one: --wallet-only"));
|
|
2617
|
+
process.exit(1);
|
|
2618
|
+
}
|
|
2619
|
+
if (ids.length > 1) {
|
|
2620
|
+
spinner.fail(`Wallet ${virtualsWallet} has ${ids.length} ERC-8004 registrations on chain ${issuingChainId} \u2014 pick one explicitly`);
|
|
2621
|
+
for (const id of ids) console.error(chalk.dim(` #${id}`));
|
|
2622
|
+
console.error(chalk.green(" Re-run with: sherwood identity link-virtuals --agent-id <tokenId>"));
|
|
2623
|
+
process.exit(1);
|
|
2624
|
+
}
|
|
2625
|
+
tokenId = ids[0];
|
|
2774
2626
|
} else {
|
|
2775
2627
|
spinner.text = `Searching ERC-8004 registry on chain ${issuingChainId} for ${virtualsWallet}...`;
|
|
2776
2628
|
const sdk = new SDK({
|
|
@@ -2874,40 +2726,41 @@ function registerIdentityCommands(program) {
|
|
|
2874
2726
|
process.exit(1);
|
|
2875
2727
|
}
|
|
2876
2728
|
});
|
|
2877
|
-
identity.command("find").description("
|
|
2878
|
-
if (
|
|
2879
|
-
console.error(chalk.red("
|
|
2729
|
+
identity.command("find").description("Find ERC-8004 agent identities held by a wallet (recover a lost agent ID)").option("--wallet <address>", "Owner / wallet address").option("--name <text>", "(unsupported \u2014 name search needs an indexer; see the error it prints)").action(async (opts) => {
|
|
2730
|
+
if (opts.name) {
|
|
2731
|
+
console.error(chalk.red("Name search is not available."));
|
|
2732
|
+
console.error(chalk.dim(" Identity lives on Robinhood mainnet (4663) and no indexer covers that chain,"));
|
|
2733
|
+
console.error(chalk.dim(" so there is nothing to query by name. Search by owner instead:"));
|
|
2734
|
+
console.error(chalk.dim(" sherwood identity find --wallet <address>"));
|
|
2880
2735
|
process.exit(1);
|
|
2881
2736
|
}
|
|
2882
|
-
|
|
2737
|
+
if (!opts.wallet || !isAddress3(opts.wallet)) {
|
|
2738
|
+
console.error(chalk.red("Pass --wallet <address> (a 0x-prefixed address)."));
|
|
2739
|
+
process.exit(1);
|
|
2740
|
+
}
|
|
2741
|
+
const wallet = getAddress9(opts.wallet);
|
|
2742
|
+
const spinner = ora(`Searching the ERC-8004 registry on Robinhood mainnet (${COORDINATION_CHAIN_ID})...`).start();
|
|
2883
2743
|
try {
|
|
2884
|
-
const
|
|
2885
|
-
|
|
2886
|
-
|
|
2887
|
-
|
|
2888
|
-
filters.chains = opts.allChains ? "all" : [getChain().id];
|
|
2889
|
-
const results = await sdk.searchAgents(filters);
|
|
2744
|
+
const found = await withNetwork(COORDINATION_NETWORK, async () => {
|
|
2745
|
+
const ids = await ownedAgentIds(wallet);
|
|
2746
|
+
return Promise.all(ids.map(async (id) => ({ id, meta: await readIdentityMetadata(id) })));
|
|
2747
|
+
});
|
|
2890
2748
|
spinner.stop();
|
|
2891
|
-
if (
|
|
2892
|
-
console.log(chalk.dim(
|
|
2893
|
-
console.log(chalk.dim("
|
|
2749
|
+
if (found.length === 0) {
|
|
2750
|
+
console.log(chalk.dim(`No identity minted to ${wallet} on Robinhood mainnet (${COORDINATION_CHAIN_ID}).`));
|
|
2751
|
+
console.log(chalk.dim(" Mint one: sherwood identity mint --name <name>"));
|
|
2752
|
+
console.log(chalk.dim(" Already have one you received by transfer? Bind it directly:"));
|
|
2753
|
+
console.log(chalk.dim(" sherwood identity load --id <tokenId>"));
|
|
2894
2754
|
return;
|
|
2895
2755
|
}
|
|
2896
2756
|
console.log();
|
|
2897
|
-
console.log(chalk.bold(`Found ${
|
|
2757
|
+
console.log(chalk.bold(`Found ${found.length} agent${found.length === 1 ? "" : "s"}`));
|
|
2898
2758
|
console.log(chalk.dim("\u2500".repeat(50)));
|
|
2899
|
-
for (const
|
|
2900
|
-
|
|
2901
|
-
|
|
2902
|
-
console.log(
|
|
2903
|
-
console.log(chalk.dim(`
|
|
2904
|
-
console.log(chalk.dim(` Full: ${idStr}`));
|
|
2905
|
-
if (a.owners?.length) {
|
|
2906
|
-
console.log(chalk.dim(` Owner: ${a.owners[0]}`));
|
|
2907
|
-
}
|
|
2908
|
-
if (a.walletAddress) {
|
|
2909
|
-
console.log(chalk.dim(` Wallet: ${a.walletAddress}`));
|
|
2910
|
-
}
|
|
2759
|
+
for (const { id, meta } of found) {
|
|
2760
|
+
console.log(` ${chalk.bold(`#${id}`)} ${meta?.name || chalk.dim("(no name)")}`);
|
|
2761
|
+
console.log(chalk.dim(` Chain: Robinhood mainnet (${COORDINATION_CHAIN_ID})`));
|
|
2762
|
+
console.log(chalk.dim(` Owner: ${wallet}`));
|
|
2763
|
+
if (meta?.description) console.log(chalk.dim(` Desc: ${meta.description}`));
|
|
2911
2764
|
}
|
|
2912
2765
|
console.log();
|
|
2913
2766
|
console.log(chalk.green("To bind one of these to this machine:"));
|
|
@@ -2922,7 +2775,7 @@ function registerIdentityCommands(program) {
|
|
|
2922
2775
|
const account = getAccount();
|
|
2923
2776
|
if (getIdentityProvider() === "virtuals") {
|
|
2924
2777
|
const virtuals = getVirtualsIdentity();
|
|
2925
|
-
const
|
|
2778
|
+
const savedId2 = getAgentId();
|
|
2926
2779
|
const issuingChainId = getIdentityChainId();
|
|
2927
2780
|
console.log();
|
|
2928
2781
|
console.log(chalk.bold("Agent Identity (ERC-8004 via Virtuals economyOS)"));
|
|
@@ -2932,14 +2785,14 @@ function registerIdentityCommands(program) {
|
|
|
2932
2785
|
if (virtuals?.agentId) console.log(` Virtuals agent: ${virtuals.agentId}`);
|
|
2933
2786
|
const walletOnly = issuingChainId === WALLET_ONLY_CHAIN_ID;
|
|
2934
2787
|
console.log(` Issuing chain: ${walletOnly ? chalk.yellow("wallet-only (no ERC-8004)") : issuingChainId ?? chalk.red("(missing)")}`);
|
|
2935
|
-
console.log(` Saved ID: ${
|
|
2936
|
-
if (virtuals?.wallet &&
|
|
2788
|
+
console.log(` Saved ID: ${savedId2 != null ? walletOnly ? chalk.dim("0 (wallet-only)") : `#${savedId2}` : chalk.red("(missing)")}`);
|
|
2789
|
+
if (virtuals?.wallet && savedId2 != null && issuingChainId != null) {
|
|
2937
2790
|
const spinner2 = ora("Re-verifying link...").start();
|
|
2938
2791
|
try {
|
|
2939
2792
|
let ownerOk = true;
|
|
2940
2793
|
let owner;
|
|
2941
2794
|
if (!walletOnly) {
|
|
2942
|
-
owner = await ownerOfOnIssuingChain(issuingChainId, BigInt(
|
|
2795
|
+
owner = await ownerOfOnIssuingChain(issuingChainId, BigInt(savedId2));
|
|
2943
2796
|
ownerOk = owner.toLowerCase() === virtuals.wallet.toLowerCase();
|
|
2944
2797
|
}
|
|
2945
2798
|
let bindingOk = virtuals.wallet.toLowerCase() === account.address.toLowerCase();
|
|
@@ -2947,7 +2800,7 @@ function registerIdentityCommands(program) {
|
|
|
2947
2800
|
bindingOk = await verifyBinding({
|
|
2948
2801
|
sherwoodEoa: account.address,
|
|
2949
2802
|
issuingChainId,
|
|
2950
|
-
tokenId: BigInt(
|
|
2803
|
+
tokenId: BigInt(savedId2),
|
|
2951
2804
|
virtualsWallet: virtuals.wallet,
|
|
2952
2805
|
signature: virtuals.binding.sig
|
|
2953
2806
|
});
|
|
@@ -2974,86 +2827,79 @@ function registerIdentityCommands(program) {
|
|
|
2974
2827
|
console.log();
|
|
2975
2828
|
return;
|
|
2976
2829
|
}
|
|
2977
|
-
const
|
|
2978
|
-
const
|
|
2979
|
-
const spinner = ora(
|
|
2830
|
+
const savedId = getAgentId();
|
|
2831
|
+
const hasSavedId = savedId != null && savedId !== 0;
|
|
2832
|
+
const spinner = ora(`Checking identity on Robinhood mainnet (${COORDINATION_CHAIN_ID})...`).start();
|
|
2980
2833
|
try {
|
|
2981
|
-
const
|
|
2982
|
-
|
|
2983
|
-
|
|
2984
|
-
|
|
2985
|
-
|
|
2834
|
+
const state = await withNetwork(COORDINATION_NETWORK, async () => {
|
|
2835
|
+
const registry = AGENT_REGISTRY().IDENTITY_REGISTRY;
|
|
2836
|
+
const client = getPublicClient();
|
|
2837
|
+
const balance = await client.readContract({
|
|
2838
|
+
address: registry,
|
|
2839
|
+
abi: IDENTITY_REGISTRY_ABI2,
|
|
2840
|
+
functionName: "balanceOf",
|
|
2841
|
+
args: [account.address]
|
|
2842
|
+
});
|
|
2843
|
+
let owner = null;
|
|
2844
|
+
let meta = null;
|
|
2845
|
+
if (hasSavedId) {
|
|
2846
|
+
try {
|
|
2847
|
+
owner = await client.readContract({
|
|
2848
|
+
address: registry,
|
|
2849
|
+
abi: IDENTITY_REGISTRY_ABI2,
|
|
2850
|
+
functionName: "ownerOf",
|
|
2851
|
+
args: [BigInt(savedId)]
|
|
2852
|
+
});
|
|
2853
|
+
} catch {
|
|
2854
|
+
owner = null;
|
|
2855
|
+
}
|
|
2856
|
+
if (owner?.toLowerCase() === account.address.toLowerCase()) {
|
|
2857
|
+
meta = await readIdentityMetadata(BigInt(savedId));
|
|
2858
|
+
}
|
|
2859
|
+
}
|
|
2860
|
+
const owned = !hasSavedId && balance > 0n ? await ownedAgentIds(account.address) : [];
|
|
2861
|
+
return { registry, balance, owner, meta, owned };
|
|
2986
2862
|
});
|
|
2987
2863
|
spinner.stop();
|
|
2988
|
-
const savedId = getAgentId();
|
|
2989
2864
|
console.log();
|
|
2990
2865
|
console.log(chalk.bold("Agent Identity (ERC-8004)"));
|
|
2991
2866
|
console.log(chalk.dim("\u2500".repeat(40)));
|
|
2992
2867
|
console.log(` Wallet: ${account.address}`);
|
|
2993
|
-
console.log(`
|
|
2994
|
-
console.log(`
|
|
2995
|
-
|
|
2996
|
-
|
|
2997
|
-
|
|
2998
|
-
address: registry,
|
|
2999
|
-
abi: IDENTITY_REGISTRY_ABI2,
|
|
3000
|
-
functionName: "ownerOf",
|
|
3001
|
-
args: [BigInt(savedId)]
|
|
3002
|
-
});
|
|
3003
|
-
const isOwner = owner.toLowerCase() === account.address.toLowerCase();
|
|
3004
|
-
console.log(` Saved ID: #${savedId} ${isOwner ? chalk.green("(verified)") : chalk.red("(owned by " + owner + ")")}`);
|
|
3005
|
-
if (isOwner) {
|
|
3006
|
-
try {
|
|
3007
|
-
const sdk = getAgent0SDK();
|
|
3008
|
-
const agent = await sdk.loadAgent(`${getChain().id}:${savedId}`);
|
|
3009
|
-
if (agent.name) console.log(` Name: ${agent.name}`);
|
|
3010
|
-
if (agent.description) console.log(` Desc: ${chalk.dim(agent.description)}`);
|
|
3011
|
-
if (agent.walletAddress) console.log(` Wallet: ${agent.walletAddress}`);
|
|
3012
|
-
} catch {
|
|
3013
|
-
}
|
|
3014
|
-
}
|
|
3015
|
-
} catch {
|
|
2868
|
+
console.log(` Chain: Robinhood mainnet (${COORDINATION_CHAIN_ID}) \u2014 the coordination chain`);
|
|
2869
|
+
console.log(` Registry: ${state.registry}`);
|
|
2870
|
+
console.log(` NFTs owned: ${state.balance.toString()}`);
|
|
2871
|
+
if (hasSavedId) {
|
|
2872
|
+
if (state.owner == null) {
|
|
3016
2873
|
console.log(` Saved ID: #${savedId} ${chalk.red("(token not found)")}`);
|
|
2874
|
+
} else {
|
|
2875
|
+
const isOwner = state.owner.toLowerCase() === account.address.toLowerCase();
|
|
2876
|
+
console.log(` Saved ID: #${savedId} ${isOwner ? chalk.green("(verified)") : chalk.red("(owned by " + state.owner + ")")}`);
|
|
2877
|
+
console.log(` Owner: ${state.owner}`);
|
|
2878
|
+
if (state.meta?.name) console.log(` Name: ${state.meta.name}`);
|
|
2879
|
+
if (state.meta?.description) console.log(` Desc: ${chalk.dim(state.meta.description)}`);
|
|
3017
2880
|
}
|
|
3018
2881
|
console.log();
|
|
3019
|
-
} else if (
|
|
3020
|
-
console.log(` Saved ID: ${chalk.yellow("none (but this wallet owns
|
|
2882
|
+
} else if (state.owned.length > 0) {
|
|
2883
|
+
console.log(` Saved ID: ${chalk.yellow("none (but this wallet owns identities \u2014 listing below)")}`);
|
|
3021
2884
|
console.log();
|
|
3022
|
-
|
|
3023
|
-
|
|
3024
|
-
|
|
3025
|
-
const results = await sdk.searchAgents({
|
|
3026
|
-
walletAddress: account.address,
|
|
3027
|
-
chains: [getChain().id]
|
|
3028
|
-
});
|
|
3029
|
-
lookupSpinner.stop();
|
|
3030
|
-
if (results.length === 0) {
|
|
3031
|
-
console.log(chalk.dim(" No agents resolved for this wallet on the active chain."));
|
|
3032
|
-
console.log(chalk.dim(" If you minted on a different chain, try:"));
|
|
3033
|
-
console.log(chalk.dim(" sherwood identity find --wallet " + account.address + " --all-chains"));
|
|
3034
|
-
} else {
|
|
3035
|
-
console.log(chalk.bold(` Owned identities on this chain (${results.length}):`));
|
|
3036
|
-
for (const a of results) {
|
|
3037
|
-
const idStr = String(a.agentId);
|
|
3038
|
-
const tokenId = idStr.includes(":") ? idStr.split(":")[1] : idStr;
|
|
3039
|
-
console.log(` ${chalk.bold(`#${tokenId}`)} ${a.name || chalk.dim("(no name)")}`);
|
|
3040
|
-
}
|
|
3041
|
-
console.log();
|
|
3042
|
-
console.log(chalk.green(" Bind one to this machine:"));
|
|
3043
|
-
if (results.length === 1) {
|
|
3044
|
-
const idStr = String(results[0].agentId);
|
|
3045
|
-
const tokenId = idStr.includes(":") ? idStr.split(":")[1] : idStr;
|
|
3046
|
-
console.log(chalk.dim(` sherwood identity load --id ${tokenId}`));
|
|
3047
|
-
} else {
|
|
3048
|
-
console.log(chalk.dim(" sherwood identity load --id <tokenId>"));
|
|
3049
|
-
}
|
|
3050
|
-
}
|
|
3051
|
-
} catch (err) {
|
|
3052
|
-
lookupSpinner.warn("Could not resolve owned token IDs via Agent0 SDK");
|
|
3053
|
-
console.log(chalk.dim(` ${err.message}`));
|
|
3054
|
-
console.log(chalk.dim(" Try: sherwood identity find --wallet " + account.address));
|
|
2885
|
+
console.log(chalk.bold(` Identities held by this wallet (${state.owned.length}):`));
|
|
2886
|
+
for (const id of state.owned) {
|
|
2887
|
+
console.log(` ${chalk.bold(`#${id}`)}`);
|
|
3055
2888
|
}
|
|
3056
2889
|
console.log();
|
|
2890
|
+
console.log(chalk.green(" Bind one to this machine:"));
|
|
2891
|
+
console.log(
|
|
2892
|
+
chalk.dim(
|
|
2893
|
+
state.owned.length === 1 ? ` sherwood identity load --id ${state.owned[0]}` : " sherwood identity load --id <tokenId>"
|
|
2894
|
+
)
|
|
2895
|
+
);
|
|
2896
|
+
console.log();
|
|
2897
|
+
} else if (state.balance > 0n) {
|
|
2898
|
+
console.log(` Saved ID: ${chalk.yellow("none")}`);
|
|
2899
|
+
console.log(chalk.dim(" This wallet holds identities that were not minted to it, and the"));
|
|
2900
|
+
console.log(chalk.dim(" registry is not enumerable \u2014 bind yours by id:"));
|
|
2901
|
+
console.log(chalk.dim(" sherwood identity load --id <tokenId>"));
|
|
2902
|
+
console.log();
|
|
3057
2903
|
} else {
|
|
3058
2904
|
console.log(` Saved ID: ${chalk.dim("none \u2014 run 'sherwood identity mint --name <name>'")}`);
|
|
3059
2905
|
console.log();
|
|
@@ -3079,11 +2925,11 @@ export {
|
|
|
3079
2925
|
encodeSettle,
|
|
3080
2926
|
encodeCancel,
|
|
3081
2927
|
encodePropose,
|
|
3082
|
-
encodeProposeWithSandbox,
|
|
3083
2928
|
encodeUnstick,
|
|
3084
2929
|
encodeEmergencySettle,
|
|
3085
2930
|
encodeGovernorParam,
|
|
3086
|
-
|
|
2931
|
+
encodeMgmtSplit,
|
|
2932
|
+
encodePerfSplit,
|
|
3087
2933
|
encodeCreateFund,
|
|
3088
2934
|
encodeStrategyDeploy,
|
|
3089
2935
|
encodeJoinRequest,
|
|
@@ -3097,7 +2943,8 @@ export {
|
|
|
3097
2943
|
stripVidTag,
|
|
3098
2944
|
verifyVidTag,
|
|
3099
2945
|
makeOwnerOfCache,
|
|
2946
|
+
lookupAgentIdsByWallet,
|
|
3100
2947
|
lookupAgentIdByWallet,
|
|
3101
2948
|
registerIdentityCommands
|
|
3102
2949
|
};
|
|
3103
|
-
//# sourceMappingURL=chunk-
|
|
2950
|
+
//# sourceMappingURL=chunk-V7TNYHIK.js.map
|