@underscore-finance/sdk 1.2.20-next.0 → 1.2.20-next.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.
Files changed (254) hide show
  1. package/.claude/settings.local.json +31 -0
  2. package/.eslintrc.json +27 -0
  3. package/.prettierrc +9 -0
  4. package/.tool-versions +1 -0
  5. package/LICENSE +41 -0
  6. package/LICENSE_DATE.md +34 -0
  7. package/LICENSE_GRANTS.md +33 -0
  8. package/LICENSE_INFO.md +90 -0
  9. package/README.md +116 -17
  10. package/dapp.config.js +154 -0
  11. package/package.json +17 -44
  12. package/src/getSwapInstructions.ts +55 -0
  13. package/src/index.ts +192 -0
  14. package/tsconfig.json +18 -0
  15. package/AGENTS.md +0 -162
  16. package/abis.json +0 -181875
  17. package/addresses.json +0 -76
  18. package/dist/contracts/AaveV3.d.ts +0 -2594
  19. package/dist/contracts/AaveV3.d.ts.map +0 -1
  20. package/dist/contracts/AaveV3.js +0 -3272
  21. package/dist/contracts/AeroClassic.d.ts +0 -2118
  22. package/dist/contracts/AeroClassic.d.ts.map +0 -1
  23. package/dist/contracts/AeroClassic.js +0 -2679
  24. package/dist/contracts/AeroSlipstream.d.ts +0 -2256
  25. package/dist/contracts/AeroSlipstream.d.ts.map +0 -1
  26. package/dist/contracts/AeroSlipstream.js +0 -2848
  27. package/dist/contracts/AgentSenderGeneric.d.ts +0 -4129
  28. package/dist/contracts/AgentSenderGeneric.d.ts.map +0 -1
  29. package/dist/contracts/AgentSenderGeneric.js +0 -5397
  30. package/dist/contracts/AgentSenderSpecial.d.ts +0 -1997
  31. package/dist/contracts/AgentSenderSpecial.d.ts.map +0 -1
  32. package/dist/contracts/AgentSenderSpecial.js +0 -2532
  33. package/dist/contracts/AgentSenderSpecialSigHelper.d.ts +0 -2245
  34. package/dist/contracts/AgentSenderSpecialSigHelper.d.ts.map +0 -1
  35. package/dist/contracts/AgentSenderSpecialSigHelper.js +0 -2971
  36. package/dist/contracts/AgentWrapper.d.ts +0 -2520
  37. package/dist/contracts/AgentWrapper.d.ts.map +0 -1
  38. package/dist/contracts/AgentWrapper.js +0 -3389
  39. package/dist/contracts/AgentWrapperV1.d.ts +0 -3789
  40. package/dist/contracts/AgentWrapperV1.d.ts.map +0 -1
  41. package/dist/contracts/AgentWrapperV1.js +0 -4945
  42. package/dist/contracts/AgentWrapperV2.d.ts +0 -2494
  43. package/dist/contracts/AgentWrapperV2.d.ts.map +0 -1
  44. package/dist/contracts/AgentWrapperV2.js +0 -3354
  45. package/dist/contracts/Appraiser.d.ts +0 -577
  46. package/dist/contracts/Appraiser.d.ts.map +0 -1
  47. package/dist/contracts/Appraiser.js +0 -735
  48. package/dist/contracts/Avantis.d.ts +0 -2606
  49. package/dist/contracts/Avantis.d.ts.map +0 -1
  50. package/dist/contracts/Avantis.js +0 -3282
  51. package/dist/contracts/Billing.d.ts +0 -381
  52. package/dist/contracts/Billing.d.ts.map +0 -1
  53. package/dist/contracts/Billing.js +0 -451
  54. package/dist/contracts/ChequeBook.d.ts +0 -1704
  55. package/dist/contracts/ChequeBook.d.ts.map +0 -1
  56. package/dist/contracts/ChequeBook.js +0 -1922
  57. package/dist/contracts/CompoundV3.d.ts +0 -2622
  58. package/dist/contracts/CompoundV3.d.ts.map +0 -1
  59. package/dist/contracts/CompoundV3.js +0 -3304
  60. package/dist/contracts/ConvertVaultToken.d.ts +0 -64
  61. package/dist/contracts/ConvertVaultToken.d.ts.map +0 -1
  62. package/dist/contracts/ConvertVaultToken.js +0 -75
  63. package/dist/contracts/Curve.d.ts +0 -1107
  64. package/dist/contracts/Curve.d.ts.map +0 -1
  65. package/dist/contracts/Curve.js +0 -1379
  66. package/dist/contracts/DefaultsBase.d.ts +0 -306
  67. package/dist/contracts/DefaultsBase.d.ts.map +0 -1
  68. package/dist/contracts/DefaultsBase.js +0 -331
  69. package/dist/contracts/ERC20.d.ts +0 -288
  70. package/dist/contracts/ERC20.d.ts.map +0 -1
  71. package/dist/contracts/ERC20.js +0 -359
  72. package/dist/contracts/EarnVault.d.ts +0 -1733
  73. package/dist/contracts/EarnVault.d.ts.map +0 -1
  74. package/dist/contracts/EarnVault.js +0 -2235
  75. package/dist/contracts/EarnVaultAgent.d.ts +0 -1033
  76. package/dist/contracts/EarnVaultAgent.d.ts.map +0 -1
  77. package/dist/contracts/EarnVaultAgent.js +0 -1296
  78. package/dist/contracts/EarnVaultAgentSigHelper.d.ts +0 -905
  79. package/dist/contracts/EarnVaultAgentSigHelper.d.ts.map +0 -1
  80. package/dist/contracts/EarnVaultAgentSigHelper.js +0 -1198
  81. package/dist/contracts/Euler.d.ts +0 -2662
  82. package/dist/contracts/Euler.d.ts.map +0 -1
  83. package/dist/contracts/Euler.js +0 -3350
  84. package/dist/contracts/ExtraFi.d.ts +0 -2637
  85. package/dist/contracts/ExtraFi.d.ts.map +0 -1
  86. package/dist/contracts/ExtraFi.js +0 -3323
  87. package/dist/contracts/Fluid.d.ts +0 -2634
  88. package/dist/contracts/Fluid.d.ts.map +0 -1
  89. package/dist/contracts/Fluid.js +0 -3318
  90. package/dist/contracts/FortyAcres.d.ts +0 -2620
  91. package/dist/contracts/FortyAcres.d.ts.map +0 -1
  92. package/dist/contracts/FortyAcres.js +0 -3300
  93. package/dist/contracts/Hatchery.d.ts +0 -392
  94. package/dist/contracts/Hatchery.d.ts.map +0 -1
  95. package/dist/contracts/Hatchery.js +0 -472
  96. package/dist/contracts/Helpers.d.ts +0 -1463
  97. package/dist/contracts/Helpers.d.ts.map +0 -1
  98. package/dist/contracts/Helpers.js +0 -1763
  99. package/dist/contracts/HighCommand.d.ts +0 -2129
  100. package/dist/contracts/HighCommand.d.ts.map +0 -1
  101. package/dist/contracts/HighCommand.js +0 -2429
  102. package/dist/contracts/Kernel.d.ts +0 -387
  103. package/dist/contracts/Kernel.d.ts.map +0 -1
  104. package/dist/contracts/Kernel.js +0 -442
  105. package/dist/contracts/Ledger.d.ts +0 -708
  106. package/dist/contracts/Ledger.d.ts.map +0 -1
  107. package/dist/contracts/Ledger.js +0 -854
  108. package/dist/contracts/LegoBook.d.ts +0 -1463
  109. package/dist/contracts/LegoBook.d.ts.map +0 -1
  110. package/dist/contracts/LegoBook.js +0 -1763
  111. package/dist/contracts/LegoTools.d.ts +0 -1913
  112. package/dist/contracts/LegoTools.d.ts.map +0 -1
  113. package/dist/contracts/LegoTools.js +0 -2402
  114. package/dist/contracts/LevgVault.d.ts +0 -2115
  115. package/dist/contracts/LevgVault.d.ts.map +0 -1
  116. package/dist/contracts/LevgVault.js +0 -2733
  117. package/dist/contracts/LevgVaultAgent.d.ts +0 -1955
  118. package/dist/contracts/LevgVaultAgent.d.ts.map +0 -1
  119. package/dist/contracts/LevgVaultAgent.js +0 -2508
  120. package/dist/contracts/LevgVaultAgentSigHelper.d.ts +0 -2221
  121. package/dist/contracts/LevgVaultAgentSigHelper.d.ts.map +0 -1
  122. package/dist/contracts/LevgVaultAgentSigHelper.js +0 -2963
  123. package/dist/contracts/LevgVaultHelper.d.ts +0 -977
  124. package/dist/contracts/LevgVaultHelper.d.ts.map +0 -1
  125. package/dist/contracts/LevgVaultHelper.js +0 -1289
  126. package/dist/contracts/LevgVaultTools.d.ts +0 -2629
  127. package/dist/contracts/LevgVaultTools.d.ts.map +0 -1
  128. package/dist/contracts/LevgVaultTools.js +0 -3560
  129. package/dist/contracts/LootDistributor.d.ts +0 -1053
  130. package/dist/contracts/LootDistributor.d.ts.map +0 -1
  131. package/dist/contracts/LootDistributor.js +0 -1291
  132. package/dist/contracts/Migrator.d.ts +0 -289
  133. package/dist/contracts/Migrator.d.ts.map +0 -1
  134. package/dist/contracts/Migrator.js +0 -348
  135. package/dist/contracts/MissionControl.d.ts +0 -1405
  136. package/dist/contracts/MissionControl.d.ts.map +0 -1
  137. package/dist/contracts/MissionControl.js +0 -1592
  138. package/dist/contracts/Moonwell.d.ts +0 -2623
  139. package/dist/contracts/Moonwell.d.ts.map +0 -1
  140. package/dist/contracts/Moonwell.js +0 -3304
  141. package/dist/contracts/Morpho.d.ts +0 -2662
  142. package/dist/contracts/Morpho.d.ts.map +0 -1
  143. package/dist/contracts/Morpho.js +0 -3350
  144. package/dist/contracts/Paymaster.d.ts +0 -1714
  145. package/dist/contracts/Paymaster.d.ts.map +0 -1
  146. package/dist/contracts/Paymaster.js +0 -2098
  147. package/dist/contracts/RipeLego.d.ts +0 -2913
  148. package/dist/contracts/RipeLego.d.ts.map +0 -1
  149. package/dist/contracts/RipeLego.js +0 -3643
  150. package/dist/contracts/Sentinel.d.ts +0 -2064
  151. package/dist/contracts/Sentinel.d.ts.map +0 -1
  152. package/dist/contracts/Sentinel.js +0 -2476
  153. package/dist/contracts/SignatureHelper.d.ts +0 -4250
  154. package/dist/contracts/SignatureHelper.d.ts.map +0 -1
  155. package/dist/contracts/SignatureHelper.js +0 -5714
  156. package/dist/contracts/SignatureHelperV1.d.ts +0 -4250
  157. package/dist/contracts/SignatureHelperV1.d.ts.map +0 -1
  158. package/dist/contracts/SignatureHelperV1.js +0 -5714
  159. package/dist/contracts/SkyPsm.d.ts +0 -2667
  160. package/dist/contracts/SkyPsm.d.ts.map +0 -1
  161. package/dist/contracts/SkyPsm.js +0 -3356
  162. package/dist/contracts/Switchboard.d.ts +0 -1483
  163. package/dist/contracts/Switchboard.d.ts.map +0 -1
  164. package/dist/contracts/Switchboard.js +0 -1790
  165. package/dist/contracts/SwitchboardAlpha.d.ts +0 -3161
  166. package/dist/contracts/SwitchboardAlpha.d.ts.map +0 -1
  167. package/dist/contracts/SwitchboardAlpha.js +0 -3771
  168. package/dist/contracts/SwitchboardBravo.d.ts +0 -1591
  169. package/dist/contracts/SwitchboardBravo.d.ts.map +0 -1
  170. package/dist/contracts/SwitchboardBravo.js +0 -1872
  171. package/dist/contracts/SwitchboardCharlie.d.ts +0 -3172
  172. package/dist/contracts/SwitchboardCharlie.d.ts.map +0 -1
  173. package/dist/contracts/SwitchboardCharlie.js +0 -3713
  174. package/dist/contracts/UnderscoreLego.d.ts +0 -2592
  175. package/dist/contracts/UnderscoreLego.d.ts.map +0 -1
  176. package/dist/contracts/UnderscoreLego.js +0 -3264
  177. package/dist/contracts/UndyAero.d.ts +0 -1733
  178. package/dist/contracts/UndyAero.d.ts.map +0 -1
  179. package/dist/contracts/UndyAero.js +0 -2235
  180. package/dist/contracts/UndyBtc.d.ts +0 -1733
  181. package/dist/contracts/UndyBtc.d.ts.map +0 -1
  182. package/dist/contracts/UndyBtc.js +0 -2235
  183. package/dist/contracts/UndyCbeth.d.ts +0 -1733
  184. package/dist/contracts/UndyCbeth.d.ts.map +0 -1
  185. package/dist/contracts/UndyCbeth.js +0 -2235
  186. package/dist/contracts/UndyEth.d.ts +0 -1733
  187. package/dist/contracts/UndyEth.d.ts.map +0 -1
  188. package/dist/contracts/UndyEth.js +0 -2235
  189. package/dist/contracts/UndyEurc.d.ts +0 -1733
  190. package/dist/contracts/UndyEurc.d.ts.map +0 -1
  191. package/dist/contracts/UndyEurc.js +0 -2235
  192. package/dist/contracts/UndyGho.d.ts +0 -1733
  193. package/dist/contracts/UndyGho.d.ts.map +0 -1
  194. package/dist/contracts/UndyGho.js +0 -2235
  195. package/dist/contracts/UndyHq.d.ts +0 -1677
  196. package/dist/contracts/UndyHq.d.ts.map +0 -1
  197. package/dist/contracts/UndyHq.js +0 -2026
  198. package/dist/contracts/UndyRewardsLego.d.ts +0 -1572
  199. package/dist/contracts/UndyRewardsLego.d.ts.map +0 -1
  200. package/dist/contracts/UndyRewardsLego.js +0 -1994
  201. package/dist/contracts/UndyUsd.d.ts +0 -1733
  202. package/dist/contracts/UndyUsd.d.ts.map +0 -1
  203. package/dist/contracts/UndyUsd.js +0 -2235
  204. package/dist/contracts/UndyUsdV2.d.ts +0 -1762
  205. package/dist/contracts/UndyUsdV2.d.ts.map +0 -1
  206. package/dist/contracts/UndyUsdV2.js +0 -2267
  207. package/dist/contracts/UndyUsds.d.ts +0 -1733
  208. package/dist/contracts/UndyUsds.d.ts.map +0 -1
  209. package/dist/contracts/UndyUsds.js +0 -2235
  210. package/dist/contracts/UndyVirtual.d.ts +0 -1762
  211. package/dist/contracts/UndyVirtual.d.ts.map +0 -1
  212. package/dist/contracts/UndyVirtual.js +0 -2267
  213. package/dist/contracts/UniswapV2.d.ts +0 -2118
  214. package/dist/contracts/UniswapV2.d.ts.map +0 -1
  215. package/dist/contracts/UniswapV2.js +0 -2679
  216. package/dist/contracts/UniswapV3.d.ts +0 -2256
  217. package/dist/contracts/UniswapV3.d.ts.map +0 -1
  218. package/dist/contracts/UniswapV3.js +0 -2848
  219. package/dist/contracts/UserWallet.d.ts +0 -2650
  220. package/dist/contracts/UserWallet.d.ts.map +0 -1
  221. package/dist/contracts/UserWallet.js +0 -3520
  222. package/dist/contracts/UserWalletConfig.d.ts +0 -3901
  223. package/dist/contracts/UserWalletConfig.d.ts.map +0 -1
  224. package/dist/contracts/UserWalletConfig.js +0 -4507
  225. package/dist/contracts/UserWalletConfigV1.d.ts +0 -3692
  226. package/dist/contracts/UserWalletConfigV1.d.ts.map +0 -1
  227. package/dist/contracts/UserWalletConfigV1.js +0 -4276
  228. package/dist/contracts/UserWalletSignatureHelper.d.ts +0 -4552
  229. package/dist/contracts/UserWalletSignatureHelper.d.ts.map +0 -1
  230. package/dist/contracts/UserWalletSignatureHelper.js +0 -6123
  231. package/dist/contracts/UserWalletV1.d.ts +0 -2650
  232. package/dist/contracts/UserWalletV1.d.ts.map +0 -1
  233. package/dist/contracts/UserWalletV1.js +0 -3520
  234. package/dist/contracts/VaultRegistry.d.ts +0 -3162
  235. package/dist/contracts/VaultRegistry.d.ts.map +0 -1
  236. package/dist/contracts/VaultRegistry.js +0 -3893
  237. package/dist/contracts/WalletBackpack.d.ts +0 -1248
  238. package/dist/contracts/WalletBackpack.d.ts.map +0 -1
  239. package/dist/contracts/WalletBackpack.js +0 -1519
  240. package/dist/contracts/Wasabi.d.ts +0 -2620
  241. package/dist/contracts/Wasabi.d.ts.map +0 -1
  242. package/dist/contracts/Wasabi.js +0 -3300
  243. package/dist/contracts/index.d.ts +0 -76
  244. package/dist/contracts/index.d.ts.map +0 -1
  245. package/dist/contracts/index.js +0 -79
  246. package/dist/contracts/sdk.d.ts +0 -156
  247. package/dist/contracts/sdk.d.ts.map +0 -1
  248. package/dist/contracts/sdk.js +0 -158
  249. package/dist/getSwapInstructions.d.ts +0 -34
  250. package/dist/getSwapInstructions.d.ts.map +0 -1
  251. package/dist/getSwapInstructions.js +0 -21
  252. package/dist/index.d.ts +0 -135
  253. package/dist/index.d.ts.map +0 -1
  254. package/dist/index.js +0 -137
