@panoptic-eng/sdk 1.0.49 → 1.0.50

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (39) hide show
  1. package/dist/cow/index.js.map +1 -1
  2. package/dist/{cow-DMX9ebPk.js → cow-CSSKPknb.js} +1 -1
  3. package/dist/deployments.d.ts +12 -4
  4. package/dist/deployments.d.ts.map +1 -1
  5. package/dist/deployments.js +78 -10
  6. package/dist/deployments.js.map +1 -1
  7. package/dist/{greeks-9aTE-DwO.js → greeks-CNi1-cnp.js} +39 -16
  8. package/dist/index.d.ts +518 -76
  9. package/dist/index.d.ts.map +1 -1
  10. package/dist/index.js +701 -84
  11. package/dist/index.js.map +1 -1
  12. package/dist/{irm-mySi_YMF.js → irm-BJaJSUjF.js} +80 -12
  13. package/dist/panoptic/v2/greeks/index.d.ts +12 -1
  14. package/dist/panoptic/v2/greeks/index.d.ts.map +1 -1
  15. package/dist/panoptic/v2/greeks/index.js +39 -16
  16. package/dist/panoptic/v2/greeks/index.js.map +1 -1
  17. package/dist/panoptic/v2/index.d.ts +1336 -74
  18. package/dist/panoptic/v2/index.d.ts.map +1 -1
  19. package/dist/panoptic/v2/index.js +20322 -18660
  20. package/dist/panoptic/v2/index.js.map +1 -1
  21. package/dist/panoptic/v2/react-public.d.ts +1518 -240
  22. package/dist/panoptic/v2/react-public.d.ts.map +1 -1
  23. package/dist/panoptic/v2/react-public.js +11518 -9319
  24. package/dist/panoptic/v2/react-public.js.map +1 -1
  25. package/dist/{rates-CDLIUGDz.js → rates-COAJpKRd.js} +612 -73
  26. package/dist/{router-45ulPnWe.js → router-B-I1eACz.js} +5 -43
  27. package/dist/router-BSS7HKd2.js +837 -0
  28. package/dist/uniswap/index.d.ts +465 -215
  29. package/dist/uniswap/index.d.ts.map +1 -1
  30. package/dist/uniswap/index.js +1799 -1076
  31. package/dist/uniswap/index.js.map +1 -1
  32. package/dist/{v2-DshssxX4.js → v2-zF6b01PI.js} +2488 -1596
  33. package/dist/{writes-2reV_omF.js → writes-D1zN0v9x.js} +4 -3
  34. package/dist/zodiac/index.d.ts +51 -7
  35. package/dist/zodiac/index.d.ts.map +1 -1
  36. package/dist/zodiac/index.js +154 -2
  37. package/dist/zodiac/index.js.map +1 -1
  38. package/package.json +2 -1
  39. package/dist/router-B2jY9Nyb.js +0 -312
