diff --git a/abi/generated_test.go b/abi/generated_test.go index a5f6fb2..cac1e97 100644 --- a/abi/generated_test.go +++ b/abi/generated_test.go @@ -514,6 +514,29 @@ func TestGetMethods(t *testing.T) { OraclePublicKeysRef: mustHexToCell("b5ee9c72010101010022000040eddc00f5f26004502a785448ce27bad6842591fff9a76b645b507328286fbbfa"), }, }, + { + name: "Dedust is_stable", + code: "b5ee9c7201025f0100162b000114ff00f4a413f4bcf2c80b01020162020302012004050201203f400201cf060702012008090499dc07434c0fe900c00407e185c6c3c900835c2c7c82084187b950b6ea3e98c36cf200835c874cfc040753e803e9034c03e803d01154800f534504c01b6cf0411814136cf380820841cab2a2aaea5c0d100e0201621f200005ba854801fbba5263134ed44f86352426f02f862f86401d30f01f866d401f86901d3008e25eda2edfb20d70b0320c0009430d603018e12c0019881010cd71801db31e030f2c1056d6de2d8018e25eda2edfb20d70b0320c0009430d603018e12c0019881010cd71801db31e030f2c1056d6de2d843306f036f233202d102d307d307d180a01c25c6f02f86c0182300de0b6b3a7640000801258a1710192a70ae4a80182300de0b6b3a7640000801258a1710192a70ae4a86f02f86d71c858cf16f8426f22c858cf1613cb0701cf17c976c8cb0412ccccc97001f90074c8cb0212ca07cbffc9d0010b01ca71c858cf16f8426f22c858cf1613cb0701cf17c976c8cb0412ccccc97001f90074c8cb0212ca07cbffc9d06f02f86e6df86ff84ff84c6f11f84c6f10c8cb07cb07f84e6f10cf16f84e6f11cf168b02cf16f400c9f86b70f86a70206f02f86770206f02f8680c00c8f84d6f11f84d6f10f84bf849f8426f11f843c8ccccccccf84401cb0ff84601cb0ff84afa02f8476f10fa02f8476f11fa02f8486f10fa02f8486f11fa02cb7fcb7fc9ed54821005f5e10070fb02830670588010c8cb0501cf1601fa02806bcf40c901fb0000caf8426f112176c8cb0412ccccc97001f90074c8cb0212ca07cbffc9d001d0fa40d30701018e25eda2edfb20d70b0320c0009430d603018e12c0019881010cd71801db31e030f2c1056d6de2d801d1f8415004c705f8426f105003c70512b001c001b0f2e10804d08fd030db3c8020d721d33f0101d48e25eda2edfb20d70b0320c0009430d603018e12c0019881010cd71801db31e030f2c1056d6de2d801fa00fa40d300fa00f404552003d430413007db3c3010365502db3ce0208210b56b9598ba9330f08be02082107bdd97deba5c0f101101f6f8426f112176c8cb0412ccccc97001f90074c8cb0212ca07cbffc9d001d0fa40d3070101d3008e25eda2edfb20d70b0320c0009430d603018e12c0019881010cd71801db31e030f2c1056d6de2d8018e25eda2edfb20d70b0320c0009430d603018e12c0019881010cd71801db31e030f2c1056d6de2d843306f0312024e8f2333f82c18a15470655376ed44ed45ed478aed67ed65ed64757fed118aed41edf101f2ffdb09131401e08e8330db3ce02082106e24728dba9330f095e02082100b429f52ba9330f090e0322182106873c90cba9331f092e02182100a420458ba9331f093e0218101bcba9331f088e0218210c015297fba9331f08ae0218210abb46b3dba9331f091e001821026c63ab7ba92f094e030840ff2f01c003201d1f8415004c705f8426f105003c70512b001c002b0f2e10902dc88ed55219993d0307f925b70f2ffda11926d32dff8078110daa070f83617a170f8430310474760c88210ad4eb6f501cb1f500501cb3f13cc01fa0201cf16f4000171c858cf16f8426f22c858cf1613cb0701cf17c976c8cb0412ccccc97001f90074c8cb0212ca07cbffc9d04130151601d8f8456f23f8476f22f84e6f22f84d6f222bd0d31f0101fa40fa40f404f404d156122dc70556132dc705b15210f2e905f84ac2005210f2e92656122dc705933853989b373a547a78102c10891067e2f846561301812710a984208107d0812710a984561458a10511100504509817000000348018c8cb0501cf1601fa02806bcf4001cf17c901fb00f80ff2f002fe058ee5513382300de0b6b3a7640000a984502382300de0b6b3a7640000a984511382300de0b6b3a7640000a9845c5c82300de0b6b3a7640000a984512082300de0b6b3a7640000a984511082300de0b6b3a7640000a984a082300de0b6b3a7640000a9845aa0511297303321a012a984e222c20003f823b913b05260f2d931481801fe521dbe15f2e930f8486f2252fac7059b53d2a117a05154a15062a09f53d2a116a05164a15082a007505504e253416f02f86750076f02f868f84d6f11f84d6f10f84bf849f8426f11f843c8ccccccccf84401cb0ff84601cb0ff84afa02f8476f10fa02f8476f11fa02f8486f10fa02f8486f11fa02cb7fcb7fc9ed542c51501902941058104d4c135420181ec85008cf165006cf165005fa025005fa02c9c882109c610de301cb1f5003cf1601cf165003fa0201fa02ccc872cf418066cf4001cf17c971fb0813a1296ee30f1a1b00a632333720d70b01c00091309134e2f807810786a070f83616a170f843104646135057c88210ad4eb6f501cb1f500501cb3f13cc01fa0201cf16f40040038018c8cb0501cf1601fa02806bcf4001cf17c901fb0000dc31323306d0fa40d300fa00f4045520103404d15502f807810a92a070f8361aa170f843108a0706105a1049103949b0c8821072aca8aa01cb1f500901cb3f17cc5005cf165003fa0201cf1650235023cb0001fa02f400ccc9028018c8cb0501cf1601fa02806acf40f400c901fb0002e8db3c8020d721d33f0101fa00fa40fa40303020f849f849c870fa025003cf16f828cf1612ccc976c8cb0412ccccc97001f90074c8cb0212ca07cbffc9d0f84101c705f2e101f8476f22f84a546250a984f84a546260a9845131a15123a1f84a26a1f86a53206f02f867f82c18a1245433240350a85c1d01fec882103aa870a601cb1f5006cf165005fa025003fa0201fa0201fa0201fa02c872cf418066cf4001cf17c971fb0813a1813b5670f836a1f84e6f2270f8436d28542a740bc88210ad4eb6f501cb1f500501cb3f13cc01fa0201cf16f40023ab00103841088018c8cb0501cf1601fa02806bcf4001cf17c901fb0020ab00a1701e00f8f843103540456dc88210ad4eb6f501cb1f500501cb3f13cc01fa0201cf16f40040038018c8cb0501cf1601fa02806bcf4001cf17c901fb00f84d6f11f84d6f10f84bf849f8426f11f843c8ccccccccf84401cb0ff84601cb0ff84afa02f8476f10fa02f8476f11fa02f8486f10fa02f8486f11fa02cb7fcb7fc9ed5402016a21220201482c2d01f14db3cf841f8426f10c705f2e1038020d721d33f0101d30f0101d4d132f84421be915be0f864f84d6f11f84d6f10f84bf849f8426f11f843c8ccccccccf84401cb0ff84601cb0ff84afa02f8476f10fa02f8476f11fa02f8486f10fa02f8486f11fa02cb7fcb7fc9ed5420fb04d0ed1eed538200a854ed43d885c020120232402c936cf1d36cf200835c874cfc04074c3c04c4c4830bfc86049c42e6c3cb845fe19be135bc47e135bc43e12fe127e109bc47e10f2333333333e110072c3fe118072c3fe12be80be11dbc43e80be11dbc47e80be121bc43e80be121bc47e80b2dff2dff27b55205c3d03f736cf200835c874cfc040753e903e8035007423897b68bb7ec835c2c0c83000250c3580c06384b0006620404335c60076cc780c3cb0415b5b78b6007e8023897b68bb7ec835c2c0c83000250c3580c06384b0006620404335c60076cc780c3cb0415b5b78b6007e8034413d013d01344411440d0408cccd01b6cf16e05c25260152f8426f112176c8cb0412ccccc97001f90074c8cb0212ca07cbffc9d001d0fa40d3070101d401d0fa402702c8f82c18a1f8476f22f84a54221354201a16db3c5218b98e3e10385f08f8078108cda070f836a170f8434304c88210e1a36cd401cb1f500301cb3fccf400c9f841128018c8cb0501cf1601fa02806acf40f400c901fb00e03a5171a05137a054761754763c5d2800e4d3008e25eda2edfb20d70b0320c0009430d603018e12c0019881010cd71801db31e030f2c1056d6de2d8018e25eda2edfb20d70b0320c0009430d603018e12c0019881010cd71801db31e030f2c1056d6de2d843306f0301d102d1f8415005c705f8426f105004c70513b001c003b0f2e11001fac88210b544f4a401cb1f5006cf165004fa0258fa0201fa0201fa0201fa02c872cf418066cf4001cf17c971fb0813a15a6f02f8675137a0f86af84d6f11f84d6f10f84bf849f8426f11f843c8ccccccccf84401cb0ff84601cb0ff84afa02f8476f10fa02f8476f11fa02f8486f10fa02f8486f11fa02cb7fcb7fc9ed542902fe81564470f8365230a12073a9d60066a15141a170f84329034159c88210aae7925601cb1f500401cb3f12cc01fa0201fa02c9f841128018c8cb0501cf1601fa02806acf40f400c901fb0022f849f849c870fa025003cf16f828cf1612ccc976c8cb0412ccccc97003820afaf080a113b609216ee301f807810d4ba070f836152a2b005421f90082f09b21e88fe793c97b7d859ca9f088251118e808eb194a1172f81221292555f549ba923070de009ca170f8285e344763c88210178d451901cb1f500601cb3f5004fa0258cf1601cf1601fa02f400c9533101f90074c8cb0212ca07cbffc9d04430738018c8cb0558cf1658fa02cb6accf400c901fb000201202e2f0201483b3c02012030310201203637048b36cf1cf6cf200835c874cfc0407e803e903d013e803e903d01347e121bc8be139bc894e4eed4dceeec3cb84942e0827270e0286ac00a708025c40e440a0dd7c0f8c348b080205c3d323303f336cf1e36cf200835c874cfc04063897b68bb7ec835c2c0c83000250c3580c06384b0006620404335c60076cc780c3cb0415b5b78b6007e90344cbe13dba622c0a2c09bc0be1c277e13f43e903e90165bc0be1c3478be115bc8ccbe141bc89490f1c164c4d7c0e756b1c1644c654cbcb048007880789bc0be1c205c3d35008471f8432c544c4350cbc88210ad4eb6f501cb1f500501cb3f13cc01fa0201cf16f400470052808018c8cb0501cf1601fa02806bcf4001cf17c901fb005006a105103401948e3e71f843103854443901c88210ad4eb6f501cb1f500501cb3f13cc01fa0201cf16f400103540068018c8cb0501cf1601fa02806bcf4001cf17c901fb0002a1945f046c22e26f02f868340088f84d6f11f84d6f10f84bf849f8426f11f843c8ccccccccf84401cb0ff84601cb0ff84afa02f8476f10fa02f8476f11fa02f8486f10fa02f8486f11fa02cb7fcb7fc9ed5400ecf8506f22c858cf1601cf16c9f86ff84ff84c6f11f84c6f10c8cb07cb07f84e6f10cf16f84e6f11cf168b02cf16f400c9f86bf84d6f11f84d6f10f84bf849f8426f11f843c8ccccccccf84401cb0ff84601cb0ff84afa02f8476f10fa02f8476f11fa02f8486f10fa02f8486f11fa02cb7fcb7fc9ed5403f336cf3e13dba622c0a2c09bc0be1c277e13f43e903e90165bc0be1c34789df6cf200835c874cfc04063897b68bb7ec835c2c0c83000250c3580c06384b0006620404335c60076cc780c3cb0415b5b78b600747e115bc8ccbe141bc8a2c0949531c164c517c1270c56b1c1644c650c3cb04838b8a2c0948431c1605c3d3803e936cf3e13dba622c0a2c09bc0be1c277e13f43e903e90165bc0be1c3478a00835c874cfc04074dff4dffd01344c0cbe131bc880608c03782dace9d90000200496285c4064a9c2b92a00608c03782dace9d90000200496285c4064a9c2b92a3e141bc8be1044b1c1654c1408ea6138c3805bc0be1b605c393a005ef2d1218040026dc88210ad83913f01cb1f5801cb3ff40070588018c8cb0501cf1601fa02806bcf4001cf17c901fb000022f841c705944003a984956c22f2c122e20100a4f8506f22c858cf1601cf16c9f86ff84d6f11f84d6f10f84bf849f8426f11f843c8ccccccccf84401cb0ff84601cb0ff84afa02f8476f10fa02f8476f11fa02f8486f10fa02f8486f11fa02cb7fcb7fc9ed54025f36cf1e76cf200835c874cffe90344c6084017d78401c3ec0a0c19c1620043232c14073c5807e80a01af3d032407ec0205c3d02f736cf200835c874cfc0407480347e11dbc89b7e0b2049259c3e0da81ce041ab9c3e0e2814982fbcb841c0e68cbe115bc8db049bc080b7be1295409b485ba44c66cc1bc8b21633c58073c5b278b220842f7752550072c7d4014072cfd400fe80807e80807e80bd00327e0b3e01e04199a81c3e0da804a85c3e1050cc205c3e0068f8410174c85801cb07f8426f22c858cf1613cb0701cf17c976c8cb0412ccccc97001f90074c8cb0212ca07cbffc9d0c705f2e128002a8018c8cb0501cf1601fa02806acf40f400c901fb0002012041420201204c4d02014843440201204a4b0201484546027fb118b6cf3e115bc8fe11dbc8be135bc889f0803cb84914e171c154e571c16c7cb848d46171c1644d254cc40990c038be1194982049c42a611459a8505100c1e05c470110a9b3db3cf8476f225c0146a8a2db3cf84f6e988b028b026f02f8709df84fd0fa40fa40596f02f870d1e2f8506f225c01e4058ee5513382300de0b6b3a7640000a984502382300de0b6b3a7640000a984511382300de0b6b3a7640000a9845c5c82300de0b6b3a7640000a984512082300de0b6b3a7640000a984511082300de0b6b3a7640000a984a082300de0b6b3a7640000a9845aa0511297303321a012a984e2014801d48ed8eda2edfb7094208407b98ec85471315c82300de0b6b3a7640000a984512082300de0b6b3a7640000a984511082300de0b6b3a7640000a984a082300de0b6b3a7640000a9845240a182300de0b6b3a76400005364e8135f03d8a10182300de0b6b3a764000001a9844900962082300de0b6b3a7640000a984a7032182300de0b6b3a7640000a984531182300de0b6b3a7640000a9845882300de0b6b3a7640000a984a0a98413a05203a1b60bc10295135f03db31e0a4010db4321b679f08905c0113b7419b679f08d024e2105c0201204e4f0201485a5b02015850510201585859020120525302037b205455015cab79db3cf849f849c870fa025003cf16f828cf1612ccc976c8cb0412ccccc97001f90074c8cb0212ca07cbffc9d05c0112a92bdb3cf8456f235b5c02efb5bb678dae191960f1a0fb43a3a38399d1797b0b834973232b23ab9ba1734b797bb1917b837b7b63997c19e2df051f48862de0100811c2a43001f604184132500af250061c540df1803560603c86203164607519e2ce100813b007e4342a460df02b1960e0349c860631725edacae8c2c8c2e8c319e2d9305c56010fb03b679f098de4505c01c682f070e5d7b6a29b392f85076fe15ca2f2053c56c2338728c4e33c9e8ddb1ee827cc588307f41770c8cb078b1398cf16c982f0ee80fd2f1e03480e2282363596ee752d7bb27f50776b95086a0279189675923e588307f41770c8cb078b24c508cf16c957007482f0b76a7ca153c24671658335bbd08946350ffc621fa1c516e7123095d4ffd5c581588307f417f84a7f8b0270c8cb0714f400c9f849103410230111acd6ed9e7c26b791405c0111ac4c6d9e7c243791405c0115b36b36cf3e115bc8db04a05c0235b11176cf0870800870802c3cb8493e11dbc8be12905100f6cf0c205c5d01f4ed44d0d421d0fa40d307010131d3008e25eda2edfb20d70b0320c0009430d603018e12c0019881010cd71801db31e030f2c1056d6de2d8018e25eda2edfb20d70b0320c0009430d603018e12c0019881010cd71801db31e030f2c1056d6de2d843306f0331f86502f863d4596f02f862d401f869d421f86b01d05e007224c0008e106c22328103e8820182b85323b609b6098e1f547032a9845220b608543234a984b608546425a984546444a98412b6084130e24300008cd307d307596f02f86cfa40fa40596f02f86efa4031f40401f86fd1d30f01f864d30f01f866fa0001f86afa00fa00596f02f867fa00fa00596f02f868d37fd37f596f02f86dd1", + data: "b5ee9c72010219010004c600048b0007000a702b2c87f54103772209721a54797c62d79eab68c84647239ee3140257f3c6ca97300c097ce7bc90715b34b9f100000000000c097ce7bc90715b34b9f10000000008010203040089800be0ac9f6bec08f07b6ae0639c39ecd1511a9a9adb4dbc9b6445697241adfb000040100b113a994b5024a16719f69139328eb759596c38a25f59028b146fecdc3621dfe80114ff00f4a413f4bcf2c80b050114ff00f4a413f4bcf2c80b0800cd0000801b5c2a74e9b12977864e903319ac4dc9ebbe94d35a5f4ad9d01f84c896ae11a4100062aa38bbb545d1f6b80cf01e6e4e20f65072b63d95167cbba735d1d2dae3b576002f82b27dafb023c1edab818e70e7b345446a6a6b6d36f26d9115a5c906b7ec0020020270060700f5de03a0e9ae43f4806041da89da8bda8f1c32b7020140e0b1002191960a039e2c03f40500d79e819203f601dacfdacbdac8e2ffda231c7bda89a1f481a60ea2658e0be5c207081e09a63e030421367547f5742be5e807a67e0261a9a61e0203a843f60843a1da3ddaa6208c208b0401ca4dda87b1da83dbe203e5ff0009bf2932f83c020162090a0202cc0b0c001ba0f605da89a1f401f481f481a8610201d40d0e0201480f1000c30831c02497c138007434c0c05c6c2544d7c0fc02f83e903e900c7e800c5c75c87e800c7e800c1cea6d0000b4c7e08403e29fa954882ea54c4d167c0238208405e3514654882ea58c511100fc02780d60841657c1ef2ea4d67c02b817c12103fcbc2000113e910c1c2ebcb853600201201112020120171801f100f4cffe803e90087c007b51343e803e903e90350c144da8548ab1c17cb8b04a30bffcb8b0950d109c150804d50500f214013e809633c58073c5b33248b232c044bd003d0032c032483e401c1d3232c0b281f2fff274013e903d010c7e800835d270803cb8b11de0063232c1540233c59c3e8085f2dac4f3201303f73b51343e803e903e90350c0234cffe80145468017e903e9014d6f1c1551cdb5c150804d50500f214013e809633c58073c5b33248b232c044bd003d0032c0327e401c1d3232c0b281f2fff274140371c1472c7cb8b0c2be80146a2860822625a020822625a004ad8228608239387028062849f8c3c975c2c070c008e014151600ae8210178d4519c8cb1f19cb3f5007fa0222cf165006cf1625fa025003cf16c95005cc2391729171e25008a813a08208e4e1c0aa008208989680a0a014bcf2e2c504c98040fb001023c85004fa0258cf1601cf16ccc9ed5400705279a018a182107362d09cc8cb1f5230cb3f58fa025007cf165007cf16c9718010c8cb0524cf165006fa0215cb6a14ccc971fb0010241023000e10491038375f040076c200b08e218210d53276db708010c8cb055008cf165004fa0216cb6a12cb1f12cb3fc972fb0093356c21e203c85004fa0258cf1601cf16ccc9ed5400db3b51343e803e903e90350c01f4cffe803e900c145468549271c17cb8b049f0bffcb8b0a0823938702a8005a805af3cb8b0e0841ef765f7b232c7c572cfd400fe8088b3c58073c5b25c60063232c14933c59c3e80b2dab33260103ec01004f214013e809633c58073c5b3327b55200083200835c87b51343e803e903e90350c0134c7e08405e3514654882ea0841ef765f784ee84ac7cb8b174cfcc7e800c04e81408f214013e809633c58073c5b3327b5520", + account: "0:3e5ffca8ddfcf36c36c9ff46f31562aab51b9914845ad6c26cbde649d58a5588", + method: IsStable, + wantTypeHint: "IsStable_DedustResult", + want: IsStable_DedustResult{ + IsStable: false, + }, + }, + { + name: "Dedust get_trade_fee", + code: "b5ee9c7201025f0100162b000114ff00f4a413f4bcf2c80b01020162020302012004050201203f400201cf060702012008090499dc07434c0fe900c00407e185c6c3c900835c2c7c82084187b950b6ea3e98c36cf200835c874cfc040753e803e9034c03e803d01154800f534504c01b6cf0411814136cf380820841cab2a2aaea5c0d100e0201621f200005ba854801fbba5263134ed44f86352426f02f862f86401d30f01f866d401f86901d3008e25eda2edfb20d70b0320c0009430d603018e12c0019881010cd71801db31e030f2c1056d6de2d8018e25eda2edfb20d70b0320c0009430d603018e12c0019881010cd71801db31e030f2c1056d6de2d843306f036f233202d102d307d307d180a01c25c6f02f86c0182300de0b6b3a7640000801258a1710192a70ae4a80182300de0b6b3a7640000801258a1710192a70ae4a86f02f86d71c858cf16f8426f22c858cf1613cb0701cf17c976c8cb0412ccccc97001f90074c8cb0212ca07cbffc9d0010b01ca71c858cf16f8426f22c858cf1613cb0701cf17c976c8cb0412ccccc97001f90074c8cb0212ca07cbffc9d06f02f86e6df86ff84ff84c6f11f84c6f10c8cb07cb07f84e6f10cf16f84e6f11cf168b02cf16f400c9f86b70f86a70206f02f86770206f02f8680c00c8f84d6f11f84d6f10f84bf849f8426f11f843c8ccccccccf84401cb0ff84601cb0ff84afa02f8476f10fa02f8476f11fa02f8486f10fa02f8486f11fa02cb7fcb7fc9ed54821005f5e10070fb02830670588010c8cb0501cf1601fa02806bcf40c901fb0000caf8426f112176c8cb0412ccccc97001f90074c8cb0212ca07cbffc9d001d0fa40d30701018e25eda2edfb20d70b0320c0009430d603018e12c0019881010cd71801db31e030f2c1056d6de2d801d1f8415004c705f8426f105003c70512b001c001b0f2e10804d08fd030db3c8020d721d33f0101d48e25eda2edfb20d70b0320c0009430d603018e12c0019881010cd71801db31e030f2c1056d6de2d801fa00fa40d300fa00f404552003d430413007db3c3010365502db3ce0208210b56b9598ba9330f08be02082107bdd97deba5c0f101101f6f8426f112176c8cb0412ccccc97001f90074c8cb0212ca07cbffc9d001d0fa40d3070101d3008e25eda2edfb20d70b0320c0009430d603018e12c0019881010cd71801db31e030f2c1056d6de2d8018e25eda2edfb20d70b0320c0009430d603018e12c0019881010cd71801db31e030f2c1056d6de2d843306f0312024e8f2333f82c18a15470655376ed44ed45ed478aed67ed65ed64757fed118aed41edf101f2ffdb09131401e08e8330db3ce02082106e24728dba9330f095e02082100b429f52ba9330f090e0322182106873c90cba9331f092e02182100a420458ba9331f093e0218101bcba9331f088e0218210c015297fba9331f08ae0218210abb46b3dba9331f091e001821026c63ab7ba92f094e030840ff2f01c003201d1f8415004c705f8426f105003c70512b001c002b0f2e10902dc88ed55219993d0307f925b70f2ffda11926d32dff8078110daa070f83617a170f8430310474760c88210ad4eb6f501cb1f500501cb3f13cc01fa0201cf16f4000171c858cf16f8426f22c858cf1613cb0701cf17c976c8cb0412ccccc97001f90074c8cb0212ca07cbffc9d04130151601d8f8456f23f8476f22f84e6f22f84d6f222bd0d31f0101fa40fa40f404f404d156122dc70556132dc705b15210f2e905f84ac2005210f2e92656122dc705933853989b373a547a78102c10891067e2f846561301812710a984208107d0812710a984561458a10511100504509817000000348018c8cb0501cf1601fa02806bcf4001cf17c901fb00f80ff2f002fe058ee5513382300de0b6b3a7640000a984502382300de0b6b3a7640000a984511382300de0b6b3a7640000a9845c5c82300de0b6b3a7640000a984512082300de0b6b3a7640000a984511082300de0b6b3a7640000a984a082300de0b6b3a7640000a9845aa0511297303321a012a984e222c20003f823b913b05260f2d931481801fe521dbe15f2e930f8486f2252fac7059b53d2a117a05154a15062a09f53d2a116a05164a15082a007505504e253416f02f86750076f02f868f84d6f11f84d6f10f84bf849f8426f11f843c8ccccccccf84401cb0ff84601cb0ff84afa02f8476f10fa02f8476f11fa02f8486f10fa02f8486f11fa02cb7fcb7fc9ed542c51501902941058104d4c135420181ec85008cf165006cf165005fa025005fa02c9c882109c610de301cb1f5003cf1601cf165003fa0201fa02ccc872cf418066cf4001cf17c971fb0813a1296ee30f1a1b00a632333720d70b01c00091309134e2f807810786a070f83616a170f843104646135057c88210ad4eb6f501cb1f500501cb3f13cc01fa0201cf16f40040038018c8cb0501cf1601fa02806bcf4001cf17c901fb0000dc31323306d0fa40d300fa00f4045520103404d15502f807810a92a070f8361aa170f843108a0706105a1049103949b0c8821072aca8aa01cb1f500901cb3f17cc5005cf165003fa0201cf1650235023cb0001fa02f400ccc9028018c8cb0501cf1601fa02806acf40f400c901fb0002e8db3c8020d721d33f0101fa00fa40fa40303020f849f849c870fa025003cf16f828cf1612ccc976c8cb0412ccccc97001f90074c8cb0212ca07cbffc9d0f84101c705f2e101f8476f22f84a546250a984f84a546260a9845131a15123a1f84a26a1f86a53206f02f867f82c18a1245433240350a85c1d01fec882103aa870a601cb1f5006cf165005fa025003fa0201fa0201fa0201fa02c872cf418066cf4001cf17c971fb0813a1813b5670f836a1f84e6f2270f8436d28542a740bc88210ad4eb6f501cb1f500501cb3f13cc01fa0201cf16f40023ab00103841088018c8cb0501cf1601fa02806bcf4001cf17c901fb0020ab00a1701e00f8f843103540456dc88210ad4eb6f501cb1f500501cb3f13cc01fa0201cf16f40040038018c8cb0501cf1601fa02806bcf4001cf17c901fb00f84d6f11f84d6f10f84bf849f8426f11f843c8ccccccccf84401cb0ff84601cb0ff84afa02f8476f10fa02f8476f11fa02f8486f10fa02f8486f11fa02cb7fcb7fc9ed5402016a21220201482c2d01f14db3cf841f8426f10c705f2e1038020d721d33f0101d30f0101d4d132f84421be915be0f864f84d6f11f84d6f10f84bf849f8426f11f843c8ccccccccf84401cb0ff84601cb0ff84afa02f8476f10fa02f8476f11fa02f8486f10fa02f8486f11fa02cb7fcb7fc9ed5420fb04d0ed1eed538200a854ed43d885c020120232402c936cf1d36cf200835c874cfc04074c3c04c4c4830bfc86049c42e6c3cb845fe19be135bc47e135bc43e12fe127e109bc47e10f2333333333e110072c3fe118072c3fe12be80be11dbc43e80be11dbc47e80be121bc43e80be121bc47e80b2dff2dff27b55205c3d03f736cf200835c874cfc040753e903e8035007423897b68bb7ec835c2c0c83000250c3580c06384b0006620404335c60076cc780c3cb0415b5b78b6007e8023897b68bb7ec835c2c0c83000250c3580c06384b0006620404335c60076cc780c3cb0415b5b78b6007e8034413d013d01344411440d0408cccd01b6cf16e05c25260152f8426f112176c8cb0412ccccc97001f90074c8cb0212ca07cbffc9d001d0fa40d3070101d401d0fa402702c8f82c18a1f8476f22f84a54221354201a16db3c5218b98e3e10385f08f8078108cda070f836a170f8434304c88210e1a36cd401cb1f500301cb3fccf400c9f841128018c8cb0501cf1601fa02806acf40f400c901fb00e03a5171a05137a054761754763c5d2800e4d3008e25eda2edfb20d70b0320c0009430d603018e12c0019881010cd71801db31e030f2c1056d6de2d8018e25eda2edfb20d70b0320c0009430d603018e12c0019881010cd71801db31e030f2c1056d6de2d843306f0301d102d1f8415005c705f8426f105004c70513b001c003b0f2e11001fac88210b544f4a401cb1f5006cf165004fa0258fa0201fa0201fa0201fa02c872cf418066cf4001cf17c971fb0813a15a6f02f8675137a0f86af84d6f11f84d6f10f84bf849f8426f11f843c8ccccccccf84401cb0ff84601cb0ff84afa02f8476f10fa02f8476f11fa02f8486f10fa02f8486f11fa02cb7fcb7fc9ed542902fe81564470f8365230a12073a9d60066a15141a170f84329034159c88210aae7925601cb1f500401cb3f12cc01fa0201fa02c9f841128018c8cb0501cf1601fa02806acf40f400c901fb0022f849f849c870fa025003cf16f828cf1612ccc976c8cb0412ccccc97003820afaf080a113b609216ee301f807810d4ba070f836152a2b005421f90082f09b21e88fe793c97b7d859ca9f088251118e808eb194a1172f81221292555f549ba923070de009ca170f8285e344763c88210178d451901cb1f500601cb3f5004fa0258cf1601cf1601fa02f400c9533101f90074c8cb0212ca07cbffc9d04430738018c8cb0558cf1658fa02cb6accf400c901fb000201202e2f0201483b3c02012030310201203637048b36cf1cf6cf200835c874cfc0407e803e903d013e803e903d01347e121bc8be139bc894e4eed4dceeec3cb84942e0827270e0286ac00a708025c40e440a0dd7c0f8c348b080205c3d323303f336cf1e36cf200835c874cfc04063897b68bb7ec835c2c0c83000250c3580c06384b0006620404335c60076cc780c3cb0415b5b78b6007e90344cbe13dba622c0a2c09bc0be1c277e13f43e903e90165bc0be1c3478be115bc8ccbe141bc89490f1c164c4d7c0e756b1c1644c654cbcb048007880789bc0be1c205c3d35008471f8432c544c4350cbc88210ad4eb6f501cb1f500501cb3f13cc01fa0201cf16f400470052808018c8cb0501cf1601fa02806bcf4001cf17c901fb005006a105103401948e3e71f843103854443901c88210ad4eb6f501cb1f500501cb3f13cc01fa0201cf16f400103540068018c8cb0501cf1601fa02806bcf4001cf17c901fb0002a1945f046c22e26f02f868340088f84d6f11f84d6f10f84bf849f8426f11f843c8ccccccccf84401cb0ff84601cb0ff84afa02f8476f10fa02f8476f11fa02f8486f10fa02f8486f11fa02cb7fcb7fc9ed5400ecf8506f22c858cf1601cf16c9f86ff84ff84c6f11f84c6f10c8cb07cb07f84e6f10cf16f84e6f11cf168b02cf16f400c9f86bf84d6f11f84d6f10f84bf849f8426f11f843c8ccccccccf84401cb0ff84601cb0ff84afa02f8476f10fa02f8476f11fa02f8486f10fa02f8486f11fa02cb7fcb7fc9ed5403f336cf3e13dba622c0a2c09bc0be1c277e13f43e903e90165bc0be1c34789df6cf200835c874cfc04063897b68bb7ec835c2c0c83000250c3580c06384b0006620404335c60076cc780c3cb0415b5b78b600747e115bc8ccbe141bc8a2c0949531c164c517c1270c56b1c1644c650c3cb04838b8a2c0948431c1605c3d3803e936cf3e13dba622c0a2c09bc0be1c277e13f43e903e90165bc0be1c3478a00835c874cfc04074dff4dffd01344c0cbe131bc880608c03782dace9d90000200496285c4064a9c2b92a00608c03782dace9d90000200496285c4064a9c2b92a3e141bc8be1044b1c1654c1408ea6138c3805bc0be1b605c393a005ef2d1218040026dc88210ad83913f01cb1f5801cb3ff40070588018c8cb0501cf1601fa02806bcf4001cf17c901fb000022f841c705944003a984956c22f2c122e20100a4f8506f22c858cf1601cf16c9f86ff84d6f11f84d6f10f84bf849f8426f11f843c8ccccccccf84401cb0ff84601cb0ff84afa02f8476f10fa02f8476f11fa02f8486f10fa02f8486f11fa02cb7fcb7fc9ed54025f36cf1e76cf200835c874cffe90344c6084017d78401c3ec0a0c19c1620043232c14073c5807e80a01af3d032407ec0205c3d02f736cf200835c874cfc0407480347e11dbc89b7e0b2049259c3e0da81ce041ab9c3e0e2814982fbcb841c0e68cbe115bc8db049bc080b7be1295409b485ba44c66cc1bc8b21633c58073c5b278b220842f7752550072c7d4014072cfd400fe80807e80807e80bd00327e0b3e01e04199a81c3e0da804a85c3e1050cc205c3e0068f8410174c85801cb07f8426f22c858cf1613cb0701cf17c976c8cb0412ccccc97001f90074c8cb0212ca07cbffc9d0c705f2e128002a8018c8cb0501cf1601fa02806acf40f400c901fb0002012041420201204c4d02014843440201204a4b0201484546027fb118b6cf3e115bc8fe11dbc8be135bc889f0803cb84914e171c154e571c16c7cb848d46171c1644d254cc40990c038be1194982049c42a611459a8505100c1e05c470110a9b3db3cf8476f225c0146a8a2db3cf84f6e988b028b026f02f8709df84fd0fa40fa40596f02f870d1e2f8506f225c01e4058ee5513382300de0b6b3a7640000a984502382300de0b6b3a7640000a984511382300de0b6b3a7640000a9845c5c82300de0b6b3a7640000a984512082300de0b6b3a7640000a984511082300de0b6b3a7640000a984a082300de0b6b3a7640000a9845aa0511297303321a012a984e2014801d48ed8eda2edfb7094208407b98ec85471315c82300de0b6b3a7640000a984512082300de0b6b3a7640000a984511082300de0b6b3a7640000a984a082300de0b6b3a7640000a9845240a182300de0b6b3a76400005364e8135f03d8a10182300de0b6b3a764000001a9844900962082300de0b6b3a7640000a984a7032182300de0b6b3a7640000a984531182300de0b6b3a7640000a9845882300de0b6b3a7640000a984a0a98413a05203a1b60bc10295135f03db31e0a4010db4321b679f08905c0113b7419b679f08d024e2105c0201204e4f0201485a5b02015850510201585859020120525302037b205455015cab79db3cf849f849c870fa025003cf16f828cf1612ccc976c8cb0412ccccc97001f90074c8cb0212ca07cbffc9d05c0112a92bdb3cf8456f235b5c02efb5bb678dae191960f1a0fb43a3a38399d1797b0b834973232b23ab9ba1734b797bb1917b837b7b63997c19e2df051f48862de0100811c2a43001f604184132500af250061c540df1803560603c86203164607519e2ce100813b007e4342a460df02b1960e0349c860631725edacae8c2c8c2e8c319e2d9305c56010fb03b679f098de4505c01c682f070e5d7b6a29b392f85076fe15ca2f2053c56c2338728c4e33c9e8ddb1ee827cc588307f41770c8cb078b1398cf16c982f0ee80fd2f1e03480e2282363596ee752d7bb27f50776b95086a0279189675923e588307f41770c8cb078b24c508cf16c957007482f0b76a7ca153c24671658335bbd08946350ffc621fa1c516e7123095d4ffd5c581588307f417f84a7f8b0270c8cb0714f400c9f849103410230111acd6ed9e7c26b791405c0111ac4c6d9e7c243791405c0115b36b36cf3e115bc8db04a05c0235b11176cf0870800870802c3cb8493e11dbc8be12905100f6cf0c205c5d01f4ed44d0d421d0fa40d307010131d3008e25eda2edfb20d70b0320c0009430d603018e12c0019881010cd71801db31e030f2c1056d6de2d8018e25eda2edfb20d70b0320c0009430d603018e12c0019881010cd71801db31e030f2c1056d6de2d843306f0331f86502f863d4596f02f862d401f869d421f86b01d05e007224c0008e106c22328103e8820182b85323b609b6098e1f547032a9845220b608543234a984b608546425a984546444a98412b6084130e24300008cd307d307596f02f86cfa40fa40596f02f86efa4031f40401f86fd1d30f01f864d30f01f866fa0001f86afa00fa00596f02f867fa00fa00596f02f868d37fd37f596f02f86dd1", + data: "b5ee9c72010219010004c600048b0007000a702b2c87f54103772209721a54797c62d79eab68c84647239ee3140257f3c6ca97300c097ce7bc90715b34b9f100000000000c097ce7bc90715b34b9f10000000008010203040089800be0ac9f6bec08f07b6ae0639c39ecd1511a9a9adb4dbc9b6445697241adfb000040100b113a994b5024a16719f69139328eb759596c38a25f59028b146fecdc3621dfe80114ff00f4a413f4bcf2c80b050114ff00f4a413f4bcf2c80b0800cd0000801b5c2a74e9b12977864e903319ac4dc9ebbe94d35a5f4ad9d01f84c896ae11a4100062aa38bbb545d1f6b80cf01e6e4e20f65072b63d95167cbba735d1d2dae3b576002f82b27dafb023c1edab818e70e7b345446a6a6b6d36f26d9115a5c906b7ec0020020270060700f5de03a0e9ae43f4806041da89da8bda8f1c32b7020140e0b1002191960a039e2c03f40500d79e819203f601dacfdacbdac8e2ffda231c7bda89a1f481a60ea2658e0be5c207081e09a63e030421367547f5742be5e807a67e0261a9a61e0203a843f60843a1da3ddaa6208c208b0401ca4dda87b1da83dbe203e5ff0009bf2932f83c020162090a0202cc0b0c001ba0f605da89a1f401f481f481a8610201d40d0e0201480f1000c30831c02497c138007434c0c05c6c2544d7c0fc02f83e903e900c7e800c5c75c87e800c7e800c1cea6d0000b4c7e08403e29fa954882ea54c4d167c0238208405e3514654882ea58c511100fc02780d60841657c1ef2ea4d67c02b817c12103fcbc2000113e910c1c2ebcb853600201201112020120171801f100f4cffe803e90087c007b51343e803e903e90350c144da8548ab1c17cb8b04a30bffcb8b0950d109c150804d50500f214013e809633c58073c5b33248b232c044bd003d0032c032483e401c1d3232c0b281f2fff274013e903d010c7e800835d270803cb8b11de0063232c1540233c59c3e8085f2dac4f3201303f73b51343e803e903e90350c0234cffe80145468017e903e9014d6f1c1551cdb5c150804d50500f214013e809633c58073c5b33248b232c044bd003d0032c0327e401c1d3232c0b281f2fff274140371c1472c7cb8b0c2be80146a2860822625a020822625a004ad8228608239387028062849f8c3c975c2c070c008e014151600ae8210178d4519c8cb1f19cb3f5007fa0222cf165006cf1625fa025003cf16c95005cc2391729171e25008a813a08208e4e1c0aa008208989680a0a014bcf2e2c504c98040fb001023c85004fa0258cf1601cf16ccc9ed5400705279a018a182107362d09cc8cb1f5230cb3f58fa025007cf165007cf16c9718010c8cb0524cf165006fa0215cb6a14ccc971fb0010241023000e10491038375f040076c200b08e218210d53276db708010c8cb055008cf165004fa0216cb6a12cb1f12cb3fc972fb0093356c21e203c85004fa0258cf1601cf16ccc9ed5400db3b51343e803e903e90350c01f4cffe803e900c145468549271c17cb8b049f0bffcb8b0a0823938702a8005a805af3cb8b0e0841ef765f7b232c7c572cfd400fe8088b3c58073c5b25c60063232c14933c59c3e80b2dab33260103ec01004f214013e809633c58073c5b3327b55200083200835c87b51343e803e903e90350c0134c7e08405e3514654882ea0841ef765f784ee84ac7cb8b174cfcc7e800c04e81408f214013e809633c58073c5b3327b5520", + account: "0:3e5ffca8ddfcf36c36c9ff46f31562aab51b9914845ad6c26cbde649d58a5588", + method: GetTradeFee, + wantTypeHint: "GetTradeFee_DedustResult", + want: GetTradeFee_DedustResult{ + TradeFeeNumerator: tlb.Int257FromInt64(10), + TradeFeeDenominator: tlb.Int257FromInt64(10000), + }, + }, } for _, tt := range tests { @@ -611,6 +634,58 @@ func TestWhalesNominators(t *testing.T) { } +func TestDedustFactory(t *testing.T) { + mainnetConfig, _ := boc.DeserializeBocBase64(mainnetConfig) + codeHex := "b5ee9c7201025a01000e85000114ff00f4a413f4bcf2c80b0102016202030201201718020120040502012006070201200f1002015808090201620c0d015fb2e5f6cf1c721633c5be109bc8b21633c584f2c1c073c5f25db232c104b333325c007e401d3232c084b281f2fff27420530201480a0b0110a9a8db3cf84af84b530110aac2db3cf8466f2253010dacc86d9e7c24c0530241ad00ed9e3781903791ae63821079708361004a99893781bfc9af81b871186d9e40530e0122db3c7001f90074c8cb0212ca07cbffc9d0580201201112020120131401adb5b3bb678de0640de46b98e0841e5c20d84012a6624de06ff26be06e1c460e590b0de4604e360a0079600b19e2c039e2df084de4590b19e2c27960e039e2f92ed91960825999992e003f200e991960425940f97ff93a10530111b5b69b679f086de470530111b6b07b679f08ede4505302012015160161b33b36cf1d32160072c1fe109bc8b21633c584f2c1c073c5f25db232c104b333325c007e401d3232c084b281f2fff27420530219b242f6cf3e114076cf3cb8412053380201cf191a0005bd42a401f1dc07434c0fe900c00407e185c6c0871c02c7c900835c2c7c8208432985553aea50c0c7c22b808208437b981012ea517c0fc22f808208405b2dff0aea517c0fc23380820842f0fc9bdaea50c0c7c23780820840873f80aeea4cc3c23b808208432695d4b6ea4cc3c23f808208409759a446ea50c0c7c24380821b0201621d1e01fe82108a518d0dba943031f091e0208210df4a27aaba943031f092e02082109f3f0937ba945f03f093e0208210b9d29997ba9330f094e02082101be6df93ba9330f095e0208210e505d21aba943031f097e020820885f5a3ba9330f098e0208210a3e45df1ba943031f096e020821097d51f2fba9330f099e02082107c40ac871c0062ba9330f09ae020821053e252aeba9330f09be020821099a84311ba943031f09ce08210f04ec526ba92f09de05b840ff2f00201581f200201203031020120212202012028290201202324020120262701cb11515bc0c81bc8d731c1083cb841b080254cc49bc0dfe4d7c0dc38a444b79cb2161bc8c09c6c1400f2c01633c58073c5be109bc8b21633c584f2c1c073c5f25db232c104b333327e119bc8a0103e113e123214024072c3c6330572c1c572c1c411840d5058202501f33e1148f5c2c0f6cf3cb841011c721633c5be109bc8b21633c584f2c1c073c5f25db232c104b3333260103e1132140173c58411440d515832208426cea8fe8072c7d4014072cfc4f3004072c3f30073c5f25c14c8007e401d3232c084b281f2fff2740408dce0063232c15633c5963e80b2dab33d0032407ec020380088c882109b3aa3fa01cb1f500501cb3f13cc0101cb0fcc01cf17c970533001f90074c8cb0212ca07cbffc9d010341023738018c8cb0558cf1658fa02cb6accf400c901fb00025736cf3e107e10dbc431c17cb840200835c874cfc0407e90344c7e10dbc43e08e080a8c028049bc0fe18f6cf205352024b36cf3e10dbc47e104071c17cb8407e08fe10dbc4afbcb840be10dbc462c09c1bc0fe18f6cf2053520201202a2b0201202e2f023536cf3e107e10dbc431c17cb8403e10dbc422c09c1bc0fe18f6cf205352043f36cf1c76cf200835c874cfc04074c0c04074c3c04075344cfe1140f6cf3e196053512c2d0040532374f40e6fa193d70b0f923070e2a45220baf2e113c85801cb0fcc0274f4430104db3c52018936cf006084017d78402fbcb841e00835c874cfc04063897b68bb7ec835c2c0c83000250c3580c06384b0006620404335c60076cc780c3cb0415b5b78b6007462c204bc226053025f36cf1db6cf006084017d78402fbcb841e00835c874cfc0407e903e9034407e91321c4072c0c4b2c1f2fff274167c226053510201203233020120454602012034350201203d3e02012036370201203b3c04b936cf1cb6cf200835c874cfc04063897b68bb7ec835c2c0c83000250c3580c06384b0006620404335c60076cc780c3cb0415b5b78b600744835c2c0fe114076cf3cb841140ce010013220406f0072c7d400c072cfc04072c3f3325c00a05351383902a536cf3e107e10dbc431c17cb840200835c874cfc04063897b68bb7ec835c2c0c83000250c3580c06384b0006620404335c60076cc780c3cb0415b5b78b60074601000b220842759520ac072c7c04072cfdc00a0533a002a0174f40e6fa19820d70b0f01d74c7f94306d6d70e2008271c858cf16f8426f22c858cf1613cb0701cf17c976c8cb0412ccccc97001f90074c8cb0212ca07cbffc9d0128018c8cb0501cf1601fa02806acf40f400c901fb00008471c858cf16f8426f22c858cf1613cb0701cf17c976c8cb0412ccccc97001f90074c8cb0212ca07cbffc9d0128018c8cb0501cf1601fa02806bcf4001cf17c901fb00027136cf3e107e10dbc431c17cb840200835c874cfc04074c3c04075344cbe126914842ebcb844c87ec13e1a76cf343b47bb54e0802a153b50f6205352016136cf3e107e10dbc431c17cb84020840ee6b2801c3ec0a0c19c3e10dbc420043232c14073c5807e80a01af3d032407ec020530201203f40020120434402e536cf3e107e10dbc431c17cb840200835c874cfc04074c1c0407e9034405d32160072c1fe109bc8b21633c584f2c1c073c5f25db232c104b333327e0b2049b9dc3e0da805285c3e113e12be12f21401b3c58411904c0572208426cea8fe8072c7d4014072cfc4f3004072c3f30073c5f254cc60534102d336cf3e107e10dbc431c17cb840200835c874cfc04074c1c0407e90347e0b2049019c3e0da80528409c0132208412396a574072c7d60072cfc073c5805d32160072c1fe109bc8b21633c584f2c1c073c5f25db232c104b333325c007e401d3232c084b281f2fff27404a05342004a01f90074c8cb0212ca07cbffc9d04430738018c8cb0558cf1658fa02cb6accf400c901fb00002c8018c8cb0501cf1601fa02806bcf4001cf17c901fb00034d36cf1c76cf200835c874cfc04074c3c04075344cbe119bc42914842ebcb844c05bc0be19b6cf20535152025736cf3e107e10dbc431c17cb840200835c874cfc04074c3c04075344cbe12a914842ebcb844fe1abe1af6cf20535202012047480201484f50020120494a0201204b4c02f736cf1cb6cf006084017d78402fbcb841e00835c874cfc04074c1c0407460103e12be12c4093220406f0072c7d400c072cfc04072c3f3325c009d32160072c1fe109bc8b21633c584f2c1c073c5f25db232c104b333325c007e401d3232c084b281f2fff27404a0063232c14073c5807e80a01ab3d03d0032407ec020535101e536cf00608403b9aca02fbcb841e00835c874cfc04063897b68bb7ec835c2c0c83000250c3580c06384b0006620404335c60076cc780c3cb0415b5b78b60063897b68bb7ec835c2c0c83000250c3580c06384b0006620404335c60076cc780c3cb0415b5b78b600745c1c15040c44e0067c22205302eb36cf1d76cf00608403b9aca02fbcb841e00835c874cfc04063897b68bb7ec835c2c0c83000250c3580c06384b0006620404335c60076cc780c3cb0415b5b78b60074c1e3897b68bb7ec835c2c0c83000250c3580c06384b0006620404335c60076cc780c3cb0415b5b78b60074c1f45fd54c1d7c2220535103ed36cf1cb6cf006084017d78402fbcb841e00835c874cfc04074c023897b68bb7ec835c2c0c83000250c3580c06384b0006620404335c60076cc780c3cb0415b5b78b60063897b68bb7ec835c2c0c83000250c3580c06384b0006620404335c60076cc780c3cb0415b5b78b610cc1bc0c0747e119bc880a053514d01d6206f235cc70420f2e106c2009533126f037f935f0370e2305033804003c88101bc01cb1f500301cb3f0101cb0fccc9700372c8586f230271b05003cb0058cf1601cf16f8426f22c858cf1613cb0701cf17c976c8cb0412ccccc97001f90074c8cb0212ca07cbffc9d041304e002a8018c8cb0501cf1601fa02806acf40f400c901fb00035136cf1c76cf200835c874cfc04074c3c04075344cbe11dbc88c082904aebcb844e9005bc0be19f6cf20535152045536cf36cf0276cf08f1c17cb84201881bc8d731c1083cb841b080254cc49bc0dfe4d7c0dc38a4840d3785e0535455560068f8410174c85801cb07f8426f22c858cf1613cb0701cf17c976c8cb0412ccccc97001f90074c8cb0212ca07cbffc9d0c705f2e1280090f8436f23f84bf848f845f8476f11f8466f11c8f8466f1001cb0fccf8476f1001cb0fccf400ccc9f844c85006cf165004cf165801cb1ff84901cb0f13ccccf84a01cb0ff400c9ed5400bced44d0fa40fa40d31f0143306f03f863d30f01f869d401f864f828f8446f02f862d401d0d30f0101d4596f02f866d30f0101d4596f02f867f40401f865d401f86821d749c2009b01d30f01f86af40401f86b9770f86a6df86b01e201d1d101d48020d721d33f0101d4fa40d3008e25eda2edfb20d70b0320c0009430d603018e12c0019881010cd71801db31e030f2c1056d6de2d8018e25eda2edfb20d70b0320c0009430d603018e12c0019881010cd71801db31e030f2c1056d6de2d843306f0301d401d0fa00fa005700caf8426f112176c8cb0412ccccc97001f90074c8cb0212ca07cbffc9d001d0fa40d30701018e25eda2edfb20d70b0320c0009430d603018e12c0019881010cd71801db31e030f2c1056d6de2d801d1f8415004c705f8426f105003c70512b001c001b0f2e10802fedb3c207001f90074c8cb0212ca07cbffc9d0c85006fa025004fa0258fa0214f40015f400f8476f22820898968081050870f836a071f8442a45345006c882109b3aa3fa01cb1f500501cb3f13cc0101cb0fcc01cf17c941065363738018c8cb0558cf1658fa02cb6accf400c901fb0814a015a1f82cf80781095fa070f836a0585900688e25eda2edfb20d70b0320c0009430d603018e12c0019881010cd71801db31e030f2c1056d6de2d801fa00fa00d105f404f404d1006073c85003cf16016f230271b05003cb0058cf1601cf16c9c8ccf8426f22c858cf1613cb0701cf17c976c8cb0412ccccc90064a150347004c8821054240fe501cb1f500301cb3f01cf1601fa02c940338018c8cb0501cf1601fa02806acf40f400c901fb00" + dataHex := "b5ee9c7202020116000100003935000003538000380822d413da4b5af0dae31ad627ac26c84e12c2d0efaeb8b3b90b0b65136740000000000028000e0001000200030114ff00f4a413f4bcf2c80b0004040900080001c0000700080009000a0114ff00f4a413f4bcf2c80b00190202700005000600f5de03a0e9ae43f4806041da89da8bda8f1c32b7020140e0b1002191960a039e2c03f40500d79e819203f601dacfdacbdac8e2ffda231c7bda89a1f481a60ea2658e0be5c207081e09a63e030421367547f5742be5e807a67e0261a9a61e0203a843f60843a1da3ddaa6208c208b0401ca4dda87b1da83dbe203e5ff0009bf2932f83c0114ff00f4a413f4bcf2c80b000b0114ff00f4a413f4bcf2c80b007a0201ce001600170114ff00f4a413f4bcf2c80b0105020162000c000d020120000e000f020120005800590201cf0010001102012000f500120499dc07434c0fe900c00407e185c6c3c900835c2c7c82084187b950b6ea3e98c36cf200835c874cfc040753e803e9034c03e803d01154800f534504c01b6cf0411814136cf380820841cab2a2aaea00770029002b002a0201620039003a01fbba5263134ed44f86352426f02f862f86401d30f01f866d401f86901d3008e25eda2edfb20d70b0320c0009430d603018e12c0019881010cd71801db31e030f2c1056d6de2d8018e25eda2edfb20d70b0320c0009430d603018e12c0019881010cd71801db31e030f2c1056d6de2d843306f036f233202d102d307d307208001301ded749c20093d31f019170e2f870d15c6f02f86c0182300de0b6b3a7640000801258a1710192a70ae4a80182300de0b6b3a7640000801258a1710192a70ae4a86f02f86d71c858cf16f8426f22c858cf1613cb0701cf17c976c8cb0412ccccc97001f90074c8cb0212ca07cbffc9d001001401ca71c858cf16f8426f22c858cf1613cb0701cf17c976c8cb0412ccccc97001f90074c8cb0212ca07cbffc9d06f02f86e6df86ff84ff84c6f11f84c6f10c8cb07cb07f84e6f10cf16f84e6f11cf168b02cf16f400c9f86b70f86a70206f02f86770206f02f868001500d2f84d6f11f84d6f10f84bf849f8426f11f843c8ccccccccf84401cb0ff84601cb0ff84afa02f8476f10fa02f8476f11fa02f8486f10fa02f8486f11fa02cb7fcb7ff85001cb1fc9ed54821005f5e10070fb02830670588010c8cb0501cf1601fa02806bcf40c901fb0001050000e000a801050000e000180114ff00f4a413f4bcf2c80b00c7020162001a001b020120001c001d020148002600270201d1001e001f02012000f50024020120002000210187db6cf3e117e104071c17cb8407e08fe11afbcb84a600835c874cfc0407e9035344cbe0b2044095c3e0da804e85c00e0063232c14073c5807e80a01ab3d03d0032407ec0200280077d407434c0fe900c00407e185c6c3c900835c2c7c820406f2ea50c0c7c0fb808208412396a576ea4cc3c0ff820843c6624956ea4bc103816e103fcbc20201f200220023026d36cf3e10be104071c17cb840600835c874cfc04074c3c04075344cbe10d4842f3cb849fe18f6cf083ec1343b47bb54e0802a153b50f62000280025028d36cf3e10be104071c17cb840600835c874cfc0407e90344c7e197e08e080a8c0283e19b6cf3e0b20450f5c3e0da8285c3e1084a0043232c14073c5807e80a01af3d032407ec02000280025013dba52631323303f86201f863d30701f86401fa4001f86570f86601d1d1db3c800250034f846c8f842cf16f84301cb0ff84401cb07f845cf16cb1fc9ed540119bb873db3cf842f844f845f84680028010db8190db3cf84380028003aed44d0fa4001f862d30f01f863d30701f864fa4001f865d31f01f866d100caf8426f112176c8cb0412ccccc97001f90074c8cb0212ca07cbffc9d001d0fa40d30701018e25eda2edfb20d70b0320c0009430d603018e12c0019881010cd71801db31e030f2c1056d6de2d801d1f8415004c705f8426f105003c70512b001c001b0f2e10804d08fd030db3c8020d721d33f0101d48e25eda2edfb20d70b0320c0009430d603018e12c0019881010cd71801db31e030f2c1056d6de2d801fa00fa40d300fa00f404552003d430413007db3c3010365502db3ce0208210b56b9598ba9330f08ce02082107bdd97deba007700d0002b002c024e8f2333f82c18a15470655376ed44ed45ed478aed67ed65ed64757fed118aed41edf101f2ffdb09002d002e01fa8e8330db3ce02082106e24728dba9330f096e02082100b429f52ba9330f091e0322182106873c90cba9331f093e02182100a420458ba9331f094e0218101bcba9331f089e0218210c015297fba9331f08be0218210abb46b3dba9331f092e02182107ed7f6ceba9331f097e001821026c63ab7ba92f095e030840ff2f0003602dc88ed55219993d0307f925b70f2ffda11926d32dff8078110daa070f83617a170f8430310474760c88210ad4eb6f501cb1f500501cb3f13cc01fa0201cf16f4000171c858cf16f8426f22c858cf1613cb0701cf17c976c8cb0412ccccc97001f90074c8cb0212ca07cbffc9d0413000e5002f01ecf8456f23f8476f22f84e6f22f84d6f222bd0d31f0101fa40fa40f404f404d156122dc70556132dc705b15210f2e905f84ac2005210f2e926f823f850be5210f2e93256122dc705933853989b373a547a78102c10891067e2f846561301812710a984208107d0812710a984561458a105111005045098003000348018c8cb0501cf1601fa02806bcf4001cf17c901fb00f80ff2f002fe058ee5513382300de0b6b3a7640000a984502382300de0b6b3a7640000a984511382300de0b6b3a7640000a9845c5c82300de0b6b3a7640000a984512082300de0b6b3a7640000a984511082300de0b6b3a7640000a984a082300de0b6b3a7640000a9845aa0511297303321a012a984e222c20003f823b913b05260f2d931006100310170521dbe15f2e930f8486f2252fac7059b53d2a117a05154a15062a09f53d2a116a05164a15082a007505504e253416f02f86750076f02f868003201acf84d6f11f84d6f10f84bf849f8426f11f843c8ccccccccf84401cb0ff84601cb0ff84afa02f8476f10fa02f8476f11fa02f8486f10fa02f8486f11fa02cb7fcb7ff85001cb1fc9ed542c51501058104d4c135420181e00330280c85008cf165006cf165005fa025005fa02c9c882109c610de301cb1f5003cf1601cf165003fa0201fa02ccc872cf418066cf4001cf17c971fb0813a1296ee30f0034003500a632333720d70b01c00091309134e2f807810786a070f83616a170f843104646135057c88210ad4eb6f501cb1f500501cb3f13cc01fa0201cf16f40040038018c8cb0501cf1601fa02806bcf4001cf17c901fb0000dc31323306d0fa40d300fa00f4045520103404d15502f807810a92a070f8361aa170f843108a0706105a1049103949b0c8821072aca8aa01cb1f500901cb3f17cc5005cf165003fa0201cf1650235023cb0001fa02f400ccc9028018c8cb0501cf1601fa02806acf40f400c901fb0002e8db3c8020d721d33f0101fa00fa40fa40303020f849f849c870fa025003cf16f828cf1612ccc976c8cb0412ccccc97001f90074c8cb0212ca07cbffc9d0f84101c705f2e101f8476f22f84a546250a984f84a546260a9845131a15123a1f84a26a1f86a53206f02f867f82c18a1245433240350a80077003701fec882103aa870a601cb1f5006cf165005fa025003fa0201fa0201fa0201fa02c872cf418066cf4001cf17c971fb0813a1813b5670f836a1f84e6f2270f8436d28542a740bc88210ad4eb6f501cb1f500501cb3f13cc01fa0201cf16f40023ab00103841088018c8cb0501cf1601fa02806bcf4001cf17c901fb0020ab00a17000380170f843103540456dc88210ad4eb6f501cb1f500501cb3f13cc01fa0201cf16f40040038018c8cb0501cf1601fa02806bcf4001cf17c901fb00004b020158003b003c02014800450046020120003d003e03f7d6d9e40106b90e99f8080ea7d207d006a00e84712f6d176fd906b85819060004a186b0180c7096000cc4080866b8c00ed98f018796082b6b6f16c00fd004712f6d176fd906b85819060004a186b0180c7096000cc4080866b8c00ed98f018796082b6b6f16c00fd0068827a027a02688822881a0811999a036d9e2dc007700ee004002f55db3cf841f8426f10c705f2e1038020d721d33f0101d30f0101d4d132f84421be915be0f864f84d6f11f84d6f10f84bf849f8426f11f843c8ccccccccf84401cb0ff84601cb0ff84afa02f8476f10fa02f8476f11fa02f8486f10fa02f8486f11fa02cb7fcb7ff85001cb1fc9ed5420fb04d0ed1eed538200a85480077003f02d35db3c74db3c8020d721d33f0101d30f01313120c2ff21812710b9b0f2e117f866f84d6f11f84d6f10f84bf849f8426f11f843c8ccccccccf84401cb0ff84601cb0ff84afa02f8476f10fa02f8476f11fa02f8486f10fa02f8486f11fa02cb7fcb7ff85001cb1fc9ed548007700db0006ed43d802c8f82c18a1f8476f22f84a54221354201a16db3c5218b98e3e10385f08f8078108cda070f836a170f8434304c88210e1a36cd401cb1f500301cb3fccf400c9f841128018c8cb0501cf1601fa02806acf40f400c901fb00e03a5171a05137a054761754763c007800410172c88210b544f4a401cb1f5006cf165004fa0258fa0201fa0201fa0201fa02c872cf418066cf4001cf17c971fb0813a15a6f02f8675137a0f86a004201fcf84d6f11f84d6f10f84bf849f8426f11f843c8ccccccccf84401cb0ff84601cb0ff84afa02f8476f10fa02f8476f11fa02f8486f10fa02f8486f11fa02cb7fcb7ff85001cb1fc9ed5481564470f8365230a12073a9d60066a15141a170f84329034159c88210aae7925601cb1f500401cb3f12cc01fa0201fa02c9f84112004301fa8018c8cb0501cf1601fa02806acf40f400c901fb0022f849f849c870fa025003cf16f828cf1612ccc976c8cb0412ccccc97003820afaf080a113b609216e8e2a21f90082f09b21e88fe793c97b7d859ca9f088251118e808eb194a1172f81221292555f549ba923070dedff807810d4ba070f83615a170f8285e3447630044008cc88210178d451901cb1f500601cb3f5004fa0258cf1601cf1601fa02f400c9533101f90074c8cb0212ca07cbffc9d04430738018c8cb0558cf1658fa02cb6accf400c901fb000201200047004802012000500051048b5db3c73db3c8020d721d33f0101fa00fa40f404fa00fa40f404d1f8486f22f84e6f225393bb5373bbb0f2e1250b8209c9c380a1ab0029c2009710391028375f03e30d22c2008007700db0049004a020120004c004d008471f8432c544c4350cbc88210ad4eb6f501cb1f500501cb3f13cc01fa0201cf16f400470052808018c8cb0501cf1601fa02806bcf4001cf17c901fb005006a105103401948e3e71f843103854443901c88210ad4eb6f501cb1f500501cb3f13cc01fa0201cf16f400103540068018c8cb0501cf1601fa02806bcf4001cf17c901fb0002a1945f046c22e26f02f868004b0092f84d6f11f84d6f10f84bf849f8426f11f843c8ccccccccf84401cb0ff84601cb0ff84afa02f8476f10fa02f8476f11fa02f8486f10fa02f8486f11fa02cb7fcb7ff85001cb1fc9ed5403f336cf1e36cf200835c874cfc04063897b68bb7ec835c2c0c83000250c3580c06384b0006620404335c60076cc780c3cb0415b5b78b6007e90344cbe13dba622c0a2c09bc0be1c677e13f43e903e90165bc0be1c7478be115bc8ccbe145bc89490f1c164c4d7c0e756b1c1644c654cbcb048007880789bc0be1c60007700db004e03f336cf3e13dba622c0a2c09bc0be1c677e13f43e903e90165bc0be1c74789df6cf200835c874cfc04063897b68bb7ec835c2c0c83000250c3580c06384b0006620404335c60076cc780c3cb0415b5b78b600747e115bc8ccbe145bc8a2c0949531c164c517c1270c56b1c1644c650c3cb04838b8a2c0948431c160007700db004f00f6f8516f22c858cf1601cf16c9f86ff84ff84c6f11f84c6f10c8cb07cb07f84e6f10cf16f84e6f11cf168b02cf16f400c9f86bf84d6f11f84d6f10f84bf849f8426f11f843c8ccccccccf84401cb0ff84601cb0ff84afa02f8476f10fa02f8476f11fa02f8486f10fa02f8486f11fa02cb7fcb7ff85001cb1fc9ed54005ef2d1218040026dc88210ad83913f01cb1f5801cb3ff40070588018c8cb0501cf1601fa02806bcf4001cf17c901fb00020120005200530201200056005703e936cf3e13dba622c0a2c09bc0be1c677e13f43e903e90165bc0be1c7478a00835c874cfc04074dff4dffd01344c0cbe131bc880608c03782dace9d90000200496285c4064a9c2b92a00608c03782dace9d90000200496285c4064a9c2b92a3e145bc8be1044b1c1654c1408ea6138c3805bc0be1b60007700540055025f36cf1e76cf200835c874cffe90344c6084017d78401c3ec0a0c19c1620043232c14073c5807e80a01af3d032407ec020007700db0022f841c705944003a984956c22f2c122e20100aef8516f22c858cf1601cf16c9f86ff84d6f11f84d6f10f84bf849f8426f11f843c8ccccccccf84401cb0ff84601cb0ff84afa02f8476f10fa02f8476f11fa02f8486f10fa02f8486f11fa02cb7fcb7ff85001cb1fc9ed5402f736cf200835c874cfc0407480347e11dbc89b7e0b2049259c3e0da81ce041ab9c3e0e2814982fbcb841c0e68cbe115bc8db049bc080b7be1295409b485ba44c66cc1bc8b21633c58073c5b278b220842f7752550072c7d4014072cfd400fe80807e80807e80bd00327e0b3e01e04199a81c3e0da804a85c3e1050cc20007700bd02c936cf1eb6cf200835c874cfc04074c7c04c4c7e1430003cb84cfe1c3e135bc47e135bc43e12fe127e109bc47e10f2333333333e110072c3fe118072c3fe12be80be11dbc43e80be11dbc47e80be121bc43e80be121bc47e80b2dff2dffe140072c7f27b5520007700db020120005a005b02012000650066020148005c005d02012000630064020148005e005f027fb118b6cf3e115bc8fe11dbc8be135bc889f0803cb84914e171c154e571c16c7cb848d46171c1644d254cc40990c038be1194982049c42a611459a8505100c1e0007700600110a9b3db3cf8476f2200770146a8a2db3cf84f6e988b028b026f02f8719df84fd0fa40fa40596f02f871d1e2f8516f22007701e4058ee5513382300de0b6b3a7640000a984502382300de0b6b3a7640000a984511382300de0b6b3a7640000a9845c5c82300de0b6b3a7640000a984512082300de0b6b3a7640000a984511082300de0b6b3a7640000a984a082300de0b6b3a7640000a9845aa0511297303321a012a984e201006101d48ed8eda2edfb7094208407b98ec85471315c82300de0b6b3a7640000a984512082300de0b6b3a7640000a984511082300de0b6b3a7640000a984a082300de0b6b3a7640000a9845240a182300de0b6b3a76400005364e8135f03d8a10182300de0b6b3a764000001a984006200962082300de0b6b3a7640000a984a7032182300de0b6b3a7640000a984531182300de0b6b3a7640000a9845882300de0b6b3a7640000a984a0a98413a05203a1b60bc10295135f03db31e0a4010db4321b679f089000770113b7419b679f08d024e210007702012000670068020148007500760201580069006a02015800710072020120006b006c02037b20006d006e015cab79db3cf849f849c870fa025003cf16f828cf1612ccc976c8cb0412ccccc97001f90074c8cb0212ca07cbffc9d000770112a92bdb3cf8456f235b007702efb5bb678dae191960f1a0fb43a3a38399d1797b0b834973232b23ab9ba1734b797bb1917b837b7b63997c19e2df051f48862de0100811c2a43001f604184132500af250061c540df1803560603c86203164607519e2ce100813b007e4342a460df02b1960e0349c860631725edacae8c2c8c2e8c319e2d9300077006f010fb03b679f098de450007701c682f070e5d7b6a29b392f85076fe15ca2f2053c56c2338728c4e33c9e8ddb1ee827cc588307f41770c8cb078b1398cf16c982f0ee80fd2f1e03480e2282363596ee752d7bb27f50776b95086a0279189675923e588307f41770c8cb078b24c508cf16c90070007482f0b76a7ca153c24671658335bbd08946350ffc621fa1c516e7123095d4ffd5c581588307f417f84a7f8b0270c8cb0714f400c9f849103410230111acd6ed9e7c26b7914000770203786000730074010fb31b679f090de4500077010bb3bb679f0a1000770115b36b36cf3e115bc8db04a000770235b11176cf0870800870802c3cb8493e11dbc8be12905100f6cf0c200077007801f4ed44d0d421d0fa40d307010131d3008e25eda2edfb20d70b0320c0009430d603018e12c0019881010cd71801db31e030f2c1056d6de2d8018e25eda2edfb20d70b0320c0009430d603018e12c0019881010cd71801db31e030f2c1056d6de2d843306f0331f86502f863d4596f02f862d401f869d421f86b01d00079007224c0008e106c22328103e8820182b85323b609b6098e1f547032a9845220b608543234a984b608546425a984546444a98412b6084130e2430000a8d307d307596f02f86cfa40fa40596f02f86efa4031f40401f86fd1d30f01f864d30f01f866fa0001f86afa00fa00596f02f867fa00fa00596f02f868d37fd37f596f02f86d20d749c20093d31f019170e2f870d1020162007b007c020120007d007e020120009a009b0201d1007f008001f9bf2931aadf6a27c3189b7817c31387c33381037817c3280ea18687d2000fc3269804712f6d176fd906b85819060004a186b0180c7096000cc4080866b8c00ed98f018796082b6b6f16c00c712f6d176fd906b85819060004a186b0180c7096000cc4080866b8c00ed98f018796082b6b6f16c2198378198fc357d0000c009900f3d807434c0fe903e900c7e801c75c87e800c7e800c1cea6d001bc014011be3161be3005be3005be33e187e105bc41c6c24bc19f80835c2c7c8208426cea8feaea456f8082084150903f96ea4cc3c1a380820842ab9e495aea4cc3c1a780820843868db352ea4cc3c1ab82084059b3b7baea4bc1af80c2103fcbc202016a0081008202015800830084020148008b008c020120008500860201200088008901bf3b513435007e18fe9035165bc0be18be90007e193e803e80165bc0be197480007e19be80007e19f500743d01007e1a3d01007e1a74c023897b68bb7ec835c2c0c83000250c3580c06384b0006620404335c60076cc780c3cb0415b5b78b60060008700a53e129bc8c09c6c3e127e12323d003d0032c00073c58073c5be12dbc43e80be12dbc47e80b27e119c6c3e109bc47e10f2333e109bc433c5b33e1133c5be115bc43e80be115bc47e80b2c03e11fe80b3327b552000728e25eda2edfb20d70b0320c0009430d603018e12c0019881010cd71801db31e030f2c1056d6de2d843306f03f86afa00fa00596f02f86bd1d101e93e129bc8ccbe115bc89c3e199c081bc0be197c197e09dbc420827270e03e105bc4e8285c3e10d512054a3220841ac2de1fc072c7d4010072cfc4b3007e80bd0032486ac0015c721633c5be109bc8b21633c584f2c1c073c5f25db232c104b333325c007e401d3232c084b281f2fff274040d105420008a00c33c193e129cb2161bc8c09c6c1400f2c01633c58073c5be109bc8b21633c584f2c1c073c5f25db232c104b333325c007e401d3232c084b281f2fff2743e105bc44071c1644c38600835c874c7c060842d5ae5662ebe11ac244c3874cfc04c5b7c19a001fe8018c8cb0501cf1601fa02806acf40f400c901fb0070f84310364005c882106b0b787f01cb1f500401cb3f12cc01fa02f400c903ab000171c858cf16f8426f22c858cf1613cb0701cf17c976c8cb0412ccccc97001f90074c8cb0212ca07cbffc9d010238018c8cb0501cf1601fa02806acf40f400c901fb008100a270f84400f3020120008d008e0201200095009603f53c193e105bc47e109bc431c17cb840e00835c874cfc04063897b68bb7ec835c2c0c83000250c3580c06384b0006620404335c60076cc780c3cb0415b5b78b6007e80347e11b8c0be115bc8be129bc8cc949431c1650c0cc068268531c164d66800644c78b894c05bc0be197e12dbc89488af948cafac38c3fc1960008f0090009103a93c193e11bcb845200835c874cfc040753e803e803440b6cf0c3e115bc8be129bc8cc940d2841287e105bc4c9308038c3dc081bc0be195c3e19bc196040281c3e1120043232c14073c5807e80a01af3d032407ec02000970093009400c28040f84344046dc882106b0b787f01cb1f500401cb3f12cc01fa02f400c9700271c858cf16f8426f22c858cf1613cb0701cf17c976c8cb0412ccccc97001f90074c8cb0212ca07cbffc9d0128018c8cb0501cf1601fa02806acf40f400c901fb0001c27ff866f84a6f2332f8276f1082080f4240a18208dd40a0a170f843f844f847f848f849109b104810375e32104b103b102ac85006cf165004fa0258cf1601fa02c9c88210b56b959801cb1f500701cb3f15cc5003cf1601fa0213ccf400f400f84a009200045f03009e72c8586f230271b05003cb0058cf1601cf16f8426f22c858cf1613cb0701cf17c976c8cb0412ccccc97001f90074c8cb0212ca07cbffc9d0128018c8cb0501cf1601fa02806bcf4001cf17c901fb0000e86c2171f84345046dc882106b0b787f01cb1f500401cb3f12cc01fa02f400c9038208a7d8c00173a9b400a0820afaf080a00171c858cf16f8426f22c858cf1613cb0701cf17c976c8cb0412ccccc97001f90074c8cb0212ca07cbffc9d010238018c8cb0501cf1601fa02806acf40f400c901fb0000fa333322c2008e7271f84345046dc882106b0b787f01cb1f500401cb3f12cc01fa02f400c9018208a7d8c00173a9b400a0820afaf080a00371c858cf16f8426f22c858cf1613cb0701cf17c976c8cb0412ccccc97001f90074c8cb0212ca07cbffc9d041308018c8cb0501cf1601fa02806acf40f400c901fb00925f04e201333c193e11bcb845200835c874cfc040753d01344076cf0c3c19a0009700413c193e113e105bc44071c17cb8407e11bcb445200835c874cfc0407d01347c19a001f6f8426f112176c8cb0412ccccc97001f90074c8cb0212ca07cbffc9d001d0fa40d3070101d3008e25eda2edfb20d70b0320c0009430d603018e12c0019881010cd71801db31e030f2c1056d6de2d8018e25eda2edfb20d70b0320c0009430d603018e12c0019881010cd71801db31e030f2c1056d6de2d843306f030098003601d1f8416f115004c705f8426f105003c70512b001c002b0f2e109002ef867fa00fa00596f02f86bf40401f868f40430f869f065020158009c009d02014800a600a7020120009e009f000db6739e0c9f089002015800a000a102012000a400a502016600a200a3000ca930f064f847000fb88f064f84b6f228007bb8df064f84a72c8586f230271b05003cb0058cf1601cf16f8426f22c858cf1613cb0701cf17c976c8cb0412ccccc97001f90074c8cb0212ca07cbffc9d080011afa378327c22b791400011afc5f8327c213788400011b7d1be0c9f094de470000db51a1e0c9f08d00114ff00f4a413f4bcf2c80b00a902016200aa00ab02012000ac00ad02012000bf00c00201cf00ae00af02012000f500be02012000b000b10201d200b500b602edd807434c0fe903e900c7e800c5c75c87e800c7e800c00807e185c6c3c900875c2c7c820843a8186176ea3a10c1676cf380820842b53adbd6ea3a0d6f6cf38082084355791a1aea50c167c20380c4820841ac2de1feea4cc3c20780820843a4d016e6ea4cc3c21381b04a0406f2ea4bc1ff80c2103fcbc200b200b300f1fbb513435007e193e9035165bc0be18b4c3c07e18f47e107e109bc431c17cb840e00835c874cfc04074c3c04075344cbe10c86fa456f83e18fe109bc47e1132333e109bc433c5b33e10c072c3f27b55083ec1343b47bb54e0802a153b50f620101c3e109bc420043232c14073c5807e80a01af3d032407ec0201f6ed44d0d401f864fa40d4596f02f862d30f01f863d18020d721d33f0101fa00fa40d300fa00f4045520103404d4d11034413021d765a4519982089896808113fb70f836a02270f83aaa00a059816d6070f8365220a02270f83aa001a80181244970f836a0820afaf080a0a0a05260a05280bef2e10708c105f2e11600b401c2ed44d0d401f864fa40d4596f02f862d30f01f863d18020d721d33f0101d4fa00fa40f404d103db3c30f82c811ba670f836a015a101a0027002c88210474f86cf01cb1f5801cb3ff40040038010c8cb0501cf1601fa02806bcf4001cf17c901fb0000d000aef82c8113fb70f836a025a017a170f844f8411078161058041038409ac8821061ee542d01cb1f500801cb3f16cc5004fa0258cf1650235023cb0001fa02f400cc028018c8cb0501cf1601fa02806bcf4001cf17c901fb0002014800b700b800ddd76a2686a00fc327d206a2cb7817c31698780fc31e8c0106b90e99f8080e8fc16408946387c1b5038c08191387c1c5029105f797083fc16408946387c1b500950b8013fb8d86441085489ee0680e58fac00e59fe5807c2089400c64658280e78b00fd014035e7a000e78be480fd804012b3b513435007e193e9035165bc0be18b4c3c07e18f46000b901bf3b513435007e193e9035165bc0be18b4c3c07e18f4600835c874cfc040753e803d013440b6cf0c3e0b20478e5c3e0da805684068009c00b2208411d3e1b3c072c7d60072cffd001000e0043232c14073c5807e80a01af3d00073c5f2407ec02000ee01ee8020d721d33f0101fa00d3008e25eda2edfb20d70b0320c0009430d603018e12c0019881010cd71801db31e030f2c1056d6de2d8018e25eda2edfb20d70b0320c0009430d603018e12c0019881010cd71801db31e030f2c1056d6de2d843306f0301d401d0fa00fa00fa00d103f404f404d1103410230900ba02fe812db270f8362170f83aaa00a0814ab370f8362270f83aa0820898968081050870f836a081396d70f836a02370f83aaa00a059a001a0018155e070f8362170f83aa0018157cc70f8362170f83aa703a0018126a070f8360170f83aa0820afaf080a0aa00a0a0a05260a05280bef2e10722c20022c200b0f2e114246f23328900bb00bc00010801dec7058b108012c705b1f2e123f82c8124af70f836a026a018a170f844f8418b10804983507c1615141bc85006fa025004fa0258cf1601fa025003fa02c9c88210f04ec52601cb1f500701cb3f15cc5003cf16016f230271b05003cb0058cf1601cf1613cc12f400f400c9f8426f101200bd002a8018c8cb0501cf1601fa02806acf40f400c901fb000061ba5265b3301d30301c000f2e105d1ed44f864126f02f862f863f8426f11f844c8ccf8426f10cf16ccf84301cb0fc9ed54802016a00c100c202012000c500c60033b0643b513435007e193e9035165bc0be18b4c3c07e18f47e10e002016e00c300c40009a6111621010035a717da89a1a803f0c9f481a8b2de05f0c5a61e03f0c7a3f084de2100d3babc1812db270f8362170f83aaa00a0814ab370f8362270f83aa0820898968081050870f836a081396d70f836a02370f83aaa00a059a001a0018155e070f8362170f83aa0018157cc70f8362170f83aa703a0018126a070f8360170f83aa0820afaf080a0aa00a0a0a08006db8a3482089896808113fb70f836a02270f83aaa00a059816d6070f8365220a02270f83aa001a80181244970f836a0820afaf080a0a0a0802016200c800c902012000ca00cb02012000f900fa0201cf00cc00cd02012000f500f602f1dc07434c0fe903e900c7e800c5c75c87e800c7e800c00807e185c6c250c0c7c21780875c2c7c820841cd8b4272ea5cc167c6022b690380c4820842b53adbd6ea3a0cc36cf380820841ac2de1feea4cc3c22f80820843a4d016e6ea4cc3c23b80c8860406f2ea4cc7c21b808608409b18eadeea4cc7c21f808600ce00cf0201ce00d300d402f6ed44d0d421d0fa40d3070101318e25eda2edfb20d70b0320c0009430d603018e12c0019881010cd71801db31e030f2c1056d6de2d8f865d102f868d4596f02f862d20001f864fa4001f866fa4001f867d30f01f863d18020d721d33f0101d4fa00fa40f404d103db3c30f82c81244970f836a015a120820afaf08000d000d100388210d1735400ba9331f088e03082109d65482bba92f08de0840ff2f001f6f8426f112176c8cb0412ccccc97001f90074c8cb0212ca07cbffc9d001d0fa40d3070101d3008e25eda2edfb20d70b0320c0009430d603018e12c0019881010cd71801db31e030f2c1056d6de2d8018e25eda2edfb20d70b0320c0009430d603018e12c0019881010cd71801db31e030f2c1056d6de2d843306f0300d200eca170b609236e8e2a23f90082f09b21e88fe793c97b7d859ca9f088251118e808eb194a1172f81221292555f549ba923070dedf1034702603477670c882100f8a7ea501cb1f500701cb3f5005fa025003cf1601cf1613cb0058fa02f400c9f847128018c8cb0501cf1601fa02806acf40f400c901fb00003201d1f8415004c705f8426f105003c70512b001c002b0f2e10902015800d500d602012000dc00dd01dd58020d721d31f013182102c76b973bddced44d0d421d0fa40d3070101318e25eda2edfb20d70b0320c0009430d603018e12c0019881010cd71801db31e030f2c1056d6de2d8f865d102f868d4596f02f862d20001f864fa4001f866fa4001f867d30f01f863d18100a270f8426f10800f302012000d700d802f73b51343508743e9034c1c0404c63897b68bb7ec835c2c0c83000250c3580c06384b0006620404335c60076cc780c3cb0415b5b78b63e197440be1a35165bc0be18b480007e193e90007e19be90007e19f4c3c07e18f47e107e109bc431c17cb840fe113cb844600835c874cfc04074c3c04075344cbe10c86fb8c0a000d900da02df3b51343508743e9034c1c0404c63897b68bb7ec835c2c0c83000250c3580c06384b0006620404335c60076cc780c3cb0415b5b78b63e197440be1a35165bc0be18b480007e193e90007e19be90007e19f4c3c07e18f45e76cf200835c874cffe90344c60822625a01c3ec0a0c19c162000db00f300025b0060f863f84471b0f8426f11f848c8cccccb00f846cf16f847cf16f84301cb0fc9ed5420fb04d0ed1eed538200a854ed43d80068f8410174c85801cb07f8426f22c858cf1613cb0701cf17c976c8cb0412ccccc97001f90074c8cb0212ca07cbffc9d0c705f2e12802012000de00df02012000f100f201cd4ed44d0d421d0fa40d3070101318e25eda2edfb20d70b0320c0009430d603018e12c0019881010cd71801db31e030f2c1056d6de2d8f865d102f868d4596f02f862d20001f864fa4001f866fa4001f867d30f01f863d1f846f84101c705f2e101f844b3f2e112800e002012000e100e200808020d721d33f0101fa406d01d300019831d401d0fa403001ded130317ff864f867f84471b0f8426f11f848c8cccccb00f846cf16f847cf16f84301cb0fc9ed5402f33b68bb7efb51343508743e9034c1c0404c63897b68bb7ec835c2c0c83000250c3580c06384b0006620404335c60076cc780c3cb0415b5b78b63e197440be1a35165bc0be18b480007e193e90007e19be90007e19f4c3c07e18f4600835c874cfc0407e803e9034c00064f50c3437be113e107e11f1c16c38c0e000e300e402f73b51343508743e9034c1c0404c63897b68bb7ec835c2c0c83000250c3580c06384b0006620404335c60076cc780c3cb0415b5b78b63e197440be1a35165bc0be18b480007e193e90007e19be90007e19f4c3c07e18f4600835c874cfc040753e803d013440b6cf0c3e0b2049a81c3e0da80568482082bebc20285c2000ee00ef008c306c235922804004706d70c882100f8a7ea501cb1f500701cb3f5005fa025003cf1601cf1613cb0058fa02f400c970f8418018c8cb0501cf1601fa02806acf40f400c901fb0002d4547321ed44ed45ed478ecd3188ed5555205922804004706d70c882100f8a7ea501cb1f500701cb3f5005fa025003cf1601cf1613cb0058fa02f400c970f8418018c8cb0501cf1601fa02806acf40f400c901fb00f80ff2f0ed67ed65ed64737fed118aed41edf101f2ff00e500e6000003fe20d70b1f208210e3a0d482bae302821040e108d6ba8ee88020d721d3008e25eda2edfb20d70b0320c0009430d603018e12c0019881010cd71801db31e030f2c1056d6de2d8018e25eda2edfb20d70b0320c0009430d603018e12c0019881010cd71801db31e030f2c1056d6de2d843306f0301fa00fa00fa00f404f404d10a00e700e800e902e8308020d721fa40d300fa00f4045520103404d4d11034413021d765a451aa820898968081204270f836a02270f83aaa00a059816d6070f8365220a02270f83aa001a80181244970f836a0820afaf080a0a0a05290be0ac1051ab0e303f82c81204270f836a018a170f8481078061058044313509a00ea00eb01fc812e4c70f8362170f83aaa00a0814ab370f8362270f83aa0820898968081050870f836a081396d70f836a02370f83aaa00a059a001a0018155e070f8362170f83aa0018157cc70f8362170f83aa703a0018126a070f8360170f83aa0820afaf080a0aa00a0a0a05290bef2e10722c20022c200b0f2e114246f2332f8450100ec000ee05f06840ff2f000925f046c235922804004706d70c882100f8a7ea501cb1f500701cb3f5005fa025003cf1601cf1613cb0058fa02f400c970f8418018c8cb0501cf1601fa02806acf40f400c901fb00db31007cc8821061ee542d01cb1f500801cb3f16cc5004fa0258cf1650235023cb0001fa02f400cc40338018c8cb0501cf1601fa02806bcf4001cf17c901fb00db3101fcc705f84558c705b1f2e123f82cf807810e67a070f836a019a170f848f84503499c1bc85006fa025004fa0258cf1601fa025003fa02c9c88210f04ec52601cb1f500701cb3f15cc5003cf16016f230271b05003cb0058cf1601cf1613cc12f400f400c9f8426f1041308018c8cb0501cf1601fa02806acf40f400c901fb0000ed0004db310152f8426f112176c8cb0412ccccc97001f90074c8cb0212ca07cbffc9d001d0fa40d3070101d401d0fa4000f0008ab6091034702603477670c882100f8a7ea501cb1f500701cb3f5005fa025003cf1601cf1613cb0058fa02f400c9f847128018c8cb0501cf1601fa02806acf40f400c901fb0000e4d3008e25eda2edfb20d70b0320c0009430d603018e12c0019881010cd71801db31e030f2c1056d6de2d8018e25eda2edfb20d70b0320c0009430d603018e12c0019881010cd71801db31e030f2c1056d6de2d843306f0301d102d1f8415005c705f8426f105004c70513b001c003b0f2e11001dd5ed44d0d421d0fa40d3070101318e25eda2edfb20d70b0320c0009430d603018e12c0019881010cd71801db31e030f2c1056d6de2d8f865d102f868d4596f02f862d20001f864fa4001f866fa4001f867d30f01f863d1f841f8426f10c705f2e103f844f2d1128100a270f8426f10800f301f74ed44d0d421d0fa40d3070101318e25eda2edfb20d70b0320c0009430d603018e12c0019881010cd71801db31e030f2c1056d6de2d8f865d102f868d4596f02f862d20001f864fa4001f866fa4001f867d30f01f863d18020d721d33f0101d1f82c8116a070f836a07181032270f838a05220bef2e107f82c8116a0800f400268010c8cb0501cf1601fa02806bcf40c901fb00006a70f836a012a170f8441371b0c88210a913dc0d01cb1f5801cb3fcb00f841128018c8cb0501cf1601fa02806bcf4001cf17c901fb000005ba854802c7ba5263134028e25eda2edfb20d70b0320c0009430d603018e12c0019881010cd71801db31e030f2c1056d6de2d801d1db3c02c001f2e105ed44f86870f8648b02f86724d749955b02fa40309d341374c8cb0212ca07cbffc9d0e2f866596f02f862f863800f700f8003cd3030120c000945b706d6de0c00197d207d3ff307159e030f2c1056d6d6d00a8f84471b0f8426f11f848c8cccccb00f846cf16f847cf16f84301cb0fc9ed54804070f8287071b0c882102c76b97301cb1f500301cb3f01cf16cb00c970f8468018c8cb0501cf1601fa02806acf40f400c901fb0002012000fb00fc0201200103010402016200fd00fe02014800ff010000b5aeae76a2686a10e87d206983808098c712f6d176fd906b85819060004a186b0180c7096000cc4080866b8c00ed98f018796082b6b6f16c7c32e8817c346a2cb7817c31690000fc327d2000fc337d2000fc33e98780fc31e8fc224000b5aecb76a2686a10e87d206983808098c712f6d176fd906b85819060004a186b0180c7096000cc4080866b8c00ed98f018796082b6b6f16c7c32e8817c346a2cb7817c31690000fc327d2000fc337d2000fc33e98780fc31e8fc23c000b5b0643b51343508743e9034c1c0404c63897b68bb7ec835c2c0c83000250c3580c06384b0006620404335c60076cc780c3cb0415b5b78b63e197440be1a35165bc0be18b480007e193e90007e19be90007e19f4c3c07e18f47e10e002016e0101010200b3a611da89a1a843a1f481a60e0202631c4bdb45dbf641ae16064180012861ac06031c25800331020219ae3003b663c061e5820adadbc5b1f0cba205f0d1a8b2de05f0c5a40003f0c9f48003f0cdf48003f0cfa61e03f0c7a3f08b00b7a717da89a1a843a1f481a60e0202631c4bdb45dbf641ae16064180012861ac06031c25800331020219ae3003b663c061e5820adadbc5b1f0cba205f0d1a8b2de05f0c5a40003f0c9f48003f0cdf48003f0cfa61e03f0c7a3f084de2100d3babc1812e4c70f8362170f83aaa00a0814ab370f8362270f83aa0820898968081050870f836a081396d70f836a02370f83aaa00a059a001a0018155e070f8362170f83aa0018157cc70f8362170f83aa703a0018126a070f8360170f83aa0820afaf080a0aa00a0a0a08006db8a34820898968081204270f836a02270f83aaa00a059816d6070f8365220a02270f83aa001a80181244970f836a0820afaf080a0a0a08020162010601070202cc01080109001ba0f605da89a1f401f481f481a8610201d4010a010b020148010c010d00c30831c02497c138007434c0c05c6c2544d7c0fc02f83e903e900c7e800c5c75c87e800c7e800c1cea6d0000b4c7e08403e29fa954882ea54c4d167c0238208405e3514654882ea58c511100fc02780d60841657c1ef2ea4d67c02b817c12103fcbc2000113e910c1c2ebcb85360020120010e010f0201200114011501f100f4cffe803e90087c007b51343e803e903e90350c144da8548ab1c17cb8b04a30bffcb8b0950d109c150804d50500f214013e809633c58073c5b33248b232c044bd003d0032c032483e401c1d3232c0b281f2fff274013e903d010c7e800835d270803cb8b11de0063232c1540233c59c3e8085f2dac4f320011003f73b51343e803e903e90350c0234cffe80145468017e903e9014d6f1c1551cdb5c150804d50500f214013e809633c58073c5b33248b232c044bd003d0032c0327e401c1d3232c0b281f2fff274140371c1472c7cb8b0c2be80146a2860822625a020822625a004ad8228608239387028062849f8c3c975c2c070c008e001110112011300ae8210178d4519c8cb1f19cb3f5007fa0222cf165006cf1625fa025003cf16c95005cc2391729171e25008a813a08208e4e1c0aa008208989680a0a014bcf2e2c504c98040fb001023c85004fa0258cf1601cf16ccc9ed5400705279a018a182107362d09cc8cb1f5230cb3f58fa025007cf165007cf16c9718010c8cb0524cf165006fa0215cb6a14ccc971fb0010241023000e10491038375f040076c200b08e218210d53276db708010c8cb055008cf165004fa0216cb6a12cb1f12cb3fc972fb0093356c21e203c85004fa0258cf1601cf16ccc9ed5400db3b51343e803e903e90350c01f4cffe803e900c145468549271c17cb8b049f0bffcb8b0a0823938702a8005a805af3cb8b0e0841ef765f7b232c7c572cfd400fe8088b3c58073c5b25c60063232c14933c59c3e80b2dab33260103ec01004f214013e809633c58073c5b3327b55200083200835c87b51343e803e903e90350c0134c7e08405e3514654882ea0841ef765f784ee84ac7cb8b174cfcc7e800c04e81408f214013e809633c58073c5b3327b5520" + account1 := "0:5f0564fb5f604783db57031ce1cf668a88d4d4d6da6de4db222b4b920d6fd800" + code, err := hex.DecodeString(codeHex) + if err != nil { + t.Fatalf("DecodeString() failed: %v", err) + } + data, err := hex.DecodeString(dataHex) + if err != nil { + t.Fatalf("DecodeString() failed: %v", err) + } + accountID, err := ton.AccountIDFromRaw(account1) + if err != nil { + t.Fatalf("AccountIDFromRaw() failed: %v", err) + } + codeCell, _ := boc.DeserializeBoc(code) + dataCell, _ := boc.DeserializeBoc(data) + emulator, err := tvm.NewEmulator(codeCell[0], dataCell[0], mainnetConfig[0], tvm.WithVerbosityLevel(-1), tvm.WithLazyC7Optimization()) + asset0 := DedustAsset{SumType: "Native"} + typeHint, got, err := GetVaultAddress(context.Background(), emulator, accountID, asset0) + if err != nil { + t.Fatalf("method invocation failed: %v", err) + } + wantTypeHint := "GetVaultAddress_DedustResult" + want := GetVaultAddress_DedustResult{ + VaultAddr: mustAccountIDToMsgAddress("0:61b6bfc47dcc6c6107650e29111878ee7fa16557a235d6eafc780bd63f37676f"), + } + if !reflect.DeepEqual(want, got) { + t.Fatalf("want: %v, got: %v", want, got) + } + if !reflect.DeepEqual(wantTypeHint, typeHint) { + t.Fatalf("want: %v, got: %v", wantTypeHint, typeHint) + } + owner, _ := ton.AccountIDFromRaw("0:61b6bfc47dcc6c6107650e29111878ee7fa16557a235d6eafc780bd63f37676f") + asset1 := DedustAsset{SumType: "Jetton"} + asset1.Jetton.WorkchainId = 0 + asset1.Jetton.Address = mustToBits256("5f8cf9d577f77e5b86b8b8adc6c9ff50dfb708bbf49995d9da5db1390d8518ac") + typeHint, got, err = GetLiquidityDepositAddress(context.Background(), emulator, accountID, owner.ToMsgAddress(), tlb.Int257FromInt64(0), asset0, asset1) + wantTypeHint = "GetLiquidityDepositAddress_DedustResult" + want1 := GetLiquidityDepositAddress_DedustResult{ + LiquidityDepositAddr: mustAccountIDToMsgAddress("0:5f89b8a0605005e3b577822d24c6588baf3d986518d29b7042eff7c46d73dd28"), + } + if !reflect.DeepEqual(want1, got) { + t.Fatalf("want: %v, got: %v", want1, got) + } + if !reflect.DeepEqual(wantTypeHint, typeHint) { + t.Fatalf("want: %v, got: %v", wantTypeHint, typeHint) + } +} + func mustAccountIDToMsgAddress(account string) tlb.MsgAddress { accountID := ton.MustParseAccountID(account) return accountID.ToMsgAddress() @@ -626,6 +701,72 @@ func TestMessageDecoder(t *testing.T) { interfaces []ContractInterface wantValidate func(t *testing.T, value any) }{ + { + name: "dedust deposit liquidity", + interfaces: []ContractInterface{DedustVault}, + wantOpName: "DedustDepositLiquidity", + boc: "b5ee9c72010102010041000165d55e46863d23fc33f0c5c0e549502f90000805889d4ca5a81250b38cfb489c99475bacacb61c512fac81458a37f66e1b10eff1010011049502f9003fcd5ac8", + wantValidate: func(t *testing.T, value any) { + body := DedustDepositLiquidityMsgBody{ + QueryId: 4405642160511500517, + Amount: tlb.Grams(2500000000), + PoolParams: DedustPoolParams{ + PoolType: DedustPoolType{SumType: "Volatile"}, + Asset0: DedustAsset{SumType: "Native"}, + Asset1: DedustAsset{SumType: "Jetton"}, + }, + } + body.Params.MinLpAmount = 0 + body.Params.Asset0TargetBalance = 2500000000 + body.Params.Asset1TargetBalance = 16569772 + body.PoolParams.Asset1.Jetton.WorkchainId = 0 + body.PoolParams.Asset1.Jetton.Address = mustToBits256("b113a994b5024a16719f69139328eb759596c38a25f59028b146fecdc3621dfe") + + if !reflect.DeepEqual(value, body) { + t.Fatalf("\n%v\n%v\n", value, body) + + } + + }, + }, + { + name: "dedust create vault", + interfaces: []ContractInterface{DedustFactory}, + wantOpName: "DedustCreateVault", + boc: "b5ee9c7201010101003000005b21cfe02b00000000000000001005f8cf9d577f77e5b86b8b8adc6c9ff50dfb708bbf49995d9da5db1390d8518ac8", + wantValidate: func(t *testing.T, value any) { + body := DedustCreateVaultMsgBody{ + QueryId: 0, + Asset: DedustAsset{SumType: "Jetton"}, + } + body.Asset.Jetton.WorkchainId = 0 + body.Asset.Jetton.Address = mustToBits256("5f8cf9d577f77e5b86b8b8adc6c9ff50dfb708bbf49995d9da5db1390d8518ac") + + if !reflect.DeepEqual(value, body) { + t.Fatalf("got: %v, want: %v", value, body) + } + }, + }, + { + name: "dedust create volatile pool", + interfaces: []ContractInterface{DedustFactory}, + wantOpName: "DedustCreateVolatilePool", + boc: "b5ee9c7201010101003000005c97d51f2f000000000000000001005404ca01c92e006d0e21554b6e8365ac42acc231d5d9956efd3176267ee3713f", + wantValidate: func(t *testing.T, value any) { + body := DedustCreateVolatilePoolMsgBody{ + QueryId: 0, + Asset0: DedustAsset{SumType: "Native"}, + Asset1: DedustAsset{SumType: "Jetton"}, + } + body.Asset1.Jetton.WorkchainId = 0 + body.Asset1.Jetton.Address = mustToBits256("5404ca01c92e006d0e21554b6e8365ac42acc231d5d9956efd3176267ee3713f") + + if !reflect.DeepEqual(value, body) { + t.Fatalf("got: %v, want: %v", value, body) + } + + }, + }, { name: "storm pay funding", @@ -1991,6 +2132,38 @@ func TestDecodeExternalIn(t *testing.T) { boc: "b5ee9c720101020100a100019c28b67b05683b74bfeb574b3e921c3376cf24bf6c95c93f9a8b7168f093350a01a313ea46307ac579d75de99353b155c78351a6f554fd4a5ebf2ac3332f3f050329a9a31765b0e360000007f5000301009c62001679dadc6448f28be4d6eded0e01c3504e6565d871fd7b185a8e7e40a9192d65a02faf08000000000000000000000000000000000000d0af20d182d0b2d0bed0b920d184d0b0d0bdd0b0d182", }, + { + name: "highload wallet v2 - ton transfer", + interfaces: []ContractInterface{WalletHighloadV2}, + wantOpName: "HighloadWalletSignedV2", + wantValue: func() any { + b := HighloadWalletSignedV2ExtInMsgBody{ + SubwalletId: 698983191, + QueryId: 7410132206735873143, + } + sig, _ := hex.DecodeString("f609105cc2671f490d8ab5ebdf93ac5a9189984a8a3015f9d7a3f2e07ff6f027c23e09f6fe2bdeeb489214149126c2a6f5a72daa4b3bbd31d068c6dc3d0fb601") + copy(b.Signature[:], sig) + for i := 0; i < 10; i++ { + payload := SendMessageAction{ + Mode: 3, + Message: MessageRelaxed{SumType: "MessageInternal"}, + } + payload.Message.MessageInternal.Src.SumType = "AddrNone" + payload.Message.MessageInternal.Dest = pointer(ton.MustParseAccountID("UQAs87W4yJHlF8mt29ocA4agnMrLsOP69jC1HPyBUjJay7Mg")).ToMsgAddress() + payload.Message.MessageInternal.IhrDisabled = true + payload.Message.MessageInternal.Bounce = false + payload.Message.MessageInternal.Body.Value = InMsgBody{ + SumType: "TextComment", + OpCode: pointer(uint32(0)), + Value: TextCommentMsgBody{Text: "test"}, + } + payload.Message.MessageInternal.Value.Grams = tlb.Grams(100 + uint64(i)) + b.Payload.Put(tlb.Uint16(i), payload) + } + return b + }, + boc: "b5ee9c7201021e010002fd000199f609105cc2671f490d8ab5ebdf93ac5a9189984a8a3015f9d7a3f2e07ff6f027c23e09f6fe2bdeeb489214149126c2a6f5a72daa4b3bbd31d068c6dc3d0fb60129a9a31766d613fb412c5477c0010202cc020302012004050201d4060702012008090201200a0b010300e00c010300e00d0201200e0f020120101102012012130201201415007242001679dadc6448f28be4d6eded0e01c3504e6565d871fd7b185a8e7e40a9192d658b60000000000000000000000000000000000074657374007242001679dadc6448f28be4d6eded0e01c3504e6565d871fd7b185a8e7e40a9192d658b68000000000000000000000000000000000074657374010300e016010300e017010300e018010300e019010300e01a010300e01b010300e01c010300e01d007242001679dadc6448f28be4d6eded0e01c3504e6565d871fd7b185a8e7e40a9192d658b20000000000000000000000000000000000074657374007242001679dadc6448f28be4d6eded0e01c3504e6565d871fd7b185a8e7e40a9192d658b28000000000000000000000000000000000074657374007242001679dadc6448f28be4d6eded0e01c3504e6565d871fd7b185a8e7e40a9192d658b30000000000000000000000000000000000074657374007242001679dadc6448f28be4d6eded0e01c3504e6565d871fd7b185a8e7e40a9192d658b38000000000000000000000000000000000074657374007242001679dadc6448f28be4d6eded0e01c3504e6565d871fd7b185a8e7e40a9192d658b40000000000000000000000000000000000074657374007242001679dadc6448f28be4d6eded0e01c3504e6565d871fd7b185a8e7e40a9192d658b48000000000000000000000000000000000074657374007242001679dadc6448f28be4d6eded0e01c3504e6565d871fd7b185a8e7e40a9192d658b50000000000000000000000000000000000074657374007242001679dadc6448f28be4d6eded0e01c3504e6565d871fd7b185a8e7e40a9192d658b58000000000000000000000000000000000074657374", + }, { name: "jetton swap", boc: "b5ee9c720102030100013000019c0e3a69e758992732f0d983de47db14547f1530f34ee356f7bb957b2383c6cfc37d4b0a307b0afd17a0bcfb691d1767585b6b4c000dedcd30dfe2c28d720b480f29a9a3176507a1e20000002a00030101d9620008a85a8c5931356a8c4cfcc443fc4125b8032a2b22afbff1409f80934cd2030fa85d99113400000000000000000000000000000f8a7ea5001d2bbe8bf62d3c50ba43b7400800ef3b9902a271b2a01c8938a523cfe24e71847aaeb6a620001ed44a77ac0e709c103b9aca030200d92593856180029580e58ac522465af9b27bbd824046b8bcb9ebc404fe93778b544edcba449b080db6e79f0036336667ecac6ce139b289530e20cdd788c446a2de30056e218a1b0c6fc478a77001b23bbd527c00fd3d0874026bb7941f8fdd4d599ed8e7a63f426d5723f0388f2e", diff --git a/abi/get_methods.go b/abi/get_methods.go index 1532044..d6b0aea 100644 --- a/abi/get_methods.go +++ b/abi/get_methods.go @@ -12,6 +12,7 @@ import ( var KnownGetMethodsDecoder = map[string][]func(tlb.VmStack) (string, any, error){ "dnsresolve": {DecodeDnsresolve_RecordsResult}, + "estimate_swap_out": {DecodeEstimateSwapOut_DedustResult}, "get_amm_contract_data": {DecodeGetAmmContractData_StormResult}, "get_amm_name": {DecodeGetAmmName_StormResult}, "get_amm_state": {DecodeGetAmmState_StormResult}, @@ -20,7 +21,7 @@ var KnownGetMethodsDecoder = map[string][]func(tlb.VmStack) (string, any, error) "get_assets": {DecodeGetAssets_DedustResult}, "get_auction_info": {DecodeGetAuctionInfoResult}, "get_authority_address": {DecodeGetAuthorityAddressResult}, - "get_balances": {DecodeGetBalancesResult}, + "get_balances": {DecodeGetBalances_DedustResult, DecodeGetBalancesResult}, "get_bill_address": {DecodeGetBillAddressResult}, "get_bill_amount": {DecodeGetBillAmountResult}, "get_channel_data": {DecodeGetChannelDataResult}, @@ -36,6 +37,7 @@ var KnownGetMethodsDecoder = map[string][]func(tlb.VmStack) (string, any, error) "get_jetton_data": {DecodeGetJettonDataResult}, "get_last_clean_time": {DecodeGetLastCleanTimeResult}, "get_last_fill_up_time": {DecodeGetLastFillUpTimeResult}, + "get_liquidity_deposit_address": {DecodeGetLiquidityDepositAddress_DedustResult}, "get_locker_bill_data": {DecodeGetLockerBillDataResult}, "get_locker_data": {DecodeGetLockerDataResult}, "get_lockup_data": {DecodeGetLockupDataResult}, @@ -80,14 +82,17 @@ var KnownGetMethodsDecoder = map[string][]func(tlb.VmStack) (string, any, error) "get_storage_params": {DecodeGetStorageParamsResult}, "get_subscription_data": {DecodeGetSubscriptionDataResult}, "get_subwallet_id": {DecodeGetSubwalletIdResult}, + "get_target_balances": {DecodeGetTargetBalances_DedustResult}, "get_telemint_auction_config": {DecodeGetTelemintAuctionConfigResult}, "get_telemint_auction_state": {DecodeGetTelemintAuctionStateResult}, "get_telemint_token_name": {DecodeGetTelemintTokenNameResult}, "get_terminal_amm_price": {DecodeGetTerminalAmmPrice_StormResult}, "get_timeout": {DecodeGetTimeoutResult}, "get_torrent_hash": {DecodeGetTorrentHashResult}, + "get_trade_fee": {DecodeGetTradeFee_DedustResult}, "get_validator_controller_data": {DecodeGetValidatorControllerDataResult}, "get_vamm_type": {DecodeGetVammType_StormResult}, + "get_vault_address": {DecodeGetVaultAddress_DedustResult}, "get_vault_contract_data": {DecodeGetVaultContractData_StormResult}, "get_vault_data": {DecodeGetVaultData_StormResult}, "get_vault_type": {DecodeGetVaultType_StormResult}, @@ -128,6 +133,7 @@ var KnownSimpleGetMethods = map[int][]func(ctx context.Context, executor Executo 83226: {GetExecutorCollectionAddress}, 83263: {GetNftApiInfo}, 83894: {GetLpMinterAddress}, + 84232: {GetTargetBalances}, 84760: {GetAuthorityAddress}, 85143: {Seqno}, 85719: {RoyaltyParams}, @@ -147,6 +153,7 @@ var KnownSimpleGetMethods = map[int][]func(ctx context.Context, executor Executo 96219: {GetMiningData}, 96263: {GetExchangeSettings}, 96705: {GetBillAmount}, + 96780: {GetTradeFee}, 97026: {GetWalletData}, 97667: {GetRevokedTime}, 98607: {GetVaultContractData}, @@ -193,6 +200,7 @@ var KnownSimpleGetMethods = map[int][]func(ctx context.Context, executor Executo var resultTypes = []interface{}{ &Dnsresolve_RecordsResult{}, + &EstimateSwapOut_DedustResult{}, &GetAmmContractData_StormResult{}, &GetAmmName_StormResult{}, &GetAmmState_StormResult{}, @@ -202,6 +210,7 @@ var resultTypes = []interface{}{ &GetAuctionInfoResult{}, &GetAuthorityAddressResult{}, &GetBalancesResult{}, + &GetBalances_DedustResult{}, &GetBillAddressResult{}, &GetBillAmountResult{}, &GetChannelDataResult{}, @@ -217,6 +226,7 @@ var resultTypes = []interface{}{ &GetJettonDataResult{}, &GetLastCleanTimeResult{}, &GetLastFillUpTimeResult{}, + &GetLiquidityDepositAddress_DedustResult{}, &GetLockerBillDataResult{}, &GetLockerDataResult{}, &GetLockupDataResult{}, @@ -264,14 +274,17 @@ var resultTypes = []interface{}{ &GetStorageParamsResult{}, &GetSubscriptionDataResult{}, &GetSubwalletIdResult{}, + &GetTargetBalances_DedustResult{}, &GetTelemintAuctionConfigResult{}, &GetTelemintAuctionStateResult{}, &GetTelemintTokenNameResult{}, &GetTerminalAmmPrice_StormResult{}, &GetTimeoutResult{}, &GetTorrentHashResult{}, + &GetTradeFee_DedustResult{}, &GetValidatorControllerDataResult{}, &GetVammType_StormResult{}, + &GetVaultAddress_DedustResult{}, &GetVaultContractData_StormResult{}, &GetVaultData_StormResult{}, &GetVaultType_StormResult{}, @@ -338,6 +351,52 @@ func DecodeDnsresolve_RecordsResult(stack tlb.VmStack) (resultType string, resul return "Dnsresolve_RecordsResult", result, err } +type EstimateSwapOut_DedustResult struct { + AssetOut DedustAsset + AmountOut tlb.Int257 + TradeFee tlb.Int257 +} + +func EstimateSwapOut(ctx context.Context, executor Executor, reqAccountID ton.AccountID, assetIn DedustAsset, amountIn tlb.Int257) (string, any, error) { + stack := tlb.VmStack{} + var ( + val tlb.VmStackValue + err error + ) + val, err = tlb.TlbStructToVmCellSlice(assetIn) + if err != nil { + return "", nil, err + } + stack.Put(val) + val = tlb.VmStackValue{SumType: "VmStkInt", VmStkInt: amountIn} + stack.Put(val) + + // MethodID = 70754 for "estimate_swap_out" method + errCode, stack, err := executor.RunSmcMethodByID(ctx, reqAccountID, 70754, stack) + if err != nil { + return "", nil, err + } + if errCode != 0 && errCode != 1 { + return "", nil, fmt.Errorf("method execution failed with code: %v", errCode) + } + for _, f := range []func(tlb.VmStack) (string, any, error){DecodeEstimateSwapOut_DedustResult} { + s, r, err := f(stack) + if err == nil { + return s, r, nil + } + } + return "", nil, fmt.Errorf("can not decode outputs") +} + +func DecodeEstimateSwapOut_DedustResult(stack tlb.VmStack) (resultType string, resultAny any, err error) { + if len(stack) != 3 || (stack[0].SumType != "VmStkSlice") || (stack[1].SumType != "VmStkTinyInt" && stack[1].SumType != "VmStkInt") || (stack[2].SumType != "VmStkTinyInt" && stack[2].SumType != "VmStkInt") { + return "", nil, fmt.Errorf("invalid stack format") + } + var result EstimateSwapOut_DedustResult + err = stack.Unmarshal(&result) + return "EstimateSwapOut_DedustResult", result, err +} + type GetAmmContractData_StormResult struct { AmmContractData boc.Cell } @@ -623,6 +682,11 @@ type GetBalancesResult struct { TotalLockedValue int64 } +type GetBalances_DedustResult struct { + Reserve0 tlb.Int257 + Reserve1 tlb.Int257 +} + func GetBalances(ctx context.Context, executor Executor, reqAccountID ton.AccountID) (string, any, error) { stack := tlb.VmStack{} @@ -634,7 +698,7 @@ func GetBalances(ctx context.Context, executor Executor, reqAccountID ton.Accoun if errCode != 0 && errCode != 1 { return "", nil, fmt.Errorf("method execution failed with code: %v", errCode) } - for _, f := range []func(tlb.VmStack) (string, any, error){DecodeGetBalancesResult} { + for _, f := range []func(tlb.VmStack) (string, any, error){DecodeGetBalances_DedustResult, DecodeGetBalancesResult} { s, r, err := f(stack) if err == nil { return s, r, nil @@ -643,6 +707,15 @@ func GetBalances(ctx context.Context, executor Executor, reqAccountID ton.Accoun return "", nil, fmt.Errorf("can not decode outputs") } +func DecodeGetBalances_DedustResult(stack tlb.VmStack) (resultType string, resultAny any, err error) { + if len(stack) != 2 || (stack[0].SumType != "VmStkTinyInt" && stack[0].SumType != "VmStkInt") || (stack[1].SumType != "VmStkTinyInt" && stack[1].SumType != "VmStkInt") { + return "", nil, fmt.Errorf("invalid stack format") + } + var result GetBalances_DedustResult + err = stack.Unmarshal(&result) + return "GetBalances_DedustResult", result, err +} + func DecodeGetBalancesResult(stack tlb.VmStack) (resultType string, resultAny any, err error) { if len(stack) != 3 || (stack[0].SumType != "VmStkTinyInt" && stack[0].SumType != "VmStkInt") || (stack[1].SumType != "VmStkTinyInt" && stack[1].SumType != "VmStkInt") || (stack[2].SumType != "VmStkTinyInt" && stack[2].SumType != "VmStkInt") { return "", nil, fmt.Errorf("invalid stack format") @@ -1228,6 +1301,60 @@ func DecodeGetLastFillUpTimeResult(stack tlb.VmStack) (resultType string, result return "GetLastFillUpTimeResult", result, err } +type GetLiquidityDepositAddress_DedustResult struct { + LiquidityDepositAddr tlb.MsgAddress +} + +func GetLiquidityDepositAddress(ctx context.Context, executor Executor, reqAccountID ton.AccountID, ownerAddr tlb.MsgAddress, poolType tlb.Int257, asset0 DedustAsset, asset1 DedustAsset) (string, any, error) { + stack := tlb.VmStack{} + var ( + val tlb.VmStackValue + err error + ) + val, err = tlb.TlbStructToVmCellSlice(ownerAddr) + if err != nil { + return "", nil, err + } + stack.Put(val) + val = tlb.VmStackValue{SumType: "VmStkInt", VmStkInt: poolType} + stack.Put(val) + val, err = tlb.TlbStructToVmCellSlice(asset0) + if err != nil { + return "", nil, err + } + stack.Put(val) + val, err = tlb.TlbStructToVmCellSlice(asset1) + if err != nil { + return "", nil, err + } + stack.Put(val) + + // MethodID = 84481 for "get_liquidity_deposit_address" method + errCode, stack, err := executor.RunSmcMethodByID(ctx, reqAccountID, 84481, stack) + if err != nil { + return "", nil, err + } + if errCode != 0 && errCode != 1 { + return "", nil, fmt.Errorf("method execution failed with code: %v", errCode) + } + for _, f := range []func(tlb.VmStack) (string, any, error){DecodeGetLiquidityDepositAddress_DedustResult} { + s, r, err := f(stack) + if err == nil { + return s, r, nil + } + } + return "", nil, fmt.Errorf("can not decode outputs") +} + +func DecodeGetLiquidityDepositAddress_DedustResult(stack tlb.VmStack) (resultType string, resultAny any, err error) { + if len(stack) != 1 || (stack[0].SumType != "VmStkSlice") { + return "", nil, fmt.Errorf("invalid stack format") + } + var result GetLiquidityDepositAddress_DedustResult + err = stack.Unmarshal(&result) + return "GetLiquidityDepositAddress_DedustResult", result, err +} + type GetLockerBillDataResult struct { LockerAddress tlb.MsgAddress TotalCoinsDeposit uint64 @@ -3015,6 +3142,40 @@ func DecodeGetSubwalletIdResult(stack tlb.VmStack) (resultType string, resultAny return "GetSubwalletIdResult", result, err } +type GetTargetBalances_DedustResult struct { + Reserve0 tlb.Int257 + Reserve1 tlb.Int257 +} + +func GetTargetBalances(ctx context.Context, executor Executor, reqAccountID ton.AccountID) (string, any, error) { + stack := tlb.VmStack{} + + // MethodID = 84232 for "get_target_balances" method + errCode, stack, err := executor.RunSmcMethodByID(ctx, reqAccountID, 84232, stack) + if err != nil { + return "", nil, err + } + if errCode != 0 && errCode != 1 { + return "", nil, fmt.Errorf("method execution failed with code: %v", errCode) + } + for _, f := range []func(tlb.VmStack) (string, any, error){DecodeGetTargetBalances_DedustResult} { + s, r, err := f(stack) + if err == nil { + return s, r, nil + } + } + return "", nil, fmt.Errorf("can not decode outputs") +} + +func DecodeGetTargetBalances_DedustResult(stack tlb.VmStack) (resultType string, resultAny any, err error) { + if len(stack) != 2 || (stack[0].SumType != "VmStkTinyInt" && stack[0].SumType != "VmStkInt") || (stack[1].SumType != "VmStkTinyInt" && stack[1].SumType != "VmStkInt") { + return "", nil, fmt.Errorf("invalid stack format") + } + var result GetTargetBalances_DedustResult + err = stack.Unmarshal(&result) + return "GetTargetBalances_DedustResult", result, err +} + type GetTelemintAuctionConfigResult struct { Beneficiar tlb.MsgAddress InitialMinBid int64 @@ -3222,6 +3383,40 @@ func DecodeGetTorrentHashResult(stack tlb.VmStack) (resultType string, resultAny return "GetTorrentHashResult", result, err } +type GetTradeFee_DedustResult struct { + TradeFeeNumerator tlb.Int257 + TradeFeeDenominator tlb.Int257 +} + +func GetTradeFee(ctx context.Context, executor Executor, reqAccountID ton.AccountID) (string, any, error) { + stack := tlb.VmStack{} + + // MethodID = 96780 for "get_trade_fee" method + errCode, stack, err := executor.RunSmcMethodByID(ctx, reqAccountID, 96780, stack) + if err != nil { + return "", nil, err + } + if errCode != 0 && errCode != 1 { + return "", nil, fmt.Errorf("method execution failed with code: %v", errCode) + } + for _, f := range []func(tlb.VmStack) (string, any, error){DecodeGetTradeFee_DedustResult} { + s, r, err := f(stack) + if err == nil { + return s, r, nil + } + } + return "", nil, fmt.Errorf("can not decode outputs") +} + +func DecodeGetTradeFee_DedustResult(stack tlb.VmStack) (resultType string, resultAny any, err error) { + if len(stack) != 2 || (stack[0].SumType != "VmStkTinyInt" && stack[0].SumType != "VmStkInt") || (stack[1].SumType != "VmStkTinyInt" && stack[1].SumType != "VmStkInt") { + return "", nil, fmt.Errorf("invalid stack format") + } + var result GetTradeFee_DedustResult + err = stack.Unmarshal(&result) + return "GetTradeFee_DedustResult", result, err +} + type GetValidatorControllerDataResult struct { State int32 Halted bool @@ -3301,6 +3496,48 @@ func DecodeGetVammType_StormResult(stack tlb.VmStack) (resultType string, result return "GetVammType_StormResult", result, err } +type GetVaultAddress_DedustResult struct { + VaultAddr tlb.MsgAddress +} + +func GetVaultAddress(ctx context.Context, executor Executor, reqAccountID ton.AccountID, asset DedustAsset) (string, any, error) { + stack := tlb.VmStack{} + var ( + val tlb.VmStackValue + err error + ) + val, err = tlb.TlbStructToVmCellSlice(asset) + if err != nil { + return "", nil, err + } + stack.Put(val) + + // MethodID = 76695 for "get_vault_address" method + errCode, stack, err := executor.RunSmcMethodByID(ctx, reqAccountID, 76695, stack) + if err != nil { + return "", nil, err + } + if errCode != 0 && errCode != 1 { + return "", nil, fmt.Errorf("method execution failed with code: %v", errCode) + } + for _, f := range []func(tlb.VmStack) (string, any, error){DecodeGetVaultAddress_DedustResult} { + s, r, err := f(stack) + if err == nil { + return s, r, nil + } + } + return "", nil, fmt.Errorf("can not decode outputs") +} + +func DecodeGetVaultAddress_DedustResult(stack tlb.VmStack) (resultType string, resultAny any, err error) { + if len(stack) != 1 || (stack[0].SumType != "VmStkSlice") { + return "", nil, fmt.Errorf("invalid stack format") + } + var result GetVaultAddress_DedustResult + err = stack.Unmarshal(&result) + return "GetVaultAddress_DedustResult", result, err +} + type GetVaultContractData_StormResult struct { Data boc.Cell } diff --git a/abi/interfaces.go b/abi/interfaces.go index c9949be..88a991f 100644 --- a/abi/interfaces.go +++ b/abi/interfaces.go @@ -8,6 +8,8 @@ import ( const ( IUnknown ContractInterface = iota + DedustFactory + DedustLiquidityDeposit DedustPool DedustVault Dns @@ -78,6 +80,10 @@ const ( func (c ContractInterface) String() string { switch c { + case DedustFactory: + return "dedust_factory" + case DedustLiquidityDeposit: + return "dedust_liquidity_deposit " case DedustPool: return "dedust_pool" case DedustVault: @@ -217,6 +223,10 @@ func (c ContractInterface) String() string { func ContractInterfaceFromString(s string) ContractInterface { switch s { + case "dedust_factory": + return DedustFactory + case "dedust_liquidity_deposit ": + return DedustLiquidityDeposit case "dedust_pool": return DedustPool case "dedust_vault": @@ -595,6 +605,10 @@ var methodInvocationOrder = []MethodDescription{ Name: "get_subwallet_id", InvokeFn: GetSubwalletId, }, + { + Name: "get_target_balances", + InvokeFn: GetTargetBalances, + }, { Name: "get_telemint_auction_config", InvokeFn: GetTelemintAuctionConfig, @@ -619,6 +633,10 @@ var methodInvocationOrder = []MethodDescription{ Name: "get_torrent_hash", InvokeFn: GetTorrentHash, }, + { + Name: "get_trade_fee", + InvokeFn: GetTradeFee, + }, { Name: "get_validator_controller_data", InvokeFn: GetValidatorControllerData, @@ -686,12 +704,21 @@ var methodInvocationOrder = []MethodDescription{ } var contractInterfacesOrder = []InterfaceDescription{ + { + Name: DedustLiquidityDeposit, + Results: []string{ + "GetBalances_DedustResult", + "GetTargetBalances_DedustResult", + }, + }, { Name: DedustPool, Results: []string{ "GetAssets_DedustResult", "GetJettonDataResult", "GetReserves_DedustResult", + "GetTradeFee_DedustResult", + "IsStable_DedustResult", }, }, { @@ -1099,7 +1126,9 @@ var knownContracts = map[ton.Bits256]knownContractDescription{ }, ton.MustParseHash("9494d1cc8edf12f05671a1a9ba09921096eb50811e1924ec65c3c629fbb80812"): { contractInterfaces: []ContractInterface{WalletHighloadV2}, - getMethods: []InvokeFn{}, + getMethods: []InvokeFn{ + GetPublicKey, + }, }, ton.MustParseHash("a01e057fbd4288402b9898d78d67bd4e90254c93c5866879bc2d1d12865436bc"): { contractInterfaces: []ContractInterface{MultisigOrderV2}, @@ -1183,16 +1212,23 @@ var knownContracts = map[ton.Bits256]knownContractDescription{ func (c ContractInterface) IntMsgs() []msgDecoderFunc { switch c { + case DedustFactory: + return []msgDecoderFunc{ + decodeFuncDedustCreateVaultMsgBody, + decodeFuncDedustCreateVolatilePoolMsgBody, + } case DedustPool: return []msgDecoderFunc{ decodeFuncDedustSwapExternalMsgBody, decodeFuncDedustSwapPeerMsgBody, + decodeFuncJettonBurnNotificationMsgBody, } case DedustVault: return []msgDecoderFunc{ decodeFuncJettonNotifyMsgBody, decodeFuncJettonTransferMsgBody, decodeFuncDedustSwapMsgBody, + decodeFuncDedustDepositLiquidityMsgBody, decodeFuncDedustPayoutFromPoolMsgBody, } case Dns: @@ -1283,6 +1319,10 @@ func (c ContractInterface) IntMsgs() []msgDecoderFunc { func (c ContractInterface) ExtInMsgs() []msgDecoderFunc { switch c { + case WalletHighloadV2: + return []msgDecoderFunc{ + decodeFuncHighloadWalletSignedV2ExtInMsgBody, + } case WalletHighloadV3R1: return []msgDecoderFunc{ decodeFuncHighloadWalletSignedV3ExtInMsgBody, @@ -1321,6 +1361,8 @@ func (c ContractInterface) ExtOutMsgs() []msgDecoderFunc { case DedustPool: return []msgDecoderFunc{ decodeFuncDedustSwapExtOutMsgBody, + decodeFuncDedustDepositExtOutMsgBody, + decodeFuncDedustWithdrawalExtOutMsgBody, } default: return nil diff --git a/abi/jetton_msg_types.go b/abi/jetton_msg_types.go index b4f6e92..4f8e46f 100644 --- a/abi/jetton_msg_types.go +++ b/abi/jetton_msg_types.go @@ -62,6 +62,17 @@ func decodeTegroAddLiquidityJettonOpJetton(j *JettonPayload, c *boc.Cell) error return err } +func decodeDedustDepositLiquidityJettonOpJetton(j *JettonPayload, c *boc.Cell) error { + var res DedustDepositLiquidityJettonPayload + err := tlb.Unmarshal(c, &res) + if err == nil { + j.SumType = DedustDepositLiquidityJettonOp + j.Value = res + return nil + } + return err +} + func decodeStonfiSwapOkRefJettonOpJetton(j *JettonPayload, c *boc.Cell) error { var res StonfiSwapOkRefJettonPayload err := tlb.Unmarshal(c, &res) @@ -123,6 +134,7 @@ const ( EncryptedTextCommentJettonOp JettonOpName = "EncryptedTextComment" StonfiSwapJettonOp JettonOpName = "StonfiSwap" TegroAddLiquidityJettonOp JettonOpName = "TegroAddLiquidity" + DedustDepositLiquidityJettonOp JettonOpName = "DedustDepositLiquidity" StonfiSwapOkRefJettonOp JettonOpName = "StonfiSwapOkRef" TonkeeperRelayerFeeJettonOp JettonOpName = "TonkeeperRelayerFee" StonfiSwapOkJettonOp JettonOpName = "StonfiSwapOk" @@ -134,6 +146,7 @@ const ( EncryptedTextCommentJettonOpCode JettonOpCode = 0x2167da4b StonfiSwapJettonOpCode JettonOpCode = 0x25938561 TegroAddLiquidityJettonOpCode JettonOpCode = 0x287e167a + DedustDepositLiquidityJettonOpCode JettonOpCode = 0x40e108d6 StonfiSwapOkRefJettonOpCode JettonOpCode = 0x45078540 TonkeeperRelayerFeeJettonOpCode JettonOpCode = 0x878da6e3 StonfiSwapOkJettonOpCode JettonOpCode = 0xc64370e5 @@ -147,6 +160,7 @@ var KnownJettonTypes = map[string]any{ EncryptedTextCommentJettonOp: EncryptedTextCommentJettonPayload{}, StonfiSwapJettonOp: StonfiSwapJettonPayload{}, TegroAddLiquidityJettonOp: TegroAddLiquidityJettonPayload{}, + DedustDepositLiquidityJettonOp: DedustDepositLiquidityJettonPayload{}, StonfiSwapOkRefJettonOp: StonfiSwapOkRefJettonPayload{}, TonkeeperRelayerFeeJettonOp: TonkeeperRelayerFeeJettonPayload{}, StonfiSwapOkJettonOp: StonfiSwapOkJettonPayload{}, @@ -159,6 +173,7 @@ var JettonOpCodes = map[JettonOpName]JettonOpCode{ EncryptedTextCommentJettonOp: EncryptedTextCommentJettonOpCode, StonfiSwapJettonOp: StonfiSwapJettonOpCode, TegroAddLiquidityJettonOp: TegroAddLiquidityJettonOpCode, + DedustDepositLiquidityJettonOp: DedustDepositLiquidityJettonOpCode, StonfiSwapOkRefJettonOp: StonfiSwapOkRefJettonOpCode, TonkeeperRelayerFeeJettonOp: TonkeeperRelayerFeeJettonOpCode, StonfiSwapOkJettonOp: StonfiSwapOkJettonOpCode, @@ -172,6 +187,7 @@ var funcJettonDecodersMapping = map[JettonOpCode]func(*JettonPayload, *boc.Cell) EncryptedTextCommentJettonOpCode: decodeEncryptedTextCommentJettonOpJetton, StonfiSwapJettonOpCode: decodeStonfiSwapJettonOpJetton, TegroAddLiquidityJettonOpCode: decodeTegroAddLiquidityJettonOpJetton, + DedustDepositLiquidityJettonOpCode: decodeDedustDepositLiquidityJettonOpJetton, StonfiSwapOkRefJettonOpCode: decodeStonfiSwapOkRefJettonOpJetton, TonkeeperRelayerFeeJettonOpCode: decodeTonkeeperRelayerFeeJettonOpJetton, StonfiSwapOkJettonOpCode: decodeStonfiSwapOkJettonOpJetton, @@ -208,6 +224,15 @@ type TegroAddLiquidityJettonPayload struct { AbountB tlb.VarUInteger16 } +type DedustDepositLiquidityJettonPayload struct { + PoolParams DedustPoolParams + MinLpAmount tlb.Grams + Asset0TargetBalance tlb.Grams + Asset1TargetBalance tlb.Grams + FulfillPayload *tlb.Any `tlb:"maybe^"` + RejectPayload *tlb.Any `tlb:"maybe^"` +} + type StonfiSwapOkRefJettonPayload struct{} type TonkeeperRelayerFeeJettonPayload struct{} diff --git a/abi/messages.md b/abi/messages.md index 185137b..c47a371 100644 --- a/abi/messages.md +++ b/abi/messages.md @@ -18,6 +18,12 @@ The list below contains the supported message operations, their names and opcode | ChannelCooperativeCommit| 0x79a126ef | | CloseStorageContract| 0x79f937ea | | Credit| 0x1690c604 | +| DedustCancelDeposit| 0x166cedee | +| DedustCreateVault| 0x21cfe02b | +| DedustCreateVolatilePool| 0x97d51f2f | +| DedustDeposit| 0xb544f4a4 | +| DedustDepositLiquidity| 0x40e108d6 | +| DedustDepositLiquidity| 0xd55e4686 | | DedustDepositLiquidityAll| 0xb56b9598 | | DedustPayout| 0x474f86cf | | DedustPayoutFromPool| 0xad4eb6f5 | @@ -26,6 +32,7 @@ The list below contains the supported message operations, their names and opcode | DedustSwap| 0xea06185d | | DedustSwapExternal| 0x61ee542d | | DedustSwapPeer| 0x72aca8aa | +| DedustWithdrawal| 0x3aa870a6 | | DeleteDnsRecord| 0x4eb1f0f9 | | DeployStorageContract| 0xe4748df1 | | Disapprove| 0xe8a0abfe | @@ -42,6 +49,7 @@ The list below contains the supported message operations, their names and opcode | GetRoyaltyParams| 0x693d3950 | | GetStaticData| 0x2fcb26a2 | | GramSubmitProofOfWork| 0x4d696e65 | +| HighloadWalletSignedV2| 0x00000000 | | HighloadWalletSignedV3| 0x00000000 | | InitPaymentChannel| 0x0e0620c2 | | JettonBurn| 0x595f07bc | diff --git a/abi/messages_generated.go b/abi/messages_generated.go index 65ebff0..5e5a276 100644 --- a/abi/messages_generated.go +++ b/abi/messages_generated.go @@ -37,6 +37,8 @@ var ( decodeFuncTonstakeControllerPoolHaltMsgBody = decodeMsg(tlb.Tag{Val: 0x139a1b4e, Len: 32}, TonstakeControllerPoolHaltMsgOp, TonstakeControllerPoolHaltMsgBody{}) // 0x1596920c decodeFuncWhalesNominatorsForceKickMsgBody = decodeMsg(tlb.Tag{Val: 0x1596920c, Len: 32}, WhalesNominatorsForceKickMsgOp, WhalesNominatorsForceKickMsgBody{}) + // 0x166cedee + decodeFuncDedustCancelDepositMsgBody = decodeMsg(tlb.Tag{Val: 0x166cedee, Len: 32}, DedustCancelDepositMsgOp, DedustCancelDepositMsgBody{}) // 0x1674b0a0 decodeFuncTonstakePayoutMintJettonsMsgBody = decodeMsg(tlb.Tag{Val: 0x1674b0a0, Len: 32}, TonstakePayoutMintJettonsMsgOp, TonstakePayoutMintJettonsMsgBody{}) // 0x1690c604 @@ -51,6 +53,8 @@ var ( decodeFuncStartUncooperativeChannelCloseMsgBody = decodeMsg(tlb.Tag{Val: 0x1f151acf, Len: 32}, StartUncooperativeChannelCloseMsgOp, StartUncooperativeChannelCloseMsgBody{}) // 0x2167da4b decodeFuncEncryptedTextCommentMsgBody = decodeMsg(tlb.Tag{Val: 0x2167da4b, Len: 32}, EncryptedTextCommentMsgOp, EncryptedTextCommentMsgBody{}) + // 0x21cfe02b + decodeFuncDedustCreateVaultMsgBody = decodeMsg(tlb.Tag{Val: 0x21cfe02b, Len: 32}, DedustCreateVaultMsgOp, DedustCreateVaultMsgBody{}) // 0x235caf52 decodeFuncJettonCallToMsgBody = decodeMsg(tlb.Tag{Val: 0x235caf52, Len: 32}, JettonCallToMsgOp, JettonCallToMsgBody{}) // 0x23d421e1 @@ -215,6 +219,8 @@ var ( decodeFuncTonstakeControllerWithdrawValidatorMsgBody = decodeMsg(tlb.Tag{Val: 0x8efed779, Len: 32}, TonstakeControllerWithdrawValidatorMsgOp, TonstakeControllerWithdrawValidatorMsgBody{}) // 0x96e7f528 decodeFuncTonstakeControllerPoolUpgradeMsgBody = decodeMsg(tlb.Tag{Val: 0x96e7f528, Len: 32}, TonstakeControllerPoolUpgradeMsgOp, TonstakeControllerPoolUpgradeMsgBody{}) + // 0x97d51f2f + decodeFuncDedustCreateVolatilePoolMsgBody = decodeMsg(tlb.Tag{Val: 0x97d51f2f, Len: 32}, DedustCreateVolatilePoolMsgOp, DedustCreateVolatilePoolMsgBody{}) // 0x9971881c decodeFuncTonstakePoolPrepareGovernanceMigrationMsgBody = decodeMsg(tlb.Tag{Val: 0x9971881c, Len: 32}, TonstakePoolPrepareGovernanceMigrationMsgOp, TonstakePoolPrepareGovernanceMigrationMsgBody{}) // 0x99a811fb @@ -277,6 +283,8 @@ var ( decodeFuncStorageContractConfirmedMsgBody = decodeMsg(tlb.Tag{Val: 0xd4caedcd, Len: 32}, StorageContractConfirmedMsgOp, StorageContractConfirmedMsgBody{}) // 0xd53276db decodeFuncExcessMsgBody = decodeMsg(tlb.Tag{Val: 0xd53276db, Len: 32}, ExcessMsgOp, ExcessMsgBody{}) + // 0xd55e4686 + decodeFuncDedustDepositLiquidityMsgBody = decodeMsg(tlb.Tag{Val: 0xd55e4686, Len: 32}, DedustDepositLiquidityMsgOp, DedustDepositLiquidityMsgBody{}) // 0xd5b5e9ad decodeFuncStormVaultUnstakeMsgBody = decodeMsg(tlb.Tag{Val: 0xd5b5e9ad, Len: 32}, StormVaultUnstakeMsgOp, StormVaultUnstakeMsgBody{}) // 0xda803efd @@ -378,6 +386,9 @@ var opcodedMsgInDecodeFunctions = map[uint32]msgDecoderFunc{ // 0x1596920c WhalesNominatorsForceKickMsgOpCode: decodeFuncWhalesNominatorsForceKickMsgBody, + // 0x166cedee + DedustCancelDepositMsgOpCode: decodeFuncDedustCancelDepositMsgBody, + // 0x1674b0a0 TonstakePayoutMintJettonsMsgOpCode: decodeFuncTonstakePayoutMintJettonsMsgBody, @@ -399,6 +410,9 @@ var opcodedMsgInDecodeFunctions = map[uint32]msgDecoderFunc{ // 0x2167da4b EncryptedTextCommentMsgOpCode: decodeFuncEncryptedTextCommentMsgBody, + // 0x21cfe02b + DedustCreateVaultMsgOpCode: decodeFuncDedustCreateVaultMsgBody, + // 0x235caf52 JettonCallToMsgOpCode: decodeFuncJettonCallToMsgBody, @@ -647,6 +661,9 @@ var opcodedMsgInDecodeFunctions = map[uint32]msgDecoderFunc{ // 0x96e7f528 TonstakeControllerPoolUpgradeMsgOpCode: decodeFuncTonstakeControllerPoolUpgradeMsgBody, + // 0x97d51f2f + DedustCreateVolatilePoolMsgOpCode: decodeFuncDedustCreateVolatilePoolMsgBody, + // 0x9971881c TonstakePoolPrepareGovernanceMigrationMsgOpCode: decodeFuncTonstakePoolPrepareGovernanceMigrationMsgBody, @@ -740,6 +757,9 @@ var opcodedMsgInDecodeFunctions = map[uint32]msgDecoderFunc{ // 0xd53276db ExcessMsgOpCode: decodeFuncExcessMsgBody, + // 0xd55e4686 + DedustDepositLiquidityMsgOpCode: decodeFuncDedustDepositLiquidityMsgBody, + // 0xd5b5e9ad StormVaultUnstakeMsgOpCode: decodeFuncStormVaultUnstakeMsgBody, @@ -835,6 +855,7 @@ const ( TonstakeNftInitMsgOp MsgOpName = "TonstakeNftInit" TonstakeControllerPoolHaltMsgOp MsgOpName = "TonstakeControllerPoolHalt" WhalesNominatorsForceKickMsgOp MsgOpName = "WhalesNominatorsForceKick" + DedustCancelDepositMsgOp MsgOpName = "DedustCancelDeposit" TonstakePayoutMintJettonsMsgOp MsgOpName = "TonstakePayoutMintJettons" CreditMsgOp MsgOpName = "Credit" JettonInternalTransferMsgOp MsgOpName = "JettonInternalTransfer" @@ -842,6 +863,7 @@ const ( SbtDestroyMsgOp MsgOpName = "SbtDestroy" StartUncooperativeChannelCloseMsgOp MsgOpName = "StartUncooperativeChannelClose" EncryptedTextCommentMsgOp MsgOpName = "EncryptedTextComment" + DedustCreateVaultMsgOp MsgOpName = "DedustCreateVault" JettonCallToMsgOp MsgOpName = "JettonCallTo" WhalesNominatorsStakeWithdrawCompletedMsgOp MsgOpName = "WhalesNominatorsStakeWithdrawCompleted" JettonUpgradeMsgOp MsgOpName = "JettonUpgrade" @@ -924,6 +946,7 @@ const ( ReportStaticDataMsgOp MsgOpName = "ReportStaticData" TonstakeControllerWithdrawValidatorMsgOp MsgOpName = "TonstakeControllerWithdrawValidator" TonstakeControllerPoolUpgradeMsgOp MsgOpName = "TonstakeControllerPoolUpgrade" + DedustCreateVolatilePoolMsgOp MsgOpName = "DedustCreateVolatilePool" TonstakePoolPrepareGovernanceMigrationMsgOp MsgOpName = "TonstakePoolPrepareGovernanceMigration" WhalesNominatorsAcceptStakeMsgOp MsgOpName = "WhalesNominatorsAcceptStake" TonstakePoolSetDepositSettingsMsgOp MsgOpName = "TonstakePoolSetDepositSettings" @@ -955,6 +978,7 @@ const ( TopUpMsgOp MsgOpName = "TopUp" StorageContractConfirmedMsgOp MsgOpName = "StorageContractConfirmed" ExcessMsgOp MsgOpName = "Excess" + DedustDepositLiquidityMsgOp MsgOpName = "DedustDepositLiquidity" StormVaultUnstakeMsgOp MsgOpName = "StormVaultUnstake" WhalesNominatorsWithdrawMsgOp MsgOpName = "WhalesNominatorsWithdraw" TonstakeNftPayoutMsgOp MsgOpName = "TonstakeNftPayout" @@ -999,6 +1023,7 @@ const ( TonstakeNftInitMsgOpCode MsgOpCode = 0x132f9a45 TonstakeControllerPoolHaltMsgOpCode MsgOpCode = 0x139a1b4e WhalesNominatorsForceKickMsgOpCode MsgOpCode = 0x1596920c + DedustCancelDepositMsgOpCode MsgOpCode = 0x166cedee TonstakePayoutMintJettonsMsgOpCode MsgOpCode = 0x1674b0a0 CreditMsgOpCode MsgOpCode = 0x1690c604 JettonInternalTransferMsgOpCode MsgOpCode = 0x178d4519 @@ -1006,6 +1031,7 @@ const ( SbtDestroyMsgOpCode MsgOpCode = 0x1f04537a StartUncooperativeChannelCloseMsgOpCode MsgOpCode = 0x1f151acf EncryptedTextCommentMsgOpCode MsgOpCode = 0x2167da4b + DedustCreateVaultMsgOpCode MsgOpCode = 0x21cfe02b JettonCallToMsgOpCode MsgOpCode = 0x235caf52 WhalesNominatorsStakeWithdrawCompletedMsgOpCode MsgOpCode = 0x23d421e1 JettonUpgradeMsgOpCode MsgOpCode = 0x2508d66a @@ -1088,6 +1114,7 @@ const ( ReportStaticDataMsgOpCode MsgOpCode = 0x8b771735 TonstakeControllerWithdrawValidatorMsgOpCode MsgOpCode = 0x8efed779 TonstakeControllerPoolUpgradeMsgOpCode MsgOpCode = 0x96e7f528 + DedustCreateVolatilePoolMsgOpCode MsgOpCode = 0x97d51f2f TonstakePoolPrepareGovernanceMigrationMsgOpCode MsgOpCode = 0x9971881c WhalesNominatorsAcceptStakeMsgOpCode MsgOpCode = 0x99a811fb TonstakePoolSetDepositSettingsMsgOpCode MsgOpCode = 0x9bf5561c @@ -1119,6 +1146,7 @@ const ( TopUpMsgOpCode MsgOpCode = 0xd372158c StorageContractConfirmedMsgOpCode MsgOpCode = 0xd4caedcd ExcessMsgOpCode MsgOpCode = 0xd53276db + DedustDepositLiquidityMsgOpCode MsgOpCode = 0xd55e4686 StormVaultUnstakeMsgOpCode MsgOpCode = 0xd5b5e9ad WhalesNominatorsWithdrawMsgOpCode MsgOpCode = 0xda803efd TonstakeNftPayoutMsgOpCode MsgOpCode = 0xdb3b8abd @@ -1247,6 +1275,11 @@ type WhalesNominatorsForceKickMsgBody struct { QueryId int64 } +type DedustCancelDepositMsgBody struct { + QueryId uint64 + Payload *tlb.Any `tlb:"maybe^"` +} + type TonstakePayoutMintJettonsMsgBody struct { QueryId uint64 Destination tlb.MsgAddress @@ -1289,6 +1322,11 @@ type EncryptedTextCommentMsgBody struct { CipherText tlb.Bytes } +type DedustCreateVaultMsgBody struct { + QueryId uint64 + Asset DedustAsset +} + type JettonCallToMsgBody struct { QueryId uint64 ToAddress tlb.MsgAddress @@ -1771,6 +1809,12 @@ type TonstakeControllerPoolUpgradeMsgBody struct { AfterUpgrade *tlb.Any `tlb:"maybe^"` } +type DedustCreateVolatilePoolMsgBody struct { + QueryId uint64 + Asset0 DedustAsset + Asset1 DedustAsset +} + type TonstakePoolPrepareGovernanceMigrationMsgBody struct { QueryId uint64 GovernorUpdateAfter tlb.Uint48 @@ -1962,6 +2006,19 @@ type ExcessMsgBody struct { QueryId uint64 } +type DedustDepositLiquidityMsgBody struct { + QueryId uint64 + Amount tlb.Grams + PoolParams DedustPoolParams + Params struct { + MinLpAmount tlb.Grams + Asset0TargetBalance tlb.Grams + Asset1TargetBalance tlb.Grams + } `tlb:"^"` + FulfillPayload *tlb.Any `tlb:"maybe^"` + RejectPayload *tlb.Any `tlb:"maybe^"` +} + type StormVaultUnstakeMsgBody struct { JettonAmount tlb.Grams UserAddress tlb.MsgAddress @@ -2113,6 +2170,7 @@ var KnownMsgInTypes = map[string]any{ TonstakeNftInitMsgOp: TonstakeNftInitMsgBody{}, TonstakeControllerPoolHaltMsgOp: TonstakeControllerPoolHaltMsgBody{}, WhalesNominatorsForceKickMsgOp: WhalesNominatorsForceKickMsgBody{}, + DedustCancelDepositMsgOp: DedustCancelDepositMsgBody{}, TonstakePayoutMintJettonsMsgOp: TonstakePayoutMintJettonsMsgBody{}, CreditMsgOp: CreditMsgBody{}, JettonInternalTransferMsgOp: JettonInternalTransferMsgBody{}, @@ -2120,6 +2178,7 @@ var KnownMsgInTypes = map[string]any{ SbtDestroyMsgOp: SbtDestroyMsgBody{}, StartUncooperativeChannelCloseMsgOp: StartUncooperativeChannelCloseMsgBody{}, EncryptedTextCommentMsgOp: EncryptedTextCommentMsgBody{}, + DedustCreateVaultMsgOp: DedustCreateVaultMsgBody{}, JettonCallToMsgOp: JettonCallToMsgBody{}, WhalesNominatorsStakeWithdrawCompletedMsgOp: WhalesNominatorsStakeWithdrawCompletedMsgBody{}, JettonUpgradeMsgOp: JettonUpgradeMsgBody{}, @@ -2202,6 +2261,7 @@ var KnownMsgInTypes = map[string]any{ ReportStaticDataMsgOp: ReportStaticDataMsgBody{}, TonstakeControllerWithdrawValidatorMsgOp: TonstakeControllerWithdrawValidatorMsgBody{}, TonstakeControllerPoolUpgradeMsgOp: TonstakeControllerPoolUpgradeMsgBody{}, + DedustCreateVolatilePoolMsgOp: DedustCreateVolatilePoolMsgBody{}, TonstakePoolPrepareGovernanceMigrationMsgOp: TonstakePoolPrepareGovernanceMigrationMsgBody{}, WhalesNominatorsAcceptStakeMsgOp: WhalesNominatorsAcceptStakeMsgBody{}, TonstakePoolSetDepositSettingsMsgOp: TonstakePoolSetDepositSettingsMsgBody{}, @@ -2233,6 +2293,7 @@ var KnownMsgInTypes = map[string]any{ TopUpMsgOp: TopUpMsgBody{}, StorageContractConfirmedMsgOp: StorageContractConfirmedMsgBody{}, ExcessMsgOp: ExcessMsgBody{}, + DedustDepositLiquidityMsgOp: DedustDepositLiquidityMsgBody{}, StormVaultUnstakeMsgOp: StormVaultUnstakeMsgBody{}, WhalesNominatorsWithdrawMsgOp: WhalesNominatorsWithdrawMsgBody{}, TonstakeNftPayoutMsgOp: TonstakeNftPayoutMsgBody{}, @@ -2270,6 +2331,8 @@ var ( decodeFuncHighloadWalletSignedV3ExtInMsgBody = decodeMsg(tlb.Tag{Val: 0x00000000, Len: 0}, HighloadWalletSignedV3ExtInMsgOp, HighloadWalletSignedV3ExtInMsgBody{}) // 0x00000000 decodeFuncPreprocessedWalletSignedV2ExtInMsgBody = decodeMsg(tlb.Tag{Val: 0x00000000, Len: 0}, PreprocessedWalletSignedV2ExtInMsgOp, PreprocessedWalletSignedV2ExtInMsgBody{}) + // 0x00000000 + decodeFuncHighloadWalletSignedV2ExtInMsgBody = decodeMsg(tlb.Tag{Val: 0x00000000, Len: 0}, HighloadWalletSignedV2ExtInMsgOp, HighloadWalletSignedV2ExtInMsgBody{}) // 0x7369676e decodeFuncWalletSignedExternalV5R1ExtInMsgBody = decodeMsg(tlb.Tag{Val: 0x7369676e, Len: 32}, WalletSignedExternalV5R1ExtInMsgOp, WalletSignedExternalV5R1ExtInMsgBody{}) ) @@ -2285,6 +2348,7 @@ const ( WalletSignedV4ExtInMsgOp MsgOpName = "WalletSignedV4" HighloadWalletSignedV3ExtInMsgOp MsgOpName = "HighloadWalletSignedV3" PreprocessedWalletSignedV2ExtInMsgOp MsgOpName = "PreprocessedWalletSignedV2" + HighloadWalletSignedV2ExtInMsgOp MsgOpName = "HighloadWalletSignedV2" WalletSignedExternalV5R1ExtInMsgOp MsgOpName = "WalletSignedExternalV5R1" ) @@ -2293,6 +2357,7 @@ const ( WalletSignedV4ExtInMsgOpCode MsgOpCode = 0x00000000 HighloadWalletSignedV3ExtInMsgOpCode MsgOpCode = 0x00000000 PreprocessedWalletSignedV2ExtInMsgOpCode MsgOpCode = 0x00000000 + HighloadWalletSignedV2ExtInMsgOpCode MsgOpCode = 0x00000000 WalletSignedExternalV5R1ExtInMsgOpCode MsgOpCode = 0x7369676e ) @@ -2323,6 +2388,13 @@ type PreprocessedWalletSignedV2ExtInMsgBody struct { Msg PreprocessedWalletV2MsgInner `tlb:"^"` } +type HighloadWalletSignedV2ExtInMsgBody struct { + Signature tlb.Bits512 + SubwalletId uint32 + QueryId uint64 + Payload tlb.HashmapE[tlb.Uint16, SendMessageAction] +} + type WalletSignedExternalV5R1ExtInMsgBody struct { WalletId uint32 ValidUntil uint32 @@ -2337,20 +2409,28 @@ var KnownMsgExtInTypes = map[string]any{ WalletSignedV4ExtInMsgOp: WalletSignedV4ExtInMsgBody{}, HighloadWalletSignedV3ExtInMsgOp: HighloadWalletSignedV3ExtInMsgBody{}, PreprocessedWalletSignedV2ExtInMsgOp: PreprocessedWalletSignedV2ExtInMsgBody{}, + HighloadWalletSignedV2ExtInMsgOp: HighloadWalletSignedV2ExtInMsgBody{}, WalletSignedExternalV5R1ExtInMsgOp: WalletSignedExternalV5R1ExtInMsgBody{}, } var ( + // 0x3aa870a6 + decodeFuncDedustWithdrawalExtOutMsgBody = decodeMsg(tlb.Tag{Val: 0x3aa870a6, Len: 32}, DedustWithdrawalExtOutMsgOp, DedustWithdrawalExtOutMsgBody{}) // 0x56a8e920 decodeFuncMegatonUpdateMiningParamsExtOutMsgBody = decodeMsg(tlb.Tag{Val: 0x56a8e920, Len: 32}, MegatonUpdateMiningParamsExtOutMsgOp, MegatonUpdateMiningParamsExtOutMsgBody{}) // 0x7362d09c decodeFuncMegatonSwapExtOutMsgBody = decodeMsg(tlb.Tag{Val: 0x7362d09c, Len: 32}, MegatonSwapExtOutMsgOp, MegatonSwapExtOutMsgBody{}) // 0x9c610de3 decodeFuncDedustSwapExtOutMsgBody = decodeMsg(tlb.Tag{Val: 0x9c610de3, Len: 32}, DedustSwapExtOutMsgOp, DedustSwapExtOutMsgBody{}) + // 0xb544f4a4 + decodeFuncDedustDepositExtOutMsgBody = decodeMsg(tlb.Tag{Val: 0xb544f4a4, Len: 32}, DedustDepositExtOutMsgOp, DedustDepositExtOutMsgBody{}) ) var opcodedMsgExtOutDecodeFunctions = map[uint32]msgDecoderFunc{ + // 0x3aa870a6 + DedustWithdrawalExtOutMsgOpCode: decodeFuncDedustWithdrawalExtOutMsgBody, + // 0x56a8e920 MegatonUpdateMiningParamsExtOutMsgOpCode: decodeFuncMegatonUpdateMiningParamsExtOutMsgBody, @@ -2359,20 +2439,36 @@ var opcodedMsgExtOutDecodeFunctions = map[uint32]msgDecoderFunc{ // 0x9c610de3 DedustSwapExtOutMsgOpCode: decodeFuncDedustSwapExtOutMsgBody, + + // 0xb544f4a4 + DedustDepositExtOutMsgOpCode: decodeFuncDedustDepositExtOutMsgBody, } const ( + DedustWithdrawalExtOutMsgOp MsgOpName = "DedustWithdrawal" MegatonUpdateMiningParamsExtOutMsgOp MsgOpName = "MegatonUpdateMiningParams" MegatonSwapExtOutMsgOp MsgOpName = "MegatonSwap" DedustSwapExtOutMsgOp MsgOpName = "DedustSwap" + DedustDepositExtOutMsgOp MsgOpName = "DedustDeposit" ) const ( + DedustWithdrawalExtOutMsgOpCode MsgOpCode = 0x3aa870a6 MegatonUpdateMiningParamsExtOutMsgOpCode MsgOpCode = 0x56a8e920 MegatonSwapExtOutMsgOpCode MsgOpCode = 0x7362d09c DedustSwapExtOutMsgOpCode MsgOpCode = 0x9c610de3 + DedustDepositExtOutMsgOpCode MsgOpCode = 0xb544f4a4 ) +type DedustWithdrawalExtOutMsgBody struct { + SenderAddr tlb.MsgAddress + Liquidity tlb.Grams + Amount0 tlb.Grams + Amount1 tlb.Grams + Reserve0 tlb.Grams + Reserve1 tlb.Grams +} + type MegatonUpdateMiningParamsExtOutMsgBody struct { PoolAddr tlb.MsgAddress LastMined tlb.Uint256 @@ -2406,8 +2502,19 @@ type DedustSwapExtOutMsgBody struct { } `tlb:"^"` } +type DedustDepositExtOutMsgBody struct { + SenderAddr tlb.MsgAddress + Amount0 tlb.Grams + Amount1 tlb.Grams + Reserve0 tlb.Grams + Reserve1 tlb.Grams + Liquidity tlb.Grams +} + var KnownMsgExtOutTypes = map[string]any{ + DedustWithdrawalExtOutMsgOp: DedustWithdrawalExtOutMsgBody{}, MegatonUpdateMiningParamsExtOutMsgOp: MegatonUpdateMiningParamsExtOutMsgBody{}, MegatonSwapExtOutMsgOp: MegatonSwapExtOutMsgBody{}, DedustSwapExtOutMsgOp: DedustSwapExtOutMsgBody{}, + DedustDepositExtOutMsgOp: DedustDepositExtOutMsgBody{}, } diff --git a/abi/schemas/dedust.xml b/abi/schemas/dedust.xml index da8ec79..776d634 100644 --- a/abi/schemas/dedust.xml +++ b/abi/schemas/dedust.xml @@ -9,19 +9,48 @@ step_params#_ kind_out:Bool limit:(VarUInteger 16) next:(Maybe ^DedustSwapStep) = DedustSwapStepParams; step#_ pool_addr:MsgAddress params:DedustSwapStepParams = DedustSwapStep; + + volatile$0 = DedustPoolType; + stable$1 = DedustPoolType; + pool_params#_ pool_type:DedustPoolType asset0:DedustAsset asset1:DedustAsset = DedustPoolParams; + + + + + + + + + + + + + + + + + + + + + + + + + @@ -30,6 +59,7 @@ + @@ -62,6 +92,64 @@ bool + + + DedustAsset + + + msgaddress + + + + + + + + + + + + + + + msgaddress + int257 + DedustAsset + DedustAsset + + + msgaddress + + + + + int257 + int257 + + + + + DedustAsset + int257 + + + DedustAsset + int257 + int257 + + + + + int257 + int257 + + + + + int257 + int257 + + deposit_liquidity_all#b56b9598 query_id:uint64 proof:^Cell @@ -90,14 +178,47 @@ swap#ea06185d query_id:uint64 amount:Coins step:DedustSwapStep swap_params:^DedustSwapParams = InMsgBody; + + deposit_liquidity#d55e4686 query_id:uint64 amount:Coins pool_params:DedustPoolParams + params:^[ min_lp_amount:Coins + asset0_target_balance:Coins asset1_target_balance:Coins ] + fulfill_payload:(Maybe ^Cell) + reject_payload:(Maybe ^Cell) = InMsgBody; + dedust_swap#e3a0d482 step:DedustSwapStep swap_params:^DedustSwapParams = ForwardPayload; + + deposit_liquidity#40e108d6 pool_params:DedustPoolParams min_lp_amount:Coins + asset0_target_balance:Coins asset1_target_balance:Coins + fulfill_payload:(Maybe ^Cell) + reject_payload:(Maybe ^Cell) = ForwardPayload; + swap#9c610de3 asset_in:DedustAsset asset_out:DedustAsset amount_in:Coins amount_out:Coins ^[ sender_addr:MsgAddress referral_addr:MsgAddress reserve0:Coins reserve1:Coins ] = ExtOutMsgBody; + + deposit#b544f4a4 sender_addr:MsgAddressInt amount0:Coins amount1:Coins + reserve0:Coins reserve1:Coins liquidity:Coins = ExtOutMsgBody; + + + withdrawal#3aa870a6 sender_addr:MsgAddressInt liquidity:Coins + amount0:Coins amount1:Coins + reserve0:Coins reserve1:Coins = ExtOutMsgBody; + + + + create_vault#21cfe02b query_id:uint64 asset:DedustAsset = InMsgBody; + + + create_volatile_pool#97d51f2f query_id:uint64 asset0:DedustAsset asset1:DedustAsset = InMsgBody; + + + cancel_deposit#166cedee query_id:uint64 payload:(Maybe ^Cell) = InMsgBody; + + \ No newline at end of file diff --git a/abi/schemas/wallets.xml b/abi/schemas/wallets.xml index afc3ae6..b1681d1 100644 --- a/abi/schemas/wallets.xml +++ b/abi/schemas/wallets.xml @@ -118,6 +118,10 @@ 9494d1cc8edf12f05671a1a9ba09921096eb50811e1924ec65c3c629fbb80812 + + + + 8ceb45b3cd4b5cc60eaae1c13b9c092392677fe536b2e9b2d801b62eff931fe1 @@ -212,4 +216,7 @@ extension_action#6578746e query_id:uint64 actions:(Maybe ^W5Actions) extended:(Maybe W5ExtendedActions) = InternalMsgBody; + + signed#_ signature:bits512 subwallet_id:uint32 query_id:uint64 payload:(HashmapE 16 SendMessageAction) = ExternalMsgBody; + diff --git a/abi/types.go b/abi/types.go index d7336ec..c53579c 100644 --- a/abi/types.go +++ b/abi/types.go @@ -45,6 +45,37 @@ func (t *DedustAsset) MarshalJSON() ([]byte, error) { } } +type DedustPoolParams struct { + PoolType DedustPoolType + Asset0 DedustAsset + Asset1 DedustAsset +} + +type DedustPoolType struct { + tlb.SumType + Volatile struct{} `tlbSumType:"$0"` + Stable struct{} `tlbSumType:"$1"` +} + +func (t *DedustPoolType) MarshalJSON() ([]byte, error) { + switch t.SumType { + case "Volatile": + bytes, err := json.Marshal(t.Volatile) + if err != nil { + return nil, err + } + return []byte(fmt.Sprintf(`{"SumType": "Volatile","Volatile":%v}`, string(bytes))), nil + case "Stable": + bytes, err := json.Marshal(t.Stable) + if err != nil { + return nil, err + } + return []byte(fmt.Sprintf(`{"SumType": "Stable","Stable":%v}`, string(bytes))), nil + default: + return nil, fmt.Errorf("unknown sum type %v", t.SumType) + } +} + type DedustSwapParams struct { Deadline uint32 RecipientAddr tlb.MsgAddress diff --git a/tlb/hashmap.go b/tlb/hashmap.go index 1f29d01..637b0e5 100644 --- a/tlb/hashmap.go +++ b/tlb/hashmap.go @@ -299,7 +299,7 @@ func (h Hashmap[keyT, T]) Get(key keyT) (T, bool) { } return *new(T), false } -func (h Hashmap[keyT, T]) Put(key keyT, value T) { +func (h *Hashmap[keyT, T]) Put(key keyT, value T) { for i, k := range h.keys { if k.Equal(key) { h.values[i] = value @@ -681,7 +681,7 @@ func (h HashmapE[keyT, T]) Get(key keyT) (T, bool) { return h.m.Get(key) } -func (h HashmapE[keyT, T]) Put(key keyT, value T) { +func (h *HashmapE[keyT, T]) Put(key keyT, value T) { h.m.Put(key, value) }