@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/browser/dist/browser.js +1 -1
- package/dist/contracts/typechain-contracts/factories/src/psm/SimplePSMV2__factory.d.ts +70 -11
- package/dist/contracts/typechain-contracts/src/psm/SimplePSMV2.d.ts +68 -9
- package/dist/deployments.js +7 -7
- package/dist/deployments.mjs +7 -7
- package/dist/index.js +316 -364
- package/dist/index.mjs +316 -364
- package/dist/modules/bitcoin/bitcoin-operations.module.d.ts +8 -6
- package/dist/modules/diamond-hands-sdk.d.ts +19 -0
- package/dist/server.js +1 -1
- package/dist/server.mjs +1 -1
- package/dist/utils/eip712-login.d.ts +8 -1
- package/dist/utils/service-endpoint-policy.d.ts +7 -2
- package/package.json +3 -3
package/dist/index.js
CHANGED
|
@@ -3689,11 +3689,11 @@ var init_deployment_addresses = __esm({
|
|
|
3689
3689
|
reason: "Shared upgrade script: LoanOperationsManagerModule implementation update"
|
|
3690
3690
|
},
|
|
3691
3691
|
UCDController: {
|
|
3692
|
-
previousImplementation: "
|
|
3693
|
-
newImplementation: "
|
|
3694
|
-
upgradedAt: "2026-
|
|
3692
|
+
previousImplementation: "0x30d0458bE846f4C5D231242eB5a9e9Db68e7232F",
|
|
3693
|
+
newImplementation: "0xF820098c311C736AB1793656044d95A0F6806B27",
|
|
3694
|
+
upgradedAt: "2026-06-02T11:35:00.000Z",
|
|
3695
3695
|
upgradedBy: "0xF20986F02420EF443AE9BE5092FB8A4975cF3aA6",
|
|
3696
|
-
reason: "
|
|
3696
|
+
reason: "H-1: UCDController v1.4.0 \u2014 liquidationManager slot + dailyBurnLimit exemption, __gap 28->27"
|
|
3697
3697
|
},
|
|
3698
3698
|
TermManagerModule: {
|
|
3699
3699
|
previousImplementation: "0x309CE239A87ffFB31d4C720804e9908E482d4f10",
|
|
@@ -3752,9 +3752,9 @@ var init_deployment_addresses = __esm({
|
|
|
3752
3752
|
reason: "Shared upgrade script: CollateralManagerModule implementation update"
|
|
3753
3753
|
},
|
|
3754
3754
|
LiquidationManagerModule: {
|
|
3755
|
-
previousImplementation: "
|
|
3756
|
-
newImplementation: "
|
|
3757
|
-
upgradedAt: "2026-
|
|
3755
|
+
previousImplementation: "0xD99bdF37a8C259bbfb394b4CdB03e76731Fa4904",
|
|
3756
|
+
newImplementation: "0xE1B3352A702acd16fDffe9C15646d723d112456F",
|
|
3757
|
+
upgradedAt: "2026-06-02T11:37:00.686Z",
|
|
3758
3758
|
upgradedBy: "0xF20986F02420EF443AE9BE5092FB8A4975cF3aA6",
|
|
3759
3759
|
reason: "Shared upgrade script: LiquidationManagerModule implementation update"
|
|
3760
3760
|
},
|
|
@@ -31149,7 +31149,6 @@ var require_pkg_src = __commonJS({
|
|
|
31149
31149
|
executeLitAction: () => executeLitAction,
|
|
31150
31150
|
executePkpOperation: () => executePkpOperation,
|
|
31151
31151
|
executePriceOracle: () => executePriceOracle,
|
|
31152
|
-
executePriceOracleConsensus: () => executePriceOracleConsensus,
|
|
31153
31152
|
executeVaultSnapshot: () => executeVaultSnapshot,
|
|
31154
31153
|
generateSessionSignatures: () => generateSessionSignatures,
|
|
31155
31154
|
generateSessionSignaturesWithCache: () => generateSessionSignaturesWithCache,
|
|
@@ -31335,30 +31334,30 @@ var require_pkg_src = __commonJS({
|
|
|
31335
31334
|
}
|
|
31336
31335
|
var DH_LIT_ACTIONS_CHIPOTLE3 = {
|
|
31337
31336
|
authorizationDummy: {
|
|
31338
|
-
cid: "
|
|
31337
|
+
cid: "QmeeYQ3zfDPKJQg3JG5p4TpxKHEnDRLXZbT79KxzwC3xjc",
|
|
31339
31338
|
authorizedCidHex: cidToHex(
|
|
31340
|
-
"
|
|
31339
|
+
"QmeeYQ3zfDPKJQg3JG5p4TpxKHEnDRLXZbT79KxzwC3xjc"
|
|
31341
31340
|
),
|
|
31342
31341
|
name: "Authorization Dummy",
|
|
31343
31342
|
description: "Production Authorization Dummy",
|
|
31344
31343
|
version: "1.0.0",
|
|
31345
31344
|
deployed: true,
|
|
31346
|
-
deployedAt:
|
|
31347
|
-
size:
|
|
31348
|
-
hash: "
|
|
31345
|
+
deployedAt: 1780400482915,
|
|
31346
|
+
size: 2216,
|
|
31347
|
+
hash: "5f862b4635f2e04b033c4ff652addc017c3c0a325f81309a24d701c90e0bc950"
|
|
31349
31348
|
},
|
|
31350
31349
|
authorizationDummyB: {
|
|
31351
|
-
cid: "
|
|
31350
|
+
cid: "QmQHKDp5GDBp2XoStcm3SE6EvdJpK5RJ5ij4ZkQFn6dcMU",
|
|
31352
31351
|
authorizedCidHex: cidToHex(
|
|
31353
|
-
"
|
|
31352
|
+
"QmQHKDp5GDBp2XoStcm3SE6EvdJpK5RJ5ij4ZkQFn6dcMU"
|
|
31354
31353
|
),
|
|
31355
31354
|
name: "Authorization Dummy B",
|
|
31356
31355
|
description: "Production Authorization Dummy B",
|
|
31357
31356
|
version: "1.0.0",
|
|
31358
31357
|
deployed: true,
|
|
31359
|
-
deployedAt:
|
|
31360
|
-
size:
|
|
31361
|
-
hash: "
|
|
31358
|
+
deployedAt: 1780400494581,
|
|
31359
|
+
size: 1885,
|
|
31360
|
+
hash: "d6eb8665fa4f1fe19b6a2bc81fbf729af68a1daf30117f40e37705381978a7ce"
|
|
31362
31361
|
},
|
|
31363
31362
|
pkpValidator: {
|
|
31364
31363
|
cid: "QmTqsmXkjib7CRGFcEhmCs61Z3EZTaRPznaZDDLk5Wq9NX",
|
|
@@ -31379,30 +31378,30 @@ var require_pkg_src = __commonJS({
|
|
|
31379
31378
|
}
|
|
31380
31379
|
},
|
|
31381
31380
|
btcTransactionSigner: {
|
|
31382
|
-
cid: "
|
|
31381
|
+
cid: "QmYMA6hLroPC2uGHeS1AxSz1xAwpZZRpGqZd3hQx3tf63o",
|
|
31383
31382
|
authorizedCidHex: cidToHex(
|
|
31384
|
-
"
|
|
31383
|
+
"QmYMA6hLroPC2uGHeS1AxSz1xAwpZZRpGqZd3hQx3tf63o"
|
|
31385
31384
|
),
|
|
31386
31385
|
name: "Btc Transaction Signer",
|
|
31387
31386
|
description: "Production Btc Transaction Signer",
|
|
31388
31387
|
version: "1.0.0",
|
|
31389
31388
|
deployed: true,
|
|
31390
|
-
deployedAt:
|
|
31391
|
-
size:
|
|
31392
|
-
hash: "
|
|
31389
|
+
deployedAt: 1780400513420,
|
|
31390
|
+
size: 27884,
|
|
31391
|
+
hash: "b7e4abec403555d85e2b0eaabed0fdd95640b5f0d068c67bba63afaa2cd200d0"
|
|
31393
31392
|
},
|
|
31394
31393
|
ucdMintValidator: {
|
|
31395
|
-
cid: "
|
|
31394
|
+
cid: "QmdfotNWFe9at78piu4zKqN1Hk6GDY97ofC8YWABoRxNTz",
|
|
31396
31395
|
authorizedCidHex: cidToHex(
|
|
31397
|
-
"
|
|
31396
|
+
"QmdfotNWFe9at78piu4zKqN1Hk6GDY97ofC8YWABoRxNTz"
|
|
31398
31397
|
),
|
|
31399
31398
|
name: "Ucd Mint Validator",
|
|
31400
31399
|
description: "Production Ucd Mint Validator",
|
|
31401
31400
|
version: "1.0.0",
|
|
31402
31401
|
deployed: true,
|
|
31403
|
-
deployedAt:
|
|
31404
|
-
size:
|
|
31405
|
-
hash: "
|
|
31402
|
+
deployedAt: 1780420101129,
|
|
31403
|
+
size: 67513,
|
|
31404
|
+
hash: "6918134d5daa56f01e3077e0716976103bd2d4ff3efddc8c2e388484953eb1fa",
|
|
31406
31405
|
validatorWalletAddress: "0x36f3dd61c4c08a56d29ed2fd6d5f111b67b6a7a1",
|
|
31407
31406
|
pkp: {
|
|
31408
31407
|
publicKey: "0x041ab17cd91fc5c0b761eea6092d032807561b621b82c488826776e04a9158d61ba64d809a4729f0501289d980732cb06d8dfd06999dd9c8efd2f495dad78b31bb",
|
|
@@ -31410,17 +31409,17 @@ var require_pkg_src = __commonJS({
|
|
|
31410
31409
|
}
|
|
31411
31410
|
},
|
|
31412
31411
|
processPaymentValidator: {
|
|
31413
|
-
cid: "
|
|
31412
|
+
cid: "QmcMditbgi5wMzTxzwypKjM7PqPnmpmuUigw7hN8jkShiS",
|
|
31414
31413
|
authorizedCidHex: cidToHex(
|
|
31415
|
-
"
|
|
31414
|
+
"QmcMditbgi5wMzTxzwypKjM7PqPnmpmuUigw7hN8jkShiS"
|
|
31416
31415
|
),
|
|
31417
31416
|
name: "Process Payment Validator",
|
|
31418
31417
|
description: "Production Process Payment Validator",
|
|
31419
31418
|
version: "1.0.0",
|
|
31420
31419
|
deployed: true,
|
|
31421
|
-
deployedAt:
|
|
31422
|
-
size:
|
|
31423
|
-
hash: "
|
|
31420
|
+
deployedAt: 1780400542927,
|
|
31421
|
+
size: 64086,
|
|
31422
|
+
hash: "e4794a8fadfe03ecc7f25c834279a96f5342a5564e1851a7dca0e96d221f51a1",
|
|
31424
31423
|
validatorWalletAddress: "0xc2ed5a59bd81eb4d1a19a0147b86ab69aa4c28ba",
|
|
31425
31424
|
pkp: {
|
|
31426
31425
|
publicKey: "0x04cfccb9b6c7addc79469c0e9fafebef4c70801302c62cdb26b610723a9b8527d23f98a40158c7340d83fd0e62d02b5ec74c12f7a86d98e8c6973b4811110f19ad",
|
|
@@ -31428,17 +31427,17 @@ var require_pkg_src = __commonJS({
|
|
|
31428
31427
|
}
|
|
31429
31428
|
},
|
|
31430
31429
|
extendPositionValidator: {
|
|
31431
|
-
cid: "
|
|
31430
|
+
cid: "QmSCnZGHNCKNArhogT2xvGgfb58qhfM3APFWQmmkSA1jbz",
|
|
31432
31431
|
authorizedCidHex: cidToHex(
|
|
31433
|
-
"
|
|
31432
|
+
"QmSCnZGHNCKNArhogT2xvGgfb58qhfM3APFWQmmkSA1jbz"
|
|
31434
31433
|
),
|
|
31435
31434
|
name: "Extend Position Validator",
|
|
31436
31435
|
description: "Production Extend Position Validator",
|
|
31437
31436
|
version: "1.0.1",
|
|
31438
31437
|
deployed: true,
|
|
31439
|
-
deployedAt:
|
|
31440
|
-
size:
|
|
31441
|
-
hash: "
|
|
31438
|
+
deployedAt: 1780385632236,
|
|
31439
|
+
size: 63008,
|
|
31440
|
+
hash: "7e3ac42b2f26e2ab9a0801e2f94da8d9dbcf02a8bf27a78b954d79832d8eb1a7",
|
|
31442
31441
|
validatorWalletAddress: "0xb3f4271c475887a86a2f21446f0968c30cc74c97",
|
|
31443
31442
|
pkp: {
|
|
31444
31443
|
publicKey: "0x04e52338f6a0c3362800f1a94c4c8f08be5030dde0fa217388c53d1c1a4790f4443c9f2886b2d2d8f4b75a9a156e9b028011b1a1cf7648da0e556aa980ec692836",
|
|
@@ -31446,17 +31445,17 @@ var require_pkg_src = __commonJS({
|
|
|
31446
31445
|
}
|
|
31447
31446
|
},
|
|
31448
31447
|
btcWithdrawal: {
|
|
31449
|
-
cid: "
|
|
31448
|
+
cid: "QmbsmTg6RuE6SGUkXqkcXSaWy99ydUtyLoFCBxiHuqpSKC",
|
|
31450
31449
|
authorizedCidHex: cidToHex(
|
|
31451
|
-
"
|
|
31450
|
+
"QmbsmTg6RuE6SGUkXqkcXSaWy99ydUtyLoFCBxiHuqpSKC"
|
|
31452
31451
|
),
|
|
31453
31452
|
name: "Btc Withdrawal",
|
|
31454
31453
|
description: "Production Btc Withdrawal",
|
|
31455
31454
|
version: "1.0.0",
|
|
31456
31455
|
deployed: true,
|
|
31457
|
-
deployedAt:
|
|
31458
|
-
size:
|
|
31459
|
-
hash: "
|
|
31456
|
+
deployedAt: 1780400560069,
|
|
31457
|
+
size: 74485,
|
|
31458
|
+
hash: "dc62aa5f52c8ad3c86f8c99f9f08519d036e716554682ccb1f7227ca969df118",
|
|
31460
31459
|
validatorWalletAddress: "0xbb137fbda353199e9419b698c57a742124d4987d",
|
|
31461
31460
|
pkp: {
|
|
31462
31461
|
publicKey: "0x043616787c5432415c24378c4ef48de2bcd6bb7b575b837e3cff09171802662da7105d79586c7659677a0ecbaddac4cce06cb2a11f69a16fa0c4d7002ac7d51a4d",
|
|
@@ -31464,17 +31463,17 @@ var require_pkg_src = __commonJS({
|
|
|
31464
31463
|
}
|
|
31465
31464
|
},
|
|
31466
31465
|
liquidationValidator: {
|
|
31467
|
-
cid: "
|
|
31466
|
+
cid: "QmVLyKW74S6jMeAssqsGmy7VwGRAHYzdUqLJBuAyvDMo99",
|
|
31468
31467
|
authorizedCidHex: cidToHex(
|
|
31469
|
-
"
|
|
31468
|
+
"QmVLyKW74S6jMeAssqsGmy7VwGRAHYzdUqLJBuAyvDMo99"
|
|
31470
31469
|
),
|
|
31471
31470
|
name: "Liquidation Validator",
|
|
31472
31471
|
description: "Production Liquidation Validator",
|
|
31473
31472
|
version: "1.0.0",
|
|
31474
31473
|
deployed: true,
|
|
31475
|
-
deployedAt:
|
|
31476
|
-
size:
|
|
31477
|
-
hash: "
|
|
31474
|
+
deployedAt: 1780385670005,
|
|
31475
|
+
size: 54164,
|
|
31476
|
+
hash: "cd32efc888d2808dfc81a75a6d97095f543efa12edb61c9070a4003c47d5f4a0",
|
|
31478
31477
|
validatorWalletAddress: "0x1542f863ee0340f6a067573e80ae66dd9b3838fa",
|
|
31479
31478
|
pkp: {
|
|
31480
31479
|
publicKey: "0x041a241de58976c13e3d7ca5a18e494f7330151e3818706135d50176e78ffb673e58b11f0b67a87c73fade6c6b27d6e7a7377ea9f4c10bf31880f1d725f18cc6f8",
|
|
@@ -31482,17 +31481,17 @@ var require_pkg_src = __commonJS({
|
|
|
31482
31481
|
}
|
|
31483
31482
|
},
|
|
31484
31483
|
priceOracle: {
|
|
31485
|
-
cid: "
|
|
31484
|
+
cid: "QmVk6KHLn6jimvheCUaZ2emvp4nxot2SUkotnjfbeRXvyp",
|
|
31486
31485
|
authorizedCidHex: cidToHex(
|
|
31487
|
-
"
|
|
31486
|
+
"QmVk6KHLn6jimvheCUaZ2emvp4nxot2SUkotnjfbeRXvyp"
|
|
31488
31487
|
),
|
|
31489
31488
|
name: "Price Oracle",
|
|
31490
31489
|
description: "Production Price Oracle (Chipotle main+getPrivateKey)",
|
|
31491
31490
|
version: "1.1.0",
|
|
31492
31491
|
deployed: true,
|
|
31493
|
-
deployedAt:
|
|
31494
|
-
size:
|
|
31495
|
-
hash: "
|
|
31492
|
+
deployedAt: 1780385689501,
|
|
31493
|
+
size: 8354,
|
|
31494
|
+
hash: "adc4d5181b22b9ad7e788c7aa846c556585062fe3fadf7586a5c5ba38a25b535",
|
|
31496
31495
|
validatorWalletAddress: "0x831ddf3048547b983efe3ccbbb35a45a53191651",
|
|
31497
31496
|
pkp: {
|
|
31498
31497
|
publicKey: "0x043beaa1da47875601a8d6f430b1438ee2d4732eefd06e5c63a474bbdaf9e7df1797b1b951e041b627c2bf839788164825324c9cbd1e2d6f740fdd4bff69b1900b",
|
|
@@ -31500,35 +31499,59 @@ var require_pkg_src = __commonJS({
|
|
|
31500
31499
|
}
|
|
31501
31500
|
},
|
|
31502
31501
|
loanVaultBtcBalance: {
|
|
31503
|
-
cid: "
|
|
31502
|
+
cid: "QmUogHM5eg7J811HG4JBWQz6sGk2nDQctrM2wSUEfa2wQP",
|
|
31504
31503
|
authorizedCidHex: cidToHex(
|
|
31505
|
-
"
|
|
31504
|
+
"QmUogHM5eg7J811HG4JBWQz6sGk2nDQctrM2wSUEfa2wQP"
|
|
31506
31505
|
),
|
|
31507
31506
|
name: "Loan Vault Btc Balance",
|
|
31508
31507
|
description: "Production Loan Vault Btc Balance",
|
|
31509
31508
|
version: "1.0.0",
|
|
31510
31509
|
deployed: true,
|
|
31511
|
-
deployedAt:
|
|
31512
|
-
size:
|
|
31513
|
-
hash: "
|
|
31510
|
+
deployedAt: 1780385701675,
|
|
31511
|
+
size: 44009,
|
|
31512
|
+
hash: "cd12e9ea2ca660675fa84ab199fb5f579f45003f137270b56569c528ef15f88a",
|
|
31514
31513
|
validatorWalletAddress: "0x47feea74c8739d24b44faa67217f2f99970e15e7",
|
|
31515
31514
|
pkp: {
|
|
31516
31515
|
publicKey: "0x043616787c5432415c24378c4ef48de2bcd6bb7b575b837e3cff09171802662da7105d79586c7659677a0ecbaddac4cce06cb2a11f69a16fa0c4d7002ac7d51a4d",
|
|
31517
31516
|
ethAddress: "0x7b9316cAA00B257F7CE30F7F6979bd6867BA9eE2"
|
|
31518
31517
|
}
|
|
31519
31518
|
},
|
|
31519
|
+
// btc-address-balance (Option B) — address-only signed total balance via
|
|
31520
|
+
// BitcoinProviderRegistry consensus (no positionId, no price). The deploy
|
|
31521
|
+
// step (deploy:chipotle:action) fills cid/authorizedCidHex/deployedAt/size/
|
|
31522
|
+
// hash + a DEDICATED validatorWalletAddress + pkp and flips deployed:true.
|
|
31523
|
+
// Requires BitcoinProviderRegistry.addAllowedCid(chainId, keccak256(utf8(cid)))
|
|
31524
|
+
// on each target chain (the action decrypts registry slots). No OAR entry.
|
|
31525
|
+
btcAddressBalance: {
|
|
31526
|
+
cid: "QmdF7eMxEc4UxFYPXhzyZ9dLkLeVwQNCfPrmirP1BGdSvT",
|
|
31527
|
+
authorizedCidHex: cidToHex(
|
|
31528
|
+
"QmdF7eMxEc4UxFYPXhzyZ9dLkLeVwQNCfPrmirP1BGdSvT"
|
|
31529
|
+
),
|
|
31530
|
+
name: "Btc Address Balance",
|
|
31531
|
+
description: "Address-only signed total BTC balance via registry consensus (no positionId, no price)",
|
|
31532
|
+
version: "0.1.0",
|
|
31533
|
+
deployed: true,
|
|
31534
|
+
deployedAt: 1780425819676,
|
|
31535
|
+
size: 21664,
|
|
31536
|
+
hash: "89936009f1de066e41234de5a28a75ca31ce0b2ae9c7f47f299c995b8e112599",
|
|
31537
|
+
validatorWalletAddress: "0xf0bf5e3f864b87283a05d1e4a85ee0fa40493fb5",
|
|
31538
|
+
pkp: {
|
|
31539
|
+
publicKey: "0x0498cbb31facfa26e3ec83ccdabfe4fe341ca0282e0c3cb81da7113723b9726e1e49efa92165cc3faa66ced4454cea56dbab12267852d6525a55d7c4f128b912cd",
|
|
31540
|
+
ethAddress: "0xF0bF5e3f864B87283a05D1E4A85eE0FA40493fB5"
|
|
31541
|
+
}
|
|
31542
|
+
},
|
|
31520
31543
|
alwaysSigner: {
|
|
31521
|
-
cid: "
|
|
31544
|
+
cid: "Qmbf27pDimUe5GAdTYYd7poV7rHqUgctxtWd7HTui3Amig",
|
|
31522
31545
|
authorizedCidHex: cidToHex(
|
|
31523
|
-
"
|
|
31546
|
+
"Qmbf27pDimUe5GAdTYYd7poV7rHqUgctxtWd7HTui3Amig"
|
|
31524
31547
|
),
|
|
31525
31548
|
name: "Always Signer",
|
|
31526
31549
|
description: "Production Always Signer",
|
|
31527
31550
|
version: "1.0.0",
|
|
31528
31551
|
deployed: true,
|
|
31529
|
-
deployedAt:
|
|
31530
|
-
size:
|
|
31531
|
-
hash: "
|
|
31552
|
+
deployedAt: 1780400578692,
|
|
31553
|
+
size: 4333,
|
|
31554
|
+
hash: "1a7101c026a638f2f7cbdce02c6b8b0a55e44cc5cfc7e9440fe029b5c5be693e"
|
|
31532
31555
|
},
|
|
31533
31556
|
ethersVersionProbe: {
|
|
31534
31557
|
cid: "QmYEfBWgTYc1pPH6vqazNGfnShfMKCVeiwcXGrWgehqK5A",
|
|
@@ -32306,14 +32329,11 @@ ${errorReport}`);
|
|
|
32306
32329
|
init_debug_logger();
|
|
32307
32330
|
init_session_signature_cache();
|
|
32308
32331
|
var import_ethers13 = require_lib2();
|
|
32309
|
-
var ACTIVE_LOAN_LIQUIDATION_THRESHOLD_BPS = 13e3;
|
|
32310
32332
|
var EXPIRED_LOAN_MIN_LIQUIDATION_THRESHOLD_BPS = 11e3;
|
|
32311
32333
|
var GRACE_PERIOD_DAYS = 30;
|
|
32312
32334
|
var SATOSHIS_PER_BITCOIN = 100000000n;
|
|
32313
32335
|
var PRICE_ORACLE_DECIMALS = 100000000n;
|
|
32314
32336
|
var UCD_TOKEN_DECIMALS = 1000000000000000000n;
|
|
32315
|
-
var PRICE_ORACLE_OUTLIER_DEVIATION_THRESHOLD = 0.02;
|
|
32316
|
-
var PRICE_ORACLE_DISPERSION_THRESHOLD = 0.05;
|
|
32317
32337
|
var MAX_BTC_AMOUNT = 25e6 * 1e8;
|
|
32318
32338
|
var UTXO_QUERY_MAX_RETRIES = 3;
|
|
32319
32339
|
var UTXO_QUERY_RETRY_DELAY_MS = 500;
|
|
@@ -32397,7 +32417,7 @@ ${errorReport}`);
|
|
|
32397
32417
|
}
|
|
32398
32418
|
function calculateLiquidationThreshold(isExpired, daysIntoGracePeriod, activeLoanThresholdBps, maxExpiredThresholdBps) {
|
|
32399
32419
|
if (!isExpired) {
|
|
32400
|
-
return activeLoanThresholdBps
|
|
32420
|
+
return activeLoanThresholdBps;
|
|
32401
32421
|
}
|
|
32402
32422
|
const maxThreshold = maxExpiredThresholdBps ?? EXPIRED_LOAN_MIN_LIQUIDATION_THRESHOLD_BPS;
|
|
32403
32423
|
const day = Math.min(daysIntoGracePeriod, GRACE_PERIOD_DAYS);
|
|
@@ -32665,7 +32685,7 @@ ${errorReport}`);
|
|
|
32665
32685
|
positionId,
|
|
32666
32686
|
positionState.vaultAddress
|
|
32667
32687
|
),
|
|
32668
|
-
this.config.priceOracle.
|
|
32688
|
+
this.config.priceOracle.getBTCPrice()
|
|
32669
32689
|
]);
|
|
32670
32690
|
const protocolParams = createProtocolParametersModule({
|
|
32671
32691
|
termManagerAddress: this.config.termManagerAddress,
|
|
@@ -32771,7 +32791,7 @@ ${errorReport}`);
|
|
|
32771
32791
|
true
|
|
32772
32792
|
// Always skip UTXO validation for fast path
|
|
32773
32793
|
),
|
|
32774
|
-
this.config.priceOracle.
|
|
32794
|
+
this.config.priceOracle.getBTCPrice()
|
|
32775
32795
|
]);
|
|
32776
32796
|
const protocolParams = createProtocolParametersModule({
|
|
32777
32797
|
termManagerAddress: this.config.termManagerAddress,
|
|
@@ -33073,7 +33093,7 @@ ${errorReport}`);
|
|
|
33073
33093
|
*
|
|
33074
33094
|
* @param positionId - Position to check
|
|
33075
33095
|
* @param additionalDebt - Additional UCD debt to add
|
|
33076
|
-
* @param requiredRatioBps - Required collateral ratio (e.g.,
|
|
33096
|
+
* @param requiredRatioBps - Required collateral ratio (e.g., 11000 for 110%)
|
|
33077
33097
|
* @returns True if sufficient collateral exists
|
|
33078
33098
|
*/
|
|
33079
33099
|
async hasSufficientCollateral(positionId, additionalDebt, requiredRatioBps) {
|
|
@@ -33834,27 +33854,23 @@ ${errorReport}`);
|
|
|
33834
33854
|
static {
|
|
33835
33855
|
this.ACTIVE_PROVIDER_NAMES = [
|
|
33836
33856
|
"cryptocompare",
|
|
33837
|
-
"coinbase",
|
|
33838
|
-
"binance",
|
|
33839
33857
|
"coinmarketcap",
|
|
33840
33858
|
"coingecko"
|
|
33841
33859
|
];
|
|
33842
33860
|
}
|
|
33843
33861
|
static {
|
|
33844
|
-
this.
|
|
33862
|
+
this.REQUIRED_PROVIDER_COUNT = 3;
|
|
33845
33863
|
}
|
|
33846
33864
|
/**
|
|
33847
33865
|
* @param priceProvidersOrConfig - REQUIRED in production flows. An array of
|
|
33848
|
-
* `{name, apiKey}` entries
|
|
33849
|
-
* deduplicated so three entries with
|
|
33850
|
-
* single provider
|
|
33866
|
+
* exactly 3 `{name, apiKey}` entries, one per locked provider. Every entry
|
|
33867
|
+
* needs an apiKey. Names are deduplicated so three entries with
|
|
33868
|
+
* `name: "coingecko"` collapse to a single provider — which then fails the
|
|
33869
|
+
* strict count check.
|
|
33851
33870
|
* @param legacySources - Test-only back door. When supplied, the constructor
|
|
33852
33871
|
* trusts the caller-supplied array verbatim and skips credential checks.
|
|
33853
|
-
*
|
|
33854
|
-
*
|
|
33855
|
-
* @param _mode - Ignored. Previously used to branch between dev / prod
|
|
33856
|
-
* validation. The oracle no longer has a "dev" relaxation; the parameter
|
|
33857
|
-
* is kept only for backward compatibility with existing call sites.
|
|
33872
|
+
* The strict count is still enforced (exactly 3).
|
|
33873
|
+
* @param _mode - Ignored. Retained for backward-compatible call sites.
|
|
33858
33874
|
*/
|
|
33859
33875
|
constructor(priceProvidersOrConfig, legacySources, _mode) {
|
|
33860
33876
|
if (legacySources && Array.isArray(legacySources)) {
|
|
@@ -33862,7 +33878,7 @@ ${errorReport}`);
|
|
|
33862
33878
|
} else {
|
|
33863
33879
|
if (!Array.isArray(priceProvidersOrConfig)) {
|
|
33864
33880
|
throw new Error(
|
|
33865
|
-
|
|
33881
|
+
`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(", ")
|
|
33866
33882
|
);
|
|
33867
33883
|
}
|
|
33868
33884
|
this.sources = this.buildSources(priceProvidersOrConfig);
|
|
@@ -33871,39 +33887,31 @@ ${errorReport}`);
|
|
|
33871
33887
|
this.validateProviderCount();
|
|
33872
33888
|
}
|
|
33873
33889
|
/**
|
|
33874
|
-
* Enforces
|
|
33875
|
-
*
|
|
33876
|
-
* Every caller — mint, extend, withdraw, liquidate, payment, balance — must
|
|
33877
|
-
* end up with at least {@link PriceOracleModule.MIN_DISTINCT_PROVIDERS}
|
|
33878
|
-
* distinct sources. Any relaxation here re-opens the oracle-manipulation
|
|
33879
|
-
* path flagged as H-5 in the audit.
|
|
33890
|
+
* Enforces strict 3-of-3. Any deviation re-opens the consensus-manipulation
|
|
33891
|
+
* path flagged as H-2 in the audit. There is no "≥3" or "3 of N" mode.
|
|
33880
33892
|
*/
|
|
33881
33893
|
validateProviderCount() {
|
|
33882
|
-
if (this.sources.length
|
|
33894
|
+
if (this.sources.length !== _PriceOracleModule.REQUIRED_PROVIDER_COUNT) {
|
|
33883
33895
|
throw new Error(
|
|
33884
|
-
`Price oracle requires
|
|
33896
|
+
`Price oracle requires exactly ${_PriceOracleModule.REQUIRED_PROVIDER_COUNT} providers. Currently configured: ${this.sources.length} provider(s). Locked production set: ${_PriceOracleModule.ACTIVE_PROVIDER_NAMES.join(", ")}`
|
|
33885
33897
|
);
|
|
33886
33898
|
}
|
|
33887
33899
|
}
|
|
33888
33900
|
/**
|
|
33889
33901
|
* Build price sources from the caller-supplied config.
|
|
33890
33902
|
*
|
|
33891
|
-
* Rules (all unconditional
|
|
33892
|
-
* -
|
|
33903
|
+
* Rules (all unconditional):
|
|
33904
|
+
* - Exactly 3 entries — reject fewer and reject more.
|
|
33905
|
+
* - Every entry must be a supported provider name from the locked set.
|
|
33893
33906
|
* - Every entry must carry an `apiKey`.
|
|
33894
|
-
* - Duplicates by `name` are rejected outright.
|
|
33895
|
-
* with different keys are still "one provider" from a risk standpoint
|
|
33896
|
-
* and do not satisfy the distinct-source requirement.
|
|
33897
|
-
* - The final set must contain at least 3 distinct providers.
|
|
33907
|
+
* - Duplicates by `name` are rejected outright.
|
|
33898
33908
|
*
|
|
33899
|
-
* Throws as soon as any rule is violated
|
|
33900
|
-
* entry would let the caller think consensus was achieved while the oracle
|
|
33901
|
-
* was actually running on a smaller / weaker pool.
|
|
33909
|
+
* Throws as soon as any rule is violated.
|
|
33902
33910
|
*/
|
|
33903
33911
|
buildSources(priceProviders) {
|
|
33904
|
-
if (priceProviders.length
|
|
33912
|
+
if (priceProviders.length !== _PriceOracleModule.REQUIRED_PROVIDER_COUNT) {
|
|
33905
33913
|
throw new Error(
|
|
33906
|
-
|
|
33914
|
+
`priceProviders must contain exactly ${_PriceOracleModule.REQUIRED_PROVIDER_COUNT} entries. Received: ${priceProviders.length}. Locked production set: ${_PriceOracleModule.ACTIVE_PROVIDER_NAMES.join(", ")}`
|
|
33907
33915
|
);
|
|
33908
33916
|
}
|
|
33909
33917
|
const sources = [];
|
|
@@ -33916,35 +33924,16 @@ ${errorReport}`);
|
|
|
33916
33924
|
const name = provider.name.toLowerCase();
|
|
33917
33925
|
if (!_PriceOracleModule.ACTIVE_PROVIDER_NAMES.includes(name)) {
|
|
33918
33926
|
throw new Error(
|
|
33919
|
-
`Unsupported price provider "${provider.name}".
|
|
33927
|
+
`Unsupported price provider "${provider.name}". Locked production set: ${_PriceOracleModule.ACTIVE_PROVIDER_NAMES.join(", ")}`
|
|
33920
33928
|
);
|
|
33921
33929
|
}
|
|
33922
33930
|
if (seen.has(name)) {
|
|
33923
33931
|
throw new Error(
|
|
33924
|
-
`Duplicate price provider "${name}" \u2014 the oracle requires
|
|
33932
|
+
`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(", ")}`
|
|
33925
33933
|
);
|
|
33926
33934
|
}
|
|
33927
33935
|
seen.add(name);
|
|
33928
33936
|
switch (name) {
|
|
33929
|
-
case "binance":
|
|
33930
|
-
if (!provider.apiKey) {
|
|
33931
|
-
throw new Error(
|
|
33932
|
-
"Binance provider requires an apiKey"
|
|
33933
|
-
);
|
|
33934
|
-
}
|
|
33935
|
-
sources.push(
|
|
33936
|
-
this.createBinanceSource(
|
|
33937
|
-
provider.apiKey,
|
|
33938
|
-
priority++
|
|
33939
|
-
)
|
|
33940
|
-
);
|
|
33941
|
-
break;
|
|
33942
|
-
case "coinbase":
|
|
33943
|
-
if (!provider.apiKey) {
|
|
33944
|
-
throw new Error("Coinbase provider requires an apiKey");
|
|
33945
|
-
}
|
|
33946
|
-
sources.push(this.createCoinbaseSource(provider.apiKey, priority++));
|
|
33947
|
-
break;
|
|
33948
33937
|
case "cryptocompare":
|
|
33949
33938
|
if (!provider.apiKey) {
|
|
33950
33939
|
throw new Error("CryptoCompare provider requires an apiKey");
|
|
@@ -33975,12 +33964,7 @@ ${errorReport}`);
|
|
|
33975
33964
|
throw new Error(`Unhandled provider: ${name}`);
|
|
33976
33965
|
}
|
|
33977
33966
|
}
|
|
33978
|
-
|
|
33979
|
-
throw new Error(
|
|
33980
|
-
`Insufficient price providers: need at least ${_PriceOracleModule.MIN_DISTINCT_PROVIDERS} distinct entries, got ${sources.length}.`
|
|
33981
|
-
);
|
|
33982
|
-
}
|
|
33983
|
-
return this.selectSampledSources(sources);
|
|
33967
|
+
return sources;
|
|
33984
33968
|
}
|
|
33985
33969
|
/**
|
|
33986
33970
|
* Create CryptoCompare price source
|
|
@@ -34001,7 +33985,9 @@ ${errorReport}`);
|
|
|
34001
33985
|
});
|
|
34002
33986
|
clearTimeout(timeoutId);
|
|
34003
33987
|
if (!res.ok) {
|
|
34004
|
-
throw new Error(
|
|
33988
|
+
throw new Error(
|
|
33989
|
+
`CryptoCompare HTTP ${res.status} ${res.statusText}`
|
|
33990
|
+
);
|
|
34005
33991
|
}
|
|
34006
33992
|
return await res.json();
|
|
34007
33993
|
} catch (error2) {
|
|
@@ -34033,7 +34019,7 @@ ${errorReport}`);
|
|
|
34033
34019
|
* Create shared fetch helper with timeout
|
|
34034
34020
|
* LIT runtime rejects custom User-Agent headers
|
|
34035
34021
|
*/
|
|
34036
|
-
createFetchJson() {
|
|
34022
|
+
createFetchJson(providerName) {
|
|
34037
34023
|
return async (url, headers) => {
|
|
34038
34024
|
const controller = new AbortController();
|
|
34039
34025
|
const timeoutMs = 5e3;
|
|
@@ -34044,7 +34030,9 @@ ${errorReport}`);
|
|
|
34044
34030
|
signal: controller.signal
|
|
34045
34031
|
});
|
|
34046
34032
|
if (!res.ok) {
|
|
34047
|
-
throw new Error(
|
|
34033
|
+
throw new Error(
|
|
34034
|
+
`${providerName} HTTP ${res.status} ${res.statusText}`
|
|
34035
|
+
);
|
|
34048
34036
|
}
|
|
34049
34037
|
return await res.json();
|
|
34050
34038
|
} finally {
|
|
@@ -34052,27 +34040,18 @@ ${errorReport}`);
|
|
|
34052
34040
|
}
|
|
34053
34041
|
};
|
|
34054
34042
|
}
|
|
34055
|
-
selectSampledSources(sources) {
|
|
34056
|
-
return [...sources].sort((a, b2) => a.name.toLowerCase().localeCompare(b2.name.toLowerCase())).slice(0, 3).map((s, idx) => ({ ...s, priority: idx + 1 }));
|
|
34057
|
-
}
|
|
34058
34043
|
/**
|
|
34059
34044
|
* Create CoinGecko price source.
|
|
34060
34045
|
*
|
|
34061
34046
|
* CoinGecko's public endpoint has no authentication, but we intentionally
|
|
34062
34047
|
* require the caller to supply either a Demo (`x-cg-demo-api-key`) or Pro
|
|
34063
|
-
* (`x-cg-pro-api-key`) key.
|
|
34064
|
-
* - An authenticated call has a predictable rate limit and per-key quota,
|
|
34065
|
-
* so node-level retries won't silently drop under load.
|
|
34066
|
-
* - The key identifies the Diamond Hands tenant, making ETL/abuse
|
|
34067
|
-
* traceable and revokable.
|
|
34068
|
-
* - It keeps the same "every provider needs a credential" invariant
|
|
34069
|
-
* across all supported providers (removes a special case).
|
|
34048
|
+
* (`x-cg-pro-api-key`) key.
|
|
34070
34049
|
*/
|
|
34071
34050
|
createCoinGeckoSource(apiKey, priority) {
|
|
34072
34051
|
if (!apiKey) {
|
|
34073
34052
|
throw new Error("createCoinGeckoSource requires an apiKey");
|
|
34074
34053
|
}
|
|
34075
|
-
const fetchJson = this.createFetchJson();
|
|
34054
|
+
const fetchJson = this.createFetchJson("CoinGecko");
|
|
34076
34055
|
return {
|
|
34077
34056
|
name: "CoinGecko",
|
|
34078
34057
|
fetchPrice: async () => {
|
|
@@ -34092,61 +34071,8 @@ ${errorReport}`);
|
|
|
34092
34071
|
priority
|
|
34093
34072
|
};
|
|
34094
34073
|
}
|
|
34095
|
-
/**
|
|
34096
|
-
* Create Binance price source. Requires apiKey.
|
|
34097
|
-
*
|
|
34098
|
-
* The public `/ticker/price` endpoint does not require a secret; only the
|
|
34099
|
-
* API key is sent as `X-MBX-APIKEY` for per-key rate limiting and
|
|
34100
|
-
* revokability.
|
|
34101
|
-
*/
|
|
34102
|
-
createBinanceSource(apiKey, priority) {
|
|
34103
|
-
if (!apiKey) {
|
|
34104
|
-
throw new Error("createBinanceSource requires an apiKey");
|
|
34105
|
-
}
|
|
34106
|
-
const fetchJson = this.createFetchJson();
|
|
34107
|
-
return {
|
|
34108
|
-
name: "Binance",
|
|
34109
|
-
fetchPrice: async () => {
|
|
34110
|
-
const url = new URL("https://api.binance.com/api/v3/ticker/price");
|
|
34111
|
-
url.searchParams.set("symbol", "BTCUSDT");
|
|
34112
|
-
const data = await fetchJson(url.toString(), {
|
|
34113
|
-
"X-MBX-APIKEY": apiKey
|
|
34114
|
-
});
|
|
34115
|
-
const price = Number(data?.price);
|
|
34116
|
-
if (!Number.isFinite(price) || price <= 0) {
|
|
34117
|
-
throw new Error("Invalid Binance price payload");
|
|
34118
|
-
}
|
|
34119
|
-
return price;
|
|
34120
|
-
},
|
|
34121
|
-
priority
|
|
34122
|
-
};
|
|
34123
|
-
}
|
|
34124
|
-
/**
|
|
34125
|
-
* Create Coinbase price source. Requires apiKey.
|
|
34126
|
-
*/
|
|
34127
|
-
createCoinbaseSource(apiKey, priority) {
|
|
34128
|
-
if (!apiKey) {
|
|
34129
|
-
throw new Error("createCoinbaseSource requires an apiKey");
|
|
34130
|
-
}
|
|
34131
|
-
const fetchJson = this.createFetchJson();
|
|
34132
|
-
return {
|
|
34133
|
-
name: "Coinbase",
|
|
34134
|
-
fetchPrice: async () => {
|
|
34135
|
-
const data = await fetchJson(
|
|
34136
|
-
"https://api.coinbase.com/v2/prices/BTC-USDT/spot",
|
|
34137
|
-
{ "CB-ACCESS-KEY": apiKey }
|
|
34138
|
-
);
|
|
34139
|
-
const price = Number(data?.data?.amount);
|
|
34140
|
-
if (!Number.isFinite(price) || price <= 0) {
|
|
34141
|
-
throw new Error("Invalid Coinbase price payload");
|
|
34142
|
-
}
|
|
34143
|
-
return price;
|
|
34144
|
-
},
|
|
34145
|
-
priority
|
|
34146
|
-
};
|
|
34147
|
-
}
|
|
34148
34074
|
createCoinMarketCapSource(apiKey, priority) {
|
|
34149
|
-
const fetchJson = this.createFetchJson();
|
|
34075
|
+
const fetchJson = this.createFetchJson("CoinMarketCap");
|
|
34150
34076
|
return {
|
|
34151
34077
|
name: "CoinMarketCap",
|
|
34152
34078
|
fetchPrice: async () => {
|
|
@@ -34169,17 +34095,21 @@ ${errorReport}`);
|
|
|
34169
34095
|
};
|
|
34170
34096
|
}
|
|
34171
34097
|
/**
|
|
34172
|
-
* Get BTC price in USD with 8 decimals
|
|
34098
|
+
* Get BTC price in USD with 8 decimals.
|
|
34173
34099
|
*
|
|
34174
|
-
*
|
|
34175
|
-
* All three
|
|
34176
|
-
* Returns the median
|
|
34100
|
+
* Strict 3-of-3: queries all sources in parallel; if any one fails, the whole
|
|
34101
|
+
* call fails (no fallback). All three prices must lie within 1% of each other
|
|
34102
|
+
* (`(hi - lo) / lo <= 0.01`). Returns the median of the three.
|
|
34103
|
+
*
|
|
34104
|
+
* This is the only signed-price path in the codebase. The previously-exposed
|
|
34105
|
+
* `getBTCPriceConsensus()` (with outlier filtering + lenient survivor median)
|
|
34106
|
+
* was removed in the H-2 fix.
|
|
34177
34107
|
*/
|
|
34178
34108
|
async getBTCPrice() {
|
|
34179
34109
|
const startTime = Date.now();
|
|
34180
|
-
if (this.sources.length !==
|
|
34110
|
+
if (this.sources.length !== _PriceOracleModule.REQUIRED_PROVIDER_COUNT) {
|
|
34181
34111
|
throw new Error(
|
|
34182
|
-
`Price oracle requires exactly
|
|
34112
|
+
`Price oracle requires exactly ${_PriceOracleModule.REQUIRED_PROVIDER_COUNT} providers. Currently configured: ${this.sources.length}`
|
|
34183
34113
|
);
|
|
34184
34114
|
}
|
|
34185
34115
|
const GLOBAL_TIMEOUT_MS = 8e3;
|
|
@@ -34193,9 +34123,17 @@ ${errorReport}`);
|
|
|
34193
34123
|
const fetchAll = Promise.all(
|
|
34194
34124
|
this.sources.map(async (source) => {
|
|
34195
34125
|
const t = Date.now();
|
|
34196
|
-
|
|
34197
|
-
|
|
34198
|
-
|
|
34126
|
+
try {
|
|
34127
|
+
const priceUSD = await source.fetchPrice();
|
|
34128
|
+
console.log(
|
|
34129
|
+
`[Price Oracle] \u2705 [+${Date.now() - t}ms] ${source.name}: $${priceUSD.toLocaleString()}`
|
|
34130
|
+
);
|
|
34131
|
+
return priceUSD;
|
|
34132
|
+
} catch (error2) {
|
|
34133
|
+
const cause = error2 instanceof Error ? error2.message : String(error2);
|
|
34134
|
+
console.log(`[Price Oracle] \u274C ${source.name}: ${cause}`);
|
|
34135
|
+
throw new Error(`${source.name} price fetch failed: ${cause}`);
|
|
34136
|
+
}
|
|
34199
34137
|
})
|
|
34200
34138
|
);
|
|
34201
34139
|
const prices = await Promise.race([fetchAll, timeoutPromise]);
|
|
@@ -34216,91 +34154,6 @@ ${errorReport}`);
|
|
|
34216
34154
|
console.log(`[Price Oracle] Price with 8 decimals: ${priceWith8Decimals}`);
|
|
34217
34155
|
return priceWith8Decimals;
|
|
34218
34156
|
}
|
|
34219
|
-
/**
|
|
34220
|
-
* Consensus across multiple sources with outlier detection
|
|
34221
|
-
* Returns median price from valid sources after filtering outliers
|
|
34222
|
-
*
|
|
34223
|
-
* Master's Wisdom: Two-Path Validation
|
|
34224
|
-
* 1. If ONE source is outlier (>2% from median) → FILTER it, continue with remaining
|
|
34225
|
-
* 2. If ALL sources too dispersed (>5% spread) → REJECT all, throw error
|
|
34226
|
-
*
|
|
34227
|
-
* Logic Flow:
|
|
34228
|
-
* 1. Calculate initial median from all sources
|
|
34229
|
-
* 2. Filter individual outliers (>2% from median)
|
|
34230
|
-
* 3. If outliers found: remove them, require minimum 2 sources remaining
|
|
34231
|
-
* 4. Recalculate median from valid sources only
|
|
34232
|
-
* 5. Check if remaining sources are too dispersed (max/min ratio > 1.05)
|
|
34233
|
-
* 6. Return final median or throw appropriate error
|
|
34234
|
-
*/
|
|
34235
|
-
async getBTCPriceConsensus() {
|
|
34236
|
-
console.log(`[Price Oracle] Fetching BTC price with consensus...`);
|
|
34237
|
-
const OUTLIER_DEVIATION = PRICE_ORACLE_OUTLIER_DEVIATION_THRESHOLD;
|
|
34238
|
-
const DISPERSION_THRESHOLD = PRICE_ORACLE_DISPERSION_THRESHOLD;
|
|
34239
|
-
const results = await Promise.allSettled(
|
|
34240
|
-
this.sources.map(async (source) => {
|
|
34241
|
-
const price = await source.fetchPrice();
|
|
34242
|
-
return { source: source.name, price };
|
|
34243
|
-
})
|
|
34244
|
-
);
|
|
34245
|
-
const successful = results.filter((r) => r.status === "fulfilled").map((r) => r.value);
|
|
34246
|
-
if (successful.length === 0) {
|
|
34247
|
-
throw new Error("No price sources returned data");
|
|
34248
|
-
}
|
|
34249
|
-
console.log(
|
|
34250
|
-
`[Price Oracle] Got prices from ${successful.length}/${this.sources.length} sources:`
|
|
34251
|
-
);
|
|
34252
|
-
successful.forEach((s) => {
|
|
34253
|
-
console.log(` ${s.source}: $${s.price.toLocaleString()}`);
|
|
34254
|
-
});
|
|
34255
|
-
const prices = successful.map((s) => s.price);
|
|
34256
|
-
prices.sort((a, b2) => a - b2);
|
|
34257
|
-
const initialMedian = prices[Math.floor(prices.length / 2)];
|
|
34258
|
-
const minPrice = prices[0];
|
|
34259
|
-
const maxPrice = prices[prices.length - 1];
|
|
34260
|
-
const dispersionRatio = maxPrice / minPrice;
|
|
34261
|
-
const validPrices = successful.filter((s) => {
|
|
34262
|
-
const deviation = Math.abs(s.price - initialMedian) / initialMedian;
|
|
34263
|
-
return deviation <= OUTLIER_DEVIATION;
|
|
34264
|
-
});
|
|
34265
|
-
if (dispersionRatio > 1 + DISPERSION_THRESHOLD && validPrices.length === successful.length) {
|
|
34266
|
-
throw new Error(
|
|
34267
|
-
`Price consensus failed: sources too dispersed (${((dispersionRatio - 1) * 100).toFixed(1)}% spread)`
|
|
34268
|
-
);
|
|
34269
|
-
}
|
|
34270
|
-
if (validPrices.length < successful.length) {
|
|
34271
|
-
const outliers = successful.filter(
|
|
34272
|
-
(s) => !validPrices.find((v) => v.source === s.source)
|
|
34273
|
-
);
|
|
34274
|
-
console.log(`[Price Oracle] \u26A0\uFE0F Detected ${outliers.length} outlier(s):`);
|
|
34275
|
-
outliers.forEach((o) => {
|
|
34276
|
-
const deviation = Math.abs(o.price - initialMedian) / initialMedian;
|
|
34277
|
-
console.log(
|
|
34278
|
-
` ${o.source}: $${o.price.toLocaleString()} (${(deviation * 100).toFixed(1)}% deviation)`
|
|
34279
|
-
);
|
|
34280
|
-
});
|
|
34281
|
-
if (validPrices.length < 2) {
|
|
34282
|
-
throw new Error(
|
|
34283
|
-
"Price consensus failed: insufficient valid sources after outlier removal"
|
|
34284
|
-
);
|
|
34285
|
-
}
|
|
34286
|
-
console.log(
|
|
34287
|
-
`[Price Oracle] \u2705 Outliers filtered, continuing with ${validPrices.length} valid sources`
|
|
34288
|
-
);
|
|
34289
|
-
const validPricesOnly = validPrices.map((v) => v.price);
|
|
34290
|
-
validPricesOnly.sort((a, b2) => a - b2);
|
|
34291
|
-
const finalMedian = validPricesOnly[Math.floor(validPricesOnly.length / 2)];
|
|
34292
|
-
console.log(
|
|
34293
|
-
`[Price Oracle] \u2705 Consensus price (median): $${finalMedian.toLocaleString()}`
|
|
34294
|
-
);
|
|
34295
|
-
const priceCents2 = Math.round(finalMedian * 100);
|
|
34296
|
-
return BigInt(priceCents2) * 1000000n;
|
|
34297
|
-
}
|
|
34298
|
-
console.log(
|
|
34299
|
-
`[Price Oracle] \u2705 Consensus price (median): $${initialMedian.toLocaleString()}`
|
|
34300
|
-
);
|
|
34301
|
-
const priceCents = Math.round(initialMedian * 100);
|
|
34302
|
-
return BigInt(priceCents) * 1000000n;
|
|
34303
|
-
}
|
|
34304
34157
|
};
|
|
34305
34158
|
var VaultBalanceModule = class {
|
|
34306
34159
|
constructor(config) {
|
|
@@ -34706,30 +34559,16 @@ ${errorReport}`);
|
|
|
34706
34559
|
const oracle = params?.customSources ? new PriceOracleModule({}, params.customSources, params?.mode) : new PriceOracleModule(params?.priceProviders, void 0, params?.mode);
|
|
34707
34560
|
return await oracle.getBTCPrice();
|
|
34708
34561
|
}
|
|
34709
|
-
async function executePriceOracleConsensus(params) {
|
|
34710
|
-
global.Lit = {
|
|
34711
|
-
Actions: {
|
|
34712
|
-
broadcastAndCollect: async ({
|
|
34713
|
-
name,
|
|
34714
|
-
value
|
|
34715
|
-
}) => {
|
|
34716
|
-
return [value];
|
|
34717
|
-
}
|
|
34718
|
-
}
|
|
34719
|
-
};
|
|
34720
|
-
const oracle = params?.customSources ? new PriceOracleModule({}, params.customSources, params?.mode) : new PriceOracleModule(params?.priceProviders, void 0, params?.mode);
|
|
34721
|
-
return await oracle.getBTCPriceConsensus();
|
|
34722
|
-
}
|
|
34723
34562
|
var NOLA_EXECUTORS = {
|
|
34724
34563
|
/**
|
|
34725
34564
|
* Vault Snapshot Executor
|
|
34726
|
-
*
|
|
34565
|
+
*
|
|
34727
34566
|
* Returns complete position health metrics:
|
|
34728
34567
|
* - BTC balance (total, authorized, available)
|
|
34729
34568
|
* - Collateral ratio and liquidation risk
|
|
34730
34569
|
* - Term status (duration, expiry, grace period)
|
|
34731
34570
|
* - Protocol parameters (fees, thresholds)
|
|
34732
|
-
*
|
|
34571
|
+
*
|
|
34733
34572
|
* Cost: FREE (no LIT Action execution)
|
|
34734
34573
|
* Same data as LIT Action would return
|
|
34735
34574
|
*/
|
|
@@ -34741,39 +34580,20 @@ ${errorReport}`);
|
|
|
34741
34580
|
},
|
|
34742
34581
|
/**
|
|
34743
34582
|
* Price Oracle Executor
|
|
34744
|
-
*
|
|
34745
|
-
* Returns
|
|
34746
|
-
* -
|
|
34747
|
-
* -
|
|
34748
|
-
* -
|
|
34749
|
-
*
|
|
34750
|
-
*
|
|
34583
|
+
*
|
|
34584
|
+
* Returns BTC price in USD (8 decimals) via strict 3-of-3 consensus:
|
|
34585
|
+
* - All 3 configured providers must respond
|
|
34586
|
+
* - Prices must agree within 1%
|
|
34587
|
+
* - Returns the median
|
|
34588
|
+
*
|
|
34751
34589
|
* Cost: FREE (no LIT Action execution)
|
|
34752
34590
|
* Use for: Price display, mint preview, collateral ratio calculation
|
|
34753
34591
|
*/
|
|
34754
34592
|
priceOracle: {
|
|
34755
34593
|
name: "price-oracle",
|
|
34756
|
-
description: "Get current BTC price (
|
|
34594
|
+
description: "Get current BTC price (strict 3-of-3 consensus)",
|
|
34757
34595
|
executor: executePriceOracle,
|
|
34758
|
-
version: "
|
|
34759
|
-
},
|
|
34760
|
-
/**
|
|
34761
|
-
* Price Oracle Consensus Executor
|
|
34762
|
-
*
|
|
34763
|
-
* Returns BTC price using multi-source consensus:
|
|
34764
|
-
* - Queries ALL configured sources
|
|
34765
|
-
* - Filters outliers (>2% deviation from median)
|
|
34766
|
-
* - Returns median of valid sources
|
|
34767
|
-
* - Rejects if sources too dispersed (>5% spread)
|
|
34768
|
-
*
|
|
34769
|
-
* Cost: FREE (no LIT Action execution)
|
|
34770
|
-
* Use for: High-stakes operations requiring price validation
|
|
34771
|
-
*/
|
|
34772
|
-
priceOracleConsensus: {
|
|
34773
|
-
name: "price-oracle-consensus",
|
|
34774
|
-
description: "Get BTC price with multi-source consensus",
|
|
34775
|
-
executor: executePriceOracleConsensus,
|
|
34776
|
-
version: "1.0.0"
|
|
34596
|
+
version: "2.0.0"
|
|
34777
34597
|
}
|
|
34778
34598
|
};
|
|
34779
34599
|
}
|
|
@@ -34794,6 +34614,15 @@ function logNetworkConfig(level, message, ...args) {
|
|
|
34794
34614
|
console[level](message, ...args);
|
|
34795
34615
|
}
|
|
34796
34616
|
}
|
|
34617
|
+
function readInitBackedEnv(name) {
|
|
34618
|
+
if (isNode2 && !isBrowser && typeof process !== "undefined" && process.env && typeof process.env[name] === "string") {
|
|
34619
|
+
const value = process.env[name].trim();
|
|
34620
|
+
if (value) {
|
|
34621
|
+
return value;
|
|
34622
|
+
}
|
|
34623
|
+
}
|
|
34624
|
+
return "";
|
|
34625
|
+
}
|
|
34797
34626
|
function getBrowserSafeConfig() {
|
|
34798
34627
|
if (isBrowser) {
|
|
34799
34628
|
return {
|
|
@@ -34887,7 +34716,7 @@ function getSepoliaConfig() {
|
|
|
34887
34716
|
});
|
|
34888
34717
|
return {
|
|
34889
34718
|
mode: "service",
|
|
34890
|
-
serviceEndpoint: "
|
|
34719
|
+
serviceEndpoint: readInitBackedEnv("LIT_OPS_ENDPOINT"),
|
|
34891
34720
|
chainId: 11155111,
|
|
34892
34721
|
name: "sepolia",
|
|
34893
34722
|
rpcUrls: [],
|
|
@@ -34915,7 +34744,7 @@ function getSepoliaConfig() {
|
|
|
34915
34744
|
positionDelegateRegistry: SEPOLIA_CONTRACTS.PositionDelegateRegistry || ""
|
|
34916
34745
|
},
|
|
34917
34746
|
subgraphs: {
|
|
34918
|
-
diamondHandsUrl: "
|
|
34747
|
+
diamondHandsUrl: readInitBackedEnv("SUBGRAPH_URL")
|
|
34919
34748
|
},
|
|
34920
34749
|
debug: true
|
|
34921
34750
|
};
|
|
@@ -107864,7 +107693,8 @@ function assertSafeServiceEndpoint(endpoint) {
|
|
|
107864
107693
|
return;
|
|
107865
107694
|
if (url.protocol === "http:") {
|
|
107866
107695
|
const host = url.hostname.replace(/^\[|\]$/g, "");
|
|
107867
|
-
const isLoopback = host === "localhost" || host === "127.0.0.1" || host === "::1" ||
|
|
107696
|
+
const isLoopback = host === "localhost" || host === "127.0.0.1" || host === "::1" || // IPv4 loopback range 127.0.0.0/8 (numeric — not resolvable/hijackable).
|
|
107697
|
+
/^127\.\d{1,3}\.\d{1,3}\.\d{1,3}$/.test(host);
|
|
107868
107698
|
if (isLoopback)
|
|
107869
107699
|
return;
|
|
107870
107700
|
throw new Error(
|
|
@@ -108259,16 +108089,25 @@ var LOGIN_TYPES = {
|
|
|
108259
108089
|
{ name: "nonce", type: "bytes32" }
|
|
108260
108090
|
]
|
|
108261
108091
|
};
|
|
108262
|
-
|
|
108092
|
+
var LOGIN_TYPES_WITH_AUDIENCE = {
|
|
108093
|
+
DhServerLogin: [
|
|
108094
|
+
{ name: "address", type: "address" },
|
|
108095
|
+
{ name: "issuedAt", type: "uint256" },
|
|
108096
|
+
{ name: "nonce", type: "bytes32" },
|
|
108097
|
+
{ name: "audience", type: "string" }
|
|
108098
|
+
]
|
|
108099
|
+
};
|
|
108100
|
+
async function buildSignedLoginPayload(signer, chainId, audience) {
|
|
108263
108101
|
const address = await signer.getAddress();
|
|
108264
108102
|
const message = {
|
|
108265
108103
|
address,
|
|
108266
108104
|
issuedAt: Math.floor(Date.now() / 1e3),
|
|
108267
|
-
nonce: hexlify(randomBytes2(32))
|
|
108105
|
+
nonce: hexlify(randomBytes2(32)),
|
|
108106
|
+
...audience ? { audience } : {}
|
|
108268
108107
|
};
|
|
108269
108108
|
const signature = await signer.signTypedData(
|
|
108270
108109
|
buildLoginDomain(chainId),
|
|
108271
|
-
LOGIN_TYPES,
|
|
108110
|
+
audience ? LOGIN_TYPES_WITH_AUDIENCE : LOGIN_TYPES,
|
|
108272
108111
|
message
|
|
108273
108112
|
);
|
|
108274
108113
|
return { chainId, message, signature };
|
|
@@ -108336,7 +108175,11 @@ var ServerSession = class {
|
|
|
108336
108175
|
return this.inFlight;
|
|
108337
108176
|
this.inFlight = (async () => {
|
|
108338
108177
|
try {
|
|
108339
|
-
const payload = await buildSignedLoginPayload(
|
|
108178
|
+
const payload = await buildSignedLoginPayload(
|
|
108179
|
+
this.signer,
|
|
108180
|
+
this.chainId,
|
|
108181
|
+
this.serviceEndpoint
|
|
108182
|
+
);
|
|
108340
108183
|
const res = await this.fetchImpl(
|
|
108341
108184
|
`${this.serviceEndpoint}/api/auth/login`,
|
|
108342
108185
|
{
|
|
@@ -112396,16 +112239,17 @@ var BitcoinOperations = class {
|
|
|
112396
112239
|
return { verified: false, reason: "not yet visible after retries" };
|
|
112397
112240
|
}
|
|
112398
112241
|
/**
|
|
112399
|
-
* Get current BTC price using LIT Protocol price oracle
|
|
112242
|
+
* Get current BTC price using LIT Protocol price oracle.
|
|
112400
112243
|
*
|
|
112401
|
-
*
|
|
112402
|
-
*
|
|
112244
|
+
* Strict 3-of-3: all three configured providers must respond within 1% of
|
|
112245
|
+
* each other, and the median is returned. The previous `mode: "fast" | "full"`
|
|
112246
|
+
* parameter (with single-source and lenient-consensus variants) was removed
|
|
112247
|
+
* in the H-2 audit fix — there is only one strict path now.
|
|
112403
112248
|
*
|
|
112404
|
-
* @param mode - Price fetch mode: "fast" (single source) or "full" (consensus)
|
|
112405
112249
|
* @param sign - Whether to request PKP signature on the price
|
|
112406
112250
|
* @returns BTC price result with timestamp and source
|
|
112407
112251
|
*/
|
|
112408
|
-
async getPrice(
|
|
112252
|
+
async getPrice(sign = false) {
|
|
112409
112253
|
if (!this.litOps) {
|
|
112410
112254
|
return failure(
|
|
112411
112255
|
new SDKError({
|
|
@@ -112420,13 +112264,11 @@ var BitcoinOperations = class {
|
|
|
112420
112264
|
async () => {
|
|
112421
112265
|
if (this.config.debug) {
|
|
112422
112266
|
log.info("\u{1F4B0} Fetching BTC price via LIT Protocol oracle", {
|
|
112423
|
-
mode,
|
|
112424
112267
|
sign,
|
|
112425
112268
|
hasSigner: !!this.config.signer
|
|
112426
112269
|
});
|
|
112427
112270
|
}
|
|
112428
112271
|
const result = await this.litOps.getBTCPrice({
|
|
112429
|
-
mode,
|
|
112430
112272
|
sign,
|
|
112431
112273
|
signer: this.config.signer,
|
|
112432
112274
|
pkpId: this.config.priceOraclePkpId,
|
|
@@ -112464,7 +112306,6 @@ var BitcoinOperations = class {
|
|
|
112464
112306
|
try {
|
|
112465
112307
|
const litOpsConfig = this.litOps?.getConfig?.() || {};
|
|
112466
112308
|
log.error("\u274C BTC price oracle failed", {
|
|
112467
|
-
mode,
|
|
112468
112309
|
sign,
|
|
112469
112310
|
errorMessage: error2 instanceof Error ? error2.message : String(error2),
|
|
112470
112311
|
errorStack: error2 instanceof Error ? error2.stack : void 0,
|
|
@@ -112481,7 +112322,6 @@ var BitcoinOperations = class {
|
|
|
112481
112322
|
severity: "MEDIUM" /* MEDIUM */,
|
|
112482
112323
|
originalError: error2 instanceof Error ? error2 : new Error(String(error2)),
|
|
112483
112324
|
context: {
|
|
112484
|
-
mode,
|
|
112485
112325
|
sign,
|
|
112486
112326
|
serviceEndpoint: this.litOps?.getConfig?.()?.serviceEndpoint,
|
|
112487
112327
|
network: this.litOps?.getConfig?.()?.network
|
|
@@ -115005,6 +114845,75 @@ var _abi = [
|
|
|
115005
114845
|
name: "AdminModuleUpdated",
|
|
115006
114846
|
type: "event"
|
|
115007
114847
|
},
|
|
114848
|
+
{
|
|
114849
|
+
anonymous: false,
|
|
114850
|
+
inputs: [
|
|
114851
|
+
{
|
|
114852
|
+
indexed: true,
|
|
114853
|
+
internalType: "address",
|
|
114854
|
+
name: "caller",
|
|
114855
|
+
type: "address"
|
|
114856
|
+
},
|
|
114857
|
+
{
|
|
114858
|
+
indexed: false,
|
|
114859
|
+
internalType: "uint256",
|
|
114860
|
+
name: "timestamp",
|
|
114861
|
+
type: "uint256"
|
|
114862
|
+
}
|
|
114863
|
+
],
|
|
114864
|
+
name: "ContractPaused",
|
|
114865
|
+
type: "event"
|
|
114866
|
+
},
|
|
114867
|
+
{
|
|
114868
|
+
anonymous: false,
|
|
114869
|
+
inputs: [
|
|
114870
|
+
{
|
|
114871
|
+
indexed: true,
|
|
114872
|
+
internalType: "address",
|
|
114873
|
+
name: "caller",
|
|
114874
|
+
type: "address"
|
|
114875
|
+
},
|
|
114876
|
+
{
|
|
114877
|
+
indexed: false,
|
|
114878
|
+
internalType: "uint256",
|
|
114879
|
+
name: "timestamp",
|
|
114880
|
+
type: "uint256"
|
|
114881
|
+
}
|
|
114882
|
+
],
|
|
114883
|
+
name: "ContractUnpaused",
|
|
114884
|
+
type: "event"
|
|
114885
|
+
},
|
|
114886
|
+
{
|
|
114887
|
+
anonymous: false,
|
|
114888
|
+
inputs: [
|
|
114889
|
+
{
|
|
114890
|
+
indexed: true,
|
|
114891
|
+
internalType: "address",
|
|
114892
|
+
name: "oldImplementation",
|
|
114893
|
+
type: "address"
|
|
114894
|
+
},
|
|
114895
|
+
{
|
|
114896
|
+
indexed: true,
|
|
114897
|
+
internalType: "address",
|
|
114898
|
+
name: "newImplementation",
|
|
114899
|
+
type: "address"
|
|
114900
|
+
},
|
|
114901
|
+
{
|
|
114902
|
+
indexed: false,
|
|
114903
|
+
internalType: "string",
|
|
114904
|
+
name: "version",
|
|
114905
|
+
type: "string"
|
|
114906
|
+
},
|
|
114907
|
+
{
|
|
114908
|
+
indexed: false,
|
|
114909
|
+
internalType: "uint256",
|
|
114910
|
+
name: "timestamp",
|
|
114911
|
+
type: "uint256"
|
|
114912
|
+
}
|
|
114913
|
+
],
|
|
114914
|
+
name: "ContractUpgraded",
|
|
114915
|
+
type: "event"
|
|
114916
|
+
},
|
|
115008
114917
|
{
|
|
115009
114918
|
anonymous: false,
|
|
115010
114919
|
inputs: [
|
|
@@ -115608,6 +115517,19 @@ var _abi = [
|
|
|
115608
115517
|
stateMutability: "view",
|
|
115609
115518
|
type: "function"
|
|
115610
115519
|
},
|
|
115520
|
+
{
|
|
115521
|
+
inputs: [],
|
|
115522
|
+
name: "VERSION",
|
|
115523
|
+
outputs: [
|
|
115524
|
+
{
|
|
115525
|
+
internalType: "string",
|
|
115526
|
+
name: "",
|
|
115527
|
+
type: "string"
|
|
115528
|
+
}
|
|
115529
|
+
],
|
|
115530
|
+
stateMutability: "view",
|
|
115531
|
+
type: "function"
|
|
115532
|
+
},
|
|
115611
115533
|
{
|
|
115612
115534
|
inputs: [
|
|
115613
115535
|
{
|
|
@@ -116057,6 +115979,11 @@ var _abi = [
|
|
|
116057
115979
|
internalType: "address",
|
|
116058
115980
|
name: "_admin",
|
|
116059
115981
|
type: "address"
|
|
115982
|
+
},
|
|
115983
|
+
{
|
|
115984
|
+
internalType: "address",
|
|
115985
|
+
name: "_adminModule",
|
|
115986
|
+
type: "address"
|
|
116060
115987
|
}
|
|
116061
115988
|
],
|
|
116062
115989
|
name: "initialize",
|
|
@@ -116788,19 +116715,6 @@ var _abi = [
|
|
|
116788
116715
|
stateMutability: "payable",
|
|
116789
116716
|
type: "function"
|
|
116790
116717
|
},
|
|
116791
|
-
{
|
|
116792
|
-
inputs: [],
|
|
116793
|
-
name: "version",
|
|
116794
|
-
outputs: [
|
|
116795
|
-
{
|
|
116796
|
-
internalType: "string",
|
|
116797
|
-
name: "",
|
|
116798
|
-
type: "string"
|
|
116799
|
-
}
|
|
116800
|
-
],
|
|
116801
|
-
stateMutability: "pure",
|
|
116802
|
-
type: "function"
|
|
116803
|
-
},
|
|
116804
116718
|
{
|
|
116805
116719
|
inputs: [
|
|
116806
116720
|
{
|
|
@@ -116820,7 +116734,7 @@ var _abi = [
|
|
|
116820
116734
|
type: "function"
|
|
116821
116735
|
}
|
|
116822
116736
|
];
|
|
116823
|
-
var _bytecode = "0x60a080604052346100ea57306080527ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a005460ff8160401c166100d9576002600160401b03196001600160401b03821601610073575b6040516145be90816100f0823960805181818161262901526127220152f35b6001600160401b0319166001600160401b039081177ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a005581527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d290602090a13880610054565b63f92ee8a960e01b60005260046000fd5b600080fdfe6080604052600436101561001257600080fd5b6000803560e01c8062f7fce9146135b457806301ffc9a714613543578063021d2893146134ea5780630871b206146134b1578063114249d214610b3a57806311d954f81461348857806313da31661461344f5780631d44a904146133a65780631f77bf651461336d578063248a9ca31461334e5780632b83cccd14612f1e5780632f2ff15d14612eec57806334bac37014612eb357806334e1812514612e7a57806336568abe14612e35578063373c86b614612dfc5780633f4ba83a14612d615780634373b57214612d385780634451e89b146129735780634ebd25a51461293a5780634f1ef286146126a75780635273b6f61461267e57806352d1902d1461261657806354fd4d50146125d7578063568fafca1461254957806359d5d02a146122805780635bc26aea1461224b5780635c975abb1461221b5780635ecc2708146120fd5780638456cb591461202e57806385c15d9a14611ff557806389d3ad0014611f2e5780638bff608e14611ef55780639010d07c14611ea257806390ad8b4014611e8657806391d1485414611e2d5780639b759bf714611dea5780639baf58d214611dcd5780639f1d0f5914611835578063a217fddf14611819578063a3246ad31461175c578063ad3cb1cc14611719578063b492fc691461161f578063b9f637af146113f4578063bf7d9119146113b5578063c0c53b8b14610ffd578063c4c5f62414610f4a578063c55f15ea14610f27578063ca15c87314610ef0578063ca2ce65d14610eb7578063cc1f8ffa14610e85578063cf46075e14610d7b578063d21a74ff14610d3e578063d2f8253614610d1b578063d547741f14610ce0578063d5d3f78b14610b73578063d66bd52414610b3a578063e1f1c4a714610b1d578063e1f3962c14610af1578063ec2f96fe14610acd578063eda5a26a146106d0578063f1a1eb841461068d578063f385116d14610654578063f77c47911461062d578063faaebd21146105f4578063facdfb5e14610454578063fc99bd9a146103435763fe32e7281461030857600080fd5b34610340576020366003190112610340576020906040906001600160a01b0361032f6136bb565b168152601283522054604051908152f35b80fd5b50346103405760403660031901126103405761035d6136bb565b6010546024359291906001600160a01b03163303610445576001600160a01b03168082526002602052604082205490929060ff16156104325780156104235782825260076020526040822054926103b48285613a34565b848110610414576001600160ff1b03811161040557600080516020614592833981519152604085968493846104029852600760205280838a205582519182526020820152a230903390613fa0565b80f35b630700fcb360e11b8452600484fd5b63446c8cc960e01b8452600484fd5b63162908e360e11b8252600482fd5b506024916374ed46ad60e01b8252600452fd5b6349db3bd360e01b8252600482fd5b50346103405760203660031901126103405761046e6136bb565b610476613c96565b6010546001600160a01b03163303610445576001600160a01b03168082526002602052604082205460ff16156105e257808252600760205260408220546040516370a0823160e01b8152306004820152602081602481865afa9081156105d75784916105a0575b5081811115610591576104f08282613846565b821590811561053c575b5050600080516020614592833981519152916040918486526007602052808387205582519182526020820152a260016000805160206145328339815191525580f35b612710810290808204612710149015171561057d576064840291848304606414171561057d571161056e5738806104fa565b63a73af74d60e01b8452600484fd5b634e487b7160e01b86526011600452602486fd5b61059b8183613846565b6104f0565b90506020813d6020116105cf575b816105bb60209383613750565b810103126105ca5751386104dd565b600080fd5b3d91506105ae565b6040513d86823e3d90fd5b6374ed46ad60e01b8252600452602490fd5b5034610340576020366003190112610340576020906040906001600160a01b0361061c6136bb565b168152600483522054604051908152f35b5034610340578060031936011261034057546040516001600160a01b039091168152602090f35b5034610340576020366003190112610340576020906040906001600160a01b0361067c6136bb565b168152600a83522054604051908152f35b5034610340576040366003190112610340576020906040906001600160a01b036106b56136bb565b16815260158352818120602435825283522054604051908152f35b503461034057610160366003190112610340576106eb6136bb565b906064356044356024356106fd6137ed565b9160a4359160c43560e43561010435916101243595610144359760018060a01b03601054163303610abe576001600160a01b038c16808c52600260205260408c2054909a9060ff16610aaa578a15610a9b578615610a8c576127108811610a72576103e88111610a5a5760ff82169c60128e118e8115610a4f575b50610a3b57803b15610a27578915610a13578a156109ff578261079a91613fe4565b841515806109f6575b6109df57851515806109d6575b6109bf578b9c602460208d9e9d604051928380926370a0823160e01b82523060048301525afa9c8d156109b3579c61097f575b506001600160ff1b038c11610970578a8d8f9760408f97838f918f8f8f8f90859f988f99879f966000805160206144d28339815191529f978b9f988f8d6000805160206144528339815191529f988e8e6109289b6000805160206144128339815191529f8f8f8487526002602052878720600160ff198254161790558487526003602052878720558386526004602052868620558285526006602052878686205582855260056020528585209060ff19825416179055818452600c6020528885852055818452600d6020528985852055818452600e6020528a85852055818452600f6020528b8585205581845260076020528484205582526012602052828220558d8152601360205220558a7f991d1ef1b5c0820d213328cba6682059e00a50e49c469a454eb3557e78eaf6668e80518b81528c6020820152a28c5198899889613a41565b0390a28151908b82526020820152a28151908782526020820152a28061094c578280f35b6040600080516020614592833981519152918151908582526020820152a281808280f35b63556e7a8160e01b8e5260048efd5b909b506020813d6020116109ab575b8161099b60209383613750565b810103126105ca57519a386107e3565b3d915061098e565b604051903d90823e3d90fd5b60448c858863dd85772b60e01b8352600452602452fd5b508386106107b0565b60448c8487637449915760e01b8352600452602452fd5b508285106107a3565b636835314760e11b8d52600160045260248dfd5b636835314760e11b8d5260048d905260248dfd5b63377e3f9960e21b8d5260048c905260248dfd5b63ca95039160e01b8d5260048e905260248dfd5b60069150108e610778565b631051834f60e11b8c526004526103e860245260448bfd5b63c1e9a14160e01b8c52600488905261271060245260448cfd5b63a2ec3a5560e01b8c5260048cfd5b63df407ac560e01b8c5260048cfd5b6317f4215b60e21b8c5260048b905260248cfd5b6349db3bd360e01b8b5260048bfd5b5034610340578060031936011261034057602060ff60015460a01c16604051908152f35b5034610340576020366003190112610340576020610b15610b106136bb565b613b79565b604051908152f35b503461034057806003193601126103405760206040516127108152f35b5034610340576020366003190112610340576020906040906001600160a01b03610b626136bb565b168152600783522054604051908152f35b503461034057602036600319011261034057610b8d6136bb565b6010546001600160a01b03163303610445576001600160a01b03168082526002602052604082205460ff16156105e2578082526007602052604082205480610cca575080825260026020526040822060ff1981541690558082526003602052816040812055808252600460205281604081205580825260056020526040822060ff198154169055808252600c602052816040812055808252600d602052816040812055808252600e602052816040812055808252600f602052816040812055808252600660205281604081205580825260076020526040822054818352600760205282604081205560405190827f3302a1b37f04242bb55603f5449e7ecd690a35eef08ba1353c48c20e2aae9cda8580a280610ca7578380f35b816040916000805160206145928339815191529352846020820152a23880808380f35b604492916376bc059760e11b8352600452602452fd5b503461034057604036600319011261034057610d17600435610d006136d1565b90610d12610d0d826138eb565b613e0c565b613e9e565b5080f35b5034610340578060031936011261034057602060ff600854166040519015158152f35b50346103405760203660031901126103405760209060ff906040906001600160a01b03610d696136bb565b16815260058452205416604051908152f35b503461034057602036600319011261034057610d956136bb565b610d9d613c96565b6010546001600160a01b03163303610445576001600160a01b03168082526002602052604082205460ff16156105e257808252600760205260408220546040516370a0823160e01b8152306004820152602081602481865afa9081156105d7578491610e45575b50600080516020614592833981519152916040918486526007602052808387205582519182526020820152a260016000805160206145328339815191525580f35b90506020813d602011610e7d575b81610e6060209383613750565b810103126105ca5751600080516020614592833981519152610e04565b3d9150610e53565b5034610340576040366003190112610340576020610ead610ea46136bb565b60243590613a7a565b6040519015158152f35b5034610340576020366003190112610340576020906040906001600160a01b03610edf6136bb565b168152601383522054604051908152f35b5034610340576020366003190112610340576040602091600435815260008051602061443283398151915283522054604051908152f35b50346103405780600319360112610340576020604051670de0b6b3a76400008152f35b503461034057604036600319011261034057610f646136bb565b6010546024359291906001600160a01b03163303610445576001600160a01b0316808252600760205260408220549290818410610fe65780600080516020614592833981519152604086610fbc866104029899613846565b84895260076020528289205583885260076020528188205482519182526020820152a23390613dd0565b5091604492633cb8e07360e01b8352600452602452fd5b5034610340576060366003190112610340576110176136bb565b61101f6136d1565b6044356001600160a01b038116918282036113b15760008051602061457283398151915254604081901c60ff161594906001600160401b0316801590816113a9575b600114908161139f575b159081611396575b506113875760008051602061457283398151915280546001600160401b031916600117905584611362575b6001600160a01b0316908115611353576001600160a01b0316908115611344578315611335576110cc61420e565b6110d461420e565b6110dc61420e565b6110e461420e565b6001600080516020614532833981519152556110fe61420e565b61110661420e565b85546001600160a01b0319908116919091178655600180549182168317905560405163313ce56760e01b8152909190602081600481855afa879181611304575b5061115a57633a24e95b60e11b8752600487fd5b6001600160a81b03199092161760a091821b60ff60a01b16176001819055901c60ff166006811415806112f9575b6112e7575061119781856140cc565b806112bf575b1561127a576111ba816000805160206145528339815191526140cc565b80611289575b1561127a576111dd906000805160206144928339815191526140cc565b9081611243575b5015611234576111f15780f35b60ff60401b19600080516020614572833981519152541660008051602061457283398151915255600080516020614472833981519152602060405160018152a180f35b63cf5a8e3360e01b8252600482fd5b61127390600080516020614492833981519152855260008051602061443283398151915260205260408520614254565b50386111e4565b63cf5a8e3360e01b8452600484fd5b60008051602061455283398151915285526000805160206144328339815191526020526112b98360408720614254565b506111c0565b8480526000805160206144328339815191526020526112e18360408720614254565b5061119d565b63167738cf60e21b8552600452602484fd5b506012811415611188565b61132791925060203d60201161132e575b61131f8183613750565b81019061391b565b9038611146565b503d611315565b630b5eba9f60e41b8652600486fd5b63c1ab6dc160e01b8652600486fd5b6336abb4df60e11b8652600486fd5b600080516020614572833981519152805460ff60401b1916600160401b17905561109e565b63f92ee8a960e01b8652600486fd5b90501538611073565b303b15915061106b565b869150611061565b8480fd5b50346103405760203660031901126103405760209060ff906040906001600160a01b036113e06136bb565b168152600284522054166040519015158152f35b5034610340576101203660031901126103405761140f6136bb565b60643591906044356024356114226137ed565b601054610104359660e4359260c4359260a43592906001600160a01b03163303611610576001600160a01b038816808a52600260205260408a205490989060ff16156115fc5786156115ed5761271088116115d3576103e882116115b95760ff8316906012821180156115af575b61159b578361149e91613fe4565b85151580611592575b61157b578a151580611572575b61155b579260008051602061441283398151915297969592828c95611555979460408e8e80825260036020528c8383205580825260046020528d838320558152600660205220558b8d52600560205260408d209060ff198254161790558a8c52600c6020528260408d20558a8c52600d6020528360408d20558a8c52600e6020528460408d20558a8c52600f6020528560408d205560405198899889613a41565b0390a280f35b60448a868d63dd85772b60e01b8352600452602452fd5b50848b106114b4565b60448a8588637449915760e01b8352600452602452fd5b508386106114a7565b63ca95039160e01b8b52600482905260248bfd5b5060068210611490565b631051834f60e11b8a5260048290526103e860245260448afd5b63c1e9a14160e01b8a52600488905261271060245260448afd5b63a2ec3a5560e01b8a5260048afd5b6374ed46ad60e01b8a52600489905260248afd5b6349db3bd360e01b8952600489fd5b5034610340576040366003190112610340576116396136bb565b6001600160a01b0316808252600260205260408220546024359060ff16156117055780156116f6576127106116bb604085670de0b6b3a76400006116aa6116c39688859a52600560205260ff8585205416908091601281106116d0575b5050888452600360205284842054906137fd565b0495815260046020522054846137fd565b048092613846565b9082519182526020820152f35b6116ef925060ff6116e36116e992613853565b16613864565b906137fd565b3880611696565b63162908e360e11b8352600483fd5b6374ed46ad60e01b83526004829052602483fd5b5034610340578060031936011261034057611758604080519061173c8183613750565b60058252640352e302e360dc1b602083015251918291826137a4565b0390f35b503461034057602036600319011261034057600435815260008051602061443283398151915260205260408120604051908160208254918281520190819285526020852090855b81811061180357505050826117b9910383613750565b604051928392602084019060208552518091526040840192915b8181106117e1575050500390f35b82516001600160a01b03168452859450602093840193909201916001016117d3565b82548452602090930192600192830192016117a3565b5034610340578060031936011261034057602090604051908152f35b503461034057611844366136f6565b91909261184f613c96565b611857613cd2565b338152600960205260408120544303611dab57338152600a602052600360408220541015611d9c57338152600a60205260408120611895815461390c565b90555b6001600160a01b0382168082526002602052604082205490929060ff16611cfb575b828252600260205260ff60408320541615610432578415610423578315611cec57828252600c60205260408220548510611cc757828252600e60205260408220548015611cb857808611611ca157508461191391613ee2565b6040516370a0823160e01b8152306004820152602081602481865afa908115611b61578291611c6f575b5061194a85303386613fa0565b6040516370a0823160e01b8152306004820152602081602481875afa908115611c6457908692918491611c2b575b509061198391613846565b10611c1c578181526007602052604081205461199f8582613a34565b818110611c0d576001600160ff1b038111611bfe5760408492600080516020614592833981519152928486526007602052808387205582519182526020820152a2818152600560205260ff604082205416849060128110611b9d575b50611a1c670de0b6b3a76400009184845260036020526040842054906137fd565b04908281526004602052611a42612710611a3a6040842054856137fd565b048093613846565b93808510611b85575080546001600160a01b0316803b15611b6c5781809160846040518094819363ae494fa160e01b83523360048401528a60248401528960448401528b60648401525af18015611b6157908291611b70575b505081611af9575b507fb3e2773606abfd36b5bd91394b3a54d1398336c65005baf7bf7a05efeffaf75b611adc60209560405191829133958842928561394f565b0390a3600160008051602061453283398151915255604051908152f35b80546001600160a01b0316803b15611b6c5781809160846040518094819363ae494fa160e01b83523060048401528860248401528960448401528160648401525af18015611b6157611b4c575b50611aa3565b611b57828092613750565b6103405780611b46565b6040513d84823e3d90fd5b5080fd5b81611b7a91613750565b610340578038611a9b565b6371c4efed60e01b8252600485905260245260449150fd5b611bad91506116e360ff91613853565b8015611bea5780600019048511611bdb57611a1c611bd4670de0b6b3a764000092876137fd565b91506119fb565b63035fc53d60e41b8252600482fd5b634e487b7160e01b82526012600452602482fd5b630700fcb360e11b8352600483fd5b63446c8cc960e01b8352600483fd5b639bfa3c1760e01b8152600490fd5b919250506020813d602011611c5c575b81611c4860209383613750565b810103126105ca5751859190611983611978565b3d9150611c3b565b6040513d85823e3d90fd5b90506020813d602011611c99575b81611c8a60209383613750565b810103126105ca57513861193d565b3d9150611c7d565b631d7f2ac360e01b83526004869052602452604482fd5b633b5db2f360e11b8352600483fd5b50908152600c6020526040812054630d54e9e160e01b82526004849052602452604490fd5b632cd84af360e01b8252600482fd5b60405163313ce56760e01b815291939291602081600481865afa859181611d7b575b50611d315763105482c760e21b8552600485fd5b93919293838352600560205260ff806040852054169116908103611d5557506118ba565b90506044928252600560205260ff604083205416631e43476360e11b8352600452602452fd5b611d9591925060203d60201161132e5761131f8183613750565b9038611d1d565b63a74c1c5f60e01b8152600490fd5b3381526009602052436040822055338152600a60205260016040822055611898565b503461034057806003193601126103405760206040516103e88152f35b5034610340576040366003190112610340576020906040906001600160a01b03611e126136bb565b16815260148352818120602435825283522054604051908152f35b5034610340576040366003190112610340576040611e496136d1565b9160043581526000805160206144f2833981519152602052209060018060a01b0316600052602052602060ff604060002054166040519015158152f35b5034610340578060031936011261034057602060405160648152f35b503461034057604036600319011261034057611edc602091600435815260008051602061443283398151915283526040602435912061423c565b905460405160039290921b1c6001600160a01b03168152f35b5034610340576020366003190112610340576020906040906001600160a01b03611f1d6136bb565b168152600983522054604051908152f35b503461034057604036600319011261034057611f486136bb565b60105460243591906001600160a01b03163303611fe6576001600160a01b0316908115611fd75760406000805160206144d28339815191529183855260136020528185205490848652601360205280838720558486526015602052828620438752602052828620548587526019602052838720558486526017602052438387205582519182526020820152a280f35b63df407ac560e01b8352600483fd5b6349db3bd360e01b8352600483fd5b5034610340576020366003190112610340576020906040906001600160a01b0361201d6136bb565b168152600383522054604051908152f35b503461034057806003193601126103405760008051602061449283398151915281526000805160206144f283398151915260209081526040808320336000908152925290205460ff16156120d857612084613cd2565b600160ff19600080516020614512833981519152541617600080516020614512833981519152557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a2586020604051338152a180f35b63e2517d3f60e01b815233600452600080516020614492833981519152602452604490fd5b5034610340576020366003190112610340576121176136bb565b6000805160206145728339815191525460ff8160401c16908115612203575b506121f45760008051602061457283398151915280546001600160481b0319166003600160401b011790558180526000805160206144f283398151915260209081526040808420336000908152925290205460ff16156121dc57612199906139d0565b60ff60401b19600080516020614572833981519152541660008051602061457283398151915255600080516020614472833981519152602060405160038152a180f35b63e2517d3f60e01b8252336004526024829052604482fd5b63f92ee8a960e01b8252600482fd5b60036001600160401b03919091161015905038612136565b5034610340578060031936011261034057602060ff60008051602061451283398151915254166040519015158152f35b5034610340576020366003190112610340576122656136bb565b6010546001600160a01b0316330361044557610402906139d0565b50346103405760603660031901126103405761229a6136bb565b6122a26136d1565b60105490926044359290916001600160a01b03163303610445576122c4613cd2565b6011546001600160a01b031691821561253a5760405163babcc53960e01b81526001600160a01b0386166004820181905293602090829060249082905afa908115611b615782916124ff575b50156124f05782156124e1576001546001600160a01b0392831692168203612431576040516370a0823160e01b8152306004820152602081602481865afa908115611b615782916123ff575b50935b84156123f05760001981036123ea5750835b84156123db578085116123c357505061238d8360209583613dd0565b7f0bf519e4b3821615dbdd874fa1a5fbb4bb651b4e6beabedd4ac318e770233b2c604080518581524287820152a3604051908152f35b630555ed4f60e31b8252600485905260245260449150fd5b632e11316f60e11b8252600482fd5b93612371565b63f09872eb60e01b8252600482fd5b90506020813d602011612429575b8161241a60209383613750565b810103126105ca57513861235c565b3d915061240d565b8181526002602052604081205460ff16156124cf576040516370a0823160e01b8152306004820152602081602481865afa908115611b6157829161249d575b5082825260076020526040822054808211156124955761248f91613846565b9361235f565b50508061248f565b90506020813d6020116124c7575b816124b860209383613750565b810103126105ca575138612470565b3d91506124ab565b60249163eef7849760e01b8252600452fd5b634e46966960e11b8152600490fd5b63133307bb60e21b8152600490fd5b90506020813d602011612532575b8161251a60209383613750565b81010312611b6c57518015158103611b6c5738612310565b3d915061250d565b630e048e7160e41b8152600490fd5b5034610340576020366003190112610340576125636136bb565b6010546001600160a01b03163303610445576001600160a01b031680156125c857601180546001600160a01b0319811683179091556001600160a01b03167f1e9c406f2707909cfd9f61e744f73bcab77e5997d063276f67883c5257d51cf08380a380f35b634e46966960e11b8252600482fd5b503461034057806003193601126103405761175860408051906125fa8183613750565b6005825264191719971960d91b602083015251918291826137a4565b50346103405780600319360112610340577f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316300361266f5760206040516000805160206144b28339815191528152f35b63703e46dd60e11b8152600490fd5b50346103405780600319360112610340576010546040516001600160a01b039091168152602090f35b506040366003190112610340576126bc6136bb565b602435906001600160401b038211612936573660238301121561293657816004013590836126e983613789565b936126f76040519586613750565b8385526020850193366024828401011161293657806024602093018637850101526001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016308114908115612913575b50612904576010546001600160a01b031633036128f5576001600160a01b0381169283156128e657813b156128d7576040516352d1902d60e01b8152602081600481885afa86918161289f575b506127b357634c9c8ce360e01b86526004859052602486fd5b93846000805160206144b283398151915287960361288d5750823b1561287b576000805160206144b283398151915280546001600160a01b031916821790558491907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b8380a280511561286057610d179382915190845af43d15612858573d9161283c83613789565b9261284a6040519485613750565b83523d85602085013e614390565b606091614390565b505050503461286c5780f35b63b398979f60e01b8152600490fd5b634c9c8ce360e01b8552600452602484fd5b632a87526960e21b8652600452602485fd5b9091506020813d6020116128cf575b816128bb60209383613750565b810103126128cb5751903861279a565b8680fd5b3d91506128ae565b636f7c43f160e01b8552600485fd5b63e6c4247b60e01b8552600485fd5b6349db3bd360e01b8452600484fd5b63703e46dd60e11b8452600484fd5b6000805160206144b2833981519152546001600160a01b0316141590503861274d565b8280fd5b5034610340576020366003190112610340576020906040906001600160a01b036129626136bb565b168152600e83522054604051908152f35b50346103405760603660031901126103405761298d6136e7565b6024356001600160401b038111612936576129ac903690600401613720565b916044356001600160401b0381116113b1576129cc903690600401613720565b6000805160206145728339815191529291925460ff8160401c16908115612d20575b506113875760008051602061457283398151915280546001600160481b0319166002600160401b0117905560008051602061455283398151915286526000805160206144f283398151915260209081526040808820336000908152925290205460ff1615612cfb57612a5e61420e565b612a6661420e565b600160008051602061453283398151915255600b549160ff8316612cec57818603612cdd57612a948661396b565b92612aa26040519485613750565b868452601f19612ab18861396b565b01366020860137875b878110612be8575060019060ff191617600b5515159460ff196008541660ff871617600855865b818110612b4557876000805160206143f2833981519152602089604051908152a160ff60401b19600080516020614572833981519152541660008051602061457283398151915255600080516020614472833981519152602060405160028152a180f35b80886000805160206145928339815191526040612b6d612b68600196888d613982565b6139a8565b612b7885898c613982565b357f8f955fa878b4aae8b1ac37b1ab715307470f2822ceff87e23d33ef1e044814a783612ba5888d6139bc565b5193898060a01b0316968793848252600660205280838320558482526007602052858383205582519182526020820152a28151908d82526020820152a201612ae1565b612bf6612b68828a8a613982565b612c01828689613982565b6001600160a01b03909116808b52600260205260408b20549091359060ff1615612cc9576103e88111612cb15750906020602492604051938480926370a0823160e01b82523060048301525afa8015612ca6578a90612c70575b60019250612c6982886139bc565b5201612aba565b509060203d8111612c9f575b612c868183613750565b6020826000928101031261034057509060019151612c5b565b503d612c7c565b6040513d8c823e3d90fd5b631051834f60e11b8b526004526103e860245260448afd5b6351104c5960e01b8b52600482905260248bfd5b63512509d360e11b8752600487fd5b6324d0d1fd60e01b8752600487fd5b63e2517d3f60e01b865233600452600080516020614552833981519152602452604486fd5b60026001600160401b039190911610159050386129ee565b50346103405780600319360112610340576011546040516001600160a01b039091168152602090f35b50346103405780600319360112610340576010546001600160a01b03163303612ded576000805160206145128339815191525460ff811615612dde5760ff1916600080516020614512833981519152557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa6020604051338152a180f35b638dfc202b60e01b8252600482fd5b6349db3bd360e01b8152600490fd5b5034610340576020366003190112610340576020906040906001600160a01b03612e246136bb565b168152601683522054604051908152f35b503461034057604036600319011261034057612e4f6136d1565b336001600160a01b03821603612e6b57610d1790600435613e9e565b63334bd91960e11b8252600482fd5b5034610340576020366003190112610340576020906040906001600160a01b03612ea26136bb565b168152600c83522054604051908152f35b5034610340576020366003190112610340576020906040906001600160a01b03612edb6136bb565b168152601783522054604051908152f35b503461034057604036600319011261034057610d17600435612f0c6136d1565b90612f19610d0d826138eb565b613e56565b503461034057612f2d366136f6565b9190612f37613c96565b612f3f613cd2565b33845260096020526040842054430361332c57338452600a60205260036040852054101561331d57338452600a60205260408420612f7d815461390c565b90555b6001600160a01b0382168085526002602052604085205490929060ff16613285575b828552600260205260ff604086205416156132715760ff600854161561326257811561325357831561324457828552600d602052604085205480831061322d5750828552600f6020526040852054801561321e5780831161320857508161300891613cfc565b670de0b6b3a76400008102818104670de0b6b3a7640000036131f4578285526003602052604085205461303a91613826565b908285526006602052613057612710611a3a6040882054856137fd565b93838652600560205260ff604087205416601281106131c9575b508085106131b2575082855260076020528360408620541061318e578285526007602052604085205484811061317f576000805160206145928339815191526040826130be888895613846565b848a52600760205280838b205582519182526020820152a284546001600160a01b0316803b1561317b57856040518092633a52b90760e11b8252818381613109883360048401613934565b03925af180156131705791602096611adc927f8caf04742286d017f9ac3924388e188c73e6e5094311c5e59a61a7ef86dda8bf94613160575b505061314f863387613dd0565b60405191829133958842928561394f565b8161316a91613750565b38613142565b6040513d88823e3d90fd5b8580fd5b6308aed4ef60e31b8652600486fd5b82855260076020526040852054635960d22160e01b86526004526024849052604485fd5b6371c4efed60e01b86526004859052602452604485fd5b946131e76131e060ff6116e36131ed959799613853565b8092613826565b95613826565b9138613071565b634e487b7160e01b85526011600452602485fd5b625502a360e91b86526004839052602452604485fd5b636c6ff70d60e11b8652600486fd5b6361767b8560e01b86526004839052602452604485fd5b632cd84af360e01b8552600485fd5b63162908e360e11b8552600485fd5b630df65d9f60e01b8552600485fd5b6374ed46ad60e01b85526004839052602485fd5b60405163313ce56760e01b8152602081600481875afa8691816132fc575b506132b75763105482c760e21b8652600486fd5b838652600560205260ff8060408820541691169081036132d75750612fa2565b83865260056020526040862054631e43476360e11b875260ff16600452602452604485fd5b61331691925060203d60201161132e5761131f8183613750565b90386132a3565b63a74c1c5f60e01b8452600484fd5b3384526009602052436040852055338452600a60205260016040852055612f80565b5034610340576020366003190112610340576020610b156004356138eb565b5034610340576020366003190112610340576020906040906001600160a01b036133956136bb565b168152600f83522054604051908152f35b5034610340576040366003190112610340576133c06136bb565b60105460243591906001600160a01b03163303611fe6576001600160a01b0316908115611fd75760406000805160206144528339815191529183855260126020528185205490848652601260205280838720558486526014602052828620438752602052828620548587526018602052838720558486526016602052438387205582519182526020820152a280f35b5034610340576020366003190112610340576020906040906001600160a01b036134776136bb565b168152600683522054604051908152f35b50346103405780600319360112610340576001546040516001600160a01b039091168152602090f35b5034610340576020366003190112610340576020906040906001600160a01b036134d96136bb565b168152600d83522054604051908152f35b5034610340576020366003190112610340576135046136e7565b6010546001600160a01b031633036104455760206000805160206143f283398151915291151560ff196008541660ff821617600855604051908152a180f35b50346103405760203660031901126103405760043563ffffffff60e01b8116809103611b6c57602090635a05180f60e01b8114908115613589575b506040519015158152f35b637965db0b60e01b8114915081156135a3575b508261357e565b6301ffc9a760e01b1490508261359c565b5034610340576040366003190112610340576135ce6136bb565b6001600160a01b03168082526002602052604082205460243592919060ff16156136a857670de0b6b3a7640000830292808404670de0b6b3a764000014901517156136945760ff604061362e819584865260036020528286205490613826565b93838152600660205261365261271061364a84842054886137fd565b048096613846565b9381526005602052205416601281101561368d579061367b6131e060ff6116e361368195613853565b92613826565b82519182526020820152f35b5090613681565b634e487b7160e01b82526011600452602482fd5b6374ed46ad60e01b825260045260249150fd5b600435906001600160a01b03821682036105ca57565b602435906001600160a01b03821682036105ca57565b6004359081151582036105ca57565b60609060031901126105ca576004356001600160a01b03811681036105ca57906024359060443590565b9181601f840112156105ca578235916001600160401b0383116105ca576020808501948460051b0101116105ca57565b601f909101601f19168101906001600160401b0382119082101761377357604052565b634e487b7160e01b600052604160045260246000fd5b6001600160401b03811161377357601f01601f191660200190565b91909160208152825180602083015260005b8181106137d7575060409293506000838284010152601f8019910116010190565b80602080928701015160408286010152016137b6565b6084359060ff821682036105ca57565b8181029291811591840414171561381057565b634e487b7160e01b600052601160045260246000fd5b8115613830570490565b634e487b7160e01b600052601260045260246000fd5b9190820391821161381057565b60ff166012039060ff821161381057565b80156138e55760009060208110600116604e8210600116176138dd57600a916001915b600181116138b45750826000190482116138a057500290565b634e487b7160e01b81526011600452602490fd5b928060001904811161369457600184166138d4575b80029260011c613887565b809202916138c9565b9050600a0a90565b50600190565b6000526000805160206144f283398151915260205260016040600020015490565b60001981146138105760010190565b908160209103126105ca575160ff811681036105ca5790565b6001600160a01b039091168152602081019190915260400190565b9094939260609260808301968352602083015260408201520152565b6001600160401b0381116137735760051b60200190565b91908110156139925760051b0190565b634e487b7160e01b600052603260045260246000fd5b356001600160a01b03811681036105ca5790565b80518210156139925760209160051b010190565b6001600160a01b03168015613a2357601080546001600160a01b0319811683179091556001600160a01b03167f17dc5b1290f7495d7f8cc68476e6941aaf510598fa925d0d2720edc8805a846c600080a3565b63e6c4247b60e01b60005260046000fd5b9190820180921161381057565b94919360e0969360ff929a99989561010088019b885260208801526040870152166060850152608084015260a083015260c08201520152565b6001600160a01b03811660008181526002602052604090205490919060ff16158015613b6c575b8015613b64575b613b525781600052600f6020526040600020548015908115613b5a575b50613b5257613aea926040918251948592839262f7fce960e01b845260048401613934565b0381305afa918215613b4657600092613b12575b506000526007602052604060002054101590565b9091506040813d604011613b3e575b81613b2e60409383613750565b810103126105ca57519038613afe565b3d9150613b21565b6040513d6000823e3d90fd5b505050600090565b9050831138613ac5565b508215613aa8565b5060ff6008541615613aa1565b6001546001600160a01b0391821691168103613bee576020602491604051928380926370a0823160e01b82523060048301525afa908115613b4657600091613bbf575090565b90506020813d602011613be6575b81613bda60209383613750565b810103126105ca575190565b3d9150613bcd565b80600052600260205260ff60406000205416613c0a5750600090565b6040516370a0823160e01b815230600482015290602082602481845afa918215613b4657600092613c62575b506000526007602052604060002054808211600014613c5b57613c5891613846565b90565b5050600090565b90916020823d602011613c8e575b81613c7d60209383613750565b810103126103405750519038613c36565b3d9150613c70565b60026000805160206145328339815191525414613cc157600260008051602061453283398151915255565b633ee5aeb560e01b60005260046000fd5b60ff6000805160206145128339815191525416613ceb57565b63d93c066560e01b60005260046000fd5b6001600160a01b03166000818152601360205260409020548015613dcb57816000526015602052604060002043600052602052613d3f6040600020549384613a34565b928310613dba57808260005260176020524360406000205414613d9c575b8311613d8057506000526015602052604060002043600052602052604060002055565b925063029359d560e41b60005260045260245260445260646000fd5b50816000526019602052613db560406000205482613a34565b613d5d565b63446c8cc960e01b60005260046000fd5b505050565b613e05613e0a9392613df760405194859263a9059cbb60e01b602085015260248401613934565b03601f198101845283613750565b614071565b565b60008181526000805160206144f28339815191526020908152604080832033845290915290205460ff1615613e3e5750565b63e2517d3f60e01b6000523360045260245260446000fd5b613e6082826140cc565b9182613e6b57505090565b60009182526000805160206144328339815191526020526040909120613e9a916001600160a01b031690614254565b5090565b613ea8828261416e565b9182613eb357505090565b60009182526000805160206144328339815191526020526040909120613e9a916001600160a01b0316906142bd565b6001600160a01b03166000818152601260205260409020548015613dcb57816000526014602052604060002043600052602052613f256040600020549384613a34565b928310613dba57808260005260166020524360406000205414613f82575b8311613f6657506000526014602052604060002043600052602052604060002055565b92506319a4e2a760e01b60005260045260245260445260646000fd5b50816000526018602052613f9b60406000205482613a34565b613f43565b6040516323b872dd60e01b60208201526001600160a01b039283166024820152929091166044830152606480830193909352918152613e0a91613e05608483613750565b60405163313ce56760e01b81529190602090839060049082906001600160a01b03165afa60009281614050575b5061402757631eecbb6560e01b60005260046000fd5b60ff9182169116808203614039575050565b631e43476360e11b60005260045260245260446000fd5b61406a91935060203d60201161132e5761131f8183613750565b9138614011565b906000602091828151910182855af115613b46576000513d6140c357506001600160a01b0381163b155b6140a25750565b635274afe760e01b60009081526001600160a01b0391909116600452602490fd5b6001141561409b565b60008181526000805160206144f2833981519152602090815260408083206001600160a01b038616845290915290205460ff16613c5b5760008181526000805160206144f2833981519152602090815260408083206001600160a01b0395909516808452949091528120805460ff19166001179055339291907f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d9080a4600190565b60008181526000805160206144f2833981519152602090815260408083206001600160a01b038616845290915290205460ff1615613c5b5760008181526000805160206144f2833981519152602090815260408083206001600160a01b0395909516808452949091528120805460ff19169055339291907ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9080a4600190565b60ff6000805160206145728339815191525460401c161561422b57565b631afcd79f60e31b60005260046000fd5b80548210156139925760005260206000200190600090565b6001810190826000528160205260406000205415600014613b52578054600160401b811015613773576142a861429182600187940185558461423c565b819391549060031b91821b91600019901b19161790565b90555491600052602052604060002055600190565b906001820191816000528260205260406000205480151560001461438757600019810181811161381057825460001981019190821161381057818103614350575b5050508054801561433a576000190190614318828261423c565b8154906000199060031b1b191690555560005260205260006040812055600190565b634e487b7160e01b600052603160045260246000fd5b614370614360614291938661423c565b90549060031b1c9283928661423c565b9055600052836020526040600020553880806142fe565b50505050600090565b906143b657508051156143a557602081519101fd5b63d6bda27560e01b60005260046000fd5b815115806143e8575b6143c7575090565b639996b31560e01b60009081526001600160a01b0391909116600452602490fd5b50803b156143bf56fe2c0a5f5ab0ba371221bb3612c2d2f90d36566279309f526000c5b354efd1b0658c67aaac7f77de07240e5a9b36dfdccb2a89c438635abbb27a73142d2aa0f629c1f6fe24621ce81ec5827caf0253cadb74709b061630e6b55e8237170593200048b07fab687f450848f1df8a96db08fef7840f53415f18fdc2ec8e9f810f0930c7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d275027301df982f5215b4963a854cf9c73219df80cb6acd8f098189c9480c7bbc360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc4460507c21097c15f6883572ebd157a9ee4b1d989a312314e93afd9d2ecd494002dd7bc7dec4dceedda775e58dd541e08a116c6c53815c0bd028192f7b626800cd5ed15c6e187e77e9aee88184c21f4f2182ab5827cb3b7e07fbedcd63f033009b779b17422d0df92223018b32b4d1fa46e071723d6817e2486d003becc55f00a49807205ce4d355092ef5a8a18f56e8913cf4a201fbe287825b095693c21775f0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a006d129bd71f2401cbe77f49f546d7d5f58992faecfca6e51ba06b50b261e83331a164736f6c6343000822000a";
|
|
116737
|
+
var _bytecode = "0x60a080604052346100ea57306080527ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a005460ff8160401c166100d9576002600160401b03196001600160401b03821601610073575b6040516146f590816100f0823960805181818161269a01526127930152f35b6001600160401b0319166001600160401b039081177ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a005581527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d290602090a13880610054565b63f92ee8a960e01b60005260046000fd5b600080fdfe6080604052600436101561001257600080fd5b6000803560e01c8062f7fce9146136c257806301ffc9a714613651578063021d2893146135f85780630871b206146135bf578063114249d214610f7257806311d954f81461359657806313da31661461355d5780631d44a904146134b45780631f77bf651461347b578063248a9ca31461345c5780632b83cccd146130305780632f2ff15d14612ffe57806334bac37014612fc557806334e1812514612f8c57806336568abe14612f47578063373c86b614612f0e5780633f4ba83a14612e475780634373b57214612e1e5780634451e89b14612a4a5780634ebd25a514612a115780634f1ef286146127185780635273b6f6146126ef57806352d1902d14612687578063568fafca146125f957806359d5d02a146123305780635bc26aea146122fb5780635c975abb146122cb5780635ecc2708146121ad5780638456cb59146120b257806385c15d9a1461207957806389d3ad0014611fb25780638bff608e14611f795780639010d07c14611f2657806390ad8b4014611f0a57806391d1485414611eb15780639b759bf714611e6e5780639baf58d214611e515780639f1d0f59146118b9578063a217fddf1461189d578063a3246ad3146117e0578063ad3cb1cc14611799578063b492fc691461169f578063b9f637af14611474578063bf7d911914611435578063c4c5f62414611382578063c55f15ea1461135f578063ca15c87314611328578063ca2ce65d146112ef578063cc1f8ffa146112bd578063cf46075e146111b3578063d21a74ff14611176578063d2f8253614611153578063d547741f14611118578063d5d3f78b14610fab578063d66bd52414610f72578063e1f1c4a714610f55578063e1f3962c14610f29578063ec2f96fe14610f05578063eda5a26a14610b08578063f1a1eb8414610ac5578063f385116d14610a8c578063f77c479114610a65578063f8c8765e14610661578063faaebd2114610628578063facdfb5e14610488578063fc99bd9a14610377578063fe32e7281461033e5763ffa1ad741461030857600080fd5b3461033b578060031936011261033b57610337610323613903565b6040519182916020835260208301906138b2565b0390f35b80fd5b503461033b57602036600319011261033b576020906040906001600160a01b036103666137c9565b168152601283522054604051908152f35b503461033b57604036600319011261033b576103916137c9565b6010546024359291906001600160a01b03163303610479576001600160a01b03168082526002602052604082205490929060ff16156104665780156104575782825260076020526040822054926103e88285613b4b565b848110610448576001600160ff1b038111610439576000805160206146c9833981519152604085968493846104369852600760205280838a205582519182526020820152a2309033906140b7565b80f35b630700fcb360e11b8452600484fd5b63446c8cc960e01b8452600484fd5b63162908e360e11b8252600482fd5b506024916374ed46ad60e01b8252600452fd5b6349db3bd360e01b8252600482fd5b503461033b57602036600319011261033b576104a26137c9565b6104aa613dad565b6010546001600160a01b03163303610479576001600160a01b03168082526002602052604082205460ff161561061657808252600760205260408220546040516370a0823160e01b8152306004820152602081602481865afa90811561060b5784916105d4575b50818111156105c557610524828261396f565b8215908115610570575b50506000805160206146c9833981519152916040918486526007602052808387205582519182526020820152a260016000805160206146698339815191525580f35b61271081029080820461271014901517156105b157606484029184830460641417156105b157116105a257388061052e565b63a73af74d60e01b8452600484fd5b634e487b7160e01b86526011600452602486fd5b6105cf818361396f565b610524565b90506020813d602011610603575b816105ef6020938361385e565b810103126105fe575138610511565b600080fd5b3d91506105e2565b6040513d86823e3d90fd5b6374ed46ad60e01b8252600452602490fd5b503461033b57602036600319011261033b576020906040906001600160a01b036106506137c9565b168152600483522054604051908152f35b503461033b57608036600319011261033b5761067b6137c9565b6106836137df565b6044356001600160a01b03811690818103610a61576064356001600160a01b0381169390849003610a5d576000805160206146a983398151915254604081901c60ff161595906001600160401b031680159081610a55575b6001149081610a4b575b159081610a42575b50610a33576000805160206146a983398151915280546001600160401b031916600117905585610a0e575b6001600160a01b03169081156109ff576001600160a01b03169081156109f05783156109e157610746614325565b61074e614325565b610756614325565b61075e614325565b600160008051602061466983398151915255610778614325565b610780614325565b86546001600160a01b0319908116919091178755600180549182168317905560405163313ce56760e01b8152909190602081600481855afa8891816109b0575b506107d457633a24e95b60e11b8852600488fd5b6001600160a81b03199092161760a091821b60ff60a01b16176001819055901c60ff166006811415806109a5575b610993575061081181866141e3565b8061096b575b1561092657610834816000805160206146898339815191526141e3565b80610935575b1561092657610857906000805160206145a98339815191526141e3565b90816108ef575b50156108e057806108b5575b506108725780f35b60ff60401b196000805160206146a983398151915254166000805160206146a983398151915255600080516020614589833981519152602060405160018152a180f35b601080546001600160a01b03191682179055826000805160206145e98339815191528180a33861086a565b63cf5a8e3360e01b8352600483fd5b61091f906000805160206145a983398151915286526000805160206145498339815191526020526040862061436b565b503861085e565b63cf5a8e3360e01b8552600485fd5b6000805160206146898339815191528652600080516020614549833981519152602052610965836040882061436b565b5061083a565b85805260008051602061454983398151915260205261098d836040882061436b565b50610817565b63167738cf60e21b8652600452602485fd5b506012811415610802565b6109d391925060203d6020116109da575b6109cb818361385e565b810190613a44565b90386107c0565b503d6109c1565b630b5eba9f60e41b8752600487fd5b63c1ab6dc160e01b8752600487fd5b6336abb4df60e11b8752600487fd5b6000805160206146a9833981519152805460ff60401b1916600160401b179055610718565b63f92ee8a960e01b8752600487fd5b905015386106ed565b303b1591506106e5565b8791506106db565b8580fd5b8480fd5b503461033b578060031936011261033b57546040516001600160a01b039091168152602090f35b503461033b57602036600319011261033b576020906040906001600160a01b03610ab46137c9565b168152600a83522054604051908152f35b503461033b57604036600319011261033b576020906040906001600160a01b03610aed6137c9565b16815260158352818120602435825283522054604051908152f35b503461033b5761016036600319011261033b57610b236137c9565b90606435604435602435610b356138f3565b9160a4359160c43560e43561010435916101243595610144359760018060a01b03601054163303610ef6576001600160a01b038c16808c52600260205260408c2054909a9060ff16610ee2578a15610ed3578615610ec4576127108811610eaa576103e88111610e925760ff82169c60128e118e8115610e87575b50610e7357803b15610e5f578915610e4b578a15610e375782610bd2916140fb565b84151580610e2e575b610e175785151580610e0e575b610df7578b9c602460208d9e9d604051928380926370a0823160e01b82523060048301525afa9c8d15610deb579c610db7575b506001600160ff1b038c11610da8578a8d8f9760408f97838f918f8f8f8f90859f988f99879f966000805160206146098339815191529f978b9f988f8d6000805160206145698339815191529f988e8e610d609b6000805160206145298339815191529f8f8f8487526002602052878720600160ff198254161790558487526003602052878720558386526004602052868620558285526006602052878686205582855260056020528585209060ff19825416179055818452600c6020528885852055818452600d6020528985852055818452600e6020528a85852055818452600f6020528b8585205581845260076020528484205582526012602052828220558d8152601360205220558a7f991d1ef1b5c0820d213328cba6682059e00a50e49c469a454eb3557e78eaf6668e80518b81528c6020820152a28c5198899889613b58565b0390a28151908b82526020820152a28151908782526020820152a280610d84578280f35b60406000805160206146c9833981519152918151908582526020820152a281808280f35b63556e7a8160e01b8e5260048efd5b909b506020813d602011610de3575b81610dd36020938361385e565b810103126105fe57519a38610c1b565b3d9150610dc6565b604051903d90823e3d90fd5b60448c858863dd85772b60e01b8352600452602452fd5b50838610610be8565b60448c8487637449915760e01b8352600452602452fd5b50828510610bdb565b636835314760e11b8d52600160045260248dfd5b636835314760e11b8d5260048d905260248dfd5b63377e3f9960e21b8d5260048c905260248dfd5b63ca95039160e01b8d5260048e905260248dfd5b60069150108e610bb0565b631051834f60e11b8c526004526103e860245260448bfd5b63c1e9a14160e01b8c52600488905261271060245260448cfd5b63a2ec3a5560e01b8c5260048cfd5b63df407ac560e01b8c5260048cfd5b6317f4215b60e21b8c5260048b905260248cfd5b6349db3bd360e01b8b5260048bfd5b503461033b578060031936011261033b57602060ff60015460a01c16604051908152f35b503461033b57602036600319011261033b576020610f4d610f486137c9565b613c90565b604051908152f35b503461033b578060031936011261033b5760206040516127108152f35b503461033b57602036600319011261033b576020906040906001600160a01b03610f9a6137c9565b168152600783522054604051908152f35b503461033b57602036600319011261033b57610fc56137c9565b6010546001600160a01b03163303610479576001600160a01b03168082526002602052604082205460ff1615610616578082526007602052604082205480611102575080825260026020526040822060ff1981541690558082526003602052816040812055808252600460205281604081205580825260056020526040822060ff198154169055808252600c602052816040812055808252600d602052816040812055808252600e602052816040812055808252600f602052816040812055808252600660205281604081205580825260076020526040822054818352600760205282604081205560405190827f3302a1b37f04242bb55603f5449e7ecd690a35eef08ba1353c48c20e2aae9cda8580a2806110df578380f35b816040916000805160206146c98339815191529352846020820152a23880808380f35b604492916376bc059760e11b8352600452602452fd5b503461033b57604036600319011261033b5761114f6004356111386137df565b9061114a61114582613a14565b613f23565b613fb5565b5080f35b503461033b578060031936011261033b57602060ff600854166040519015158152f35b503461033b57602036600319011261033b5760209060ff906040906001600160a01b036111a16137c9565b16815260058452205416604051908152f35b503461033b57602036600319011261033b576111cd6137c9565b6111d5613dad565b6010546001600160a01b03163303610479576001600160a01b03168082526002602052604082205460ff161561061657808252600760205260408220546040516370a0823160e01b8152306004820152602081602481865afa90811561060b57849161127d575b506000805160206146c9833981519152916040918486526007602052808387205582519182526020820152a260016000805160206146698339815191525580f35b90506020813d6020116112b5575b816112986020938361385e565b810103126105fe57516000805160206146c983398151915261123c565b3d915061128b565b503461033b57604036600319011261033b5760206112e56112dc6137c9565b60243590613b91565b6040519015158152f35b503461033b57602036600319011261033b576020906040906001600160a01b036113176137c9565b168152601383522054604051908152f35b503461033b57602036600319011261033b576040602091600435815260008051602061454983398151915283522054604051908152f35b503461033b578060031936011261033b576020604051670de0b6b3a76400008152f35b503461033b57604036600319011261033b5761139c6137c9565b6010546024359291906001600160a01b03163303610479576001600160a01b031680825260076020526040822054929081841061141e57806000805160206146c98339815191526040866113f486610436989961396f565b84895260076020528289205583885260076020528188205482519182526020820152a23390613ee7565b5091604492633cb8e07360e01b8352600452602452fd5b503461033b57602036600319011261033b5760209060ff906040906001600160a01b036114606137c9565b168152600284522054166040519015158152f35b503461033b5761012036600319011261033b5761148f6137c9565b60643591906044356024356114a26138f3565b601054610104359660e4359260c4359260a43592906001600160a01b03163303611690576001600160a01b038816808a52600260205260408a205490989060ff161561167c57861561166d576127108811611653576103e882116116395760ff83169060128211801561162f575b61161b578361151e916140fb565b85151580611612575b6115fb578a1515806115f2575b6115db579260008051602061452983398151915297969592828c956115d5979460408e8e80825260036020528c8383205580825260046020528d838320558152600660205220558b8d52600560205260408d209060ff198254161790558a8c52600c6020528260408d20558a8c52600d6020528360408d20558a8c52600e6020528460408d20558a8c52600f6020528560408d205560405198899889613b58565b0390a280f35b60448a868d63dd85772b60e01b8352600452602452fd5b50848b10611534565b60448a8588637449915760e01b8352600452602452fd5b50838610611527565b63ca95039160e01b8b52600482905260248bfd5b5060068210611510565b631051834f60e11b8a5260048290526103e860245260448afd5b63c1e9a14160e01b8a52600488905261271060245260448afd5b63a2ec3a5560e01b8a5260048afd5b6374ed46ad60e01b8a52600489905260248afd5b6349db3bd360e01b8952600489fd5b503461033b57604036600319011261033b576116b96137c9565b6001600160a01b0316808252600260205260408220546024359060ff16156117855780156117765761271061173b604085670de0b6b3a764000061172a6117439688859a52600560205260ff858520541690809160128110611750575b505088845260036020528484205490613926565b049581526004602052205484613926565b04809261396f565b9082519182526020820152f35b61176f925060ff6117636117699261397c565b1661398d565b90613926565b3880611716565b63162908e360e11b8352600483fd5b6374ed46ad60e01b83526004829052602483fd5b503461033b578060031936011261033b5761033760408051906117bc818361385e565b60058252640352e302e360dc1b6020830152519182916020835260208301906138b2565b503461033b57602036600319011261033b57600435815260008051602061454983398151915260205260408120604051908160208254918281520190819285526020852090855b818110611887575050508261183d91038361385e565b604051928392602084019060208552518091526040840192915b818110611865575050500390f35b82516001600160a01b0316845285945060209384019390920191600101611857565b8254845260209093019260019283019201611827565b503461033b578060031936011261033b57602090604051908152f35b503461033b576118c836613804565b9190926118d3613dad565b6118db613de9565b338152600960205260408120544303611e2f57338152600a602052600360408220541015611e2057338152600a602052604081206119198154613a35565b90555b6001600160a01b0382168082526002602052604082205490929060ff16611d7f575b828252600260205260ff60408320541615610466578415610457578315611d7057828252600c60205260408220548510611d4b57828252600e60205260408220548015611d3c57808611611d2557508461199791613ff9565b6040516370a0823160e01b8152306004820152602081602481865afa908115611be5578291611cf3575b506119ce853033866140b7565b6040516370a0823160e01b8152306004820152602081602481875afa908115611ce857908692918491611caf575b5090611a079161396f565b10611ca05781815260076020526040812054611a238582613b4b565b818110611c91576001600160ff1b038111611c8257604084926000805160206146c9833981519152928486526007602052808387205582519182526020820152a2818152600560205260ff604082205416849060128110611c21575b50611aa0670de0b6b3a7640000918484526003602052604084205490613926565b04908281526004602052611ac6612710611abe604084205485613926565b04809361396f565b93808510611c09575080546001600160a01b0316803b15611bf05781809160846040518094819363ae494fa160e01b83523360048401528a60248401528960448401528b60648401525af18015611be557908291611bf4575b505081611b7d575b507fb3e2773606abfd36b5bd91394b3a54d1398336c65005baf7bf7a05efeffaf75b611b60602095604051918291339588429285613a78565b0390a3600160008051602061466983398151915255604051908152f35b80546001600160a01b0316803b15611bf05781809160846040518094819363ae494fa160e01b83523060048401528860248401528960448401528160648401525af18015611be557611bd0575b50611b27565b611bdb82809261385e565b61033b5780611bca565b6040513d84823e3d90fd5b5080fd5b81611bfe9161385e565b61033b578038611b1f565b6371c4efed60e01b8252600485905260245260449150fd5b611c31915061176360ff9161397c565b8015611c6e5780600019048511611c5f57611aa0611c58670de0b6b3a76400009287613926565b9150611a7f565b63035fc53d60e41b8252600482fd5b634e487b7160e01b82526012600452602482fd5b630700fcb360e11b8352600483fd5b63446c8cc960e01b8352600483fd5b639bfa3c1760e01b8152600490fd5b919250506020813d602011611ce0575b81611ccc6020938361385e565b810103126105fe5751859190611a076119fc565b3d9150611cbf565b6040513d85823e3d90fd5b90506020813d602011611d1d575b81611d0e6020938361385e565b810103126105fe5751386119c1565b3d9150611d01565b631d7f2ac360e01b83526004869052602452604482fd5b633b5db2f360e11b8352600483fd5b50908152600c6020526040812054630d54e9e160e01b82526004849052602452604490fd5b632cd84af360e01b8252600482fd5b60405163313ce56760e01b815291939291602081600481865afa859181611dff575b50611db55763105482c760e21b8552600485fd5b93919293838352600560205260ff806040852054169116908103611dd9575061193e565b90506044928252600560205260ff604083205416631e43476360e11b8352600452602452fd5b611e1991925060203d6020116109da576109cb818361385e565b9038611da1565b63a74c1c5f60e01b8152600490fd5b3381526009602052436040822055338152600a6020526001604082205561191c565b503461033b578060031936011261033b5760206040516103e88152f35b503461033b57604036600319011261033b576020906040906001600160a01b03611e966137c9565b16815260148352818120602435825283522054604051908152f35b503461033b57604036600319011261033b576040611ecd6137df565b916004358152600080516020614629833981519152602052209060018060a01b0316600052602052602060ff604060002054166040519015158152f35b503461033b578060031936011261033b57602060405160648152f35b503461033b57604036600319011261033b57611f606020916004358152600080516020614549833981519152835260406024359120614353565b905460405160039290921b1c6001600160a01b03168152f35b503461033b57602036600319011261033b576020906040906001600160a01b03611fa16137c9565b168152600983522054604051908152f35b503461033b57604036600319011261033b57611fcc6137c9565b60105460243591906001600160a01b0316330361206a576001600160a01b031690811561205b5760406000805160206146098339815191529183855260136020528185205490848652601360205280838720558486526015602052828620438752602052828620548587526019602052838720558486526017602052438387205582519182526020820152a280f35b63df407ac560e01b8352600483fd5b6349db3bd360e01b8352600483fd5b503461033b57602036600319011261033b576020906040906001600160a01b036120a16137c9565b168152600383522054604051908152f35b503461033b578060031936011261033b576000805160206145a9833981519152815260008051602061462983398151915260209081526040808320336000908152925290205460ff161561218857612108613de9565b600160ff19600080516020614649833981519152541617600080516020614649833981519152557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a2586020604051338152a16040514281527f80170b5fcdd2bf1e0660ef4b8851f86685f64d41b1a19de1471947ece8725aac60203392a280f35b63e2517d3f60e01b8152336004526000805160206145a9833981519152602452604490fd5b503461033b57602036600319011261033b576121c76137c9565b6000805160206146a98339815191525460ff8160401c169081156122b3575b506122a4576000805160206146a983398151915280546001600160481b0319166003600160401b0117905581805260008051602061462983398151915260209081526040808420336000908152925290205460ff161561228c5761224990613af9565b60ff60401b196000805160206146a983398151915254166000805160206146a983398151915255600080516020614589833981519152602060405160038152a180f35b63e2517d3f60e01b8252336004526024829052604482fd5b63f92ee8a960e01b8252600482fd5b60036001600160401b039190911610159050386121e6565b503461033b578060031936011261033b57602060ff60008051602061464983398151915254166040519015158152f35b503461033b57602036600319011261033b576123156137c9565b6010546001600160a01b031633036104795761043690613af9565b503461033b57606036600319011261033b5761234a6137c9565b6123526137df565b60105490926044359290916001600160a01b0316330361047957612374613de9565b6011546001600160a01b03169182156125ea5760405163babcc53960e01b81526001600160a01b0386166004820181905293602090829060249082905afa908115611be55782916125af575b50156125a0578215612591576001546001600160a01b03928316921682036124e1576040516370a0823160e01b8152306004820152602081602481865afa908115611be55782916124af575b50935b84156124a057600019810361249a5750835b841561248b5780851161247357505061243d8360209583613ee7565b7f0bf519e4b3821615dbdd874fa1a5fbb4bb651b4e6beabedd4ac318e770233b2c604080518581524287820152a3604051908152f35b630555ed4f60e31b8252600485905260245260449150fd5b632e11316f60e11b8252600482fd5b93612421565b63f09872eb60e01b8252600482fd5b90506020813d6020116124d9575b816124ca6020938361385e565b810103126105fe57513861240c565b3d91506124bd565b8181526002602052604081205460ff161561257f576040516370a0823160e01b8152306004820152602081602481865afa908115611be557829161254d575b5082825260076020526040822054808211156125455761253f9161396f565b9361240f565b50508061253f565b90506020813d602011612577575b816125686020938361385e565b810103126105fe575138612520565b3d915061255b565b60249163eef7849760e01b8252600452fd5b634e46966960e11b8152600490fd5b63133307bb60e21b8152600490fd5b90506020813d6020116125e2575b816125ca6020938361385e565b81010312611bf057518015158103611bf057386123c0565b3d91506125bd565b630e048e7160e41b8152600490fd5b503461033b57602036600319011261033b576126136137c9565b6010546001600160a01b03163303610479576001600160a01b0316801561267857601180546001600160a01b0319811683179091556001600160a01b03167f1e9c406f2707909cfd9f61e744f73bcab77e5997d063276f67883c5257d51cf08380a380f35b634e46966960e11b8252600482fd5b503461033b578060031936011261033b577f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031630036126e05760206040516000805160206145c98339815191528152f35b63703e46dd60e11b8152600490fd5b503461033b578060031936011261033b576010546040516001600160a01b039091168152602090f35b50604036600319011261033b5761272d6137c9565b602435906001600160401b038211612a0d5736602383011215612a0d578160040135908361275a83613897565b93612768604051958661385e565b83855260208501933660248284010111612a0d57806024602093018637850101526001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000163081149081156129ea575b506129db576010546001600160a01b031633036129cc576001600160a01b0381169283156129bd57813b156129ae576000805160206145c98339815191525484612806613903565b7f6ea8b34d59b2818d3f37a08dddaa06f5886b9c20c907b36f03ca6528e106e86f61283c604051926040845260408401906138b2565b4260208401526001600160a01b038516929081900390a36040516352d1902d60e01b8152602081600481895afa879181612976575b5061288a57634c9c8ce360e01b87526004869052602487fd5b90816000805160206145c9833981519152889793036129645750833b15612950576001600160a01b03191681176000805160206145c9833981519152558491907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b8380a28051156129355761114f9382915190845af43d1561292d573d9161291183613897565b9261291f604051948561385e565b83523d85602085013e6144a7565b6060916144a7565b50505050346129415780f35b63b398979f60e01b8152600490fd5b634c9c8ce360e01b86526004829052602486fd5b632a87526960e21b8752600452602486fd5b9091506020813d6020116129a6575b816129926020938361385e565b810103126129a257519038612871565b8780fd5b3d9150612985565b636f7c43f160e01b8552600485fd5b63e6c4247b60e01b8552600485fd5b6349db3bd360e01b8452600484fd5b63703e46dd60e11b8452600484fd5b6000805160206145c9833981519152546001600160a01b031614159050386127be565b8280fd5b503461033b57602036600319011261033b576020906040906001600160a01b03612a396137c9565b168152600e83522054604051908152f35b503461033b57606036600319011261033b57612a646137f5565b6024356001600160401b038111612a0d57612a8390369060040161382e565b916044356001600160401b038111610a6157612aa390369060040161382e565b6000805160206146a98339815191529291925460ff8160401c16908115612e06575b50612df7576000805160206146a983398151915280546001600160481b0319166002600160401b01179055600080516020614689833981519152865260008051602061462983398151915260209081526040808820336000908152925290205460ff1615612dd257612b35614325565b612b3d614325565b600160008051602061466983398151915255600b549160ff8316612dc357818603612db457612b6b86613a94565b92612b79604051948561385e565b868452601f19612b8888613a94565b01366020860137875b878110612cbf575060019060ff191617600b5515159460ff196008541660ff871617600855865b818110612c1c5787600080516020614509833981519152602089604051908152a160ff60401b196000805160206146a983398151915254166000805160206146a983398151915255600080516020614589833981519152602060405160028152a180f35b80886000805160206146c98339815191526040612c44612c3f600196888d613aab565b613ad1565b612c4f85898c613aab565b357f8f955fa878b4aae8b1ac37b1ab715307470f2822ceff87e23d33ef1e044814a783612c7c888d613ae5565b5193898060a01b0316968793848252600660205280838320558482526007602052858383205582519182526020820152a28151908d82526020820152a201612bb8565b612ccd612c3f828a8a613aab565b612cd8828689613aab565b6001600160a01b03909116808b52600260205260408b20549091359060ff1615612da0576103e88111612d885750906020602492604051938480926370a0823160e01b82523060048301525afa8015612d7d578a90612d47575b60019250612d408288613ae5565b5201612b91565b509060203d8111612d76575b612d5d818361385e565b6020826000928101031261033b57509060019151612d32565b503d612d53565b6040513d8c823e3d90fd5b631051834f60e11b8b526004526103e860245260448afd5b6351104c5960e01b8b52600482905260248bfd5b63512509d360e11b8752600487fd5b6324d0d1fd60e01b8752600487fd5b63e2517d3f60e01b865233600452600080516020614689833981519152602452604486fd5b63f92ee8a960e01b8652600486fd5b60026001600160401b03919091161015905038612ac5565b503461033b578060031936011261033b576011546040516001600160a01b039091168152602090f35b503461033b578060031936011261033b576010546001600160a01b03163303612eff576000805160206146498339815191525460ff811615612ef05760ff1916600080516020614649833981519152557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa6020604051338152a16040514281527f107553d8191d85b405879cf752997865edd48d94e20bda4dd27223c94b31a7cc60203392a280f35b638dfc202b60e01b8252600482fd5b6349db3bd360e01b8152600490fd5b503461033b57602036600319011261033b576020906040906001600160a01b03612f366137c9565b168152601683522054604051908152f35b503461033b57604036600319011261033b57612f616137df565b336001600160a01b03821603612f7d5761114f90600435613fb5565b63334bd91960e11b8252600482fd5b503461033b57602036600319011261033b576020906040906001600160a01b03612fb46137c9565b168152600c83522054604051908152f35b503461033b57602036600319011261033b576020906040906001600160a01b03612fed6137c9565b168152601783522054604051908152f35b503461033b57604036600319011261033b5761114f60043561301e6137df565b9061302b61114582613a14565b613f6d565b503461033b5761303f36613804565b9190613049613dad565b613051613de9565b33845260096020526040842054430361343a57338452600a60205260036040852054101561342b57338452600a6020526040842061308f8154613a35565b90555b6001600160a01b0382168085526002602052604085205490929060ff16613393575b828552600260205260ff6040862054161561337f5760ff600854161561337057811561336157831561335257828552600d602052604085205480831061333b5750828552600f6020526040852054801561332c5780831161331657508161311a91613e13565b670de0b6b3a76400008102818104670de0b6b3a764000003613302578285526003602052604085205461314c9161394f565b908285526006602052613169612710611abe604088205485613926565b93838652600560205260ff604087205416601281106132d7575b508085106132c0575082855260076020528360408620541061329c578285526007602052604085205484811061328d576000805160206146c98339815191526040826131d088889561396f565b848a52600760205280838b205582519182526020820152a284546001600160a01b0316803b15610a5d57856040518092633a52b90760e11b825281838161321b883360048401613a5d565b03925af180156132825791602096611b60927f8caf04742286d017f9ac3924388e188c73e6e5094311c5e59a61a7ef86dda8bf94613272575b5050613261863387613ee7565b604051918291339588429285613a78565b8161327c9161385e565b38613254565b6040513d88823e3d90fd5b6308aed4ef60e31b8652600486fd5b82855260076020526040852054635960d22160e01b86526004526024849052604485fd5b6371c4efed60e01b86526004859052602452604485fd5b946132f56132ee60ff6117636132fb95979961397c565b809261394f565b9561394f565b9138613183565b634e487b7160e01b85526011600452602485fd5b625502a360e91b86526004839052602452604485fd5b636c6ff70d60e11b8652600486fd5b6361767b8560e01b86526004839052602452604485fd5b632cd84af360e01b8552600485fd5b63162908e360e11b8552600485fd5b630df65d9f60e01b8552600485fd5b6374ed46ad60e01b85526004839052602485fd5b60405163313ce56760e01b8152602081600481875afa86918161340a575b506133c55763105482c760e21b8652600486fd5b838652600560205260ff8060408820541691169081036133e557506130b4565b83865260056020526040862054631e43476360e11b875260ff16600452602452604485fd5b61342491925060203d6020116109da576109cb818361385e565b90386133b1565b63a74c1c5f60e01b8452600484fd5b3384526009602052436040852055338452600a60205260016040852055613092565b503461033b57602036600319011261033b576020610f4d600435613a14565b503461033b57602036600319011261033b576020906040906001600160a01b036134a36137c9565b168152600f83522054604051908152f35b503461033b57604036600319011261033b576134ce6137c9565b60105460243591906001600160a01b0316330361206a576001600160a01b031690811561205b5760406000805160206145698339815191529183855260126020528185205490848652601260205280838720558486526014602052828620438752602052828620548587526018602052838720558486526016602052438387205582519182526020820152a280f35b503461033b57602036600319011261033b576020906040906001600160a01b036135856137c9565b168152600683522054604051908152f35b503461033b578060031936011261033b576001546040516001600160a01b039091168152602090f35b503461033b57602036600319011261033b576020906040906001600160a01b036135e76137c9565b168152600d83522054604051908152f35b503461033b57602036600319011261033b576136126137f5565b6010546001600160a01b0316330361047957602060008051602061450983398151915291151560ff196008541660ff821617600855604051908152a180f35b503461033b57602036600319011261033b5760043563ffffffff60e01b8116809103611bf057602090635a05180f60e01b8114908115613697575b506040519015158152f35b637965db0b60e01b8114915081156136b1575b508261368c565b6301ffc9a760e01b149050826136aa565b503461033b57604036600319011261033b576136dc6137c9565b6001600160a01b03168082526002602052604082205460243592919060ff16156137b657670de0b6b3a7640000830292808404670de0b6b3a764000014901517156137a25760ff604061373c81958486526003602052828620549061394f565b9383815260066020526137606127106137588484205488613926565b04809661396f565b9381526005602052205416601281101561379b57906137896132ee60ff61176361378f9561397c565b9261394f565b82519182526020820152f35b509061378f565b634e487b7160e01b82526011600452602482fd5b6374ed46ad60e01b825260045260249150fd5b600435906001600160a01b03821682036105fe57565b602435906001600160a01b03821682036105fe57565b6004359081151582036105fe57565b60609060031901126105fe576004356001600160a01b03811681036105fe57906024359060443590565b9181601f840112156105fe578235916001600160401b0383116105fe576020808501948460051b0101116105fe57565b601f909101601f19168101906001600160401b0382119082101761388157604052565b634e487b7160e01b600052604160045260246000fd5b6001600160401b03811161388157601f01601f191660200190565b919082519283825260005b8481106138de575050826000602080949584010152601f8019910116010190565b806020809284010151828286010152016138bd565b6084359060ff821682036105fe57565b6040519061391260408361385e565b6005825264322e332e3360d81b6020830152565b8181029291811591840414171561393957565b634e487b7160e01b600052601160045260246000fd5b8115613959570490565b634e487b7160e01b600052601260045260246000fd5b9190820391821161393957565b60ff166012039060ff821161393957565b8015613a0e5760009060208110600116604e821060011617613a0657600a916001915b600181116139dd5750826000190482116139c957500290565b634e487b7160e01b81526011600452602490fd5b92806000190481116137a257600184166139fd575b80029260011c6139b0565b809202916139f2565b9050600a0a90565b50600190565b60005260008051602061462983398151915260205260016040600020015490565b60001981146139395760010190565b908160209103126105fe575160ff811681036105fe5790565b6001600160a01b039091168152602081019190915260400190565b9094939260609260808301968352602083015260408201520152565b6001600160401b0381116138815760051b60200190565b9190811015613abb5760051b0190565b634e487b7160e01b600052603260045260246000fd5b356001600160a01b03811681036105fe5790565b8051821015613abb5760209160051b010190565b6001600160a01b03168015613b3a57601080546001600160a01b0319811683179091556001600160a01b03166000805160206145e9833981519152600080a3565b63e6c4247b60e01b60005260046000fd5b9190820180921161393957565b94919360e0969360ff929a99989561010088019b885260208801526040870152166060850152608084015260a083015260c08201520152565b6001600160a01b03811660008181526002602052604090205490919060ff16158015613c83575b8015613c7b575b613c695781600052600f6020526040600020548015908115613c71575b50613c6957613c01926040918251948592839262f7fce960e01b845260048401613a5d565b0381305afa918215613c5d57600092613c29575b506000526007602052604060002054101590565b9091506040813d604011613c55575b81613c456040938361385e565b810103126105fe57519038613c15565b3d9150613c38565b6040513d6000823e3d90fd5b505050600090565b9050831138613bdc565b508215613bbf565b5060ff6008541615613bb8565b6001546001600160a01b0391821691168103613d05576020602491604051928380926370a0823160e01b82523060048301525afa908115613c5d57600091613cd6575090565b90506020813d602011613cfd575b81613cf16020938361385e565b810103126105fe575190565b3d9150613ce4565b80600052600260205260ff60406000205416613d215750600090565b6040516370a0823160e01b815230600482015290602082602481845afa918215613c5d57600092613d79575b506000526007602052604060002054808211600014613d7257613d6f9161396f565b90565b5050600090565b90916020823d602011613da5575b81613d946020938361385e565b8101031261033b5750519038613d4d565b3d9150613d87565b60026000805160206146698339815191525414613dd857600260008051602061466983398151915255565b633ee5aeb560e01b60005260046000fd5b60ff6000805160206146498339815191525416613e0257565b63d93c066560e01b60005260046000fd5b6001600160a01b03166000818152601360205260409020548015613ee257816000526015602052604060002043600052602052613e566040600020549384613b4b565b928310613ed157808260005260176020524360406000205414613eb3575b8311613e9757506000526015602052604060002043600052602052604060002055565b925063029359d560e41b60005260045260245260445260646000fd5b50816000526019602052613ecc60406000205482613b4b565b613e74565b63446c8cc960e01b60005260046000fd5b505050565b613f1c613f219392613f0e60405194859263a9059cbb60e01b602085015260248401613a5d565b03601f19810184528361385e565b614188565b565b60008181526000805160206146298339815191526020908152604080832033845290915290205460ff1615613f555750565b63e2517d3f60e01b6000523360045260245260446000fd5b613f7782826141e3565b9182613f8257505090565b60009182526000805160206145498339815191526020526040909120613fb1916001600160a01b03169061436b565b5090565b613fbf8282614285565b9182613fca57505090565b60009182526000805160206145498339815191526020526040909120613fb1916001600160a01b0316906143d4565b6001600160a01b03166000818152601260205260409020548015613ee25781600052601460205260406000204360005260205261403c6040600020549384613b4b565b928310613ed157808260005260166020524360406000205414614099575b831161407d57506000526014602052604060002043600052602052604060002055565b92506319a4e2a760e01b60005260045260245260445260646000fd5b508160005260186020526140b260406000205482613b4b565b61405a565b6040516323b872dd60e01b60208201526001600160a01b039283166024820152929091166044830152606480830193909352918152613f2191613f1c60848361385e565b60405163313ce56760e01b81529190602090839060049082906001600160a01b03165afa60009281614167575b5061413e57631eecbb6560e01b60005260046000fd5b60ff9182169116808203614150575050565b631e43476360e11b60005260045260245260446000fd5b61418191935060203d6020116109da576109cb818361385e565b9138614128565b906000602091828151910182855af115613c5d576000513d6141da57506001600160a01b0381163b155b6141b95750565b635274afe760e01b60009081526001600160a01b0391909116600452602490fd5b600114156141b2565b6000818152600080516020614629833981519152602090815260408083206001600160a01b038616845290915290205460ff16613d72576000818152600080516020614629833981519152602090815260408083206001600160a01b0395909516808452949091528120805460ff19166001179055339291907f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d9080a4600190565b6000818152600080516020614629833981519152602090815260408083206001600160a01b038616845290915290205460ff1615613d72576000818152600080516020614629833981519152602090815260408083206001600160a01b0395909516808452949091528120805460ff19169055339291907ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9080a4600190565b60ff6000805160206146a98339815191525460401c161561434257565b631afcd79f60e31b60005260046000fd5b8054821015613abb5760005260206000200190600090565b6001810190826000528160205260406000205415600014613c69578054600160401b811015613881576143bf6143a8826001879401855584614353565b819391549060031b91821b91600019901b19161790565b90555491600052602052604060002055600190565b906001820191816000528260205260406000205480151560001461449e57600019810181811161393957825460001981019190821161393957818103614467575b5050508054801561445157600019019061442f8282614353565b8154906000199060031b1b191690555560005260205260006040812055600190565b634e487b7160e01b600052603160045260246000fd5b6144876144776143a89386614353565b90549060031b1c92839286614353565b905560005283602052604060002055388080614415565b50505050600090565b906144cd57508051156144bc57602081519101fd5b63d6bda27560e01b60005260046000fd5b815115806144ff575b6144de575090565b639996b31560e01b60009081526001600160a01b0391909116600452602490fd5b50803b156144d656fe2c0a5f5ab0ba371221bb3612c2d2f90d36566279309f526000c5b354efd1b0658c67aaac7f77de07240e5a9b36dfdccb2a89c438635abbb27a73142d2aa0f629c1f6fe24621ce81ec5827caf0253cadb74709b061630e6b55e8237170593200048b07fab687f450848f1df8a96db08fef7840f53415f18fdc2ec8e9f810f0930c7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d275027301df982f5215b4963a854cf9c73219df80cb6acd8f098189c9480c7bbc360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc17dc5b1290f7495d7f8cc68476e6941aaf510598fa925d0d2720edc8805a846c4460507c21097c15f6883572ebd157a9ee4b1d989a312314e93afd9d2ecd494002dd7bc7dec4dceedda775e58dd541e08a116c6c53815c0bd028192f7b626800cd5ed15c6e187e77e9aee88184c21f4f2182ab5827cb3b7e07fbedcd63f033009b779b17422d0df92223018b32b4d1fa46e071723d6817e2486d003becc55f00a49807205ce4d355092ef5a8a18f56e8913cf4a201fbe287825b095693c21775f0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a006d129bd71f2401cbe77f49f546d7d5f58992faecfca6e51ba06b50b261e83331a164736f6c6343000822000a";
|
|
116824
116738
|
var isSuperArgs = (xs) => xs.length > 1;
|
|
116825
116739
|
var SimplePSMV2__factory = class extends ContractFactory {
|
|
116826
116740
|
constructor(...args) {
|
|
@@ -122848,7 +122762,7 @@ Error data: ${errorData || "none"}`
|
|
|
122848
122762
|
source: json.data.source
|
|
122849
122763
|
};
|
|
122850
122764
|
}
|
|
122851
|
-
const result = await this.bitcoinOperations.getPrice(
|
|
122765
|
+
const result = await this.bitcoinOperations.getPrice(false);
|
|
122852
122766
|
if (!result.success) {
|
|
122853
122767
|
const cause = result.error?.originalError?.message ?? String(result.error);
|
|
122854
122768
|
throw new Error(`Failed to get BTC price: ${cause}`);
|
|
@@ -123076,6 +122990,44 @@ Error data: ${errorData || "none"}`
|
|
|
123076
122990
|
}));
|
|
123077
122991
|
}
|
|
123078
122992
|
}
|
|
122993
|
+
/**
|
|
122994
|
+
* Get a PKP-signed TOTAL confirmed Bitcoin balance for a raw vault ADDRESS
|
|
122995
|
+
* (no positionId) via the `btc-address-balance` LIT Action.
|
|
122996
|
+
*
|
|
122997
|
+
* Exercises the balance-query path (BitcoinProviderRegistry decrypt →
|
|
122998
|
+
* cross-provider consensus → PKP signature) using only an address. This is
|
|
122999
|
+
* NOT a protocol trusted/available balance: authorized spends are not
|
|
123000
|
+
* subtracted, and the returned signature is an `AddressBalanceAttestation`
|
|
123001
|
+
* (NOT a `BalanceConfirmation` — it is not consumable by
|
|
123002
|
+
* `PositionManager.updateBalance`).
|
|
123003
|
+
*/
|
|
123004
|
+
async getAddressBalance(vaultAddress) {
|
|
123005
|
+
this.ensureInitialized();
|
|
123006
|
+
try {
|
|
123007
|
+
if (this.config.mode !== "service") {
|
|
123008
|
+
throw new Error("getAddressBalance requires service mode \u2014 standalone mode is not supported");
|
|
123009
|
+
}
|
|
123010
|
+
const serviceEndpoint = this.config.serviceEndpoint;
|
|
123011
|
+
const url = `${serviceEndpoint}/api/lit/address-balance?vaultAddress=${encodeURIComponent(vaultAddress)}`;
|
|
123012
|
+
const response = await fetch(url, {
|
|
123013
|
+
headers: await this.getAuthHeader()
|
|
123014
|
+
});
|
|
123015
|
+
if (!response.ok) {
|
|
123016
|
+
throw new Error(`Address balance request failed: ${response.status} ${response.statusText}`);
|
|
123017
|
+
}
|
|
123018
|
+
const json = await response.json();
|
|
123019
|
+
if (!json.success)
|
|
123020
|
+
throw new Error(json.error ?? "Address balance request failed");
|
|
123021
|
+
return success(json.data);
|
|
123022
|
+
} catch (error2) {
|
|
123023
|
+
return failure(new SDKError({
|
|
123024
|
+
message: `Failed to get address balance: ${error2 instanceof Error ? error2.message : String(error2)}`,
|
|
123025
|
+
category: "CONFIGURATION" /* CONFIGURATION */,
|
|
123026
|
+
severity: "MEDIUM" /* MEDIUM */,
|
|
123027
|
+
originalError: error2 instanceof Error ? error2 : new Error(String(error2))
|
|
123028
|
+
}));
|
|
123029
|
+
}
|
|
123030
|
+
}
|
|
123079
123031
|
// ============================================================================
|
|
123080
123032
|
// HIGH-LEVEL API - Mock Token Operations (Test Networks Only)
|
|
123081
123033
|
// ============================================================================
|