@black-market/sdk 0.8.0 → 0.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (43) hide show
  1. package/README.md +76 -89
  2. package/assets/abyss-ziggurat-v3-pale-text-1500x500.png +0 -0
  3. package/dist/lifecycle/deployments/dynamic-fee-pool-hook-v1-20261011.d.ts +12 -0
  4. package/dist/lifecycle/deployments/dynamic-fee-pool-hook-v1-20261011.d.ts.map +1 -0
  5. package/dist/lifecycle/deployments/dynamic-fee-pool-hook-v1-20261011.js +11 -0
  6. package/dist/lifecycle/deployments/dynamic-fee-pool-hook-v1-20261011.js.map +1 -0
  7. package/dist/lifecycle/deployments/hmm-dynamic-pool-hook-v1-20261011.d.ts +67 -0
  8. package/dist/lifecycle/deployments/hmm-dynamic-pool-hook-v1-20261011.d.ts.map +1 -0
  9. package/dist/lifecycle/deployments/hmm-dynamic-pool-hook-v1-20261011.js +69 -0
  10. package/dist/lifecycle/deployments/hmm-dynamic-pool-hook-v1-20261011.js.map +1 -0
  11. package/dist/lifecycle/deployments/hmm-fixed-pool-hook-v1-20261011.d.ts +67 -0
  12. package/dist/lifecycle/deployments/hmm-fixed-pool-hook-v1-20261011.d.ts.map +1 -0
  13. package/dist/lifecycle/deployments/hmm-fixed-pool-hook-v1-20261011.js +69 -0
  14. package/dist/lifecycle/deployments/hmm-fixed-pool-hook-v1-20261011.js.map +1 -0
  15. package/dist/lifecycle/hmm.d.ts +125 -0
  16. package/dist/lifecycle/hmm.d.ts.map +1 -0
  17. package/dist/lifecycle/hmm.js +91 -0
  18. package/dist/lifecycle/hmm.js.map +1 -0
  19. package/dist/lifecycle/index.d.ts +1 -0
  20. package/dist/lifecycle/index.d.ts.map +1 -1
  21. package/dist/lifecycle/index.js +1 -0
  22. package/dist/lifecycle/index.js.map +1 -1
  23. package/dist/lifecycle/markets.d.ts +3 -0
  24. package/dist/lifecycle/markets.d.ts.map +1 -1
  25. package/dist/lifecycle/markets.js +24 -1
  26. package/dist/lifecycle/markets.js.map +1 -1
  27. package/dist/lifecycle/presets.d.ts +9 -3
  28. package/dist/lifecycle/presets.d.ts.map +1 -1
  29. package/dist/lifecycle/presets.js +103 -1
  30. package/dist/lifecycle/presets.js.map +1 -1
  31. package/docs/launch-lifecycle.md +109 -10
  32. package/examples/README.md +11 -5
  33. package/examples/hmm-launch-config.ts +29 -0
  34. package/examples/launch-example.ts +13 -5
  35. package/package.json +1 -1
  36. package/src/lifecycle/deployments/dynamic-fee-pool-hook-v1-20261011.ts +12 -0
  37. package/src/lifecycle/deployments/hmm-dynamic-pool-hook-v1-20261011.ts +71 -0
  38. package/src/lifecycle/deployments/hmm-fixed-pool-hook-v1-20261011.ts +71 -0
  39. package/src/lifecycle/hmm.ts +99 -0
  40. package/src/lifecycle/index.ts +1 -0
  41. package/src/lifecycle/markets.ts +22 -1
  42. package/src/lifecycle/presets.ts +108 -1
  43. package/assets/abyss-social.webp +0 -0