@@ -1,5 +1,5 @@
1
- import { BatchValidationError, DEFAULT_VEGOID, InputListFailError, InvalidTickLimitsError, InvalidTokenIdParameterError, LEG_BITS, LEG_LIMITS, LEG_MASKS, LoanSlotExhaustedError, MaxRetriesExceededError, MissingPositionIdsError, NoLoanPositionsError, OracleRateLimitedError, PanopticError, PanopticValidationError, PositionSnapshotNotFoundError, ProviderLagError, STANDARD_TICK_WIDTHS, STRIKE_CONVERSION_FACTOR, SwapTokenMismatchError, SyncTimeoutError, TOKEN_ID_BITS, UnsafePremiumSettlementError, collateralTrackerV2Abi, createTxResult, decodeLeftRightUnsigned, decodeOracleTiming, decodePosition, decodeTickSpacing, formatTokenAmount, getBlockMeta, getOpenPositionIds, getPool, getPoolMetaKey, getPoolMetadata, getPositionMetaKey, getPositions, getPositionsKey, getSyncCheckpointKey, getTrackedPositionIds, jsonSerializer, oracleEpochAt, panopticErrorsAbi, panopticFactoryV3Abi, panopticFactoryV4Abi, panopticPoolV2Abi, parsePanopticError, parseTokenAmount, submitWrite } from "./rates-CDLIUGDz.js";
2
- import { MAX_TICK, MIN_TICK, REORG_DEPTH, calculatePositionGreeks, priceToTick, roundToTickSpacing, sqrtPriceX96ToTick, tickLimits, tickToPrice, tickToPriceDecimalScaled, tickToSqrtPriceX96 } from "./greeks-9aTE-DwO.js";
1
+ import { BatchValidationError, DEFAULT_VEGOID, InputListFailError, InvalidTickLimitsError, InvalidTokenIdParameterError, LEG_BITS, LEG_LIMITS, LEG_MASKS, LoanSlotExhaustedError, MaxRetriesExceededError, MissingPositionIdsError, NoLoanPositionsError, OracleRateLimitedError, PanopticError, PanopticValidationError, PositionSnapshotNotFoundError, ProviderLagError, STANDARD_TICK_WIDTHS, STRIKE_CONVERSION_FACTOR, SwapTokenMismatchError, SyncTimeoutError, TOKEN_ID_BITS, UnsafePremiumSettlementError, collateralTrackerV2Abi, createTxResult, decodeLeftRightUnsigned, decodeOracleTiming, decodePosition, decodeTickSpacing, formatTokenAmount, getBlockMeta, getOpenPositionIds, getPool, getPoolMetaKey, getPoolMetadata, getPositionMetaKey, getPositions, getPositionsKey, getSyncCheckpointKey, getTrackedPositionIds, jsonSerializer, oracleEpochAt, panopticErrorsAbi, panopticFactoryV3Abi, panopticFactoryV4Abi, panopticPoolV2Abi, parsePanopticError, parseTokenAmount, submitWrite } from "./rates-COAJpKRd.js";
2
+ import { MAX_TICK, MIN_TICK, REORG_DEPTH, calculatePositionGreeks, priceToTick, roundToTickSpacing, sqrtPriceX96ToTick, tickLimits, tickToPrice, tickToPriceDecimalScaled, tickToSqrtPriceX96 } from "./greeks-CNi1-cnp.js";
3
3
  import { decodeFunctionResult, encodeFunctionData, erc20Abi, getAbiItem } from "viem";
4
4
 
5
5
  //#region src/panoptic/v2/writes/broadcaster.ts
