@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.
- package/.claude/settings.local.json +31 -0
- package/.eslintrc.json +27 -0
- package/.prettierrc +9 -0
- package/.tool-versions +1 -0
- package/LICENSE +41 -0
- package/LICENSE_DATE.md +34 -0
- package/LICENSE_GRANTS.md +33 -0
- package/LICENSE_INFO.md +90 -0
- package/README.md +116 -17
- package/dapp.config.js +154 -0
- package/package.json +17 -44
- package/src/getSwapInstructions.ts +55 -0
- package/src/index.ts +192 -0
- package/tsconfig.json +18 -0
- package/AGENTS.md +0 -162
- package/abis.json +0 -181875
- package/addresses.json +0 -76
- package/dist/contracts/AaveV3.d.ts +0 -2594
- package/dist/contracts/AaveV3.d.ts.map +0 -1
- package/dist/contracts/AaveV3.js +0 -3272
- package/dist/contracts/AeroClassic.d.ts +0 -2118
- package/dist/contracts/AeroClassic.d.ts.map +0 -1
- package/dist/contracts/AeroClassic.js +0 -2679
- package/dist/contracts/AeroSlipstream.d.ts +0 -2256
- package/dist/contracts/AeroSlipstream.d.ts.map +0 -1
- package/dist/contracts/AeroSlipstream.js +0 -2848
- package/dist/contracts/AgentSenderGeneric.d.ts +0 -4129
- package/dist/contracts/AgentSenderGeneric.d.ts.map +0 -1
- package/dist/contracts/AgentSenderGeneric.js +0 -5397
- package/dist/contracts/AgentSenderSpecial.d.ts +0 -1997
- package/dist/contracts/AgentSenderSpecial.d.ts.map +0 -1
- package/dist/contracts/AgentSenderSpecial.js +0 -2532
- package/dist/contracts/AgentSenderSpecialSigHelper.d.ts +0 -2245
- package/dist/contracts/AgentSenderSpecialSigHelper.d.ts.map +0 -1
- package/dist/contracts/AgentSenderSpecialSigHelper.js +0 -2971
- package/dist/contracts/AgentWrapper.d.ts +0 -2520
- package/dist/contracts/AgentWrapper.d.ts.map +0 -1
- package/dist/contracts/AgentWrapper.js +0 -3389
- package/dist/contracts/AgentWrapperV1.d.ts +0 -3789
- package/dist/contracts/AgentWrapperV1.d.ts.map +0 -1
- package/dist/contracts/AgentWrapperV1.js +0 -4945
- package/dist/contracts/AgentWrapperV2.d.ts +0 -2494
- package/dist/contracts/AgentWrapperV2.d.ts.map +0 -1
- package/dist/contracts/AgentWrapperV2.js +0 -3354
- package/dist/contracts/Appraiser.d.ts +0 -577
- package/dist/contracts/Appraiser.d.ts.map +0 -1
- package/dist/contracts/Appraiser.js +0 -735
- package/dist/contracts/Avantis.d.ts +0 -2606
- package/dist/contracts/Avantis.d.ts.map +0 -1
- package/dist/contracts/Avantis.js +0 -3282
- package/dist/contracts/Billing.d.ts +0 -381
- package/dist/contracts/Billing.d.ts.map +0 -1
- package/dist/contracts/Billing.js +0 -451
- package/dist/contracts/ChequeBook.d.ts +0 -1704
- package/dist/contracts/ChequeBook.d.ts.map +0 -1
- package/dist/contracts/ChequeBook.js +0 -1922
- package/dist/contracts/CompoundV3.d.ts +0 -2622
- package/dist/contracts/CompoundV3.d.ts.map +0 -1
- package/dist/contracts/CompoundV3.js +0 -3304
- package/dist/contracts/ConvertVaultToken.d.ts +0 -64
- package/dist/contracts/ConvertVaultToken.d.ts.map +0 -1
- package/dist/contracts/ConvertVaultToken.js +0 -75
- package/dist/contracts/Curve.d.ts +0 -1107
- package/dist/contracts/Curve.d.ts.map +0 -1
- package/dist/contracts/Curve.js +0 -1379
- package/dist/contracts/DefaultsBase.d.ts +0 -306
- package/dist/contracts/DefaultsBase.d.ts.map +0 -1
- package/dist/contracts/DefaultsBase.js +0 -331
- package/dist/contracts/ERC20.d.ts +0 -288
- package/dist/contracts/ERC20.d.ts.map +0 -1
- package/dist/contracts/ERC20.js +0 -359
- package/dist/contracts/EarnVault.d.ts +0 -1733
- package/dist/contracts/EarnVault.d.ts.map +0 -1
- package/dist/contracts/EarnVault.js +0 -2235
- package/dist/contracts/EarnVaultAgent.d.ts +0 -1033
- package/dist/contracts/EarnVaultAgent.d.ts.map +0 -1
- package/dist/contracts/EarnVaultAgent.js +0 -1296
- package/dist/contracts/EarnVaultAgentSigHelper.d.ts +0 -905
- package/dist/contracts/EarnVaultAgentSigHelper.d.ts.map +0 -1
- package/dist/contracts/EarnVaultAgentSigHelper.js +0 -1198
- package/dist/contracts/Euler.d.ts +0 -2662
- package/dist/contracts/Euler.d.ts.map +0 -1
- package/dist/contracts/Euler.js +0 -3350
- package/dist/contracts/ExtraFi.d.ts +0 -2637
- package/dist/contracts/ExtraFi.d.ts.map +0 -1
- package/dist/contracts/ExtraFi.js +0 -3323
- package/dist/contracts/Fluid.d.ts +0 -2634
- package/dist/contracts/Fluid.d.ts.map +0 -1
- package/dist/contracts/Fluid.js +0 -3318
- package/dist/contracts/FortyAcres.d.ts +0 -2620
- package/dist/contracts/FortyAcres.d.ts.map +0 -1
- package/dist/contracts/FortyAcres.js +0 -3300
- package/dist/contracts/Hatchery.d.ts +0 -392
- package/dist/contracts/Hatchery.d.ts.map +0 -1
- package/dist/contracts/Hatchery.js +0 -472
- package/dist/contracts/Helpers.d.ts +0 -1463
- package/dist/contracts/Helpers.d.ts.map +0 -1
- package/dist/contracts/Helpers.js +0 -1763
- package/dist/contracts/HighCommand.d.ts +0 -2129
- package/dist/contracts/HighCommand.d.ts.map +0 -1
- package/dist/contracts/HighCommand.js +0 -2429
- package/dist/contracts/Kernel.d.ts +0 -387
- package/dist/contracts/Kernel.d.ts.map +0 -1
- package/dist/contracts/Kernel.js +0 -442
- package/dist/contracts/Ledger.d.ts +0 -708
- package/dist/contracts/Ledger.d.ts.map +0 -1
- package/dist/contracts/Ledger.js +0 -854
- package/dist/contracts/LegoBook.d.ts +0 -1463
- package/dist/contracts/LegoBook.d.ts.map +0 -1
- package/dist/contracts/LegoBook.js +0 -1763
- package/dist/contracts/LegoTools.d.ts +0 -1913
- package/dist/contracts/LegoTools.d.ts.map +0 -1
- package/dist/contracts/LegoTools.js +0 -2402
- package/dist/contracts/LevgVault.d.ts +0 -2115
- package/dist/contracts/LevgVault.d.ts.map +0 -1
- package/dist/contracts/LevgVault.js +0 -2733
- package/dist/contracts/LevgVaultAgent.d.ts +0 -1955
- package/dist/contracts/LevgVaultAgent.d.ts.map +0 -1
- package/dist/contracts/LevgVaultAgent.js +0 -2508
- package/dist/contracts/LevgVaultAgentSigHelper.d.ts +0 -2221
- package/dist/contracts/LevgVaultAgentSigHelper.d.ts.map +0 -1
- package/dist/contracts/LevgVaultAgentSigHelper.js +0 -2963
- package/dist/contracts/LevgVaultHelper.d.ts +0 -977
- package/dist/contracts/LevgVaultHelper.d.ts.map +0 -1
- package/dist/contracts/LevgVaultHelper.js +0 -1289
- package/dist/contracts/LevgVaultTools.d.ts +0 -2629
- package/dist/contracts/LevgVaultTools.d.ts.map +0 -1
- package/dist/contracts/LevgVaultTools.js +0 -3560
- package/dist/contracts/LootDistributor.d.ts +0 -1053
- package/dist/contracts/LootDistributor.d.ts.map +0 -1
- package/dist/contracts/LootDistributor.js +0 -1291
- package/dist/contracts/Migrator.d.ts +0 -289
- package/dist/contracts/Migrator.d.ts.map +0 -1
- package/dist/contracts/Migrator.js +0 -348
- package/dist/contracts/MissionControl.d.ts +0 -1405
- package/dist/contracts/MissionControl.d.ts.map +0 -1
- package/dist/contracts/MissionControl.js +0 -1592
- package/dist/contracts/Moonwell.d.ts +0 -2623
- package/dist/contracts/Moonwell.d.ts.map +0 -1
- package/dist/contracts/Moonwell.js +0 -3304
- package/dist/contracts/Morpho.d.ts +0 -2662
- package/dist/contracts/Morpho.d.ts.map +0 -1
- package/dist/contracts/Morpho.js +0 -3350
- package/dist/contracts/Paymaster.d.ts +0 -1714
- package/dist/contracts/Paymaster.d.ts.map +0 -1
- package/dist/contracts/Paymaster.js +0 -2098
- package/dist/contracts/RipeLego.d.ts +0 -2913
- package/dist/contracts/RipeLego.d.ts.map +0 -1
- package/dist/contracts/RipeLego.js +0 -3643
- package/dist/contracts/Sentinel.d.ts +0 -2064
- package/dist/contracts/Sentinel.d.ts.map +0 -1
- package/dist/contracts/Sentinel.js +0 -2476
- package/dist/contracts/SignatureHelper.d.ts +0 -4250
- package/dist/contracts/SignatureHelper.d.ts.map +0 -1
- package/dist/contracts/SignatureHelper.js +0 -5714
- package/dist/contracts/SignatureHelperV1.d.ts +0 -4250
- package/dist/contracts/SignatureHelperV1.d.ts.map +0 -1
- package/dist/contracts/SignatureHelperV1.js +0 -5714
- package/dist/contracts/SkyPsm.d.ts +0 -2667
- package/dist/contracts/SkyPsm.d.ts.map +0 -1
- package/dist/contracts/SkyPsm.js +0 -3356
- package/dist/contracts/Switchboard.d.ts +0 -1483
- package/dist/contracts/Switchboard.d.ts.map +0 -1
- package/dist/contracts/Switchboard.js +0 -1790
- package/dist/contracts/SwitchboardAlpha.d.ts +0 -3161
- package/dist/contracts/SwitchboardAlpha.d.ts.map +0 -1
- package/dist/contracts/SwitchboardAlpha.js +0 -3771
- package/dist/contracts/SwitchboardBravo.d.ts +0 -1591
- package/dist/contracts/SwitchboardBravo.d.ts.map +0 -1
- package/dist/contracts/SwitchboardBravo.js +0 -1872
- package/dist/contracts/SwitchboardCharlie.d.ts +0 -3172
- package/dist/contracts/SwitchboardCharlie.d.ts.map +0 -1
- package/dist/contracts/SwitchboardCharlie.js +0 -3713
- package/dist/contracts/UnderscoreLego.d.ts +0 -2592
- package/dist/contracts/UnderscoreLego.d.ts.map +0 -1
- package/dist/contracts/UnderscoreLego.js +0 -3264
- package/dist/contracts/UndyAero.d.ts +0 -1733
- package/dist/contracts/UndyAero.d.ts.map +0 -1
- package/dist/contracts/UndyAero.js +0 -2235
- package/dist/contracts/UndyBtc.d.ts +0 -1733
- package/dist/contracts/UndyBtc.d.ts.map +0 -1
- package/dist/contracts/UndyBtc.js +0 -2235
- package/dist/contracts/UndyCbeth.d.ts +0 -1733
- package/dist/contracts/UndyCbeth.d.ts.map +0 -1
- package/dist/contracts/UndyCbeth.js +0 -2235
- package/dist/contracts/UndyEth.d.ts +0 -1733
- package/dist/contracts/UndyEth.d.ts.map +0 -1
- package/dist/contracts/UndyEth.js +0 -2235
- package/dist/contracts/UndyEurc.d.ts +0 -1733
- package/dist/contracts/UndyEurc.d.ts.map +0 -1
- package/dist/contracts/UndyEurc.js +0 -2235
- package/dist/contracts/UndyGho.d.ts +0 -1733
- package/dist/contracts/UndyGho.d.ts.map +0 -1
- package/dist/contracts/UndyGho.js +0 -2235
- package/dist/contracts/UndyHq.d.ts +0 -1677
- package/dist/contracts/UndyHq.d.ts.map +0 -1
- package/dist/contracts/UndyHq.js +0 -2026
- package/dist/contracts/UndyRewardsLego.d.ts +0 -1572
- package/dist/contracts/UndyRewardsLego.d.ts.map +0 -1
- package/dist/contracts/UndyRewardsLego.js +0 -1994
- package/dist/contracts/UndyUsd.d.ts +0 -1733
- package/dist/contracts/UndyUsd.d.ts.map +0 -1
- package/dist/contracts/UndyUsd.js +0 -2235
- package/dist/contracts/UndyUsdV2.d.ts +0 -1762
- package/dist/contracts/UndyUsdV2.d.ts.map +0 -1
- package/dist/contracts/UndyUsdV2.js +0 -2267
- package/dist/contracts/UndyUsds.d.ts +0 -1733
- package/dist/contracts/UndyUsds.d.ts.map +0 -1
- package/dist/contracts/UndyUsds.js +0 -2235
- package/dist/contracts/UndyVirtual.d.ts +0 -1762
- package/dist/contracts/UndyVirtual.d.ts.map +0 -1
- package/dist/contracts/UndyVirtual.js +0 -2267
- package/dist/contracts/UniswapV2.d.ts +0 -2118
- package/dist/contracts/UniswapV2.d.ts.map +0 -1
- package/dist/contracts/UniswapV2.js +0 -2679
- package/dist/contracts/UniswapV3.d.ts +0 -2256
- package/dist/contracts/UniswapV3.d.ts.map +0 -1
- package/dist/contracts/UniswapV3.js +0 -2848
- package/dist/contracts/UserWallet.d.ts +0 -2650
- package/dist/contracts/UserWallet.d.ts.map +0 -1
- package/dist/contracts/UserWallet.js +0 -3520
- package/dist/contracts/UserWalletConfig.d.ts +0 -3901
- package/dist/contracts/UserWalletConfig.d.ts.map +0 -1
- package/dist/contracts/UserWalletConfig.js +0 -4507
- package/dist/contracts/UserWalletConfigV1.d.ts +0 -3692
- package/dist/contracts/UserWalletConfigV1.d.ts.map +0 -1
- package/dist/contracts/UserWalletConfigV1.js +0 -4276
- package/dist/contracts/UserWalletSignatureHelper.d.ts +0 -4552
- package/dist/contracts/UserWalletSignatureHelper.d.ts.map +0 -1
- package/dist/contracts/UserWalletSignatureHelper.js +0 -6123
- package/dist/contracts/UserWalletV1.d.ts +0 -2650
- package/dist/contracts/UserWalletV1.d.ts.map +0 -1
- package/dist/contracts/UserWalletV1.js +0 -3520
- package/dist/contracts/VaultRegistry.d.ts +0 -3162
- package/dist/contracts/VaultRegistry.d.ts.map +0 -1
- package/dist/contracts/VaultRegistry.js +0 -3893
- package/dist/contracts/WalletBackpack.d.ts +0 -1248
- package/dist/contracts/WalletBackpack.d.ts.map +0 -1
- package/dist/contracts/WalletBackpack.js +0 -1519
- package/dist/contracts/Wasabi.d.ts +0 -2620
- package/dist/contracts/Wasabi.d.ts.map +0 -1
- package/dist/contracts/Wasabi.js +0 -3300
- package/dist/contracts/index.d.ts +0 -76
- package/dist/contracts/index.d.ts.map +0 -1
- package/dist/contracts/index.js +0 -79
- package/dist/contracts/sdk.d.ts +0 -156
- package/dist/contracts/sdk.d.ts.map +0 -1
- package/dist/contracts/sdk.js +0 -158
- package/dist/getSwapInstructions.d.ts +0 -34
- package/dist/getSwapInstructions.d.ts.map +0 -1
- package/dist/getSwapInstructions.js +0 -21
- package/dist/index.d.ts +0 -135
- package/dist/index.d.ts.map +0 -1
- 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 -->
|