@gvnrdao/dh-sdk 0.0.320 → 0.0.324

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.
@@ -0,0 +1,8 @@
1
+ export declare const DiamondHandsSDK: any;
2
+ export type CreateLoanRequest = any;
3
+ export type CreateLoanResult = any;
4
+ export type DiamondHandsSDKConfig = any;
5
+ export declare const AuthParamsValidation: any, BPSConversions: any, BitcoinOperations: any, CacheManager: any, ContractManager: any, SDKClass: any, ErrorCategory: any, ErrorSeverity: any, EventHelpers: any, LoanCreator: any, LoanQuery: any, LoanStatus: any, PaymentType: any, PositionStatus: any, SDKError: any, SatoshisConversions: any, UCDConversions: any, WeiConversions: any, createBitcoinOperations: any, createCacheManager: any, createContractManager: any, createLoanCreator: any, createLoanQuery: any, createPKPManager: any, failure: any, success: any, tryCatch: any, tryCatchAsync: any, unwrap: any, unwrapOr: any, validateSDKConfig: any;
6
+ declare const _default: any;
7
+ export default _default;
8
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"AAiBA,eAAO,MAAM,eAAe,KAA4B,CAAC;AAgCzD,MAAM,MAAM,iBAAiB,GAAG,GAAG,CAAC;AACpC,MAAM,MAAM,gBAAgB,GAAG,GAAG,CAAC;AACnC,MAAM,MAAM,qBAAqB,GAAG,GAAG,CAAC;AAQxC,eAAO,MACL,oBAAoB,OACpB,cAAc,OACd,iBAAiB,OACjB,YAAY,OACZ,eAAe,OACE,QAAQ,OACzB,aAAa,OACb,aAAa,OACb,YAAY,OACZ,WAAW,OACX,SAAS,OACT,UAAU,OACV,WAAW,OACX,cAAc,OACd,QAAQ,OACR,mBAAmB,OACnB,cAAc,OACd,cAAc,OACd,uBAAuB,OACvB,kBAAkB,OAClB,qBAAqB,OACrB,iBAAiB,OACjB,eAAe,OACf,gBAAgB,OAChB,OAAO,OACP,OAAO,OACP,QAAQ,OACR,aAAa,OACb,MAAM,OACN,QAAQ,OACR,iBAAiB,KACN,CAAC;;AAOd,wBAAyC"}
@@ -0,0 +1,25 @@
1
+ // Browser ESM entry point for Diamond Hands SDK
2
+ // Converts CommonJS exports to ES module imports for browser compatibility
3
+ // Uses the proven wrapper pattern from test-app/src/lib/lit-ops-wrapper.ts
4
+ // Import from the original built SDK (CommonJS module)
5
+ const SDKModule = require("../dist/index.js");
6
+ // Import lit-ops and lit-actions (using the wrapper pattern)
7
+ // TODO: Re-enable when these modules have proper ES module builds
8
+ // import * as LitOpsModule from "../../lit-ops/dist/index.js";
9
+ // import * as LitActionsModule from "../../lit-actions/dist/index.js";
10
+ // ========================================
11
+ // MAIN SDK EXPORTS
12
+ // ========================================
13
+ // Export main SDK classes (based on actual SDK exports)
14
+ export const DiamondHandsSDK = SDKModule.DiamondHandsSDK;
15
+ // ========================================
16
+ // RE-EXPORT CORE SDK ONLY
17
+ // ========================================
18
+ // Re-export core SDK exports only to avoid conflicts
19
+ // Note: CommonJS module, so we export specific items
20
+ export const { AuthParamsValidation, BPSConversions, BitcoinOperations, CacheManager, ContractManager, DiamondHandsSDK: SDKClass, ErrorCategory, ErrorSeverity, EventHelpers, LoanCreator, LoanQuery, LoanStatus, PaymentType, PositionStatus, SDKError, SatoshisConversions, UCDConversions, WeiConversions, createBitcoinOperations, createCacheManager, createContractManager, createLoanCreator, createLoanQuery, createPKPManager, failure, success, tryCatch, tryCatchAsync, unwrap, unwrapOr, validateSDKConfig, } = SDKModule;
21
+ // ========================================
22
+ // DEFAULT EXPORT
23
+ // ========================================
24
+ // Default export (main SDK class)
25
+ export default SDKModule.DiamondHandsSDK;
@@ -39,6 +39,8 @@ export interface DeploymentContracts {
39
39
  AgentDelegationRegistry?: string;
40
40
  /** DHAgentDelegate — EIP-7702 execution adapter (Gate 2): lets the renewal agent call extendPosition as the borrower. Stateless; reads AgentDelegationRegistry.canRenew. */
41
41
  DHAgentDelegate?: string;
42
+ /** AgentModuleFactory — CREATE2 factory a multi-sig Safe uses to deploy its own AgentModule during the delegation ceremony. Bakes the four protocol targets in as immutables (anti-phishing) and records provenance via isFromFactory. */
43
+ AgentModuleFactory?: string;
42
44
  PriceFeedConsumer?: string;
43
45
  OperationAuthorizationRegistry?: string;
44
46
  PKPValidation?: string;
@@ -38,6 +38,8 @@ export interface NetworkConfig {
38
38
  carryAgentRegistry?: string;
39
39
  agentDelegationRegistry?: string;
40
40
  dhAgentDelegate?: string;
41
+ /** AgentModuleFactory; CREATE2 factory a multi-sig Safe uses to deploy its own AgentModule in the delegation ceremony. Sepolia only. */
42
+ agentModuleFactory?: string;
41
43
  mockUsdcToken?: string;
42
44
  mockUsdtToken?: string;
43
45
  mockUsdcOwner?: string;
@@ -14,7 +14,7 @@ export declare class AgentDelegationRegistry__factory extends ContractFactory {
14
14
  deploymentTransaction(): ContractTransactionResponse;
15
15
  }>;
16
16
  connect(runner: ContractRunner | null): AgentDelegationRegistry__factory;
17
- static readonly bytecode = "0x60a080604052346100ea57306080527ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a005460ff8160401c166100d9576002600160401b03196001600160401b03821601610073575b604051612d3290816100f0823960805181818161101d01526112020152f35b6001600160401b0319166001600160401b039081177ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a005581527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d290602090a13880610054565b63f92ee8a960e01b60005260046000fd5b600080fdfe608080604052600436101561001357600080fd5b60003560e01c90816301ffc9a714611dec575080630d33f3c214611dc85780630f3f4a9414611d7d5780631459457a146119d757806318c38b89146118c65780631d444541146117f5578063248a9ca3146117cf5780632ec22d4c1461170e5780632f0647ce146116935780632f2ff15d1461166257806336568abe1461161c578063392f1087146115cf5780633f4ba83a146114d75780633f5aadc9146114685780634f1ef28614611186578063523403631461109d5780635273b6f61461107457806352d1902d1461100a578063554c4f4b14610f7a578063561b7f8a14610e4e5780635bc26aea14610dc15780635c975abb14610d915780636289d18c14610d105780636711cc0b14610cf45780636e852a7814610bf35780637e35bf6e14610bbf5780638343f67414610b925780638456cb5914610a9c5780638f33527f14610a625780639010d07c14610a0e57806391d14854146109b45780639b9d30c11461098b578063a19af3f6146108c9578063a217fddf146108ad578063a3246ad3146107eb578063a8780864146107cf578063ac3c0e30146106c2578063ad3cb1cc1461067b578063b3fad638146105ef578063c34e9c26146105d3578063ca15c8731461059a578063d547741f14610562578063dd71d99a14610520578063e0922fa114610473578063efa9b4ae14610404578063f2f4eb26146103db578063f68e9553146103b2578063fd437d39146102735763ffa1ad741461023a57600080fd5b3461026e57600036600319011261026e5761026a610256611fb9565b604051918291602083526020830190611f94565b0390f35b600080fd5b3461026e57606036600319011261026e5761028c611e6f565b610294611e59565b9061029d611f5b565b906102a661247b565b6001600160a01b0316338190036103a25780600052600160205260406000209283549360ff8560e01c16600381101561038c5760010361037b57816001602092610312877fc5d5c5bbf10444998e0ea6d4725e79027b574e1c14ec929279e8a9a95c6c6e919688612929565b818060a01b038316828060a01b03198254161781556103318782612111565b0180546001600160401b031916426001600160401b03908116919091179091556001600160a01b0391821660008181526002855260409081902087905551969091168652951693a4005b632437e77160e11b60005260046000fd5b634e487b7160e01b600052602160045260246000fd5b62fca64560e31b60005260046000fd5b3461026e57600036600319011261026e576020604051600080516020612cc68339815191528152f35b3461026e57600036600319011261026e576003546040516001600160a01b039091168152602090f35b3461026e57602036600319011261026e5760043561042061247b565b61044261042c826124c6565b9190600163ffffffff825460a01c161790612037565b6001600160a01b0316907f812690e0a9dff5bf3add998111b8af5c8299608d859025bfe35662060ab4267d600080a3005b3461026e57602036600319011261026e576004356001600160401b0381169081810361026e576000546001600160a01b038116330361050f57600160a01b600160e01b0319811660a092831b600160a01b600160e01b031617600055604080519190921c6001600160401b0316815260208101929092527f9c195448332abd01f716db873b329752ea02f19d33f7e311fb0daf082c4edd0391a1005b6349db3bd360e01b60005260046000fd5b3461026e57602036600319011261026e576001600160a01b03610541611e6f565b166000526002602052602060018060a01b0360406000205416604051908152f35b3461026e57604036600319011261026e57610598600435610581611e59565b9061059361058e82612016565b6123a5565b612437565b005b3461026e57602036600319011261026e57600435600052600080516020612bc68339815191526020526020604060002054604051908152f35b3461026e57600036600319011261026e57602060405160028152f35b3461026e57602036600319011261026e5760006040805161060f81611f02565b828152826020820152015260043560005260046020526060604060002063ffffffff6040519161063e83611f02565b548160018060a01b038216938481528160406020830192828660a01c168452019360c01c1683526040519485525116602084015251166040820152f35b3461026e57600036600319011261026e5761026a604080519061069e8183611f1d565b60058252640352e302e360dc1b602083015251918291602083526020830190611f94565b3461026e57602036600319011261026e576106db611e6f565b600060806040516106eb81611ed1565b828152826020820152826040820152826060820152015260018060a01b03166000526001602052604060002060405161072381611ed1565b81546001600160a01b038116825260a081901c6001600160401b03166020830190815292604083019160e01c60ff1690600382101561038c57908252600101546001600160401b0380821660608501908152604092831c821660808601908152925194516001600160a01b031685529451166020840152905192600384101561038c57604083019390935291516001600160401b0390811660608301529151909116608082015260a090f35b3461026e57600036600319011261026e57602060405160018152f35b3461026e57602036600319011261026e57600435600052600080516020612bc683398151915260205260406000206040518060208354918281520190819360005260206000209060005b818110610897575050508161084b910382611f1d565b6040519182916020830190602084525180915260408301919060005b818110610875575050500390f35b82516001600160a01b0316845285945060209384019390920191600101610867565b8254845260209093019260019283019201610835565b3461026e57600036600319011261026e57602060405160008152f35b3461026e57604036600319011261026e576004356108e5611ebe565b906108ee61247b565b63ffffffff600554169163ffffffff811692808410908115610982575b506109715760207f1da95b87b4c773f68c1447ffc5644e41a8a8887d55065beb64852014cf7140be9161095e610940856124c6565b9290610959600463ffffffff835460a01c161782612037565b611fdc565b6040519485526001600160a01b031693a3005b634346c13160e01b60005260046000fd5b9050158461090b565b3461026e57600036600319011261026e576020604051600080516020612c068339815191528152f35b3461026e57604036600319011261026e576109cd611e59565b600435600052600080516020612ca683398151915260205260406000209060018060a01b0316600052602052602060ff604060002054166040519015158152f35b3461026e57604036600319011261026e57600435600052600080516020612bc68339815191526020526020610a4960243560406000206129f2565b905460405160039290921b1c6001600160a01b03168152f35b3461026e57602036600319011261026e576001600160a01b03610a83611e6f565b1660005260026020526020604060002054604051908152f35b3461026e57600036600319011261026e573360009081527f0ac8cc3d209806126662940717264973110c39045b305f6ba49613325a615e09602052604090205460ff1615610b6b57610aec61247b565b600160ff19600080516020612ce6833981519152541617600080516020612ce6833981519152557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a2586020604051338152a16040514281527f80170b5fcdd2bf1e0660ef4b8851f86685f64d41b1a19de1471947ece8725aac60203392a2005b63e2517d3f60e01b60005233600452600080516020612c0683398151915260245260446000fd5b3461026e57600036600319011261026e5760005460405160a09190911c6001600160401b03168152602090f35b3461026e57604036600319011261026e57610be3610bdb611e59565b6004356120de565b9061026a60405192839283611e8f565b3461026e57604036600319011261026e57610c0c611e6f565b336000908152600080516020612c46833981519152602052604090205460ff161580610ce1575b6103a2576001600160a01b03166000818152600160205260409020805460e01c60ff16600381101561038c5760010361037b57805460ff60e01b198116600160e11b1782556001919091018054600160401b600160801b03191642604090811b600160401b600160801b0316919091179091555160243581526001600160a01b0390911691907fc0499cc07ed9d734deec6857802d3f0fa8d5afaf79a7008beb8ba7bef62a271b90602090a3005b50336001600160a01b0382161415610c33565b3461026e57600036600319011261026e57602060405160048152f35b3461026e57602036600319011261026e57610d29611eab565b6000546001600160a01b0316330361050f5763ffffffff8116908115610d8057600080516020612c8683398151915291610d7b63ffffffff926005549284198416176005556040519384931683611fff565b0390a1005b6338f3377360e21b60005260046000fd5b3461026e57600036600319011261026e57602060ff600080516020612ce683398151915254166040519015158152f35b3461026e57602036600319011261026e57610dda611e6f565b6000546001600160a01b038116903382900361050f576001600160a01b038316928315610e3d573b15610e2c576001600160a01b03191682176000908155600080516020612c668339815191529080a3005b636f7c43f160e01b60005260046000fd5b63e6c4247b60e01b60005260046000fd5b3461026e57606036600319011261026e57610e67611e6f565b610e6f611e59565b610e77611f5b565b91610e8061247b565b6001600160a01b031690338290036103a257816000526001602052604060002060ff815460e01c16600381101561038c57600114610f695781602091610ee8867ff223dc085722c94c84dcf67427e225799be616382a2a484d378f8921c69a20339587612929565b80546001600160a01b0319166001600160a01b038316178155610f0b8682612111565b6001810180546001600160801b031916426001600160401b0390811691909117909155815460ff60e01b1916600160e01b179091556001600160a01b03919091166000818152600284526040908190208690555195909116855293a3005b639d2c8fdf60e01b60005260046000fd5b3461026e57602036600319011261026e576001600160a01b03610f9b611e6f565b166000526001602052604060002060ff600080516020612ce683398151915254161580610fee575b60209181610fd7575b506040519015158152f35b5460a01c6001600160401b03164210905082610fcc565b5060ff815460e01c1690600382101561038c5790600114610fc3565b3461026e57600036600319011261026e577f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03163003611063576020604051600080516020612c268339815191528152f35b63703e46dd60e11b60005260046000fd5b3461026e57600036600319011261026e576000546040516001600160a01b039091168152602090f35b3461026e57602036600319011261026e57600435604060008281526004602052209081549160018060a01b038316928315908115611177575b5061116657336000908152600080516020612c46833981519152602052604090205460ff16158061115c575b61114b578061111e63fffffffe611124935460a01c1682612037565b82612381565b7fa5ffbdba01b15df97334e34ad816b9986b6057a5ddc97aba93b7e8ccd21759ed600080a3005b630a606ec360e11b60005260046000fd5b5082331415611102565b6360eb6c2360e01b60005260046000fd5b6001915060a01c1615846110d6565b604036600319011261026e5761119a611e6f565b602435906001600160401b03821161026e573660238301121561026e578160040135906111c682611f40565b916111d46040519384611f1d565b8083526020830193366024838301011161026e57816000926024602093018737840101526001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016308114908115611445575b50611063576000546001600160a01b0316330361050f576001600160a01b038116928315610e3d57813b156114345730841461142557600080516020612c26833981519152548461127c611fb9565b7f6ea8b34d59b2818d3f37a08dddaa06f5886b9c20c907b36f03ca6528e106e86f6112b260405192604084526040840190611f94565b4260208401526001600160a01b038516929081900390a36040516352d1902d60e01b8152602081600481895afa600091816113f1575b506113025785634c9c8ce360e01b60005260045260246000fd5b9081600080516020612c268339815191528793036113dd5750833b156113c8576001600160a01b0319168117600080516020612c26833981519152557fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b600080a28251156113ad5760008091610598945190845af43d156113a5573d9161138883611f40565b926113966040519485611f1d565b83523d6000602085013e612b64565b606091612b64565b505050346113b757005b63b398979f60e01b60005260046000fd5b50634c9c8ce360e01b60005260045260246000fd5b632a87526960e21b60005260045260246000fd5b9091506020813d60201161141d575b8161140d60209383611f1d565b8101031261026e575190876112e8565b3d9150611400565b614e8d60eb1b60005260046000fd5b632e07c4bd60e11b60005260046000fd5b600080516020612c26833981519152546001600160a01b0316141590508461122d565b3461026e57602036600319011261026e5760043561148461247b565b6114a6611490826124c6565b9190600263ffffffff825460a01c161790612037565b6001600160a01b0316907fc2713e691344add4705edc62a0ee5aede95ba66ad68f97316efef9cb50644edd600080a3005b3461026e57600036600319011261026e57336000908152600080516020612c46833981519152602052604090205460ff1615806115ba575b6115a957600080516020612ce68339815191525460ff8116156115985760ff1916600080516020612ce6833981519152557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa6020604051338152a16040514281527f107553d8191d85b405879cf752997865edd48d94e20bda4dd27223c94b31a7cc60203392a2005b638dfc202b60e01b60005260046000fd5b63659a07b360e11b60005260046000fd5b506000546001600160a01b031633141561150f565b3461026e57604036600319011261026e57606063ffffffff6115fa6115f2611e59565b60043561205a565b90604093929351931515845261160f81611e85565b6020840152166040820152f35b3461026e57604036600319011261026e57611635611e59565b336001600160a01b038216036116515761059890600435612437565b63334bd91960e11b60005260046000fd5b3461026e57604036600319011261026e57610598600435611681611e59565b9061168e61058e82612016565b6123ef565b3461026e57602036600319011261026e576004356116dd6116b38261230f565b91906116c963fffffffb825460a01c1682612037565b805463ffffffff60c01b1916815583612381565b6001600160a01b0316907f09cb4ec44cdef8489412844b9682f87f7900758fa2bd7e039113e9125e538e0f600080a3005b3461026e57602036600319011261026e57600435604060008281526004602052209081549160018060a01b0383169283159081156117c0575b5061116657336000908152600080516020612c46833981519152602052604090205460ff1615806117b6575b61114b578061111e63fffffffd61178f935460a01c1682612037565b7fb390ab029eab314bd18190ebe73d7e5c1c336beaa5c83ac22578378dc9ccc405600080a3005b5082331415611773565b6002915060a01c161584611747565b3461026e57602036600319011261026e5760206117ed600435612016565b604051908152f35b3461026e57604036600319011261026e57600435611811611ebe565b63ffffffff600554169063ffffffff8116918083109081156118bd575b506109715761183c8361230f565b909263ffffffff845460c01c16809260018060a01b031633141591826118b2575b50506118a15761188d827e8a218591d4362499c38c38eb1c12e7a7cc97a9068818d1fe6046a42ba4a5ba94611fdc565b61189c60405192839283611fff565b0390a2005b634e80a40760e11b60005260046000fd5b11159050818661185d565b9050158461182e565b3461026e57602036600319011261026e576118df611eab565b600080516020612d068339815191525460ff8160401c169081156119bf575b506119ae57600080516020612d06833981519152805460026001600160401b0319821681179092556000546001600160481b031990911690911791906001600160a01b0316330361050f5763ffffffff168015610d8057604081600080516020612c868339815191529263ffffffff196005541617600555815190600082526020820152a1600080516020612d0683398151915255600080516020612be6833981519152602060405160028152a1005b63f92ee8a960e01b60005260046000fd5b60026001600160401b039190911610159050826118fe565b3461026e5760a036600319011261026e576119f0611e6f565b6119f8611e59565b906044356001600160a01b03811680820361026e576064356001600160a01b0381169182820361026e576084356001600160a01b038116949085900361026e57600080516020612d0683398151915254604081901c60ff161596906001600160401b031680159081611d75575b6001149081611d6b575b159081611d62575b506119ae57600080516020612d0683398151915280546001600160401b031916600117905586611d3d575b611aaa6127b2565b611ab26127b2565b611aba6127b2565b611ac26127b2565b6001600160a01b038116908115610e3d578315610e3d578515610e3d576001600160a01b038916988915610e3d573b15610e2c57858414611d2c5762aa36a746148015611d21575b8015611d16575b1580611d04575b610e2c57611b279060006127e0565b9081611cbd575b5015611c0257611b4c90600080516020612cc68339815191526127e0565b9081611c68575b5015611c0257611b7190600080516020612c068339815191526127e0565b9081611c13575b5015611c0257600080546001600160a01b031916841781556040519390600080516020612c668339815191528180a38015610e3d57803b15610e2c57600380546001600160a01b031916919091179055611bce57005b600080516020612d06833981519152805460ff60401b1916905560018152600080516020612be683398151915290602090a1005b63cf5a8e3360e01b60005260046000fd5b600080516020612c06833981519152600052600080516020612bc6833981519152602052611c61907ffff5b43478fa6840382eb63777e0da6941d320b940e3f70f0ea4780feff95827612a20565b5084611b78565b600080516020612cc6833981519152600052600080516020612bc6833981519152602052611cb6907f32d31393d541a265984ec379cddd8b1fcbe5f2b0eb8ad81dddfead454f135eaa612a20565b5086611b53565b60008052600080516020612bc6833981519152602052611cfd907f615f0f9e84155bea8cc509fe18befeb1baf65611e38a6ba60964480fb29dfd44612a20565b5088611b2e565b50823b1580611b185750843b15611b18565b50617a694614611b11565b506105394614611b0a565b638135316560e01b60005260046000fd5b600080516020612d06833981519152805460ff60401b1916600160401b179055611aa2565b90501589611a77565b303b159150611a6f565b889150611a65565b3461026e57604036600319011261026e5761026a611db1611d9c611e59565b6004356000526004602052604060002061213a565b611dba81611e85565b604051918183921583611e8f565b3461026e57600036600319011261026e57602063ffffffff60055416604051908152f35b3461026e57602036600319011261026e576004359063ffffffff60e01b821680920361026e57602091635a05180f60e01b8114908115611e2e575b5015158152f35b637965db0b60e01b811491508115611e48575b5083611e27565b6301ffc9a760e01b14905083611e41565b602435906001600160a01b038216820361026e57565b600435906001600160a01b038216820361026e57565b6008111561038c57565b901515815260408101929190602090611ea783611e85565b0152565b6004359063ffffffff8216820361026e57565b6024359063ffffffff8216820361026e57565b60a081019081106001600160401b03821117611eec57604052565b634e487b7160e01b600052604160045260246000fd5b606081019081106001600160401b03821117611eec57604052565b601f909101601f19168101906001600160401b03821190821017611eec57604052565b6001600160401b038111611eec57601f01601f191660200190565b604435906001600160401b038216820361026e57565b60005b838110611f845750506000910152565b8181015183820152602001611f74565b90602091611fad81518092818552858086019101611f71565b601f01601f1916010190565b60405190611fc8604083611f1d565b60058252640322e302e360dc1b6020830152565b805463ffffffff60c01b191660c09290921b63ffffffff60c01b16919091179055565b63ffffffff91821681529116602082015260400190565b600052600080516020612ca683398151915260205260016040600020015490565b805463ffffffff60a01b191660a09290921b63ffffffff60a01b16919091179055565b9190916000526004602052612074604060002092836121f7565b9161207e83611e85565b826120d45763ffffffff9192505460c01c1663ffffffff60055416811580156120cc575b6120bf578082106120b857505b60019160009190565b90506120af565b5050600090600390600090565b5080156120a2565b5060009190600090565b906120f59160005260046020526040600020612283565b6120fe81611e85565b8061210c5750600190600090565b600091565b8054600160a01b600160e01b03191660a09290921b600160a01b600160e01b0316919091179055565b60ff600080516020612ce683398151915254166121f057546001600160a01b0381169081156121e85760a01c600216156121e15760005260016020526040600020549060ff8260e01c16600381101561038c5780156121d9576002146121d2574260a083901c6001600160401b031611156121cb576001600160a01b039081169116036121c657600090565b600790565b5050600690565b5050600590565b505050600490565b5050600390565b505050600290565b5050600190565b60ff600080516020612ce683398151915254166121f057546001600160a01b0381169081156121e85760a01c600416156121e15760005260016020526040600020549060ff8260e01c16600381101561038c5780156121d9576002146121d2574260a083901c6001600160401b031611156121cb576001600160a01b039081169116036121c657600090565b60ff600080516020612ce683398151915254166121f057546001600160a01b0381169081156121e85760a01c600116156121e15760005260016020526040600020549060ff8260e01c16600381101561038c5780156121d9576002146121d2574260a083901c6001600160401b031611156121cb576001600160a01b039081169116036121c657600090565b6000908152600460205260409020805490916001600160a01b038216918215908115612372575b5061116657336000908152600080516020612c46833981519152602052604090205460ff161580612368575b61114b57565b5081331415612362565b6004915060a01c161538612336565b905460a01c63ffffffff16156123945750565b600052600460205260006040812055565b6000818152600080516020612ca68339815191526020908152604080832033845290915290205460ff16156123d75750565b63e2517d3f60e01b6000523360045260245260446000fd5b6123f982826127e0565b918261240457505090565b6000918252600080516020612bc68339815191526020526040909120612433916001600160a01b031690612a20565b5090565b6124418282612889565b918261244c57505090565b6000918252600080516020612bc68339815191526020526040909120612433916001600160a01b031690612a91565b60ff600080516020612ce6833981519152541661249457565b63d93c066560e01b60005260046000fd5b519064ffffffffff8216820361026e57565b519061ffff8216820361026e57565b80156127a157600354604051638d34875560e01b8152600481018390529190600090839060249082906001600160a01b03165afa918215612795576000926125ea575b5060808201516001600160a01b0316913383900361114b57610120015161252f81611e85565b61253881611e85565b600381149081156125d5575b81156125c1575b506125b05781600052600160205260ff60406000205460e01c16600381101561038c5760010361259f57600090815260046020526040902080546001600160a01b0319166001600160a01b03831617815591565b632e68d1d360e21b60005260046000fd5b63e9f6db8560e01b60005260046000fd5b600791506125ce81611e85565b143861254b565b90506125e081611e85565b6005811490612544565b90913d8082843e6125fb8184611f1d565b820191602081840312612775578051906001600160401b03821161277d5701906101a08284031261277257604051926101a084016001600160401b038111858210176127815760409081528351855260208085015190860152838101519085015260608301516001600160401b03811161277d57830181601f8201121561277d5780519061268882611f40565b926126966040519485611f1d565b8284526020838301011161277957906126b59160208085019101611f71565b606084015260808201516001600160a01b03811681036127755760808401526126e060a083016124a5565b60a08401526126f160c083016124a5565b60c084015261270260e083016124b7565b60e084015261271461010083016124a5565b6101008401526101208201519060088210156127725750612765916101809161012085015261274661014082016124a5565b61014085015261275961016082016124b7565b610160850152016124a5565b6101808201529038612509565b80fd5b5080fd5b8380fd5b8280fd5b634e487b7160e01b83526041600452602483fd5b6040513d6000823e3d90fd5b637bb0b62160e01b60005260046000fd5b60ff600080516020612d068339815191525460401c16156127cf57565b631afcd79f60e31b60005260046000fd5b6000818152600080516020612ca6833981519152602090815260408083206001600160a01b038616845290915290205460ff16612882576000818152600080516020612ca6833981519152602090815260408083206001600160a01b0395909516808452949091528120805460ff19166001179055339291907f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d9080a4600190565b5050600090565b6000818152600080516020612ca6833981519152602090815260408083206001600160a01b038616845290915290205460ff1615612882576000818152600080516020612ca6833981519152602090815260408083206001600160a01b0395909516808452949091528120805460ff19169055339291907ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9080a4600190565b1580156129e1575b610e3d576001600160a01b03166000908152600260205260409020546129d0576001600160401b0316428111156129bf5760005460a01c6001600160401b03168015159182612994575b505061298357565b63e774e7b560e01b60005260046000fd5b9091504281039081116129a95711388061297b565b634e487b7160e01b600052601160045260246000fd5b63efa7aefd60e01b60005260046000fd5b633b53f64f60e21b60005260046000fd5b506001600160a01b03811615612931565b8054821015612a0a5760005260206000200190600090565b634e487b7160e01b600052603260045260246000fd5b6001810190826000528160205260406000205415600014612a89578054600160401b811015611eec57612a74612a5d8260018794018555846129f2565b819391549060031b91821b91600019901b19161790565b90555491600052602052604060002055600190565b505050600090565b9060018201918160005282602052604060002054801515600014612b5b5760001981018181116129a95782546000198101919082116129a957818103612b24575b50505080548015612b0e576000190190612aec82826129f2565b8154906000199060031b1b191690555560005260205260006040812055600190565b634e487b7160e01b600052603160045260246000fd5b612b44612b34612a5d93866129f2565b90549060031b1c928392866129f2565b905560005283602052604060002055388080612ad2565b50505050600090565b90612b8a5750805115612b7957602081519101fd5b63d6bda27560e01b60005260046000fd5b81511580612bbc575b612b9b575090565b639996b31560e01b60009081526001600160a01b0391909116600452602490fd5b50803b15612b9356fec1f6fe24621ce81ec5827caf0253cadb74709b061630e6b55e82371705932000c7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d275027301df982f5215b4963a854cf9c73219df80cb6acd8f098189c9480c7bbc360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc07966f2ab141347034724e9b2a472c2f77f5cd745aeba27cacba797b8fcb708617dc5b1290f7495d7f8cc68476e6941aaf510598fa925d0d2720edc8805a846cd37bc77615afefc793aa17d75d4249a9b517ba91b0e54a49c9c4a44b3d7e228302dd7bc7dec4dceedda775e58dd541e08a116c6c53815c0bd028192f7b626800edcc084d3dcd65a1f7f23c65c46722faca6953d28e43150a467cf43e5c309238cd5ed15c6e187e77e9aee88184c21f4f2182ab5827cb3b7e07fbedcd63f03300f0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a00a164736f6c6343000822000a";
17
+ static readonly bytecode = "0x60a080604052346100ea57306080527ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a005460ff8160401c166100d9576002600160401b03196001600160401b03821601610073575b60405161304c90816100f0823960805181818161114401526113290152f35b6001600160401b0319166001600160401b039081177ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a005581527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d290602090a13880610054565b63f92ee8a960e01b60005260046000fd5b600080fdfe608080604052600436101561001357600080fd5b60003560e01c90816301ffc9a714611ff7575080630d33f3c214611fd35780630f3f4a9414611f885780631459457a14611be257806318c38b8914611ad15780631d44454114611a005780632106764c146119d9578063248a9ca3146119b35780632ec22d4c146118f25780632f0647ce146118775780632f2ff15d14611846578063324207441461177257806336568abe1461172c578063392f1087146116f65780633f4ba83a146115fe5780633f5aadc91461158f5780634f1ef286146112ad57806352340363146111c45780635273b6f61461119b57806352d1902d14611131578063554c4f4b146110a1578063561b7f8a14610f755780635bc26aea14610ee85780635c975abb14610eb85780636289d18c14610e375780636711cc0b14610e1b5780636e852a7814610d1a5780637e35bf6e14610ce65780638343f67414610cb95780638456cb5914610bc35780638f33527f14610b895780639010d07c14610b3557806391d1485414610adb5780639b9d30c114610ab2578063a19af3f614610a01578063a217fddf146109e5578063a3246ad314610923578063a878086414610907578063ac3c0e30146107fa578063ad3cb1cc146107b3578063b3fad6381461070e578063c34e9c26146106f2578063c86deb31146106d6578063ca15c8731461069d578063d547741f14610665578063dd71d99a14610623578063e0922fa114610576578063efa9b4ae14610507578063f2f4eb26146104de578063f68e9553146104b5578063f94f67ab146103de578063fd437d391461029f5763ffa1ad741461026657600080fd5b3461029a57600036600319011261029a576102966102826121ed565b6040519182916020835260208301906121c8565b0390f35b600080fd5b3461029a57606036600319011261029a576102b861207a565b6102c0612064565b906102c961218f565b906102d2612795565b6001600160a01b0316338190036103ce5780600052600160205260406000209283549360ff8560e01c1660038110156103b8576001036103a75781600160209261033e877fc5d5c5bbf10444998e0ea6d4725e79027b574e1c14ec929279e8a9a95c6c6e919688612c43565b818060a01b038316828060a01b031982541617815561035d878261239f565b0180546001600160401b031916426001600160401b03908116919091179091556001600160a01b0391821660008181526002855260409081902087905551969091168652951693a4005b632437e77160e11b60005260046000fd5b634e487b7160e01b600052602160045260246000fd5b62fca64560e31b60005260046000fd5b3461029a57604036600319011261029a576004356103fa6120c9565b90610403612795565b63ffffffff600554169163ffffffff8116928084109081156104ac575b5061049b5760207f6b7727cc9c3df4a29acf0afe01594c1b7e845d20f40f4a14e4c292164a9ed8e191610452846127e0565b9161046a600863ffffffff845460a01c1617836122e3565b81546001600160e01b031660e09190911b6001600160e01b0319161790556040519485526001600160a01b031693a3005b634346c13160e01b60005260046000fd5b90501584610420565b3461029a57600036600319011261029a576020604051600080516020612fe08339815191528152f35b3461029a57600036600319011261029a576003546040516001600160a01b039091168152602090f35b3461029a57602036600319011261029a57600435610523612795565b61054561052f826127e0565b9190600163ffffffff825460a01c1617906122e3565b6001600160a01b0316907f812690e0a9dff5bf3add998111b8af5c8299608d859025bfe35662060ab4267d600080a3005b3461029a57602036600319011261029a576004356001600160401b0381169081810361029a576000546001600160a01b038116330361061257600160a01b600160e01b0319811660a092831b600160a01b600160e01b031617600055604080519190921c6001600160401b0316815260208101929092527f9c195448332abd01f716db873b329752ea02f19d33f7e311fb0daf082c4edd0391a1005b6349db3bd360e01b60005260046000fd5b3461029a57602036600319011261029a576001600160a01b0361064461207a565b166000526002602052602060018060a01b0360406000205416604051908152f35b3461029a57604036600319011261029a5761069b600435610684612064565b90610696610691826122c2565b6126bf565b612751565b005b3461029a57602036600319011261029a57600435600052600080516020612ee08339815191526020526020604060002054604051908152f35b3461029a57600036600319011261029a57602060405160088152f35b3461029a57600036600319011261029a57602060405160028152f35b3461029a57602036600319011261029a576000606060405161072f81612136565b828152826020820152826040820152015260043560005260046020526080604060002063ffffffff6040519161076483612136565b548160018060a01b038216938481528160208201818560a01c16815260606040840193838760c01c168552019460e01c8552604051968752511660208601525116604084015251166060820152f35b3461029a57600036600319011261029a5761029660408051906107d68183612151565b60058252640352e302e360dc1b6020830152519182916020835260208301906121c8565b3461029a57602036600319011261029a5761081361207a565b6000608060405161082381612105565b828152826020820152826040820152826060820152015260018060a01b03166000526001602052604060002060405161085b81612105565b81546001600160a01b038116825260a081901c6001600160401b03166020830190815292604083019160e01c60ff169060038210156103b857908252600101546001600160401b0380821660608501908152604092831c821660808601908152925194516001600160a01b03168552945116602084015290519260038410156103b857604083019390935291516001600160401b0390811660608301529151909116608082015260a090f35b3461029a57600036600319011261029a57602060405160018152f35b3461029a57602036600319011261029a57600435600052600080516020612ee083398151915260205260406000206040518060208354918281520190819360005260206000209060005b8181106109cf5750505081610983910382612151565b6040519182916020830190602084525180915260408301919060005b8181106109ad575050500390f35b82516001600160a01b031684528594506020938401939092019160010161099f565b825484526020909301926001928301920161096d565b3461029a57600036600319011261029a57602060405160008152f35b3461029a57604036600319011261029a57600435610a1d6120c9565b90610a26612795565b63ffffffff600554169163ffffffff811692808410908115610aa9575b5061049b5760207f1da95b87b4c773f68c1447ffc5644e41a8a8887d55065beb64852014cf7140be91610a96610a78856127e0565b9290610a91600463ffffffff835460a01c1617826122e3565b612210565b6040519485526001600160a01b031693a3005b90501584610a43565b3461029a57600036600319011261029a576020604051600080516020612f208339815191528152f35b3461029a57604036600319011261029a57610af4612064565b600435600052600080516020612fc083398151915260205260406000209060018060a01b0316600052602052602060ff604060002054166040519015158152f35b3461029a57604036600319011261029a57600435600052600080516020612ee08339815191526020526020610b706024356040600020612d0c565b905460405160039290921b1c6001600160a01b03168152f35b3461029a57602036600319011261029a576001600160a01b03610baa61207a565b1660005260026020526020604060002054604051908152f35b3461029a57600036600319011261029a573360009081527f0ac8cc3d209806126662940717264973110c39045b305f6ba49613325a615e09602052604090205460ff1615610c9257610c13612795565b600160ff19600080516020613000833981519152541617600080516020613000833981519152557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a2586020604051338152a16040514281527f80170b5fcdd2bf1e0660ef4b8851f86685f64d41b1a19de1471947ece8725aac60203392a2005b63e2517d3f60e01b60005233600452600080516020612f2083398151915260245260446000fd5b3461029a57600036600319011261029a5760005460405160a09190911c6001600160401b03168152602090f35b3461029a57604036600319011261029a57610d0a610d02612064565b60043561236c565b906102966040519283928361209a565b3461029a57604036600319011261029a57610d3361207a565b336000908152600080516020612f60833981519152602052604090205460ff161580610e08575b6103ce576001600160a01b03166000818152600160205260409020805460e01c60ff1660038110156103b8576001036103a757805460ff60e01b198116600160e11b1782556001919091018054600160401b600160801b03191642604090811b600160401b600160801b0316919091179091555160243581526001600160a01b0390911691907fc0499cc07ed9d734deec6857802d3f0fa8d5afaf79a7008beb8ba7bef62a271b90602090a3005b50336001600160a01b0382161415610d5a565b3461029a57600036600319011261029a57602060405160048152f35b3461029a57602036600319011261029a57610e506120b6565b6000546001600160a01b031633036106125763ffffffff8116908115610ea757600080516020612fa083398151915291610ea263ffffffff926005549284198416176005556040519384931683612233565b0390a1005b6338f3377360e21b60005260046000fd5b3461029a57600036600319011261029a57602060ff60008051602061300083398151915254166040519015158152f35b3461029a57602036600319011261029a57610f0161207a565b6000546001600160a01b0381169033829003610612576001600160a01b038316928315610f64573b15610f53576001600160a01b03191682176000908155600080516020612f808339815191529080a3005b636f7c43f160e01b60005260046000fd5b63e6c4247b60e01b60005260046000fd5b3461029a57606036600319011261029a57610f8e61207a565b610f96612064565b610f9e61218f565b91610fa7612795565b6001600160a01b031690338290036103ce57816000526001602052604060002060ff815460e01c1660038110156103b857600114611090578160209161100f867ff223dc085722c94c84dcf67427e225799be616382a2a484d378f8921c69a20339587612c43565b80546001600160a01b0319166001600160a01b038316178155611032868261239f565b6001810180546001600160801b031916426001600160401b0390811691909117909155815460ff60e01b1916600160e01b179091556001600160a01b03919091166000818152600284526040908190208690555195909116855293a3005b639d2c8fdf60e01b60005260046000fd5b3461029a57602036600319011261029a576001600160a01b036110c261207a565b166000526001602052604060002060ff60008051602061300083398151915254161580611115575b602091816110fe575b506040519015158152f35b5460a01c6001600160401b031642109050826110f3565b5060ff815460e01c169060038210156103b857906001146110ea565b3461029a57600036600319011261029a577f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316300361118a576020604051600080516020612f408339815191528152f35b63703e46dd60e11b60005260046000fd5b3461029a57600036600319011261029a576000546040516001600160a01b039091168152602090f35b3461029a57602036600319011261029a57600435604060008281526004602052209081549160018060a01b03831692831590811561129e575b5061128d57336000908152600080516020612f60833981519152602052604090205460ff161580611283575b611272578061124563fffffffe61124b935460a01c16826122e3565b8261269b565b7fa5ffbdba01b15df97334e34ad816b9986b6057a5ddc97aba93b7e8ccd21759ed600080a3005b630a606ec360e11b60005260046000fd5b5082331415611229565b6360eb6c2360e01b60005260046000fd5b6001915060a01c1615846111fd565b604036600319011261029a576112c161207a565b602435906001600160401b03821161029a573660238301121561029a578160040135906112ed82612174565b916112fb6040519384612151565b8083526020830193366024838301011161029a57816000926024602093018737840101526001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001630811490811561156c575b5061118a576000546001600160a01b03163303610612576001600160a01b038116928315610f6457813b1561155b5730841461154c57600080516020612f4083398151915254846113a36121ed565b7f6ea8b34d59b2818d3f37a08dddaa06f5886b9c20c907b36f03ca6528e106e86f6113d9604051926040845260408401906121c8565b4260208401526001600160a01b038516929081900390a36040516352d1902d60e01b8152602081600481895afa60009181611518575b506114295785634c9c8ce360e01b60005260045260246000fd5b9081600080516020612f408339815191528793036115045750833b156114ef576001600160a01b0319168117600080516020612f40833981519152557fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b600080a28251156114d4576000809161069b945190845af43d156114cc573d916114af83612174565b926114bd6040519485612151565b83523d6000602085013e612e7e565b606091612e7e565b505050346114de57005b63b398979f60e01b60005260046000fd5b50634c9c8ce360e01b60005260045260246000fd5b632a87526960e21b60005260045260246000fd5b9091506020813d602011611544575b8161153460209383612151565b8101031261029a5751908761140f565b3d9150611527565b614e8d60eb1b60005260046000fd5b632e07c4bd60e11b60005260046000fd5b600080516020612f40833981519152546001600160a01b03161415905084611354565b3461029a57602036600319011261029a576004356115ab612795565b6115cd6115b7826127e0565b9190600263ffffffff825460a01c1617906122e3565b6001600160a01b0316907fc2713e691344add4705edc62a0ee5aede95ba66ad68f97316efef9cb50644edd600080a3005b3461029a57600036600319011261029a57336000908152600080516020612f60833981519152602052604090205460ff1615806116e1575b6116d0576000805160206130008339815191525460ff8116156116bf5760ff1916600080516020613000833981519152557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa6020604051338152a16040514281527f107553d8191d85b405879cf752997865edd48d94e20bda4dd27223c94b31a7cc60203392a2005b638dfc202b60e01b60005260046000fd5b63659a07b360e11b60005260046000fd5b506000546001600160a01b0316331415611636565b3461029a57604036600319011261029a5761029661171d611715612064565b600435612306565b604093919351938493846120dc565b3461029a57604036600319011261029a57611745612064565b336001600160a01b038216036117615761069b90600435612751565b63334bd91960e11b60005260046000fd5b3461029a57602036600319011261029a57600435604060008281526004602052209081549160018060a01b038316928315908115611837575b5061128d57336000908152600080516020612f60833981519152602052604090205460ff16158061182d575b61127257806117f363fffffff7611806935460a01c16826122e3565b80546001600160e01b031681558261269b565b7f054490ec6650e07db9b97a06ea31d44cebd44b390c9975a380055e1b4d3cac21600080a3005b50823314156117d7565b6008915060a01c1615846117ab565b3461029a57604036600319011261029a5761069b600435611865612064565b90611872610691826122c2565b612709565b3461029a57602036600319011261029a576004356118c161189782612629565b91906118ad63fffffffb825460a01c16826122e3565b805463ffffffff60c01b191681558361269b565b6001600160a01b0316907f09cb4ec44cdef8489412844b9682f87f7900758fa2bd7e039113e9125e538e0f600080a3005b3461029a57602036600319011261029a57600435604060008281526004602052209081549160018060a01b0383169283159081156119a4575b5061128d57336000908152600080516020612f60833981519152602052604090205460ff16158061199a575b611272578061124563fffffffd611973935460a01c16826122e3565b7fb390ab029eab314bd18190ebe73d7e5c1c336beaa5c83ac22578378dc9ccc405600080a3005b5082331415611957565b6002915060a01c16158461192b565b3461029a57602036600319011261029a5760206119d16004356122c2565b604051908152f35b3461029a57604036600319011261029a5761029661171d6119f8612064565b60043561224a565b3461029a57604036600319011261029a57600435611a1c6120c9565b63ffffffff600554169063ffffffff811691808310908115611ac8575b5061049b57611a4783612629565b909263ffffffff845460c01c16809260018060a01b03163314159182611abd575b5050611aac57611a98827e8a218591d4362499c38c38eb1c12e7a7cc97a9068818d1fe6046a42ba4a5ba94612210565b611aa760405192839283612233565b0390a2005b634e80a40760e11b60005260046000fd5b111590508186611a68565b90501584611a39565b3461029a57602036600319011261029a57611aea6120b6565b6000805160206130208339815191525460ff8160401c16908115611bca575b50611bb957600080516020613020833981519152805460026001600160401b0319821681179092556000546001600160481b031990911690911791906001600160a01b031633036106125763ffffffff168015610ea757604081600080516020612fa08339815191529263ffffffff196005541617600555815190600082526020820152a160008051602061302083398151915255600080516020612f00833981519152602060405160028152a1005b63f92ee8a960e01b60005260046000fd5b60026001600160401b03919091161015905082611b09565b3461029a5760a036600319011261029a57611bfb61207a565b611c03612064565b906044356001600160a01b03811680820361029a576064356001600160a01b0381169182820361029a576084356001600160a01b038116949085900361029a5760008051602061302083398151915254604081901c60ff161596906001600160401b031680159081611f80575b6001149081611f76575b159081611f6d575b50611bb95760008051602061302083398151915280546001600160401b031916600117905586611f48575b611cb5612acc565b611cbd612acc565b611cc5612acc565b611ccd612acc565b6001600160a01b038116908115610f64578315610f64578515610f64576001600160a01b038916988915610f64573b15610f5357858414611f375762aa36a746148015611f2c575b8015611f21575b1580611f0f575b610f5357611d32906000612afa565b9081611ec8575b5015611e0d57611d5790600080516020612fe0833981519152612afa565b9081611e73575b5015611e0d57611d7c90600080516020612f20833981519152612afa565b9081611e1e575b5015611e0d57600080546001600160a01b031916841781556040519390600080516020612f808339815191528180a38015610f6457803b15610f5357600380546001600160a01b031916919091179055611dd957005b600080516020613020833981519152805460ff60401b1916905560018152600080516020612f0083398151915290602090a1005b63cf5a8e3360e01b60005260046000fd5b600080516020612f20833981519152600052600080516020612ee0833981519152602052611e6c907ffff5b43478fa6840382eb63777e0da6941d320b940e3f70f0ea4780feff95827612d3a565b5084611d83565b600080516020612fe0833981519152600052600080516020612ee0833981519152602052611ec1907f32d31393d541a265984ec379cddd8b1fcbe5f2b0eb8ad81dddfead454f135eaa612d3a565b5086611d5e565b60008052600080516020612ee0833981519152602052611f08907f615f0f9e84155bea8cc509fe18befeb1baf65611e38a6ba60964480fb29dfd44612d3a565b5088611d39565b50823b1580611d235750843b15611d23565b50617a694614611d1c565b506105394614611d15565b638135316560e01b60005260046000fd5b600080516020613020833981519152805460ff60401b1916600160401b179055611cad565b90501589611c82565b303b159150611c7a565b889150611c70565b3461029a57604036600319011261029a57610296611fbc611fa7612064565b600435600052600460205260406000206123c8565b611fc581612090565b60405191818392158361209a565b3461029a57600036600319011261029a57602063ffffffff60055416604051908152f35b3461029a57602036600319011261029a576004359063ffffffff60e01b821680920361029a57602091635a05180f60e01b8114908115612039575b5015158152f35b637965db0b60e01b811491508115612053575b5083612032565b6301ffc9a760e01b1490508361204c565b602435906001600160a01b038216820361029a57565b600435906001600160a01b038216820361029a57565b600811156103b857565b9015158152604081019291906020906120b283612090565b0152565b6004359063ffffffff8216820361029a57565b6024359063ffffffff8216820361029a57565b91604091949363ffffffff916060850196151585526120fa81612090565b602085015216910152565b60a081019081106001600160401b0382111761212057604052565b634e487b7160e01b600052604160045260246000fd5b608081019081106001600160401b0382111761212057604052565b601f909101601f19168101906001600160401b0382119082101761212057604052565b6001600160401b03811161212057601f01601f191660200190565b604435906001600160401b038216820361029a57565b60005b8381106121b85750506000910152565b81810151838201526020016121a8565b906020916121e1815180928185528580860191016121a5565b601f01601f1916010190565b604051906121fc604083612151565b60058252640322e312e360dc1b6020830152565b805463ffffffff60c01b191660c09290921b63ffffffff60c01b16919091179055565b63ffffffff91821681529116602082015260400190565b600052600460205261226160406000209182612485565b61226a81612090565b806122b857505460e01c63ffffffff60055416811580156122b0575b6122a35780821061229c57505b60019160009190565b9050612293565b5050600090600390600090565b508015612286565b6000929091508290565b600052600080516020612fc083398151915260205260016040600020015490565b805463ffffffff60a01b191660a09290921b63ffffffff60a01b16919091179055565b919091600052600460205261232060406000209283612511565b9161232a83612090565b826123625763ffffffff9192505460c01c1663ffffffff60055416811580156122b0576122a35780821061229c575060019160009190565b5060009190600090565b90612383916000526004602052604060002061259d565b61238c81612090565b8061239a5750600190600090565b600091565b8054600160a01b600160e01b03191660a09290921b600160a01b600160e01b0316919091179055565b60ff600080516020613000833981519152541661247e57546001600160a01b0381169081156124765760a01c6002161561246f5760005260016020526040600020549060ff8260e01c1660038110156103b857801561246757600214612460574260a083901c6001600160401b03161115612459576001600160a01b0390811691160361245457600090565b600790565b5050600690565b5050600590565b505050600490565b5050600390565b505050600290565b5050600190565b60ff600080516020613000833981519152541661247e57546001600160a01b0381169081156124765760a01c6008161561246f5760005260016020526040600020549060ff8260e01c1660038110156103b857801561246757600214612460574260a083901c6001600160401b03161115612459576001600160a01b0390811691160361245457600090565b60ff600080516020613000833981519152541661247e57546001600160a01b0381169081156124765760a01c6004161561246f5760005260016020526040600020549060ff8260e01c1660038110156103b857801561246757600214612460574260a083901c6001600160401b03161115612459576001600160a01b0390811691160361245457600090565b60ff600080516020613000833981519152541661247e57546001600160a01b0381169081156124765760a01c6001161561246f5760005260016020526040600020549060ff8260e01c1660038110156103b857801561246757600214612460574260a083901c6001600160401b03161115612459576001600160a01b0390811691160361245457600090565b6000908152600460205260409020805490916001600160a01b03821691821590811561268c575b5061128d57336000908152600080516020612f60833981519152602052604090205460ff161580612682575b61127257565b508133141561267c565b6004915060a01c161538612650565b905460a01c63ffffffff16156126ae5750565b600052600460205260006040812055565b6000818152600080516020612fc08339815191526020908152604080832033845290915290205460ff16156126f15750565b63e2517d3f60e01b6000523360045260245260446000fd5b6127138282612afa565b918261271e57505090565b6000918252600080516020612ee0833981519152602052604090912061274d916001600160a01b031690612d3a565b5090565b61275b8282612ba3565b918261276657505090565b6000918252600080516020612ee0833981519152602052604090912061274d916001600160a01b031690612dab565b60ff60008051602061300083398151915254166127ae57565b63d93c066560e01b60005260046000fd5b519064ffffffffff8216820361029a57565b519061ffff8216820361029a57565b8015612abb57600354604051638d34875560e01b8152600481018390529190600090839060249082906001600160a01b03165afa918215612aaf57600092612904575b5060808201516001600160a01b0316913383900361127257610120015161284981612090565b61285281612090565b600381149081156128ef575b81156128db575b506128ca5781600052600160205260ff60406000205460e01c1660038110156103b8576001036128b957600090815260046020526040902080546001600160a01b0319166001600160a01b03831617815591565b632e68d1d360e21b60005260046000fd5b63e9f6db8560e01b60005260046000fd5b600791506128e881612090565b1438612865565b90506128fa81612090565b600581149061285e565b90913d8082843e6129158184612151565b820191602081840312612a8f578051906001600160401b038211612a975701906101a082840312612a8c57604051926101a084016001600160401b03811185821017612a9b5760409081528351855260208085015190860152838101519085015260608301516001600160401b038111612a9757830181601f82011215612a97578051906129a282612174565b926129b06040519485612151565b82845260208383010111612a9357906129cf91602080850191016121a5565b606084015260808201516001600160a01b0381168103612a8f5760808401526129fa60a083016127bf565b60a0840152612a0b60c083016127bf565b60c0840152612a1c60e083016127d1565b60e0840152612a2e61010083016127bf565b610100840152610120820151906008821015612a8c5750612a7f9161018091610120850152612a6061014082016127bf565b610140850152612a7361016082016127d1565b610160850152016127bf565b6101808201529038612823565b80fd5b5080fd5b8380fd5b8280fd5b634e487b7160e01b83526041600452602483fd5b6040513d6000823e3d90fd5b637bb0b62160e01b60005260046000fd5b60ff6000805160206130208339815191525460401c1615612ae957565b631afcd79f60e31b60005260046000fd5b6000818152600080516020612fc0833981519152602090815260408083206001600160a01b038616845290915290205460ff16612b9c576000818152600080516020612fc0833981519152602090815260408083206001600160a01b0395909516808452949091528120805460ff19166001179055339291907f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d9080a4600190565b5050600090565b6000818152600080516020612fc0833981519152602090815260408083206001600160a01b038616845290915290205460ff1615612b9c576000818152600080516020612fc0833981519152602090815260408083206001600160a01b0395909516808452949091528120805460ff19169055339291907ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9080a4600190565b158015612cfb575b610f64576001600160a01b0316600090815260026020526040902054612cea576001600160401b031642811115612cd95760005460a01c6001600160401b03168015159182612cae575b5050612c9d57565b63e774e7b560e01b60005260046000fd5b909150428103908111612cc357113880612c95565b634e487b7160e01b600052601160045260246000fd5b63efa7aefd60e01b60005260046000fd5b633b53f64f60e21b60005260046000fd5b506001600160a01b03811615612c4b565b8054821015612d245760005260206000200190600090565b634e487b7160e01b600052603260045260246000fd5b6001810190826000528160205260406000205415600014612da3578054600160401b81101561212057612d8e612d77826001879401855584612d0c565b819391549060031b91821b91600019901b19161790565b90555491600052602052604060002055600190565b505050600090565b9060018201918160005282602052604060002054801515600014612e75576000198101818111612cc3578254600019810191908211612cc357818103612e3e575b50505080548015612e28576000190190612e068282612d0c565b8154906000199060031b1b191690555560005260205260006040812055600190565b634e487b7160e01b600052603160045260246000fd5b612e5e612e4e612d779386612d0c565b90549060031b1c92839286612d0c565b905560005283602052604060002055388080612dec565b50505050600090565b90612ea45750805115612e9357602081519101fd5b63d6bda27560e01b60005260046000fd5b81511580612ed6575b612eb5575090565b639996b31560e01b60009081526001600160a01b0391909116600452602490fd5b50803b15612ead56fec1f6fe24621ce81ec5827caf0253cadb74709b061630e6b55e82371705932000c7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d275027301df982f5215b4963a854cf9c73219df80cb6acd8f098189c9480c7bbc360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc07966f2ab141347034724e9b2a472c2f77f5cd745aeba27cacba797b8fcb708617dc5b1290f7495d7f8cc68476e6941aaf510598fa925d0d2720edc8805a846cd37bc77615afefc793aa17d75d4249a9b517ba91b0e54a49c9c4a44b3d7e228302dd7bc7dec4dceedda775e58dd541e08a116c6c53815c0bd028192f7b626800edcc084d3dcd65a1f7f23c65c46722faca6953d28e43150a467cf43e5c309238cd5ed15c6e187e77e9aee88184c21f4f2182ab5827cb3b7e07fbedcd63f03300f0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a00a164736f6c6343000822000a";
18
18
  static readonly abi: readonly [{
19
19
  readonly inputs: readonly [];
20
20
  readonly stateMutability: "nonpayable";
@@ -369,6 +369,41 @@ export declare class AgentDelegationRegistry__factory extends ContractFactory {
369
369
  }];
370
370
  readonly name: "AutoRepayEnabled";
371
371
  readonly type: "event";
372
+ }, {
373
+ readonly anonymous: false;
374
+ readonly inputs: readonly [{
375
+ readonly indexed: true;
376
+ readonly internalType: "bytes32";
377
+ readonly name: "positionId";
378
+ readonly type: "bytes32";
379
+ }, {
380
+ readonly indexed: true;
381
+ readonly internalType: "address";
382
+ readonly name: "borrower";
383
+ readonly type: "address";
384
+ }];
385
+ readonly name: "AutoWithdrawDisabled";
386
+ readonly type: "event";
387
+ }, {
388
+ readonly anonymous: false;
389
+ readonly inputs: readonly [{
390
+ readonly indexed: true;
391
+ readonly internalType: "bytes32";
392
+ readonly name: "positionId";
393
+ readonly type: "bytes32";
394
+ }, {
395
+ readonly indexed: true;
396
+ readonly internalType: "address";
397
+ readonly name: "borrower";
398
+ readonly type: "address";
399
+ }, {
400
+ readonly indexed: false;
401
+ readonly internalType: "uint32";
402
+ readonly name: "minWithdrawRatioBps";
403
+ readonly type: "uint32";
404
+ }];
405
+ readonly name: "AutoWithdrawEnabled";
406
+ readonly type: "event";
372
407
  }, {
373
408
  readonly anonymous: false;
374
409
  readonly inputs: readonly [{
@@ -619,6 +654,16 @@ export declare class AgentDelegationRegistry__factory extends ContractFactory {
619
654
  }];
620
655
  readonly stateMutability: "view";
621
656
  readonly type: "function";
657
+ }, {
658
+ readonly inputs: readonly [];
659
+ readonly name: "SCOPE_WITHDRAW";
660
+ readonly outputs: readonly [{
661
+ readonly internalType: "uint32";
662
+ readonly name: "";
663
+ readonly type: "uint32";
664
+ }];
665
+ readonly stateMutability: "view";
666
+ readonly type: "function";
622
667
  }, {
623
668
  readonly inputs: readonly [];
624
669
  readonly name: "UPGRADE_INTERFACE_VERSION";
@@ -764,6 +809,32 @@ export declare class AgentDelegationRegistry__factory extends ContractFactory {
764
809
  }];
765
810
  readonly stateMutability: "view";
766
811
  readonly type: "function";
812
+ }, {
813
+ readonly inputs: readonly [{
814
+ readonly internalType: "bytes32";
815
+ readonly name: "positionId";
816
+ readonly type: "bytes32";
817
+ }, {
818
+ readonly internalType: "address";
819
+ readonly name: "caller";
820
+ readonly type: "address";
821
+ }];
822
+ readonly name: "canWithdraw";
823
+ readonly outputs: readonly [{
824
+ readonly internalType: "bool";
825
+ readonly name: "ok";
826
+ readonly type: "bool";
827
+ }, {
828
+ readonly internalType: "enum IAgentDelegationRegistry.DenyReason";
829
+ readonly name: "reason";
830
+ readonly type: "uint8";
831
+ }, {
832
+ readonly internalType: "uint32";
833
+ readonly name: "effectiveFloorBps";
834
+ readonly type: "uint32";
835
+ }];
836
+ readonly stateMutability: "view";
837
+ readonly type: "function";
767
838
  }, {
768
839
  readonly inputs: readonly [];
769
840
  readonly name: "core";
@@ -804,6 +875,16 @@ export declare class AgentDelegationRegistry__factory extends ContractFactory {
804
875
  readonly outputs: readonly [];
805
876
  readonly stateMutability: "nonpayable";
806
877
  readonly type: "function";
878
+ }, {
879
+ readonly inputs: readonly [{
880
+ readonly internalType: "bytes32";
881
+ readonly name: "positionId";
882
+ readonly type: "bytes32";
883
+ }];
884
+ readonly name: "disableAutoWithdraw";
885
+ readonly outputs: readonly [];
886
+ readonly stateMutability: "nonpayable";
887
+ readonly type: "function";
807
888
  }, {
808
889
  readonly inputs: readonly [{
809
890
  readonly internalType: "bytes32";
@@ -838,6 +919,20 @@ export declare class AgentDelegationRegistry__factory extends ContractFactory {
838
919
  readonly outputs: readonly [];
839
920
  readonly stateMutability: "nonpayable";
840
921
  readonly type: "function";
922
+ }, {
923
+ readonly inputs: readonly [{
924
+ readonly internalType: "bytes32";
925
+ readonly name: "positionId";
926
+ readonly type: "bytes32";
927
+ }, {
928
+ readonly internalType: "uint32";
929
+ readonly name: "minWithdrawRatioBps";
930
+ readonly type: "uint32";
931
+ }];
932
+ readonly name: "enableAutoWithdraw";
933
+ readonly outputs: readonly [];
934
+ readonly stateMutability: "nonpayable";
935
+ readonly type: "function";
841
936
  }, {
842
937
  readonly inputs: readonly [{
843
938
  readonly internalType: "bytes32";
@@ -858,6 +953,10 @@ export declare class AgentDelegationRegistry__factory extends ContractFactory {
858
953
  readonly internalType: "uint32";
859
954
  readonly name: "minCollateralRatioBps";
860
955
  readonly type: "uint32";
956
+ }, {
957
+ readonly internalType: "uint32";
958
+ readonly name: "minWithdrawRatioBps";
959
+ readonly type: "uint32";
861
960
  }];
862
961
  readonly internalType: "struct IAgentDelegationRegistry.LoanGrant";
863
962
  readonly name: "";
@@ -27,26 +27,30 @@ export declare namespace IAgentDelegationRegistry {
27
27
  borrower: AddressLike;
28
28
  scopeBits: BigNumberish;
29
29
  minCollateralRatioBps: BigNumberish;
30
+ minWithdrawRatioBps: BigNumberish;
30
31
  };
31
32
  type LoanGrantStructOutput = [
32
33
  borrower: string,
33
34
  scopeBits: bigint,
34
- minCollateralRatioBps: bigint
35
+ minCollateralRatioBps: bigint,
36
+ minWithdrawRatioBps: bigint
35
37
  ] & {
36
38
  borrower: string;
37
39
  scopeBits: bigint;
38
40
  minCollateralRatioBps: bigint;
41
+ minWithdrawRatioBps: bigint;
39
42
  };
40
43
  }
41
44
  export interface AgentDelegationRegistryInterface extends Interface {
42
- getFunction(nameOrSignature: "DEFAULT_ADMIN_ROLE" | "EMERGENCY_PAUSE_ROLE" | "REGISTRAR_ROLE" | "SCOPE_MINT" | "SCOPE_RENEW" | "SCOPE_REPAY" | "UPGRADE_INTERFACE_VERSION" | "VERSION" | "adminModule" | "agentMintFloorMinBps" | "agentOf" | "canMint" | "canRenew" | "canRepay" | "core" | "disableAutoMint" | "disableAutoRenew" | "disableAutoRepay" | "enableAutoMint" | "enableAutoRenew" | "enableAutoRepay" | "getLoanGrant" | "getRoleAdmin" | "getRoleMember" | "getRoleMemberCount" | "getRoleMembers" | "grantRole" | "hasRole" | "initialize" | "initializeV2" | "isAgentActive" | "keyOfAgent" | "maxAgentTtl" | "pause" | "paused" | "proxiableUUID" | "registerAgent" | "renounceRole" | "revokeAgent" | "revokeRole" | "rotateAgent" | "setAdminModule" | "setAgentMintFloorMin" | "setMaxAgentTtl" | "setMintCollateralFloor" | "supportsInterface" | "unpause" | "upgradeToAndCall" | "userOfAgent"): FunctionFragment;
43
- getEvent(nameOrSignatureOrTopic: "AdminModuleUpdated" | "AgentMintFloorMinUpdated" | "AgentRegistered" | "AgentRevoked" | "AgentRotated" | "AutoMintDisabled" | "AutoMintEnabled" | "AutoRenewDisabled" | "AutoRenewEnabled" | "AutoRepayDisabled" | "AutoRepayEnabled" | "ContractPaused" | "ContractUnpaused" | "ContractUpgraded" | "Initialized" | "MaxAgentTtlUpdated" | "MintCollateralFloorUpdated" | "Paused" | "RoleAdminChanged" | "RoleGranted" | "RoleRevoked" | "Unpaused" | "Upgraded"): EventFragment;
45
+ getFunction(nameOrSignature: "DEFAULT_ADMIN_ROLE" | "EMERGENCY_PAUSE_ROLE" | "REGISTRAR_ROLE" | "SCOPE_MINT" | "SCOPE_RENEW" | "SCOPE_REPAY" | "SCOPE_WITHDRAW" | "UPGRADE_INTERFACE_VERSION" | "VERSION" | "adminModule" | "agentMintFloorMinBps" | "agentOf" | "canMint" | "canRenew" | "canRepay" | "canWithdraw" | "core" | "disableAutoMint" | "disableAutoRenew" | "disableAutoRepay" | "disableAutoWithdraw" | "enableAutoMint" | "enableAutoRenew" | "enableAutoRepay" | "enableAutoWithdraw" | "getLoanGrant" | "getRoleAdmin" | "getRoleMember" | "getRoleMemberCount" | "getRoleMembers" | "grantRole" | "hasRole" | "initialize" | "initializeV2" | "isAgentActive" | "keyOfAgent" | "maxAgentTtl" | "pause" | "paused" | "proxiableUUID" | "registerAgent" | "renounceRole" | "revokeAgent" | "revokeRole" | "rotateAgent" | "setAdminModule" | "setAgentMintFloorMin" | "setMaxAgentTtl" | "setMintCollateralFloor" | "supportsInterface" | "unpause" | "upgradeToAndCall" | "userOfAgent"): FunctionFragment;
46
+ getEvent(nameOrSignatureOrTopic: "AdminModuleUpdated" | "AgentMintFloorMinUpdated" | "AgentRegistered" | "AgentRevoked" | "AgentRotated" | "AutoMintDisabled" | "AutoMintEnabled" | "AutoRenewDisabled" | "AutoRenewEnabled" | "AutoRepayDisabled" | "AutoRepayEnabled" | "AutoWithdrawDisabled" | "AutoWithdrawEnabled" | "ContractPaused" | "ContractUnpaused" | "ContractUpgraded" | "Initialized" | "MaxAgentTtlUpdated" | "MintCollateralFloorUpdated" | "Paused" | "RoleAdminChanged" | "RoleGranted" | "RoleRevoked" | "Unpaused" | "Upgraded"): EventFragment;
44
47
  encodeFunctionData(functionFragment: "DEFAULT_ADMIN_ROLE", values?: undefined): string;
45
48
  encodeFunctionData(functionFragment: "EMERGENCY_PAUSE_ROLE", values?: undefined): string;
46
49
  encodeFunctionData(functionFragment: "REGISTRAR_ROLE", values?: undefined): string;
47
50
  encodeFunctionData(functionFragment: "SCOPE_MINT", values?: undefined): string;
48
51
  encodeFunctionData(functionFragment: "SCOPE_RENEW", values?: undefined): string;
49
52
  encodeFunctionData(functionFragment: "SCOPE_REPAY", values?: undefined): string;
53
+ encodeFunctionData(functionFragment: "SCOPE_WITHDRAW", values?: undefined): string;
50
54
  encodeFunctionData(functionFragment: "UPGRADE_INTERFACE_VERSION", values?: undefined): string;
51
55
  encodeFunctionData(functionFragment: "VERSION", values?: undefined): string;
52
56
  encodeFunctionData(functionFragment: "adminModule", values?: undefined): string;
@@ -55,13 +59,16 @@ export interface AgentDelegationRegistryInterface extends Interface {
55
59
  encodeFunctionData(functionFragment: "canMint", values: [BytesLike, AddressLike]): string;
56
60
  encodeFunctionData(functionFragment: "canRenew", values: [BytesLike, AddressLike]): string;
57
61
  encodeFunctionData(functionFragment: "canRepay", values: [BytesLike, AddressLike]): string;
62
+ encodeFunctionData(functionFragment: "canWithdraw", values: [BytesLike, AddressLike]): string;
58
63
  encodeFunctionData(functionFragment: "core", values?: undefined): string;
59
64
  encodeFunctionData(functionFragment: "disableAutoMint", values: [BytesLike]): string;
60
65
  encodeFunctionData(functionFragment: "disableAutoRenew", values: [BytesLike]): string;
61
66
  encodeFunctionData(functionFragment: "disableAutoRepay", values: [BytesLike]): string;
67
+ encodeFunctionData(functionFragment: "disableAutoWithdraw", values: [BytesLike]): string;
62
68
  encodeFunctionData(functionFragment: "enableAutoMint", values: [BytesLike, BigNumberish]): string;
63
69
  encodeFunctionData(functionFragment: "enableAutoRenew", values: [BytesLike]): string;
64
70
  encodeFunctionData(functionFragment: "enableAutoRepay", values: [BytesLike]): string;
71
+ encodeFunctionData(functionFragment: "enableAutoWithdraw", values: [BytesLike, BigNumberish]): string;
65
72
  encodeFunctionData(functionFragment: "getLoanGrant", values: [BytesLike]): string;
66
73
  encodeFunctionData(functionFragment: "getRoleAdmin", values: [BytesLike]): string;
67
74
  encodeFunctionData(functionFragment: "getRoleMember", values: [BytesLike, BigNumberish]): string;
@@ -96,6 +103,7 @@ export interface AgentDelegationRegistryInterface extends Interface {
96
103
  decodeFunctionResult(functionFragment: "SCOPE_MINT", data: BytesLike): Result;
97
104
  decodeFunctionResult(functionFragment: "SCOPE_RENEW", data: BytesLike): Result;
98
105
  decodeFunctionResult(functionFragment: "SCOPE_REPAY", data: BytesLike): Result;
106
+ decodeFunctionResult(functionFragment: "SCOPE_WITHDRAW", data: BytesLike): Result;
99
107
  decodeFunctionResult(functionFragment: "UPGRADE_INTERFACE_VERSION", data: BytesLike): Result;
100
108
  decodeFunctionResult(functionFragment: "VERSION", data: BytesLike): Result;
101
109
  decodeFunctionResult(functionFragment: "adminModule", data: BytesLike): Result;
@@ -104,13 +112,16 @@ export interface AgentDelegationRegistryInterface extends Interface {
104
112
  decodeFunctionResult(functionFragment: "canMint", data: BytesLike): Result;
105
113
  decodeFunctionResult(functionFragment: "canRenew", data: BytesLike): Result;
106
114
  decodeFunctionResult(functionFragment: "canRepay", data: BytesLike): Result;
115
+ decodeFunctionResult(functionFragment: "canWithdraw", data: BytesLike): Result;
107
116
  decodeFunctionResult(functionFragment: "core", data: BytesLike): Result;
108
117
  decodeFunctionResult(functionFragment: "disableAutoMint", data: BytesLike): Result;
109
118
  decodeFunctionResult(functionFragment: "disableAutoRenew", data: BytesLike): Result;
110
119
  decodeFunctionResult(functionFragment: "disableAutoRepay", data: BytesLike): Result;
120
+ decodeFunctionResult(functionFragment: "disableAutoWithdraw", data: BytesLike): Result;
111
121
  decodeFunctionResult(functionFragment: "enableAutoMint", data: BytesLike): Result;
112
122
  decodeFunctionResult(functionFragment: "enableAutoRenew", data: BytesLike): Result;
113
123
  decodeFunctionResult(functionFragment: "enableAutoRepay", data: BytesLike): Result;
124
+ decodeFunctionResult(functionFragment: "enableAutoWithdraw", data: BytesLike): Result;
114
125
  decodeFunctionResult(functionFragment: "getLoanGrant", data: BytesLike): Result;
115
126
  decodeFunctionResult(functionFragment: "getRoleAdmin", data: BytesLike): Result;
116
127
  decodeFunctionResult(functionFragment: "getRoleMember", data: BytesLike): Result;
@@ -306,6 +317,39 @@ export declare namespace AutoRepayEnabledEvent {
306
317
  type Log = TypedEventLog<Event>;
307
318
  type LogDescription = TypedLogDescription<Event>;
308
319
  }
320
+ export declare namespace AutoWithdrawDisabledEvent {
321
+ type InputTuple = [positionId: BytesLike, borrower: AddressLike];
322
+ type OutputTuple = [positionId: string, borrower: string];
323
+ interface OutputObject {
324
+ positionId: string;
325
+ borrower: string;
326
+ }
327
+ type Event = TypedContractEvent<InputTuple, OutputTuple, OutputObject>;
328
+ type Filter = TypedDeferredTopicFilter<Event>;
329
+ type Log = TypedEventLog<Event>;
330
+ type LogDescription = TypedLogDescription<Event>;
331
+ }
332
+ export declare namespace AutoWithdrawEnabledEvent {
333
+ type InputTuple = [
334
+ positionId: BytesLike,
335
+ borrower: AddressLike,
336
+ minWithdrawRatioBps: BigNumberish
337
+ ];
338
+ type OutputTuple = [
339
+ positionId: string,
340
+ borrower: string,
341
+ minWithdrawRatioBps: bigint
342
+ ];
343
+ interface OutputObject {
344
+ positionId: string;
345
+ borrower: string;
346
+ minWithdrawRatioBps: bigint;
347
+ }
348
+ type Event = TypedContractEvent<InputTuple, OutputTuple, OutputObject>;
349
+ type Filter = TypedDeferredTopicFilter<Event>;
350
+ type Log = TypedEventLog<Event>;
351
+ type LogDescription = TypedLogDescription<Event>;
352
+ }
309
353
  export declare namespace ContractPausedEvent {
310
354
  type InputTuple = [caller: AddressLike, timestamp: BigNumberish];
311
355
  type OutputTuple = [caller: string, timestamp: bigint];
@@ -505,6 +549,7 @@ export interface AgentDelegationRegistry extends BaseContract {
505
549
  SCOPE_MINT: TypedContractMethod<[], [bigint], "view">;
506
550
  SCOPE_RENEW: TypedContractMethod<[], [bigint], "view">;
507
551
  SCOPE_REPAY: TypedContractMethod<[], [bigint], "view">;
552
+ SCOPE_WITHDRAW: TypedContractMethod<[], [bigint], "view">;
508
553
  UPGRADE_INTERFACE_VERSION: TypedContractMethod<[], [string], "view">;
509
554
  VERSION: TypedContractMethod<[], [string], "view">;
510
555
  adminModule: TypedContractMethod<[], [string], "view">;
@@ -546,6 +591,20 @@ export interface AgentDelegationRegistry extends BaseContract {
546
591
  reason: bigint;
547
592
  }
548
593
  ], "view">;
594
+ canWithdraw: TypedContractMethod<[
595
+ positionId: BytesLike,
596
+ caller: AddressLike
597
+ ], [
598
+ [
599
+ boolean,
600
+ bigint,
601
+ bigint
602
+ ] & {
603
+ ok: boolean;
604
+ reason: bigint;
605
+ effectiveFloorBps: bigint;
606
+ }
607
+ ], "view">;
549
608
  core: TypedContractMethod<[], [string], "view">;
550
609
  disableAutoMint: TypedContractMethod<[
551
610
  positionId: BytesLike
@@ -562,6 +621,11 @@ export interface AgentDelegationRegistry extends BaseContract {
562
621
  ], [
563
622
  void
564
623
  ], "nonpayable">;
624
+ disableAutoWithdraw: TypedContractMethod<[
625
+ positionId: BytesLike
626
+ ], [
627
+ void
628
+ ], "nonpayable">;
565
629
  enableAutoMint: TypedContractMethod<[
566
630
  positionId: BytesLike,
567
631
  minCollateralRatioBps: BigNumberish
@@ -578,6 +642,12 @@ export interface AgentDelegationRegistry extends BaseContract {
578
642
  ], [
579
643
  void
580
644
  ], "nonpayable">;
645
+ enableAutoWithdraw: TypedContractMethod<[
646
+ positionId: BytesLike,
647
+ minWithdrawRatioBps: BigNumberish
648
+ ], [
649
+ void
650
+ ], "nonpayable">;
581
651
  getLoanGrant: TypedContractMethod<[
582
652
  positionId: BytesLike
583
653
  ], [
@@ -697,6 +767,7 @@ export interface AgentDelegationRegistry extends BaseContract {
697
767
  getFunction(nameOrSignature: "SCOPE_MINT"): TypedContractMethod<[], [bigint], "view">;
698
768
  getFunction(nameOrSignature: "SCOPE_RENEW"): TypedContractMethod<[], [bigint], "view">;
699
769
  getFunction(nameOrSignature: "SCOPE_REPAY"): TypedContractMethod<[], [bigint], "view">;
770
+ getFunction(nameOrSignature: "SCOPE_WITHDRAW"): TypedContractMethod<[], [bigint], "view">;
700
771
  getFunction(nameOrSignature: "UPGRADE_INTERFACE_VERSION"): TypedContractMethod<[], [string], "view">;
701
772
  getFunction(nameOrSignature: "VERSION"): TypedContractMethod<[], [string], "view">;
702
773
  getFunction(nameOrSignature: "adminModule"): TypedContractMethod<[], [string], "view">;
@@ -738,10 +809,25 @@ export interface AgentDelegationRegistry extends BaseContract {
738
809
  reason: bigint;
739
810
  }
740
811
  ], "view">;
812
+ getFunction(nameOrSignature: "canWithdraw"): TypedContractMethod<[
813
+ positionId: BytesLike,
814
+ caller: AddressLike
815
+ ], [
816
+ [
817
+ boolean,
818
+ bigint,
819
+ bigint
820
+ ] & {
821
+ ok: boolean;
822
+ reason: bigint;
823
+ effectiveFloorBps: bigint;
824
+ }
825
+ ], "view">;
741
826
  getFunction(nameOrSignature: "core"): TypedContractMethod<[], [string], "view">;
742
827
  getFunction(nameOrSignature: "disableAutoMint"): TypedContractMethod<[positionId: BytesLike], [void], "nonpayable">;
743
828
  getFunction(nameOrSignature: "disableAutoRenew"): TypedContractMethod<[positionId: BytesLike], [void], "nonpayable">;
744
829
  getFunction(nameOrSignature: "disableAutoRepay"): TypedContractMethod<[positionId: BytesLike], [void], "nonpayable">;
830
+ getFunction(nameOrSignature: "disableAutoWithdraw"): TypedContractMethod<[positionId: BytesLike], [void], "nonpayable">;
745
831
  getFunction(nameOrSignature: "enableAutoMint"): TypedContractMethod<[
746
832
  positionId: BytesLike,
747
833
  minCollateralRatioBps: BigNumberish
@@ -750,6 +836,12 @@ export interface AgentDelegationRegistry extends BaseContract {
750
836
  ], "nonpayable">;
751
837
  getFunction(nameOrSignature: "enableAutoRenew"): TypedContractMethod<[positionId: BytesLike], [void], "nonpayable">;
752
838
  getFunction(nameOrSignature: "enableAutoRepay"): TypedContractMethod<[positionId: BytesLike], [void], "nonpayable">;
839
+ getFunction(nameOrSignature: "enableAutoWithdraw"): TypedContractMethod<[
840
+ positionId: BytesLike,
841
+ minWithdrawRatioBps: BigNumberish
842
+ ], [
843
+ void
844
+ ], "nonpayable">;
753
845
  getFunction(nameOrSignature: "getLoanGrant"): TypedContractMethod<[
754
846
  positionId: BytesLike
755
847
  ], [
@@ -853,6 +945,8 @@ export interface AgentDelegationRegistry extends BaseContract {
853
945
  getEvent(key: "AutoRenewEnabled"): TypedContractEvent<AutoRenewEnabledEvent.InputTuple, AutoRenewEnabledEvent.OutputTuple, AutoRenewEnabledEvent.OutputObject>;
854
946
  getEvent(key: "AutoRepayDisabled"): TypedContractEvent<AutoRepayDisabledEvent.InputTuple, AutoRepayDisabledEvent.OutputTuple, AutoRepayDisabledEvent.OutputObject>;
855
947
  getEvent(key: "AutoRepayEnabled"): TypedContractEvent<AutoRepayEnabledEvent.InputTuple, AutoRepayEnabledEvent.OutputTuple, AutoRepayEnabledEvent.OutputObject>;
948
+ getEvent(key: "AutoWithdrawDisabled"): TypedContractEvent<AutoWithdrawDisabledEvent.InputTuple, AutoWithdrawDisabledEvent.OutputTuple, AutoWithdrawDisabledEvent.OutputObject>;
949
+ getEvent(key: "AutoWithdrawEnabled"): TypedContractEvent<AutoWithdrawEnabledEvent.InputTuple, AutoWithdrawEnabledEvent.OutputTuple, AutoWithdrawEnabledEvent.OutputObject>;
856
950
  getEvent(key: "ContractPaused"): TypedContractEvent<ContractPausedEvent.InputTuple, ContractPausedEvent.OutputTuple, ContractPausedEvent.OutputObject>;
857
951
  getEvent(key: "ContractUnpaused"): TypedContractEvent<ContractUnpausedEvent.InputTuple, ContractUnpausedEvent.OutputTuple, ContractUnpausedEvent.OutputObject>;
858
952
  getEvent(key: "ContractUpgraded"): TypedContractEvent<ContractUpgradedEvent.InputTuple, ContractUpgradedEvent.OutputTuple, ContractUpgradedEvent.OutputObject>;
@@ -888,6 +982,10 @@ export interface AgentDelegationRegistry extends BaseContract {
888
982
  AutoRepayDisabled: TypedContractEvent<AutoRepayDisabledEvent.InputTuple, AutoRepayDisabledEvent.OutputTuple, AutoRepayDisabledEvent.OutputObject>;
889
983
  "AutoRepayEnabled(bytes32,address)": TypedContractEvent<AutoRepayEnabledEvent.InputTuple, AutoRepayEnabledEvent.OutputTuple, AutoRepayEnabledEvent.OutputObject>;
890
984
  AutoRepayEnabled: TypedContractEvent<AutoRepayEnabledEvent.InputTuple, AutoRepayEnabledEvent.OutputTuple, AutoRepayEnabledEvent.OutputObject>;
985
+ "AutoWithdrawDisabled(bytes32,address)": TypedContractEvent<AutoWithdrawDisabledEvent.InputTuple, AutoWithdrawDisabledEvent.OutputTuple, AutoWithdrawDisabledEvent.OutputObject>;
986
+ AutoWithdrawDisabled: TypedContractEvent<AutoWithdrawDisabledEvent.InputTuple, AutoWithdrawDisabledEvent.OutputTuple, AutoWithdrawDisabledEvent.OutputObject>;
987
+ "AutoWithdrawEnabled(bytes32,address,uint32)": TypedContractEvent<AutoWithdrawEnabledEvent.InputTuple, AutoWithdrawEnabledEvent.OutputTuple, AutoWithdrawEnabledEvent.OutputObject>;
988
+ AutoWithdrawEnabled: TypedContractEvent<AutoWithdrawEnabledEvent.InputTuple, AutoWithdrawEnabledEvent.OutputTuple, AutoWithdrawEnabledEvent.OutputObject>;
891
989
  "ContractPaused(address,uint256)": TypedContractEvent<ContractPausedEvent.InputTuple, ContractPausedEvent.OutputTuple, ContractPausedEvent.OutputObject>;
892
990
  ContractPaused: TypedContractEvent<ContractPausedEvent.InputTuple, ContractPausedEvent.OutputTuple, ContractPausedEvent.OutputObject>;
893
991
  "ContractUnpaused(address,uint256)": TypedContractEvent<ContractUnpausedEvent.InputTuple, ContractUnpausedEvent.OutputTuple, ContractUnpausedEvent.OutputObject>;
@@ -65,7 +65,8 @@ var SEPOLIA_DEPLOYMENT = {
65
65
  BitcoinWithdrawalAddressRegistry: "0x6376D392097F0A81e51BD83960A97EA20eaf1dbe",
66
66
  CarryAgentRegistry: "0x5595CB538D44E6Cf179D20364fD631D0477e69f7",
67
67
  AgentDelegationRegistry: "0x6AE7fc6bE0925126b9D25b1B7Ce5AD5d127ec025",
68
- DHAgentDelegate: "0xa5A14489ae883960df6E1463A41a47aBE9Ecc5AF"
68
+ DHAgentDelegate: "0xa5A14489ae883960df6E1463A41a47aBE9Ecc5AF",
69
+ AgentModuleFactory: "0x1Fd3aCa2C030Cf77ce28Af9694D3Bb3034ACa2E5"
69
70
  },
70
71
  upgraded: {
71
72
  PositionManager: {
@@ -360,7 +361,8 @@ var SEPOLIA_CONTRACTS = {
360
361
  BitcoinWithdrawalAddressRegistry: "0x6376D392097F0A81e51BD83960A97EA20eaf1dbe",
361
362
  CarryAgentRegistry: "0x5595CB538D44E6Cf179D20364fD631D0477e69f7",
362
363
  AgentDelegationRegistry: "0x6AE7fc6bE0925126b9D25b1B7Ce5AD5d127ec025",
363
- DHAgentDelegate: "0xa5A14489ae883960df6E1463A41a47aBE9Ecc5AF"
364
+ DHAgentDelegate: "0xa5A14489ae883960df6E1463A41a47aBE9Ecc5AF",
365
+ AgentModuleFactory: "0x1Fd3aCa2C030Cf77ce28Af9694D3Bb3034ACa2E5"
364
366
  };
365
367
  var MAINNET_DEPLOYMENT = {
366
368
  network: "mainnet",
@@ -597,7 +599,7 @@ var MAINNET_CONTRACTS = {
597
599
  var LOCALHOST_DEPLOYMENT = {
598
600
  network: "localhost",
599
601
  chainId: 1337,
600
- timestamp: "2026-07-20T19:45:58.514Z",
602
+ timestamp: "2026-07-23T17:13:42.777Z",
601
603
  deployer: "",
602
604
  contracts: {
603
605
  MessageHashBuilder: "0xa82fF9aFd8f496c3d6ac40E2a0F282E47488CFc9",
@@ -617,6 +619,30 @@ var LOCALHOST_DEPLOYMENT = {
617
619
  PositionManager: "0x851356ae760d987E095750cCeb3bC6014560891C",
618
620
  OperationAuthorizationRegistry: "0xc96304e3c037f81dA488ed9dEa1D8F2a48278a75",
619
621
  PKPValidation: "0xD0141E899a65C95a556fE2B27e5982A6DE7fDD7A"
622
+ },
623
+ latestEnv: {
624
+ UCD_TOKEN: "0xe7f1725E7734CE288F8367e1Bb143E90bb3F0512",
625
+ UCD_CONTROLLER: "0xCf7Ed3AccA5a467e9e704C703E8D87F634fB0Fc9",
626
+ POSITION_MANAGER: "0x851356ae760d987E095750cCeb3bC6014560891C",
627
+ PKP_VALIDATION_REGISTRY: "0xD0141E899a65C95a556fE2B27e5982A6DE7fDD7A",
628
+ PKP_VALIDATION_CID_V1: "0x12203af2054b0ab6e18d898ddfc7985593439fb82d22336133387c1169f98d3702ab",
629
+ PKP_VALIDATION_CID_V3: "0x12203af2054b0ab6e18d898ddfc7985593439fb82d22336133387c1169f98d3702ab",
630
+ PKP_ETH_ADDRESS: "0x406f6a9855de2f5577b1525f0600461f02859bd0",
631
+ OPERATION_AUTHORIZATION_REGISTRY: "0xc96304e3c037f81dA488ed9dEa1D8F2a48278a75",
632
+ UCD_MINT_VALIDATOR_ADDRESS: "0x406f6a9855de2f5577b1525f0600461f02859bd0",
633
+ UCD_MINT_VALIDATOR_VERSION: 1,
634
+ BTC_WITHDRAWAL_VALIDATOR_ADDRESS: "0x406f6a9855de2f5577b1525f0600461f02859bd0",
635
+ BTC_WITHDRAWAL_VALIDATOR_VERSION: 3,
636
+ UPDATE_BALANCE_VALIDATOR_ADDRESS: "0x406f6a9855de2f5577b1525f0600461f02859bd0",
637
+ UPDATE_BALANCE_VALIDATOR_VERSION: 1,
638
+ PROCESS_PAYMENT_VALIDATOR_ADDRESS: "0x406f6a9855de2f5577b1525f0600461f02859bd0",
639
+ PROCESS_PAYMENT_VALIDATOR_VERSION: 1,
640
+ EXTEND_POSITION_VALIDATOR_ADDRESS: "0x406f6a9855de2f5577b1525f0600461f02859bd0",
641
+ EXTEND_POSITION_VALIDATOR_VERSION: 1,
642
+ POSITION_MANAGER_CORE_MODULE: "0xB7f8BC63BbcaD18155201308C8f3540b07f84F5e",
643
+ LOAN_OPERATIONS_MANAGER_MODULE: "0x68B1D87F95878fE05B998F19b66F4baba5De1aed",
644
+ TERM_MANAGER_MODULE: "0x0DCd1Bf9A1b36cE34237eEaFef220932846BCD82",
645
+ COMMUNITY_MANAGER_MODULE: ""
620
646
  }
621
647
  };
622
648
  var LOCALHOST_CONTRACTS = {