@@ -0,0 +1,55 @@
1
+ import { AddressResolverFunction } from '@dappql/async'
2
+ import { Address, PublicClient } from 'viem'
3
+
4
+ import { LegoTools } from './contracts/index.js'
5
+
6
+ type DeepMutable<T> = {
7
+ -readonly [P in keyof T]: T[P] extends object ? DeepMutable<T[P]> : T[P]
8
+ }
9
+
10
+ export async function getSwapInstructionsAmountOut(
11
+ publicClient: PublicClient,
12
+ payload: {
13
+ tokenIn: Address
14
+ tokenOut: Address
15
+ amountIn: bigint
16
+ slippage: bigint
17
+ includeLegoIds?: bigint[]
18
+ },
19
+ addressResolver?: AddressResolverFunction,
20
+ ) {
21
+ const { tokenIn, tokenOut, amountIn, slippage, includeLegoIds } = payload
22
+
23
+ const instructions = await publicClient.simulateContract({
24
+ address: addressResolver ? addressResolver('LegoTools') : LegoTools.deployAddress!,
25
+ abi: LegoTools.abi,
26
+ functionName: 'getRoutesAndSwapInstructionsAmountOut',
27
+ args: [tokenIn, tokenOut, amountIn, slippage, includeLegoIds ?? []],
28
+ })
29
+
30
+ return instructions.result as DeepMutable<typeof instructions.result>
31
+ }
32
+
33
+ export async function getSwapInstructionsAmountIn(
34
+ publicClient: PublicClient,
35
+ payload: {
36
+ tokenIn: Address
37
+ tokenOut: Address
38
+ amountOut: bigint
39
+ amountInAvailable: bigint
40
+ slippage: bigint
41
+ includeLegoIds?: bigint[]
42
+ },
43
+ addressResolver?: AddressResolverFunction,
44
+ ) {
45
+ const { tokenIn, tokenOut, amountOut, amountInAvailable, slippage, includeLegoIds } = payload
46
+
47
+ const instructions = await publicClient.simulateContract({
48
+ address: addressResolver ? addressResolver('LegoTools') : LegoTools.deployAddress!,
49
+ abi: LegoTools.abi,
50
+ functionName: 'getRoutesAndSwapInstructionsAmountIn',
51
+ args: [tokenIn, tokenOut, amountOut, amountInAvailable, slippage, includeLegoIds ?? []],
52
+ })
53
+
54
+ return instructions.result as DeepMutable<typeof instructions.result>
55
+ }
package/src/index.ts ADDED
@@ -0,0 +1,192 @@
1
+ import { GetItemCallFunction, iteratorQuery, query, RequestCollection } from '@dappql/async'
2
+ import { Address, createPublicClient, http, PublicClient, WalletClient } from 'viem'
3
+ import { base } from 'viem/chains'
4
+
5
+ import * as CONTRACTS from './contracts/index.js'
6
+ import createSdk, { SDK } from './contracts/sdk.js'
7
+ import { getSwapInstructionsAmountIn, getSwapInstructionsAmountOut } from './getSwapInstructions.js'
8
+ export * from './contracts/index.js'
9
+
10
+ export type Contracts = SDK
11
+ export type ContractsNames = keyof typeof CONTRACTS
12
+
13
+ export const DEPARTMENT_IDS = {
14
+ LEDGER: 1n,
15
+ MISSION_CONTROL: 2n,
16
+ LEGO_BOOK: 3n,
17
+ SWITCHBOARD: 4n,
18
+ HATCHERY: 5n,
19
+ LOOT_DISTRIBUTOR: 6n,
20
+ APPRAISER: 7n,
21
+ WALLET_BACKPACK: 8n,
22
+ BILLING: 9n,
23
+ VAULT_REGISTRY: 10n,
24
+ HELPERS: 11n,
25
+ }
26
+
27
+ export const LEGOS_IDS = {
28
+ RIPE: 1n,
29
+ AAVE_V3: 2n,
30
+ COMPOUND_V3: 3n,
31
+ EULER: 4n,
32
+ FLUID: 5n,
33
+ MOONWELL: 6n,
34
+ MORPHO: 7n,
35
+ AERO_CLASSIC: 8n,
36
+ AERO_SLIPSTREAM: 9n,
37
+ CURVE: 10n,
38
+ UNISWAP_V2: 11n,
39
+ UNISWAP_V3: 12n,
40
+ UNDERSCORE: 13n,
41
+ FORTY_ACRES: 14n,
42
+ WASABI: 15n,
43
+ AVANTIS: 16n,
44
+ SKY_PSM: 17n,
45
+ EXTRA_FI: 18n,
46
+ }
47
+
48
+ export const HELPERS_IDS = {
49
+ LEGO_TOOLS: 1n,
50
+ LEVG_VAULT_TOOLS: 2n,
51
+ }
52
+
53
+ export type UnderscoreConfig = {
54
+ rpcUrl?: string
55
+ publicClient?: PublicClient
56
+ walletClient?: WalletClient
57
+ }
58
+
59
+ class Underscore {
60
+ public publicClient: PublicClient
61
+ public walletClient: WalletClient | undefined
62
+ public contracts: SDK
63
+ public addresses: Partial<Record<ContractsNames, `0x${string}`>>
64
+ constructor(config?: UnderscoreConfig) {
65
+ this.publicClient =
66
+ config?.publicClient ||
67
+ (createPublicClient({
68
+ chain: base,
69
+ transport: http(config?.rpcUrl),
70
+ }) as unknown as PublicClient)
71
+ this.addresses = {}
72
+ this.walletClient = config?.walletClient
73
+ this.contracts = createSdk(this.publicClient, this.walletClient, this.addressResolver)
74
+ }
75
+
76
+ async loadAddresses() {
77
+ const departments = await this.multicall((contracts) => {
78
+ return {
79
+ Ledger: contracts.UndyHq.call.getAddr(DEPARTMENT_IDS.LEDGER),
80
+ MissionControl: contracts.UndyHq.call.getAddr(DEPARTMENT_IDS.MISSION_CONTROL),
81
+ LegoBook: contracts.UndyHq.call.getAddr(DEPARTMENT_IDS.LEGO_BOOK),
82
+ Switchboard: contracts.UndyHq.call.getAddr(DEPARTMENT_IDS.SWITCHBOARD),
83
+ Hatchery: contracts.UndyHq.call.getAddr(DEPARTMENT_IDS.HATCHERY),
84
+ LootDistributor: contracts.UndyHq.call.getAddr(DEPARTMENT_IDS.LOOT_DISTRIBUTOR),
85
+ Appraiser: contracts.UndyHq.call.getAddr(DEPARTMENT_IDS.APPRAISER),
86
+ WalletBackpack: contracts.UndyHq.call.getAddr(DEPARTMENT_IDS.WALLET_BACKPACK),
87
+ Billing: contracts.UndyHq.call.getAddr(DEPARTMENT_IDS.BILLING),
88
+ VaultRegistry: contracts.UndyHq.call.getAddr(DEPARTMENT_IDS.VAULT_REGISTRY),
89
+ Helpers: contracts.UndyHq.call.getAddr(DEPARTMENT_IDS.HELPERS),
90
+ }
91
+ })
92
+ const children = await this.multicall((contracts) => {
93
+ return {
94
+ RipeLego: contracts.LegoBook.call.getAddr(LEGOS_IDS.RIPE).at(departments.LegoBook),
95
+ AaveV3: contracts.LegoBook.call.getAddr(LEGOS_IDS.AAVE_V3).at(departments.LegoBook),
96
+ CompoundV3: contracts.LegoBook.call.getAddr(LEGOS_IDS.COMPOUND_V3).at(departments.LegoBook),
97
+ Euler: contracts.LegoBook.call.getAddr(LEGOS_IDS.EULER).at(departments.LegoBook),
98
+ Fluid: contracts.LegoBook.call.getAddr(LEGOS_IDS.FLUID).at(departments.LegoBook),
99
+ Moonwell: contracts.LegoBook.call.getAddr(LEGOS_IDS.MOONWELL).at(departments.LegoBook),
100
+ Morpho: contracts.LegoBook.call.getAddr(LEGOS_IDS.MORPHO).at(departments.LegoBook),
101
+ AeroClassic: contracts.LegoBook.call.getAddr(LEGOS_IDS.AERO_CLASSIC).at(departments.LegoBook),
102
+ AeroSlipstream: contracts.LegoBook.call.getAddr(LEGOS_IDS.AERO_SLIPSTREAM).at(departments.LegoBook),
103
+ Curve: contracts.LegoBook.call.getAddr(LEGOS_IDS.CURVE).at(departments.LegoBook),
104
+ UniswapV2: contracts.LegoBook.call.getAddr(LEGOS_IDS.UNISWAP_V2).at(departments.LegoBook),
105
+ UniswapV3: contracts.LegoBook.call.getAddr(LEGOS_IDS.UNISWAP_V3).at(departments.LegoBook),
106
+ UnderscoreLego: contracts.LegoBook.call.getAddr(LEGOS_IDS.UNDERSCORE).at(departments.LegoBook),
107
+ FortyAcres: contracts.LegoBook.call.getAddr(LEGOS_IDS.FORTY_ACRES).at(departments.LegoBook),
108
+ Wasabi: contracts.LegoBook.call.getAddr(LEGOS_IDS.WASABI).at(departments.LegoBook),
109
+ Avantis: contracts.LegoBook.call.getAddr(LEGOS_IDS.AVANTIS).at(departments.LegoBook),
110
+ SkyPsm: contracts.LegoBook.call.getAddr(LEGOS_IDS.SKY_PSM).at(departments.LegoBook),
111
+ ExtraFi: contracts.LegoBook.call.getAddr(LEGOS_IDS.EXTRA_FI).at(departments.LegoBook),
112
+
113
+ SwitchboardAlpha: contracts.Switchboard.call.getAddr(1n).at(departments.Switchboard),
114
+ SwitchboardBravo: contracts.Switchboard.call.getAddr(2n).at(departments.Switchboard),
115
+ SwitchboardCharlie: contracts.Switchboard.call.getAddr(3n).at(departments.Switchboard),
116
+
117
+ LegoTools: contracts.Helpers.call.getAddr(1n).at(departments.Helpers),
118
+ LevgVaultTools: contracts.Helpers.call.getAddr(2n).at(departments.Helpers),
119
+ }
120
+ })
121
+
122
+ this.addresses = {
123
+ ...departments,
124
+ ...children,
125
+ }
126
+ }
127
+
128
+ addressResolver = (name: string) => {
129
+ return this.addresses[name as ContractsNames]!
130
+ }
131
+
132
+ setWalletClient(walletClient: WalletClient) {
133
+ this.walletClient = walletClient
134
+ this.contracts = createSdk(this.publicClient, this.walletClient)
135
+ }
136
+
137
+ setPublicClient(publicClient: PublicClient) {
138
+ this.publicClient = publicClient
139
+ this.contracts = createSdk(this.publicClient, this.walletClient)
140
+ }
141
+
142
+ async multicall<T extends RequestCollection>(
143
+ cb: (contracts: typeof CONTRACTS) => T,
144
+ options: { blockNumber?: bigint } = {},
145
+ ) {
146
+ const request = cb(CONTRACTS)
147
+ return (query as any)(this.publicClient, request, options, this.addressResolver) as ReturnType<typeof query<T>>
148
+ }
149
+
150
+ async iterate<T>(
151
+ cb: (contracts: typeof CONTRACTS) => {
152
+ total: bigint
153
+ getItem: GetItemCallFunction<T>
154
+ },
155
+ options: {
156
+ blockNumber?: bigint
157
+ firstIndex?: bigint
158
+ } = {},
159
+ ) {
160
+ const { total, getItem } = cb(CONTRACTS)
161
+ return (iteratorQuery as any)(this.publicClient, total, getItem, options, this.addressResolver) as ReturnType<
162
+ typeof iteratorQuery<T>
163
+ >
164
+ }
165
+
166
+ async getSwapInstructionsAmountOut(payload: {
167
+ tokenIn: Address
168
+ tokenOut: Address
169
+ amountIn: bigint
170
+ slippage: bigint
171
+ includeLegoIds?: bigint[]
172
+ }) {
173
+ return getSwapInstructionsAmountOut(this.publicClient, payload, this.addressResolver)
174
+ }
175
+
176
+ async getSwapInstructionsAmountIn(payload: {
177
+ tokenIn: Address
178
+ tokenOut: Address
179
+ amountOut: bigint
180
+ amountInAvailable: bigint
181
+ slippage: bigint
182
+ includeLegoIds?: bigint[]
183
+ }) {
184
+ return getSwapInstructionsAmountIn(this.publicClient, payload)
185
+ }
186
+
187
+ DEPARTMENT_IDS = DEPARTMENT_IDS
188
+
189
+ LEGOS_IDS = LEGOS_IDS
190
+ }
191
+
192
+ export default Underscore
package/tsconfig.json ADDED
@@ -0,0 +1,18 @@
1
+ {
2
+ "compilerOptions": {
3
+ "jsx": "react-jsx",
4
+ "module": "NodeNext",
5
+ "moduleResolution": "NodeNext",
6
+ "target": "ES2021",
7
+ "strict": true,
8
+ "outDir": "dist",
9
+ "rootDir": "src",
10
+ "declaration": true,
11
+ "declarationMap": true,
12
+ "esModuleInterop": true,
13
+ "skipLibCheck": true,
14
+ "resolveJsonModule": true
15
+ },
16
+ "include": ["src/**/*.ts", "src/**/*.tsx"],
17
+ "exclude": ["node_modules"]
18
+ }
package/AGENTS.md DELETED
@@ -1,162 +0,0 @@
1
- <!-- dappql:start -->
2
- <!-- Autogenerated by `dappql` from dapp.config.js — don't hand-edit between the dappql markers. Re-run `dappql` after config changes. -->
3
-
4
- # DappQL — project context for AI agents
5
-
6
- This project reads and writes on-chain state via **[DappQL](https://github.com/dappql/core)**, an agent-native data layer on wagmi + viem that makes smart contracts fluent for humans and agents. Use it for every contract interaction; don't reach for raw wagmi/viem primitives when a DappQL hook exists.
7
-
8
- Full agent reference: https://github.com/dappql/core/blob/main/AGENTS.md
9
-
10
- ## Generated setup
11
-
12
- - Contracts directory: `./src/contracts`
13
- - Module system: ESM
14
- - SDK factory: yes — `./src/contracts/sdk` exports `createSdk(publicClient, walletClient, addressResolver)`
15
- - Chain ID: 8453
16
-
17
- ## Contracts in this project
18
-
19
- | Contract | Shape | Reads | Writes | Events |
20
- | --- | --- | --- | --- | --- |
21
- | `AaveV3` | singleton | `getAddys`, `getUndyHq`, `isLegoAsset`, `getAssetOpportunities`, `getAssets`, `isAssetOpportunity`, `getNumLegoAssets`, `getWeightedPricePerShare`, … (+38) | `pause`, `recoverFunds`, `recoverFundsMany`, `setSnapShotPriceConfig`, `registerVaultTokenLocally`, `deregisterVaultTokenLocally`, `depositForYield`, `withdrawFromYield`, … (+14) | `AaveV3Deposit`, `AaveV3Withdrawal`, `LegoPauseModified`, `LegoFundsRecovered`, `SnapShotPriceConfigSet`, `AssetOpportunityAdded`, `AssetOpportunityRemoved` |
22
- | `AeroClassic` | singleton | `getAddys`, `getUndyHq`, `legoId`, `isPaused`, `hasCapability`, `getRegistries`, `isYieldLego`, `isDexLego`, … (+17) | `pause`, `recoverFunds`, `recoverFundsMany`, `swapTokens`, `addLiquidity`, `removeLiquidity`, `depositForYield`, `withdrawFromYield`, … (+10) | `AerodromeSwap`, `AerodromeLiquidityAdded`, `AerodromeLiquidityRemoved`, `LegoPauseModified`, `LegoFundsRecovered` |
23
- | `AeroSlipstream` | singleton | `getAddys`, `getUndyHq`, `legoId`, `isPaused`, `hasCapability`, `onERC721Received`, `getRegistries`, `isYieldLego`, … (+15) | `pause`, `recoverFunds`, `recoverFundsMany`, `swapTokens`, `uniswapV3SwapCallback`, `addLiquidityConcentrated`, `removeLiquidityConcentrated`, `getBestSwapAmountOut`, … (+16) | `AeroSlipStreamSwap`, `AeroSlipStreamLiquidityAdded`, `AeroSlipStreamLiquidityRemoved`, `AeroSlipStreamNftRecovered`, `AeroSlipstreamFeesCollected`, `LegoPauseModified`, `LegoFundsRecovered` |
24
- | `AgentSenderGeneric` | template | `hasPendingOwnerChange`, `owner`, `ownershipTimeLock`, `pendingOwner`, `MIN_OWNERSHIP_TIMELOCK`, `MAX_OWNERSHIP_TIMELOCK`, `getNonce`, `currentNonce` | `changeOwnership`, `confirmOwnershipChange`, `cancelOwnershipChange`, `setOwnershipTimeLock`, `transferFunds`, `createAndPayCheque`, `depositForYield`, `withdrawFromYield`, … (+17) | `NonceIncremented`, `OwnershipChangeInitiated`, `OwnershipChangeConfirmed`, `OwnershipChangeCancelled`, `OwnershipTimeLockSet` |
25
- | `AgentSenderSpecial` | template | `hasPendingOwnerChange`, `owner`, `ownershipTimeLock`, `pendingOwner`, `MIN_OWNERSHIP_TIMELOCK`, `MAX_OWNERSHIP_TIMELOCK`, `getNonce`, `currentNonce`, … (+3) | `changeOwnership`, `confirmOwnershipChange`, `cancelOwnershipChange`, `setOwnershipTimeLock`, `addCollateralAndBorrow`, `repayAndWithdraw`, `rebalanceYieldPositionsWithSwap`, `claimIncentivesAndSwap`, … (+1) | `NonceIncremented`, `OwnershipChangeInitiated`, `OwnershipChangeConfirmed`, `OwnershipChangeCancelled`, `OwnershipTimeLockSet` |
26
- | `AgentSenderSpecialSigHelper` | template | `getAddCollateralAndBorrowHash`, `getRepayAndWithdrawHash`, `getRebalanceYieldPositionsWithSwapHash`, `getClaimIncentivesAndSwapHash` | — | — |
27
- | `AgentWrapper` | template | `isSender`, `groupId`, `senders`, `indexOfSender`, `numSenders` | `transferFunds`, `createAndPayCheque`, `depositForYield`, `withdrawFromYield`, `rebalanceYieldPosition`, `swapTokens`, `mintOrRedeemAsset`, `confirmMintOrRedeemAsset`, … (+13) | `AgentAction` |
28
- | `AgentWrapperV1` | template | `hasPendingOwnerChange`, `owner`, `ownershipTimeLock`, `pendingOwner`, `MIN_OWNERSHIP_TIMELOCK`, `MAX_OWNERSHIP_TIMELOCK`, `getNonce`, `groupId`, … (+1) | `changeOwnership`, `confirmOwnershipChange`, `cancelOwnershipChange`, `setOwnershipTimeLock`, `transferFunds`, `depositForYield`, `withdrawFromYield`, `rebalanceYieldPosition`, … (+16) | `NonceIncremented`, `OwnershipChangeInitiated`, `OwnershipChangeConfirmed`, `OwnershipChangeCancelled`, `OwnershipTimeLockSet` |
29
- | `AgentWrapperV2` | template | `isSender`, `groupId`, `senders`, `indexOfSender`, `numSenders` | `transferFunds`, `depositForYield`, `withdrawFromYield`, `rebalanceYieldPosition`, `swapTokens`, `mintOrRedeemAsset`, `confirmMintOrRedeemAsset`, `addCollateral`, … (+12) | `AgentAction` |
30
- | `Appraiser` | singleton | `getAddys`, `getUndyHq`, `canMintUndy`, `isPaused`, `calculateYieldProfitsNoUpdate`, `lastPricePerShare`, `getUsdValue`, `getUnderlyingUsdValue`, … (+2) | `pause`, `recoverFunds`, `recoverFundsMany`, `calculateYieldProfits`, `updatePriceAndGetUsdValue`, `updatePriceAndGetUsdValueAndIsYieldAsset` | `DepartmentPauseModified`, `DepartmentFundsRecovered` |
31
- | `Avantis` | singleton | `getAddys`, `getUndyHq`, `isLegoAsset`, `getAssetOpportunities`, `getAssets`, `isAssetOpportunity`, `getNumLegoAssets`, `getWeightedPricePerShare`, … (+37) | `pause`, `recoverFunds`, `recoverFundsMany`, `setSnapShotPriceConfig`, `registerVaultTokenLocally`, `deregisterVaultTokenLocally`, `addPriceSnapshot`, `depositForYield`, … (+14) | `AvantisDeposit`, `AvantisWithdrawal`, `LegoPauseModified`, `LegoFundsRecovered`, `SnapShotPriceConfigSet`, `AssetOpportunityAdded`, `AssetOpportunityRemoved`, `PricePerShareSnapShotAdded` |
32
- | `Billing` | singleton | `getAddys`, `getUndyHq`, `canMintUndy`, `isPaused`, `canPullPaymentAsCheque`, `canPullPaymentAsPayee` | `pause`, `recoverFunds`, `recoverFundsMany`, `pullPaymentAsCheque`, `pullPaymentAsPayee` | `ChequePaymentPulled`, `PayeePaymentPulled`, `DepartmentPauseModified`, `DepartmentFundsRecovered` |
33
- | `ChequeBook` | singleton | `canCreateCheque`, `isValidNewCheque`, `isValidChequeSettings`, `getChequeConfig`, `createDefaultChequeSettings`, `UNDY_HQ`, `MIN_CHEQUE_PERIOD`, `MAX_CHEQUE_PERIOD`, … (+6) | `createCheque`, `cancelCheque`, `setChequeSettings`, `confirmPendingChequeSettings`, `cancelPendingChequeSettings` | `ChequeCreated`, `ChequeCancelled`, `ChequeSettingsModified`, `ChequeSettingsPending`, `ChequeSettingsPendingConfirmed`, `ChequeSettingsPendingCancelled` |
34
- | `CompoundV3` | singleton | `getAddys`, `getUndyHq`, `isLegoAsset`, `getAssetOpportunities`, `getAssets`, `isAssetOpportunity`, `getNumLegoAssets`, `getWeightedPricePerShare`, … (+37) | `pause`, `recoverFunds`, `recoverFundsMany`, `setSnapShotPriceConfig`, `registerVaultTokenLocally`, `deregisterVaultTokenLocally`, `depositForYield`, `withdrawFromYield`, … (+16) | `CompoundV3Deposit`, `CompoundV3Withdrawal`, `CompoundV3RewardsAddrSet`, `LegoPauseModified`, `LegoFundsRecovered`, `SnapShotPriceConfigSet`, `AssetOpportunityAdded`, `AssetOpportunityRemoved` |
35
- | `ConvertVaultToken` | singleton | — | `convertVaultToken` | — |
36
- | `Curve` | singleton | `getAddys`, `getUndyHq`, `legoId`, `isPaused`, `hasCapability`, `getRegistries`, `isYieldLego`, `isDexLego`, … (+16) | `pause`, `recoverFunds`, `recoverFundsMany`, `swapTokens`, `addLiquidity`, `removeLiquidity` | `CurveSwap`, `CurveLiquidityAdded`, `CurveLiquidityRemoved`, `LegoPauseModified`, `LegoFundsRecovered` |
37
- | `DefaultsBase` | singleton | `userWalletConfig`, `agentConfig`, `managerConfig`, `payeeConfig`, `chequeConfig`, `ripeRewardsConfig`, `securitySigners`, `whitelistedCreators` | — | — |
38
- | `ERC20` | template | `name`, `symbol`, `decimals`, `totalSupply`, `balanceOf`, `allowance`, `nonces`, `DOMAIN_SEPARATOR` | `transfer`, `transferFrom`, `approve`, `permit` | `Transfer`, `Approval` |
39
- | `EarnVault` | template | `name`, `symbol`, `decimals`, `DOMAIN_SEPARATOR`, `undyHq`, `blacklisted`, `isPaused`, `balanceOf`, … (+32) | `transfer`, `transferFrom`, `approve`, `increaseAllowance`, `decreaseAllowance`, `burn`, `permit`, `setBlacklist`, … (+16) | `Deposit`, `Withdraw`, `Transfer`, `Approval`, `BlacklistModified`, `TokenPauseModified`, `EarnVaultDeposit`, `EarnVaultWithdrawal`, … (+3) |
40
- | `EarnVaultAgent` | singleton | `hasPendingOwnerChange`, `owner`, `ownershipTimeLock`, `pendingOwner`, `MIN_OWNERSHIP_TIMELOCK`, `MAX_OWNERSHIP_TIMELOCK`, `getNonce`, `groupId`, … (+1) | `changeOwnership`, `confirmOwnershipChange`, `cancelOwnershipChange`, `setOwnershipTimeLock`, `depositForYield`, `withdrawFromYield`, `swapTokens`, `claimIncentives`, … (+2) | `NonceIncremented`, `OwnershipChangeInitiated`, `OwnershipChangeConfirmed`, `OwnershipChangeCancelled`, `OwnershipTimeLockSet` |
41
- | `EarnVaultAgentSigHelper` | singleton | `getDepositForYieldHash`, `getWithdrawFromYieldHash`, `getSwapTokensHash`, `getClaimIncentivesHash`, `getBatchActionsHash` | — | — |
42
- | `Euler` | singleton | `getAddys`, `getUndyHq`, `isLegoAsset`, `getAssetOpportunities`, `getAssets`, `isAssetOpportunity`, `getNumLegoAssets`, `getWeightedPricePerShare`, … (+39) | `pause`, `recoverFunds`, `recoverFundsMany`, `setSnapShotPriceConfig`, `registerVaultTokenLocally`, `deregisterVaultTokenLocally`, `addPriceSnapshot`, `depositForYield`, … (+15) | `EulerDeposit`, `EulerWithdrawal`, `EulerRewardsAddrSet`, `LegoPauseModified`, `LegoFundsRecovered`, `SnapShotPriceConfigSet`, `AssetOpportunityAdded`, `AssetOpportunityRemoved`, … (+1) |
43
- | `ExtraFi` | singleton | `getAddys`, `getUndyHq`, `isLegoAsset`, `getAssetOpportunities`, `getAssets`, `isAssetOpportunity`, `getNumLegoAssets`, `getWeightedPricePerShare`, … (+38) | `pause`, `recoverFunds`, `recoverFundsMany`, `setSnapShotPriceConfig`, `registerVaultTokenLocally`, `deregisterVaultTokenLocally`, `registerVaultTokensGlobally`, `addPriceSnapshot`, … (+15) | `ExtraFiDeposit`, `ExtraFiWithdrawal`, `AssetOpportunityAdded`, `LegoPauseModified`, `LegoFundsRecovered`, `SnapShotPriceConfigSet`, `AssetOpportunityRemoved`, `PricePerShareSnapShotAdded` |
44
- | `Fluid` | singleton | `getAddys`, `getUndyHq`, `isLegoAsset`, `getAssetOpportunities`, `getAssets`, `isAssetOpportunity`, `getNumLegoAssets`, `getWeightedPricePerShare`, … (+39) | `pause`, `recoverFunds`, `recoverFundsMany`, `setSnapShotPriceConfig`, `registerVaultTokenLocally`, `deregisterVaultTokenLocally`, `addPriceSnapshot`, `depositForYield`, … (+14) | `FluidDeposit`, `FluidWithdrawal`, `LegoPauseModified`, `LegoFundsRecovered`, `SnapShotPriceConfigSet`, `AssetOpportunityAdded`, `AssetOpportunityRemoved`, `PricePerShareSnapShotAdded` |
45
- | `FortyAcres` | singleton | `getAddys`, `getUndyHq`, `isLegoAsset`, `getAssetOpportunities`, `getAssets`, `isAssetOpportunity`, `getNumLegoAssets`, `getWeightedPricePerShare`, … (+38) | `pause`, `recoverFunds`, `recoverFundsMany`, `setSnapShotPriceConfig`, `registerVaultTokenLocally`, `deregisterVaultTokenLocally`, `addPriceSnapshot`, `depositForYield`, … (+14) | `FortyAcresDeposit`, `FortyAcresWithdrawal`, `LegoPauseModified`, `LegoFundsRecovered`, `SnapShotPriceConfigSet`, `AssetOpportunityAdded`, `AssetOpportunityRemoved`, `PricePerShareSnapShotAdded` |
46
- | `Hatchery` | singleton | `getAddys`, `getUndyHq`, `canMintUndy`, `isPaused`, `doesWalletStillHaveTrialFundsWithAddys`, `WETH`, `ETH` | `pause`, `recoverFunds`, `recoverFundsMany`, `createUserWallet` | `UserWalletCreated`, `DepartmentPauseModified`, `DepartmentFundsRecovered` |
47
- | `Helpers` | singleton | `getUndyHqFromGov`, `canGovern`, `getGovernors`, `hasPendingGovChange`, `isValidGovTimeLock`, `minGovChangeTimeLock`, `maxGovChangeTimeLock`, `governance`, … (+31) | `startGovernanceChange`, `confirmGovernanceChange`, `cancelGovernanceChange`, `relinquishGov`, `setGovTimeLock`, `finishUndyHqSetup`, `setRegistryTimeLock`, `setRegistryTimeLockAfterSetup`, … (+12) | `GovChangeTimeLockModified`, `RegistryTimeLockModified`, `GovChangeStarted`, `GovChangeConfirmed`, `GovChangeCancelled`, `GovRelinquished`, `UndyHqSetupFinished`, `DepartmentPauseModified`, … (+10) |
48
- | `HighCommand` | singleton | `isValidNewManager`, `validateManagerOnUpdate`, `validateGlobalManagerSettings`, `createDefaultGlobalManagerSettings`, `createStarterAgentSettings`, `getManagerSettingsBundle`, `UNDY_HQ`, `MIN_MANAGER_PERIOD`, … (+4) | `addManager`, `updateManager`, `removeManager`, `adjustManagerActivationLength`, `setGlobalManagerSettings` | `GlobalManagerSettingsModified`, `ManagerSettingsModified`, `ManagerRemoved`, `ManagerActivationLengthAdjusted` |
49
- | `Kernel` | singleton | `canManageWhitelist`, `getWhitelistConfig`, `UNDY_HQ` | `addPendingWhitelistAddr`, `confirmWhitelistAddr`, `cancelPendingWhitelistAddr`, `removeWhitelistAddr` | `WhitelistAddrPending`, `WhitelistAddrConfirmed`, `WhitelistAddrCancelled`, `WhitelistAddrRemoved` |
50
- | `Ledger` | singleton | `getAddys`, `getUndyHq`, `canMintUndy`, `isPaused`, `getNumUserWallets`, `isUserWallet`, `getLastTotalUsdValue`, `getUserAndGlobalPoints`, … (+14) | `pause`, `recoverFunds`, `recoverFundsMany`, `createUserWallet`, `setUserPoints`, `setGlobalPoints`, `setUserAndGlobalPoints`, `setVaultToken`, … (+2) | `DepartmentPauseModified`, `DepartmentFundsRecovered` |
51
- | `LegoBook` | singleton | `getUndyHqFromGov`, `canGovern`, `getGovernors`, `hasPendingGovChange`, `isValidGovTimeLock`, `minGovChangeTimeLock`, `maxGovChangeTimeLock`, `governance`, … (+31) | `startGovernanceChange`, `confirmGovernanceChange`, `cancelGovernanceChange`, `relinquishGov`, `setGovTimeLock`, `finishUndyHqSetup`, `setRegistryTimeLock`, `setRegistryTimeLockAfterSetup`, … (+12) | `GovChangeTimeLockModified`, `RegistryTimeLockModified`, `GovChangeStarted`, `GovChangeConfirmed`, `GovChangeCancelled`, `GovRelinquished`, `UndyHqSetupFinished`, `DepartmentPauseModified`, … (+10) |
52
- | `LegoTools` | singleton | `getAddys`, `getUndyHq`, `canMintUndy`, `isPaused`, `aaveV3`, `aaveV3Id`, `compoundV3`, `compoundV3Id`, … (+38) | `pause`, `recoverFunds`, `recoverFundsMany`, `getRoutesAndSwapInstructionsAmountOut`, `getRoutesAndSwapInstructionsAmountIn`, `prepareSwapInstructionsAmountOut`, `getBestSwapRoutesAmountOut`, `getBestSwapAmountOutWithRouterPool`, … (+6) | `DepartmentPauseModified`, `DepartmentFundsRecovered` |
53
- | `LevgVault` | template | `name`, `symbol`, `decimals`, `DOMAIN_SEPARATOR`, `undyHq`, `blacklisted`, `isPaused`, `balanceOf`, … (+35) | `transfer`, `transferFrom`, `approve`, `increaseAllowance`, `decreaseAllowance`, `burn`, `permit`, `setBlacklist`, … (+24) | `Deposit`, `Withdraw`, `LeftoversSwept`, `Transfer`, `Approval`, `BlacklistModified`, `TokenPauseModified`, `LevgVaultAction`, … (+5) |
54
- | `LevgVaultAgent` | singleton | `hasPendingOwnerChange`, `owner`, `ownershipTimeLock`, `pendingOwner`, `MIN_OWNERSHIP_TIMELOCK`, `MAX_OWNERSHIP_TIMELOCK`, `getNonce`, `UNDY_HQ`, … (+3) | `changeOwnership`, `confirmOwnershipChange`, `cancelOwnershipChange`, `setOwnershipTimeLock`, `borrowAndEarnYield`, `deleverage`, `compoundYieldGains`, `incrementNonce` | `NonceIncremented`, `OwnershipChangeInitiated`, `OwnershipChangeConfirmed`, `OwnershipChangeCancelled`, `OwnershipTimeLockSet` |
55
- | `LevgVaultAgentSigHelper` | singleton | `getBorrowAndEarnYieldHash`, `getDeleverageHash`, `getCompoundYieldGainsHash` | — | — |
56
- | `LevgVaultHelper` | template | `getAddys`, `getUndyHq`, `getSwappableUsdcAmount`, `getMaxBorrowAmount`, `performPostSwapValidation`, `getTotalAssetsForUsdcVault`, `getTotalAssetsForNonUsdcVault`, `getCollateralBalance`, … (+8) | — | — |
57
- | `LevgVaultTools` | singleton | `getAddys`, `getUndyHq`, `getTotalUnderlyingAmount`, `getAmountForAsset`, `getUnderlyingAmountForVaultToken`, `getRipeCollateralBalance`, `getUnderlyingGreenAmount`, `getSavingsGreenBalances`, … (+18) | — | — |
58
- | `LootDistributor` | singleton | `getAddys`, `getUndyHq`, `canMintUndy`, `isPaused`, `getClaimableLootForAsset`, `getTotalClaimableAssets`, `getLatestDepositPoints`, `isValidWalletConfig`, … (+13) | `pause`, `recoverFunds`, `recoverFundsMany`, `addLootFromSwapOrRewards`, `addLootFromYieldProfit`, `claimRevShareAndBonusLoot`, `adjustLoot`, `updateDepositPoints`, … (+6) | `TransactionFeePaid`, `RevenueTransferredToGov`, `YieldPerformanceFeePaid`, `AmbassadorTxFeePaid`, `YieldBonusPaid`, `LootAdjusted`, `LootClaimed`, `DepositRewardsAdded`, … (+4) |
59
- | `Migrator` | singleton | `canMigrateFundsToNewWallet`, `canCopyWalletConfig`, `getMigrationConfigBundle`, `UNDY_HQ` | `migrateAll`, `migrateFunds`, `cloneConfig` | `FundsMigrated`, `ConfigCloned` |
60
- | `MissionControl` | singleton | `getAddys`, `getUndyHq`, `canMintUndy`, `isPaused`, `getUserWalletCreationConfig`, `getDepositRewardsAsset`, `getLootClaimCoolOffPeriod`, `getRipeRewardsConfig`, … (+22) | `pause`, `recoverFunds`, `recoverFundsMany`, `setUserWalletConfig`, `setManagerConfig`, `setPayeeConfig`, `setChequeConfig`, `setRipeRewardsConfig`, … (+7) | `DepartmentPauseModified`, `DepartmentFundsRecovered` |
61
- | `Moonwell` | singleton | `getAddys`, `getUndyHq`, `isLegoAsset`, `getAssetOpportunities`, `getAssets`, `isAssetOpportunity`, `getNumLegoAssets`, `getWeightedPricePerShare`, … (+38) | `pause`, `recoverFunds`, `recoverFundsMany`, `setSnapShotPriceConfig`, `registerVaultTokenLocally`, `deregisterVaultTokenLocally`, `addPriceSnapshot`, `depositForYield`, … (+14) | `MoonwellDeposit`, `MoonwellWithdrawal`, `LegoPauseModified`, `LegoFundsRecovered`, `SnapShotPriceConfigSet`, `AssetOpportunityAdded`, `AssetOpportunityRemoved`, `PricePerShareSnapShotAdded` |
62
- | `Morpho` | singleton | `getAddys`, `getUndyHq`, `isLegoAsset`, `getAssetOpportunities`, `getAssets`, `isAssetOpportunity`, `getNumLegoAssets`, `getWeightedPricePerShare`, … (+39) | `pause`, `recoverFunds`, `recoverFundsMany`, `setSnapShotPriceConfig`, `registerVaultTokenLocally`, `deregisterVaultTokenLocally`, `addPriceSnapshot`, `depositForYield`, … (+15) | `MorphoDeposit`, `MorphoWithdrawal`, `MorphoRewardsAddrSet`, `LegoPauseModified`, `LegoFundsRecovered`, `SnapShotPriceConfigSet`, `AssetOpportunityAdded`, `AssetOpportunityRemoved`, … (+1) |
63
- | `Paymaster` | singleton | `isValidNewPayee`, `isValidPayeeUpdate`, `canAddPendingPayee`, `isValidGlobalPayeeSettings`, `getPayeeConfig`, `createDefaultGlobalPayeeSettings`, `UNDY_HQ`, `MIN_PAYEE_PERIOD`, … (+4) | `setGlobalPayeeSettings`, `addPayee`, `updatePayee`, `removePayee`, `addPendingPayee`, `confirmPendingPayee`, `cancelPendingPayee` | `PayeeAdded`, `PayeeUpdated`, `PayeeRemoved`, `GlobalPayeeSettingsModified`, `PayeePending`, `PayeePendingConfirmed`, `PayeePendingCancelled` |
64
- | `RipeLego` | singleton | `getAddys`, `getUndyHq`, `isLegoAsset`, `getAssetOpportunities`, `getAssets`, `isAssetOpportunity`, `getNumLegoAssets`, `getWeightedPricePerShare`, … (+41) | `pause`, `recoverFunds`, `recoverFundsMany`, `setSnapShotPriceConfig`, `registerVaultTokenLocally`, `deregisterVaultTokenLocally`, `addPriceSnapshot`, `depositForYield`, … (+16) | `RipeCollateralDeposit`, `RipeCollateralWithdrawal`, `RipeBorrow`, `RipeRepay`, `RipeClaimRewards`, `RipeSavingsGreenDeposit`, `RipeSavingsGreenWithdrawal`, `RipeEndaomentPsmSwap`, … (+6) |
65
- | `Sentinel` | singleton | `canSignerPerformAction`, `canSignerPerformActionWithConfig`, `canManagerFinishTx`, `checkManagerLimitsPostTx`, `isValidPayee`, `isValidPayeeAndGetData`, `isValidChequeAndGetData` | — | — |
66
- | `SignatureHelper` | singleton | `getTransferFundsHash`, `getDepositForYieldHash`, `getWithdrawFromYieldHash`, `getRebalanceYieldPositionHash`, `getSwapTokensHash`, `getMintOrRedeemAssetHash`, `getConfirmMintOrRedeemAssetHash`, `getAddCollateralHash`, … (+11) | — | — |
67
- | `SignatureHelperV1` | template | `getTransferFundsHash`, `getDepositForYieldHash`, `getWithdrawFromYieldHash`, `getRebalanceYieldPositionHash`, `getSwapTokensHash`, `getMintOrRedeemAssetHash`, `getConfirmMintOrRedeemAssetHash`, `getAddCollateralHash`, … (+11) | — | — |
68
- | `SkyPsm` | singleton | `getAddys`, `getUndyHq`, `isLegoAsset`, `getAssetOpportunities`, `getAssets`, `isAssetOpportunity`, `getNumLegoAssets`, `getWeightedPricePerShare`, … (+40) | `pause`, `recoverFunds`, `recoverFundsMany`, `setSnapShotPriceConfig`, `registerVaultTokenLocally`, `deregisterVaultTokenLocally`, `addPriceSnapshot`, `depositForYield`, … (+15) | `SkyPsmDeposit`, `SkyPsmWithdrawal`, `SlippageSet`, `LegoPauseModified`, `LegoFundsRecovered`, `SnapShotPriceConfigSet`, `AssetOpportunityAdded`, `AssetOpportunityRemoved`, … (+1) |
69
- | `Switchboard` | singleton | `getUndyHqFromGov`, `canGovern`, `getGovernors`, `hasPendingGovChange`, `isValidGovTimeLock`, `minGovChangeTimeLock`, `maxGovChangeTimeLock`, `governance`, … (+31) | `startGovernanceChange`, `confirmGovernanceChange`, `cancelGovernanceChange`, `relinquishGov`, `setGovTimeLock`, `finishUndyHqSetup`, `setRegistryTimeLock`, `setRegistryTimeLockAfterSetup`, … (+13) | `GovChangeTimeLockModified`, `RegistryTimeLockModified`, `GovChangeStarted`, `GovChangeConfirmed`, `GovChangeCancelled`, `GovRelinquished`, `UndyHqSetupFinished`, `DepartmentPauseModified`, … (+10) |
70
- | `SwitchboardAlpha` | singleton | `getAddys`, `getUndyHq`, `getUndyHqFromGov`, `canGovern`, `getGovernors`, `hasPendingGovChange`, `isValidGovTimeLock`, `minGovChangeTimeLock`, … (+29) | `startGovernanceChange`, `confirmGovernanceChange`, `cancelGovernanceChange`, `relinquishGov`, `setGovTimeLock`, `finishUndyHqSetup`, `setActionTimeLock`, `setExpiration`, … (+23) | `PendingUserWalletTemplatesChange`, `UserWalletTemplatesSet`, `PendingWalletCreationLimitsChange`, `WalletCreationLimitsSet`, `PendingKeyActionTimelockBoundsChange`, `KeyActionTimelockBoundsSet`, `PendingTxFeesChange`, `TxFeesSet`, … (+39) |
71
- | `SwitchboardBravo` | singleton | `getAddys`, `getUndyHq`, `getUndyHqFromGov`, `canGovern`, `getGovernors`, `hasPendingGovChange`, `isValidGovTimeLock`, `minGovChangeTimeLock`, … (+24) | `startGovernanceChange`, `confirmGovernanceChange`, `cancelGovernanceChange`, `relinquishGov`, `setGovTimeLock`, `finishUndyHqSetup`, `setActionTimeLock`, `setExpiration`, … (+15) | `PendingRecoverFundsAction`, `PendingRecoverFundsManyAction`, `PendingRecoverNftAction`, `PendingLootAdjustAction`, `PendingRecoverDepositRewardsAction`, `AssetDataUpdated`, `AllAssetDataUpdated`, `PendingSetEjectionModeAction`, … (+18) |
72
- | `SwitchboardCharlie` | singleton | `getAddys`, `getUndyHq`, `getUndyHqFromGov`, `canGovern`, `getGovernors`, `hasPendingGovChange`, `isValidGovTimeLock`, `minGovChangeTimeLock`, … (+37) | `startGovernanceChange`, `confirmGovernanceChange`, `cancelGovernanceChange`, `relinquishGov`, `setGovTimeLock`, `finishUndyHqSetup`, `setActionTimeLock`, `setExpiration`, … (+35) | `PendingRedemptionBufferChange`, `RedemptionBufferSet`, `PendingMinYieldWithdrawAmountChange`, `MinYieldWithdrawAmountSet`, `PendingSnapShotPriceConfigChange`, `SnapShotPriceConfigSet`, `PendingApprovedVaultTokenChange`, `ApprovedVaultTokenSet`, … (+52) |
73
- | `UnderscoreLego` | singleton | `getAddys`, `getUndyHq`, `isLegoAsset`, `getAssetOpportunities`, `getAssets`, `isAssetOpportunity`, `getNumLegoAssets`, `getWeightedPricePerShare`, … (+36) | `pause`, `recoverFunds`, `recoverFundsMany`, `setSnapShotPriceConfig`, `registerVaultTokenLocally`, `deregisterVaultTokenLocally`, `addPriceSnapshot`, `depositForYield`, … (+14) | `UnderscoreEarnVaultDeposit`, `UnderscoreEarnVaultWithdrawal`, `LegoPauseModified`, `LegoFundsRecovered`, `SnapShotPriceConfigSet`, `AssetOpportunityAdded`, `AssetOpportunityRemoved`, `PricePerShareSnapShotAdded` |
74
- | `UndyAero` | singleton | `name`, `symbol`, `decimals`, `DOMAIN_SEPARATOR`, `undyHq`, `blacklisted`, `isPaused`, `balanceOf`, … (+32) | `transfer`, `transferFrom`, `approve`, `increaseAllowance`, `decreaseAllowance`, `burn`, `permit`, `setBlacklist`, … (+16) | `Deposit`, `Withdraw`, `Transfer`, `Approval`, `BlacklistModified`, `TokenPauseModified`, `EarnVaultDeposit`, `EarnVaultWithdrawal`, … (+3) |
75
- | `UndyBtc` | singleton | `name`, `symbol`, `decimals`, `DOMAIN_SEPARATOR`, `undyHq`, `blacklisted`, `isPaused`, `balanceOf`, … (+32) | `transfer`, `transferFrom`, `approve`, `increaseAllowance`, `decreaseAllowance`, `burn`, `permit`, `setBlacklist`, … (+16) | `Deposit`, `Withdraw`, `Transfer`, `Approval`, `BlacklistModified`, `TokenPauseModified`, `EarnVaultDeposit`, `EarnVaultWithdrawal`, … (+3) |
76
- | `UndyCbeth` | singleton | `name`, `symbol`, `decimals`, `DOMAIN_SEPARATOR`, `undyHq`, `blacklisted`, `isPaused`, `balanceOf`, … (+32) | `transfer`, `transferFrom`, `approve`, `increaseAllowance`, `decreaseAllowance`, `burn`, `permit`, `setBlacklist`, … (+16) | `Deposit`, `Withdraw`, `Transfer`, `Approval`, `BlacklistModified`, `TokenPauseModified`, `EarnVaultDeposit`, `EarnVaultWithdrawal`, … (+3) |
77
- | `UndyEth` | singleton | `name`, `symbol`, `decimals`, `DOMAIN_SEPARATOR`, `undyHq`, `blacklisted`, `isPaused`, `balanceOf`, … (+32) | `transfer`, `transferFrom`, `approve`, `increaseAllowance`, `decreaseAllowance`, `burn`, `permit`, `setBlacklist`, … (+16) | `Deposit`, `Withdraw`, `Transfer`, `Approval`, `BlacklistModified`, `TokenPauseModified`, `EarnVaultDeposit`, `EarnVaultWithdrawal`, … (+3) |
78
- | `UndyEurc` | singleton | `name`, `symbol`, `decimals`, `DOMAIN_SEPARATOR`, `undyHq`, `blacklisted`, `isPaused`, `balanceOf`, … (+32) | `transfer`, `transferFrom`, `approve`, `increaseAllowance`, `decreaseAllowance`, `burn`, `permit`, `setBlacklist`, … (+16) | `Deposit`, `Withdraw`, `Transfer`, `Approval`, `BlacklistModified`, `TokenPauseModified`, `EarnVaultDeposit`, `EarnVaultWithdrawal`, … (+3) |
79
- | `UndyGho` | singleton | `name`, `symbol`, `decimals`, `DOMAIN_SEPARATOR`, `undyHq`, `blacklisted`, `isPaused`, `balanceOf`, … (+32) | `transfer`, `transferFrom`, `approve`, `increaseAllowance`, `decreaseAllowance`, `burn`, `permit`, `setBlacklist`, … (+16) | `Deposit`, `Withdraw`, `Transfer`, `Approval`, `BlacklistModified`, `TokenPauseModified`, `EarnVaultDeposit`, `EarnVaultWithdrawal`, … (+3) |
80
- | `UndyHq` | singleton | `getUndyHqFromGov`, `canGovern`, `getGovernors`, `hasPendingGovChange`, `isValidGovTimeLock`, `minGovChangeTimeLock`, `maxGovChangeTimeLock`, `governance`, … (+34) | `startGovernanceChange`, `confirmGovernanceChange`, `cancelGovernanceChange`, `relinquishGov`, `setGovTimeLock`, `finishUndyHqSetup`, `setRegistryTimeLock`, `setRegistryTimeLockAfterSetup`, … (+16) | `HqConfigChangeInitiated`, `HqConfigChangeConfirmed`, `HqConfigChangeCancelled`, `UndyHqFundsRecovered`, `UndyTokenSet`, `MintingEnabled`, `GovChangeTimeLockModified`, `RegistryTimeLockModified`, … (+14) |
81
- | `UndyRewardsLego` | singleton | `getAddys`, `getUndyHq`, `hasClaimableRewards`, `hasCapability`, `getRegistries`, `isDexLego`, `isYieldLego`, `isPaused`, … (+3) | `claimRewards`, `pause`, `recoverFunds`, `recoverFundsMany`, `depositForYield`, `withdrawFromYield`, `swapTokens`, `mintOrRedeemAsset`, … (+9) | — |
82
- | `UndyUsd` | singleton | `name`, `symbol`, `decimals`, `DOMAIN_SEPARATOR`, `undyHq`, `blacklisted`, `isPaused`, `balanceOf`, … (+32) | `transfer`, `transferFrom`, `approve`, `increaseAllowance`, `decreaseAllowance`, `burn`, `permit`, `setBlacklist`, … (+16) | `Deposit`, `Withdraw`, `Transfer`, `Approval`, `BlacklistModified`, `TokenPauseModified`, `EarnVaultDeposit`, `EarnVaultWithdrawal`, … (+3) |
83
- | `UndyUsdV2` | singleton | `name`, `symbol`, `decimals`, `DOMAIN_SEPARATOR`, `undyHq`, `blacklisted`, `isPaused`, `balanceOf`, … (+32) | `transfer`, `transferFrom`, `approve`, `increaseAllowance`, `decreaseAllowance`, `burn`, `permit`, `setBlacklist`, … (+17) | `Deposit`, `Withdraw`, `LeftoversSwept`, `Transfer`, `Approval`, `BlacklistModified`, `TokenPauseModified`, `EarnVaultDeposit`, … (+4) |
84
- | `UndyUsds` | singleton | `name`, `symbol`, `decimals`, `DOMAIN_SEPARATOR`, `undyHq`, `blacklisted`, `isPaused`, `balanceOf`, … (+32) | `transfer`, `transferFrom`, `approve`, `increaseAllowance`, `decreaseAllowance`, `burn`, `permit`, `setBlacklist`, … (+16) | `Deposit`, `Withdraw`, `Transfer`, `Approval`, `BlacklistModified`, `TokenPauseModified`, `EarnVaultDeposit`, `EarnVaultWithdrawal`, … (+3) |
85
- | `UndyVirtual` | singleton | `name`, `symbol`, `decimals`, `DOMAIN_SEPARATOR`, `undyHq`, `blacklisted`, `isPaused`, `balanceOf`, … (+32) | `transfer`, `transferFrom`, `approve`, `increaseAllowance`, `decreaseAllowance`, `burn`, `permit`, `setBlacklist`, … (+17) | `Deposit`, `Withdraw`, `LeftoversSwept`, `Transfer`, `Approval`, `BlacklistModified`, `TokenPauseModified`, `EarnVaultDeposit`, … (+4) |
86
- | `UniswapV2` | singleton | `getAddys`, `getUndyHq`, `legoId`, `isPaused`, `hasCapability`, `getRegistries`, `isYieldLego`, `isDexLego`, … (+17) | `pause`, `recoverFunds`, `recoverFundsMany`, `swapTokens`, `addLiquidity`, `removeLiquidity`, `depositForYield`, `withdrawFromYield`, … (+10) | `UniswapV2Swap`, `UniswapV2LiquidityAdded`, `UniswapV2LiquidityRemoved`, `LegoPauseModified`, `LegoFundsRecovered` |
87
- | `UniswapV3` | singleton | `getAddys`, `getUndyHq`, `legoId`, `isPaused`, `hasCapability`, `onERC721Received`, `getRegistries`, `isYieldLego`, … (+15) | `pause`, `recoverFunds`, `recoverFundsMany`, `swapTokens`, `uniswapV3SwapCallback`, `addLiquidityConcentrated`, `removeLiquidityConcentrated`, `getBestSwapAmountOut`, … (+16) | `UniswapV3Swap`, `UniswapV3LiquidityAdded`, `UniswapV3LiquidityRemoved`, `UniswapV3NftRecovered`, `UniswapV3FeesCollected`, `LegoPauseModified`, `LegoFundsRecovered` |
88
- | `UserWallet` | template | `onERC721Received`, `apiVersion`, `walletConfig`, `assetData`, `assets`, `indexOfAsset`, `numAssets`, `WETH`, … (+1) | `transferFunds`, `depositForYield`, `withdrawFromYield`, `rebalanceYieldPosition`, `swapTokens`, `mintOrRedeemAsset`, `confirmMintOrRedeemAsset`, `addCollateral`, … (+14) | `WalletAction`, `WalletActionExt` |
89
- | `UserWalletConfig` | template | `hasPendingOwnerChange`, `owner`, `ownershipTimeLock`, `pendingOwner`, `MIN_OWNERSHIP_TIMELOCK`, `MAX_OWNERSHIP_TIMELOCK`, `apiVersion`, `checkSignerPermissionsAndGetBundle`, … (+42) | `changeOwnership`, `confirmOwnershipChange`, `cancelOwnershipChange`, `setOwnershipTimeLock`, `setWallet`, `checkManagerLimitsPostTx`, `checkRecipientLimitsAndUpdateData`, `validateCheque`, … (+38) | `EjectionModeSet`, `FrozenSet`, `NftRecovered`, `OwnershipChangeInitiated`, `OwnershipChangeConfirmed`, `OwnershipChangeCancelled`, `OwnershipTimeLockSet` |
90
- | `UserWalletConfigV1` | template | `hasPendingOwnerChange`, `owner`, `ownershipTimeLock`, `pendingOwner`, `MIN_OWNERSHIP_TIMELOCK`, `MAX_OWNERSHIP_TIMELOCK`, `apiVersion`, `checkSignerPermissionsAndGetBundle`, … (+43) | `changeOwnership`, `confirmOwnershipChange`, `cancelOwnershipChange`, `setOwnershipTimeLock`, `setWallet`, `checkManagerUsdLimitsAndUpdateData`, `checkRecipientLimitsAndUpdateData`, `validateCheque`, … (+35) | `EjectionModeSet`, `FrozenSet`, `NftRecovered`, `OwnershipChangeInitiated`, `OwnershipChangeConfirmed`, `OwnershipChangeCancelled`, `OwnershipTimeLockSet` |
91
- | `UserWalletSignatureHelper` | template | `getTransferFundsHash`, `getCreateAndPayChequeHash`, `getDepositForYieldHash`, `getWithdrawFromYieldHash`, `getRebalanceYieldPositionHash`, `getSwapTokensHash`, `getMintOrRedeemAssetHash`, `getConfirmMintOrRedeemAssetHash`, … (+13) | — | — |
92
- | `UserWalletV1` | template | `onERC721Received`, `apiVersion`, `walletConfig`, `assetData`, `assets`, `indexOfAsset`, `numAssets`, `WETH`, … (+1) | `transferFunds`, `depositForYield`, `withdrawFromYield`, `rebalanceYieldPosition`, `swapTokens`, `mintOrRedeemAsset`, `confirmMintOrRedeemAsset`, `addCollateral`, … (+14) | `WalletAction`, `WalletActionExt` |
93
- | `VaultRegistry` | singleton | `getUndyHqFromGov`, `canGovern`, `getGovernors`, `hasPendingGovChange`, `isValidGovTimeLock`, `minGovChangeTimeLock`, `maxGovChangeTimeLock`, `governance`, … (+74) | `startGovernanceChange`, `confirmGovernanceChange`, `cancelGovernanceChange`, `relinquishGov`, `setGovTimeLock`, `finishUndyHqSetup`, `setRegistryTimeLock`, `setRegistryTimeLockAfterSetup`, … (+24) | `CanDepositSet`, `CanWithdrawSet`, `MaxDepositAmountSet`, `VaultOpsFrozenSet`, `RedemptionBufferSet`, `MinYieldWithdrawAmountSet`, `PerformanceFeeSet`, `DefaultTargetVaultTokenSet`, … (+24) |
94
- | `WalletBackpack` | singleton | `getUndyHqFromGov`, `canGovern`, `getGovernors`, `hasPendingGovChange`, `isValidGovTimeLock`, `minGovChangeTimeLock`, `maxGovChangeTimeLock`, `governance`, … (+27) | `startGovernanceChange`, `confirmGovernanceChange`, `cancelGovernanceChange`, `relinquishGov`, `setGovTimeLock`, `finishUndyHqSetup`, `pause`, `recoverFunds`, … (+22) | `PendingBackpackItemAdded`, `BackpackItemConfirmed`, `PendingBackpackItemCancelled`, `GovChangeTimeLockModified`, `ExpirationSet`, `ActionTimeLockSet`, `GovChangeStarted`, `GovChangeConfirmed`, … (+5) |
95
- | `Wasabi` | singleton | `getAddys`, `getUndyHq`, `isLegoAsset`, `getAssetOpportunities`, `getAssets`, `isAssetOpportunity`, `getNumLegoAssets`, `getWeightedPricePerShare`, … (+38) | `pause`, `recoverFunds`, `recoverFundsMany`, `setSnapShotPriceConfig`, `registerVaultTokenLocally`, `deregisterVaultTokenLocally`, `addPriceSnapshot`, `depositForYield`, … (+14) | `WasabiDeposit`, `WasabiWithdrawal`, `LegoPauseModified`, `LegoFundsRecovered`, `SnapShotPriceConfigSet`, `AssetOpportunityAdded`, `AssetOpportunityRemoved`, `PricePerShareSnapShotAdded` |
96
-
97
- *singleton = fixed `deployAddress` baked in. template = pass the address per use via `.at(addr)` in React or `sdk.Contract(addr)` in the SDK factory.*
98
-
99
- ## Use it
100
-
101
- ### React — prefer `useContextQuery` (batches across the whole tree)
102
-
103
- ```tsx
104
- import { AaveV3 } from './src/contracts'
105
- import { useContextQuery } from '@dappql/react'
106
-
107
- const { data, isLoading } = useContextQuery({
108
- getAddys: AaveV3.call.getAddys(),
109
- getUndyHq: AaveV3.call.getUndyHq(),
110
- })
111
- ```
112
-
113
- ### React — mutations
114
-
115
- ```tsx
116
- import { AeroClassic } from './src/contracts'
117
- import { useMutation } from '@dappql/react'
118
-
119
- const tx = useMutation(AeroClassic.mutation.pause, 'pause')
120
- tx.send(/* _shouldPause */)
121
- ```
122
-
123
- ### Template contracts
124
-
125
- ```ts
126
- // Template contract — bind the address per call
127
- AgentSenderGeneric.call.hasPendingOwnerChange().at(contractAddress)
128
- ```
129
-
130
- ### Non-React — generated SDK factory
131
-
132
- ```ts
133
- import createSdk from './src/contracts/sdk'
134
-
135
- const sdk = createSdk(publicClient, walletClient)
136
- const value = await sdk.AaveV3.getAddys()
137
- const bound = sdk.AgentSenderGeneric('0x...') // template: pass address
138
- const result = await bound.hasPendingOwnerChange()
139
- ```
140
-
141
- ### Non-React — ad-hoc multicall
142
-
143
- ```ts
144
- import { query } from '@dappql/async'
145
- import { AaveV3 } from './src/contracts'
146
-
147
- const { data } = await query(publicClient, {
148
- value: AaveV3.call.getAddys(),
149
- })
150
- ```
151
-
152
- ## Non-negotiables
153
-
154
- - **Always import from `./src/contracts`.** Never hand-craft ABIs or hardcode addresses already in the config. Re-run `dappql` after editing `dapp.config.js`.
155
- - **Never use `useReadContract` / `useReadContracts` / `useWriteContract` directly** when you can use `useContextQuery` / `useQuery` / `useMutation`. The batching and typing layer is the whole point.
156
- - **Default to `useContextQuery`** over `useQuery` — it fuses calls across the component tree into one RPC.
157
- - **`uint256` is `bigint`.** Use `0n`, `1n`, `BigInt(n)`. Never pass plain numbers where `bigint` is expected.
158
- - **Addresses are `\`0x${string}\``.** Checksum untrusted input via viem's `getAddress`.
159
- - **Mutation `send` takes spread args**: `tx.send(a, b, c)`, not `tx.send([a, b, c])`.
160
- - **Template contracts require an address** per use — use `.at(addr)` on the call builder or `sdk.Contract(addr)` in the SDK factory.
161
-
162
- <!-- dappql:end -->