@@ -0,0 +1,71 @@
1
+ import type { Hex } from "viem";
2
+ import type { LaunchEnvelopeV2, AdapterRegistrationV1, ProfileRegistrationV1 } from "../schema.js";
3
+
4
+ // Black Market main 1ca9881: pool-hook-template-v1/20261011T214314Z-hmm-fixed.
5
+ // Generated by scripts/generate-hmm-presets.mjs from admission bytes and hash-checked live storage children.
6
+ export const hmmFixedEnvelope = Object.freeze({
7
+ artifactDigest: "0x699b5108d783395b1a88a6c92cc135ce80a45d190266922942d05ddf388ae1ac",
8
+ reviewManifestDigest: "0x77b7f0d34c662e1c1f25d6b2161a6bba37fcb61edefd13d0ee0bc84a7372bf97",
9
+ configBoundsDigest: "0x72e0b2d542556d472a47f9c38b2c91079c72793af847dee77933f0eca203129d",
10
+ termsDigest: "0x27373dbb7f9ebdfafb4cfbf6257131eda0b23fe47fd6e95a020e6729976e2e03",
11
+ topology: 2,
12
+ configVersion: 6,
13
+ economicVersion: 3,
14
+ capabilities: 123n,
15
+ flags: 0n,
16
+ callbackFlags: 6908,
17
+ callbackMask: 16383,
18
+ protocolTreasury: "0x961981916AB6575C3af3eeCecbf6A3b7Fad7C9e1",
19
+ protocolFeeDenominator: 6,
20
+ beneficiary: "0x7cb44b8693b3C350A2BcD4b681aF85365aa27783",
21
+ maximumDeveloperFeeBps: 0,
22
+ bounds: Object.freeze({
23
+ minimumTickSpacing: 1,
24
+ maximumTickSpacing: 32767,
25
+ maximumPositions: 32,
26
+ maximumOracleCardinality: 4096,
27
+ feeModeFlags: 3,
28
+ }),
29
+ graph: Object.freeze({
30
+ manager: "0x8366a39CC670B4001A1121B8F6A443A643e40951",
31
+ hookRoot: "0x0000000000000000000000000000000000000000",
32
+ oracleFactory: "0xe7feF2BC860B25bbdEB6F6AB96d88bAAa77ddad7",
33
+ locker: "0x30ba05aB5E0A12569Bd6D2A481F3efd1aE6544FA",
34
+ collectorFactory: "0x3802dd3035C592FE0a13b00eB93aa225f323345A",
35
+ collectorDeployer: "0x29DB95f6ddd29D0CFf6481fb2eFd96C26Cbe8e51",
36
+ hookDeployer: "0xad3bBE3d921C5B9A5310550EAc2f24938C53a9c7",
37
+ coreCodeHash: "0x9fb8f46c3b980b9db25dfdb487a69a308a86be145860269b4036a4e74480787b",
38
+ managerCodeHash: "0xbd3881180b547f5fe817545743cfb4343e96b1bc6640dcd70c106b0066e95626",
39
+ hookRuntimeCodeHash: "0x0000000000000000000000000000000000000000000000000000000000000000",
40
+ oracleFactoryCodeHash: "0x974fb5c72d91ccb99f1eb4679a5d4432c82bbaa0906b1c2917ec4da3499b7b98",
41
+ lockerCodeHash: "0xf8f7ad4ca06f9a2c7e9296ea9c68b00297f16a9a8309aa3f74d63ff66fb6aac5",
42
+ collectorFactoryCodeHash: "0x81694220f02ab66fb12815eee2ccf4d75dad10968d79a29cfc6c8e21cf74ed6b",
43
+ collectorDeployerCodeHash: "0xa7728eb517ca3826a4f939fb61c7739fe22ab66d86aa61d6224362242764e204",
44
+ hookDeployerCodeHash: "0x8534539c433244bd9015a53b34eee99b2df2b13123408e2a26bd63e7f54b6a1e",
45
+ hookCreationCodeHash: "0x699b5108d783395b1a88a6c92cc135ce80a45d190266922942d05ddf388ae1ac",
46
+ codeChunk0: "0xC187971CC76C2378078D7D3BD97D2f429D6cd52b",
47
+ codeChunk0Hash: "0xa69d8927c316f7d0bb54055bb79572bbd1902de61be8f76be12252113090cbca",
48
+ codeChunk1: "0x0000000000000000000000000000000000000000",
49
+ codeChunk1Hash: "0x0000000000000000000000000000000000000000000000000000000000000000",
50
+ sharedHookSalt: "0x0000000000000000000000000000000000000000000000000000000000000000",
51
+ }),
52
+ }) satisfies LaunchEnvelopeV2;
53
+ export const hmmFixedAdapter = Object.freeze({
54
+ implementation: "0xb755Eb31B62ABA95bfeB09f87956BB766ACEE69C",
55
+ codeHash: "0x590f76629def4711ecd0a48bbd50dd78fc95f75247e18ca08f3b1720c9205c35",
56
+ capabilities: 123n,
57
+ configVersion: 6,
58
+ enabled: true,
59
+ }) satisfies AdapterRegistrationV1;
60
+ export const hmmFixedRegistration = Object.freeze({
61
+ adapterId: "0xb13c8134a4c8af50976ca7920a93f2428d1c288a62c8787ce0adbc503c7b6dba",
62
+ configSchema: "0x51c5ca14c40012f78425cd1afb1ea77980da3fed0490a00911a8a4ed34792045",
63
+ dependencyDigest: "0xc827c83120f0eeb870bf6932420db1a4f3558a2f6548ce2c5529913106cda38f",
64
+ venue: "0x8366a39CC670B4001A1121B8F6A443A643e40951",
65
+ factory: "0x0000000000000000000000000000000000000000",
66
+ hook: "0x0000000000000000000000000000000000000000",
67
+ capabilities: 123n,
68
+ enabled: true,
69
+ }) satisfies ProfileRegistrationV1;
70
+ // 22876 bytes; keccak256 0x699b5108d783395b1a88a6c92cc135ce80a45d190266922942d05ddf388ae1ac; append 640-byte V2 constructor.
71
+ export const hmmFixedCreationCode: Hex = "0x610240604052348015610010575f5ffd5b5060405161595c38038061595c83398101604081905261002f91610b66565b8061003981610408565b611afc613fff30161461005f57604051632a96f9e160e21b815260040160405180910390fd5b80516001600160a01b039081166080908152602080840151831660a0908152604080860151851660c0526060860151851660e0529285015184166101005284015190921661012052516100b491839101610ceb565b60408051808303601f1901815291905280516020909101206101609081526102408201516101809081526101208301516001600160a01b039081166101a05261026084015163ffffffff166101c052908301519183015160189290921b66ffffffff0000001662ffffff909216919091176101e05260a082015160c08301519082169116105f81610149578260a0015161014f565b8260c001515b90505f82610161578360c00151610167565b8360a001515b6001600160a01b038084166102008190529082166102208190526040805160a081018252928352602083019190915260e087015162ffffff169082015261010086015160020b60608201523060808201529091506101c68160a0902090565b6101405280515f80546001600160a01b03199081166001600160a01b03938416178255602080850151600180546040808901516060808b0151958a166001600160b81b031990941693909317600160a01b62ffffff928316021762ffffff60b81b1916600160b81b91909516029390931782556080808901516002805490971690891617909555825161012081018452958652938b015186169285019290925260c08a0151909416938301939093526101a088015191929083019160ff169081111561029457610294610e90565b60018111156102a5576102a5610e90565b815261014087015162ffffff166020808301919091526101c088015160ff166040808401919091526101e08901516001600160a01b039081166060808601919091526102008b0151151560808601526102208b015160a0909501949094528451600380549183166001600160a01b031992831617815593860151600480549184169183169190911790559185015160058054919092169281168317825593850151929390916001600160a81b031990911617600160a01b83600181111561036e5761036e610e90565b0217905550608082015160028201805460a085015160ff16600160c01b0260ff60c01b1962ffffff909416600160a81b029390931663ffffffff60a81b199091161791909117905560c082015160038201805460e08501511515600160a01b026001600160a81b03199091166001600160a01b03909316929092179190911790556101009091015160049091015550610ec6945050505050565b80516001600160a01b03163b158061042c575060208101516001600160a01b03163b155b80610443575060408101516001600160a01b03163b155b8061045a575060608101516001600160a01b03163b155b80610471575060808101516001600160a01b03163b155b80610488575060c08101516001600160a01b03163b155b8061049e575060a08101516001600160a01b0316155b806104c257508060c001516001600160a01b03168160a001516001600160a01b0316145b806104d9575060a08101516001600160a01b031630145b806104fd575080606001516001600160a01b031681602001516001600160a01b0316145b806105205750805f01516001600160a01b031681602001516001600160a01b0316145b80610537575060208101516001600160a01b031630145b8061054e575060608101516001600160a01b031630145b80610565575060808101516001600160a01b031630145b806105885750805f01516001600160a01b031681608001516001600160a01b0316145b8061059b575060e081015162ffffff1615155b806105b15750600160020b81610100015160020b125b806105c85750610100810151617fff60029190910b135b806105ee57506401000276a36001600160a01b03168161012001516001600160a01b0316105b80610624575073fffd8963efd1fc6a506488495d951d5263988d266001600160a01b03168161012001516001600160a01b031610155b806106405750620f424062ffffff1681610140015162ffffff16115b8061065e575080610140015162ffffff1681610160015162ffffff16115b806106745750600160ff16816101a0015160ff16115b806106ab57506101c081015160ff16158015906106ab57506004816101c0015160ff1610806106ab5750600a816101c0015160ff16115b806106d457506101c081015160ff16158015906106d457506101e08101516001600160a01b0316155b806106ec57506101e08101516001600160a01b031630145b806107105750805f01516001600160a01b0316816101e001516001600160a01b0316145b80610735575080608001516001600160a01b0316816101e001516001600160a01b0316145b806107435750610240810151155b80610757575061026081015163ffffffff16155b8061076d5750602081610260015163ffffffff16115b1561078b5760405163c52a9bd360e01b815260040160405180910390fd5b5f816020015190505f8260800151905082606001516001600160a01b0316826001600160a01b031663f2f4eb266040518163ffffffff1660e01b8152600401602060405180830381865afa1580156107e5573d5f5f3e3d5ffd5b505050506040513d601f19601f820116820180604052508101906108099190610ea4565b6001600160a01b03161415806108935750825f01516001600160a01b0316826001600160a01b031663dc4c90d36040518163ffffffff1660e01b8152600401602060405180830381865afa158015610863573d5f5f3e3d5ffd5b505050506040513d601f19601f820116820180604052508101906108879190610ea4565b6001600160a01b031614155b80610913575082604001516001600160a01b0316826001600160a01b031663c7f7fb906040518163ffffffff1660e01b8152600401602060405180830381865afa1580156108e3573d5f5f3e3d5ffd5b505050506040513d601f19601f820116820180604052508101906109079190610ea4565b6001600160a01b031614155b80610993575082608001516001600160a01b0316826001600160a01b031663d7b96d4e6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610963573d5f5f3e3d5ffd5b505050506040513d601f19601f820116820180604052508101906109879190610ea4565b6001600160a01b031614155b80610a13575082602001516001600160a01b0316816001600160a01b03166316eebd1e6040518163ffffffff1660e01b8152600401602060405180830381865afa1580156109e3573d5f5f3e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610a079190610ea4565b6001600160a01b031614155b80610a925750825f01516001600160a01b0316816001600160a01b031663dc4c90d36040518163ffffffff1660e01b8152600401602060405180830381865afa158015610a62573d5f5f3e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610a869190610ea4565b6001600160a01b031614155b15610ab05760405163c52a9bd360e01b815260040160405180910390fd5b505050565b60405161028081016001600160401b0381118282101715610ae457634e487b7160e01b5f52604160045260245ffd5b60405290565b6001600160a01b0381168114610afe575f5ffd5b50565b8051610b0c81610aea565b919050565b805162ffffff81168114610b0c575f5ffd5b8051600281900b8114610b0c575f5ffd5b805163ffffffff81168114610b0c575f5ffd5b805160ff81168114610b0c575f5ffd5b80518015158114610b0c575f5ffd5b5f610280828403128015610b78575f5ffd5b50610b81610ab5565b610b8a83610b01565b8152610b9860208401610b01565b6020820152610ba960408401610b01565b6040820152610bba60608401610b01565b6060820152610bcb60808401610b01565b6080820152610bdc60a08401610b01565b60a0820152610bed60c08401610b01565b60c0820152610bfe60e08401610b11565b60e0820152610c106101008401610b23565b610100820152610c236101208401610b01565b610120820152610c366101408401610b11565b610140820152610c496101608401610b11565b610160820152610c5c6101808401610b34565b610180820152610c6f6101a08401610b47565b6101a0820152610c826101c08401610b47565b6101c0820152610c956101e08401610b01565b6101e0820152610ca86102008401610b57565b61020082015261022083810151908201526102408084015190820152610cd16102608401610b34565b6102608201529392505050565b6001600160a01b03169052565b5f61028082019050610cfe828451610cde565b6020830151610d106020840182610cde565b506040830151610d236040840182610cde565b506060830151610d366060840182610cde565b506080830151610d496080840182610cde565b5060a0830151610d5c60a0840182610cde565b5060c0830151610d6f60c0840182610cde565b5060e0830151610d8660e084018262ffffff169052565b50610100830151610d9d61010084018260020b9052565b50610120830151610db2610120840182610cde565b50610140830151610dcb61014084018262ffffff169052565b50610160830151610de461016084018262ffffff169052565b50610180830151610dfe61018084018263ffffffff169052565b506101a0830151610e156101a084018260ff169052565b506101c0830151610e2c6101c084018260ff169052565b506101e0830151610e416101e0840182610cde565b50610200830151610e5761020084018215159052565b50610220830151610220830152610240830151610240830152610260830151610e8961026084018263ffffffff169052565b5092915050565b634e487b7160e01b5f52602160045260245ffd5b5f60208284031215610eb4575f5ffd5b8151610ebf81610aea565b9392505050565b60805160a05160c05160e05161010051610120516101405161016051610180516101a0516101c0516101e051610200516102205161480061115c5f395f8181611cad01528181611db30152612e6401525f8181611c6c01528181611d780152612e4301525f8181610405015281816105010152612be201525f81816104bf0152612fa301525f8181610451015261103701525f61065f01525f6103a801525f81816103200152818161081201528181610c0301528181610ea70152818161109d015281816112f6015281816116140152818161196801528181611ab001528181611d4d01528181612223015281816123a4015281816126d801528181612b6401528181612c1101528181612f3001528181612f6b015261371a01525f818161072e01528181612895015281816131e501526137fa01525f818161049801528181610bcb01528181610d8001528181610ef501528181611afc01528181611b6701528181611bd101528181611d2701528181612249015281816122ed015281816123810152612e2201525f81816106d3015281816128e401528181613234015261375201525f6105d201525f81816102920152818161079801528181610aff01528181610ffa0152818161292e0152818161301701526137d701525f81816106860152818161098701528181610a1401528181610c8101528181610e8601528181610f69015281816111270152818161126601528181611504015281816116fb015281816118a501528181611d060152818161250c0152818161259b0152818161261801528181612b8b01528181612c4901528181612e01015281816133de015281816138b601528181613a7201528181613b0101528181613b7e01528181613c4d01528181613c980152613d0501526148005ff3fe608060405234801561000f575f5ffd5b5060043610610202575f3560e01c80630268e293146102065780630581555f1461021b5780630885f7321461022e57806321d0ee701461024e578063259982e51461027a5780632b20e3971461028d57806333827438146102cc578063359b4f30146102d45780633e451d6a146102f557806342ea83e01461030857806347f8496c1461031b5780635524d54814610342578063575e24b4146103655780635955d09a146103a357806360f89f2e146103ca5780636fe7e6eb146103dd578063747a68cd146103f05780637dbeb94e14610403578063847211a6146104395780638bc801c11461044c57806391dd7346146104735780639759164a146104935780639e5fe062146104ba578063a3f4bac7146104f6578063a8691114146104ff578063aae49d7014610528578063ac4e405414610532578063ac5555aa1461053b578063b47b2fb11461054e578063b6a8b0fa14610584578063c5c51dca14610597578063c5fbb298146105ac578063c67046af146105bf578063c7f7fb90146105cd578063ca266dfe146105f4578063ce1b8e4f1461065a578063dc4c90d314610681578063e1b4af69146106a8578063e2e65ec1146106bb578063f2f4eb26146106ce578063f399150c146106f5578063f9bc70e714610716578063fc0c546a14610729578063fd5b6d5b14610750575b5f5ffd5b610219610214366004613de7565b610763565b005b6040515f81526020015b60405180910390f35b61024161023c366004613e01565b610866565b6040516102259190613e62565b61026161025c366004613f64565b61097b565b6040516001600160e01b03199091168152602001610225565b610261610288366004613f64565b610a08565b6102b47f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b039091168152602001610225565b6016546102b4565b6102e76102e2366004613fe4565b610a9c565b604051908152602001610225565b6102e7610303366004614012565b610ab9565b61021961031636600461402d565b610aca565b6102e77f000000000000000000000000000000000000000000000000000000000000000081565b610355610350366004613e01565b610c5e565b6040519015158152602001610225565b61037861037336600461407c565b610c73565b604080516001600160e01b03199094168452602084019290925262ffffff1690820152606001610225565b6102e77f000000000000000000000000000000000000000000000000000000000000000081565b6102196103d83660046140d5565b610e77565b6102616103eb36600461412d565b610f5d565b6102e76103fe366004614012565b6110f4565b7f00000000000000000000000000000000000000000000000000000000000000005b60405162ffffff9091168152602001610225565b6102e7610447366004613e01565b611108565b6102b47f000000000000000000000000000000000000000000000000000000000000000081565b610486610481366004614184565b61111a565b60405161022591906141c2565b6102b47f000000000000000000000000000000000000000000000000000000000000000081565b6104e17f000000000000000000000000000000000000000000000000000000000000000081565b60405163ffffffff9091168152602001610225565b6102b4613fff81565b7f000000000000000000000000000000000000000000000000000000000000000060181c6104e1565b610425620f424081565b6102b4611afc81565b610355610549366004613e01565b61123f565b61056161055c3660046141f7565b611259565b604080516001600160e01b03199093168352600f9190910b602083015201610225565b610261610592366004614277565b6114f8565b61059f6115aa565b60405161022591906142d0565b6102e76105ba366004613e01565b611655565b5f6040516102259190614312565b6102b47f000000000000000000000000000000000000000000000000000000000000000081565b610607610602366004613e01565b611665565b604051610225919081516001600160a01b03908116825260208084015182169083015260408084015162ffffff169083015260608084015160020b90830152608092830151169181019190915260a00190565b6102e77f000000000000000000000000000000000000000000000000000000000000000081565b6102b47f000000000000000000000000000000000000000000000000000000000000000081565b6102616106b6366004614277565b6116ef565b6102e76106c9366004613fe4565b6117a9565b6102b47f000000000000000000000000000000000000000000000000000000000000000081565b610708610703366004613de7565b6117c7565b604051610225929190614325565b610425610724366004614333565b6119d1565b6102b47f000000000000000000000000000000000000000000000000000000000000000081565b6102e761075e366004613fe4565b611a3e565b3068929eee149b4bd2126854036107815763ab143c065f526004601cfd5b3068929eee149b4bd2126855336001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016146107d5576040516282b42960e81b815260040160405180910390fd5b6107de81611a5c565b601354156107ff576040516304c7cf6760e51b815260040160405180910390fd5b4260135561080b611a9b565b60405142907f0000000000000000000000000000000000000000000000000000000000000000907ff1bac50d2c6f6c83cb8ff6fac488b03adc5fb0cc9fae30db2077588d5d9e5fbd905f90a33868929eee149b4bd212685550565b60408051610120810182525f80825260208201819052918101829052606081018290526080810182905260a0810182905260c0810182905260e081018290526101008101919091526108b782611aae565b6040805161012081018252600380546001600160a01b039081168352600454811660208401526005549081169383019390935290916060830190600160a01b900460ff16600181111561090c5761090c613e25565b600181111561091d5761091d613e25565b8152600282015462ffffff600160a81b820416602083015260ff600160c01b9091048116604083015260038301546001600160a01b0381166060840152600160a01b9004161515608082015260049091015460a09091015292915050565b5f336001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016146109c4576040516282b42960e81b815260040160405180910390fd5b3068929eee149b4bd2126854036109e25763ab143c065f526004601cfd5b6109eb85611a5c565b6109f58685611aed565b5063021d0ee760e41b5b95945050505050565b5f336001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001614610a51576040516282b42960e81b815260040160405180910390fd5b3068929eee149b4bd212685403610a6f5763ab143c065f526004601cfd5b610a7885611a5c565b610a828685611aed565b610a8a611c3e565b5063259982e560e01b95945050505050565b5f610aa683611aae565b610aaf82611c69565b5490505b92915050565b5f610ac382611c69565b5492915050565b3068929eee149b4bd212685403610ae85763ab143c065f526004601cfd5b3068929eee149b4bd2126855336001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001614610b3c576040516282b42960e81b815260040160405180910390fd5b610b5d610b58610b51368590038501856143a3565b60a0902090565b611aae565b60125460ff1615610b8157604051630ea075bf60e21b815260040160405180910390fd5b610b8a81611d04565b610b938161200d565b610ba06020820182614012565b600380546001600160a01b0319166001600160a01b039283161790556012805460ff191660011790557f000000000000000000000000000000000000000000000000000000000000000016610bf86020830183614012565b6001600160a01b03167f00000000000000000000000000000000000000000000000000000000000000007ffafdbdd88ac30f0aa936e576be61816ea751908540523fa81b80c4a406ad7bec60405160405180910390a43868929eee149b4bd21268555050565b5f610c6882611aae565b505060125460ff1690565b5f8080336001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001614610cbe576040516282b42960e81b815260040160405180910390fd5b3068929eee149b4bd212685403610cdc5763ab143c065f526004601cfd5b60155460ff1615610d005760405163558a1e0360e11b815260040160405180910390fd5b610d0987611a5c565b610d11611c3e565b60035f610d1e8a896120a6565b90505f610d2b8a8a6120d3565b90505f62ffffff831615801590610d495750610d49828c8c87612118565b15610d6757610d64610d5e8b6020013561219c565b846121d7565b90505b6040516364b3357d60e11b81525f906001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169063c9666afa90610db9908f908f908790600401614500565b602060405180830381865afa158015610dd4573d5f5f3e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610df8919061452b565b9050610e348c610e0b60208e018e614542565b610e15575f610e17565b825b610e2460208f018f614542565b610e2e5783612215565b5f612215565b8115610e5657610e5683838760020160189054906101000a900460ff16612402565b506315d7892d60e21b965060801b94505f9350505050955095509592505050565b610e8083611a5c565b5f610ecb7f00000000000000000000000000000000000000000000000000000000000000007f0000000000000000000000000000000000000000000000000000000000000000612747565b5050600354919250506001600160a01b038481169116141580610f205750816001600160a01b03167f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031614155b80610f3257506001600160a01b038116155b15610f4f5760405162820f3560e61b815260040160405180910390fd5b610f576127f9565b50505050565b5f336001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001614610fa6576040516282b42960e81b815260040160405180910390fd5b3068929eee149b4bd212685403610fc45763ab143c065f526004601cfd5b610fd9610b58610b51368790038701876143a3565b60125460ff161580610ff25750601254610100900460ff165b8061102f57507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316856001600160a01b031614155b8061106c57507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316836001600160a01b031614155b156110895760405162820f3560e61b815260040160405180910390fd5b6012805461ff0019166101001790556040517f0000000000000000000000000000000000000000000000000000000000000000907febcc9ffea17e08841d7588f2ecd87720e1cfb444bb3b5e662c4a5005c3c94ab2905f90a250636fe7e6eb60e01b5b949350505050565b5f6110fe82611c69565b6003015492915050565b5f61111282611aae565b505060135490565b6060336001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001614611164576040516282b42960e81b815260040160405180910390fd5b601454158061118c5750601454838360405161118192919061455b565b604051809103902014155b156111aa5760405163f7a632f560e01b815260040160405180910390fd5b5f60148190556111bc838501856143a3565b90506111cc610b588260a0902090565b601254610100900460ff166111f35760405162820f3560e61b815260040160405180910390fd5b5f611200825f01516129de565b90505f61121083602001516129de565b90508181604051602001611225929190614325565b604051602081830303815290604052935050505092915050565b5f61124982611aae565b5050601254610100900460ff1690565b5f80336001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016146112a3576040516282b42960e81b815260040160405180910390fd5b3068929eee149b4bd2126854036112c15763ab143c065f526004601cfd5b60155460ff16156112e55760405163558a1e0360e11b815260040160405180910390fd5b6112ee87611a5c565b5f61131c60107f00000000000000000000000000000000000000000000000000000000000000008b8a612a77565b9050611329885f5f612215565b60035f6113368a8a6120d3565b90505f61134660208c018c614012565b6001600160a01b0316826001600160a01b0316146113705761136b60208c018c614012565b611380565b61138060408c0160208d01614012565b905062ffffff84161580159061139d575061139d828c8c86612118565b15611436575f6113b96113b38c6020013561219c565b866121d7565b90508015611434575f6113cf60208e018e614012565b6001600160a01b0316846001600160a01b0316146113f6576113f18b600f0b90565b611400565b6114008b60801d90565b90506114108260208e013561457e565b81600f0b146114325760405163161b48a960e21b815260040160405180910390fd5b505b505b5f62ffffff8516158015906114525750611452828d8d87612118565b156114d3575f61146560208e018e614012565b6001600160a01b0316836001600160a01b03161461148c576114878b600f0b90565b611496565b6114968b60801d90565b90506114ad6114a782600f0b61219c565b876121d7565b915081156114d1576114d183838760020160189054906101000a900460ff16612402565b505b6114de8c8c8c612ae5565b63b47b2fb160e01b9d909c509a5050505050505050505050565b5f336001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001614611541576040516282b42960e81b815260040160405180910390fd5b3068929eee149b4bd21268540361155f5763ab143c065f526004601cfd5b60155460ff16156115835760405163558a1e0360e11b815260040160405180910390fd5b61158c86611a5c565b611597868686612215565b50635b54587d60e11b9695505050505050565b60125460609060ff166115bd575f6115c0565b60015b60ff166001600160401b038111156115da576115da61434d565b604051908082528060200260200182016040528015611603578160200160208202803683370190505b5060125490915060ff1615611652577f0000000000000000000000000000000000000000000000000000000000000000815f81518110611645576116456145a5565b6020026020010181815250505b90565b5f61165f82611aae565b5f610ab3565b6040805160a0810182525f8082526020820181905291810182905260608101829052608081019190915261169882611aae565b50506040805160a0810182525f546001600160a01b039081168252600154808216602084015262ffffff600160a01b82041693830193909352600160b81b909204600290810b606083015254909116608082015290565b5f336001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001614611738576040516282b42960e81b815260040160405180910390fd5b60155460ff161561175c5760405163558a1e0360e11b815260040160405180910390fd5b3068929eee149b4bd21268540361177a5763ab143c065f526004601cfd5b61178386611a5c565b61178e865f5f612215565b611796612b04565b5063e1b4af6960e01b9695505050505050565b5f6117b383611aae565b6117bc82611c69565b600101549392505050565b5f5f3068929eee149b4bd2126854036117e75763ab143c065f526004601cfd5b3068929eee149b4bd212685560155460ff16156118175760405163558a1e0360e11b815260040160405180910390fd5b61182083611a5c565b6003546001600160a01b0316331461184a576040516282b42960e81b815260040160405180910390fd5b60085415158061185b5750600c5415155b1561195c575f8360405160200161187291906145b9565b60408051601f1981840301815290829052805160208201206014556348c8949160e01b825291505f906001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016906348c89491906118da9085906004016141c2565b5f604051808303815f875af11580156118f5573d5f5f3e3d5ffd5b505050506040513d5f823e601f3d908101601f1916820160405261191c91908101906145c7565b601454909150156119405760405163f7a632f560e01b815260040160405180910390fd5b808060200190518101906119549190614659565b909450925050505b336001600160a01b03167f00000000000000000000000000000000000000000000000000000000000000007f4a93be8d0a356d70b54fdf016f78a2ed8b8a3c420952848eb4f4b2c4546405b684846040516119b8929190614325565b60405180910390a33868929eee149b4bd2126855915091565b5f3068929eee149b4bd2126854036119f05763ab143c065f526004601cfd5b601254610100900460ff16611a175760405162820f3560e61b815260040160405180910390fd5b611a1f6127f9565b5f611a2983612b15565b509050611a3581612cf9565b9150505b919050565b5f611a4883611aae565b611a5182611c69565b600201549392505050565b611a71610b58610b51368490038401846143a3565b601254610100900460ff16611a985760405162820f3560e61b815260040160405180910390fd5b50565b611aac632520a12d60e11b5f612d61565b565b7f00000000000000000000000000000000000000000000000000000000000000008114611a985760405162820f3560e61b815260040160405180910390fd5b60155460ff168015611b3e57507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316826001600160a01b0316141580611b3e5750604081013515155b15611b5c5760405163558a1e0360e11b815260040160405180910390fd5b6013545f03611bbb577f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316826001600160a01b031614611bb757604051637cd5a0ad60e01b815260040160405180910390fd5b5050565b600654600160a01b900460ff168015611c0657507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316826001600160a01b031614155b8015611c20575060155460ff1680611c2057506016548214155b15611bb757604051630af9fb3360e21b815260040160405180910390fd5b601554610100900460ff1615611c5057565b611c586127f9565b6015805461ff001916610100179055565b5f7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316826001600160a01b031603611cab57506008919050565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316826001600160a01b031603611cec5750600c919050565b60405162820f3560e61b815260040160405180910390fd5b7f00000000000000000000000000000000000000000000000000000000000000007f00000000000000000000000000000000000000000000000000000000000000005f611d71837f0000000000000000000000000000000000000000000000000000000000000000612747565b50505090507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03163b5f1480611dd657506001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000163b155b80611de957506001600160a01b03811615155b80611e1557506001600160a01b038216611e096040860160208701614012565b6001600160a01b031614155b80611e4357506005546001600160a01b0316611e376060860160408701614012565b6001600160a01b031614155b80611e8b5750600554600160a01b900460ff166001811115611e6757611e67613e25565b611e77608086016060870161467b565b6001811115611e8857611e88613e25565b14155b80611eb85750600554600160a81b900462ffffff16611eb060a0860160808701614699565b62ffffff1614155b80611ee15750600554600160c01b900460ff16611edb60c0860160a087016146b2565b60ff1614155b80611f0f57506006546001600160a01b0316611f0360e0860160c08701614012565b6001600160a01b031614155b80611f3a5750600654600160a01b900460ff161515611f35610100860160e08701614542565b151514155b80611f4c575060075461010085013514155b80611f6b5750611f5f6020850185614012565b6001600160a01b03163b155b80611f9357506001600160a01b038216611f886020860186614012565b6001600160a01b0316145b80611fb2575030611fa76020860186614012565b6001600160a01b0316145b80611fda57506001600160a01b038316611fcf6020860186614012565b6001600160a01b0316145b15611ff85760405163c52a9bd360e01b815260040160405180910390fd5b610f576120086020860186614012565b612dff565b5f61201b6020830183614012565b90506306704e8760e31b637f5a7c7b60e01b5f80612064565b5f604051838152602081600483865afa601f3d118116612052575f5ffd5b5051905060a081901c15610ab3575f5ffd5b61206e8486612034565b91503061207b8484612034565b1490508061209c5760405163c52a9bd360e01b815260040160405180910390fd5b5060165550505050565b5f5f5f6120b284612b15565b604082015191935091506120c960108488886132be565b9695505050505050565b5f6120e16020830183614542565b15155f60208401351214612104576120ff6040840160208501614012565b612111565b6121116020840184614012565b9392505050565b5f8060016002840154600160a01b900460ff16600181111561213c5761213c613e25565b146121745761214e6020850185614542565b612167576121626040860160208701614012565b612183565b6121626020860186614012565b60028301546001600160a01b03165b6001600160a01b03878116911614915050949350505050565b5f600160ff1b82036121c157604051637e2df70960e11b815260040160405180910390fd5b5f82126121ce5781610ab3565b610ab3826146d2565b5f6121eb838362ffffff16620f424061333c565b905060016001607f1b03811115610ab357604051637e2df70960e11b815260040160405180910390fd5b60405162e568cf60e71b81527f000000000000000000000000000000000000000000000000000000000000000060048201527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906372b4678090602401602060405180830381865afa158015612296573d5f5f3e3d5ffd5b505050506040513d601f19601f820116820180604052508101906122ba919061452b565b5f036122c557505050565b6015805460ff191660011790556040516381f8a9d160e01b81525f9081906001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016906381f8a9d190612326908890889088906004016146ec565b60408051808303815f875af1158015612341573d5f5f3e3d5ffd5b505050506040513d601f19601f820116820180604052508101906123659190614659565b6015805460ff1916905560405191935091506001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016907f0000000000000000000000000000000000000000000000000000000000000000907fa30ca6140dfb2cac1c1021c5303d8dc7de0cd4db47221fb3ad068fac7ef8185e906123f39086908690614325565b60405180910390a35050505050565b3068929eee149b4bd2126854036124205763ab143c065f526004601cfd5b3068929eee149b4bd2126855825f61243782611c69565b90505f8160020154825f015461244d919061470b565b90506124608160016001607f1b0361470b565b851115612472576124728683836133ca565b5f60ff8516156124a557606461248b60ff87168861471e565b61249690607d61473d565b6124a0919061471e565b6124a7565b5f5b905085835f015f8282546124bb9190614754565b9250508190555080836001015f8282546124d59190614754565b9250508190555085836003015f8282546124ef9190614754565b9091555050604051627eeac760e11b81525f906001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169062fdd58e906125429030908990600401614767565b602060405180830381865afa15801561255d573d5f5f3e3d5ffd5b505050506040513d601f19601f82011682018060405250810190612581919061452b565b604051630ab714fb60e11b81529091506001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169063156e29f6906125d490309089908c90600401614781565b5f604051808303815f87803b1580156125eb575f5ffd5b505af11580156125fd573d5f5f3e3d5ffd5b5050604051627eeac760e11b81525f92506001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016915062fdd58e9061264f9030908a90600401614767565b602060405180830381865afa15801561266a573d5f5f3e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061268e919061452b565b9050818110806126a057508782820314155b806126ae5750846003015481105b156126cc5760405163104eed1d60e31b815260040160405180910390fd5b856001600160a01b03167f00000000000000000000000000000000000000000000000000000000000000007f2616e25de5abcc9e6a698b140fb6c92f55ace21b7a57f76172f195dbbf693af68a86604051612728929190614325565b60405180910390a35050505050503868929eee149b4bd2126855505050565b5f5f5f5f5f6127558661346e565b604051631e2eaeaf60e01b8152600481018290529091505f906001600160a01b03891690631e2eaeaf90602401602060405180830381865afa15801561279d573d5f5f3e3d5ffd5b505050506040513d601f19601f820116820180604052508101906127c1919061452b565b90506001600160a01b03811695508060a01c60020b945062ffffff8160b81c16935062ffffff8160d01c169250505092959194509250565b601554610100900460ff161561280b57565b6003546001600160a01b03165f61283161282c83630d96a1bf60e21b6134aa565b6134c4565b90505f6128538263537df88f60e11b6001600160a01b038616602460c06134d6565b9050606081015160a01c815160a01c171561286c575f5ffd5b60a081015160808201511760101c15612883575f5ffd5b60c081016040525f6001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000166128c961282c8563514526c360e11b6134aa565b6001600160a01b031614158061292457506001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001661291861282c8563056a0fbf60e31b6134aa565b6001600160a01b031614155b80612959575081517f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031614155b8061296d57505f61296b836020015190565b145b8061298157505f61297f836040015190565b145b8061299557505f612993836060015190565b145b806129ae57508061ffff166129ab8360a0015190565b14155b806129c05750608082015160a0830151115b15610f575760405163c52a9bd360e01b815260040160405180910390fd5b5f81816129ea82611c69565b80549091505f819003612a0157505f949350505050565b612a1b8583846002015484612a16919061470b565b6133ca565b6001820180545f808555918290556002840191909155612a3b818361470b565b600654909550612a569085906001600160a01b03168361350b565b600354612a6e9085906001600160a01b03168761350b565b50505050919050565b60018401545f9063ffffffff16801580612a9c5750612a9785858561359b565b865414155b15612abd576040516001620787ab60e51b0319815260040160405180910390fd5b612ac86001826147a5565b5f87556001909601805463ffffffff191690555093949350505050565b608081811c15159082901b151516610f57632f02d37f60e21b82612d61565b611aac6309f17b8160e31b5f612d61565b612b6160408051610120810182525f80825260208201819052918101829052606081018290526080810182905260a0810182905260c0810182905260e081018290529061010082015290565b5f7f0000000000000000000000000000000000000000000000000000000000000000818080612bb07f000000000000000000000000000000000000000000000000000000000000000085612747565b509250925092508062ffffff165f14612bdc5760405163c52a9bd360e01b815260040160405180910390fd5b8194505f7f000000000000000000000000000000000000000000000000000000000000000090506040518061012001604052807f00000000000000000000000000000000000000000000000000000000000000008152602001856001600160a01b03168152602001612c6e7f0000000000000000000000000000000000000000000000000000000000000000886135d0565b6001600160801b0316815260200189602001358152602001895f016020810190612c989190614542565b1515815260055462ffffff600160a81b8204811660208401528416604083015263ffffffff601885901c16606083015260809091019060ff600160a01b909104166001811115612cea57612cea613e25565b81525096505050505050915091565b5f600160ff1b826060015103612d2257604051637e2df70960e11b815260040160405180910390fd5b5060a081015160c082015181908062ffffff168362ffffff161015612d5a576040516302cce67760e31b815260040160405180910390fd5b5050919050565b6016546001600160a01b038116612d7757505050565b5f612710603f612d8b622dc6c0604061473d565b612d95919061471e565b612d9f9190614754565b905063c52a9bd360e01b7f6e819d90474482ea53f17905af71585dac910232de1a68f42349cd60badb2874825a1015612dda57815f5260045ffd5b855f52846004525f5f60245f5f88622dc6c0f1612df7578060205fa15b505050505050565b7f00000000000000000000000000000000000000000000000000000000000000007f00000000000000000000000000000000000000000000000000000000000000007f00000000000000000000000000000000000000000000000000000000000000007f00000000000000000000000000000000000000000000000000000000000000005f612e9861282c87630d96a1bf60e21b6134aa565b90505f612ea6878585613653565b90506001600160a01b038616612ec661282c8963dc4c90d360e01b6134aa565b6001600160a01b0316141580612f0157506001600160a01b038516612ef561282c89636bdcb6a760e11b6134aa565b6001600160a01b031614155b80612f28575030612f1c61282c89636620eee760e11b6134aa565b6001600160a01b031614155b80612f6357507f0000000000000000000000000000000000000000000000000000000000000000612f6088631f06e1a760e11b6134aa565b14155b80612f9657507f0000000000000000000000000000000000000000000000000000000000000000612f93886136ee565b14155b80612fd7575063ffffffff7f000000000000000000000000000000000000000000000000000000000000000016612fd488634f2ff03160e11b6134aa565b14155b8061300757506001600160a01b038616612ffb61282c8763dc4c90d360e01b6134aa565b6001600160a01b031614155b8061305757506001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001661304b61282c87630b775e8f60e11b6134aa565b6001600160a01b031614155b8061307157505f61306e8662e568cf60e71b613711565b14155b80613090575061309061308b86630323715f60e11b613711565b613742565b806130ab57505f6130a886635c0af38360e01b613711565b14155b806130d257505f6130c661282c87630961712f60e01b613711565b6001600160a01b031614155b806130db575080155b806130ee57506001600160a01b0382163b155b8061310157506001600160a01b03821630145b8061311d5750866001600160a01b0316826001600160a01b0316145b806131395750846001600160a01b0316826001600160a01b0316145b806131555750856001600160a01b0316826001600160a01b0316145b806131715750836001600160a01b0316826001600160a01b0316145b8061318d5750826001600160a01b0316826001600160a01b0316145b806131a557506006546001600160a01b038381169116145b806131bd57506006546001600160a01b038881169116145b156131db5760405163c52a9bd360e01b815260040160405180910390fd5b6001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001661321961282c8463514526c360e11b6134aa565b6001600160a01b031614158061327457506001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001661326861282c8463056a0fbf60e31b6134aa565b6001600160a01b031614155b8061328e575061328e61308b8363b3f05b9760e01b6134aa565b156132ac5760405163c52a9bd360e01b815260040160405180910390fd5b6132b582613750565b50505050505050565b60018401545f9063ffffffff16156132ec576040516001620787ab60e51b0319815260040160405180910390fd5b83516132f785612cf9565b915061330481858561359b565b865561331662ffffff831660016147c1565b600196909601805463ffffffff191663ffffffff90971696909617909555949350505050565b828202818385830414851517026133c3575f198385098181108201900382848609835f0384168285116133765763ae47f7025f526004601cfd5b93849004938382119092035f839003839004600101029203041760026003830281188084028203028084028203028084028203028084028203028084028203028084029091030202612111565b0492915050565b805f036133d657505050565b8281613402827f0000000000000000000000000000000000000000000000000000000000000000613a30565b1015613421576040516365169c1d60e01b815260040160405180910390fd5b81836003015f828254613434919061470b565b909155506134459050818484613a5a565b613450843084613c39565b81836002015f8282546134639190614754565b909155505050505050565b6040515f9061348d908390600690602001918252602082015260400190565b604051602081830303815290604052805190602001209050919050565b5f806134bb848483600460206134d6565b51949350505050565b5f8160a01c156134d2575f5ffd5b5090565b60405184815260231983016134ec578360048201525b81818483895afa6134ff573d5f823e3d81fd5b813d10156109ff575f5ffd5b805f0361351757505050565b5f6135228430613a30565b90505f61352f8585613a30565b905061353c858585613d87565b5f6135478630613a30565b90505f6135548787613a30565b90508382118061356657508482850314155b8061357057508281105b8061357d57508483820314155b156132b557604051631dc418c360e31b815260040160405180910390fd5b5f8383836040516020016135b1939291906147dd565b6040516020818303038152906040528051906020012090509392505050565b5f5f6135db8361346e565b90505f6135e9600383614754565b604051631e2eaeaf60e01b8152600481018290529091506001600160a01b03861690631e2eaeaf90602401602060405180830381865afa15801561362f573d5f5f3e3d5ffd5b505050506040513d601f19601f820116820180604052508101906109ff919061452b565b5f8061366b856371a9730560e01b83600460206134d6565b80519091506001600160a01b0380861691908516903d906001600160401b038111601f1983018211171561369d575f5ffd5b602081863e8451602080838503030481116001600160401b03821117156136c2575f5ffd5b600281036136e157604060208301873e83602087015114858751141696505b5050505050509392505050565b5f806137068363182148ef60e01b83600460a06134d6565b60a090209392505050565b5f5f6134bb84847f0000000000000000000000000000000000000000000000000000000000000000602460206134d6565b5f60018211156134d2575f5ffd5b7f00000000000000000000000000000000000000000000000000000000000000005f6137898263086fce0d60e11b8360046101606134d6565b90505f6005905080604083015111602083015160201c17156137a9575f5ffd5b6101408201606083015b818110156137d157805160a01c156137c9575f5ffd5b6020016137b3565b505081517f000000000000000000000000000000000000000000000000000000000000000091507f00000000000000000000000000000000000000000000000000000000000000009080158061382c57506001604085015114155b8061384a57506001600160a01b038316613847856060015190565b14155b8061386857506001600160a01b038316613865856080015190565b14155b8061388657506001600160a01b0382166138838560a0015190565b14155b806138a657506005546001600160a01b03166138a38560c0015190565b14155b806138e457506001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000166138e18560e0015190565b14155b15613901576040516282b42960e81b815260040160405180910390fd5b5f61390d856020015190565b905061392686636373dff160e11b8460246101c06134d6565b94505f600190505f600590508060a0880151118260808901511117604088015160a01c1715613953575f5ffd5b610120870160c088015b8181101561397b57805160a01c15613973575f5ffd5b60200161395d565b50506101a0870161012088015b818110156139a657805160201c1561399e575f5ffd5b602001613988565b5050865184925090501415806139c15750600160a086015114155b806139df57506001600160a01b0383166139dc8660c0015190565b14155b806139fd57506001600160a01b0387166139fa8660e0015190565b14155b80613a13575061014085015163ffffffff821610155b156132b5576040516282b42960e81b815260040160405180910390fd5b5f816014526370a0823160601b5f5260208060246010865afa601f3d111660205102905092915050565b604051627eeac760e11b81525f906001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169062fdd58e90613aa89030908890600401614767565b602060405180830381865afa158015613ac3573d5f5f3e3d5ffd5b505050506040513d601f19601f82011682018060405250810190613ae7919061452b565b604051637a94c56560e11b81529091506001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169063f5298aca90613b3a90309088908790600401614781565b5f604051808303815f87803b158015613b51575f5ffd5b505af1158015613b63573d5f5f3e3d5ffd5b5050604051627eeac760e11b81525f92506001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016915062fdd58e90613bb59030908990600401614767565b602060405180830381865afa158015613bd0573d5f5f3e3d5ffd5b505050506040513d601f19601f82011682018060405250810190613bf4919061452b565b905081811180613c0657508281830314155b80613c145750836003015481105b15613c325760405163104eed1d60e31b815260040160405180910390fd5b5050505050565b805f03613c4557505050565b825f613c71827f0000000000000000000000000000000000000000000000000000000000000000613a30565b90505f613c7e8386613a30565b604051630b0d9c0960e01b81529091506001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001690630b0d9c0990613cd190899089908990600401614781565b5f604051808303815f87803b158015613ce8575f5ffd5b505af1158015613cfa573d5f5f3e3d5ffd5b505050505f613d29847f0000000000000000000000000000000000000000000000000000000000000000613a30565b90505f613d368588613a30565b905083821180613d4857508582850314155b80613d5257508281105b80613d5f57508583820314155b15613d7d57604051631dc418c360e31b815260040160405180910390fd5b5050505050505050565b816014528060345263a9059cbb60601b5f5260205f604460105f875af18060015f511416613dc757803d853b151710613dc7576390b8ec185f526004601cfd5b505f603452505050565b5f60a08284031215613de1575f5ffd5b50919050565b5f60a08284031215613df7575f5ffd5b6121118383613dd1565b5f60208284031215613e11575f5ffd5b5035919050565b6001600160a01b03169052565b634e487b7160e01b5f52602160045260245ffd5b60028110611a9857634e487b7160e01b5f52602160045260245ffd5b613e5e81613e39565b9052565b81516001600160a01b03908116825260208084015190911690820152604080830151610120830191613e9690840182613e18565b506060830151613ea96060840182613e55565b506080830151613ec0608084018262ffffff169052565b5060a0830151613ed560a084018260ff169052565b5060c0830151613ee860c0840182613e18565b5060e0830151613efc60e084018215159052565b5061010092830151919092015290565b6001600160a01b0381168114611a98575f5ffd5b5f5f83601f840112613f30575f5ffd5b5081356001600160401b03811115613f46575f5ffd5b602083019150836020828501011115613f5d575f5ffd5b9250929050565b5f5f5f5f5f858703610160811215613f7a575f5ffd5b8635613f8581613f0c565b9550613f948860208901613dd1565b9450608060bf1982011215613fa7575f5ffd5b5060c0860192506101408601356001600160401b03811115613fc7575f5ffd5b613fd388828901613f20565b969995985093965092949392505050565b5f5f60408385031215613ff5575f5ffd5b82359150602083013561400781613f0c565b809150509250929050565b5f60208284031215614022575f5ffd5b813561211181613f0c565b5f5f8284036101c0811215614040575f5ffd5b61404a8585613dd1565b9250610120609f198201121561405e575f5ffd5b5060a0830190509250929050565b5f60608284031215613de1575f5ffd5b5f5f5f5f5f6101408688031215614091575f5ffd5b853561409c81613f0c565b94506140ab8760208801613dd1565b93506140ba8760c0880161406c565b92506101208601356001600160401b03811115613fc7575f5ffd5b5f5f5f60e084860312156140e7575f5ffd5b6140f18585613dd1565b925060a084013561410181613f0c565b915060c084013561411181613f0c565b809150509250925092565b8035600281900b8114611a39575f5ffd5b5f5f5f5f6101008587031215614141575f5ffd5b843561414c81613f0c565b935061415b8660208701613dd1565b925060c085013561416b81613f0c565b915061417960e0860161411c565b905092959194509250565b5f5f60208385031215614195575f5ffd5b82356001600160401b038111156141aa575f5ffd5b6141b685828601613f20565b90969095509350505050565b602081525f82518060208401528060208501604085015e5f604082850101526040601f19601f83011684010191505092915050565b5f5f5f5f5f5f610160878903121561420d575f5ffd5b863561421881613f0c565b95506142278860208901613dd1565b94506142368860c0890161406c565b935061012087013592506101408701356001600160401b03811115614259575f5ffd5b61426589828a01613f20565b979a9699509497509295939492505050565b5f5f5f5f5f5f610120878903121561428d575f5ffd5b863561429881613f0c565b95506142a78860208901613dd1565b945060c0870135935060e087013592506101008701356001600160401b03811115614259575f5ffd5b602080825282518282018190525f918401906040840190835b818110156143075783518352602093840193909201916001016142e9565b509095945050505050565b6020810161431f83613e39565b91905290565b918252602082015260400190565b5f60608284031215614343575f5ffd5b612111838361406c565b634e487b7160e01b5f52604160045260245ffd5b604051601f8201601f191681016001600160401b03811182821017156143895761438961434d565b604052919050565b803562ffffff81168114611a39575f5ffd5b5f60a08284031280156143b4575f5ffd5b5060405160a081016001600160401b03811182821017156143d7576143d761434d565b60405282356143e581613f0c565b815260208301356143f581613f0c565b602082015261440660408401614391565b60408201526144176060840161411c565b6060820152608083013561442a81613f0c565b60808201529392505050565b803561444181613f0c565b6001600160a01b03168252602081013561445a81613f0c565b6001600160a01b0316602083015262ffffff61447860408301614391565b16604083015261448a6060820161411c565b60020b606083015260808101356144a081613f0c565b6001600160a01b03166080929092019190915250565b80358015158114611a39575f5ffd5b6144ce816144b6565b151582526020818101359083015260408101356144ea81613f0c565b6001600160a01b03166040929092019190915250565b610120810161450f8286614436565b61451c60a08301856144c5565b82610100830152949350505050565b5f6020828403121561453b575f5ffd5b5051919050565b5f60208284031215614552575f5ffd5b612111826144b6565b818382375f9101908152919050565b634e487b7160e01b5f52601160045260245ffd5b8082018281125f83128015821682158216171561459d5761459d61456a565b505092915050565b634e487b7160e01b5f52603260045260245ffd5b60a08101610ab38284614436565b5f602082840312156145d7575f5ffd5b81516001600160401b038111156145ec575f5ffd5b8201601f810184136145fc575f5ffd5b80516001600160401b038111156146155761461561434d565b614628601f8201601f1916602001614361565b81815285602083850101111561463c575f5ffd5b8160208401602083015e5f91810160200191909152949350505050565b5f5f6040838503121561466a575f5ffd5b505080516020909101519092909150565b5f6020828403121561468b575f5ffd5b813560028110612111575f5ffd5b5f602082840312156146a9575f5ffd5b61211182614391565b5f602082840312156146c2575f5ffd5b813560ff81168114612111575f5ffd5b5f600160ff1b82016146e6576146e661456a565b505f0390565b60e081016146fa8286614436565b60a082019390935260c00152919050565b81810381811115610ab357610ab361456a565b5f8261473857634e487b7160e01b5f52601260045260245ffd5b500490565b8082028115828204841417610ab357610ab361456a565b80820180821115610ab357610ab361456a565b6001600160a01b0392831681529116602082015260400190565b6001600160a01b039384168152919092166020820152604081019190915260600190565b63ffffffff8281168282160390811115610ab357610ab361456a565b63ffffffff8181168382160190811115610ab357610ab361456a565b8381526001600160a01b038316602082015260a081016110ec60408301846144c556";
@@ -0,0 +1,99 @@
1
+ import { decodeAbiParameters, encodeAbiParameters, type Address, type Hex } from "viem";
2
+ import { AUCTION_QUOTE_OPTIONS, ROBINHOOD_WETH } from "../auction.js";
3
+ import { LifecyclePlanningError } from "./types.js";
4
+
5
+ export const HMM_FIXED_PROFILE_ID: Hex = "0x7e51d9aa979940e7867c75a82e05e924aa067e9d436f7731c3e3299f9e55d53d";
6
+ export const HMM_DYNAMIC_PROFILE_ID: Hex = "0x109598e017b8f12648aff0f0dc04dbf8d4c0493f41a63068682d8f9d0a07a83d";
7
+ export function isHmmProfile(profileId: Hex): boolean {
8
+ const id = profileId.toLowerCase();
9
+ return id === HMM_FIXED_PROFILE_ID || id === HMM_DYNAMIC_PROFILE_ID;
10
+ }
11
+
12
+ /** Widths and displacement are tick spacings; amounts are raw token/quote units. */
13
+ export type HmmStrategyConfig = {
14
+ bidWidth: number; askWidth: number; gap: number; staleAfterSeconds: number; staleDisplacement: number;
15
+ minQuoteDeploy: bigint; minQuoteHarvest: bigint; minTokenHarvest: bigint;
16
+ resalePremiumBps: number; maxAsks: number; maxAskTokenExposure: bigint; maxAcquiredInventory: bigint;
17
+ premiumDecaySeconds: number;
18
+ };
19
+ export type HmmLaunchConfig = { strategyShareBps: number; strategy: HmmStrategyConfig };
20
+ export const hmmStrategyComponents = [
21
+ { name: "bidWidth", type: "int24" }, { name: "askWidth", type: "int24" }, { name: "gap", type: "int24" },
22
+ { name: "staleAfterSeconds", type: "uint32" }, { name: "staleDisplacement", type: "int24" },
23
+ { name: "minQuoteDeploy", type: "uint256" }, { name: "minQuoteHarvest", type: "uint256" },
24
+ { name: "minTokenHarvest", type: "uint256" }, { name: "resalePremiumBps", type: "uint16" },
25
+ { name: "maxAsks", type: "uint8" }, { name: "maxAskTokenExposure", type: "uint256" },
26
+ { name: "maxAcquiredInventory", type: "uint256" }, { name: "premiumDecaySeconds", type: "uint32" },
27
+ ] as const;
28
+ export const hmmLaunchComponents = [
29
+ { name: "strategyShareBps", type: "uint16" }, { name: "strategy", type: "tuple", components: hmmStrategyComponents },
30
+ ] as const;
31
+
32
+ function integer(name: string, value: number, min: number, max: number): void {
33
+ if (!Number.isInteger(value) || value < min || value > max) invalid(`${name} must be an integer between ${min} and ${max}`);
34
+ }
35
+ function amount(name: string, value: bigint, min: bigint, max = (1n << 256n) - 1n): void {
36
+ if (typeof value !== "bigint" || value < min || value > max) invalid(`${name} must be a bigint between ${min} and ${max}`);
37
+ }
38
+ function invalid(message: string): never { throw new LifecyclePlanningError("INVALID_HMM_CONFIG", message); }
39
+
40
+ /** Mirrors HMMFeeCollectorFactoryV1._decodeHMM, including Solidity field widths. */
41
+ export function validateHmmLaunchConfig(config: HmmLaunchConfig): void {
42
+ integer("strategyShareBps", config.strategyShareBps, 0, 10000);
43
+ const s = config.strategy;
44
+ integer("bidWidth", s.bidWidth, 1, 8388607);
45
+ integer("askWidth", s.askWidth, 1, 8388607);
46
+ integer("gap", s.gap, 0, 8388607);
47
+ integer("staleAfterSeconds", s.staleAfterSeconds, 1, 0xffffffff);
48
+ integer("staleDisplacement", s.staleDisplacement, 1, 8388607);
49
+ integer("resalePremiumBps", s.resalePremiumBps, 0, 5000);
50
+ integer("maxAsks", s.maxAsks, 1, 8);
51
+ integer("premiumDecaySeconds", s.premiumDecaySeconds, 0, 0xffffffff);
52
+ amount("minQuoteDeploy", s.minQuoteDeploy, 0n);
53
+ amount("minQuoteHarvest", s.minQuoteHarvest, 1n);
54
+ amount("minTokenHarvest", s.minTokenHarvest, 1n);
55
+ const cap = (1n << 128n) - 1n;
56
+ amount("maxAskTokenExposure", s.maxAskTokenExposure, 0n, cap);
57
+ amount("maxAcquiredInventory", s.maxAcquiredInventory, s.minTokenHarvest, cap);
58
+ if (s.maxAskTokenExposure < BigInt(s.maxAsks) || s.maxAskTokenExposure < s.minTokenHarvest) invalid("maxAskTokenExposure must cover maxAsks and minTokenHarvest");
59
+ }
60
+
61
+ /** Exactly abi.encode(HMMLaunchConfigV1): fourteen static words (448 bytes). */
62
+ export function encodeHmmLaunchTail(config: HmmLaunchConfig): Hex {
63
+ validateHmmLaunchConfig(config);
64
+ return encodeAbiParameters([{ type: "tuple", components: hmmLaunchComponents }], [config]);
65
+ }
66
+ export function decodeHmmLaunchTail(encoded: Hex): HmmLaunchConfig {
67
+ if (encoded.length !== 2 + 448 * 2) invalid("HMM launch tail must be exactly 448 bytes");
68
+ const config = decodeAbiParameters([{ type: "tuple", components: hmmLaunchComponents }], encoded)[0];
69
+ if (encodeHmmLaunchTail(config).toLowerCase() !== encoded.toLowerCase()) invalid("HMM launch tail is not canonical");
70
+ return config;
71
+ }
72
+
73
+ /** Model calibration defaults, not an investment recommendation. Unknown quotes need explicit thresholds. */
74
+ export function defaultHmmLaunchConfig(options: {
75
+ tokenBudget: bigint; quoteAsset: Address | string; quoteDecimals?: number;
76
+ minQuoteDeploy?: bigint; minQuoteHarvest?: bigint;
77
+ }): HmmLaunchConfig {
78
+ amount("tokenBudget", options.tokenBudget, 1n, (1n << 128n) - 1n);
79
+ const quote = AUCTION_QUOTE_OPTIONS.find((q) => q.id === options.quoteAsset || q.address.toLowerCase() === options.quoteAsset.toLowerCase());
80
+ const decimals = options.quoteDecimals ?? quote?.decimals;
81
+ if (decimals !== undefined) integer("quoteDecimals", decimals, 0, 255);
82
+ if (quote !== undefined && decimals !== quote.decimals) invalid("quoteDecimals must match the supported quote asset");
83
+ const weth = quote?.address.toLowerCase() === ROBINHOOD_WETH.toLowerCase();
84
+ const unit = decimals === undefined ? undefined : 10n ** BigInt(decimals);
85
+ const minQuoteDeploy = options.minQuoteDeploy ?? (weth ? 500000000000000n : quote?.usdPeg && unit !== undefined ? unit : undefined);
86
+ const minQuoteHarvest = options.minQuoteHarvest ?? (weth ? 5000000000000000n : quote?.usdPeg && unit !== undefined ? 10n * unit : undefined);
87
+ if (minQuoteDeploy === undefined || minQuoteHarvest === undefined) invalid("Unsupported quote asset requires explicit minQuoteDeploy and minQuoteHarvest");
88
+ const config: HmmLaunchConfig = {
89
+ strategyShareBps: 5000,
90
+ strategy: {
91
+ bidWidth: 5, askWidth: 5, gap: 1, staleAfterSeconds: 86400, staleDisplacement: 5,
92
+ minQuoteDeploy, minQuoteHarvest, minTokenHarvest: options.tokenBudget / 100000n,
93
+ resalePremiumBps: 500, maxAsks: 4, maxAskTokenExposure: options.tokenBudget / 10n,
94
+ maxAcquiredInventory: options.tokenBudget, premiumDecaySeconds: 0,
95
+ },
96
+ };
97
+ validateHmmLaunchConfig(config);
98
+ return config;
99
+ }
@@ -3,6 +3,7 @@ export * from "./schema.js";
3
3
  export * from "./types.js";
