@gvnrdao/dh-sdk 0.0.270 → 0.0.272

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.mjs CHANGED
@@ -3695,11 +3695,11 @@ var init_deployment_addresses = __esm({
3695
3695
  reason: "Shared upgrade script: LoanOperationsManagerModule implementation update"
3696
3696
  },
3697
3697
  UCDController: {
3698
- previousImplementation: "0x397dE5069270d90c1A62679e0496029D856Cb0ff",
3699
- newImplementation: "0x30d0458bE846f4C5D231242eB5a9e9Db68e7232F",
3700
- upgradedAt: "2026-05-17T18:41:48.528Z",
3698
+ previousImplementation: "0x30d0458bE846f4C5D231242eB5a9e9Db68e7232F",
3699
+ newImplementation: "0xF820098c311C736AB1793656044d95A0F6806B27",
3700
+ upgradedAt: "2026-06-02T11:35:00.000Z",
3701
3701
  upgradedBy: "0xF20986F02420EF443AE9BE5092FB8A4975cF3aA6",
3702
- reason: "Shared upgrade script: UCDController implementation update"
3702
+ reason: "H-1: UCDController v1.4.0 \u2014 liquidationManager slot + dailyBurnLimit exemption, __gap 28->27"
3703
3703
  },
3704
3704
  TermManagerModule: {
3705
3705
  previousImplementation: "0x309CE239A87ffFB31d4C720804e9908E482d4f10",
@@ -3758,9 +3758,9 @@ var init_deployment_addresses = __esm({
3758
3758
  reason: "Shared upgrade script: CollateralManagerModule implementation update"
3759
3759
  },
3760
3760
  LiquidationManagerModule: {
3761
- previousImplementation: "0x6bE9676b27e20D6ad4c901909d8a64585C47EC5A",
3762
- newImplementation: "0xD99bdF37a8C259bbfb394b4CdB03e76731Fa4904",
3763
- upgradedAt: "2026-05-18T21:18:37.255Z",
3761
+ previousImplementation: "0xD99bdF37a8C259bbfb394b4CdB03e76731Fa4904",
3762
+ newImplementation: "0xE1B3352A702acd16fDffe9C15646d723d112456F",
3763
+ upgradedAt: "2026-06-02T11:37:00.686Z",
3764
3764
  upgradedBy: "0xF20986F02420EF443AE9BE5092FB8A4975cF3aA6",
3765
3765
  reason: "Shared upgrade script: LiquidationManagerModule implementation update"
3766
3766
  },
@@ -31155,7 +31155,6 @@ var require_pkg_src = __commonJS({
31155
31155
  executeLitAction: () => executeLitAction,
31156
31156
  executePkpOperation: () => executePkpOperation,
31157
31157
  executePriceOracle: () => executePriceOracle,
31158
- executePriceOracleConsensus: () => executePriceOracleConsensus,
31159
31158
  executeVaultSnapshot: () => executeVaultSnapshot,
31160
31159
  generateSessionSignatures: () => generateSessionSignatures,
31161
31160
  generateSessionSignaturesWithCache: () => generateSessionSignaturesWithCache,
@@ -31341,30 +31340,30 @@ var require_pkg_src = __commonJS({
31341
31340
  }
31342
31341
  var DH_LIT_ACTIONS_CHIPOTLE3 = {
31343
31342
  authorizationDummy: {
31344
- cid: "QmXPh5RTReLqjqZDRNhgVKi1TWMJK2vS9QSRPkWPhLBQJN",
31343
+ cid: "QmeeYQ3zfDPKJQg3JG5p4TpxKHEnDRLXZbT79KxzwC3xjc",
31345
31344
  authorizedCidHex: cidToHex(
31346
- "QmXPh5RTReLqjqZDRNhgVKi1TWMJK2vS9QSRPkWPhLBQJN"
31345
+ "QmeeYQ3zfDPKJQg3JG5p4TpxKHEnDRLXZbT79KxzwC3xjc"
31347
31346
  ),
31348
31347
  name: "Authorization Dummy",
31349
31348
  description: "Production Authorization Dummy",
31350
31349
  version: "1.0.0",
31351
31350
  deployed: true,
31352
- deployedAt: 1776707622939,
31353
- size: 2026,
31354
- hash: "349d51aa096d56b394f82de75ed34cd4eef72719969f7e5fe584f4582b2745fa"
31351
+ deployedAt: 1780400482915,
31352
+ size: 2216,
31353
+ hash: "5f862b4635f2e04b033c4ff652addc017c3c0a325f81309a24d701c90e0bc950"
31355
31354
  },
31356
31355
  authorizationDummyB: {
31357
- cid: "QmQXTcAU9tr4YAVrzHujEJw9moJgM1o5gnJU2ojcvhigua",
31356
+ cid: "QmQHKDp5GDBp2XoStcm3SE6EvdJpK5RJ5ij4ZkQFn6dcMU",
31358
31357
  authorizedCidHex: cidToHex(
31359
- "QmQXTcAU9tr4YAVrzHujEJw9moJgM1o5gnJU2ojcvhigua"
31358
+ "QmQHKDp5GDBp2XoStcm3SE6EvdJpK5RJ5ij4ZkQFn6dcMU"
31360
31359
  ),
31361
31360
  name: "Authorization Dummy B",
31362
31361
  description: "Production Authorization Dummy B",
31363
31362
  version: "1.0.0",
31364
31363
  deployed: true,
31365
- deployedAt: 1776707632987,
31366
- size: 1695,
31367
- hash: "def4576ba6c382d145f996c4f950b5e39e58792415ee7fdd749e0d2bc61e8f0b"
31364
+ deployedAt: 1780400494581,
31365
+ size: 1885,
31366
+ hash: "d6eb8665fa4f1fe19b6a2bc81fbf729af68a1daf30117f40e37705381978a7ce"
31368
31367
  },
31369
31368
  pkpValidator: {
31370
31369
  cid: "QmTqsmXkjib7CRGFcEhmCs61Z3EZTaRPznaZDDLk5Wq9NX",
@@ -31385,30 +31384,30 @@ var require_pkg_src = __commonJS({
31385
31384
  }
31386
31385
  },
31387
31386
  btcTransactionSigner: {
31388
- cid: "QmX7A1R2JBa2aau87vLhpQ52aqVQeSM3nkJLAKPqn4HyJm",
31387
+ cid: "QmYMA6hLroPC2uGHeS1AxSz1xAwpZZRpGqZd3hQx3tf63o",
31389
31388
  authorizedCidHex: cidToHex(
31390
- "QmX7A1R2JBa2aau87vLhpQ52aqVQeSM3nkJLAKPqn4HyJm"
31389
+ "QmYMA6hLroPC2uGHeS1AxSz1xAwpZZRpGqZd3hQx3tf63o"
31391
31390
  ),
31392
31391
  name: "Btc Transaction Signer",
31393
31392
  description: "Production Btc Transaction Signer",
31394
31393
  version: "1.0.0",
31395
31394
  deployed: true,
31396
- deployedAt: 1779894172771,
31397
- size: 27660,
31398
- hash: "856da2d48ac2b76fc0d493a5a3df2decbf8e0fbbaff550996a0c48733bdd4660"
31395
+ deployedAt: 1780400513420,
31396
+ size: 27884,
31397
+ hash: "b7e4abec403555d85e2b0eaabed0fdd95640b5f0d068c67bba63afaa2cd200d0"
31399
31398
  },
31400
31399
  ucdMintValidator: {
31401
- cid: "QmNgE555xr7SGduoJWXk8oLMPiKCT3xYdDg7uCWLVp6Ewk",
31400
+ cid: "QmdfotNWFe9at78piu4zKqN1Hk6GDY97ofC8YWABoRxNTz",
31402
31401
  authorizedCidHex: cidToHex(
31403
- "QmNgE555xr7SGduoJWXk8oLMPiKCT3xYdDg7uCWLVp6Ewk"
31402
+ "QmdfotNWFe9at78piu4zKqN1Hk6GDY97ofC8YWABoRxNTz"
31404
31403
  ),
31405
31404
  name: "Ucd Mint Validator",
31406
31405
  description: "Production Ucd Mint Validator",
31407
31406
  version: "1.0.0",
31408
31407
  deployed: true,
31409
- deployedAt: 1779894180903,
31410
- size: 69530,
31411
- hash: "64e45e5a1918af2e375f12e5036757364080a15b640e8b7d76b513109c1e0b3c",
31408
+ deployedAt: 1780420101129,
31409
+ size: 67513,
31410
+ hash: "6918134d5daa56f01e3077e0716976103bd2d4ff3efddc8c2e388484953eb1fa",
31412
31411
  validatorWalletAddress: "0x36f3dd61c4c08a56d29ed2fd6d5f111b67b6a7a1",
31413
31412
  pkp: {
31414
31413
  publicKey: "0x041ab17cd91fc5c0b761eea6092d032807561b621b82c488826776e04a9158d61ba64d809a4729f0501289d980732cb06d8dfd06999dd9c8efd2f495dad78b31bb",
@@ -31416,17 +31415,17 @@ var require_pkg_src = __commonJS({
31416
31415
  }
31417
31416
  },
31418
31417
  processPaymentValidator: {
31419
- cid: "QmVmgq1zAuwdiyYsBx9LoUZFJetz2qC7EAjjwB55Yb3ZPJ",
31418
+ cid: "QmcMditbgi5wMzTxzwypKjM7PqPnmpmuUigw7hN8jkShiS",
31420
31419
  authorizedCidHex: cidToHex(
31421
- "QmVmgq1zAuwdiyYsBx9LoUZFJetz2qC7EAjjwB55Yb3ZPJ"
31420
+ "QmcMditbgi5wMzTxzwypKjM7PqPnmpmuUigw7hN8jkShiS"
31422
31421
  ),
31423
31422
  name: "Process Payment Validator",
31424
31423
  description: "Production Process Payment Validator",
31425
31424
  version: "1.0.0",
31426
31425
  deployed: true,
31427
- deployedAt: 1779894189375,
31428
- size: 65519,
31429
- hash: "cc3d394347166f9611bdb780f0dfcabea0d5e6fe21ebfddd1b481432e59e0d8d",
31426
+ deployedAt: 1780400542927,
31427
+ size: 64086,
31428
+ hash: "e4794a8fadfe03ecc7f25c834279a96f5342a5564e1851a7dca0e96d221f51a1",
31430
31429
  validatorWalletAddress: "0xc2ed5a59bd81eb4d1a19a0147b86ab69aa4c28ba",
31431
31430
  pkp: {
31432
31431
  publicKey: "0x04cfccb9b6c7addc79469c0e9fafebef4c70801302c62cdb26b610723a9b8527d23f98a40158c7340d83fd0e62d02b5ec74c12f7a86d98e8c6973b4811110f19ad",
@@ -31434,17 +31433,17 @@ var require_pkg_src = __commonJS({
31434
31433
  }
31435
31434
  },
31436
31435
  extendPositionValidator: {
31437
- cid: "QmSVjVq18N2mzhrjxCLs1UGFqAD4TLwG6CEGZzCFSb4GoZ",
31436
+ cid: "QmSCnZGHNCKNArhogT2xvGgfb58qhfM3APFWQmmkSA1jbz",
31438
31437
  authorizedCidHex: cidToHex(
31439
- "QmSVjVq18N2mzhrjxCLs1UGFqAD4TLwG6CEGZzCFSb4GoZ"
31438
+ "QmSCnZGHNCKNArhogT2xvGgfb58qhfM3APFWQmmkSA1jbz"
31440
31439
  ),
31441
31440
  name: "Extend Position Validator",
31442
31441
  description: "Production Extend Position Validator",
31443
31442
  version: "1.0.1",
31444
31443
  deployed: true,
31445
- deployedAt: 1779894197740,
31446
- size: 64948,
31447
- hash: "97cdc90fa70e4dfb3c64b073bb22257c3a696d3392e3cca3b4d7ae7304751845",
31444
+ deployedAt: 1780385632236,
31445
+ size: 63008,
31446
+ hash: "7e3ac42b2f26e2ab9a0801e2f94da8d9dbcf02a8bf27a78b954d79832d8eb1a7",
31448
31447
  validatorWalletAddress: "0xb3f4271c475887a86a2f21446f0968c30cc74c97",
31449
31448
  pkp: {
31450
31449
  publicKey: "0x04e52338f6a0c3362800f1a94c4c8f08be5030dde0fa217388c53d1c1a4790f4443c9f2886b2d2d8f4b75a9a156e9b028011b1a1cf7648da0e556aa980ec692836",
@@ -31452,17 +31451,17 @@ var require_pkg_src = __commonJS({
31452
31451
  }
31453
31452
  },
31454
31453
  btcWithdrawal: {
31455
- cid: "QmWBZxCTXP52fxakJRRQ4wiDwF9AS4E5RJXtRinnaShbtu",
31454
+ cid: "QmbsmTg6RuE6SGUkXqkcXSaWy99ydUtyLoFCBxiHuqpSKC",
31456
31455
  authorizedCidHex: cidToHex(
31457
- "QmWBZxCTXP52fxakJRRQ4wiDwF9AS4E5RJXtRinnaShbtu"
31456
+ "QmbsmTg6RuE6SGUkXqkcXSaWy99ydUtyLoFCBxiHuqpSKC"
31458
31457
  ),
31459
31458
  name: "Btc Withdrawal",
31460
31459
  description: "Production Btc Withdrawal",
31461
31460
  version: "1.0.0",
31462
31461
  deployed: true,
31463
- deployedAt: 1779894206894,
31464
- size: 76209,
31465
- hash: "ac5756d09e0a4f04513af18fdb6f3054ebd0bcb61bc51e8de7c98049b1a296c3",
31462
+ deployedAt: 1780400560069,
31463
+ size: 74485,
31464
+ hash: "dc62aa5f52c8ad3c86f8c99f9f08519d036e716554682ccb1f7227ca969df118",
31466
31465
  validatorWalletAddress: "0xbb137fbda353199e9419b698c57a742124d4987d",
31467
31466
  pkp: {
31468
31467
  publicKey: "0x043616787c5432415c24378c4ef48de2bcd6bb7b575b837e3cff09171802662da7105d79586c7659677a0ecbaddac4cce06cb2a11f69a16fa0c4d7002ac7d51a4d",
@@ -31470,17 +31469,17 @@ var require_pkg_src = __commonJS({
31470
31469
  }
31471
31470
  },
31472
31471
  liquidationValidator: {
31473
- cid: "QmcQAWj3nCsAbHkqBnBnk6LzqKEvVy7Ed5awnTQ9s9Nznq",
31472
+ cid: "QmVLyKW74S6jMeAssqsGmy7VwGRAHYzdUqLJBuAyvDMo99",
31474
31473
  authorizedCidHex: cidToHex(
31475
- "QmcQAWj3nCsAbHkqBnBnk6LzqKEvVy7Ed5awnTQ9s9Nznq"
31474
+ "QmVLyKW74S6jMeAssqsGmy7VwGRAHYzdUqLJBuAyvDMo99"
31476
31475
  ),
31477
31476
  name: "Liquidation Validator",
31478
31477
  description: "Production Liquidation Validator",
31479
31478
  version: "1.0.0",
31480
31479
  deployed: true,
31481
- deployedAt: 1779894215050,
31482
- size: 56114,
31483
- hash: "b0fcc1acfbf40e4e77de2d3327447e691b0e4a82fe0b34bd8d47d1c6051e9766",
31480
+ deployedAt: 1780385670005,
31481
+ size: 54164,
31482
+ hash: "cd32efc888d2808dfc81a75a6d97095f543efa12edb61c9070a4003c47d5f4a0",
31484
31483
  validatorWalletAddress: "0x1542f863ee0340f6a067573e80ae66dd9b3838fa",
31485
31484
  pkp: {
31486
31485
  publicKey: "0x041a241de58976c13e3d7ca5a18e494f7330151e3818706135d50176e78ffb673e58b11f0b67a87c73fade6c6b27d6e7a7377ea9f4c10bf31880f1d725f18cc6f8",
@@ -31488,17 +31487,17 @@ var require_pkg_src = __commonJS({
31488
31487
  }
31489
31488
  },
31490
31489
  priceOracle: {
31491
- cid: "QmYvwgGkFcvkqFB93oebMRDeqFgiHBAxRUcd6qKgktqXAf",
31490
+ cid: "QmVk6KHLn6jimvheCUaZ2emvp4nxot2SUkotnjfbeRXvyp",
31492
31491
  authorizedCidHex: cidToHex(
31493
- "QmYvwgGkFcvkqFB93oebMRDeqFgiHBAxRUcd6qKgktqXAf"
31492
+ "QmVk6KHLn6jimvheCUaZ2emvp4nxot2SUkotnjfbeRXvyp"
31494
31493
  ),
31495
31494
  name: "Price Oracle",
31496
31495
  description: "Production Price Oracle (Chipotle main+getPrivateKey)",
31497
31496
  version: "1.1.0",
31498
31497
  deployed: true,
31499
- deployedAt: 1779199116800,
31500
- size: 11179,
31501
- hash: "83102b059588020143ca5fbc0f651318fa1436914a6236e356758c8d31468a78",
31498
+ deployedAt: 1780385689501,
31499
+ size: 8354,
31500
+ hash: "adc4d5181b22b9ad7e788c7aa846c556585062fe3fadf7586a5c5ba38a25b535",
31502
31501
  validatorWalletAddress: "0x831ddf3048547b983efe3ccbbb35a45a53191651",
31503
31502
  pkp: {
31504
31503
  publicKey: "0x043beaa1da47875601a8d6f430b1438ee2d4732eefd06e5c63a474bbdaf9e7df1797b1b951e041b627c2bf839788164825324c9cbd1e2d6f740fdd4bff69b1900b",
@@ -31506,35 +31505,59 @@ var require_pkg_src = __commonJS({
31506
31505
  }
31507
31506
  },
31508
31507
  loanVaultBtcBalance: {
31509
- cid: "QmWqHBGzyhQB4Usfs47W7nGGYsCivJXFaJQCRqoPE8hy6i",
31508
+ cid: "QmUogHM5eg7J811HG4JBWQz6sGk2nDQctrM2wSUEfa2wQP",
31510
31509
  authorizedCidHex: cidToHex(
31511
- "QmWqHBGzyhQB4Usfs47W7nGGYsCivJXFaJQCRqoPE8hy6i"
31510
+ "QmUogHM5eg7J811HG4JBWQz6sGk2nDQctrM2wSUEfa2wQP"
31512
31511
  ),
31513
31512
  name: "Loan Vault Btc Balance",
31514
31513
  description: "Production Loan Vault Btc Balance",
31515
31514
  version: "1.0.0",
31516
31515
  deployed: true,
31517
- deployedAt: 1779894223069,
31518
- size: 45960,
31519
- hash: "7ee25d0058e7f9f50f7c97f966cbbea46c53e3e08891d0403b41223ddaf03a5f",
31516
+ deployedAt: 1780385701675,
31517
+ size: 44009,
31518
+ hash: "cd12e9ea2ca660675fa84ab199fb5f579f45003f137270b56569c528ef15f88a",
31520
31519
  validatorWalletAddress: "0x47feea74c8739d24b44faa67217f2f99970e15e7",
31521
31520
  pkp: {
31522
31521
  publicKey: "0x043616787c5432415c24378c4ef48de2bcd6bb7b575b837e3cff09171802662da7105d79586c7659677a0ecbaddac4cce06cb2a11f69a16fa0c4d7002ac7d51a4d",
31523
31522
  ethAddress: "0x7b9316cAA00B257F7CE30F7F6979bd6867BA9eE2"
31524
31523
  }
31525
31524
  },
31525
+ // btc-address-balance (Option B) — address-only signed total balance via
31526
+ // BitcoinProviderRegistry consensus (no positionId, no price). The deploy
31527
+ // step (deploy:chipotle:action) fills cid/authorizedCidHex/deployedAt/size/
31528
+ // hash + a DEDICATED validatorWalletAddress + pkp and flips deployed:true.
31529
+ // Requires BitcoinProviderRegistry.addAllowedCid(chainId, keccak256(utf8(cid)))
31530
+ // on each target chain (the action decrypts registry slots). No OAR entry.
31531
+ btcAddressBalance: {
31532
+ cid: "QmdF7eMxEc4UxFYPXhzyZ9dLkLeVwQNCfPrmirP1BGdSvT",
31533
+ authorizedCidHex: cidToHex(
31534
+ "QmdF7eMxEc4UxFYPXhzyZ9dLkLeVwQNCfPrmirP1BGdSvT"
31535
+ ),
31536
+ name: "Btc Address Balance",
31537
+ description: "Address-only signed total BTC balance via registry consensus (no positionId, no price)",
31538
+ version: "0.1.0",
31539
+ deployed: true,
31540
+ deployedAt: 1780425819676,
31541
+ size: 21664,
31542
+ hash: "89936009f1de066e41234de5a28a75ca31ce0b2ae9c7f47f299c995b8e112599",
31543
+ validatorWalletAddress: "0xf0bf5e3f864b87283a05d1e4a85ee0fa40493fb5",
31544
+ pkp: {
31545
+ publicKey: "0x0498cbb31facfa26e3ec83ccdabfe4fe341ca0282e0c3cb81da7113723b9726e1e49efa92165cc3faa66ced4454cea56dbab12267852d6525a55d7c4f128b912cd",
31546
+ ethAddress: "0xF0bF5e3f864B87283a05D1E4A85eE0FA40493fB5"
31547
+ }
31548
+ },
31526
31549
  alwaysSigner: {
31527
- cid: "QmXQjybSsdE19Da66to9Hh7X2dLFwpZPhjoqojxbpk7Nvs",
31550
+ cid: "Qmbf27pDimUe5GAdTYYd7poV7rHqUgctxtWd7HTui3Amig",
31528
31551
  authorizedCidHex: cidToHex(
31529
- "QmXQjybSsdE19Da66to9Hh7X2dLFwpZPhjoqojxbpk7Nvs"
31552
+ "Qmbf27pDimUe5GAdTYYd7poV7rHqUgctxtWd7HTui3Amig"
31530
31553
  ),
31531
31554
  name: "Always Signer",
31532
31555
  description: "Production Always Signer",
31533
31556
  version: "1.0.0",
31534
31557
  deployed: true,
31535
- deployedAt: 1776708176283,
31536
- size: 4143,
31537
- hash: "25007f80b4ed3169470bf617d403971136be431eb29dfb09f78afe2494bf0138"
31558
+ deployedAt: 1780400578692,
31559
+ size: 4333,
31560
+ hash: "1a7101c026a638f2f7cbdce02c6b8b0a55e44cc5cfc7e9440fe029b5c5be693e"
31538
31561
  },
31539
31562
  ethersVersionProbe: {
31540
31563
  cid: "QmYEfBWgTYc1pPH6vqazNGfnShfMKCVeiwcXGrWgehqK5A",
@@ -32312,14 +32335,11 @@ ${errorReport}`);
32312
32335
  init_debug_logger();
32313
32336
  init_session_signature_cache();
32314
32337
  var import_ethers13 = require_lib2();
32315
- var ACTIVE_LOAN_LIQUIDATION_THRESHOLD_BPS = 13e3;
32316
32338
  var EXPIRED_LOAN_MIN_LIQUIDATION_THRESHOLD_BPS = 11e3;
32317
32339
  var GRACE_PERIOD_DAYS = 30;
32318
32340
  var SATOSHIS_PER_BITCOIN = 100000000n;
32319
32341
  var PRICE_ORACLE_DECIMALS = 100000000n;
32320
32342
  var UCD_TOKEN_DECIMALS = 1000000000000000000n;
32321
- var PRICE_ORACLE_OUTLIER_DEVIATION_THRESHOLD = 0.02;
32322
- var PRICE_ORACLE_DISPERSION_THRESHOLD = 0.05;
32323
32343
  var MAX_BTC_AMOUNT = 25e6 * 1e8;
32324
32344
  var UTXO_QUERY_MAX_RETRIES = 3;
32325
32345
  var UTXO_QUERY_RETRY_DELAY_MS = 500;
@@ -32403,7 +32423,7 @@ ${errorReport}`);
32403
32423
  }
32404
32424
  function calculateLiquidationThreshold(isExpired, daysIntoGracePeriod, activeLoanThresholdBps, maxExpiredThresholdBps) {
32405
32425
  if (!isExpired) {
32406
- return activeLoanThresholdBps ?? ACTIVE_LOAN_LIQUIDATION_THRESHOLD_BPS;
32426
+ return activeLoanThresholdBps;
32407
32427
  }
32408
32428
  const maxThreshold = maxExpiredThresholdBps ?? EXPIRED_LOAN_MIN_LIQUIDATION_THRESHOLD_BPS;
32409
32429
  const day = Math.min(daysIntoGracePeriod, GRACE_PERIOD_DAYS);
@@ -32671,7 +32691,7 @@ ${errorReport}`);
32671
32691
  positionId,
32672
32692
  positionState.vaultAddress
32673
32693
  ),
32674
- this.config.priceOracle.getBTCPriceConsensus()
32694
+ this.config.priceOracle.getBTCPrice()
32675
32695
  ]);
32676
32696
  const protocolParams = createProtocolParametersModule({
32677
32697
  termManagerAddress: this.config.termManagerAddress,
@@ -32777,7 +32797,7 @@ ${errorReport}`);
32777
32797
  true
32778
32798
  // Always skip UTXO validation for fast path
32779
32799
  ),
32780
- this.config.priceOracle.getBTCPriceConsensus()
32800
+ this.config.priceOracle.getBTCPrice()
32781
32801
  ]);
32782
32802
  const protocolParams = createProtocolParametersModule({
32783
32803
  termManagerAddress: this.config.termManagerAddress,
@@ -33079,7 +33099,7 @@ ${errorReport}`);
33079
33099
  *
33080
33100
  * @param positionId - Position to check
33081
33101
  * @param additionalDebt - Additional UCD debt to add
33082
- * @param requiredRatioBps - Required collateral ratio (e.g., 13000 for 130%)
33102
+ * @param requiredRatioBps - Required collateral ratio (e.g., 11000 for 110%)
33083
33103
  * @returns True if sufficient collateral exists
33084
33104
  */
33085
33105
  async hasSufficientCollateral(positionId, additionalDebt, requiredRatioBps) {
@@ -33840,27 +33860,23 @@ ${errorReport}`);
33840
33860
  static {
33841
33861
  this.ACTIVE_PROVIDER_NAMES = [
33842
33862
  "cryptocompare",
33843
- "coinbase",
33844
- "binance",
33845
33863
  "coinmarketcap",
33846
33864
  "coingecko"
33847
33865
  ];
33848
33866
  }
33849
33867
  static {
33850
- this.MIN_DISTINCT_PROVIDERS = 3;
33868
+ this.REQUIRED_PROVIDER_COUNT = 3;
33851
33869
  }
33852
33870
  /**
33853
33871
  * @param priceProvidersOrConfig - REQUIRED in production flows. An array of
33854
- * `{name, apiKey}` entries. Every provider needs an apiKey. Names are
33855
- * deduplicated so three entries with `name: "coingecko"` collapse to a
33856
- * single provider.
33872
+ * exactly 3 `{name, apiKey}` entries, one per locked provider. Every entry
33873
+ * needs an apiKey. Names are deduplicated so three entries with
33874
+ * `name: "coingecko"` collapse to a single provider — which then fails the
33875
+ * strict count check.
33857
33876
  * @param legacySources - Test-only back door. When supplied, the constructor
33858
33877
  * trusts the caller-supplied array verbatim and skips credential checks.
33859
- * This path is exercised exclusively by unit tests that inject in-process
33860
- * `fetchPrice` stubs.
33861
- * @param _mode - Ignored. Previously used to branch between dev / prod
33862
- * validation. The oracle no longer has a "dev" relaxation; the parameter
33863
- * is kept only for backward compatibility with existing call sites.
33878
+ * The strict count is still enforced (exactly 3).
33879
+ * @param _mode - Ignored. Retained for backward-compatible call sites.
33864
33880
  */
33865
33881
  constructor(priceProvidersOrConfig, legacySources, _mode) {
33866
33882
  if (legacySources && Array.isArray(legacySources)) {
@@ -33868,7 +33884,7 @@ ${errorReport}`);
33868
33884
  } else {
33869
33885
  if (!Array.isArray(priceProvidersOrConfig)) {
33870
33886
  throw new Error(
33871
- "Price oracle requires a priceProviders array \u2014 defaults and fallbacks have been removed. Pass 3 distinct {name, apiKey} entries from the supported set: " + _PriceOracleModule.ACTIVE_PROVIDER_NAMES.join(", ")
33887
+ `Price oracle requires a priceProviders array \u2014 defaults and fallbacks have been removed. Pass exactly ${_PriceOracleModule.REQUIRED_PROVIDER_COUNT} distinct {name, apiKey} entries from the locked set: ` + _PriceOracleModule.ACTIVE_PROVIDER_NAMES.join(", ")
33872
33888
  );
33873
33889
  }
33874
33890
  this.sources = this.buildSources(priceProvidersOrConfig);
@@ -33877,39 +33893,31 @@ ${errorReport}`);
33877
33893
  this.validateProviderCount();
33878
33894
  }
33879
33895
  /**
33880
- * Enforces the unconditional, mode-independent 3-provider rule.
33881
- *
33882
- * Every caller — mint, extend, withdraw, liquidate, payment, balance — must
33883
- * end up with at least {@link PriceOracleModule.MIN_DISTINCT_PROVIDERS}
33884
- * distinct sources. Any relaxation here re-opens the oracle-manipulation
33885
- * path flagged as H-5 in the audit.
33896
+ * Enforces strict 3-of-3. Any deviation re-opens the consensus-manipulation
33897
+ * path flagged as H-2 in the audit. There is no "≥3" or "3 of N" mode.
33886
33898
  */
33887
33899
  validateProviderCount() {
33888
- if (this.sources.length < _PriceOracleModule.MIN_DISTINCT_PROVIDERS) {
33900
+ if (this.sources.length !== _PriceOracleModule.REQUIRED_PROVIDER_COUNT) {
33889
33901
  throw new Error(
33890
- `Price oracle requires at least ${_PriceOracleModule.MIN_DISTINCT_PROVIDERS} eligible providers for consensus. Currently configured: ${this.sources.length} provider(s). Supported active providers: ${_PriceOracleModule.ACTIVE_PROVIDER_NAMES.join(", ")}`
33902
+ `Price oracle requires exactly ${_PriceOracleModule.REQUIRED_PROVIDER_COUNT} providers. Currently configured: ${this.sources.length} provider(s). Locked production set: ${_PriceOracleModule.ACTIVE_PROVIDER_NAMES.join(", ")}`
33891
33903
  );
33892
33904
  }
33893
33905
  }
33894
33906
  /**
33895
33907
  * Build price sources from the caller-supplied config.
33896
33908
  *
33897
- * Rules (all unconditional — there is no dev-mode relaxation):
33898
- * - Every entry must be a supported provider name.
33909
+ * Rules (all unconditional):
33910
+ * - Exactly 3 entries reject fewer and reject more.
33911
+ * - Every entry must be a supported provider name from the locked set.
33899
33912
  * - Every entry must carry an `apiKey`.
33900
- * - Duplicates by `name` are rejected outright. Three CoinGecko entries
33901
- * with different keys are still "one provider" from a risk standpoint
33902
- * and do not satisfy the distinct-source requirement.
33903
- * - The final set must contain at least 3 distinct providers.
33913
+ * - Duplicates by `name` are rejected outright.
33904
33914
  *
33905
- * Throws as soon as any rule is violated — silently dropping an invalid
33906
- * entry would let the caller think consensus was achieved while the oracle
33907
- * was actually running on a smaller / weaker pool.
33915
+ * Throws as soon as any rule is violated.
33908
33916
  */
33909
33917
  buildSources(priceProviders) {
33910
- if (priceProviders.length === 0) {
33918
+ if (priceProviders.length !== _PriceOracleModule.REQUIRED_PROVIDER_COUNT) {
33911
33919
  throw new Error(
33912
- "priceProviders must be a non-empty array of 3 distinct providers, each with an apiKey."
33920
+ `priceProviders must contain exactly ${_PriceOracleModule.REQUIRED_PROVIDER_COUNT} entries. Received: ${priceProviders.length}. Locked production set: ${_PriceOracleModule.ACTIVE_PROVIDER_NAMES.join(", ")}`
33913
33921
  );
33914
33922
  }
33915
33923
  const sources = [];
@@ -33922,35 +33930,16 @@ ${errorReport}`);
33922
33930
  const name = provider.name.toLowerCase();
33923
33931
  if (!_PriceOracleModule.ACTIVE_PROVIDER_NAMES.includes(name)) {
33924
33932
  throw new Error(
33925
- `Unsupported price provider "${provider.name}". Supported: ${_PriceOracleModule.ACTIVE_PROVIDER_NAMES.join(", ")}`
33933
+ `Unsupported price provider "${provider.name}". Locked production set: ${_PriceOracleModule.ACTIVE_PROVIDER_NAMES.join(", ")}`
33926
33934
  );
33927
33935
  }
33928
33936
  if (seen.has(name)) {
33929
33937
  throw new Error(
33930
- `Duplicate price provider "${name}" \u2014 the oracle requires 3 DISTINCT providers so a single upstream failure or manipulation cannot compromise consensus. Use 3 different provider names from: ${_PriceOracleModule.ACTIVE_PROVIDER_NAMES.join(", ")}`
33938
+ `Duplicate price provider "${name}" \u2014 the oracle requires ${_PriceOracleModule.REQUIRED_PROVIDER_COUNT} DISTINCT providers so a single upstream failure or manipulation cannot compromise consensus. Use ${_PriceOracleModule.REQUIRED_PROVIDER_COUNT} different provider names from: ${_PriceOracleModule.ACTIVE_PROVIDER_NAMES.join(", ")}`
33931
33939
  );
33932
33940
  }
33933
33941
  seen.add(name);
33934
33942
  switch (name) {
33935
- case "binance":
33936
- if (!provider.apiKey) {
33937
- throw new Error(
33938
- "Binance provider requires an apiKey"
33939
- );
33940
- }
33941
- sources.push(
33942
- this.createBinanceSource(
33943
- provider.apiKey,
33944
- priority++
33945
- )
33946
- );
33947
- break;
33948
- case "coinbase":
33949
- if (!provider.apiKey) {
33950
- throw new Error("Coinbase provider requires an apiKey");
33951
- }
33952
- sources.push(this.createCoinbaseSource(provider.apiKey, priority++));
33953
- break;
33954
33943
  case "cryptocompare":
33955
33944
  if (!provider.apiKey) {
33956
33945
  throw new Error("CryptoCompare provider requires an apiKey");
@@ -33981,12 +33970,7 @@ ${errorReport}`);
33981
33970
  throw new Error(`Unhandled provider: ${name}`);
33982
33971
  }
33983
33972
  }
33984
- if (sources.length < _PriceOracleModule.MIN_DISTINCT_PROVIDERS) {
33985
- throw new Error(
33986
- `Insufficient price providers: need at least ${_PriceOracleModule.MIN_DISTINCT_PROVIDERS} distinct entries, got ${sources.length}.`
33987
- );
33988
- }
33989
- return this.selectSampledSources(sources);
33973
+ return sources;
33990
33974
  }
33991
33975
  /**
33992
33976
  * Create CryptoCompare price source
@@ -34007,7 +33991,9 @@ ${errorReport}`);
34007
33991
  });
34008
33992
  clearTimeout(timeoutId);
34009
33993
  if (!res.ok) {
34010
- throw new Error(`HTTP ${res.status} ${res.statusText}`);
33994
+ throw new Error(
33995
+ `CryptoCompare HTTP ${res.status} ${res.statusText}`
33996
+ );
34011
33997
  }
34012
33998
  return await res.json();
34013
33999
  } catch (error2) {
@@ -34039,7 +34025,7 @@ ${errorReport}`);
34039
34025
  * Create shared fetch helper with timeout
34040
34026
  * LIT runtime rejects custom User-Agent headers
34041
34027
  */
34042
- createFetchJson() {
34028
+ createFetchJson(providerName) {
34043
34029
  return async (url, headers) => {
34044
34030
  const controller = new AbortController();
34045
34031
  const timeoutMs = 5e3;
@@ -34050,7 +34036,9 @@ ${errorReport}`);
34050
34036
  signal: controller.signal
34051
34037
  });
34052
34038
  if (!res.ok) {
34053
- throw new Error(`HTTP ${res.status} ${res.statusText}`);
34039
+ throw new Error(
34040
+ `${providerName} HTTP ${res.status} ${res.statusText}`
34041
+ );
34054
34042
  }
34055
34043
  return await res.json();
34056
34044
  } finally {
@@ -34058,27 +34046,18 @@ ${errorReport}`);
34058
34046
  }
34059
34047
  };
34060
34048
  }
34061
- selectSampledSources(sources) {
34062
- return [...sources].sort((a, b2) => a.name.toLowerCase().localeCompare(b2.name.toLowerCase())).slice(0, 3).map((s, idx) => ({ ...s, priority: idx + 1 }));
34063
- }
34064
34049
  /**
34065
34050
  * Create CoinGecko price source.
34066
34051
  *
34067
34052
  * CoinGecko's public endpoint has no authentication, but we intentionally
34068
34053
  * require the caller to supply either a Demo (`x-cg-demo-api-key`) or Pro
34069
- * (`x-cg-pro-api-key`) key. Reasons:
34070
- * - An authenticated call has a predictable rate limit and per-key quota,
34071
- * so node-level retries won't silently drop under load.
34072
- * - The key identifies the Diamond Hands tenant, making ETL/abuse
34073
- * traceable and revokable.
34074
- * - It keeps the same "every provider needs a credential" invariant
34075
- * across all supported providers (removes a special case).
34054
+ * (`x-cg-pro-api-key`) key.
34076
34055
  */
34077
34056
  createCoinGeckoSource(apiKey, priority) {
34078
34057
  if (!apiKey) {
34079
34058
  throw new Error("createCoinGeckoSource requires an apiKey");
34080
34059
  }
34081
- const fetchJson = this.createFetchJson();
34060
+ const fetchJson = this.createFetchJson("CoinGecko");
34082
34061
  return {
34083
34062
  name: "CoinGecko",
34084
34063
  fetchPrice: async () => {
@@ -34098,61 +34077,8 @@ ${errorReport}`);
34098
34077
  priority
34099
34078
  };
34100
34079
  }
34101
- /**
34102
- * Create Binance price source. Requires apiKey.
34103
- *
34104
- * The public `/ticker/price` endpoint does not require a secret; only the
34105
- * API key is sent as `X-MBX-APIKEY` for per-key rate limiting and
34106
- * revokability.
34107
- */
34108
- createBinanceSource(apiKey, priority) {
34109
- if (!apiKey) {
34110
- throw new Error("createBinanceSource requires an apiKey");
34111
- }
34112
- const fetchJson = this.createFetchJson();
34113
- return {
34114
- name: "Binance",
34115
- fetchPrice: async () => {
34116
- const url = new URL("https://api.binance.com/api/v3/ticker/price");
34117
- url.searchParams.set("symbol", "BTCUSDT");
34118
- const data = await fetchJson(url.toString(), {
34119
- "X-MBX-APIKEY": apiKey
34120
- });
34121
- const price = Number(data?.price);
34122
- if (!Number.isFinite(price) || price <= 0) {
34123
- throw new Error("Invalid Binance price payload");
34124
- }
34125
- return price;
34126
- },
34127
- priority
34128
- };
34129
- }
34130
- /**
34131
- * Create Coinbase price source. Requires apiKey.
34132
- */
34133
- createCoinbaseSource(apiKey, priority) {
34134
- if (!apiKey) {
34135
- throw new Error("createCoinbaseSource requires an apiKey");
34136
- }
34137
- const fetchJson = this.createFetchJson();
34138
- return {
34139
- name: "Coinbase",
34140
- fetchPrice: async () => {
34141
- const data = await fetchJson(
34142
- "https://api.coinbase.com/v2/prices/BTC-USDT/spot",
34143
- { "CB-ACCESS-KEY": apiKey }
34144
- );
34145
- const price = Number(data?.data?.amount);
34146
- if (!Number.isFinite(price) || price <= 0) {
34147
- throw new Error("Invalid Coinbase price payload");
34148
- }
34149
- return price;
34150
- },
34151
- priority
34152
- };
34153
- }
34154
34080
  createCoinMarketCapSource(apiKey, priority) {
34155
- const fetchJson = this.createFetchJson();
34081
+ const fetchJson = this.createFetchJson("CoinMarketCap");
34156
34082
  return {
34157
34083
  name: "CoinMarketCap",
34158
34084
  fetchPrice: async () => {
@@ -34175,17 +34101,21 @@ ${errorReport}`);
34175
34101
  };
34176
34102
  }
34177
34103
  /**
34178
- * Get BTC price in USD with 8 decimals
34104
+ * Get BTC price in USD with 8 decimals.
34179
34105
  *
34180
- * CRITICAL OPTIMIZATION: Queries all sources in parallel with Promise.race()
34181
- * All three providers must resolve and agree within 1% tolerance.
34182
- * Returns the median price.
34106
+ * Strict 3-of-3: queries all sources in parallel; if any one fails, the whole
34107
+ * call fails (no fallback). All three prices must lie within 1% of each other
34108
+ * (`(hi - lo) / lo <= 0.01`). Returns the median of the three.
34109
+ *
34110
+ * This is the only signed-price path in the codebase. The previously-exposed
34111
+ * `getBTCPriceConsensus()` (with outlier filtering + lenient survivor median)
34112
+ * was removed in the H-2 fix.
34183
34113
  */
34184
34114
  async getBTCPrice() {
34185
34115
  const startTime = Date.now();
34186
- if (this.sources.length !== 3) {
34116
+ if (this.sources.length !== _PriceOracleModule.REQUIRED_PROVIDER_COUNT) {
34187
34117
  throw new Error(
34188
- `Price oracle requires exactly 3 providers. Currently configured: ${this.sources.length}`
34118
+ `Price oracle requires exactly ${_PriceOracleModule.REQUIRED_PROVIDER_COUNT} providers. Currently configured: ${this.sources.length}`
34189
34119
  );
34190
34120
  }
34191
34121
  const GLOBAL_TIMEOUT_MS = 8e3;
@@ -34199,9 +34129,17 @@ ${errorReport}`);
34199
34129
  const fetchAll = Promise.all(
34200
34130
  this.sources.map(async (source) => {
34201
34131
  const t = Date.now();
34202
- const priceUSD = await source.fetchPrice();
34203
- console.log(`[Price Oracle] \u2705 [+${Date.now() - t}ms] ${source.name}: $${priceUSD.toLocaleString()}`);
34204
- return priceUSD;
34132
+ try {
34133
+ const priceUSD = await source.fetchPrice();
34134
+ console.log(
34135
+ `[Price Oracle] \u2705 [+${Date.now() - t}ms] ${source.name}: $${priceUSD.toLocaleString()}`
34136
+ );
34137
+ return priceUSD;
34138
+ } catch (error2) {
34139
+ const cause = error2 instanceof Error ? error2.message : String(error2);
34140
+ console.log(`[Price Oracle] \u274C ${source.name}: ${cause}`);
34141
+ throw new Error(`${source.name} price fetch failed: ${cause}`);
34142
+ }
34205
34143
  })
34206
34144
  );
34207
34145
  const prices = await Promise.race([fetchAll, timeoutPromise]);
@@ -34222,91 +34160,6 @@ ${errorReport}`);
34222
34160
  console.log(`[Price Oracle] Price with 8 decimals: ${priceWith8Decimals}`);
34223
34161
  return priceWith8Decimals;
34224
34162
  }
34225
- /**
34226
- * Consensus across multiple sources with outlier detection
34227
- * Returns median price from valid sources after filtering outliers
34228
- *
34229
- * Master's Wisdom: Two-Path Validation
34230
- * 1. If ONE source is outlier (>2% from median) → FILTER it, continue with remaining
34231
- * 2. If ALL sources too dispersed (>5% spread) → REJECT all, throw error
34232
- *
34233
- * Logic Flow:
34234
- * 1. Calculate initial median from all sources
34235
- * 2. Filter individual outliers (>2% from median)
34236
- * 3. If outliers found: remove them, require minimum 2 sources remaining
34237
- * 4. Recalculate median from valid sources only
34238
- * 5. Check if remaining sources are too dispersed (max/min ratio > 1.05)
34239
- * 6. Return final median or throw appropriate error
34240
- */
34241
- async getBTCPriceConsensus() {
34242
- console.log(`[Price Oracle] Fetching BTC price with consensus...`);
34243
- const OUTLIER_DEVIATION = PRICE_ORACLE_OUTLIER_DEVIATION_THRESHOLD;
34244
- const DISPERSION_THRESHOLD = PRICE_ORACLE_DISPERSION_THRESHOLD;
34245
- const results = await Promise.allSettled(
34246
- this.sources.map(async (source) => {
34247
- const price = await source.fetchPrice();
34248
- return { source: source.name, price };
34249
- })
34250
- );
34251
- const successful = results.filter((r) => r.status === "fulfilled").map((r) => r.value);
34252
- if (successful.length === 0) {
34253
- throw new Error("No price sources returned data");
34254
- }
34255
- console.log(
34256
- `[Price Oracle] Got prices from ${successful.length}/${this.sources.length} sources:`
34257
- );
34258
- successful.forEach((s) => {
34259
- console.log(` ${s.source}: $${s.price.toLocaleString()}`);
34260
- });
34261
- const prices = successful.map((s) => s.price);
34262
- prices.sort((a, b2) => a - b2);
34263
- const initialMedian = prices[Math.floor(prices.length / 2)];
34264
- const minPrice = prices[0];
34265
- const maxPrice = prices[prices.length - 1];
34266
- const dispersionRatio = maxPrice / minPrice;
34267
- const validPrices = successful.filter((s) => {
34268
- const deviation = Math.abs(s.price - initialMedian) / initialMedian;
34269
- return deviation <= OUTLIER_DEVIATION;
34270
- });
34271
- if (dispersionRatio > 1 + DISPERSION_THRESHOLD && validPrices.length === successful.length) {
34272
- throw new Error(
34273
- `Price consensus failed: sources too dispersed (${((dispersionRatio - 1) * 100).toFixed(1)}% spread)`
34274
- );
34275
- }
34276
- if (validPrices.length < successful.length) {
34277
- const outliers = successful.filter(
34278
- (s) => !validPrices.find((v) => v.source === s.source)
34279
- );
34280
- console.log(`[Price Oracle] \u26A0\uFE0F Detected ${outliers.length} outlier(s):`);
34281
- outliers.forEach((o) => {
34282
- const deviation = Math.abs(o.price - initialMedian) / initialMedian;
34283
- console.log(
34284
- ` ${o.source}: $${o.price.toLocaleString()} (${(deviation * 100).toFixed(1)}% deviation)`
34285
- );
34286
- });
34287
- if (validPrices.length < 2) {
34288
- throw new Error(
34289
- "Price consensus failed: insufficient valid sources after outlier removal"
34290
- );
34291
- }
34292
- console.log(
34293
- `[Price Oracle] \u2705 Outliers filtered, continuing with ${validPrices.length} valid sources`
34294
- );
34295
- const validPricesOnly = validPrices.map((v) => v.price);
34296
- validPricesOnly.sort((a, b2) => a - b2);
34297
- const finalMedian = validPricesOnly[Math.floor(validPricesOnly.length / 2)];
34298
- console.log(
34299
- `[Price Oracle] \u2705 Consensus price (median): $${finalMedian.toLocaleString()}`
34300
- );
34301
- const priceCents2 = Math.round(finalMedian * 100);
34302
- return BigInt(priceCents2) * 1000000n;
34303
- }
34304
- console.log(
34305
- `[Price Oracle] \u2705 Consensus price (median): $${initialMedian.toLocaleString()}`
34306
- );
34307
- const priceCents = Math.round(initialMedian * 100);
34308
- return BigInt(priceCents) * 1000000n;
34309
- }
34310
34163
  };
34311
34164
  var VaultBalanceModule = class {
34312
34165
  constructor(config) {
@@ -34712,30 +34565,16 @@ ${errorReport}`);
34712
34565
  const oracle = params?.customSources ? new PriceOracleModule({}, params.customSources, params?.mode) : new PriceOracleModule(params?.priceProviders, void 0, params?.mode);
34713
34566
  return await oracle.getBTCPrice();
34714
34567
  }
34715
- async function executePriceOracleConsensus(params) {
34716
- global.Lit = {
34717
- Actions: {
34718
- broadcastAndCollect: async ({
34719
- name,
34720
- value
34721
- }) => {
34722
- return [value];
34723
- }
34724
- }
34725
- };
34726
- const oracle = params?.customSources ? new PriceOracleModule({}, params.customSources, params?.mode) : new PriceOracleModule(params?.priceProviders, void 0, params?.mode);
34727
- return await oracle.getBTCPriceConsensus();
34728
- }
34729
34568
  var NOLA_EXECUTORS = {
34730
34569
  /**
34731
34570
  * Vault Snapshot Executor
34732
- *
34571
+ *
34733
34572
  * Returns complete position health metrics:
34734
34573
  * - BTC balance (total, authorized, available)
34735
34574
  * - Collateral ratio and liquidation risk
34736
34575
  * - Term status (duration, expiry, grace period)
34737
34576
  * - Protocol parameters (fees, thresholds)
34738
- *
34577
+ *
34739
34578
  * Cost: FREE (no LIT Action execution)
34740
34579
  * Same data as LIT Action would return
34741
34580
  */
@@ -34747,39 +34586,20 @@ ${errorReport}`);
34747
34586
  },
34748
34587
  /**
34749
34588
  * Price Oracle Executor
34750
- *
34751
- * Returns current BTC price in USD with 8 decimals:
34752
- * - Queries CoinGecko, Binance, Coinbase in parallel
34753
- * - First successful response wins (fastest path)
34754
- * - Automatic fallback if primary source fails
34755
- * - Same price format as LIT Action validator
34756
- *
34589
+ *
34590
+ * Returns BTC price in USD (8 decimals) via strict 3-of-3 consensus:
34591
+ * - All 3 configured providers must respond
34592
+ * - Prices must agree within 1%
34593
+ * - Returns the median
34594
+ *
34757
34595
  * Cost: FREE (no LIT Action execution)
34758
34596
  * Use for: Price display, mint preview, collateral ratio calculation
34759
34597
  */
34760
34598
  priceOracle: {
34761
34599
  name: "price-oracle",
34762
- description: "Get current BTC price (fastest source)",
34600
+ description: "Get current BTC price (strict 3-of-3 consensus)",
34763
34601
  executor: executePriceOracle,
34764
- version: "1.0.0"
34765
- },
34766
- /**
34767
- * Price Oracle Consensus Executor
34768
- *
34769
- * Returns BTC price using multi-source consensus:
34770
- * - Queries ALL configured sources
34771
- * - Filters outliers (>2% deviation from median)
34772
- * - Returns median of valid sources
34773
- * - Rejects if sources too dispersed (>5% spread)
34774
- *
34775
- * Cost: FREE (no LIT Action execution)
34776
- * Use for: High-stakes operations requiring price validation
34777
- */
34778
- priceOracleConsensus: {
34779
- name: "price-oracle-consensus",
34780
- description: "Get BTC price with multi-source consensus",
34781
- executor: executePriceOracleConsensus,
34782
- version: "1.0.0"
34602
+ version: "2.0.0"
34783
34603
  }
34784
34604
  };
34785
34605
  }
@@ -34800,6 +34620,15 @@ function logNetworkConfig(level, message, ...args) {
34800
34620
  console[level](message, ...args);
34801
34621
  }
34802
34622
  }
34623
+ function readInitBackedEnv(name) {
34624
+ if (isNode2 && !isBrowser && typeof process !== "undefined" && process.env && typeof process.env[name] === "string") {
34625
+ const value = process.env[name].trim();
34626
+ if (value) {
34627
+ return value;
34628
+ }
34629
+ }
34630
+ return "";
34631
+ }
34803
34632
  function getBrowserSafeConfig() {
34804
34633
  if (isBrowser) {
34805
34634
  return {
@@ -34893,7 +34722,7 @@ function getSepoliaConfig() {
34893
34722
  });
34894
34723
  return {
34895
34724
  mode: "service",
34896
- serviceEndpoint: "https://emerald.gvnr.xyz",
34725
+ serviceEndpoint: readInitBackedEnv("LIT_OPS_ENDPOINT"),
34897
34726
  chainId: 11155111,
34898
34727
  name: "sepolia",
34899
34728
  rpcUrls: [],
@@ -34921,7 +34750,7 @@ function getSepoliaConfig() {
34921
34750
  positionDelegateRegistry: SEPOLIA_CONTRACTS.PositionDelegateRegistry || ""
34922
34751
  },
34923
34752
  subgraphs: {
34924
- diamondHandsUrl: "https://api.studio.thegraph.com/query/1747853/diamond-hands/version/latest"
34753
+ diamondHandsUrl: readInitBackedEnv("SUBGRAPH_URL")
34925
34754
  },
34926
34755
  debug: true
34927
34756
  };
@@ -107788,7 +107617,8 @@ function assertSafeServiceEndpoint(endpoint) {
107788
107617
  return;
107789
107618
  if (url.protocol === "http:") {
107790
107619
  const host = url.hostname.replace(/^\[|\]$/g, "");
107791
- const isLoopback = host === "localhost" || host === "127.0.0.1" || host === "::1" || host.endsWith(".localhost");
107620
+ const isLoopback = host === "localhost" || host === "127.0.0.1" || host === "::1" || // IPv4 loopback range 127.0.0.0/8 (numeric — not resolvable/hijackable).
107621
+ /^127\.\d{1,3}\.\d{1,3}\.\d{1,3}$/.test(host);
107792
107622
  if (isLoopback)
107793
107623
  return;
107794
107624
  throw new Error(
@@ -108183,16 +108013,25 @@ var LOGIN_TYPES = {
108183
108013
  { name: "nonce", type: "bytes32" }
108184
108014
  ]
108185
108015
  };
108186
- async function buildSignedLoginPayload(signer, chainId) {
108016
+ var LOGIN_TYPES_WITH_AUDIENCE = {
108017
+ DhServerLogin: [
108018
+ { name: "address", type: "address" },
108019
+ { name: "issuedAt", type: "uint256" },
108020
+ { name: "nonce", type: "bytes32" },
108021
+ { name: "audience", type: "string" }
108022
+ ]
108023
+ };
108024
+ async function buildSignedLoginPayload(signer, chainId, audience) {
108187
108025
  const address = await signer.getAddress();
108188
108026
  const message = {
108189
108027
  address,
108190
108028
  issuedAt: Math.floor(Date.now() / 1e3),
108191
- nonce: hexlify(randomBytes2(32))
108029
+ nonce: hexlify(randomBytes2(32)),
108030
+ ...audience ? { audience } : {}
108192
108031
  };
108193
108032
  const signature = await signer.signTypedData(
108194
108033
  buildLoginDomain(chainId),
108195
- LOGIN_TYPES,
108034
+ audience ? LOGIN_TYPES_WITH_AUDIENCE : LOGIN_TYPES,
108196
108035
  message
108197
108036
  );
108198
108037
  return { chainId, message, signature };
@@ -108260,7 +108099,11 @@ var ServerSession = class {
108260
108099
  return this.inFlight;
108261
108100
  this.inFlight = (async () => {
108262
108101
  try {
108263
- const payload = await buildSignedLoginPayload(this.signer, this.chainId);
108102
+ const payload = await buildSignedLoginPayload(
108103
+ this.signer,
108104
+ this.chainId,
108105
+ this.serviceEndpoint
108106
+ );
108264
108107
  const res = await this.fetchImpl(
108265
108108
  `${this.serviceEndpoint}/api/auth/login`,
108266
108109
  {
@@ -112320,16 +112163,17 @@ var BitcoinOperations = class {
112320
112163
  return { verified: false, reason: "not yet visible after retries" };
112321
112164
  }
112322
112165
  /**
112323
- * Get current BTC price using LIT Protocol price oracle
112166
+ * Get current BTC price using LIT Protocol price oracle.
112324
112167
  *
112325
- * Queries the decentralized price oracle via LIT Actions.
112326
- * Supports fast mode (single source) and full mode (consensus).
112168
+ * Strict 3-of-3: all three configured providers must respond within 1% of
112169
+ * each other, and the median is returned. The previous `mode: "fast" | "full"`
112170
+ * parameter (with single-source and lenient-consensus variants) was removed
112171
+ * in the H-2 audit fix — there is only one strict path now.
112327
112172
  *
112328
- * @param mode - Price fetch mode: "fast" (single source) or "full" (consensus)
112329
112173
  * @param sign - Whether to request PKP signature on the price
112330
112174
  * @returns BTC price result with timestamp and source
112331
112175
  */
112332
- async getPrice(mode = "fast", sign = false) {
112176
+ async getPrice(sign = false) {
112333
112177
  if (!this.litOps) {
112334
112178
  return failure(
112335
112179
  new SDKError({
@@ -112344,13 +112188,11 @@ var BitcoinOperations = class {
112344
112188
  async () => {
112345
112189
  if (this.config.debug) {
112346
112190
  log.info("\u{1F4B0} Fetching BTC price via LIT Protocol oracle", {
112347
- mode,
112348
112191
  sign,
112349
112192
  hasSigner: !!this.config.signer
112350
112193
  });
112351
112194
  }
112352
112195
  const result = await this.litOps.getBTCPrice({
112353
- mode,
112354
112196
  sign,
112355
112197
  signer: this.config.signer,
112356
112198
  pkpId: this.config.priceOraclePkpId,
@@ -112388,7 +112230,6 @@ var BitcoinOperations = class {
112388
112230
  try {
112389
112231
  const litOpsConfig = this.litOps?.getConfig?.() || {};
112390
112232
  log.error("\u274C BTC price oracle failed", {
112391
- mode,
112392
112233
  sign,
112393
112234
  errorMessage: error2 instanceof Error ? error2.message : String(error2),
112394
112235
  errorStack: error2 instanceof Error ? error2.stack : void 0,
@@ -112405,7 +112246,6 @@ var BitcoinOperations = class {
112405
112246
  severity: "MEDIUM" /* MEDIUM */,
112406
112247
  originalError: error2 instanceof Error ? error2 : new Error(String(error2)),
112407
112248
  context: {
112408
- mode,
112409
112249
  sign,
112410
112250
  serviceEndpoint: this.litOps?.getConfig?.()?.serviceEndpoint,
112411
112251
  network: this.litOps?.getConfig?.()?.network
@@ -114929,6 +114769,75 @@ var _abi = [
114929
114769
  name: "AdminModuleUpdated",
114930
114770
  type: "event"
114931
114771
  },
114772
+ {
114773
+ anonymous: false,
114774
+ inputs: [
114775
+ {
114776
+ indexed: true,
114777
+ internalType: "address",
114778
+ name: "caller",
114779
+ type: "address"
114780
+ },
114781
+ {
114782
+ indexed: false,
114783
+ internalType: "uint256",
114784
+ name: "timestamp",
114785
+ type: "uint256"
114786
+ }
114787
+ ],
114788
+ name: "ContractPaused",
114789
+ type: "event"
114790
+ },
114791
+ {
114792
+ anonymous: false,
114793
+ inputs: [
114794
+ {
114795
+ indexed: true,
114796
+ internalType: "address",
114797
+ name: "caller",
114798
+ type: "address"
114799
+ },
114800
+ {
114801
+ indexed: false,
114802
+ internalType: "uint256",
114803
+ name: "timestamp",
114804
+ type: "uint256"
114805
+ }
114806
+ ],
114807
+ name: "ContractUnpaused",
114808
+ type: "event"
114809
+ },
114810
+ {
114811
+ anonymous: false,
114812
+ inputs: [
114813
+ {
114814
+ indexed: true,
114815
+ internalType: "address",
114816
+ name: "oldImplementation",
114817
+ type: "address"
114818
+ },
114819
+ {
114820
+ indexed: true,
114821
+ internalType: "address",
114822
+ name: "newImplementation",
114823
+ type: "address"
114824
+ },
114825
+ {
114826
+ indexed: false,
114827
+ internalType: "string",
114828
+ name: "version",
114829
+ type: "string"
114830
+ },
114831
+ {
114832
+ indexed: false,
114833
+ internalType: "uint256",
114834
+ name: "timestamp",
114835
+ type: "uint256"
114836
+ }
114837
+ ],
114838
+ name: "ContractUpgraded",
114839
+ type: "event"
114840
+ },
114932
114841
  {
114933
114842
  anonymous: false,
114934
114843
  inputs: [
@@ -115532,6 +115441,19 @@ var _abi = [
115532
115441
  stateMutability: "view",
115533
115442
  type: "function"
115534
115443
  },
115444
+ {
115445
+ inputs: [],
115446
+ name: "VERSION",
115447
+ outputs: [
115448
+ {
115449
+ internalType: "string",
115450
+ name: "",
115451
+ type: "string"
115452
+ }
115453
+ ],
115454
+ stateMutability: "view",
115455
+ type: "function"
115456
+ },
115535
115457
  {
115536
115458
  inputs: [
115537
115459
  {
@@ -115981,6 +115903,11 @@ var _abi = [
115981
115903
  internalType: "address",
115982
115904
  name: "_admin",
115983
115905
  type: "address"
115906
+ },
115907
+ {
115908
+ internalType: "address",
115909
+ name: "_adminModule",
115910
+ type: "address"
115984
115911
  }
115985
115912
  ],
115986
115913
  name: "initialize",
@@ -116712,19 +116639,6 @@ var _abi = [
116712
116639
  stateMutability: "payable",
116713
116640
  type: "function"
116714
116641
  },
116715
- {
116716
- inputs: [],
116717
- name: "version",
116718
- outputs: [
116719
- {
116720
- internalType: "string",
116721
- name: "",
116722
- type: "string"
116723
- }
116724
- ],
116725
- stateMutability: "pure",
116726
- type: "function"
116727
- },
116728
116642
  {
116729
116643
  inputs: [
116730
116644
  {
@@ -116744,7 +116658,7 @@ var _abi = [
116744
116658
  type: "function"
116745
116659
  }
116746
116660
  ];
116747
- var _bytecode = "0x60a080604052346100ea57306080527ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a005460ff8160401c166100d9576002600160401b03196001600160401b03821601610073575b6040516145be90816100f0823960805181818161262901526127220152f35b6001600160401b0319166001600160401b039081177ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a005581527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d290602090a13880610054565b63f92ee8a960e01b60005260046000fd5b600080fdfe6080604052600436101561001257600080fd5b6000803560e01c8062f7fce9146135b457806301ffc9a714613543578063021d2893146134ea5780630871b206146134b1578063114249d214610b3a57806311d954f81461348857806313da31661461344f5780631d44a904146133a65780631f77bf651461336d578063248a9ca31461334e5780632b83cccd14612f1e5780632f2ff15d14612eec57806334bac37014612eb357806334e1812514612e7a57806336568abe14612e35578063373c86b614612dfc5780633f4ba83a14612d615780634373b57214612d385780634451e89b146129735780634ebd25a51461293a5780634f1ef286146126a75780635273b6f61461267e57806352d1902d1461261657806354fd4d50146125d7578063568fafca1461254957806359d5d02a146122805780635bc26aea1461224b5780635c975abb1461221b5780635ecc2708146120fd5780638456cb591461202e57806385c15d9a14611ff557806389d3ad0014611f2e5780638bff608e14611ef55780639010d07c14611ea257806390ad8b4014611e8657806391d1485414611e2d5780639b759bf714611dea5780639baf58d214611dcd5780639f1d0f5914611835578063a217fddf14611819578063a3246ad31461175c578063ad3cb1cc14611719578063b492fc691461161f578063b9f637af146113f4578063bf7d9119146113b5578063c0c53b8b14610ffd578063c4c5f62414610f4a578063c55f15ea14610f27578063ca15c87314610ef0578063ca2ce65d14610eb7578063cc1f8ffa14610e85578063cf46075e14610d7b578063d21a74ff14610d3e578063d2f8253614610d1b578063d547741f14610ce0578063d5d3f78b14610b73578063d66bd52414610b3a578063e1f1c4a714610b1d578063e1f3962c14610af1578063ec2f96fe14610acd578063eda5a26a146106d0578063f1a1eb841461068d578063f385116d14610654578063f77c47911461062d578063faaebd21146105f4578063facdfb5e14610454578063fc99bd9a146103435763fe32e7281461030857600080fd5b34610340576020366003190112610340576020906040906001600160a01b0361032f6136bb565b168152601283522054604051908152f35b80fd5b50346103405760403660031901126103405761035d6136bb565b6010546024359291906001600160a01b03163303610445576001600160a01b03168082526002602052604082205490929060ff16156104325780156104235782825260076020526040822054926103b48285613a34565b848110610414576001600160ff1b03811161040557600080516020614592833981519152604085968493846104029852600760205280838a205582519182526020820152a230903390613fa0565b80f35b630700fcb360e11b8452600484fd5b63446c8cc960e01b8452600484fd5b63162908e360e11b8252600482fd5b506024916374ed46ad60e01b8252600452fd5b6349db3bd360e01b8252600482fd5b50346103405760203660031901126103405761046e6136bb565b610476613c96565b6010546001600160a01b03163303610445576001600160a01b03168082526002602052604082205460ff16156105e257808252600760205260408220546040516370a0823160e01b8152306004820152602081602481865afa9081156105d75784916105a0575b5081811115610591576104f08282613846565b821590811561053c575b5050600080516020614592833981519152916040918486526007602052808387205582519182526020820152a260016000805160206145328339815191525580f35b612710810290808204612710149015171561057d576064840291848304606414171561057d571161056e5738806104fa565b63a73af74d60e01b8452600484fd5b634e487b7160e01b86526011600452602486fd5b61059b8183613846565b6104f0565b90506020813d6020116105cf575b816105bb60209383613750565b810103126105ca5751386104dd565b600080fd5b3d91506105ae565b6040513d86823e3d90fd5b6374ed46ad60e01b8252600452602490fd5b5034610340576020366003190112610340576020906040906001600160a01b0361061c6136bb565b168152600483522054604051908152f35b5034610340578060031936011261034057546040516001600160a01b039091168152602090f35b5034610340576020366003190112610340576020906040906001600160a01b0361067c6136bb565b168152600a83522054604051908152f35b5034610340576040366003190112610340576020906040906001600160a01b036106b56136bb565b16815260158352818120602435825283522054604051908152f35b503461034057610160366003190112610340576106eb6136bb565b906064356044356024356106fd6137ed565b9160a4359160c43560e43561010435916101243595610144359760018060a01b03601054163303610abe576001600160a01b038c16808c52600260205260408c2054909a9060ff16610aaa578a15610a9b578615610a8c576127108811610a72576103e88111610a5a5760ff82169c60128e118e8115610a4f575b50610a3b57803b15610a27578915610a13578a156109ff578261079a91613fe4565b841515806109f6575b6109df57851515806109d6575b6109bf578b9c602460208d9e9d604051928380926370a0823160e01b82523060048301525afa9c8d156109b3579c61097f575b506001600160ff1b038c11610970578a8d8f9760408f97838f918f8f8f8f90859f988f99879f966000805160206144d28339815191529f978b9f988f8d6000805160206144528339815191529f988e8e6109289b6000805160206144128339815191529f8f8f8487526002602052878720600160ff198254161790558487526003602052878720558386526004602052868620558285526006602052878686205582855260056020528585209060ff19825416179055818452600c6020528885852055818452600d6020528985852055818452600e6020528a85852055818452600f6020528b8585205581845260076020528484205582526012602052828220558d8152601360205220558a7f991d1ef1b5c0820d213328cba6682059e00a50e49c469a454eb3557e78eaf6668e80518b81528c6020820152a28c5198899889613a41565b0390a28151908b82526020820152a28151908782526020820152a28061094c578280f35b6040600080516020614592833981519152918151908582526020820152a281808280f35b63556e7a8160e01b8e5260048efd5b909b506020813d6020116109ab575b8161099b60209383613750565b810103126105ca57519a386107e3565b3d915061098e565b604051903d90823e3d90fd5b60448c858863dd85772b60e01b8352600452602452fd5b508386106107b0565b60448c8487637449915760e01b8352600452602452fd5b508285106107a3565b636835314760e11b8d52600160045260248dfd5b636835314760e11b8d5260048d905260248dfd5b63377e3f9960e21b8d5260048c905260248dfd5b63ca95039160e01b8d5260048e905260248dfd5b60069150108e610778565b631051834f60e11b8c526004526103e860245260448bfd5b63c1e9a14160e01b8c52600488905261271060245260448cfd5b63a2ec3a5560e01b8c5260048cfd5b63df407ac560e01b8c5260048cfd5b6317f4215b60e21b8c5260048b905260248cfd5b6349db3bd360e01b8b5260048bfd5b5034610340578060031936011261034057602060ff60015460a01c16604051908152f35b5034610340576020366003190112610340576020610b15610b106136bb565b613b79565b604051908152f35b503461034057806003193601126103405760206040516127108152f35b5034610340576020366003190112610340576020906040906001600160a01b03610b626136bb565b168152600783522054604051908152f35b503461034057602036600319011261034057610b8d6136bb565b6010546001600160a01b03163303610445576001600160a01b03168082526002602052604082205460ff16156105e2578082526007602052604082205480610cca575080825260026020526040822060ff1981541690558082526003602052816040812055808252600460205281604081205580825260056020526040822060ff198154169055808252600c602052816040812055808252600d602052816040812055808252600e602052816040812055808252600f602052816040812055808252600660205281604081205580825260076020526040822054818352600760205282604081205560405190827f3302a1b37f04242bb55603f5449e7ecd690a35eef08ba1353c48c20e2aae9cda8580a280610ca7578380f35b816040916000805160206145928339815191529352846020820152a23880808380f35b604492916376bc059760e11b8352600452602452fd5b503461034057604036600319011261034057610d17600435610d006136d1565b90610d12610d0d826138eb565b613e0c565b613e9e565b5080f35b5034610340578060031936011261034057602060ff600854166040519015158152f35b50346103405760203660031901126103405760209060ff906040906001600160a01b03610d696136bb565b16815260058452205416604051908152f35b503461034057602036600319011261034057610d956136bb565b610d9d613c96565b6010546001600160a01b03163303610445576001600160a01b03168082526002602052604082205460ff16156105e257808252600760205260408220546040516370a0823160e01b8152306004820152602081602481865afa9081156105d7578491610e45575b50600080516020614592833981519152916040918486526007602052808387205582519182526020820152a260016000805160206145328339815191525580f35b90506020813d602011610e7d575b81610e6060209383613750565b810103126105ca5751600080516020614592833981519152610e04565b3d9150610e53565b5034610340576040366003190112610340576020610ead610ea46136bb565b60243590613a7a565b6040519015158152f35b5034610340576020366003190112610340576020906040906001600160a01b03610edf6136bb565b168152601383522054604051908152f35b5034610340576020366003190112610340576040602091600435815260008051602061443283398151915283522054604051908152f35b50346103405780600319360112610340576020604051670de0b6b3a76400008152f35b503461034057604036600319011261034057610f646136bb565b6010546024359291906001600160a01b03163303610445576001600160a01b0316808252600760205260408220549290818410610fe65780600080516020614592833981519152604086610fbc866104029899613846565b84895260076020528289205583885260076020528188205482519182526020820152a23390613dd0565b5091604492633cb8e07360e01b8352600452602452fd5b5034610340576060366003190112610340576110176136bb565b61101f6136d1565b6044356001600160a01b038116918282036113b15760008051602061457283398151915254604081901c60ff161594906001600160401b0316801590816113a9575b600114908161139f575b159081611396575b506113875760008051602061457283398151915280546001600160401b031916600117905584611362575b6001600160a01b0316908115611353576001600160a01b0316908115611344578315611335576110cc61420e565b6110d461420e565b6110dc61420e565b6110e461420e565b6001600080516020614532833981519152556110fe61420e565b61110661420e565b85546001600160a01b0319908116919091178655600180549182168317905560405163313ce56760e01b8152909190602081600481855afa879181611304575b5061115a57633a24e95b60e11b8752600487fd5b6001600160a81b03199092161760a091821b60ff60a01b16176001819055901c60ff166006811415806112f9575b6112e7575061119781856140cc565b806112bf575b1561127a576111ba816000805160206145528339815191526140cc565b80611289575b1561127a576111dd906000805160206144928339815191526140cc565b9081611243575b5015611234576111f15780f35b60ff60401b19600080516020614572833981519152541660008051602061457283398151915255600080516020614472833981519152602060405160018152a180f35b63cf5a8e3360e01b8252600482fd5b61127390600080516020614492833981519152855260008051602061443283398151915260205260408520614254565b50386111e4565b63cf5a8e3360e01b8452600484fd5b60008051602061455283398151915285526000805160206144328339815191526020526112b98360408720614254565b506111c0565b8480526000805160206144328339815191526020526112e18360408720614254565b5061119d565b63167738cf60e21b8552600452602484fd5b506012811415611188565b61132791925060203d60201161132e575b61131f8183613750565b81019061391b565b9038611146565b503d611315565b630b5eba9f60e41b8652600486fd5b63c1ab6dc160e01b8652600486fd5b6336abb4df60e11b8652600486fd5b600080516020614572833981519152805460ff60401b1916600160401b17905561109e565b63f92ee8a960e01b8652600486fd5b90501538611073565b303b15915061106b565b869150611061565b8480fd5b50346103405760203660031901126103405760209060ff906040906001600160a01b036113e06136bb565b168152600284522054166040519015158152f35b5034610340576101203660031901126103405761140f6136bb565b60643591906044356024356114226137ed565b601054610104359660e4359260c4359260a43592906001600160a01b03163303611610576001600160a01b038816808a52600260205260408a205490989060ff16156115fc5786156115ed5761271088116115d3576103e882116115b95760ff8316906012821180156115af575b61159b578361149e91613fe4565b85151580611592575b61157b578a151580611572575b61155b579260008051602061441283398151915297969592828c95611555979460408e8e80825260036020528c8383205580825260046020528d838320558152600660205220558b8d52600560205260408d209060ff198254161790558a8c52600c6020528260408d20558a8c52600d6020528360408d20558a8c52600e6020528460408d20558a8c52600f6020528560408d205560405198899889613a41565b0390a280f35b60448a868d63dd85772b60e01b8352600452602452fd5b50848b106114b4565b60448a8588637449915760e01b8352600452602452fd5b508386106114a7565b63ca95039160e01b8b52600482905260248bfd5b5060068210611490565b631051834f60e11b8a5260048290526103e860245260448afd5b63c1e9a14160e01b8a52600488905261271060245260448afd5b63a2ec3a5560e01b8a5260048afd5b6374ed46ad60e01b8a52600489905260248afd5b6349db3bd360e01b8952600489fd5b5034610340576040366003190112610340576116396136bb565b6001600160a01b0316808252600260205260408220546024359060ff16156117055780156116f6576127106116bb604085670de0b6b3a76400006116aa6116c39688859a52600560205260ff8585205416908091601281106116d0575b5050888452600360205284842054906137fd565b0495815260046020522054846137fd565b048092613846565b9082519182526020820152f35b6116ef925060ff6116e36116e992613853565b16613864565b906137fd565b3880611696565b63162908e360e11b8352600483fd5b6374ed46ad60e01b83526004829052602483fd5b5034610340578060031936011261034057611758604080519061173c8183613750565b60058252640352e302e360dc1b602083015251918291826137a4565b0390f35b503461034057602036600319011261034057600435815260008051602061443283398151915260205260408120604051908160208254918281520190819285526020852090855b81811061180357505050826117b9910383613750565b604051928392602084019060208552518091526040840192915b8181106117e1575050500390f35b82516001600160a01b03168452859450602093840193909201916001016117d3565b82548452602090930192600192830192016117a3565b5034610340578060031936011261034057602090604051908152f35b503461034057611844366136f6565b91909261184f613c96565b611857613cd2565b338152600960205260408120544303611dab57338152600a602052600360408220541015611d9c57338152600a60205260408120611895815461390c565b90555b6001600160a01b0382168082526002602052604082205490929060ff16611cfb575b828252600260205260ff60408320541615610432578415610423578315611cec57828252600c60205260408220548510611cc757828252600e60205260408220548015611cb857808611611ca157508461191391613ee2565b6040516370a0823160e01b8152306004820152602081602481865afa908115611b61578291611c6f575b5061194a85303386613fa0565b6040516370a0823160e01b8152306004820152602081602481875afa908115611c6457908692918491611c2b575b509061198391613846565b10611c1c578181526007602052604081205461199f8582613a34565b818110611c0d576001600160ff1b038111611bfe5760408492600080516020614592833981519152928486526007602052808387205582519182526020820152a2818152600560205260ff604082205416849060128110611b9d575b50611a1c670de0b6b3a76400009184845260036020526040842054906137fd565b04908281526004602052611a42612710611a3a6040842054856137fd565b048093613846565b93808510611b85575080546001600160a01b0316803b15611b6c5781809160846040518094819363ae494fa160e01b83523360048401528a60248401528960448401528b60648401525af18015611b6157908291611b70575b505081611af9575b507fb3e2773606abfd36b5bd91394b3a54d1398336c65005baf7bf7a05efeffaf75b611adc60209560405191829133958842928561394f565b0390a3600160008051602061453283398151915255604051908152f35b80546001600160a01b0316803b15611b6c5781809160846040518094819363ae494fa160e01b83523060048401528860248401528960448401528160648401525af18015611b6157611b4c575b50611aa3565b611b57828092613750565b6103405780611b46565b6040513d84823e3d90fd5b5080fd5b81611b7a91613750565b610340578038611a9b565b6371c4efed60e01b8252600485905260245260449150fd5b611bad91506116e360ff91613853565b8015611bea5780600019048511611bdb57611a1c611bd4670de0b6b3a764000092876137fd565b91506119fb565b63035fc53d60e41b8252600482fd5b634e487b7160e01b82526012600452602482fd5b630700fcb360e11b8352600483fd5b63446c8cc960e01b8352600483fd5b639bfa3c1760e01b8152600490fd5b919250506020813d602011611c5c575b81611c4860209383613750565b810103126105ca5751859190611983611978565b3d9150611c3b565b6040513d85823e3d90fd5b90506020813d602011611c99575b81611c8a60209383613750565b810103126105ca57513861193d565b3d9150611c7d565b631d7f2ac360e01b83526004869052602452604482fd5b633b5db2f360e11b8352600483fd5b50908152600c6020526040812054630d54e9e160e01b82526004849052602452604490fd5b632cd84af360e01b8252600482fd5b60405163313ce56760e01b815291939291602081600481865afa859181611d7b575b50611d315763105482c760e21b8552600485fd5b93919293838352600560205260ff806040852054169116908103611d5557506118ba565b90506044928252600560205260ff604083205416631e43476360e11b8352600452602452fd5b611d9591925060203d60201161132e5761131f8183613750565b9038611d1d565b63a74c1c5f60e01b8152600490fd5b3381526009602052436040822055338152600a60205260016040822055611898565b503461034057806003193601126103405760206040516103e88152f35b5034610340576040366003190112610340576020906040906001600160a01b03611e126136bb565b16815260148352818120602435825283522054604051908152f35b5034610340576040366003190112610340576040611e496136d1565b9160043581526000805160206144f2833981519152602052209060018060a01b0316600052602052602060ff604060002054166040519015158152f35b5034610340578060031936011261034057602060405160648152f35b503461034057604036600319011261034057611edc602091600435815260008051602061443283398151915283526040602435912061423c565b905460405160039290921b1c6001600160a01b03168152f35b5034610340576020366003190112610340576020906040906001600160a01b03611f1d6136bb565b168152600983522054604051908152f35b503461034057604036600319011261034057611f486136bb565b60105460243591906001600160a01b03163303611fe6576001600160a01b0316908115611fd75760406000805160206144d28339815191529183855260136020528185205490848652601360205280838720558486526015602052828620438752602052828620548587526019602052838720558486526017602052438387205582519182526020820152a280f35b63df407ac560e01b8352600483fd5b6349db3bd360e01b8352600483fd5b5034610340576020366003190112610340576020906040906001600160a01b0361201d6136bb565b168152600383522054604051908152f35b503461034057806003193601126103405760008051602061449283398151915281526000805160206144f283398151915260209081526040808320336000908152925290205460ff16156120d857612084613cd2565b600160ff19600080516020614512833981519152541617600080516020614512833981519152557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a2586020604051338152a180f35b63e2517d3f60e01b815233600452600080516020614492833981519152602452604490fd5b5034610340576020366003190112610340576121176136bb565b6000805160206145728339815191525460ff8160401c16908115612203575b506121f45760008051602061457283398151915280546001600160481b0319166003600160401b011790558180526000805160206144f283398151915260209081526040808420336000908152925290205460ff16156121dc57612199906139d0565b60ff60401b19600080516020614572833981519152541660008051602061457283398151915255600080516020614472833981519152602060405160038152a180f35b63e2517d3f60e01b8252336004526024829052604482fd5b63f92ee8a960e01b8252600482fd5b60036001600160401b03919091161015905038612136565b5034610340578060031936011261034057602060ff60008051602061451283398151915254166040519015158152f35b5034610340576020366003190112610340576122656136bb565b6010546001600160a01b0316330361044557610402906139d0565b50346103405760603660031901126103405761229a6136bb565b6122a26136d1565b60105490926044359290916001600160a01b03163303610445576122c4613cd2565b6011546001600160a01b031691821561253a5760405163babcc53960e01b81526001600160a01b0386166004820181905293602090829060249082905afa908115611b615782916124ff575b50156124f05782156124e1576001546001600160a01b0392831692168203612431576040516370a0823160e01b8152306004820152602081602481865afa908115611b615782916123ff575b50935b84156123f05760001981036123ea5750835b84156123db578085116123c357505061238d8360209583613dd0565b7f0bf519e4b3821615dbdd874fa1a5fbb4bb651b4e6beabedd4ac318e770233b2c604080518581524287820152a3604051908152f35b630555ed4f60e31b8252600485905260245260449150fd5b632e11316f60e11b8252600482fd5b93612371565b63f09872eb60e01b8252600482fd5b90506020813d602011612429575b8161241a60209383613750565b810103126105ca57513861235c565b3d915061240d565b8181526002602052604081205460ff16156124cf576040516370a0823160e01b8152306004820152602081602481865afa908115611b6157829161249d575b5082825260076020526040822054808211156124955761248f91613846565b9361235f565b50508061248f565b90506020813d6020116124c7575b816124b860209383613750565b810103126105ca575138612470565b3d91506124ab565b60249163eef7849760e01b8252600452fd5b634e46966960e11b8152600490fd5b63133307bb60e21b8152600490fd5b90506020813d602011612532575b8161251a60209383613750565b81010312611b6c57518015158103611b6c5738612310565b3d915061250d565b630e048e7160e41b8152600490fd5b5034610340576020366003190112610340576125636136bb565b6010546001600160a01b03163303610445576001600160a01b031680156125c857601180546001600160a01b0319811683179091556001600160a01b03167f1e9c406f2707909cfd9f61e744f73bcab77e5997d063276f67883c5257d51cf08380a380f35b634e46966960e11b8252600482fd5b503461034057806003193601126103405761175860408051906125fa8183613750565b6005825264191719971960d91b602083015251918291826137a4565b50346103405780600319360112610340577f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316300361266f5760206040516000805160206144b28339815191528152f35b63703e46dd60e11b8152600490fd5b50346103405780600319360112610340576010546040516001600160a01b039091168152602090f35b506040366003190112610340576126bc6136bb565b602435906001600160401b038211612936573660238301121561293657816004013590836126e983613789565b936126f76040519586613750565b8385526020850193366024828401011161293657806024602093018637850101526001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016308114908115612913575b50612904576010546001600160a01b031633036128f5576001600160a01b0381169283156128e657813b156128d7576040516352d1902d60e01b8152602081600481885afa86918161289f575b506127b357634c9c8ce360e01b86526004859052602486fd5b93846000805160206144b283398151915287960361288d5750823b1561287b576000805160206144b283398151915280546001600160a01b031916821790558491907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b8380a280511561286057610d179382915190845af43d15612858573d9161283c83613789565b9261284a6040519485613750565b83523d85602085013e614390565b606091614390565b505050503461286c5780f35b63b398979f60e01b8152600490fd5b634c9c8ce360e01b8552600452602484fd5b632a87526960e21b8652600452602485fd5b9091506020813d6020116128cf575b816128bb60209383613750565b810103126128cb5751903861279a565b8680fd5b3d91506128ae565b636f7c43f160e01b8552600485fd5b63e6c4247b60e01b8552600485fd5b6349db3bd360e01b8452600484fd5b63703e46dd60e11b8452600484fd5b6000805160206144b2833981519152546001600160a01b0316141590503861274d565b8280fd5b5034610340576020366003190112610340576020906040906001600160a01b036129626136bb565b168152600e83522054604051908152f35b50346103405760603660031901126103405761298d6136e7565b6024356001600160401b038111612936576129ac903690600401613720565b916044356001600160401b0381116113b1576129cc903690600401613720565b6000805160206145728339815191529291925460ff8160401c16908115612d20575b506113875760008051602061457283398151915280546001600160481b0319166002600160401b0117905560008051602061455283398151915286526000805160206144f283398151915260209081526040808820336000908152925290205460ff1615612cfb57612a5e61420e565b612a6661420e565b600160008051602061453283398151915255600b549160ff8316612cec57818603612cdd57612a948661396b565b92612aa26040519485613750565b868452601f19612ab18861396b565b01366020860137875b878110612be8575060019060ff191617600b5515159460ff196008541660ff871617600855865b818110612b4557876000805160206143f2833981519152602089604051908152a160ff60401b19600080516020614572833981519152541660008051602061457283398151915255600080516020614472833981519152602060405160028152a180f35b80886000805160206145928339815191526040612b6d612b68600196888d613982565b6139a8565b612b7885898c613982565b357f8f955fa878b4aae8b1ac37b1ab715307470f2822ceff87e23d33ef1e044814a783612ba5888d6139bc565b5193898060a01b0316968793848252600660205280838320558482526007602052858383205582519182526020820152a28151908d82526020820152a201612ae1565b612bf6612b68828a8a613982565b612c01828689613982565b6001600160a01b03909116808b52600260205260408b20549091359060ff1615612cc9576103e88111612cb15750906020602492604051938480926370a0823160e01b82523060048301525afa8015612ca6578a90612c70575b60019250612c6982886139bc565b5201612aba565b509060203d8111612c9f575b612c868183613750565b6020826000928101031261034057509060019151612c5b565b503d612c7c565b6040513d8c823e3d90fd5b631051834f60e11b8b526004526103e860245260448afd5b6351104c5960e01b8b52600482905260248bfd5b63512509d360e11b8752600487fd5b6324d0d1fd60e01b8752600487fd5b63e2517d3f60e01b865233600452600080516020614552833981519152602452604486fd5b60026001600160401b039190911610159050386129ee565b50346103405780600319360112610340576011546040516001600160a01b039091168152602090f35b50346103405780600319360112610340576010546001600160a01b03163303612ded576000805160206145128339815191525460ff811615612dde5760ff1916600080516020614512833981519152557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa6020604051338152a180f35b638dfc202b60e01b8252600482fd5b6349db3bd360e01b8152600490fd5b5034610340576020366003190112610340576020906040906001600160a01b03612e246136bb565b168152601683522054604051908152f35b503461034057604036600319011261034057612e4f6136d1565b336001600160a01b03821603612e6b57610d1790600435613e9e565b63334bd91960e11b8252600482fd5b5034610340576020366003190112610340576020906040906001600160a01b03612ea26136bb565b168152600c83522054604051908152f35b5034610340576020366003190112610340576020906040906001600160a01b03612edb6136bb565b168152601783522054604051908152f35b503461034057604036600319011261034057610d17600435612f0c6136d1565b90612f19610d0d826138eb565b613e56565b503461034057612f2d366136f6565b9190612f37613c96565b612f3f613cd2565b33845260096020526040842054430361332c57338452600a60205260036040852054101561331d57338452600a60205260408420612f7d815461390c565b90555b6001600160a01b0382168085526002602052604085205490929060ff16613285575b828552600260205260ff604086205416156132715760ff600854161561326257811561325357831561324457828552600d602052604085205480831061322d5750828552600f6020526040852054801561321e5780831161320857508161300891613cfc565b670de0b6b3a76400008102818104670de0b6b3a7640000036131f4578285526003602052604085205461303a91613826565b908285526006602052613057612710611a3a6040882054856137fd565b93838652600560205260ff604087205416601281106131c9575b508085106131b2575082855260076020528360408620541061318e578285526007602052604085205484811061317f576000805160206145928339815191526040826130be888895613846565b848a52600760205280838b205582519182526020820152a284546001600160a01b0316803b1561317b57856040518092633a52b90760e11b8252818381613109883360048401613934565b03925af180156131705791602096611adc927f8caf04742286d017f9ac3924388e188c73e6e5094311c5e59a61a7ef86dda8bf94613160575b505061314f863387613dd0565b60405191829133958842928561394f565b8161316a91613750565b38613142565b6040513d88823e3d90fd5b8580fd5b6308aed4ef60e31b8652600486fd5b82855260076020526040852054635960d22160e01b86526004526024849052604485fd5b6371c4efed60e01b86526004859052602452604485fd5b946131e76131e060ff6116e36131ed959799613853565b8092613826565b95613826565b9138613071565b634e487b7160e01b85526011600452602485fd5b625502a360e91b86526004839052602452604485fd5b636c6ff70d60e11b8652600486fd5b6361767b8560e01b86526004839052602452604485fd5b632cd84af360e01b8552600485fd5b63162908e360e11b8552600485fd5b630df65d9f60e01b8552600485fd5b6374ed46ad60e01b85526004839052602485fd5b60405163313ce56760e01b8152602081600481875afa8691816132fc575b506132b75763105482c760e21b8652600486fd5b838652600560205260ff8060408820541691169081036132d75750612fa2565b83865260056020526040862054631e43476360e11b875260ff16600452602452604485fd5b61331691925060203d60201161132e5761131f8183613750565b90386132a3565b63a74c1c5f60e01b8452600484fd5b3384526009602052436040852055338452600a60205260016040852055612f80565b5034610340576020366003190112610340576020610b156004356138eb565b5034610340576020366003190112610340576020906040906001600160a01b036133956136bb565b168152600f83522054604051908152f35b5034610340576040366003190112610340576133c06136bb565b60105460243591906001600160a01b03163303611fe6576001600160a01b0316908115611fd75760406000805160206144528339815191529183855260126020528185205490848652601260205280838720558486526014602052828620438752602052828620548587526018602052838720558486526016602052438387205582519182526020820152a280f35b5034610340576020366003190112610340576020906040906001600160a01b036134776136bb565b168152600683522054604051908152f35b50346103405780600319360112610340576001546040516001600160a01b039091168152602090f35b5034610340576020366003190112610340576020906040906001600160a01b036134d96136bb565b168152600d83522054604051908152f35b5034610340576020366003190112610340576135046136e7565b6010546001600160a01b031633036104455760206000805160206143f283398151915291151560ff196008541660ff821617600855604051908152a180f35b50346103405760203660031901126103405760043563ffffffff60e01b8116809103611b6c57602090635a05180f60e01b8114908115613589575b506040519015158152f35b637965db0b60e01b8114915081156135a3575b508261357e565b6301ffc9a760e01b1490508261359c565b5034610340576040366003190112610340576135ce6136bb565b6001600160a01b03168082526002602052604082205460243592919060ff16156136a857670de0b6b3a7640000830292808404670de0b6b3a764000014901517156136945760ff604061362e819584865260036020528286205490613826565b93838152600660205261365261271061364a84842054886137fd565b048096613846565b9381526005602052205416601281101561368d579061367b6131e060ff6116e361368195613853565b92613826565b82519182526020820152f35b5090613681565b634e487b7160e01b82526011600452602482fd5b6374ed46ad60e01b825260045260249150fd5b600435906001600160a01b03821682036105ca57565b602435906001600160a01b03821682036105ca57565b6004359081151582036105ca57565b60609060031901126105ca576004356001600160a01b03811681036105ca57906024359060443590565b9181601f840112156105ca578235916001600160401b0383116105ca576020808501948460051b0101116105ca57565b601f909101601f19168101906001600160401b0382119082101761377357604052565b634e487b7160e01b600052604160045260246000fd5b6001600160401b03811161377357601f01601f191660200190565b91909160208152825180602083015260005b8181106137d7575060409293506000838284010152601f8019910116010190565b80602080928701015160408286010152016137b6565b6084359060ff821682036105ca57565b8181029291811591840414171561381057565b634e487b7160e01b600052601160045260246000fd5b8115613830570490565b634e487b7160e01b600052601260045260246000fd5b9190820391821161381057565b60ff166012039060ff821161381057565b80156138e55760009060208110600116604e8210600116176138dd57600a916001915b600181116138b45750826000190482116138a057500290565b634e487b7160e01b81526011600452602490fd5b928060001904811161369457600184166138d4575b80029260011c613887565b809202916138c9565b9050600a0a90565b50600190565b6000526000805160206144f283398151915260205260016040600020015490565b60001981146138105760010190565b908160209103126105ca575160ff811681036105ca5790565b6001600160a01b039091168152602081019190915260400190565b9094939260609260808301968352602083015260408201520152565b6001600160401b0381116137735760051b60200190565b91908110156139925760051b0190565b634e487b7160e01b600052603260045260246000fd5b356001600160a01b03811681036105ca5790565b80518210156139925760209160051b010190565b6001600160a01b03168015613a2357601080546001600160a01b0319811683179091556001600160a01b03167f17dc5b1290f7495d7f8cc68476e6941aaf510598fa925d0d2720edc8805a846c600080a3565b63e6c4247b60e01b60005260046000fd5b9190820180921161381057565b94919360e0969360ff929a99989561010088019b885260208801526040870152166060850152608084015260a083015260c08201520152565b6001600160a01b03811660008181526002602052604090205490919060ff16158015613b6c575b8015613b64575b613b525781600052600f6020526040600020548015908115613b5a575b50613b5257613aea926040918251948592839262f7fce960e01b845260048401613934565b0381305afa918215613b4657600092613b12575b506000526007602052604060002054101590565b9091506040813d604011613b3e575b81613b2e60409383613750565b810103126105ca57519038613afe565b3d9150613b21565b6040513d6000823e3d90fd5b505050600090565b9050831138613ac5565b508215613aa8565b5060ff6008541615613aa1565b6001546001600160a01b0391821691168103613bee576020602491604051928380926370a0823160e01b82523060048301525afa908115613b4657600091613bbf575090565b90506020813d602011613be6575b81613bda60209383613750565b810103126105ca575190565b3d9150613bcd565b80600052600260205260ff60406000205416613c0a5750600090565b6040516370a0823160e01b815230600482015290602082602481845afa918215613b4657600092613c62575b506000526007602052604060002054808211600014613c5b57613c5891613846565b90565b5050600090565b90916020823d602011613c8e575b81613c7d60209383613750565b810103126103405750519038613c36565b3d9150613c70565b60026000805160206145328339815191525414613cc157600260008051602061453283398151915255565b633ee5aeb560e01b60005260046000fd5b60ff6000805160206145128339815191525416613ceb57565b63d93c066560e01b60005260046000fd5b6001600160a01b03166000818152601360205260409020548015613dcb57816000526015602052604060002043600052602052613d3f6040600020549384613a34565b928310613dba57808260005260176020524360406000205414613d9c575b8311613d8057506000526015602052604060002043600052602052604060002055565b925063029359d560e41b60005260045260245260445260646000fd5b50816000526019602052613db560406000205482613a34565b613d5d565b63446c8cc960e01b60005260046000fd5b505050565b613e05613e0a9392613df760405194859263a9059cbb60e01b602085015260248401613934565b03601f198101845283613750565b614071565b565b60008181526000805160206144f28339815191526020908152604080832033845290915290205460ff1615613e3e5750565b63e2517d3f60e01b6000523360045260245260446000fd5b613e6082826140cc565b9182613e6b57505090565b60009182526000805160206144328339815191526020526040909120613e9a916001600160a01b031690614254565b5090565b613ea8828261416e565b9182613eb357505090565b60009182526000805160206144328339815191526020526040909120613e9a916001600160a01b0316906142bd565b6001600160a01b03166000818152601260205260409020548015613dcb57816000526014602052604060002043600052602052613f256040600020549384613a34565b928310613dba57808260005260166020524360406000205414613f82575b8311613f6657506000526014602052604060002043600052602052604060002055565b92506319a4e2a760e01b60005260045260245260445260646000fd5b50816000526018602052613f9b60406000205482613a34565b613f43565b6040516323b872dd60e01b60208201526001600160a01b039283166024820152929091166044830152606480830193909352918152613e0a91613e05608483613750565b60405163313ce56760e01b81529190602090839060049082906001600160a01b03165afa60009281614050575b5061402757631eecbb6560e01b60005260046000fd5b60ff9182169116808203614039575050565b631e43476360e11b60005260045260245260446000fd5b61406a91935060203d60201161132e5761131f8183613750565b9138614011565b906000602091828151910182855af115613b46576000513d6140c357506001600160a01b0381163b155b6140a25750565b635274afe760e01b60009081526001600160a01b0391909116600452602490fd5b6001141561409b565b60008181526000805160206144f2833981519152602090815260408083206001600160a01b038616845290915290205460ff16613c5b5760008181526000805160206144f2833981519152602090815260408083206001600160a01b0395909516808452949091528120805460ff19166001179055339291907f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d9080a4600190565b60008181526000805160206144f2833981519152602090815260408083206001600160a01b038616845290915290205460ff1615613c5b5760008181526000805160206144f2833981519152602090815260408083206001600160a01b0395909516808452949091528120805460ff19169055339291907ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9080a4600190565b60ff6000805160206145728339815191525460401c161561422b57565b631afcd79f60e31b60005260046000fd5b80548210156139925760005260206000200190600090565b6001810190826000528160205260406000205415600014613b52578054600160401b811015613773576142a861429182600187940185558461423c565b819391549060031b91821b91600019901b19161790565b90555491600052602052604060002055600190565b906001820191816000528260205260406000205480151560001461438757600019810181811161381057825460001981019190821161381057818103614350575b5050508054801561433a576000190190614318828261423c565b8154906000199060031b1b191690555560005260205260006040812055600190565b634e487b7160e01b600052603160045260246000fd5b614370614360614291938661423c565b90549060031b1c9283928661423c565b9055600052836020526040600020553880806142fe565b50505050600090565b906143b657508051156143a557602081519101fd5b63d6bda27560e01b60005260046000fd5b815115806143e8575b6143c7575090565b639996b31560e01b60009081526001600160a01b0391909116600452602490fd5b50803b156143bf56fe2c0a5f5ab0ba371221bb3612c2d2f90d36566279309f526000c5b354efd1b0658c67aaac7f77de07240e5a9b36dfdccb2a89c438635abbb27a73142d2aa0f629c1f6fe24621ce81ec5827caf0253cadb74709b061630e6b55e8237170593200048b07fab687f450848f1df8a96db08fef7840f53415f18fdc2ec8e9f810f0930c7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d275027301df982f5215b4963a854cf9c73219df80cb6acd8f098189c9480c7bbc360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc4460507c21097c15f6883572ebd157a9ee4b1d989a312314e93afd9d2ecd494002dd7bc7dec4dceedda775e58dd541e08a116c6c53815c0bd028192f7b626800cd5ed15c6e187e77e9aee88184c21f4f2182ab5827cb3b7e07fbedcd63f033009b779b17422d0df92223018b32b4d1fa46e071723d6817e2486d003becc55f00a49807205ce4d355092ef5a8a18f56e8913cf4a201fbe287825b095693c21775f0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a006d129bd71f2401cbe77f49f546d7d5f58992faecfca6e51ba06b50b261e83331a164736f6c6343000822000a";
116661
+ var _bytecode = "0x60a080604052346100ea57306080527ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a005460ff8160401c166100d9576002600160401b03196001600160401b03821601610073575b6040516146f590816100f0823960805181818161269a01526127930152f35b6001600160401b0319166001600160401b039081177ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a005581527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d290602090a13880610054565b63f92ee8a960e01b60005260046000fd5b600080fdfe6080604052600436101561001257600080fd5b6000803560e01c8062f7fce9146136c257806301ffc9a714613651578063021d2893146135f85780630871b206146135bf578063114249d214610f7257806311d954f81461359657806313da31661461355d5780631d44a904146134b45780631f77bf651461347b578063248a9ca31461345c5780632b83cccd146130305780632f2ff15d14612ffe57806334bac37014612fc557806334e1812514612f8c57806336568abe14612f47578063373c86b614612f0e5780633f4ba83a14612e475780634373b57214612e1e5780634451e89b14612a4a5780634ebd25a514612a115780634f1ef286146127185780635273b6f6146126ef57806352d1902d14612687578063568fafca146125f957806359d5d02a146123305780635bc26aea146122fb5780635c975abb146122cb5780635ecc2708146121ad5780638456cb59146120b257806385c15d9a1461207957806389d3ad0014611fb25780638bff608e14611f795780639010d07c14611f2657806390ad8b4014611f0a57806391d1485414611eb15780639b759bf714611e6e5780639baf58d214611e515780639f1d0f59146118b9578063a217fddf1461189d578063a3246ad3146117e0578063ad3cb1cc14611799578063b492fc691461169f578063b9f637af14611474578063bf7d911914611435578063c4c5f62414611382578063c55f15ea1461135f578063ca15c87314611328578063ca2ce65d146112ef578063cc1f8ffa146112bd578063cf46075e146111b3578063d21a74ff14611176578063d2f8253614611153578063d547741f14611118578063d5d3f78b14610fab578063d66bd52414610f72578063e1f1c4a714610f55578063e1f3962c14610f29578063ec2f96fe14610f05578063eda5a26a14610b08578063f1a1eb8414610ac5578063f385116d14610a8c578063f77c479114610a65578063f8c8765e14610661578063faaebd2114610628578063facdfb5e14610488578063fc99bd9a14610377578063fe32e7281461033e5763ffa1ad741461030857600080fd5b3461033b578060031936011261033b57610337610323613903565b6040519182916020835260208301906138b2565b0390f35b80fd5b503461033b57602036600319011261033b576020906040906001600160a01b036103666137c9565b168152601283522054604051908152f35b503461033b57604036600319011261033b576103916137c9565b6010546024359291906001600160a01b03163303610479576001600160a01b03168082526002602052604082205490929060ff16156104665780156104575782825260076020526040822054926103e88285613b4b565b848110610448576001600160ff1b038111610439576000805160206146c9833981519152604085968493846104369852600760205280838a205582519182526020820152a2309033906140b7565b80f35b630700fcb360e11b8452600484fd5b63446c8cc960e01b8452600484fd5b63162908e360e11b8252600482fd5b506024916374ed46ad60e01b8252600452fd5b6349db3bd360e01b8252600482fd5b503461033b57602036600319011261033b576104a26137c9565b6104aa613dad565b6010546001600160a01b03163303610479576001600160a01b03168082526002602052604082205460ff161561061657808252600760205260408220546040516370a0823160e01b8152306004820152602081602481865afa90811561060b5784916105d4575b50818111156105c557610524828261396f565b8215908115610570575b50506000805160206146c9833981519152916040918486526007602052808387205582519182526020820152a260016000805160206146698339815191525580f35b61271081029080820461271014901517156105b157606484029184830460641417156105b157116105a257388061052e565b63a73af74d60e01b8452600484fd5b634e487b7160e01b86526011600452602486fd5b6105cf818361396f565b610524565b90506020813d602011610603575b816105ef6020938361385e565b810103126105fe575138610511565b600080fd5b3d91506105e2565b6040513d86823e3d90fd5b6374ed46ad60e01b8252600452602490fd5b503461033b57602036600319011261033b576020906040906001600160a01b036106506137c9565b168152600483522054604051908152f35b503461033b57608036600319011261033b5761067b6137c9565b6106836137df565b6044356001600160a01b03811690818103610a61576064356001600160a01b0381169390849003610a5d576000805160206146a983398151915254604081901c60ff161595906001600160401b031680159081610a55575b6001149081610a4b575b159081610a42575b50610a33576000805160206146a983398151915280546001600160401b031916600117905585610a0e575b6001600160a01b03169081156109ff576001600160a01b03169081156109f05783156109e157610746614325565b61074e614325565b610756614325565b61075e614325565b600160008051602061466983398151915255610778614325565b610780614325565b86546001600160a01b0319908116919091178755600180549182168317905560405163313ce56760e01b8152909190602081600481855afa8891816109b0575b506107d457633a24e95b60e11b8852600488fd5b6001600160a81b03199092161760a091821b60ff60a01b16176001819055901c60ff166006811415806109a5575b610993575061081181866141e3565b8061096b575b1561092657610834816000805160206146898339815191526141e3565b80610935575b1561092657610857906000805160206145a98339815191526141e3565b90816108ef575b50156108e057806108b5575b506108725780f35b60ff60401b196000805160206146a983398151915254166000805160206146a983398151915255600080516020614589833981519152602060405160018152a180f35b601080546001600160a01b03191682179055826000805160206145e98339815191528180a33861086a565b63cf5a8e3360e01b8352600483fd5b61091f906000805160206145a983398151915286526000805160206145498339815191526020526040862061436b565b503861085e565b63cf5a8e3360e01b8552600485fd5b6000805160206146898339815191528652600080516020614549833981519152602052610965836040882061436b565b5061083a565b85805260008051602061454983398151915260205261098d836040882061436b565b50610817565b63167738cf60e21b8652600452602485fd5b506012811415610802565b6109d391925060203d6020116109da575b6109cb818361385e565b810190613a44565b90386107c0565b503d6109c1565b630b5eba9f60e41b8752600487fd5b63c1ab6dc160e01b8752600487fd5b6336abb4df60e11b8752600487fd5b6000805160206146a9833981519152805460ff60401b1916600160401b179055610718565b63f92ee8a960e01b8752600487fd5b905015386106ed565b303b1591506106e5565b8791506106db565b8580fd5b8480fd5b503461033b578060031936011261033b57546040516001600160a01b039091168152602090f35b503461033b57602036600319011261033b576020906040906001600160a01b03610ab46137c9565b168152600a83522054604051908152f35b503461033b57604036600319011261033b576020906040906001600160a01b03610aed6137c9565b16815260158352818120602435825283522054604051908152f35b503461033b5761016036600319011261033b57610b236137c9565b90606435604435602435610b356138f3565b9160a4359160c43560e43561010435916101243595610144359760018060a01b03601054163303610ef6576001600160a01b038c16808c52600260205260408c2054909a9060ff16610ee2578a15610ed3578615610ec4576127108811610eaa576103e88111610e925760ff82169c60128e118e8115610e87575b50610e7357803b15610e5f578915610e4b578a15610e375782610bd2916140fb565b84151580610e2e575b610e175785151580610e0e575b610df7578b9c602460208d9e9d604051928380926370a0823160e01b82523060048301525afa9c8d15610deb579c610db7575b506001600160ff1b038c11610da8578a8d8f9760408f97838f918f8f8f8f90859f988f99879f966000805160206146098339815191529f978b9f988f8d6000805160206145698339815191529f988e8e610d609b6000805160206145298339815191529f8f8f8487526002602052878720600160ff198254161790558487526003602052878720558386526004602052868620558285526006602052878686205582855260056020528585209060ff19825416179055818452600c6020528885852055818452600d6020528985852055818452600e6020528a85852055818452600f6020528b8585205581845260076020528484205582526012602052828220558d8152601360205220558a7f991d1ef1b5c0820d213328cba6682059e00a50e49c469a454eb3557e78eaf6668e80518b81528c6020820152a28c5198899889613b58565b0390a28151908b82526020820152a28151908782526020820152a280610d84578280f35b60406000805160206146c9833981519152918151908582526020820152a281808280f35b63556e7a8160e01b8e5260048efd5b909b506020813d602011610de3575b81610dd36020938361385e565b810103126105fe57519a38610c1b565b3d9150610dc6565b604051903d90823e3d90fd5b60448c858863dd85772b60e01b8352600452602452fd5b50838610610be8565b60448c8487637449915760e01b8352600452602452fd5b50828510610bdb565b636835314760e11b8d52600160045260248dfd5b636835314760e11b8d5260048d905260248dfd5b63377e3f9960e21b8d5260048c905260248dfd5b63ca95039160e01b8d5260048e905260248dfd5b60069150108e610bb0565b631051834f60e11b8c526004526103e860245260448bfd5b63c1e9a14160e01b8c52600488905261271060245260448cfd5b63a2ec3a5560e01b8c5260048cfd5b63df407ac560e01b8c5260048cfd5b6317f4215b60e21b8c5260048b905260248cfd5b6349db3bd360e01b8b5260048bfd5b503461033b578060031936011261033b57602060ff60015460a01c16604051908152f35b503461033b57602036600319011261033b576020610f4d610f486137c9565b613c90565b604051908152f35b503461033b578060031936011261033b5760206040516127108152f35b503461033b57602036600319011261033b576020906040906001600160a01b03610f9a6137c9565b168152600783522054604051908152f35b503461033b57602036600319011261033b57610fc56137c9565b6010546001600160a01b03163303610479576001600160a01b03168082526002602052604082205460ff1615610616578082526007602052604082205480611102575080825260026020526040822060ff1981541690558082526003602052816040812055808252600460205281604081205580825260056020526040822060ff198154169055808252600c602052816040812055808252600d602052816040812055808252600e602052816040812055808252600f602052816040812055808252600660205281604081205580825260076020526040822054818352600760205282604081205560405190827f3302a1b37f04242bb55603f5449e7ecd690a35eef08ba1353c48c20e2aae9cda8580a2806110df578380f35b816040916000805160206146c98339815191529352846020820152a23880808380f35b604492916376bc059760e11b8352600452602452fd5b503461033b57604036600319011261033b5761114f6004356111386137df565b9061114a61114582613a14565b613f23565b613fb5565b5080f35b503461033b578060031936011261033b57602060ff600854166040519015158152f35b503461033b57602036600319011261033b5760209060ff906040906001600160a01b036111a16137c9565b16815260058452205416604051908152f35b503461033b57602036600319011261033b576111cd6137c9565b6111d5613dad565b6010546001600160a01b03163303610479576001600160a01b03168082526002602052604082205460ff161561061657808252600760205260408220546040516370a0823160e01b8152306004820152602081602481865afa90811561060b57849161127d575b506000805160206146c9833981519152916040918486526007602052808387205582519182526020820152a260016000805160206146698339815191525580f35b90506020813d6020116112b5575b816112986020938361385e565b810103126105fe57516000805160206146c983398151915261123c565b3d915061128b565b503461033b57604036600319011261033b5760206112e56112dc6137c9565b60243590613b91565b6040519015158152f35b503461033b57602036600319011261033b576020906040906001600160a01b036113176137c9565b168152601383522054604051908152f35b503461033b57602036600319011261033b576040602091600435815260008051602061454983398151915283522054604051908152f35b503461033b578060031936011261033b576020604051670de0b6b3a76400008152f35b503461033b57604036600319011261033b5761139c6137c9565b6010546024359291906001600160a01b03163303610479576001600160a01b031680825260076020526040822054929081841061141e57806000805160206146c98339815191526040866113f486610436989961396f565b84895260076020528289205583885260076020528188205482519182526020820152a23390613ee7565b5091604492633cb8e07360e01b8352600452602452fd5b503461033b57602036600319011261033b5760209060ff906040906001600160a01b036114606137c9565b168152600284522054166040519015158152f35b503461033b5761012036600319011261033b5761148f6137c9565b60643591906044356024356114a26138f3565b601054610104359660e4359260c4359260a43592906001600160a01b03163303611690576001600160a01b038816808a52600260205260408a205490989060ff161561167c57861561166d576127108811611653576103e882116116395760ff83169060128211801561162f575b61161b578361151e916140fb565b85151580611612575b6115fb578a1515806115f2575b6115db579260008051602061452983398151915297969592828c956115d5979460408e8e80825260036020528c8383205580825260046020528d838320558152600660205220558b8d52600560205260408d209060ff198254161790558a8c52600c6020528260408d20558a8c52600d6020528360408d20558a8c52600e6020528460408d20558a8c52600f6020528560408d205560405198899889613b58565b0390a280f35b60448a868d63dd85772b60e01b8352600452602452fd5b50848b10611534565b60448a8588637449915760e01b8352600452602452fd5b50838610611527565b63ca95039160e01b8b52600482905260248bfd5b5060068210611510565b631051834f60e11b8a5260048290526103e860245260448afd5b63c1e9a14160e01b8a52600488905261271060245260448afd5b63a2ec3a5560e01b8a5260048afd5b6374ed46ad60e01b8a52600489905260248afd5b6349db3bd360e01b8952600489fd5b503461033b57604036600319011261033b576116b96137c9565b6001600160a01b0316808252600260205260408220546024359060ff16156117855780156117765761271061173b604085670de0b6b3a764000061172a6117439688859a52600560205260ff858520541690809160128110611750575b505088845260036020528484205490613926565b049581526004602052205484613926565b04809261396f565b9082519182526020820152f35b61176f925060ff6117636117699261397c565b1661398d565b90613926565b3880611716565b63162908e360e11b8352600483fd5b6374ed46ad60e01b83526004829052602483fd5b503461033b578060031936011261033b5761033760408051906117bc818361385e565b60058252640352e302e360dc1b6020830152519182916020835260208301906138b2565b503461033b57602036600319011261033b57600435815260008051602061454983398151915260205260408120604051908160208254918281520190819285526020852090855b818110611887575050508261183d91038361385e565b604051928392602084019060208552518091526040840192915b818110611865575050500390f35b82516001600160a01b0316845285945060209384019390920191600101611857565b8254845260209093019260019283019201611827565b503461033b578060031936011261033b57602090604051908152f35b503461033b576118c836613804565b9190926118d3613dad565b6118db613de9565b338152600960205260408120544303611e2f57338152600a602052600360408220541015611e2057338152600a602052604081206119198154613a35565b90555b6001600160a01b0382168082526002602052604082205490929060ff16611d7f575b828252600260205260ff60408320541615610466578415610457578315611d7057828252600c60205260408220548510611d4b57828252600e60205260408220548015611d3c57808611611d2557508461199791613ff9565b6040516370a0823160e01b8152306004820152602081602481865afa908115611be5578291611cf3575b506119ce853033866140b7565b6040516370a0823160e01b8152306004820152602081602481875afa908115611ce857908692918491611caf575b5090611a079161396f565b10611ca05781815260076020526040812054611a238582613b4b565b818110611c91576001600160ff1b038111611c8257604084926000805160206146c9833981519152928486526007602052808387205582519182526020820152a2818152600560205260ff604082205416849060128110611c21575b50611aa0670de0b6b3a7640000918484526003602052604084205490613926565b04908281526004602052611ac6612710611abe604084205485613926565b04809361396f565b93808510611c09575080546001600160a01b0316803b15611bf05781809160846040518094819363ae494fa160e01b83523360048401528a60248401528960448401528b60648401525af18015611be557908291611bf4575b505081611b7d575b507fb3e2773606abfd36b5bd91394b3a54d1398336c65005baf7bf7a05efeffaf75b611b60602095604051918291339588429285613a78565b0390a3600160008051602061466983398151915255604051908152f35b80546001600160a01b0316803b15611bf05781809160846040518094819363ae494fa160e01b83523060048401528860248401528960448401528160648401525af18015611be557611bd0575b50611b27565b611bdb82809261385e565b61033b5780611bca565b6040513d84823e3d90fd5b5080fd5b81611bfe9161385e565b61033b578038611b1f565b6371c4efed60e01b8252600485905260245260449150fd5b611c31915061176360ff9161397c565b8015611c6e5780600019048511611c5f57611aa0611c58670de0b6b3a76400009287613926565b9150611a7f565b63035fc53d60e41b8252600482fd5b634e487b7160e01b82526012600452602482fd5b630700fcb360e11b8352600483fd5b63446c8cc960e01b8352600483fd5b639bfa3c1760e01b8152600490fd5b919250506020813d602011611ce0575b81611ccc6020938361385e565b810103126105fe5751859190611a076119fc565b3d9150611cbf565b6040513d85823e3d90fd5b90506020813d602011611d1d575b81611d0e6020938361385e565b810103126105fe5751386119c1565b3d9150611d01565b631d7f2ac360e01b83526004869052602452604482fd5b633b5db2f360e11b8352600483fd5b50908152600c6020526040812054630d54e9e160e01b82526004849052602452604490fd5b632cd84af360e01b8252600482fd5b60405163313ce56760e01b815291939291602081600481865afa859181611dff575b50611db55763105482c760e21b8552600485fd5b93919293838352600560205260ff806040852054169116908103611dd9575061193e565b90506044928252600560205260ff604083205416631e43476360e11b8352600452602452fd5b611e1991925060203d6020116109da576109cb818361385e565b9038611da1565b63a74c1c5f60e01b8152600490fd5b3381526009602052436040822055338152600a6020526001604082205561191c565b503461033b578060031936011261033b5760206040516103e88152f35b503461033b57604036600319011261033b576020906040906001600160a01b03611e966137c9565b16815260148352818120602435825283522054604051908152f35b503461033b57604036600319011261033b576040611ecd6137df565b916004358152600080516020614629833981519152602052209060018060a01b0316600052602052602060ff604060002054166040519015158152f35b503461033b578060031936011261033b57602060405160648152f35b503461033b57604036600319011261033b57611f606020916004358152600080516020614549833981519152835260406024359120614353565b905460405160039290921b1c6001600160a01b03168152f35b503461033b57602036600319011261033b576020906040906001600160a01b03611fa16137c9565b168152600983522054604051908152f35b503461033b57604036600319011261033b57611fcc6137c9565b60105460243591906001600160a01b0316330361206a576001600160a01b031690811561205b5760406000805160206146098339815191529183855260136020528185205490848652601360205280838720558486526015602052828620438752602052828620548587526019602052838720558486526017602052438387205582519182526020820152a280f35b63df407ac560e01b8352600483fd5b6349db3bd360e01b8352600483fd5b503461033b57602036600319011261033b576020906040906001600160a01b036120a16137c9565b168152600383522054604051908152f35b503461033b578060031936011261033b576000805160206145a9833981519152815260008051602061462983398151915260209081526040808320336000908152925290205460ff161561218857612108613de9565b600160ff19600080516020614649833981519152541617600080516020614649833981519152557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a2586020604051338152a16040514281527f80170b5fcdd2bf1e0660ef4b8851f86685f64d41b1a19de1471947ece8725aac60203392a280f35b63e2517d3f60e01b8152336004526000805160206145a9833981519152602452604490fd5b503461033b57602036600319011261033b576121c76137c9565b6000805160206146a98339815191525460ff8160401c169081156122b3575b506122a4576000805160206146a983398151915280546001600160481b0319166003600160401b0117905581805260008051602061462983398151915260209081526040808420336000908152925290205460ff161561228c5761224990613af9565b60ff60401b196000805160206146a983398151915254166000805160206146a983398151915255600080516020614589833981519152602060405160038152a180f35b63e2517d3f60e01b8252336004526024829052604482fd5b63f92ee8a960e01b8252600482fd5b60036001600160401b039190911610159050386121e6565b503461033b578060031936011261033b57602060ff60008051602061464983398151915254166040519015158152f35b503461033b57602036600319011261033b576123156137c9565b6010546001600160a01b031633036104795761043690613af9565b503461033b57606036600319011261033b5761234a6137c9565b6123526137df565b60105490926044359290916001600160a01b0316330361047957612374613de9565b6011546001600160a01b03169182156125ea5760405163babcc53960e01b81526001600160a01b0386166004820181905293602090829060249082905afa908115611be55782916125af575b50156125a0578215612591576001546001600160a01b03928316921682036124e1576040516370a0823160e01b8152306004820152602081602481865afa908115611be55782916124af575b50935b84156124a057600019810361249a5750835b841561248b5780851161247357505061243d8360209583613ee7565b7f0bf519e4b3821615dbdd874fa1a5fbb4bb651b4e6beabedd4ac318e770233b2c604080518581524287820152a3604051908152f35b630555ed4f60e31b8252600485905260245260449150fd5b632e11316f60e11b8252600482fd5b93612421565b63f09872eb60e01b8252600482fd5b90506020813d6020116124d9575b816124ca6020938361385e565b810103126105fe57513861240c565b3d91506124bd565b8181526002602052604081205460ff161561257f576040516370a0823160e01b8152306004820152602081602481865afa908115611be557829161254d575b5082825260076020526040822054808211156125455761253f9161396f565b9361240f565b50508061253f565b90506020813d602011612577575b816125686020938361385e565b810103126105fe575138612520565b3d915061255b565b60249163eef7849760e01b8252600452fd5b634e46966960e11b8152600490fd5b63133307bb60e21b8152600490fd5b90506020813d6020116125e2575b816125ca6020938361385e565b81010312611bf057518015158103611bf057386123c0565b3d91506125bd565b630e048e7160e41b8152600490fd5b503461033b57602036600319011261033b576126136137c9565b6010546001600160a01b03163303610479576001600160a01b0316801561267857601180546001600160a01b0319811683179091556001600160a01b03167f1e9c406f2707909cfd9f61e744f73bcab77e5997d063276f67883c5257d51cf08380a380f35b634e46966960e11b8252600482fd5b503461033b578060031936011261033b577f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031630036126e05760206040516000805160206145c98339815191528152f35b63703e46dd60e11b8152600490fd5b503461033b578060031936011261033b576010546040516001600160a01b039091168152602090f35b50604036600319011261033b5761272d6137c9565b602435906001600160401b038211612a0d5736602383011215612a0d578160040135908361275a83613897565b93612768604051958661385e565b83855260208501933660248284010111612a0d57806024602093018637850101526001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000163081149081156129ea575b506129db576010546001600160a01b031633036129cc576001600160a01b0381169283156129bd57813b156129ae576000805160206145c98339815191525484612806613903565b7f6ea8b34d59b2818d3f37a08dddaa06f5886b9c20c907b36f03ca6528e106e86f61283c604051926040845260408401906138b2565b4260208401526001600160a01b038516929081900390a36040516352d1902d60e01b8152602081600481895afa879181612976575b5061288a57634c9c8ce360e01b87526004869052602487fd5b90816000805160206145c9833981519152889793036129645750833b15612950576001600160a01b03191681176000805160206145c9833981519152558491907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b8380a28051156129355761114f9382915190845af43d1561292d573d9161291183613897565b9261291f604051948561385e565b83523d85602085013e6144a7565b6060916144a7565b50505050346129415780f35b63b398979f60e01b8152600490fd5b634c9c8ce360e01b86526004829052602486fd5b632a87526960e21b8752600452602486fd5b9091506020813d6020116129a6575b816129926020938361385e565b810103126129a257519038612871565b8780fd5b3d9150612985565b636f7c43f160e01b8552600485fd5b63e6c4247b60e01b8552600485fd5b6349db3bd360e01b8452600484fd5b63703e46dd60e11b8452600484fd5b6000805160206145c9833981519152546001600160a01b031614159050386127be565b8280fd5b503461033b57602036600319011261033b576020906040906001600160a01b03612a396137c9565b168152600e83522054604051908152f35b503461033b57606036600319011261033b57612a646137f5565b6024356001600160401b038111612a0d57612a8390369060040161382e565b916044356001600160401b038111610a6157612aa390369060040161382e565b6000805160206146a98339815191529291925460ff8160401c16908115612e06575b50612df7576000805160206146a983398151915280546001600160481b0319166002600160401b01179055600080516020614689833981519152865260008051602061462983398151915260209081526040808820336000908152925290205460ff1615612dd257612b35614325565b612b3d614325565b600160008051602061466983398151915255600b549160ff8316612dc357818603612db457612b6b86613a94565b92612b79604051948561385e565b868452601f19612b8888613a94565b01366020860137875b878110612cbf575060019060ff191617600b5515159460ff196008541660ff871617600855865b818110612c1c5787600080516020614509833981519152602089604051908152a160ff60401b196000805160206146a983398151915254166000805160206146a983398151915255600080516020614589833981519152602060405160028152a180f35b80886000805160206146c98339815191526040612c44612c3f600196888d613aab565b613ad1565b612c4f85898c613aab565b357f8f955fa878b4aae8b1ac37b1ab715307470f2822ceff87e23d33ef1e044814a783612c7c888d613ae5565b5193898060a01b0316968793848252600660205280838320558482526007602052858383205582519182526020820152a28151908d82526020820152a201612bb8565b612ccd612c3f828a8a613aab565b612cd8828689613aab565b6001600160a01b03909116808b52600260205260408b20549091359060ff1615612da0576103e88111612d885750906020602492604051938480926370a0823160e01b82523060048301525afa8015612d7d578a90612d47575b60019250612d408288613ae5565b5201612b91565b509060203d8111612d76575b612d5d818361385e565b6020826000928101031261033b57509060019151612d32565b503d612d53565b6040513d8c823e3d90fd5b631051834f60e11b8b526004526103e860245260448afd5b6351104c5960e01b8b52600482905260248bfd5b63512509d360e11b8752600487fd5b6324d0d1fd60e01b8752600487fd5b63e2517d3f60e01b865233600452600080516020614689833981519152602452604486fd5b63f92ee8a960e01b8652600486fd5b60026001600160401b03919091161015905038612ac5565b503461033b578060031936011261033b576011546040516001600160a01b039091168152602090f35b503461033b578060031936011261033b576010546001600160a01b03163303612eff576000805160206146498339815191525460ff811615612ef05760ff1916600080516020614649833981519152557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa6020604051338152a16040514281527f107553d8191d85b405879cf752997865edd48d94e20bda4dd27223c94b31a7cc60203392a280f35b638dfc202b60e01b8252600482fd5b6349db3bd360e01b8152600490fd5b503461033b57602036600319011261033b576020906040906001600160a01b03612f366137c9565b168152601683522054604051908152f35b503461033b57604036600319011261033b57612f616137df565b336001600160a01b03821603612f7d5761114f90600435613fb5565b63334bd91960e11b8252600482fd5b503461033b57602036600319011261033b576020906040906001600160a01b03612fb46137c9565b168152600c83522054604051908152f35b503461033b57602036600319011261033b576020906040906001600160a01b03612fed6137c9565b168152601783522054604051908152f35b503461033b57604036600319011261033b5761114f60043561301e6137df565b9061302b61114582613a14565b613f6d565b503461033b5761303f36613804565b9190613049613dad565b613051613de9565b33845260096020526040842054430361343a57338452600a60205260036040852054101561342b57338452600a6020526040842061308f8154613a35565b90555b6001600160a01b0382168085526002602052604085205490929060ff16613393575b828552600260205260ff6040862054161561337f5760ff600854161561337057811561336157831561335257828552600d602052604085205480831061333b5750828552600f6020526040852054801561332c5780831161331657508161311a91613e13565b670de0b6b3a76400008102818104670de0b6b3a764000003613302578285526003602052604085205461314c9161394f565b908285526006602052613169612710611abe604088205485613926565b93838652600560205260ff604087205416601281106132d7575b508085106132c0575082855260076020528360408620541061329c578285526007602052604085205484811061328d576000805160206146c98339815191526040826131d088889561396f565b848a52600760205280838b205582519182526020820152a284546001600160a01b0316803b15610a5d57856040518092633a52b90760e11b825281838161321b883360048401613a5d565b03925af180156132825791602096611b60927f8caf04742286d017f9ac3924388e188c73e6e5094311c5e59a61a7ef86dda8bf94613272575b5050613261863387613ee7565b604051918291339588429285613a78565b8161327c9161385e565b38613254565b6040513d88823e3d90fd5b6308aed4ef60e31b8652600486fd5b82855260076020526040852054635960d22160e01b86526004526024849052604485fd5b6371c4efed60e01b86526004859052602452604485fd5b946132f56132ee60ff6117636132fb95979961397c565b809261394f565b9561394f565b9138613183565b634e487b7160e01b85526011600452602485fd5b625502a360e91b86526004839052602452604485fd5b636c6ff70d60e11b8652600486fd5b6361767b8560e01b86526004839052602452604485fd5b632cd84af360e01b8552600485fd5b63162908e360e11b8552600485fd5b630df65d9f60e01b8552600485fd5b6374ed46ad60e01b85526004839052602485fd5b60405163313ce56760e01b8152602081600481875afa86918161340a575b506133c55763105482c760e21b8652600486fd5b838652600560205260ff8060408820541691169081036133e557506130b4565b83865260056020526040862054631e43476360e11b875260ff16600452602452604485fd5b61342491925060203d6020116109da576109cb818361385e565b90386133b1565b63a74c1c5f60e01b8452600484fd5b3384526009602052436040852055338452600a60205260016040852055613092565b503461033b57602036600319011261033b576020610f4d600435613a14565b503461033b57602036600319011261033b576020906040906001600160a01b036134a36137c9565b168152600f83522054604051908152f35b503461033b57604036600319011261033b576134ce6137c9565b60105460243591906001600160a01b0316330361206a576001600160a01b031690811561205b5760406000805160206145698339815191529183855260126020528185205490848652601260205280838720558486526014602052828620438752602052828620548587526018602052838720558486526016602052438387205582519182526020820152a280f35b503461033b57602036600319011261033b576020906040906001600160a01b036135856137c9565b168152600683522054604051908152f35b503461033b578060031936011261033b576001546040516001600160a01b039091168152602090f35b503461033b57602036600319011261033b576020906040906001600160a01b036135e76137c9565b168152600d83522054604051908152f35b503461033b57602036600319011261033b576136126137f5565b6010546001600160a01b0316330361047957602060008051602061450983398151915291151560ff196008541660ff821617600855604051908152a180f35b503461033b57602036600319011261033b5760043563ffffffff60e01b8116809103611bf057602090635a05180f60e01b8114908115613697575b506040519015158152f35b637965db0b60e01b8114915081156136b1575b508261368c565b6301ffc9a760e01b149050826136aa565b503461033b57604036600319011261033b576136dc6137c9565b6001600160a01b03168082526002602052604082205460243592919060ff16156137b657670de0b6b3a7640000830292808404670de0b6b3a764000014901517156137a25760ff604061373c81958486526003602052828620549061394f565b9383815260066020526137606127106137588484205488613926565b04809661396f565b9381526005602052205416601281101561379b57906137896132ee60ff61176361378f9561397c565b9261394f565b82519182526020820152f35b509061378f565b634e487b7160e01b82526011600452602482fd5b6374ed46ad60e01b825260045260249150fd5b600435906001600160a01b03821682036105fe57565b602435906001600160a01b03821682036105fe57565b6004359081151582036105fe57565b60609060031901126105fe576004356001600160a01b03811681036105fe57906024359060443590565b9181601f840112156105fe578235916001600160401b0383116105fe576020808501948460051b0101116105fe57565b601f909101601f19168101906001600160401b0382119082101761388157604052565b634e487b7160e01b600052604160045260246000fd5b6001600160401b03811161388157601f01601f191660200190565b919082519283825260005b8481106138de575050826000602080949584010152601f8019910116010190565b806020809284010151828286010152016138bd565b6084359060ff821682036105fe57565b6040519061391260408361385e565b6005825264322e332e3360d81b6020830152565b8181029291811591840414171561393957565b634e487b7160e01b600052601160045260246000fd5b8115613959570490565b634e487b7160e01b600052601260045260246000fd5b9190820391821161393957565b60ff166012039060ff821161393957565b8015613a0e5760009060208110600116604e821060011617613a0657600a916001915b600181116139dd5750826000190482116139c957500290565b634e487b7160e01b81526011600452602490fd5b92806000190481116137a257600184166139fd575b80029260011c6139b0565b809202916139f2565b9050600a0a90565b50600190565b60005260008051602061462983398151915260205260016040600020015490565b60001981146139395760010190565b908160209103126105fe575160ff811681036105fe5790565b6001600160a01b039091168152602081019190915260400190565b9094939260609260808301968352602083015260408201520152565b6001600160401b0381116138815760051b60200190565b9190811015613abb5760051b0190565b634e487b7160e01b600052603260045260246000fd5b356001600160a01b03811681036105fe5790565b8051821015613abb5760209160051b010190565b6001600160a01b03168015613b3a57601080546001600160a01b0319811683179091556001600160a01b03166000805160206145e9833981519152600080a3565b63e6c4247b60e01b60005260046000fd5b9190820180921161393957565b94919360e0969360ff929a99989561010088019b885260208801526040870152166060850152608084015260a083015260c08201520152565b6001600160a01b03811660008181526002602052604090205490919060ff16158015613c83575b8015613c7b575b613c695781600052600f6020526040600020548015908115613c71575b50613c6957613c01926040918251948592839262f7fce960e01b845260048401613a5d565b0381305afa918215613c5d57600092613c29575b506000526007602052604060002054101590565b9091506040813d604011613c55575b81613c456040938361385e565b810103126105fe57519038613c15565b3d9150613c38565b6040513d6000823e3d90fd5b505050600090565b9050831138613bdc565b508215613bbf565b5060ff6008541615613bb8565b6001546001600160a01b0391821691168103613d05576020602491604051928380926370a0823160e01b82523060048301525afa908115613c5d57600091613cd6575090565b90506020813d602011613cfd575b81613cf16020938361385e565b810103126105fe575190565b3d9150613ce4565b80600052600260205260ff60406000205416613d215750600090565b6040516370a0823160e01b815230600482015290602082602481845afa918215613c5d57600092613d79575b506000526007602052604060002054808211600014613d7257613d6f9161396f565b90565b5050600090565b90916020823d602011613da5575b81613d946020938361385e565b8101031261033b5750519038613d4d565b3d9150613d87565b60026000805160206146698339815191525414613dd857600260008051602061466983398151915255565b633ee5aeb560e01b60005260046000fd5b60ff6000805160206146498339815191525416613e0257565b63d93c066560e01b60005260046000fd5b6001600160a01b03166000818152601360205260409020548015613ee257816000526015602052604060002043600052602052613e566040600020549384613b4b565b928310613ed157808260005260176020524360406000205414613eb3575b8311613e9757506000526015602052604060002043600052602052604060002055565b925063029359d560e41b60005260045260245260445260646000fd5b50816000526019602052613ecc60406000205482613b4b565b613e74565b63446c8cc960e01b60005260046000fd5b505050565b613f1c613f219392613f0e60405194859263a9059cbb60e01b602085015260248401613a5d565b03601f19810184528361385e565b614188565b565b60008181526000805160206146298339815191526020908152604080832033845290915290205460ff1615613f555750565b63e2517d3f60e01b6000523360045260245260446000fd5b613f7782826141e3565b9182613f8257505090565b60009182526000805160206145498339815191526020526040909120613fb1916001600160a01b03169061436b565b5090565b613fbf8282614285565b9182613fca57505090565b60009182526000805160206145498339815191526020526040909120613fb1916001600160a01b0316906143d4565b6001600160a01b03166000818152601260205260409020548015613ee25781600052601460205260406000204360005260205261403c6040600020549384613b4b565b928310613ed157808260005260166020524360406000205414614099575b831161407d57506000526014602052604060002043600052602052604060002055565b92506319a4e2a760e01b60005260045260245260445260646000fd5b508160005260186020526140b260406000205482613b4b565b61405a565b6040516323b872dd60e01b60208201526001600160a01b039283166024820152929091166044830152606480830193909352918152613f2191613f1c60848361385e565b60405163313ce56760e01b81529190602090839060049082906001600160a01b03165afa60009281614167575b5061413e57631eecbb6560e01b60005260046000fd5b60ff9182169116808203614150575050565b631e43476360e11b60005260045260245260446000fd5b61418191935060203d6020116109da576109cb818361385e565b9138614128565b906000602091828151910182855af115613c5d576000513d6141da57506001600160a01b0381163b155b6141b95750565b635274afe760e01b60009081526001600160a01b0391909116600452602490fd5b600114156141b2565b6000818152600080516020614629833981519152602090815260408083206001600160a01b038616845290915290205460ff16613d72576000818152600080516020614629833981519152602090815260408083206001600160a01b0395909516808452949091528120805460ff19166001179055339291907f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d9080a4600190565b6000818152600080516020614629833981519152602090815260408083206001600160a01b038616845290915290205460ff1615613d72576000818152600080516020614629833981519152602090815260408083206001600160a01b0395909516808452949091528120805460ff19169055339291907ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9080a4600190565b60ff6000805160206146a98339815191525460401c161561434257565b631afcd79f60e31b60005260046000fd5b8054821015613abb5760005260206000200190600090565b6001810190826000528160205260406000205415600014613c69578054600160401b811015613881576143bf6143a8826001879401855584614353565b819391549060031b91821b91600019901b19161790565b90555491600052602052604060002055600190565b906001820191816000528260205260406000205480151560001461449e57600019810181811161393957825460001981019190821161393957818103614467575b5050508054801561445157600019019061442f8282614353565b8154906000199060031b1b191690555560005260205260006040812055600190565b634e487b7160e01b600052603160045260246000fd5b6144876144776143a89386614353565b90549060031b1c92839286614353565b905560005283602052604060002055388080614415565b50505050600090565b906144cd57508051156144bc57602081519101fd5b63d6bda27560e01b60005260046000fd5b815115806144ff575b6144de575090565b639996b31560e01b60009081526001600160a01b0391909116600452602490fd5b50803b156144d656fe2c0a5f5ab0ba371221bb3612c2d2f90d36566279309f526000c5b354efd1b0658c67aaac7f77de07240e5a9b36dfdccb2a89c438635abbb27a73142d2aa0f629c1f6fe24621ce81ec5827caf0253cadb74709b061630e6b55e8237170593200048b07fab687f450848f1df8a96db08fef7840f53415f18fdc2ec8e9f810f0930c7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d275027301df982f5215b4963a854cf9c73219df80cb6acd8f098189c9480c7bbc360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc17dc5b1290f7495d7f8cc68476e6941aaf510598fa925d0d2720edc8805a846c4460507c21097c15f6883572ebd157a9ee4b1d989a312314e93afd9d2ecd494002dd7bc7dec4dceedda775e58dd541e08a116c6c53815c0bd028192f7b626800cd5ed15c6e187e77e9aee88184c21f4f2182ab5827cb3b7e07fbedcd63f033009b779b17422d0df92223018b32b4d1fa46e071723d6817e2486d003becc55f00a49807205ce4d355092ef5a8a18f56e8913cf4a201fbe287825b095693c21775f0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a006d129bd71f2401cbe77f49f546d7d5f58992faecfca6e51ba06b50b261e83331a164736f6c6343000822000a";
116748
116662
  var isSuperArgs = (xs) => xs.length > 1;
116749
116663
  var SimplePSMV2__factory = class extends ContractFactory {
116750
116664
  constructor(...args) {
@@ -122772,7 +122686,7 @@ Error data: ${errorData || "none"}`
122772
122686
  source: json.data.source
122773
122687
  };
122774
122688
  }
122775
- const result = await this.bitcoinOperations.getPrice("fast", false);
122689
+ const result = await this.bitcoinOperations.getPrice(false);
122776
122690
  if (!result.success) {
122777
122691
  const cause = result.error?.originalError?.message ?? String(result.error);
122778
122692
  throw new Error(`Failed to get BTC price: ${cause}`);
@@ -123000,6 +122914,44 @@ Error data: ${errorData || "none"}`
123000
122914
  }));
123001
122915
  }
123002
122916
  }
122917
+ /**
122918
+ * Get a PKP-signed TOTAL confirmed Bitcoin balance for a raw vault ADDRESS
122919
+ * (no positionId) via the `btc-address-balance` LIT Action.
122920
+ *
122921
+ * Exercises the balance-query path (BitcoinProviderRegistry decrypt →
122922
+ * cross-provider consensus → PKP signature) using only an address. This is
122923
+ * NOT a protocol trusted/available balance: authorized spends are not
122924
+ * subtracted, and the returned signature is an `AddressBalanceAttestation`
122925
+ * (NOT a `BalanceConfirmation` — it is not consumable by
122926
+ * `PositionManager.updateBalance`).
122927
+ */
122928
+ async getAddressBalance(vaultAddress) {
122929
+ this.ensureInitialized();
122930
+ try {
122931
+ if (this.config.mode !== "service") {
122932
+ throw new Error("getAddressBalance requires service mode \u2014 standalone mode is not supported");
122933
+ }
122934
+ const serviceEndpoint = this.config.serviceEndpoint;
122935
+ const url = `${serviceEndpoint}/api/lit/address-balance?vaultAddress=${encodeURIComponent(vaultAddress)}`;
122936
+ const response = await fetch(url, {
122937
+ headers: await this.getAuthHeader()
122938
+ });
122939
+ if (!response.ok) {
122940
+ throw new Error(`Address balance request failed: ${response.status} ${response.statusText}`);
122941
+ }
122942
+ const json = await response.json();
122943
+ if (!json.success)
122944
+ throw new Error(json.error ?? "Address balance request failed");
122945
+ return success(json.data);
122946
+ } catch (error2) {
122947
+ return failure(new SDKError({
122948
+ message: `Failed to get address balance: ${error2 instanceof Error ? error2.message : String(error2)}`,
122949
+ category: "CONFIGURATION" /* CONFIGURATION */,
122950
+ severity: "MEDIUM" /* MEDIUM */,
122951
+ originalError: error2 instanceof Error ? error2 : new Error(String(error2))
122952
+ }));
122953
+ }
122954
+ }
123003
122955
  // ============================================================================
123004
122956
  // HIGH-LEVEL API - Mock Token Operations (Test Networks Only)
123005
122957
  // ============================================================================