@@ -3595,7 +3595,7 @@ async function simulateWithTokenFlow(params) {
3595
3595
  const delta1 = assetsAfter.assets1 - assetsBefore.assets1;
3596
3596
  let gasEstimate = 0n;
3597
3597
  try {
3598
- gasEstimate = await client.estimateGas({
3598
+ if (params.estimateGas !== false) gasEstimate = await client.estimateGas({
3599
3599
  account: user,
3600
3600
  to: poolAddress,
3601
3601
  data: callData,
@@ -5122,6 +5122,7 @@ async function simulateOpenPosition(params) {
5122
5122
  ]
5123
5123
  });
5124
5124
  const flowResult = await simulateWithTokenFlow({
5125
+ estimateGas: params.estimateGas,
5125
5126
  client,
5126
5127
  poolAddress,
5127
5128
  user: account,
@@ -1,4 +1,4 @@
1
- import { Hex } from "viem";
1
+ import { Address, ContractFunctionArgs, ContractFunctionName, Hex } from "viem";
2
2
 
3
3
  //#region src/zodiac/rolesAbi.d.ts
4
4
  /** Minimal Zodiac Roles v2 modifier ABI used by the scoping/apply flows. */
@@ -99,12 +99,13 @@ declare const rolesV2Abi: readonly [{
99
99
  readonly outputs: readonly [];
100
100
  }]; //#endregion
101
101
  //#region src/zodiac/applySteps.d.ts
102
- /** One idempotent Roles-modifier configuration call. */
103
- interface ScopeStep {
102
+ type ScopeFunctionName = ContractFunctionName<typeof rolesV2Abi, 'nonpayable'>;
103
+ /** One idempotent Roles-modifier configuration call, paired with its ABI arguments. */
104
+ type ScopeStep = { [Name in ScopeFunctionName]: {
104
105
  name: string;
105
- functionName: 'assignRoles' | 'scopeTarget' | 'scopeFunction' | 'allowFunction' | 'setTransactionUnwrapper';
106
- args: unknown[];
107
- }
106
+ functionName: Name;
107
+ args: ContractFunctionArgs<typeof rolesV2Abi, 'nonpayable', Name>;
108
+ } }[ScopeFunctionName];
108
109
  /**
109
110
  * Minimal structural client shapes (instead of viem's `PublicClient` /
110
111
  * `WalletClient`) so any viem 2.x instance is accepted — pnpm peer-keying can
@@ -285,6 +286,49 @@ declare function buildDispatchCustomRoleSteps(params: {
285
286
  extra?: Hex;
286
287
  }): ScopeStep[];
287
288
 
289
+ //#endregion
290
+ //#region src/zodiac/roles/liquidator.d.ts
291
+ /**
292
+ * Liquidator role: scopes ONLY `PanopticLiquidator.liquidate(LiquidateParams)`
293
+ * on the helper. `initializePool`, `execute`, `multicall`, `sweep`, and
294
+ * `quoteLiquidation` are never scoped.
295
+ *
296
+ * Split of enforcement (must match the LiquidatorCondition contract and the
297
+ * hand-encoded tree in zodiac-modules/test/LiquidatorRolesFork.t.sol, which is
298
+ * the golden spec for this builder):
299
+ * - THIS TREE pins the static fields: pool ∈ allowlist, account ∉ {safe,
300
+ * helper}, swap targets ∈ {router, 0}, premia flags = 0, and — via
301
+ * ExecutionOptions.None — zero outer msg.value (attached value is excluded
302
+ * from the helper's minDelta floors, so it must never flow through the
303
+ * role; native shortfalls are funded via nativeFundingAmount instead).
304
+ * - THE ADAPTER (Custom node on positionIdListTo; Roles hands it full
305
+ * calldata) enforces the cross-field invariants: flash/swap tokens ∈ pool
306
+ * underlyings, swap groups zeroed together or exact nonzero amounts,
307
+ * nativeFundingAmount only on native pools, floors ≥ 0 with one positive.
308
+ */
309
+ declare const LIQUIDATE_SELECTOR: `0x${string}`;
310
+ interface LiquidatorConditionsParams {
311
+ /** Deployed LiquidatorCondition adapter. */
312
+ adapter: Address;
313
+ /** The Safe (avatar) — excluded as a liquidation target. */
314
+ safe: Address;
315
+ /** The PanopticLiquidator helper — also excluded as a target. */
316
+ helper: Address;
317
+ /** Pinned swap router (Uniswap Universal Router). */
318
+ router: Address;
319
+ /** PanopticPool allowlist (at least one). */
320
+ pools: readonly Address[];
321
+ /** Trailing 12 bytes of the Custom compValue (unused by the adapter). */
322
+ extra?: Hex;
323
+ }
324
+ /** BFS ConditionFlat tree over liquidate's single LiquidateParams tuple. */
325
+ declare function buildLiquidatorConditions(params: LiquidatorConditionsParams): ConditionFlat[];
326
+ /** assignRoles → scopeTarget → scopeFunction for the liquidator role. */
327
+ declare function buildLiquidatorRoleSteps(params: LiquidatorConditionsParams & {
328
+ roleKey: Hex;
329
+ member: Address;
330
+ }): ScopeStep[];
331
+
288
332
  //#endregion
289
333
  //#region src/zodiac/roles/loanHedger.d.ts
290
334
  /**
@@ -508,5 +552,5 @@ declare function loanBitmaskCondition(): {
508
552
  };
509
553
 
510
554
  //#endregion
511
- export { CANONICAL_ADAPTERS, ConditionFlat, DELEVERAGER_ROLE_KEY, DEPOSIT_SELECTOR, DISPATCH_FROM_SELECTOR, DISPATCH_SELECTOR, EXECUTE_SELECTOR, ExecutionOptions, LOAN_BITMASK_WINDOW_SHIFTS, MAINTENANCE_ROLE_KEY, MULTICALL_SELECTOR, MULTISEND_SELECTOR, Operator, ParameterType, ROLLER_ROLE_KEY, SIZE_ADJUSTER_ROLE_KEY, ScopeStep, WETH_DEPOSIT_SELECTOR, WETH_WITHDRAW_SELECTOR, WITHDRAW_SELECTOR, WITHDRAW_WITH_POSITIONS_SELECTOR, addressEqualCompValue, applyScopeSteps, buildDeleveragerDispatchConditions, buildDeleveragerRoleSteps, buildDepositConditions, buildDispatchCustomConditions, buildDispatchCustomRoleSteps, buildDispatchFromConditions, buildLoanOnlyDispatchConditions, buildMaintenanceRoleSteps, buildRollerRoleSteps, buildSfpmSwapConditions, buildSfpmSwapVenueSteps, buildSizeAdjusterRoleSteps, buildWithdrawConditions, buildWithdrawWithPositionsConditions, customCompValue, isPureLoanTokenId, legFieldMask, loanBitmaskCompValueAt, loanBitmaskCondition, loanWidthFieldsMask, optionRatioFieldsMask, roleKey, rolesV2Abi, sfpmPoolIdPinExtra, sizeCapExtra, strikeFieldsMask };
555
+ export { CANONICAL_ADAPTERS, ConditionFlat, DELEVERAGER_ROLE_KEY, DEPOSIT_SELECTOR, DISPATCH_FROM_SELECTOR, DISPATCH_SELECTOR, EXECUTE_SELECTOR, ExecutionOptions, LIQUIDATE_SELECTOR, LOAN_BITMASK_WINDOW_SHIFTS, LiquidatorConditionsParams, MAINTENANCE_ROLE_KEY, MULTICALL_SELECTOR, MULTISEND_SELECTOR, Operator, ParameterType, ROLLER_ROLE_KEY, SIZE_ADJUSTER_ROLE_KEY, ScopeStep, WETH_DEPOSIT_SELECTOR, WETH_WITHDRAW_SELECTOR, WITHDRAW_SELECTOR, WITHDRAW_WITH_POSITIONS_SELECTOR, addressEqualCompValue, applyScopeSteps, buildDeleveragerDispatchConditions, buildDeleveragerRoleSteps, buildDepositConditions, buildDispatchCustomConditions, buildDispatchCustomRoleSteps, buildDispatchFromConditions, buildLiquidatorConditions, buildLiquidatorRoleSteps, buildLoanOnlyDispatchConditions, buildMaintenanceRoleSteps, buildRollerRoleSteps, buildSfpmSwapConditions, buildSfpmSwapVenueSteps, buildSizeAdjusterRoleSteps, buildWithdrawConditions, buildWithdrawWithPositionsConditions, customCompValue, isPureLoanTokenId, legFieldMask, loanBitmaskCompValueAt, loanBitmaskCondition, loanWidthFieldsMask, optionRatioFieldsMask, roleKey, rolesV2Abi, sfpmPoolIdPinExtra, sizeCapExtra, strikeFieldsMask };
512
556
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","names":["rolesV2Abi","rolesV2Abi","ScopeStep","ScopeStepsPublicClient","Promise","ScopeStepsWalletClient","applyScopeSteps","Hex","ConditionFlat","addressEqualCompValue","customCompValue","sizeCapExtra","ParameterType","Operator","CANONICAL_ADAPTERS","ExecutionOptions","Hex","ScopeStep","ConditionFlat","DELEVERAGER_ROLE_KEY","buildDeleveragerDispatchConditions","buildDeleveragerRoleSteps","Hex","ScopeStep","ConditionFlat","DISPATCH_SELECTOR","roleKey","buildDispatchCustomConditions","buildDispatchCustomRoleSteps","Hex","ConditionFlat","LOAN_BITMASK_WINDOW_SHIFTS","loanBitmaskCompValueAt","buildLoanOnlyDispatchConditions","WITHDRAW_SELECTOR","DEPOSIT_SELECTOR","EXECUTE_SELECTOR","buildWithdrawConditions","buildDepositConditions","Hex","ScopeStep","ConditionFlat","MAINTENANCE_ROLE_KEY","DISPATCH_FROM_SELECTOR","buildDispatchFromConditions","buildMaintenanceRoleSteps","Hex","ScopeStep","ROLLER_ROLE_KEY","buildRollerRoleSteps","Hex","ScopeStep","ConditionFlat","MULTICALL_SELECTOR","MULTISEND_SELECTOR","WETH_DEPOSIT_SELECTOR","WETH_WITHDRAW_SELECTOR","WITHDRAW_WITH_POSITIONS_SELECTOR","buildWithdrawWithPositionsConditions","sfpmPoolIdPinExtra","buildSfpmSwapConditions","buildSfpmSwapVenueSteps","Hex","ScopeStep","SIZE_ADJUSTER_ROLE_KEY","buildSizeAdjusterRoleSteps","legFieldMask","loanWidthFieldsMask","strikeFieldsMask","optionRatioFieldsMask","isPureLoanTokenId","loanBitmaskCondition"],"sources":["../../src/zodiac/rolesAbi.d.ts","../../src/zodiac/applySteps.d.ts","../../src/zodiac/conditions.d.ts","../../src/zodiac/constants.d.ts","../../src/zodiac/roles/deleverager.d.ts","../../src/zodiac/roles/dispatchCustomRole.d.ts","../../src/zodiac/roles/loanHedger.d.ts","../../src/zodiac/roles/maintenance.d.ts","../../src/zodiac/roles/roller.d.ts","../../src/zodiac/roles/sfpmSwap.d.ts","../../src/zodiac/roles/sizeAdjuster.d.ts","../../src/zodiac/tokenIdMask.d.ts"],"sourcesContent":null,"mappings":";;;;;cACqBC;;;EAAAA,SAAAA,eA8FnB,EAAA,YAAA;;;;;IC7Fe8D,SAAS,IAAA,EAAA,UAAA;;;;;;;AAW1B,CAAA,EAAA;EAQiB1D,SAAAA,IAAAA,EAAAA,UAAsB;EAAA,SAAA,IAAA,EAAA,aAAA;EAAA,SAGnBJ,eAAAA,EAAAA,YAAAA;EAAU,SACR8D,MAAAA,EAAAA,SAAAA,CAAAA;IAId3D,SAAAA,IAAAA,EAAAA,SAAAA;IAAO,SAAA,IAAA,EAAA,SAAA;;;;;;AAOf,CAAA,EAAA;EAAuC,SAAA,IAAA,EAAA,UAAA;EAAA,SACrBD,IAAAA,EAAAA,eAAAA;EAAsB,SACtBE,eAAAA,EAAAA,YAAAA;EAAsB,SAE7B0D,MAAAA,EAAAA,SAAAA,CAAAA;IAaP3D,SAAAA,IAAAA,EAAAA,SAAAA;IAAO,SAAA,IAAA,EAAA,SAAA;;;;;ICnDMgD,SAAAA,IAAa,EAAA,UAIZ;;EAGM3C,CAAAA,EAAAA;;;;;MAKAC,SAAAA,IAAe,EAAA,OAAA;IAAA,CAAA,EAAA;MAAiCoD,SAAAA,IAAAA,EAAAA,WAAAA;MAAMA,SAAAA,IAAAA,EAAAA,OAAAA;IAAG,CAAA,EAAA;;;;;;IAMzDnD,CAAAA,CAAAA;;;;;;;;;;;;ICZHC,SAAAA,IAQpB,EAAA,SAAA;EACoBC,CAAAA,EAAAA;;;;;;;;;;EA8BAC,SAAAA,OAAAA,EAAAA,SAIpB,EAAA;AACD,CAAA,EAAA;;;;;;;;;;;;;;;;;;UFlDiBiD,SAAAA;;EDDI9D,YAAAA,EA8FnB,a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QxB;;iBQLSO,kBAAAA,kBAAoCG;;;;ARY5D;;;AAEkBzD,iBQPMuD,uBAAAA,CRONvD,OAAAA,EAAAA,KAAAA,MAAAA,EAAAA,EAAAA,SAAAA,EAAAA,MAAAA,CAAAA,EQP0E+C,aRO1E/C,EAAAA;;;AAeP;;;;;ACnDX;;AAOA;;;;;AAKA;;AAAwEyD,iBOkChDD,uBAAAA,CPlCgDC,MAAAA,EAAAA;EAAG,OAAGA,EOmCjEA,GPnCiEA;EAAG,IAAA,EAAA,KAAA,MAAA,EAAA;;;;;;EAMzDnD;;;;;;;;;;;;ECZHC,gBAQpB,CAAA,EAAA,QAAA,GAAA,QAAA,GAAA,MAAA;EACoBC;;IMsDjBkD;;;;;;ATtEJ;;;;;ACCA;;cSSqBC;iBACGC,0BAAAA;;;;ETCP9D,OAAAA,CAAAA,EAAAA,MAAAA;EAQAE,OAAAA,CAAAA,ESJHyD,GTIGzD;CAAsB,CAAA,ESHnC0D,STGmC,EAAA;;;;;;;;ADpBvC;;;;;ACCA;;iBUSwBG,YAAAA;;iBAEAC,mBAAAA,CAAAA;;iBAEAC,gBAAAA,CAAAA;AVFxB;AAQiB/D,iBUJOgE,qBAAAA,CAAAA,CVIe,EAAA,MAAA;;AAGnBpE,iBULIqE,iBAAAA,CVKJrE,OAAAA,EAAAA,MAAAA,CAAAA,EAAAA,OAAAA;;AAKZG,iBURgBmE,oBAAAA,CAAAA,CVQhBnE,EAAAA;EAAO,IAAA,EAAA,KAAA,MAAA,EAAA"}
1
+ {"version":3,"file":"index.d.ts","names":["rolesV2Abi","ContractFunctionArgs","ContractFunctionName","rolesV2Abi","ScopeFunctionName","ScopeStep","Name","ScopeStepsPublicClient","Promise","ScopeStepsWalletClient","applyScopeSteps","Hex","ConditionFlat","addressEqualCompValue","customCompValue","sizeCapExtra","ParameterType","Operator","CANONICAL_ADAPTERS","ExecutionOptions","Hex","ScopeStep","ConditionFlat","DELEVERAGER_ROLE_KEY","buildDeleveragerDispatchConditions","buildDeleveragerRoleSteps","Hex","ScopeStep","ConditionFlat","DISPATCH_SELECTOR","roleKey","buildDispatchCustomConditions","buildDispatchCustomRoleSteps","Address","Hex","ScopeStep","ConditionFlat","LIQUIDATE_SELECTOR","LiquidatorConditionsParams","buildLiquidatorConditions","buildLiquidatorRoleSteps","Hex","ConditionFlat","LOAN_BITMASK_WINDOW_SHIFTS","loanBitmaskCompValueAt","buildLoanOnlyDispatchConditions","WITHDRAW_SELECTOR","DEPOSIT_SELECTOR","EXECUTE_SELECTOR","buildWithdrawConditions","buildDepositConditions","Hex","ScopeStep","ConditionFlat","MAINTENANCE_ROLE_KEY","DISPATCH_FROM_SELECTOR","buildDispatchFromConditions","buildMaintenanceRoleSteps","Hex","ScopeStep","ROLLER_ROLE_KEY","buildRollerRoleSteps","Hex","ScopeStep","ConditionFlat","MULTICALL_SELECTOR","MULTISEND_SELECTOR","WETH_DEPOSIT_SELECTOR","WETH_WITHDRAW_SELECTOR","WITHDRAW_WITH_POSITIONS_SELECTOR","buildWithdrawWithPositionsConditions","sfpmPoolIdPinExtra","buildSfpmSwapConditions","buildSfpmSwapVenueSteps","Hex","ScopeStep","SIZE_ADJUSTER_ROLE_KEY","buildSizeAdjusterRoleSteps","legFieldMask","loanWidthFieldsMask","strikeFieldsMask","optionRatioFieldsMask","isPureLoanTokenId","loanBitmaskCondition"],"sources":["../../src/zodiac/rolesAbi.d.ts","../../src/zodiac/applySteps.d.ts","../../src/zodiac/conditions.d.ts","../../src/zodiac/constants.d.ts","../../src/zodiac/roles/deleverager.d.ts","../../src/zodiac/roles/dispatchCustomRole.d.ts","../../src/zodiac/roles/liquidator.d.ts","../../src/zodiac/roles/loanHedger.d.ts","../../src/zodiac/roles/maintenance.d.ts","../../src/zodiac/roles/roller.d.ts","../../src/zodiac/roles/sfpmSwap.d.ts","../../src/zodiac/roles/sizeAdjuster.d.ts","../../src/zodiac/tokenIdMask.d.ts"],"sourcesContent":null,"mappings":";;;;;cACqBG;;;EAAAA,SAAAA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,MAAAA;;AAC8CA,iBWW5C4E,iBAAAA,CXX4C5E,OAAAA,EAAAA,MAAAA,CAAAA,EAAAA,OAAAA;;AAElEF,iBWWsB+E,oBAAAA,CAAAA,CXXtB/E,EAAAA;EAAiB,IAAA,EAAA,KAAA,MAAA,EAAA"}
@@ -1,4 +1,4 @@
1
- import { keccak256, toBytes, toFunctionSelector, zeroHash } from "viem";
1
+ import { keccak256, toBytes, toFunctionSelector, zeroAddress, zeroHash } from "viem";
2
2
 
3
3
  //#region src/zodiac/rolesAbi.ts
4
4
  /** Minimal Zodiac Roles v2 modifier ABI used by the scoping/apply flows. */
@@ -523,6 +523,158 @@ function buildDeleveragerRoleSteps(params) {
523
523
  ];
524
524
  }
525
525
 
526
+ //#endregion
527
+ //#region src/zodiac/roles/liquidator.ts
528
+ /**
529
+ * Liquidator role: scopes ONLY `PanopticLiquidator.liquidate(LiquidateParams)`
530
+ * on the helper. `initializePool`, `execute`, `multicall`, `sweep`, and
531
+ * `quoteLiquidation` are never scoped.
532
+ *
533
+ * Split of enforcement (must match the LiquidatorCondition contract and the
534
+ * hand-encoded tree in zodiac-modules/test/LiquidatorRolesFork.t.sol, which is
535
+ * the golden spec for this builder):
536
+ * - THIS TREE pins the static fields: pool ∈ allowlist, account ∉ {safe,
537
+ * helper}, swap targets ∈ {router, 0}, premia flags = 0, and — via
538
+ * ExecutionOptions.None — zero outer msg.value (attached value is excluded
539
+ * from the helper's minDelta floors, so it must never flow through the
540
+ * role; native shortfalls are funded via nativeFundingAmount instead).
541
+ * - THE ADAPTER (Custom node on positionIdListTo; Roles hands it full
542
+ * calldata) enforces the cross-field invariants: flash/swap tokens ∈ pool
543
+ * underlyings, swap groups zeroed together or exact nonzero amounts,
544
+ * nativeFundingAmount only on native pools, floors ≥ 0 with one positive.
545
+ */
546
+ const LIQUIDATE_SELECTOR = toFunctionSelector("liquidate((address,address,uint256[],uint256,address,uint256,uint256,address,bytes,address,uint256,address,bytes,address,uint256,int256,int256))");
547
+ /** BFS ConditionFlat tree over liquidate's single LiquidateParams tuple. */
548
+ function buildLiquidatorConditions(params) {
549
+ const { adapter, safe, helper, router, pools, extra = "0x" } = params;
550
+ if (pools.length === 0) throw new Error("liquidator role needs at least one pool");
551
+ const pass = (parent, paramType) => ({
552
+ parent,
553
+ paramType,
554
+ operator: Operator.Pass,
555
+ compValue: "0x"
556
+ });
557
+ const conditions = [
558
+ {
559
+ parent: 0,
560
+ paramType: ParameterType.Calldata,
561
+ operator: Operator.Matches,
562
+ compValue: "0x"
563
+ },
564
+ {
565
+ parent: 0,
566
+ paramType: ParameterType.Tuple,
567
+ operator: Operator.Matches,
568
+ compValue: "0x"
569
+ },
570
+ {
571
+ parent: 1,
572
+ paramType: ParameterType.None,
573
+ operator: Operator.Or,
574
+ compValue: "0x"
575
+ },
576
+ {
577
+ parent: 1,
578
+ paramType: ParameterType.None,
579
+ operator: Operator.Nor,
580
+ compValue: "0x"
581
+ },
582
+ {
583
+ parent: 1,
584
+ paramType: ParameterType.Array,
585
+ operator: Operator.Custom,
586
+ compValue: customCompValue(adapter, extra)
587
+ },
588
+ {
589
+ parent: 1,
590
+ paramType: ParameterType.Static,
591
+ operator: Operator.EqualTo,
592
+ compValue: "0x0000000000000000000000000000000000000000000000000000000000000000"
593
+ },
594
+ pass(1, ParameterType.Static),
595
+ pass(1, ParameterType.Static),
596
+ pass(1, ParameterType.Static),
597
+ {
598
+ parent: 1,
599
+ paramType: ParameterType.None,
600
+ operator: Operator.Or,
601
+ compValue: "0x"
602
+ },
603
+ pass(1, ParameterType.Dynamic),
604
+ pass(1, ParameterType.Static),
605
+ pass(1, ParameterType.Static),
606
+ {
607
+ parent: 1,
608
+ paramType: ParameterType.None,
609
+ operator: Operator.Or,
610
+ compValue: "0x"
611
+ },
612
+ pass(1, ParameterType.Dynamic),
613
+ pass(1, ParameterType.Static),
614
+ pass(1, ParameterType.Static),
615
+ pass(1, ParameterType.Static),
616
+ pass(1, ParameterType.Static)
617
+ ];
618
+ for (const pool of pools) conditions.push({
619
+ parent: 2,
620
+ paramType: ParameterType.Static,
621
+ operator: Operator.EqualTo,
622
+ compValue: addressEqualCompValue(pool)
623
+ });
624
+ for (const excluded of [safe, helper]) conditions.push({
625
+ parent: 3,
626
+ paramType: ParameterType.Static,
627
+ operator: Operator.EqualTo,
628
+ compValue: addressEqualCompValue(excluded)
629
+ });
630
+ conditions.push(pass(4, ParameterType.Static));
631
+ for (const parent of [9, 13]) {
632
+ conditions.push({
633
+ parent,
634
+ paramType: ParameterType.Static,
635
+ operator: Operator.EqualTo,
636
+ compValue: addressEqualCompValue(router)
637
+ });
638
+ conditions.push({
639
+ parent,
640
+ paramType: ParameterType.Static,
641
+ operator: Operator.EqualTo,
642
+ compValue: addressEqualCompValue(zeroAddress)
643
+ });
644
+ }
645
+ return conditions;
646
+ }
647
+ /** assignRoles → scopeTarget → scopeFunction for the liquidator role. */
648
+ function buildLiquidatorRoleSteps(params) {
649
+ return [
650
+ {
651
+ name: "assignRoles(liquidator member)",
652
+ functionName: "assignRoles",
653
+ args: [
654
+ params.member,
655
+ [params.roleKey],
656
+ [true]
657
+ ]
658
+ },
659
+ {
660
+ name: "scopeTarget(helper)",
661
+ functionName: "scopeTarget",
662
+ args: [params.roleKey, params.helper]
663
+ },
664
+ {
665
+ name: "scopeFunction(liquidate, liquidator conditions)",
666
+ functionName: "scopeFunction",
667
+ args: [
668
+ params.roleKey,
669
+ params.helper,
670
+ LIQUIDATE_SELECTOR,
671
+ buildLiquidatorConditions(params),
672
+ ExecutionOptions.None
673
+ ]
674
+ }
675
+ ];
676
+ }
677
+
526
678
  //#endregion
527
679
  //#region src/zodiac/tokenIdMask.ts
528
680
  /**
@@ -1150,5 +1302,5 @@ function buildSizeAdjusterRoleSteps(params) {
1150
1302
  }
1151
1303
 
1152
1304
  //#endregion
1153
- export { CANONICAL_ADAPTERS, DELEVERAGER_ROLE_KEY, DEPOSIT_SELECTOR, DISPATCH_FROM_SELECTOR, DISPATCH_SELECTOR, EXECUTE_SELECTOR, ExecutionOptions, LOAN_BITMASK_WINDOW_SHIFTS, MAINTENANCE_ROLE_KEY, MULTICALL_SELECTOR, MULTISEND_SELECTOR, Operator, ParameterType, ROLLER_ROLE_KEY, SIZE_ADJUSTER_ROLE_KEY, WETH_DEPOSIT_SELECTOR, WETH_WITHDRAW_SELECTOR, WITHDRAW_SELECTOR, WITHDRAW_WITH_POSITIONS_SELECTOR, addressEqualCompValue, applyScopeSteps, buildDeleveragerDispatchConditions, buildDeleveragerRoleSteps, buildDepositConditions, buildDispatchCustomConditions, buildDispatchCustomRoleSteps, buildDispatchFromConditions, buildLoanOnlyDispatchConditions, buildMaintenanceRoleSteps, buildRollerRoleSteps, buildSfpmSwapConditions, buildSfpmSwapVenueSteps, buildSizeAdjusterRoleSteps, buildWithdrawConditions, buildWithdrawWithPositionsConditions, customCompValue, isPureLoanTokenId, legFieldMask, loanBitmaskCompValueAt, loanBitmaskCondition, loanWidthFieldsMask, optionRatioFieldsMask, roleKey, rolesV2Abi, sfpmPoolIdPinExtra, sizeCapExtra, strikeFieldsMask };
1305
+ export { CANONICAL_ADAPTERS, DELEVERAGER_ROLE_KEY, DEPOSIT_SELECTOR, DISPATCH_FROM_SELECTOR, DISPATCH_SELECTOR, EXECUTE_SELECTOR, ExecutionOptions, LIQUIDATE_SELECTOR, LOAN_BITMASK_WINDOW_SHIFTS, MAINTENANCE_ROLE_KEY, MULTICALL_SELECTOR, MULTISEND_SELECTOR, Operator, ParameterType, ROLLER_ROLE_KEY, SIZE_ADJUSTER_ROLE_KEY, WETH_DEPOSIT_SELECTOR, WETH_WITHDRAW_SELECTOR, WITHDRAW_SELECTOR, WITHDRAW_WITH_POSITIONS_SELECTOR, addressEqualCompValue, applyScopeSteps, buildDeleveragerDispatchConditions, buildDeleveragerRoleSteps, buildDepositConditions, buildDispatchCustomConditions, buildDispatchCustomRoleSteps, buildDispatchFromConditions, buildLiquidatorConditions, buildLiquidatorRoleSteps, buildLoanOnlyDispatchConditions, buildMaintenanceRoleSteps, buildRollerRoleSteps, buildSfpmSwapConditions, buildSfpmSwapVenueSteps, buildSizeAdjusterRoleSteps, buildWithdrawConditions, buildWithdrawWithPositionsConditions, customCompValue, isPureLoanTokenId, legFieldMask, loanBitmaskCompValueAt, loanBitmaskCondition, loanWidthFieldsMask, optionRatioFieldsMask, roleKey, rolesV2Abi, sfpmPoolIdPinExtra, sizeCapExtra, strikeFieldsMask };
1154
1306
  //# sourceMappingURL=index.js.map