4
4
  export * from "./abi.js";
5
5
  export * from "./markets.js";
6
+ export * from "./hmm.js";
6
7
  export * from "./progress.js";
7
8
  export * from "./fork.js";
8
9
  export * from "./authors.js";
@@ -1,6 +1,7 @@
1
1
  import { concatHex, decodeAbiParameters, encodeAbiParameters, getAddress, hexToBytes, keccak256, pad, stringToHex, toHex, zeroHash, type Address, type Hex } from "viem";
2
2
  import type { MarketConfigV1 } from "./schema.js";
3
3
  import { LifecyclePlanningError, type LifecycleProfile, type PoolBoundHookSaltProgress } from "./types.js";
4
+ import { decodeHmmLaunchTail, encodeHmmLaunchTail, isHmmProfile, type HmmLaunchConfig } from "./hmm.js";
4
5
 
5
6
  export type V4LifecyclePositionConfig = {
6
7
  tickLower: number; tickUpper: number; liquidity: bigint; salt: Hex; maxTokenAmount: bigint;
@@ -42,6 +43,7 @@ export type V4PoolBoundLifecycleMarketConfigV5 = Omit<V4LifecycleMarketConfig, "
42
43
  };
43
44
  export type V4PoolBoundLifecycleMarketConfigV6 = Omit<V4LifecycleMarketConfig, "version"> & {
44
45
  version: 6; minimumHookFeePips: number; feeSensitivityPipsSecondsPerTick: number; hookSalt: Hex;
46
+ hmmLaunchConfig?: HmmLaunchConfig;
45
47
  };
