damm-sdk 1.4.35 → 1.4.37
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +17187 -16747
- package/dist/index.cjs.map +84 -97
- package/dist/index.js +13222 -12265
- package/dist/index.js.map +77 -84
- package/dist/integrations/index.d.ts +1 -0
- package/dist/integrations/index.d.ts.map +1 -1
- package/dist/integrations/lagoonV1/delay.proxy.admin.d.ts +208 -0
- package/dist/integrations/lagoonV1/delay.proxy.admin.d.ts.map +1 -0
- package/dist/integrations/lagoonV1/index.d.ts +1 -0
- package/dist/integrations/lagoonV1/index.d.ts.map +1 -1
- package/dist/integrations/lagoonV1/lagoon.v1.d.ts +17 -0
- package/dist/integrations/lagoonV1/lagoon.v1.d.ts.map +1 -1
- package/dist/integrations/lagoonV2/addresses.d.ts +19 -0
- package/dist/integrations/lagoonV2/addresses.d.ts.map +1 -0
- package/dist/integrations/lagoonV2/factory.abi.d.ts +183 -0
- package/dist/integrations/lagoonV2/factory.abi.d.ts.map +1 -0
- package/dist/integrations/lagoonV2/index.d.ts +7 -0
- package/dist/integrations/lagoonV2/index.d.ts.map +1 -0
- package/dist/integrations/lagoonV2/lagoon.v2.d.ts +132 -0
- package/dist/integrations/lagoonV2/lagoon.v2.d.ts.map +1 -0
- package/dist/integrations/lagoonV2/lagoon.v2.permissions.d.ts +268 -0
- package/dist/integrations/lagoonV2/lagoon.v2.permissions.d.ts.map +1 -0
- package/dist/integrations/lagoonV2/lagoon.v2.setters.d.ts +293 -0
- package/dist/integrations/lagoonV2/lagoon.v2.setters.d.ts.map +1 -0
- package/dist/integrations/lagoonV2/vault.abi.d.ts +349 -0
- package/dist/integrations/lagoonV2/vault.abi.d.ts.map +1 -0
- package/dist/integrations/morphoVault/morpho.vault.d.ts +11 -0
- package/dist/integrations/morphoVault/morpho.vault.d.ts.map +1 -1
- package/dist/integrations/morphoVault/morpho.vault.v2.abi.d.ts +37 -0
- package/dist/integrations/morphoVault/morpho.vault.v2.abi.d.ts.map +1 -0
- package/package.json +1 -1
- package/src/integrations/index.ts +1 -0
- package/src/integrations/lagoonV1/delay.proxy.admin.ts +358 -0
- package/src/integrations/lagoonV1/index.ts +1 -0
- package/src/integrations/lagoonV1/lagoon.v1.ts +109 -36
- package/src/integrations/lagoonV2/addresses.ts +35 -0
- package/src/integrations/lagoonV2/factory.abi.ts +110 -0
- package/src/integrations/lagoonV2/index.ts +6 -0
- package/src/integrations/lagoonV2/lagoon.v2.permissions.ts +578 -0
- package/src/integrations/lagoonV2/lagoon.v2.setters.ts +521 -0
- package/src/integrations/lagoonV2/lagoon.v2.ts +345 -0
- package/src/integrations/lagoonV2/vault.abi.ts +479 -0
- package/src/integrations/morphoVault/morpho.vault.ts +45 -0
- package/src/integrations/morphoVault/morpho.vault.v2.abi.ts +23 -0
- package/src/lib/contractsRegistry.json +4 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/integrations/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AACzB,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,OAAO,CAAC;AACtB,cAAc,UAAU,CAAC;AACzB,cAAc,WAAW,CAAC;AAC1B,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC;AAC3B,cAAc,cAAc,CAAC;AAC7B,cAAc,SAAS,CAAC;AACxB,cAAc,cAAc,CAAC;AAC7B,cAAc,eAAe,CAAC;AAC9B,cAAc,yBAAyB,CAAC;AACxC,cAAc,SAAS,CAAC;AACxB,cAAc,OAAO,CAAC;AACtB,cAAc,QAAQ,CAAC;AACvB,cAAc,QAAQ,CAAC;AACvB,cAAc,UAAU,CAAC;AACzB,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC;AAC5B,cAAc,WAAW,CAAC;AAC1B,cAAc,QAAQ,CAAC;AACvB,cAAc,SAAS,CAAC;AACxB,cAAc,WAAW,CAAC;AAC1B,cAAc,aAAa,CAAC;AAC5B,cAAc,QAAQ,CAAC;AACvB,cAAc,UAAU,CAAC;AACzB,cAAc,YAAY,CAAC;AAC3B,cAAc,QAAQ,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/integrations/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AACzB,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,OAAO,CAAC;AACtB,cAAc,UAAU,CAAC;AACzB,cAAc,WAAW,CAAC;AAC1B,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC;AAC3B,cAAc,cAAc,CAAC;AAC7B,cAAc,SAAS,CAAC;AACxB,cAAc,cAAc,CAAC;AAC7B,cAAc,eAAe,CAAC;AAC9B,cAAc,yBAAyB,CAAC;AACxC,cAAc,SAAS,CAAC;AACxB,cAAc,OAAO,CAAC;AACtB,cAAc,QAAQ,CAAC;AACvB,cAAc,QAAQ,CAAC;AACvB,cAAc,UAAU,CAAC;AACzB,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC;AAC5B,cAAc,WAAW,CAAC;AAC1B,cAAc,QAAQ,CAAC;AACvB,cAAc,SAAS,CAAC;AACxB,cAAc,WAAW,CAAC;AAC1B,cAAc,aAAa,CAAC;AAC5B,cAAc,QAAQ,CAAC;AACvB,cAAc,UAAU,CAAC;AACzB,cAAc,YAAY,CAAC;AAC3B,cAAc,QAAQ,CAAC"}
|
|
@@ -0,0 +1,208 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* DelayProxyAdmin upgrade encoders (M2 — slice 3 of the v0.5-on-OptinProxy continuity epic).
|
|
3
|
+
*
|
|
4
|
+
* The DelayProxyAdmin is deployed automatically by the LagoonVaultProxy constructor
|
|
5
|
+
* for every v0.5 vault. It is stored in the ERC-1967 admin slot of the proxy and
|
|
6
|
+
* implements a two-phase timelocked upgrade:
|
|
7
|
+
*
|
|
8
|
+
* Phase 1 — submitImplementation(address _implementation)
|
|
9
|
+
* Records `newImplementation` in storage and sets `implementationUpdateTime =
|
|
10
|
+
* block.timestamp + delay`. Owner-only.
|
|
11
|
+
* Selector: 0x657081b3 (submitImplementation(address))
|
|
12
|
+
*
|
|
13
|
+
* Phase 2 — upgradeAndCall(proxy, impl, data)
|
|
14
|
+
* After the timelock elapses, calls `proxy.upgradeToAndCall(newImplementation, data)`.
|
|
15
|
+
* The `impl` argument MUST equal the address that was passed to `submitImplementation`.
|
|
16
|
+
* The deployed contract reverts `ImplementationInconsistent(address expected)` if they
|
|
17
|
+
* differ. The encoder therefore passes the same v0.6 impl that was submitted in phase 1.
|
|
18
|
+
* For a storage-compatible v0.5→v0.6 swap pass empty calldata ("0x") — no
|
|
19
|
+
* reinitializer is needed (Lagoon guarantees storage layout compatibility).
|
|
20
|
+
* Selector: 0x9623609d (upgradeAndCall(address,address,bytes))
|
|
21
|
+
*
|
|
22
|
+
* Additional helpers:
|
|
23
|
+
* submitDelay(uint256 _delay) — schedule a delay change (timelocked by current delay)
|
|
24
|
+
* Selector: 0x432efade (submitDelay(uint256))
|
|
25
|
+
*
|
|
26
|
+
* Getter read helpers:
|
|
27
|
+
* newImplementation() — returns the pending impl submitted in phase 1
|
|
28
|
+
* Selector: 0x8b677b03 (newImplementation())
|
|
29
|
+
*
|
|
30
|
+
* delay() — returns the configured timelock in seconds
|
|
31
|
+
* Selector: 0x6a42b8f8
|
|
32
|
+
*
|
|
33
|
+
* v0.6 MaxCap unlock:
|
|
34
|
+
* After the upgrade, v0.6 storage slot for maxCap is zero (it was unused in v0.5).
|
|
35
|
+
* Every deposit therefore reverts MaxCapReached until the Safe owner calls
|
|
36
|
+
* updateMaxCap(<nominalCap>) on the vault. This is NOT a DelayProxyAdmin call —
|
|
37
|
+
* it's a v0.6 vault call. Use `lagoonV2UpdateMaxCapTrx` from lagoon.v2.setters for that.
|
|
38
|
+
*
|
|
39
|
+
* ── ABI verification ──────────────────────────────────────────────────────────
|
|
40
|
+
* Verified against DelayProxyAdmin.sol source (lagoon-v0/src/proxy/DelayProxyAdmin.sol)
|
|
41
|
+
* and confirmed via `cast sig` 2026-06-12:
|
|
42
|
+
* submitImplementation(address) = 0x657081b3
|
|
43
|
+
* newImplementation() = 0x8b677b03
|
|
44
|
+
* upgradeAndCall(address,address,bytes)= 0x9623609d
|
|
45
|
+
* delay() = 0x6a42b8f8
|
|
46
|
+
* implementationUpdateTime() = 0xf6b12cf9
|
|
47
|
+
* submitDelay(uint256) = 0x432efade
|
|
48
|
+
* owner() = 0x8da5cb5b
|
|
49
|
+
* ──────────────────────────────────────────────────────────────────────────────
|
|
50
|
+
*/
|
|
51
|
+
import type { Address, Hex } from "viem";
|
|
52
|
+
import { type Call, type HexString, type Unwrapable } from "../..";
|
|
53
|
+
/**
|
|
54
|
+
* Arguments for the two-phase timelocked upgrade of a v0.5→v0.6 vault.
|
|
55
|
+
*/
|
|
56
|
+
export type DelayProxyAdminUpgradeArgs = Readonly<{
|
|
57
|
+
/** Address of the DelayProxyAdmin contract (stored in ERC-1967 admin slot). */
|
|
58
|
+
proxyAdmin: Address;
|
|
59
|
+
/** Address of the vault proxy being upgraded. */
|
|
60
|
+
proxy: Address;
|
|
61
|
+
/** New vault implementation address (e.g. Arb v0.6 impl). */
|
|
62
|
+
newImpl: Address;
|
|
63
|
+
}>;
|
|
64
|
+
/**
|
|
65
|
+
* Encodes `submitImplementation(address _implementation)` calldata.
|
|
66
|
+
* Selector: 0x657081b3
|
|
67
|
+
*
|
|
68
|
+
* Phase 1 of the timelocked upgrade. Records `newImpl` as `newImplementation`
|
|
69
|
+
* in storage and sets `implementationUpdateTime = block.timestamp + delay`.
|
|
70
|
+
* Owner-only. Emits `ImplementationUpdateSubmited`.
|
|
71
|
+
*
|
|
72
|
+
* After calling this, phase 2 (`upgradeAndCall`) can only execute after
|
|
73
|
+
* `block.timestamp >= implementationUpdateTime`.
|
|
74
|
+
*
|
|
75
|
+
* @param newImpl - The new implementation address to submit (e.g. v0.6 vault impl).
|
|
76
|
+
*/
|
|
77
|
+
export declare const SubmitImplementationCalldata: ({ newImpl }: {
|
|
78
|
+
readonly newImpl: Address;
|
|
79
|
+
}) => HexString;
|
|
80
|
+
/**
|
|
81
|
+
* Wraps SubmitImplementationCalldata in a Call for Safe execution.
|
|
82
|
+
*/
|
|
83
|
+
export declare const submitImplementationTrx: ({ proxyAdmin, newImpl, }: {
|
|
84
|
+
readonly proxyAdmin: Address;
|
|
85
|
+
readonly newImpl: Address;
|
|
86
|
+
}) => Unwrapable<Call>;
|
|
87
|
+
/**
|
|
88
|
+
* Encodes `upgradeAndCall(address proxy, address impl, bytes data)` calldata.
|
|
89
|
+
* Selector: 0x9623609d
|
|
90
|
+
*
|
|
91
|
+
* Phase 2 of the timelocked upgrade. Executes the implementation swap.
|
|
92
|
+
*
|
|
93
|
+
* CONSTRAINT (enforced on-chain): `impl` MUST equal the address that was
|
|
94
|
+
* passed to `submitImplementation`. The DelayProxyAdmin reverts with
|
|
95
|
+
* `ImplementationMismatch` if they differ.
|
|
96
|
+
*
|
|
97
|
+
* Pass empty `data` ("0x") for a v0.5→v0.6 storage-compatible upgrade —
|
|
98
|
+
* no reinitializer is needed. Lagoon guarantees slot layout compatibility
|
|
99
|
+
* via `StorageCollision.t.sol`. The v0.6 storage field `maxCap` is simply
|
|
100
|
+
* zero after a clean upgrade; the vault owner must call `updateMaxCap`
|
|
101
|
+
* before the first deposit can succeed.
|
|
102
|
+
*
|
|
103
|
+
* This is a PAYABLE function — value is forwarded to the proxy's fallback
|
|
104
|
+
* if data is non-empty. For the empty-data case, value MUST be 0.
|
|
105
|
+
*
|
|
106
|
+
* @param args.proxy - The vault proxy address to upgrade.
|
|
107
|
+
* @param args.newImpl - The new implementation (must match phase-1 submission).
|
|
108
|
+
* @param args.data - Calldata forwarded to the new impl; use "0x" for v0.5→v0.6.
|
|
109
|
+
*/
|
|
110
|
+
export declare const UpgradeAndCallCalldata: ({ proxy, newImpl, data, }: {
|
|
111
|
+
readonly proxy: Address;
|
|
112
|
+
readonly newImpl: Address;
|
|
113
|
+
readonly data?: `0x${string}` | undefined;
|
|
114
|
+
}) => HexString;
|
|
115
|
+
/**
|
|
116
|
+
* Wraps UpgradeAndCallCalldata in a Call for Safe execution.
|
|
117
|
+
* Value defaults to 0n (required for empty-data upgrades).
|
|
118
|
+
*/
|
|
119
|
+
export declare const upgradeAndCallTrx: ({ proxyAdmin, proxy, newImpl, data, }: {
|
|
120
|
+
readonly proxyAdmin: Address;
|
|
121
|
+
readonly proxy: Address;
|
|
122
|
+
readonly newImpl: Address;
|
|
123
|
+
readonly data?: `0x${string}` | undefined;
|
|
124
|
+
}) => Unwrapable<Call>;
|
|
125
|
+
/**
|
|
126
|
+
* Encodes `submitDelay(uint256 newDelay)` calldata.
|
|
127
|
+
* Selector: 0x432efade
|
|
128
|
+
*
|
|
129
|
+
* Schedules a change to the DelayProxyAdmin's timelock duration.
|
|
130
|
+
* The new delay is NOT applied immediately — it must be committed via
|
|
131
|
+
* `updateDelay()` (selector 0x0185921e) after the current delay elapses.
|
|
132
|
+
*
|
|
133
|
+
* On-chain bounds (verified from DelayProxyAdmin.sol source):
|
|
134
|
+
* MIN_DELAY = 86400s (1 day) — reverts DelayTooLow(86400) below this
|
|
135
|
+
* MAX_DELAY = 2592000s (30 days) — reverts DelayTooHigh(2592000) above this
|
|
136
|
+
*
|
|
137
|
+
* @param newDelay - New timelock duration in seconds. Must satisfy 86400 ≤ newDelay ≤ 2592000.
|
|
138
|
+
*/
|
|
139
|
+
export declare const SubmitDelayCalldata: ({ newDelay }: {
|
|
140
|
+
readonly newDelay: bigint;
|
|
141
|
+
}) => HexString;
|
|
142
|
+
export declare const submitDelayTrx: ({ proxyAdmin, newDelay, }: {
|
|
143
|
+
readonly proxyAdmin: Address;
|
|
144
|
+
readonly newDelay: bigint;
|
|
145
|
+
}) => Unwrapable<Call>;
|
|
146
|
+
/**
|
|
147
|
+
* ABI item for `newImplementation()` — the pending implementation submitted
|
|
148
|
+
* in phase 1. Returns `address(0)` if no upgrade is queued (after phase 2
|
|
149
|
+
* completes the field is reset to zero).
|
|
150
|
+
*
|
|
151
|
+
* Selector: 0x8b677b03
|
|
152
|
+
*
|
|
153
|
+
* @example
|
|
154
|
+
* const pending = await publicClient.readContract({
|
|
155
|
+
* address: proxyAdminAddress,
|
|
156
|
+
* abi: DELAY_PROXY_ADMIN_PENDING_IMPL_ABI,
|
|
157
|
+
* functionName: 'newImplementation',
|
|
158
|
+
* })
|
|
159
|
+
*/
|
|
160
|
+
export declare const DELAY_PROXY_ADMIN_PENDING_IMPL_ABI: readonly [{
|
|
161
|
+
readonly name: "newImplementation";
|
|
162
|
+
readonly type: "function";
|
|
163
|
+
readonly inputs: readonly [];
|
|
164
|
+
readonly outputs: readonly [{
|
|
165
|
+
readonly name: "";
|
|
166
|
+
readonly type: "address";
|
|
167
|
+
}];
|
|
168
|
+
readonly stateMutability: "view";
|
|
169
|
+
}];
|
|
170
|
+
/**
|
|
171
|
+
* ABI item for `delay()` — returns the enforced timelock in seconds.
|
|
172
|
+
* This is the `delay` storage variable (public) that gates phase-2 execution.
|
|
173
|
+
*
|
|
174
|
+
* Selector: 0x6a42b8f8
|
|
175
|
+
*
|
|
176
|
+
* @example
|
|
177
|
+
* const timelockSeconds = await publicClient.readContract({
|
|
178
|
+
* address: proxyAdminAddress,
|
|
179
|
+
* abi: DELAY_PROXY_ADMIN_GET_MIN_DELAY_ABI,
|
|
180
|
+
* functionName: 'delay',
|
|
181
|
+
* })
|
|
182
|
+
*/
|
|
183
|
+
export declare const DELAY_PROXY_ADMIN_GET_MIN_DELAY_ABI: readonly [{
|
|
184
|
+
readonly name: "delay";
|
|
185
|
+
readonly type: "function";
|
|
186
|
+
readonly inputs: readonly [];
|
|
187
|
+
readonly outputs: readonly [{
|
|
188
|
+
readonly name: "";
|
|
189
|
+
readonly type: "uint256";
|
|
190
|
+
}];
|
|
191
|
+
readonly stateMutability: "view";
|
|
192
|
+
}];
|
|
193
|
+
/**
|
|
194
|
+
* Returns the ABI item for `owner()` for use in viem readContract calls.
|
|
195
|
+
*
|
|
196
|
+
* Selector: 0x8da5cb5b
|
|
197
|
+
*/
|
|
198
|
+
export declare const DELAY_PROXY_ADMIN_OWNER_ABI: readonly [{
|
|
199
|
+
readonly name: "owner";
|
|
200
|
+
readonly type: "function";
|
|
201
|
+
readonly inputs: readonly [];
|
|
202
|
+
readonly outputs: readonly [{
|
|
203
|
+
readonly name: "";
|
|
204
|
+
readonly type: "address";
|
|
205
|
+
}];
|
|
206
|
+
readonly stateMutability: "view";
|
|
207
|
+
}];
|
|
208
|
+
//# sourceMappingURL=delay.proxy.admin.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"delay.proxy.admin.d.ts","sourceRoot":"","sources":["../../../src/integrations/lagoonV1/delay.proxy.admin.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiDG;AAGH,OAAO,KAAK,EAAE,OAAO,EAAE,GAAG,EAAE,MAAM,MAAM,CAAC;AACzC,OAAO,EAAc,KAAK,IAAI,EAAE,KAAK,SAAS,EAAE,KAAK,UAAU,EAAE,MAAM,OAAO,CAAC;AAgE/E;;GAEG;AACH,MAAM,MAAM,0BAA0B,GAAG,QAAQ,CAAC;IAC9C,+EAA+E;IAC/E,UAAU,EAAE,OAAO,CAAC;IACpB,iDAAiD;IACjD,KAAK,EAAE,OAAO,CAAC;IACf,6DAA6D;IAC7D,OAAO,EAAE,OAAO,CAAC;CACpB,CAAC,CAAC;AAMH;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,4BAA4B;sBAAqC,OAAO;MAAK,SAMzF,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,uBAAuB;yBAIX,OAAO;sBACV,OAAO;MACzB,WAAW,IAAI,CAOlB,CAAC;AAMF;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,eAAO,MAAM,sBAAsB;oBAKf,OAAO;sBACL,OAAO;;MAEzB,SAMH,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,iBAAiB;yBAML,OAAO;oBACZ,OAAO;sBACL,OAAO;;MAEzB,WAAW,IAAI,CAOlB,CAAC;AAMF;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,mBAAmB;uBAAuC,MAAM;MAAK,SAoBjF,CAAC;AAEF,eAAO,MAAM,cAAc;yBAIF,OAAO;uBACT,MAAM;MACzB,WAAW,IAAI,CAOlB,CAAC;AAMF;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,kCAAkC;;;;;;;;;EAQrC,CAAC;AAEX;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,mCAAmC;;;;;;;;;EAQtC,CAAC;AAEX;;;;GAIG;AACH,eAAO,MAAM,2BAA2B;;;;;;;;;EAQ9B,CAAC"}
|
|
@@ -2,4 +2,5 @@ export { default as lagoonV1FactoryAbi } from "./factory.abi";
|
|
|
2
2
|
export { default as lagoonV1VaultAbi } from "./vault.abi";
|
|
3
3
|
export { default as lagoonV1SiloAbi } from "./silo.abi";
|
|
4
4
|
export * from "./lagoon.v1";
|
|
5
|
+
export * from "./delay.proxy.admin";
|
|
5
6
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/integrations/lagoonV1/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,kBAAkB,EAAE,MAAM,eAAe,CAAC;AAC9D,OAAO,EAAE,OAAO,IAAI,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAC1D,OAAO,EAAE,OAAO,IAAI,eAAe,EAAE,MAAM,YAAY,CAAC;AACxD,cAAc,aAAa,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/integrations/lagoonV1/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,kBAAkB,EAAE,MAAM,eAAe,CAAC;AAC9D,OAAO,EAAE,OAAO,IAAI,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAC1D,OAAO,EAAE,OAAO,IAAI,eAAe,EAAE,MAAM,YAAY,CAAC;AACxD,cAAc,aAAa,CAAC;AAC5B,cAAc,qBAAqB,CAAC"}
|
|
@@ -63,6 +63,23 @@ export declare const closeVaultTrx: ({ vault, newTotalAssets, }: {
|
|
|
63
63
|
vault: Address;
|
|
64
64
|
newTotalAssets: bigint;
|
|
65
65
|
}) => Unwrapable<Call>;
|
|
66
|
+
/**
|
|
67
|
+
* Computes the deterministic CREATE2 vault address for a v0.5 Lagoon vault
|
|
68
|
+
* deployed via the protocol-v3 OptinProxyFactory.
|
|
69
|
+
*
|
|
70
|
+
* The v3 factory deploys `new LagoonVaultProxy{salt: salt}(logic, registry, initialOwner, initialDelay, call_data)`.
|
|
71
|
+
* The CREATE2 address is: keccak256(0xff ++ factory ++ salt ++ keccak256(initCode))[-20:]
|
|
72
|
+
* where initCode = LAGOON_VAULT_PROXY_CREATION_BYTECODE + abi.encode(logic, registry, initialOwner, initialDelay, call_data)
|
|
73
|
+
*
|
|
74
|
+
* The proxy is logic-agnostic: the same LagoonVaultProxy bytecode is used for v0.5 and v0.6.
|
|
75
|
+
* Only the inner `call_data` (initialize calldata) differs between versions.
|
|
76
|
+
*
|
|
77
|
+
* @param factoryAddress - The v3 OptinProxyFactory address (per-chain)
|
|
78
|
+
* @param registry - The shared fee registry address
|
|
79
|
+
* @param wrappedNativeToken - The wrapped native token address (per-chain)
|
|
80
|
+
* @param initStruct - The 12-field v0.5 InitStruct (logic, salt, and all vault params)
|
|
81
|
+
* @returns EIP-55 checksummed address of the vault that would be deployed
|
|
82
|
+
*/
|
|
66
83
|
export declare const calculateDeterministicVaultAddress: ({ factoryAddress, registry, wrappedNativeToken, initStruct, }: {
|
|
67
84
|
factoryAddress: Address;
|
|
68
85
|
registry: Address;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lagoon.v1.d.ts","sourceRoot":"","sources":["../../../src/integrations/lagoonV1/lagoon.v1.ts"],"names":[],"mappings":"AACA,OAAO,EAA4B,KAAK,IAAI,EAAE,KAAK,SAAS,EAAE,KAAK,UAAU,EAAE,MAAM,OAAO,CAAC;AAE7F,OAAO,KAAK,EAAE,OAAO,
|
|
1
|
+
{"version":3,"file":"lagoon.v1.d.ts","sourceRoot":"","sources":["../../../src/integrations/lagoonV1/lagoon.v1.ts"],"names":[],"mappings":"AACA,OAAO,EAA4B,KAAK,IAAI,EAAE,KAAK,SAAS,EAAE,KAAK,UAAU,EAAE,MAAM,OAAO,CAAC;AAE7F,OAAO,KAAK,EAAE,OAAO,EAAO,MAAM,MAAM,CAAC;AAazC,MAAM,MAAM,iCAAiC,GAAG,QAAQ,CAAC;IACrD,KAAK,EAAE,OAAO,CAAC;IACf,YAAY,EAAE,OAAO,CAAC;IACtB,YAAY,EAAE,MAAM,CAAC;IACrB,UAAU,EAAE,OAAO,CAAC;IACpB,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,OAAO,CAAC;IACd,gBAAgB,EAAE,OAAO,CAAC;IAC1B,gBAAgB,EAAE,OAAO,CAAC;IAC1B,KAAK,EAAE,OAAO,CAAC;IACf,WAAW,EAAE,OAAO,CAAC;IACrB,cAAc,EAAE,MAAM,CAAC;IACvB,eAAe,EAAE,MAAM,CAAC;IACxB,eAAe,EAAE,OAAO,CAAC;IACzB,kBAAkB,EAAE,MAAM,CAAC;IAC3B,IAAI,EAAE,SAAS,CAAC;CACnB,CAAC,CAAC;AAEH,eAAO,MAAM,wBAAwB,+MAiBlC,iCAAiC,KAAG,SA6BtC,CAAC;AAEF,eAAO,MAAM,mBAAmB;4BAIJ,iCAAiC;aAChD,OAAO;MAChB,WAAW,IAAI,CAOlB,CAAC;AAEF,eAAO,MAAM,iCAAiC;SAAoB,MAAM;MAAK,SAE5E,CAAC;AAEF,eAAO,MAAM,4BAA4B;WAA6B,OAAO;SAAO,MAAM;MAAK,WAAW,IAAI,CAO7G,CAAC;AAEF,eAAO,MAAM,2BAA2B;cAA8B,OAAO,EAAE;MAAK,SAEnF,CAAC;AAEF,eAAO,MAAM,sBAAsB;WAIxB,OAAO;cACJ,OAAO,EAAE;MACnB,WAAW,IAAI,CAOlB,CAAC;AAEF,eAAO,MAAM,gCAAgC;cAA8B,OAAO,EAAE;MAAK,SAExF,CAAC;AAEF,eAAO,MAAM,2BAA2B;WAI7B,OAAO;cACJ,OAAO,EAAE;MACnB,WAAW,IAAI,CAOlB,CAAC;AAaF,eAAO,MAAM,kBAAkB,QAAO,SAErC,CAAC;AAEF,eAAO,MAAM,aAAa;WAAwB,OAAO;MAAK,WAAW,IAAI,CAO5E,CAAC;AAIF,eAAO,MAAM,oBAAoB,QAAO,SAEvC,CAAC;AAEF,eAAO,MAAM,eAAe;WAAwB,OAAO;MAAK,WAAW,IAAI,CAO9E,CAAC;AAIF,eAAO,MAAM,uBAAuB,QAAO,SAE1C,CAAC;AAEF,eAAO,MAAM,uBAAuB;WAAwB,OAAO;MAAK,WAAW,IAAI,CAOtF,CAAC;AAIF,eAAO,MAAM,kBAAkB;oBAA0C,MAAM;MAAK,SAEnF,CAAC;AAEF,eAAO,MAAM,aAAa;WAIf,OAAO;oBACE,MAAM;MACtB,WAAW,IAAI,CAOlB,CAAC;AAoCF;;;;;;;;;;;;;;;;GAgBG;AACH,eAAO,MAAM,kCAAkC;oBAM3B,OAAO;cACb,OAAO;wBACG,OAAO;gBACf,iCAAiC;MAC7C,OAsDH,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { Address } from "viem";
|
|
2
|
+
/**
|
|
3
|
+
* Per-chain addresses for the Lagoon v0.6 stack.
|
|
4
|
+
* Verified on-chain 2026-06-08.
|
|
5
|
+
*
|
|
6
|
+
* factory: The v3 Lagoon factory proxy (deploys via CREATE2, hosts registry() + wrappedNativeToken() views).
|
|
7
|
+
* vaultImpl: The v0.6 vault implementation logic address. MUST be passed explicitly as `logic` in
|
|
8
|
+
* createVaultProxy — never address(0), which silently falls back to v0.5.0.
|
|
9
|
+
* registry: Shared fee registry (same address on all chains).
|
|
10
|
+
* wrappedNative: Wrapped native token (WETH on ETH/Arb).
|
|
11
|
+
*/
|
|
12
|
+
export type LagoonV2ChainAddresses = Readonly<{
|
|
13
|
+
factory: Address;
|
|
14
|
+
vaultImpl: Address;
|
|
15
|
+
registry: Address;
|
|
16
|
+
wrappedNative: Address;
|
|
17
|
+
}>;
|
|
18
|
+
export declare const LAGOON_V2_ADDRESSES: Readonly<Record<number, LagoonV2ChainAddresses>>;
|
|
19
|
+
//# sourceMappingURL=addresses.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"addresses.d.ts","sourceRoot":"","sources":["../../../src/integrations/lagoonV2/addresses.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AAEpC;;;;;;;;;GASG;AACH,MAAM,MAAM,sBAAsB,GAAG,QAAQ,CAAC;IAC1C,OAAO,EAAE,OAAO,CAAC;IACjB,SAAS,EAAE,OAAO,CAAC;IACnB,QAAQ,EAAE,OAAO,CAAC;IAClB,aAAa,EAAE,OAAO,CAAC;CAC1B,CAAC,CAAC;AAEH,eAAO,MAAM,mBAAmB,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,sBAAsB,CAAC,CAevE,CAAC"}
|
|
@@ -0,0 +1,183 @@
|
|
|
1
|
+
declare const _default: readonly [{
|
|
2
|
+
readonly inputs: readonly [{
|
|
3
|
+
readonly internalType: "bool";
|
|
4
|
+
readonly name: "disable";
|
|
5
|
+
readonly type: "bool";
|
|
6
|
+
}];
|
|
7
|
+
readonly stateMutability: "nonpayable";
|
|
8
|
+
readonly type: "constructor";
|
|
9
|
+
}, {
|
|
10
|
+
readonly inputs: readonly [];
|
|
11
|
+
readonly name: "InvalidInitialization";
|
|
12
|
+
readonly type: "error";
|
|
13
|
+
}, {
|
|
14
|
+
readonly inputs: readonly [];
|
|
15
|
+
readonly name: "NotInitializing";
|
|
16
|
+
readonly type: "error";
|
|
17
|
+
}, {
|
|
18
|
+
readonly inputs: readonly [{
|
|
19
|
+
readonly internalType: "address";
|
|
20
|
+
readonly name: "owner";
|
|
21
|
+
readonly type: "address";
|
|
22
|
+
}];
|
|
23
|
+
readonly name: "OwnableInvalidOwner";
|
|
24
|
+
readonly type: "error";
|
|
25
|
+
}, {
|
|
26
|
+
readonly inputs: readonly [{
|
|
27
|
+
readonly internalType: "address";
|
|
28
|
+
readonly name: "account";
|
|
29
|
+
readonly type: "address";
|
|
30
|
+
}];
|
|
31
|
+
readonly name: "OwnableUnauthorizedAccount";
|
|
32
|
+
readonly type: "error";
|
|
33
|
+
}, {
|
|
34
|
+
readonly anonymous: false;
|
|
35
|
+
readonly inputs: readonly [{
|
|
36
|
+
readonly indexed: false;
|
|
37
|
+
readonly internalType: "uint64";
|
|
38
|
+
readonly name: "version";
|
|
39
|
+
readonly type: "uint64";
|
|
40
|
+
}];
|
|
41
|
+
readonly name: "Initialized";
|
|
42
|
+
readonly type: "event";
|
|
43
|
+
}, {
|
|
44
|
+
readonly anonymous: false;
|
|
45
|
+
readonly inputs: readonly [{
|
|
46
|
+
readonly indexed: true;
|
|
47
|
+
readonly internalType: "address";
|
|
48
|
+
readonly name: "previousOwner";
|
|
49
|
+
readonly type: "address";
|
|
50
|
+
}, {
|
|
51
|
+
readonly indexed: true;
|
|
52
|
+
readonly internalType: "address";
|
|
53
|
+
readonly name: "newOwner";
|
|
54
|
+
readonly type: "address";
|
|
55
|
+
}];
|
|
56
|
+
readonly name: "OwnershipTransferred";
|
|
57
|
+
readonly type: "event";
|
|
58
|
+
}, {
|
|
59
|
+
readonly anonymous: false;
|
|
60
|
+
readonly inputs: readonly [{
|
|
61
|
+
readonly indexed: false;
|
|
62
|
+
readonly internalType: "address";
|
|
63
|
+
readonly name: "proxy";
|
|
64
|
+
readonly type: "address";
|
|
65
|
+
}, {
|
|
66
|
+
readonly indexed: false;
|
|
67
|
+
readonly internalType: "address";
|
|
68
|
+
readonly name: "deployer";
|
|
69
|
+
readonly type: "address";
|
|
70
|
+
}];
|
|
71
|
+
readonly name: "ProxyDeployed";
|
|
72
|
+
readonly type: "event";
|
|
73
|
+
}, {
|
|
74
|
+
readonly inputs: readonly [{
|
|
75
|
+
readonly internalType: "address";
|
|
76
|
+
readonly name: "_logic";
|
|
77
|
+
readonly type: "address";
|
|
78
|
+
}, {
|
|
79
|
+
readonly internalType: "address";
|
|
80
|
+
readonly name: "_initialOwner";
|
|
81
|
+
readonly type: "address";
|
|
82
|
+
}, {
|
|
83
|
+
readonly internalType: "uint256";
|
|
84
|
+
readonly name: "_initialDelay";
|
|
85
|
+
readonly type: "uint256";
|
|
86
|
+
}, {
|
|
87
|
+
readonly internalType: "bytes";
|
|
88
|
+
readonly name: "call_data";
|
|
89
|
+
readonly type: "bytes";
|
|
90
|
+
}, {
|
|
91
|
+
readonly internalType: "bytes32";
|
|
92
|
+
readonly name: "salt";
|
|
93
|
+
readonly type: "bytes32";
|
|
94
|
+
}];
|
|
95
|
+
readonly name: "createVaultProxy";
|
|
96
|
+
readonly outputs: readonly [{
|
|
97
|
+
readonly internalType: "address";
|
|
98
|
+
readonly name: "";
|
|
99
|
+
readonly type: "address";
|
|
100
|
+
}];
|
|
101
|
+
readonly stateMutability: "nonpayable";
|
|
102
|
+
readonly type: "function";
|
|
103
|
+
}, {
|
|
104
|
+
readonly inputs: readonly [{
|
|
105
|
+
readonly internalType: "address";
|
|
106
|
+
readonly name: "_registry";
|
|
107
|
+
readonly type: "address";
|
|
108
|
+
}, {
|
|
109
|
+
readonly internalType: "address";
|
|
110
|
+
readonly name: "_wrappedNativeToken";
|
|
111
|
+
readonly type: "address";
|
|
112
|
+
}, {
|
|
113
|
+
readonly internalType: "address";
|
|
114
|
+
readonly name: "owner";
|
|
115
|
+
readonly type: "address";
|
|
116
|
+
}];
|
|
117
|
+
readonly name: "initialize";
|
|
118
|
+
readonly outputs: readonly [];
|
|
119
|
+
readonly stateMutability: "nonpayable";
|
|
120
|
+
readonly type: "function";
|
|
121
|
+
}, {
|
|
122
|
+
readonly inputs: readonly [{
|
|
123
|
+
readonly internalType: "address";
|
|
124
|
+
readonly name: "vault";
|
|
125
|
+
readonly type: "address";
|
|
126
|
+
}];
|
|
127
|
+
readonly name: "isInstance";
|
|
128
|
+
readonly outputs: readonly [{
|
|
129
|
+
readonly internalType: "bool";
|
|
130
|
+
readonly name: "";
|
|
131
|
+
readonly type: "bool";
|
|
132
|
+
}];
|
|
133
|
+
readonly stateMutability: "view";
|
|
134
|
+
readonly type: "function";
|
|
135
|
+
}, {
|
|
136
|
+
readonly inputs: readonly [];
|
|
137
|
+
readonly name: "owner";
|
|
138
|
+
readonly outputs: readonly [{
|
|
139
|
+
readonly internalType: "address";
|
|
140
|
+
readonly name: "";
|
|
141
|
+
readonly type: "address";
|
|
142
|
+
}];
|
|
143
|
+
readonly stateMutability: "view";
|
|
144
|
+
readonly type: "function";
|
|
145
|
+
}, {
|
|
146
|
+
readonly inputs: readonly [];
|
|
147
|
+
readonly name: "registry";
|
|
148
|
+
readonly outputs: readonly [{
|
|
149
|
+
readonly internalType: "address";
|
|
150
|
+
readonly name: "";
|
|
151
|
+
readonly type: "address";
|
|
152
|
+
}];
|
|
153
|
+
readonly stateMutability: "view";
|
|
154
|
+
readonly type: "function";
|
|
155
|
+
}, {
|
|
156
|
+
readonly inputs: readonly [];
|
|
157
|
+
readonly name: "renounceOwnership";
|
|
158
|
+
readonly outputs: readonly [];
|
|
159
|
+
readonly stateMutability: "nonpayable";
|
|
160
|
+
readonly type: "function";
|
|
161
|
+
}, {
|
|
162
|
+
readonly inputs: readonly [{
|
|
163
|
+
readonly internalType: "address";
|
|
164
|
+
readonly name: "newOwner";
|
|
165
|
+
readonly type: "address";
|
|
166
|
+
}];
|
|
167
|
+
readonly name: "transferOwnership";
|
|
168
|
+
readonly outputs: readonly [];
|
|
169
|
+
readonly stateMutability: "nonpayable";
|
|
170
|
+
readonly type: "function";
|
|
171
|
+
}, {
|
|
172
|
+
readonly inputs: readonly [];
|
|
173
|
+
readonly name: "wrappedNativeToken";
|
|
174
|
+
readonly outputs: readonly [{
|
|
175
|
+
readonly internalType: "address";
|
|
176
|
+
readonly name: "";
|
|
177
|
+
readonly type: "address";
|
|
178
|
+
}];
|
|
179
|
+
readonly stateMutability: "view";
|
|
180
|
+
readonly type: "function";
|
|
181
|
+
}];
|
|
182
|
+
export default _default;
|
|
183
|
+
//# sourceMappingURL=factory.abi.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"factory.abi.d.ts","sourceRoot":"","sources":["../../../src/integrations/lagoonV2/factory.abi.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAGA,wBA0GW"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export { default as lagoonV2FactoryAbi } from "./factory.abi";
|
|
2
|
+
export { default as lagoonV2VaultAbi } from "./vault.abi";
|
|
3
|
+
export * from "./addresses";
|
|
4
|
+
export * from "./lagoon.v2";
|
|
5
|
+
export * from "./lagoon.v2.permissions";
|
|
6
|
+
export * from "./lagoon.v2.setters";
|
|
7
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/integrations/lagoonV2/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,kBAAkB,EAAE,MAAM,eAAe,CAAC;AAC9D,OAAO,EAAE,OAAO,IAAI,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAC1D,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,yBAAyB,CAAC;AACxC,cAAc,qBAAqB,CAAC"}
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
import type { Address, Hex } from "viem";
|
|
2
|
+
import { type Call, type HexString, type Unwrapable } from "../..";
|
|
3
|
+
/**
|
|
4
|
+
* AccessMode enum for Lagoon v0.6 vault.
|
|
5
|
+
* Blacklist = 0 (default): all addresses permitted unless explicitly blocked.
|
|
6
|
+
* Whitelist = 1: only explicitly whitelisted addresses permitted.
|
|
7
|
+
*/
|
|
8
|
+
export declare const LagoonV2AccessMode: {
|
|
9
|
+
readonly Blacklist: 0;
|
|
10
|
+
readonly Whitelist: 1;
|
|
11
|
+
};
|
|
12
|
+
export type LagoonV2AccessModeValue = (typeof LagoonV2AccessMode)[keyof typeof LagoonV2AccessMode];
|
|
13
|
+
/**
|
|
14
|
+
* 19-field InitStruct for Lagoon v0.6.
|
|
15
|
+
*
|
|
16
|
+
* Field order matches the Solidity ABI encoding order exactly (required for abi.encode):
|
|
17
|
+
* underlying, name, symbol, safe, whitelistManager, valuationManager, admin,
|
|
18
|
+
* feeReceiver, managementRate, performanceRate, accessMode, entryRate, exitRate,
|
|
19
|
+
* haircutRate, securityCouncil, externalSanctionsList, initialTotalAssets,
|
|
20
|
+
* superOperator, allowHighWaterMarkReset
|
|
21
|
+
*
|
|
22
|
+
* Key differences from v0.5:
|
|
23
|
+
* - `accessMode` (uint8 enum) replaces `enableWhitelist` (bool)
|
|
24
|
+
* - `entryRate`, `exitRate`, `haircutRate` are new fee rate fields (uint16)
|
|
25
|
+
* - `securityCouncil`, `externalSanctionsList`, `superOperator` are new roles (address)
|
|
26
|
+
* - `initialTotalAssets` (uint256) is new
|
|
27
|
+
* - `allowHighWaterMarkReset` (bool) is new
|
|
28
|
+
* - `rateUpdateCooldown` is REMOVED
|
|
29
|
+
* All fields are required — no defaults are applied.
|
|
30
|
+
*/
|
|
31
|
+
export type LagoonV2InitStruct = Readonly<{
|
|
32
|
+
underlying: Address;
|
|
33
|
+
name: string;
|
|
34
|
+
symbol: string;
|
|
35
|
+
safe: Address;
|
|
36
|
+
whitelistManager: Address;
|
|
37
|
+
valuationManager: Address;
|
|
38
|
+
admin: Address;
|
|
39
|
+
feeReceiver: Address;
|
|
40
|
+
managementRate: number;
|
|
41
|
+
performanceRate: number;
|
|
42
|
+
accessMode: LagoonV2AccessModeValue;
|
|
43
|
+
entryRate: number;
|
|
44
|
+
exitRate: number;
|
|
45
|
+
haircutRate: number;
|
|
46
|
+
securityCouncil: Address;
|
|
47
|
+
externalSanctionsList: Address;
|
|
48
|
+
initialTotalAssets: bigint;
|
|
49
|
+
superOperator: Address;
|
|
50
|
+
allowHighWaterMarkReset: boolean;
|
|
51
|
+
}>;
|
|
52
|
+
/**
|
|
53
|
+
* Full args for the v0.6 bytes-overload createVaultProxy call.
|
|
54
|
+
* `logic` MUST be the explicit v0.6 vault implementation address — never address(0).
|
|
55
|
+
* Passing address(0) resolves to the registry's v0.5.0 default logic and silently deploys v0.5.
|
|
56
|
+
*/
|
|
57
|
+
export type LagoonV2CreateVaultProxyArgs = Readonly<{
|
|
58
|
+
logic: Address;
|
|
59
|
+
initialOwner: Address;
|
|
60
|
+
initialDelay: bigint;
|
|
61
|
+
initStruct: LagoonV2InitStruct;
|
|
62
|
+
/** Registry address (per-chain constant; obtained from factory.registry()). */
|
|
63
|
+
registry: Address;
|
|
64
|
+
/** Wrapped native token address (per-chain constant; obtained from factory.wrappedNativeToken()). */
|
|
65
|
+
wrappedNative: Address;
|
|
66
|
+
salt: HexString;
|
|
67
|
+
}>;
|
|
68
|
+
/**
|
|
69
|
+
* Builds the `call_data` bytes that the LagoonVaultProxy's initialize function expects.
|
|
70
|
+
*
|
|
71
|
+
* call_data = initialize(abi.encode(<19-field InitStruct tuple>), registry, wrappedNative)
|
|
72
|
+
*
|
|
73
|
+
* This is passed to the bytes-overload createVaultProxy as the `call_data` argument.
|
|
74
|
+
* The factory forwards it verbatim to the proxy's constructor, which delegatecalls it
|
|
75
|
+
* into the vault implementation during initialization.
|
|
76
|
+
*/
|
|
77
|
+
export declare const buildLagoonV2InitCalldata: ({ initStruct, registry, wrappedNative, }: {
|
|
78
|
+
initStruct: LagoonV2InitStruct;
|
|
79
|
+
registry: Address;
|
|
80
|
+
wrappedNative: Address;
|
|
81
|
+
}) => Hex;
|
|
82
|
+
/**
|
|
83
|
+
* Encodes the bytes-overload `createVaultProxy` calldata for the v3 Lagoon factory.
|
|
84
|
+
*
|
|
85
|
+
* Uses selector 0x9dfe49f2 = keccak4("createVaultProxy(address,address,uint256,bytes,bytes32)").
|
|
86
|
+
* The `logic` argument MUST be the explicit v0.6 vault implementation — never address(0).
|
|
87
|
+
*
|
|
88
|
+
* @returns ABI-encoded transaction calldata (including 4-byte selector).
|
|
89
|
+
*/
|
|
90
|
+
export declare const CreateLagoonV2VaultProxyCalldata: ({ logic, initialOwner, initialDelay, initStruct, registry, wrappedNative, salt, }: LagoonV2CreateVaultProxyArgs) => HexString;
|
|
91
|
+
/**
|
|
92
|
+
* Wraps CreateLagoonV2VaultProxyCalldata in a Call object suitable for Safe execution.
|
|
93
|
+
*/
|
|
94
|
+
export declare const createLagoonV2VaultProxyTrx: ({ createVaultProxyParams, factory, }: {
|
|
95
|
+
createVaultProxyParams: LagoonV2CreateVaultProxyArgs;
|
|
96
|
+
factory: Address;
|
|
97
|
+
}) => Unwrapable<Call>;
|
|
98
|
+
/**
|
|
99
|
+
* LagoonVaultProxy creation bytecode (v0.6).
|
|
100
|
+
*
|
|
101
|
+
* Extracted from the v3 factory implementation at 0xd8c3dfb8e47b153913fe217d6ff4c9ecc4bb5544
|
|
102
|
+
* (Arbitrum mainnet) via CODECOPY analysis: 5580 bytes at factory bytecode offset 0x0aa1.
|
|
103
|
+
* The same factory implementation is deployed on Ethereum mainnet at the same address.
|
|
104
|
+
*
|
|
105
|
+
* Constructor signature: (address logic, address registry, address initialOwner, uint256 initialDelay, bytes call_data)
|
|
106
|
+
* The factory passes: (logic, registry, initialOwner, initialDelay, call_data) where
|
|
107
|
+
* registry is read from factory storage, and call_data is the bytes arg from the factory call.
|
|
108
|
+
*
|
|
109
|
+
* This bytecode is different from v0.5's OptinProxy creation bytecode.
|
|
110
|
+
* Using the wrong creation bytecode produces a mismatched CREATE2 address.
|
|
111
|
+
*/
|
|
112
|
+
export declare const LAGOON_VAULT_PROXY_CREATION_BYTECODE = "0x60c06040526040516115cc3803806115cc833981016040819052610022916104b2565b61002c85856100a8565b8161003782826101b8565b5050828260405161004790610454565b6001600160a01b0390921682526020820152604001604051809103905ff080158015610075573d5f803e3d5ffd5b506001600160a01b031660805261009361008e60805190565b610216565b5050506001600160a01b031660a0525061061d565b5f6001600160a01b03831661011e57816001600160a01b03166345f55b3c6040518163ffffffff1660e01b8152600401602060405180830381865afa1580156100f3573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610117919061059c565b90506101b2565b6001600160a01b03821663f3c665f7610135610262565b856040518363ffffffff1660e01b81526004016101539291906105b5565b602060405180830381865afa15801561016e573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061019291906105cf565b6101af5760405163474245d760e11b815260040160405180910390fd5b50815b92915050565b6101c18261027f565b6040516001600160a01b038316907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b905f90a280511561020a5761020582826102e5565b505050565b610212610358565b5050565b7f7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f61023f610379565b8260405161024e9291906105b5565b60405180910390a161025f81610398565b50565b5f61027a5f5f805160206115ac833981519152610389565b905090565b806001600160a01b03163b5f036102b45780604051634c9c8ce360e01b81526004016102ab91906105ee565b60405180910390fd5b805f805160206115ac8339815191525b80546001600160a01b0319166001600160a01b039290921691909117905550565b60605f80846001600160a01b0316846040516103019190610602565b5f60405180830381855af49150503d805f8114610339576040519150601f19603f3d011682016040523d82523d5f602084013e61033e565b606091505b50909250905061034f8583836103d5565b95945050505050565b34156103775760405163b398979f60e01b815260040160405180910390fd5b565b5f5f8051602061158c8339815191525b546001600160a01b0316919050565b6001600160a01b0381166103c1575f604051633173bdd160e11b81526004016102ab91906105ee565b805f8051602061158c8339815191526102c4565b6060826103ea576103e58261042b565b610424565b815115801561040157506001600160a01b0384163b155b156104215783604051639996b31560e01b81526004016102ab91906105ee565b50805b9392505050565b80511561043b5780518082602001fd5b604051630a12f52160e11b815260040160405180910390fd5b6109a180610beb83390190565b80516001600160a01b0381168114610477575f80fd5b919050565b634e487b7160e01b5f52604160045260245ffd5b5f5b838110156104aa578181015183820152602001610492565b50505f910152565b5f805f805f60a086880312156104c6575f80fd5b6104cf86610461565b94506104dd60208701610461565b93506104eb60408701610461565b6060870151608088015191945092506001600160401b0381111561050d575f80fd5b8601601f8101881361051d575f80fd5b80516001600160401b038111156105365761053661047c565b604051601f8201601f19908116603f011681016001600160401b03811182821017156105645761056461047c565b6040528181528282016020018a101561057b575f80fd5b61058c826020830160208601610490565b8093505050509295509295909350565b5f602082840312156105ac575f80fd5b61042482610461565b6001600160a01b0392831681529116602082015260400190565b5f602082840312156105df575f80fd5b81518015158114610424575f80fd5b6001600160a01b0391909116815260200190565b5f8251610613818460208701610490565b9190910192915050565b60805160a0516105a96106425f395f81816038015260f401525f607201526105a95ff3fe60806040526004361061001d575f3560e01c806306433b1b14610027575b610025610070565b005b348015610032575f80fd5b5061005a7f000000000000000000000000000000000000000000000000000000000000000081565b60405161006791906103eb565b60405180910390f35b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031633036101c2575f356001600160e01b03191663278f794360e11b146100d2576040516334ad5dbb60e21b815260040160405180910390fd5b5f806100e136600481846103ff565b8101906100ee919061043a565b915091507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663f3c665f76101296101cc565b6040516001600160e01b031960e084901b1681526001600160a01b0391821660048201529085166024820152604401602060405180830381865afa158015610173573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906101979190610508565b6101b45760405163474245d760e11b815260040160405180910390fd5b6101be82826101f0565b5050565b6101ca61024a565b565b5f6101eb5f80516020610554833981519152546001600160a01b031690565b905090565b6101f98261025a565b6040516001600160a01b038316907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b905f90a28051156102425761023d82826102bd565b505050565b6101be61032f565b6101ca6102556101cc565b61034e565b806001600160a01b03163b5f0361028f5780604051634c9c8ce360e01b815260040161028691906103eb565b60405180910390fd5b5f8051602061055483398151915280546001600160a01b0319166001600160a01b0392909216919091179055565b60605f80846001600160a01b0316846040516102d99190610527565b5f60405180830381855af49150503d805f8114610311576040519150601f19603f3d011682016040523d82523d5f602084013e610316565b606091505b509150915061032685838361036c565b95945050505050565b34156101ca5760405163b398979f60e01b815260040160405180910390fd5b365f80375f80365f845af43d5f803e808015610368573d5ff35b3d5ffd5b6060826103815761037c826103c2565b6103bb565b815115801561039857506001600160a01b0384163b155b156103b85783604051639996b31560e01b815260040161028691906103eb565b50805b9392505050565b8051156103d25780518082602001fd5b604051630a12f52160e11b815260040160405180910390fd5b6001600160a01b0391909116815260200190565b5f808585111561040d575f80fd5b83861115610419575f80fd5b5050820193919092039150565b634e487b7160e01b5f52604160045260245ffd5b5f806040838503121561044b575f80fd5b82356001600160a01b0381168114610461575f80fd5b915060208301356001600160401b0381111561047b575f80fd5b8301601f8101851361048b575f80fd5b80356001600160401b038111156104a4576104a4610426565b604051601f8201601f19908116603f011681016001600160401b03811182821017156104d2576104d2610426565b6040528181528282016020018710156104e9575f80fd5b816020840160208301375f602083830101528093505050509250929050565b5f60208284031215610518575f80fd5b815180151581146103bb575f80fd5b5f82515f5b81811015610546576020818601810151858301520161052c565b505f92019182525091905056fe360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbca26469706673582212201310de98019309a7eb9fb8d90a862cfb1e8bb0576f4d1ffc2eaf580c61d7e42864736f6c634300081a0033608060405234801561000f575f80fd5b506040516109a13803806109a183398101604081905261002e91610158565b81806001600160a01b03811661005e57604051631e4fbdf760e01b81525f60048201526024015b60405180910390fd5b61006781610109565b5050620151808110156100925760405163013ccc8d60e01b8152620151806004820152602401610055565b62278d008111156100bb57604051630b94129b60e31b815262278d006004820152602401610055565b5f1960018190556003556005819055604080518281525f60208201527fa580b4a9812995ffed1b336481c3f3bfeb3414df9f587a9d73856bab25aa4eee910160405180910390a1505061018f565b5f80546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b5f8060408385031215610169575f80fd5b82516001600160a01b038116811461017f575f80fd5b6020939093015192949293505050565b6108058061019c5f395ff3fe6080604052600436106100b7575f3560e01c8063033f8dbc146100bb5780634125ff90146100e3578063432efade146100f9578063554f94db1461011a578063657081b31461012e5780636a42b8f81461014d578063715018a6146101625780638b677b03146101765780638da5cb5b146101a25780639623609d146101b65780639f81aed7146101c9578063a36f141c146101df578063ad3cb1cc146101f4578063f2fde38b14610231578063f6b12cf914610250575b5f80fd5b3480156100c6575f80fd5b506100d060045481565b6040519081526020015b60405180910390f35b3480156100ee575f80fd5b506100d062278d0081565b348015610104575f80fd5b506101186101133660046105e1565b610265565b005b348015610125575f80fd5b50610118610326565b348015610139575f80fd5b5061011861014836600461060c565b6103a8565b348015610158575f80fd5b506100d060055481565b34801561016d575f80fd5b50610118610420565b348015610181575f80fd5b50600254610195906001600160a01b031681565b6040516100da919061062e565b3480156101ad575f80fd5b50610195610433565b6101186101c4366004610656565b610441565b3480156101d4575f80fd5b506100d06201518081565b3480156101ea575f80fd5b506100d060035481565b3480156101ff575f80fd5b50610224604051806040016040528060058152602001640352e302e360dc1b81525081565b6040516100da919061076d565b34801561023c575f80fd5b5061011861024b36600461060c565b610523565b34801561025b575f80fd5b506100d060015481565b61026d610560565b6201518081101561029b5760405163013ccc8d60e01b81526201518060048201526024015b60405180910390fd5b62278d008111156102c457604051630b94129b60e31b815262278d006004820152602401610292565b60048190556005546102d6904261077f565b60038190556005546004546040805192835260208301919091528101919091527fab7d3921ca5710b1f874b995128f2d434b8b28080cc90e5b7ae542d01a41dd6e9060600160405180910390a150565b61032e610560565b60035442101561035157604051634040f3a760e01b815260040160405180910390fd5b7fa580b4a9812995ffed1b336481c3f3bfeb3414df9f587a9d73856bab25aa4eee60045460055460405161038f929190918252602082015260400190565b60405180910390a1600480546005555f90555f19600355565b6103b0610560565b600280546001600160a01b0319166001600160a01b0383161790556005546103d8904261077f565b60018190556002546040519182526001600160a01b0316907fb995d606597d17deae0e0b28f4668c00c67c22d7bed7b95db2a5ac7f1b96aa2b9060200160405180910390a250565b610428610560565b6104315f610592565b565b5f546001600160a01b031690565b610449610560565b60015442101561046c57604051634040f3a760e01b815260040160405180910390fd5b6002546001600160a01b038381169116146104a757600254604051631a160ecd60e11b8152610292916001600160a01b03169060040161062e565b60025460405163278f794360e11b81526001600160a01b0380861692634f1ef2869234926104db92169086906004016107a4565b5f604051808303818588803b1580156104f2575f80fd5b505af1158015610504573d5f803e3d5ffd5b5050600280546001600160a01b031916905550505f1960015550505050565b61052b610560565b6001600160a01b038116610554575f604051631e4fbdf760e01b8152600401610292919061062e565b61055d81610592565b50565b33610569610433565b6001600160a01b031614610431573360405163118cdaa760e01b8152600401610292919061062e565b5f80546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b5f602082840312156105f1575f80fd5b5035919050565b6001600160a01b038116811461055d575f80fd5b5f6020828403121561061c575f80fd5b8135610627816105f8565b9392505050565b6001600160a01b0391909116815260200190565b634e487b7160e01b5f52604160045260245ffd5b5f805f60608486031215610668575f80fd5b8335610673816105f8565b92506020840135610683816105f8565b915060408401356001600160401b0381111561069d575f80fd5b8401601f810186136106ad575f80fd5b80356001600160401b038111156106c6576106c6610642565b604051601f8201601f19908116603f011681016001600160401b03811182821017156106f4576106f4610642565b60405281815282820160200188101561070b575f80fd5b816020840160208301375f602083830101528093505050509250925092565b5f81518084525f5b8181101561074e57602081850181015186830182015201610732565b505f602082860101526020601f19601f83011685010191505092915050565b602081525f610627602083018461072a565b8082018082111561079e57634e487b7160e01b5f52601160045260245ffd5b92915050565b6001600160a01b03831681526040602082018190525f906107c79083018461072a565b94935050505056fea264697066735822122036804f99dd8956664ddace0c969782ec219cf2ab51ffe4b46a5fa0641d88cc0c64736f6c634300081a0033b53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc";
|
|
113
|
+
/**
|
|
114
|
+
* Computes the deterministic CREATE2 vault address for a v0.6 Lagoon vault.
|
|
115
|
+
*
|
|
116
|
+
* The factory deploys `new LagoonVaultProxy{salt: salt}(logic, registry, initialOwner, initialDelay, call_data)`.
|
|
117
|
+
* The CREATE2 address is: keccak256(0xff ++ factory ++ salt ++ keccak256(initCode))[-20:]
|
|
118
|
+
* where initCode = LAGOON_VAULT_PROXY_CREATION_BYTECODE + abi.encode(logic, registry, initialOwner, initialDelay, call_data)
|
|
119
|
+
*
|
|
120
|
+
* @returns EIP-55 checksummed address of the vault that would be deployed.
|
|
121
|
+
*/
|
|
122
|
+
export declare const calculateLagoonV2DeterministicVaultAddress: ({ factoryAddress, logic, initialOwner, initialDelay, initStruct, registry, wrappedNative, salt, }: {
|
|
123
|
+
factoryAddress: Address;
|
|
124
|
+
logic: Address;
|
|
125
|
+
initialOwner: Address;
|
|
126
|
+
initialDelay: bigint;
|
|
127
|
+
initStruct: LagoonV2InitStruct;
|
|
128
|
+
registry: Address;
|
|
129
|
+
wrappedNative: Address;
|
|
130
|
+
salt: HexString;
|
|
131
|
+
}) => Address;
|
|
132
|
+
//# sourceMappingURL=lagoon.v2.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lagoon.v2.d.ts","sourceRoot":"","sources":["../../../src/integrations/lagoonV2/lagoon.v2.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,OAAO,EAAE,GAAG,EAAE,MAAM,MAAM,CAAC;AACzC,OAAO,EAA4B,KAAK,IAAI,EAAE,KAAK,SAAS,EAAE,KAAK,UAAU,EAAE,MAAM,OAAO,CAAC;AAO7F;;;;GAIG;AACH,eAAO,MAAM,kBAAkB;;;CAGrB,CAAC;AACX,MAAM,MAAM,uBAAuB,GAAG,CAAC,OAAO,kBAAkB,CAAC,CAAC,MAAM,OAAO,kBAAkB,CAAC,CAAC;AAEnG;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,MAAM,kBAAkB,GAAG,QAAQ,CAAC;IACtC,UAAU,EAAE,OAAO,CAAC;IACpB,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,OAAO,CAAC;IACd,gBAAgB,EAAE,OAAO,CAAC;IAC1B,gBAAgB,EAAE,OAAO,CAAC;IAC1B,KAAK,EAAE,OAAO,CAAC;IACf,WAAW,EAAE,OAAO,CAAC;IACrB,cAAc,EAAE,MAAM,CAAC;IACvB,eAAe,EAAE,MAAM,CAAC;IACxB,UAAU,EAAE,uBAAuB,CAAC;IACpC,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,EAAE,MAAM,CAAC;IACpB,eAAe,EAAE,OAAO,CAAC;IACzB,qBAAqB,EAAE,OAAO,CAAC;IAC/B,kBAAkB,EAAE,MAAM,CAAC;IAC3B,aAAa,EAAE,OAAO,CAAC;IACvB,uBAAuB,EAAE,OAAO,CAAC;CACpC,CAAC,CAAC;AAEH;;;;GAIG;AACH,MAAM,MAAM,4BAA4B,GAAG,QAAQ,CAAC;IAChD,KAAK,EAAE,OAAO,CAAC;IACf,YAAY,EAAE,OAAO,CAAC;IACtB,YAAY,EAAE,MAAM,CAAC;IACrB,UAAU,EAAE,kBAAkB,CAAC;IAC/B,+EAA+E;IAC/E,QAAQ,EAAE,OAAO,CAAC;IAClB,qGAAqG;IACrG,aAAa,EAAE,OAAO,CAAC;IACvB,IAAI,EAAE,SAAS,CAAC;CACnB,CAAC,CAAC;AAqEH;;;;;;;;GAQG;AACH,eAAO,MAAM,yBAAyB;gBAKtB,kBAAkB;cACpB,OAAO;mBACF,OAAO;MACtB,GAwCH,CAAC;AAMF;;;;;;;GAOG;AACH,eAAO,MAAM,gCAAgC,sFAQ1C,4BAA4B,KAAG,SAejC,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,2BAA2B;4BAIZ,4BAA4B;aAC3C,OAAO;MAChB,WAAW,IAAI,CAOlB,CAAC;AAMF;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,oCAAoC,+5VAC+2V,CAAC;AAEj6V;;;;;;;;GAQG;AACH,eAAO,MAAM,0CAA0C;oBAUnC,OAAO;WAChB,OAAO;kBACA,OAAO;kBACP,MAAM;gBACR,kBAAkB;cACpB,OAAO;mBACF,OAAO;UAChB,SAAS;MACf,OAsCH,CAAC"}
|