46
48
  export type V4PoolBoundLifecycleMarketConfig = V4PoolBoundLifecycleMarketConfigV5 | V4PoolBoundLifecycleMarketConfigV6;
47
49
  export const V4_LIFECYCLE_CONFIG_SCHEMA = keccak256(stringToHex("(uint16,uint24,int24,uint160,uint24,uint8,uint8,address,bool,bytes32,bytes32,bytes32,address,uint16,(int24,int24,uint128,bytes32,uint256)[])"));
@@ -88,7 +90,19 @@ function assertV1HookFeeShape(config: object): void {
88
90
  }
89
91
  }
90
92
 
93
+ /** HMM profile selection requires a typed tail and appends it automatically. */
91
94
  export function encodePoolBoundV4LifecycleMarketConfig(config: V4PoolBoundLifecycleMarketConfig): Hex {
95
+ const prefix = encodePoolBoundV4Prefix(config);
96
+ if (isHmmProfile(config.profileId)) {
97
+ if (config.version !== 6 || config.hmmLaunchConfig === undefined) throw new LifecyclePlanningError("INVALID_HMM_CONFIG", "HMM profiles require config6 and an explicit hmmLaunchConfig");
98
+ if (config.lpFeePips !== 0) throw new LifecyclePlanningError("INVALID_HOOK_FEES", "HMM profiles require zero LP fee");
99
+ return concatHex([prefix, encodeHmmLaunchTail(config.hmmLaunchConfig)]);
100
+ }
101
+ if (config.version === 6 && config.hmmLaunchConfig !== undefined) throw new LifecyclePlanningError("INVALID_HMM_CONFIG", "An HMM launch tail requires an HMM profile");
102
+ return prefix;
103
+ }
104
+
105
+ function encodePoolBoundV4Prefix(config: V4PoolBoundLifecycleMarketConfig): Hex {
92
106
  if (!isPoolBoundV4ConfigVersion(config.version)) throw new LifecyclePlanningError("UNSUPPORTED_CONFIG_VERSION", "Pool-bound V4 config version must be explicitly 5 or 6");
93
107
  if (config.version === 6) validatePoolBoundHookFees(config);
94
108
  else assertV1HookFeeShape(config);
@@ -106,6 +120,11 @@ export function decodePoolBoundV4LifecycleMarketConfig(encoded: Hex, expectedVer
106
120
  const config = version === 5
107
121
  ? decodeAbiParameters([{ type: "tuple", components: poolBoundV4LifecycleMarketComponentsV5 }], encoded)[0] as V4PoolBoundLifecycleMarketConfigV5
108
122
  : decodeAbiParameters([{ type: "tuple", components: poolBoundV4LifecycleMarketComponentsV6 }], encoded)[0] as V4PoolBoundLifecycleMarketConfigV6;
123
+ if (isHmmProfile(config.profileId)) {
124
+ if (config.version !== 6) throw new LifecyclePlanningError("INVALID_HMM_CONFIG", "HMM profiles require config6");
125
+ const prefixLength = encodePoolBoundV4Prefix(config).length;
126
+ config.hmmLaunchConfig = decodeHmmLaunchTail(`0x${encoded.slice(prefixLength)}`);
127
+ }
109
128
  if (encodePoolBoundV4LifecycleMarketConfig(config).toLowerCase() !== encoded.toLowerCase()) throw new LifecyclePlanningError("INVALID_BOUND_MARKET", "Pool-bound config is not canonical for its explicit schema");
110
129
  return config;
111
130
  }
@@ -225,7 +244,9 @@ export function hashPoolBoundV4MarketCommitment(options: { chainId: bigint; core
225
244
  if (!isPoolBoundV4ConfigVersion(market.configVersion)) throw new LifecyclePlanningError("INVALID_BOUND_MARKET", "Pool-bound V4 market requires explicit config version 5 or 6");
226
245
  const config = decodePoolBoundV4LifecycleMarketConfig(market.config, market.configVersion);
227
246
  if (config.profileId.toLowerCase() !== market.profileId.toLowerCase()) throw new LifecyclePlanningError("INVALID_BOUND_MARKET", "Config profile differs from the committed market profile");
228
- const configHash = keccak256(encodePoolBoundV4LifecycleMarketConfig({ ...config, hookSalt: zeroHash }));
247
+ // The collector factory commits the V6 prefix, not the auxiliary HMM tail.
248
+ // The full plan commitment separately binds every byte of that tail.
249
+ const configHash = keccak256(encodePoolBoundV4Prefix({ ...config, hookSalt: zeroHash }));
229
250
  return keccak256(encodeAbiParameters([
230
251
  { type: "bytes32" }, { type: "uint256" }, { type: "address" }, { type: "address" }, { type: "address" },
231
252
  { type: "bytes32" }, { type: "bytes32" }, { type: "address" }, { type: "uint256" }, { type: "uint32" }, { type: "bytes32" },
@@ -4,6 +4,10 @@ import type {
4
4
  } from "./schema.js";
5
5
  import type { LifecycleProfile } from "./types.js";
6
6
  import { fixedFeePoolHookV1CreationCode } from "./deployments/fixed-fee-pool-hook-v1-20261008.js";
7
+ import { dynamicFeePoolHookV1CreationCode } from "./deployments/dynamic-fee-pool-hook-v1-20261011.js";
8
+ import { hmmFixedEnvelope, hmmFixedAdapter, hmmFixedRegistration, hmmFixedCreationCode } from "./deployments/hmm-fixed-pool-hook-v1-20261011.js";
9
+ import { hmmDynamicEnvelope, hmmDynamicAdapter, hmmDynamicRegistration, hmmDynamicCreationCode } from "./deployments/hmm-dynamic-pool-hook-v1-20261011.js";
10
+ import { HMM_FIXED_PROFILE_ID, HMM_DYNAMIC_PROFILE_ID } from "./hmm.js";
7
11
 
8
12
  export enum KnownLifecycleProfile {
9
13
  Abyss0 = "abyss-0",
@@ -11,10 +15,16 @@ export enum KnownLifecycleProfile {
11
15
  Abyss2 = "abyss-2",
12
16
  Abyss3 = "abyss-3",
13
17
  V4FixedFeePool = "v4-fixed-fee-pool",
18
+ V4DynamicFeePool = "v4-dynamic-fee-pool",
19
+ V4HmmFixedPool = "v4-hmm-fixed-pool",
20
+ V4HmmDynamicPool = "v4-hmm-dynamic-pool",
14
21
  }
15
22
 
16
23
  export enum KnownLifecycleHook {
17
24
  FixedFeePoolV1 = "fixed-fee-pool-v1",
25
+ DynamicFeePoolV1 = "dynamic-fee-pool-v1",
26
+ HmmFixedPoolV1 = "hmm-fixed-pool-v1",
27
+ HmmDynamicPoolV1 = "hmm-dynamic-pool-v1",
18
28
  }
19
29
 
20
30
  Object.freeze(KnownLifecycleProfile);
@@ -195,6 +205,100 @@ const fixedFeePoolPreset: LifecycleProfilePreset = Object.freeze({
195
205
  }),
196
206
  });
197
207
 
208
+ // pool-hook-template-v1/20261011T033141Z-dynamic-fee-zero-royalty: config.json,
209
+ // admission.json (unsigned preparation), preserved storage-child runtimes and the
210
+ // successful admit-latest.json receipt 0x1928b13d1a6bf8826d08493a18c483fc7d244a3ec4100a7f8118f510a5db640c.
211
+ // The admitted envelope shares the fixed profile's bounds and protocol terms,
212
+ // but has its own artifact, review, author terms, locker, deployer and adapter.
213
+ const dynamicFeePoolEnvelope = Object.freeze({
214
+ ...fixedFeePoolEnvelope,
215
+ artifactDigest: "0xd448a4117b78714cc4f96824356c6a90ec666449fde5c57e2b7bbe072f5e4a7a",
216
+ reviewManifestDigest: "0x59c9c449ec9f1e5a552fd67e9538fe77055945f46513048115d1282d3a479589",
217
+ termsDigest: "0xbe3b09dc6d49fd548e76fed654b852039e8899e591ebacafc5e67f0692d0c699",
218
+ graph: Object.freeze({
219
+ ...fixedFeePoolEnvelope.graph,
220
+ locker: "0x3C68D5d75C69DF755eD53EA51f0be609cA76402c",
221
+ lockerCodeHash: "0xbc55801d253d519818b7be0a0008c359dd9774c068f7b103bdd0b7d4997e7467",
222
+ hookDeployer: "0x59F83bC43A075C40c68dea444dcd9c639BE7F1E7",
223
+ hookDeployerCodeHash: "0x1b11f186b567721148b442eab0a922dd2a2e85ddbf3b729d239eef2379b319c3",
224
+ hookCreationCodeHash: "0xd448a4117b78714cc4f96824356c6a90ec666449fde5c57e2b7bbe072f5e4a7a",
225
+ codeChunk0: "0x766eB09552C91faea2bA9ae46832dFCeD6C60335",
226
+ codeChunk0Hash: "0x818c56bf10ae21129fe54f1b8991d6f807ce4ccef35b34c56251c1fd2d7d623f",
227
+ codeChunk1: "0x4Ce7Ed36Ea5E26a83c0Dc536C7Babc2EA171439c",
228
+ codeChunk1Hash: "0xbc73944bfa7e74df5968907a05fe2579a17ab155d3a0db407588d1baff51b4de",
229
+ }),
230
+ } satisfies LaunchEnvelopeV2);
231
+
232
+ const dynamicFeePoolAdapter = Object.freeze({
233
+ implementation: "0xDa8581E1241722154B44404a032C086708080519",
234
+ codeHash: "0xddee60ce5afbc508b0337fb170b3e7446775db08a444635eaa3cfea0ff575fdb",
235
+ capabilities: 123n,
236
+ configVersion: 6,
237
+ enabled: true,
238
+ } satisfies AdapterRegistrationV1);
239
+
240
+ const dynamicFeePoolPreset: LifecycleProfilePreset = Object.freeze({
241
+ key: KnownLifecycleProfile.V4DynamicFeePool,
242
+ supported: true,
243
+ profile: Object.freeze({
244
+ id: "0x27f219872fe934a5464bc9b900028256122f215b40cbdb69ef5f88cd5f627ccb",
245
+ registration: Object.freeze({
246
+ adapterId: "0xce1347ee563f66097199aee9c7c651e1b938972924dc271605db1b6721502bc3",
247
+ configSchema: "0x51c5ca14c40012f78425cd1afb1ea77980da3fed0490a00911a8a4ed34792045",
248
+ dependencyDigest: "0x599fd5154bef5751fdb6e1265586c7eced3d3e7ebd2c6f0066a20f9c8b7bf810",
249
+ venue: dynamicFeePoolEnvelope.graph.manager,
250
+ factory: zeroAddress,
251
+ hook: zeroAddress,
252
+ capabilities: 123n,
253
+ enabled: true,
254
+ }),
255
+ adapter: dynamicFeePoolAdapter,
256
+ topology: Object.freeze({
257
+ hookTopology: 2,
258
+ configVersion: 6,
259
+ hookDeployer: dynamicFeePoolEnvelope.graph.hookDeployer,
260
+ hookCreationCodeHash: dynamicFeePoolEnvelope.graph.hookCreationCodeHash,
261
+ }),
262
+ venueKind: "uniswap-v4",
263
+ envelope: dynamicFeePoolEnvelope,
264
+ developerTerms: Object.freeze({
265
+ adapter: dynamicFeePoolAdapter.implementation,
266
+ beneficiary: dynamicFeePoolEnvelope.beneficiary,
267
+ maximumDeveloperFeeBps: dynamicFeePoolEnvelope.maximumDeveloperFeeBps,
268
+ termsDigest: dynamicFeePoolEnvelope.termsDigest,
269
+ enabled: true,
270
+ }),
271
+ protocolMaximumDeveloperFeeBps: 2400,
272
+ }),
273
+ boundHook: Object.freeze({
274
+ creationCode: dynamicFeePoolHookV1CreationCode,
275
+ deployer: dynamicFeePoolEnvelope.graph.hookDeployer,
276
+ poolManager: dynamicFeePoolEnvelope.graph.manager,
277
+ oracleFactory: dynamicFeePoolEnvelope.graph.oracleFactory,
278
+ liquidityLocker: dynamicFeePoolEnvelope.graph.locker,
279
+ registrar: dynamicFeePoolAdapter.implementation,
280
+ }),
281
+ });
282
+
283
+ function hmmPreset(key: KnownLifecycleProfile, id: Hex, envelope: LaunchEnvelopeV2,
284
+ adapter: AdapterRegistrationV1, registration: ProfileRegistrationV1, creationCode: Hex): LifecycleProfilePreset {
285
+ return Object.freeze({
286
+ key, supported: true,
287
+ profile: Object.freeze({
288
+ id, registration, adapter,
289
+ topology: Object.freeze({ hookTopology: 2, configVersion: 6,
290
+ hookDeployer: envelope.graph.hookDeployer, hookCreationCodeHash: envelope.graph.hookCreationCodeHash }),
291
+ venueKind: "uniswap-v4", envelope,
292
+ developerTerms: Object.freeze({ adapter: adapter.implementation, beneficiary: envelope.beneficiary,
293
+ maximumDeveloperFeeBps: envelope.maximumDeveloperFeeBps, termsDigest: envelope.termsDigest, enabled: true }),
294
+ protocolMaximumDeveloperFeeBps: 2400,
295
+ }),
296
+ boundHook: Object.freeze({ creationCode, deployer: envelope.graph.hookDeployer,
297
+ poolManager: envelope.graph.manager, oracleFactory: envelope.graph.oracleFactory,
298
+ liquidityLocker: envelope.graph.locker, registrar: adapter.implementation }),
299
+ });
300
+ }
301
+
198
302
  const knownDeployment: LifecycleDeploymentPreset = Object.freeze({
199
303
  chainId: 4663n,
200
304
  orchestrator: "0x91560876033d568d25CDe98C78c33ff8FC43962c",
@@ -208,6 +312,9 @@ const knownDeployment: LifecycleDeploymentPreset = Object.freeze({
208
312
  abyssPreset(KnownLifecycleProfile.Abyss2, "0x49b3bd30fe302526d7799f2ef15f3b2b261b5c44e075aa48b98c6b37148b7d59"),
209
313
  abyssPreset(KnownLifecycleProfile.Abyss3, "0xe1bd95e086469e6afd9791ccc957e4d22b735012cb3db4a747f703673c62c306"),
210
314
  fixedFeePoolPreset,
315
+ dynamicFeePoolPreset,
316
+ hmmPreset(KnownLifecycleProfile.V4HmmFixedPool, HMM_FIXED_PROFILE_ID, hmmFixedEnvelope, hmmFixedAdapter, hmmFixedRegistration, hmmFixedCreationCode),
317
+ hmmPreset(KnownLifecycleProfile.V4HmmDynamicPool, HMM_DYNAMIC_PROFILE_ID, hmmDynamicEnvelope, hmmDynamicAdapter, hmmDynamicRegistration, hmmDynamicCreationCode),
211
318
  ]),
212
319
  provenance: Object.freeze({ sourceCommit: "e174ce695c7010f50ca9211b07b9f178c990beac", deploymentBlock: 82880546n }),
213
320
  });
@@ -237,7 +344,7 @@ export function getKnownLifecycleProfile(options: KnownLifecycleDeploymentIdenti
237
344
  return undefined;
238
345
  }
239
346
 
240
- /** Stable, frozen release order: Abyss variants 0 through 3, then the pool-bound V4 profile. */
347
+ /** Stable, frozen order: Abyss variants 0 through 3, fixed/dynamic V4, then HMM fixed/dynamic. */
241
348
  export function listKnownLifecycleProfiles(options: KnownLifecycleDeploymentIdentity): readonly LifecycleProfilePreset[] {
242
349
  return getKnownLifecycleDeployment(options)?.profiles ?? noProfiles;
243
350
  }
Binary file