@paraswap/dex-lib 4.0.0 → 4.0.1-balancer-v3-cables.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (359) hide show
  1. package/.vscode/launch.json +53 -0
  2. package/.vscode/settings.json +2 -0
  3. package/.vscode/tasks.json +15 -0
  4. package/build/abi/balancer-v3/batch-router.json +989 -0
  5. package/build/abi/balancer-v3/router.json +1792 -0
  6. package/build/abi/balancer-v3/vault-extension.json +2834 -0
  7. package/build/abi/permit2.json +581 -0
  8. package/build/abi/uniswap-v3/AlienBaseV3Router.abi.json +52 -0
  9. package/build/abi/usual-m-smart-m/usualM.abi.json +483 -0
  10. package/build/abi/usual-m-usd0/usualCollateralDao.abi.json +681 -0
  11. package/build/abi/{angle-transmuter/ChainlinkAccessControlledOffchainAggregator.json → wombat/pool.json} +637 -594
  12. package/build/bigint-constants.d.ts +1 -0
  13. package/build/bigint-constants.js +2 -1
  14. package/build/bigint-constants.js.map +1 -1
  15. package/build/config.js +28 -0
  16. package/build/config.js.map +1 -1
  17. package/build/constants.d.ts +2 -0
  18. package/build/constants.js +4 -1
  19. package/build/constants.js.map +1 -1
  20. package/build/dex/aave-v1/aave-v1.js +1 -0
  21. package/build/dex/aave-v1/aave-v1.js.map +1 -1
  22. package/build/dex/aave-v2/tokens-avalanche.json +44 -0
  23. package/build/dex/aave-v2/tokens-mainnet.json +188 -0
  24. package/build/dex/aave-v2/tokens-polygon.json +44 -0
  25. package/build/dex/augustus-approvals.d.ts +3 -2
  26. package/build/dex/augustus-approvals.js +35 -16
  27. package/build/dex/augustus-approvals.js.map +1 -1
  28. package/build/dex/bProtocol.d.ts +18 -0
  29. package/build/dex/bProtocol.js +39 -0
  30. package/build/dex/bProtocol.js.map +1 -0
  31. package/build/dex/balancer-v3/abi/balancerBatchRouter.d.ts +729 -0
  32. package/build/dex/balancer-v3/abi/balancerBatchRouter.js +732 -0
  33. package/build/dex/balancer-v3/abi/balancerBatchRouter.js.map +1 -0
  34. package/build/dex/balancer-v3/abi/balancerRouter.d.ts +1406 -0
  35. package/build/dex/balancer-v3/abi/balancerRouter.js +1175 -0
  36. package/build/dex/balancer-v3/abi/balancerRouter.js.map +1 -0
  37. package/build/dex/balancer-v3/abi/vaultExtension.V3.d.ts +2081 -0
  38. package/build/dex/balancer-v3/abi/vaultExtension.V3.js +1851 -0
  39. package/build/dex/balancer-v3/abi/vaultExtension.V3.js.map +1 -0
  40. package/build/dex/balancer-v3/balancer-v3-pool.d.ts +80 -0
  41. package/build/dex/balancer-v3/balancer-v3-pool.js +469 -0
  42. package/build/dex/balancer-v3/balancer-v3-pool.js.map +1 -0
  43. package/build/dex/balancer-v3/balancer-v3-sepolia-pools.d.ts +34 -0
  44. package/build/dex/balancer-v3/balancer-v3-sepolia-pools.js +406 -0
  45. package/build/dex/balancer-v3/balancer-v3-sepolia-pools.js.map +1 -0
  46. package/build/dex/balancer-v3/balancer-v3.d.ts +56 -0
  47. package/build/dex/balancer-v3/balancer-v3.js +412 -0
  48. package/build/dex/balancer-v3/balancer-v3.js.map +1 -0
  49. package/build/dex/balancer-v3/config.d.ts +9 -0
  50. package/build/dex/balancer-v3/config.js +45 -0
  51. package/build/dex/balancer-v3/config.js.map +1 -0
  52. package/build/dex/balancer-v3/getGasCost.d.ts +2 -0
  53. package/build/dex/balancer-v3/getGasCost.js +40 -0
  54. package/build/dex/balancer-v3/getGasCost.js.map +1 -0
  55. package/build/dex/balancer-v3/getOnChainState.d.ts +10 -0
  56. package/build/dex/balancer-v3/getOnChainState.js +163 -0
  57. package/build/dex/balancer-v3/getOnChainState.js.map +1 -0
  58. package/build/dex/balancer-v3/getPoolsApi.d.ts +2 -0
  59. package/build/dex/balancer-v3/getPoolsApi.js +84 -0
  60. package/build/dex/balancer-v3/getPoolsApi.js.map +1 -0
  61. package/build/dex/balancer-v3/getTopPoolsApi.d.ts +17 -0
  62. package/build/dex/balancer-v3/getTopPoolsApi.js +65 -0
  63. package/build/dex/balancer-v3/getTopPoolsApi.js.map +1 -0
  64. package/build/dex/balancer-v3/optimizer.d.ts +2 -0
  65. package/build/dex/balancer-v3/optimizer.js +47 -0
  66. package/build/dex/balancer-v3/optimizer.js.map +1 -0
  67. package/build/dex/balancer-v3/stablePool.d.ts +7 -0
  68. package/build/dex/balancer-v3/stablePool.js +73 -0
  69. package/build/dex/balancer-v3/stablePool.js.map +1 -0
  70. package/build/dex/balancer-v3/types.d.ts +62 -0
  71. package/build/dex/balancer-v3/types.js +3 -0
  72. package/build/dex/balancer-v3/types.js.map +1 -0
  73. package/build/dex/balancer-v3/weightedPool.d.ts +1 -0
  74. package/build/dex/balancer-v3/weightedPool.js +6 -0
  75. package/build/dex/balancer-v3/weightedPool.js.map +1 -0
  76. package/build/dex/bancor.d.ts +26 -0
  77. package/build/dex/bancor.js +58 -0
  78. package/build/dex/bancor.js.map +1 -0
  79. package/build/dex/cables/cables.d.ts +7 -5
  80. package/build/dex/cables/cables.js +229 -86
  81. package/build/dex/cables/cables.js.map +1 -1
  82. package/build/dex/cables/constants.d.ts +13 -12
  83. package/build/dex/cables/constants.js +14 -16
  84. package/build/dex/cables/constants.js.map +1 -1
  85. package/build/dex/cables/types.d.ts +7 -0
  86. package/build/dex/cables/types.js +8 -1
  87. package/build/dex/cables/types.js.map +1 -1
  88. package/build/dex/compound.d.ts +18 -0
  89. package/build/dex/compound.js +46 -0
  90. package/build/dex/compound.js.map +1 -0
  91. package/build/dex/curve-v2.d.ts +58 -0
  92. package/build/dex/curve-v2.js +180 -0
  93. package/build/dex/curve-v2.js.map +1 -0
  94. package/build/dex/dodo-v1.d.ts +33 -0
  95. package/build/dex/dodo-v1.js +63 -0
  96. package/build/dex/dodo-v1.js.map +1 -0
  97. package/build/dex/fluid-dex/fluid-dex-pool.d.ts +47 -0
  98. package/build/dex/fluid-dex/fluid-dex-pool.js +119 -0
  99. package/build/dex/fluid-dex/fluid-dex-pool.js.map +1 -0
  100. package/build/dex/inception/inception-event-pool.d.ts +4 -4
  101. package/build/dex/inception/inception-event-pool.js +7 -9
  102. package/build/dex/inception/inception-event-pool.js.map +1 -1
  103. package/build/dex/inception/inception.d.ts +6 -6
  104. package/build/dex/inception/inception.js +16 -40
  105. package/build/dex/inception/inception.js.map +1 -1
  106. package/build/dex/inception/utils.d.ts +1 -0
  107. package/build/dex/inception/utils.js +22 -1
  108. package/build/dex/inception/utils.js.map +1 -1
  109. package/build/dex/index.js +4 -0
  110. package/build/dex/index.js.map +1 -1
  111. package/build/dex/lido.d.ts +19 -0
  112. package/build/dex/lido.js +42 -0
  113. package/build/dex/lido.js.map +1 -0
  114. package/build/dex/maker-psm/scripts/gem.abi.json +136 -0
  115. package/build/dex/maker-psm/scripts/validate-state.d.ts +0 -0
  116. package/build/dex/maker-psm/scripts/validate-state.js +185 -0
  117. package/build/dex/maker-psm/scripts/validate-state.js.map +1 -0
  118. package/build/dex/maker-psm/scripts/vat.abi.json +243 -0
  119. package/build/dex/onebit.d.ts +25 -0
  120. package/build/dex/onebit.js +42 -0
  121. package/build/dex/onebit.js.map +1 -0
  122. package/build/dex/platypus/platypus.js +17 -3
  123. package/build/dex/platypus/platypus.js.map +1 -1
  124. package/build/dex/smoothy.d.ts +26 -0
  125. package/build/dex/smoothy.js +48 -0
  126. package/build/dex/smoothy.js.map +1 -0
  127. package/build/dex/solidly-v3/scripts/check-event-pool-event.d.ts +1 -0
  128. package/build/dex/solidly-v3/scripts/check-event-pool-event.js +53 -0
  129. package/build/dex/solidly-v3/scripts/check-event-pool-event.js.map +1 -0
  130. package/build/dex/stable-pool.d.ts +28 -0
  131. package/build/dex/stable-pool.js +55 -0
  132. package/build/dex/stable-pool.js.map +1 -0
  133. package/build/dex/swaap-v1/swaap-v1.js +4 -0
  134. package/build/dex/swaap-v1/swaap-v1.js.map +1 -1
  135. package/build/dex/trader-joe-v2.1/trader-joe-v2.1-new.d.ts +7 -0
  136. package/build/dex/trader-joe-v2.1/trader-joe-v2.1-new.js +20 -0
  137. package/build/dex/trader-joe-v2.1/trader-joe-v2.1-new.js.map +1 -0
  138. package/build/dex/trader-joe-v2.1.d.ts +43 -0
  139. package/build/dex/trader-joe-v2.1.js +79 -0
  140. package/build/dex/trader-joe-v2.1.js.map +1 -0
  141. package/build/dex/uniswap-v3/forks/alien-base-v3/alien-base-v3.d.ts +17 -0
  142. package/build/dex/uniswap-v3/forks/alien-base-v3/alien-base-v3.js +64 -0
  143. package/build/dex/uniswap-v3/forks/alien-base-v3/alien-base-v3.js.map +1 -0
  144. package/build/dex/uniswap-v3/forks/alien-v3/alien-v3.d.ts +17 -0
  145. package/build/dex/uniswap-v3/forks/alien-v3/alien-v3.js +79 -0
  146. package/build/dex/uniswap-v3/forks/alien-v3/alien-v3.js.map +1 -0
  147. package/build/dex/uniswap-v3/uniswap-v3-pricing.d.ts +4 -0
  148. package/build/dex/uniswap-v3/uniswap-v3-pricing.js +43 -0
  149. package/build/dex/uniswap-v3/uniswap-v3-pricing.js.map +1 -0
  150. package/build/dex/uniswap-v3/uniswap-v3-worker.d.ts +1 -0
  151. package/build/dex/uniswap-v3/uniswap-v3-worker.js +10 -0
  152. package/build/dex/uniswap-v3/uniswap-v3-worker.js.map +1 -0
  153. package/build/dex/usual/types.d.ts +13 -0
  154. package/build/dex/usual/types.js +3 -0
  155. package/build/dex/usual/types.js.map +1 -0
  156. package/build/dex/usual/usual-bond.d.ts +18 -0
  157. package/build/dex/usual/usual-bond.js +52 -0
  158. package/build/dex/usual/usual-bond.js.map +1 -0
  159. package/build/dex/usual/usual-m-smart-m.d.ts +17 -0
  160. package/build/dex/usual/usual-m-smart-m.js +50 -0
  161. package/build/dex/usual/usual-m-smart-m.js.map +1 -0
  162. package/build/dex/usual/usual-m-usd0.d.ts +17 -0
  163. package/build/dex/usual/usual-m-usd0.js +51 -0
  164. package/build/dex/usual/usual-m-usd0.js.map +1 -0
  165. package/build/dex/usual/usual.d.ts +27 -0
  166. package/build/dex/usual/usual.js +125 -0
  167. package/build/dex/usual/usual.js.map +1 -0
  168. package/build/dex/usual-m-smart-m/config.d.ts +3 -0
  169. package/build/dex/usual-m-smart-m/config.js +13 -0
  170. package/build/dex/usual-m-smart-m/config.js.map +1 -0
  171. package/build/dex/usual-m-smart-m/types.d.ts +7 -0
  172. package/build/dex/usual-m-smart-m/types.js +3 -0
  173. package/build/dex/usual-m-smart-m/types.js.map +1 -0
  174. package/build/dex/usual-m-smart-m/usual-m-smart-m.d.ts +35 -0
  175. package/build/dex/usual-m-smart-m/usual-m-smart-m.js +161 -0
  176. package/build/dex/usual-m-smart-m/usual-m-smart-m.js.map +1 -0
  177. package/build/dex/usual-m-usd0/config.d.ts +3 -0
  178. package/build/dex/usual-m-usd0/config.js +14 -0
  179. package/build/dex/usual-m-usd0/config.js.map +1 -0
  180. package/build/dex/usual-m-usd0/types.d.ts +8 -0
  181. package/build/dex/usual-m-usd0/types.js +3 -0
  182. package/build/dex/usual-m-usd0/types.js.map +1 -0
  183. package/build/dex/usual-m-usd0/usual-m-usd0.d.ts +35 -0
  184. package/build/dex/usual-m-usd0/usual-m-usd0.js +159 -0
  185. package/build/dex/usual-m-usd0/usual-m-usd0.js.map +1 -0
  186. package/build/dex/weth/config.js +3 -0
  187. package/build/dex/weth/config.js.map +1 -1
  188. package/build/executor/Executor01BytecodeBuilder.js +2 -2
  189. package/build/executor/Executor01BytecodeBuilder.js.map +1 -1
  190. package/build/executor/Executor02BytecodeBuilder.js +2 -2
  191. package/build/executor/Executor02BytecodeBuilder.js.map +1 -1
  192. package/build/executor/Executor03BytecodeBuilder.js +2 -2
  193. package/build/executor/Executor03BytecodeBuilder.js.map +1 -1
  194. package/build/executor/ExecutorBytecodeBuilder.d.ts +3 -1
  195. package/build/executor/ExecutorBytecodeBuilder.js +35 -2
  196. package/build/executor/ExecutorBytecodeBuilder.js.map +1 -1
  197. package/build/generic-swap-transaction-builder.js +5 -1
  198. package/build/generic-swap-transaction-builder.js.map +1 -1
  199. package/build/types.d.ts +1 -0
  200. package/package.json +2 -1
  201. package/scripts/run-dex-integration-v3.ts +78 -0
  202. package/src/abi/balancer-v3/batch-router.json +989 -0
  203. package/src/abi/balancer-v3/router.json +1792 -0
  204. package/src/abi/balancer-v3/vault-extension.json +2834 -0
  205. package/src/abi/permit2.json +581 -0
  206. package/src/bigint-constants.ts +1 -0
  207. package/src/config.ts +29 -0
  208. package/src/constants.ts +4 -0
  209. package/src/dex/augustus-approvals.ts +52 -19
  210. package/src/dex/balancer-v3/balancer-v3-e2e.test.ts +275 -0
  211. package/src/dex/balancer-v3/balancer-v3-events.test.ts +223 -0
  212. package/src/dex/balancer-v3/balancer-v3-integration.test.ts +879 -0
  213. package/src/dex/balancer-v3/balancer-v3-pool.ts +656 -0
  214. package/src/dex/balancer-v3/balancer-v3.ts +538 -0
  215. package/src/dex/balancer-v3/config.ts +46 -0
  216. package/src/dex/balancer-v3/getGasCost.ts +37 -0
  217. package/src/dex/balancer-v3/getOnChainState.ts +326 -0
  218. package/src/dex/balancer-v3/getPoolsApi.ts +129 -0
  219. package/src/dex/balancer-v3/getTopPoolsApi.ts +96 -0
  220. package/src/dex/balancer-v3/optimizer.ts +66 -0
  221. package/src/dex/balancer-v3/stablePool.ts +78 -0
  222. package/src/dex/balancer-v3/types.ts +86 -0
  223. package/src/dex/balancer-v3/weightedPool.ts +2 -0
  224. package/src/dex/index.ts +4 -0
  225. package/src/dex/weth/config.ts +3 -0
  226. package/src/executor/Executor01BytecodeBuilder.ts +2 -0
  227. package/src/executor/Executor02BytecodeBuilder.ts +2 -0
  228. package/src/executor/Executor03BytecodeBuilder.ts +2 -0
  229. package/src/executor/ExecutorBytecodeBuilder.ts +63 -2
  230. package/src/generic-swap-transaction-builder.ts +6 -2
  231. package/src/types.ts +1 -0
  232. package/tests/constants-e2e.ts +66 -0
  233. package/build/abi/Aave_GSM.json +0 -751
  234. package/build/abi/Balancer.json +0 -257
  235. package/build/abi/BalancerV2.json +0 -1179
  236. package/build/abi/RamsesV2Pool.abi.json +0 -1554
  237. package/build/abi/RamsesV2Quoter.abi.json +0 -274
  238. package/build/abi/USDM.json +0 -807
  239. package/build/abi/UniswapV2Router.json +0 -397
  240. package/build/abi/angle-transmuter/ChainlinkEACAggregatorProxy.json +0 -509
  241. package/build/abi/curve-v1/CurveBUSDv2.abi.json +0 -1356
  242. package/build/abi/curve-v1/CurveTokenV1.json +0 -305
  243. package/build/abi/curve-v1/CurveTokenV2.json +0 -318
  244. package/build/abi/curve-v1/CurveV1StableNg.json +0 -1452
  245. package/build/abi/curve-v1/CurveV2Swap.json +0 -700
  246. package/build/abi/curve-v1/FactoryCryptoRegistry.json +0 -316
  247. package/build/abi/curve-v1/FactoryRegistry.json +0 -508
  248. package/build/abi/curve-v1/StableSwapAave.json +0 -1152
  249. package/build/abi/curve-v1/StableSwapBUSD.json +0 -814
  250. package/build/abi/curve-v1/StableSwapCompound.json +0 -814
  251. package/build/abi/curve-v1/StableSwapIDLE.json +0 -1253
  252. package/build/abi/curve-v1/StableSwapPax.json +0 -865
  253. package/build/abi/curve-v1/StableSwapSnow.json +0 -900
  254. package/build/abi/curve-v1/StableSwapUSDN.json +0 -1004
  255. package/build/abi/curve-v1/StableSwapUSDT.json +0 -814
  256. package/build/abi/curve-v1/StableSwapY.json +0 -814
  257. package/build/abi/inception/inception-ineth.json +0 -609
  258. package/build/abi/kyberdmm/kyber-storage.abi.json +0 -824
  259. package/build/abi/kyberdmm.abi.json +0 -1148
  260. package/build/abi/maverick-v2/MaverickV2Quoter.json +0 -278
  261. package/build/abi/nerve/nerve-metapool.json +0 -790
  262. package/build/abi/uniswap-v3/UniswapV3Quoter.abi.json +0 -193
  263. package/build/abi/velodrome-slipstream/VelodromeSlipstreamQuoterV2.abi.json +0 -267
  264. package/build/dex/balancer-v1/balancer-pools.json +0 -33333
  265. package/build/dex/bebop/websocket-fetcher.d.ts +0 -35
  266. package/build/dex/bebop/websocket-fetcher.js +0 -87
  267. package/build/dex/bebop/websocket-fetcher.js.map +0 -1
  268. package/build/dex/idle-dao/idle-dao-pool.d.ts +0 -56
  269. package/build/dex/idle-dao/idle-dao-pool.js +0 -176
  270. package/build/dex/idle-dao/idle-dao-pool.js.map +0 -1
  271. package/build/dex/idle-dao/idle-dao-pooling-pool.d.ts +0 -16
  272. package/build/dex/idle-dao/idle-dao-pooling-pool.js +0 -57
  273. package/build/dex/idle-dao/idle-dao-pooling-pool.js.map +0 -1
  274. package/build/dex/idle-dao/scripts.d.ts +0 -9
  275. package/build/dex/idle-dao/scripts.js +0 -552
  276. package/build/dex/idle-dao/scripts.js.map +0 -1
  277. package/build/dex/inception/inception-native.d.ts +0 -43
  278. package/build/dex/inception/inception-native.js +0 -131
  279. package/build/dex/inception/inception-native.js.map +0 -1
  280. package/build/dex/inception/inception-pool.d.ts +0 -18
  281. package/build/dex/inception/inception-pool.js +0 -32
  282. package/build/dex/inception/inception-pool.js.map +0 -1
  283. package/build/dex/inception/inception-price-feed.d.ts +0 -19
  284. package/build/dex/inception/inception-price-feed.js +0 -51
  285. package/build/dex/inception/inception-price-feed.js.map +0 -1
  286. package/build/executor/fixtures/executor01/exchange-params/price-route-multiswap-balancerv1-curvev1-eth-usdc-gusd.json +0 -16
  287. package/build/executor/fixtures/executor01/exchange-params/price-route-multiswap-balancerv1-sushiv3-wbtc-eth-sushi.json +0 -16
  288. package/build/executor/fixtures/executor01/exchange-params/price-route-multiswap-sushiv3-curvev1-eth-usdc-gusd.json +0 -16
  289. package/build/executor/fixtures/executor01/exchange-params/price-route-multiswap-sushiv3-curvev1-gusd-usdc-eth.json +0 -16
  290. package/build/executor/fixtures/executor01/exchange-params/price-route-multiswap-sushiv3-dai-usdc-eth.json +0 -16
  291. package/build/executor/fixtures/executor01/exchange-params/price-route-multiswap-sushiv3-eth-usdc-dai.json +0 -16
  292. package/build/executor/fixtures/executor01/exchange-params/price-route-multiswap-sushiv3-usdc-eth-wbtc.json +0 -16
  293. package/build/executor/fixtures/executor01/exchange-params/price-route-multiswap-sushiv3-usdt-usdc-dai.json +0 -16
  294. package/build/executor/fixtures/executor01/exchange-params/price-route-simpleSwap-balancerv1-eth-usdc.json +0 -9
  295. package/build/executor/fixtures/executor01/exchange-params/price-route-simpleSwap-balancerv1-usdc-eth.json +0 -9
  296. package/build/executor/fixtures/executor01/exchange-params/price-route-simpleSwap-balancerv1-usdc-wbtc.json +0 -9
  297. package/build/executor/fixtures/executor01/exchange-params/price-route-simpleSwap-curvev1-eth-steth.json +0 -9
  298. package/build/executor/fixtures/executor01/exchange-params/price-route-simpleSwap-curvev1-steth-eth.json +0 -9
  299. package/build/executor/fixtures/executor01/exchange-params/price-route-simpleSwap-curvev1-usdc-usdt.json +0 -9
  300. package/build/executor/fixtures/executor01/exchange-params/price-route-simpleSwap-univ3-eth-usdc.json +0 -9
  301. package/build/executor/fixtures/executor01/exchange-params/price-route-simpleSwap-univ3-usdc-eth.json +0 -9
  302. package/build/executor/fixtures/executor01/exchange-params/price-route-simpleSwap-univ3-usdc-usdt.json +0 -9
  303. package/build/executor/fixtures/executor01/maybe-weth-calldata/price-route-multiswap-balancerv1-sushiv3-wbtc-eth-sushi.json +0 -12
  304. package/build/executor/fixtures/executor01/maybe-weth-calldata/price-route-multiswap-sushiv3-curvev1-eth-usdc-gusd.json +0 -7
  305. package/build/executor/fixtures/executor01/maybe-weth-calldata/price-route-multiswap-sushiv3-curvev1-gusd-usdc-eth.json +0 -7
  306. package/build/executor/fixtures/executor01/maybe-weth-calldata/price-route-multiswap-sushiv3-dai-usdc-eth.json +0 -7
  307. package/build/executor/fixtures/executor01/maybe-weth-calldata/price-route-multiswap-sushiv3-eth-usdc-dai.json +0 -7
  308. package/build/executor/fixtures/executor01/maybe-weth-calldata/price-route-multiswap-sushiv3-usdc-eth-wbtc.json +0 -12
  309. package/build/executor/fixtures/executor01/maybe-weth-calldata/price-route-simpleSwap-univ3-eth-usdc.json +0 -7
  310. package/build/executor/fixtures/executor01/maybe-weth-calldata/price-route-simpleSwap-univ3-usdc-eth.json +0 -7
  311. package/build/executor/fixtures/executor01/routes/price-route-multiswap-balancerv1-curvev1-eth-usdc-gusd.json +0 -78
  312. package/build/executor/fixtures/executor01/routes/price-route-multiswap-balancerv1-sushiv3-wbtc-eth-sushi.json +0 -81
  313. package/build/executor/fixtures/executor01/routes/price-route-multiswap-sushiv3-curvev1-eth-usdc-gusd.json +0 -78
  314. package/build/executor/fixtures/executor01/routes/price-route-multiswap-sushiv3-curvev1-gusd-usdc-eth.json +0 -78
  315. package/build/executor/fixtures/executor01/routes/price-route-multiswap-sushiv3-dai-usdc-eth.json +0 -81
  316. package/build/executor/fixtures/executor01/routes/price-route-multiswap-sushiv3-eth-usdc-dai.json +0 -81
  317. package/build/executor/fixtures/executor01/routes/price-route-multiswap-sushiv3-usdc-eth-wbtc.json +0 -81
  318. package/build/executor/fixtures/executor01/routes/price-route-multiswap-sushiv3-usdt-usdc-dai.json +0 -81
  319. package/build/executor/fixtures/executor01/routes/price-route-simpleSwap-balancerv1-eth-usdc.json +0 -64
  320. package/build/executor/fixtures/executor01/routes/price-route-simpleSwap-balancerv1-usdc-eth.json +0 -85
  321. package/build/executor/fixtures/executor01/routes/price-route-simpleSwap-balancerv1-usdc-wbtc.json +0 -64
  322. package/build/executor/fixtures/executor01/routes/price-route-simpleSwap-curvev1-eth-steth.json +0 -52
  323. package/build/executor/fixtures/executor01/routes/price-route-simpleSwap-curvev1-steth-eth.json +0 -52
  324. package/build/executor/fixtures/executor01/routes/price-route-simpleSwap-curvev1-usdc-usdt.json +0 -52
  325. package/build/executor/fixtures/executor01/routes/price-route-simpleSwap-univ3-eth-usdc.json +0 -55
  326. package/build/executor/fixtures/executor01/routes/price-route-simpleSwap-univ3-usdc-eth.json +0 -55
  327. package/build/executor/fixtures/executor01/routes/price-route-simpleSwap-univ3-usdc-usdt.json +0 -55
  328. package/build/executor/fixtures/executor02/exchange-params/price-route-multiSwap-balancerv1-sushiv3-univ3-bal-eth-sushi.json +0 -23
  329. package/build/executor/fixtures/executor02/exchange-params/price-route-multiSwap-maverickv1-sushiv3-univ3-eth-usdc-mav.json +0 -37
  330. package/build/executor/fixtures/executor02/exchange-params/price-route-multiSwap-univ3-sushiv3-sushi-eth-wbtc.json +0 -23
  331. package/build/executor/fixtures/executor02/exchange-params/price-route-multiSwap-univ3-sushiv3-wbtc-eth-sushi.json +0 -23
  332. package/build/executor/fixtures/executor02/exchange-params/price-route-multiswap-curvev1-univ3-dai-usdc-eth.json +0 -51
  333. package/build/executor/fixtures/executor02/exchange-params/price-route-multiswap-univ3-usdt-dai-eth.json +0 -58
  334. package/build/executor/fixtures/executor02/exchange-params/price-route-simpleSwap-sushiv3-balancerv1-eth-usdc.json +0 -23
  335. package/build/executor/fixtures/executor02/exchange-params/price-route-simpleSwap-sushiv3-balancerv1-usdc-eth.json +0 -23
  336. package/build/executor/fixtures/executor02/exchange-params/price-route-simpleSwap-sushiv3-univ3-eth-sushi.json +0 -9
  337. package/build/executor/fixtures/executor02/exchange-params/price-route-simpleSwap-sushiv3-univ3-sushi-eth.json +0 -16
  338. package/build/executor/fixtures/executor02/exchange-params/price-route-simpleSwap-univ3-curvev1-usdt-dai.json +0 -23
  339. package/build/executor/fixtures/executor02/maybe-weth-calldata/price-route-multiSwap-balancerv1-sushiv3-univ3-bal-eth-sushi.json +0 -12
  340. package/build/executor/fixtures/executor02/maybe-weth-calldata/price-route-multiSwap-maverickv1-sushiv3-univ3-eth-usdc-mav.json +0 -7
  341. package/build/executor/fixtures/executor02/maybe-weth-calldata/price-route-multiSwap-univ3-sushiv3-sushi-eth-wbtc.json +0 -12
  342. package/build/executor/fixtures/executor02/maybe-weth-calldata/price-route-multiSwap-univ3-sushiv3-wbtc-eth-sushi.json +0 -12
  343. package/build/executor/fixtures/executor02/maybe-weth-calldata/price-route-multiswap-curvev1-univ3-dai-usdc-eth.json +0 -7
  344. package/build/executor/fixtures/executor02/maybe-weth-calldata/price-route-multiswap-univ3-usdt-dai-eth.json +0 -7
  345. package/build/executor/fixtures/executor02/maybe-weth-calldata/price-route-simpleSwap-sushiv3-balancerv1-eth-usdc.json +0 -7
  346. package/build/executor/fixtures/executor02/maybe-weth-calldata/price-route-simpleSwap-sushiv3-balancerv1-usdc-eth.json +0 -7
  347. package/build/executor/fixtures/executor02/maybe-weth-calldata/price-route-simpleSwap-sushiv3-univ3-eth-sushi.json +0 -7
  348. package/build/executor/fixtures/executor02/maybe-weth-calldata/price-route-simpleSwap-sushiv3-univ3-sushi-eth.json +0 -7
  349. package/build/executor/fixtures/executor02/routes/price-route-multiSwap-balancerv1-sushiv3-univ3-bal-eth-sushi.json +0 -130
  350. package/build/executor/fixtures/executor02/routes/price-route-multiSwap-maverickv1-sushiv3-univ3-eth-usdc-mav.json +0 -136
  351. package/build/executor/fixtures/executor02/routes/price-route-multiSwap-univ3-sushiv3-sushi-eth-wbtc.json +0 -100
  352. package/build/executor/fixtures/executor02/routes/price-route-multiSwap-univ3-sushiv3-wbtc-eth-sushi.json +0 -100
  353. package/build/executor/fixtures/executor02/routes/price-route-multiswap-curvev1-univ3-dai-usdc-eth.json +0 -166
  354. package/build/executor/fixtures/executor02/routes/price-route-multiswap-univ3-usdt-dai-eth.json +0 -190
  355. package/build/executor/fixtures/executor02/routes/price-route-simpleSwap-sushiv3-balancerv1-eth-usdc.json +0 -114
  356. package/build/executor/fixtures/executor02/routes/price-route-simpleSwap-sushiv3-balancerv1-usdc-eth.json +0 -114
  357. package/build/executor/fixtures/executor02/routes/price-route-simpleSwap-sushiv3-univ3-eth-sushi.json +0 -55
  358. package/build/executor/fixtures/executor02/routes/price-route-simpleSwap-sushiv3-univ3-sushi-eth.json +0 -73
  359. package/build/executor/fixtures/executor02/routes/price-route-simpleSwap-univ3-curvev1-usdt-dai.json +0 -82
@@ -0,0 +1,136 @@
1
+ [
2
+ {
3
+ "inputs": [
4
+ { "internalType": "address", "name": "vat_", "type": "address" },
5
+ { "internalType": "bytes32", "name": "ilk_", "type": "bytes32" },
6
+ { "internalType": "address", "name": "gem_", "type": "address" }
7
+ ],
8
+ "stateMutability": "nonpayable",
9
+ "type": "constructor"
10
+ },
11
+ {
12
+ "anonymous": true,
13
+ "inputs": [
14
+ {
15
+ "indexed": true,
16
+ "internalType": "bytes4",
17
+ "name": "sig",
18
+ "type": "bytes4"
19
+ },
20
+ {
21
+ "indexed": true,
22
+ "internalType": "address",
23
+ "name": "usr",
24
+ "type": "address"
25
+ },
26
+ {
27
+ "indexed": true,
28
+ "internalType": "bytes32",
29
+ "name": "arg1",
30
+ "type": "bytes32"
31
+ },
32
+ {
33
+ "indexed": true,
34
+ "internalType": "bytes32",
35
+ "name": "arg2",
36
+ "type": "bytes32"
37
+ },
38
+ {
39
+ "indexed": false,
40
+ "internalType": "bytes",
41
+ "name": "data",
42
+ "type": "bytes"
43
+ }
44
+ ],
45
+ "name": "LogNote",
46
+ "type": "event"
47
+ },
48
+ {
49
+ "inputs": [],
50
+ "name": "cage",
51
+ "outputs": [],
52
+ "stateMutability": "nonpayable",
53
+ "type": "function"
54
+ },
55
+ {
56
+ "inputs": [],
57
+ "name": "dec",
58
+ "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }],
59
+ "stateMutability": "view",
60
+ "type": "function"
61
+ },
62
+ {
63
+ "inputs": [{ "internalType": "address", "name": "usr", "type": "address" }],
64
+ "name": "deny",
65
+ "outputs": [],
66
+ "stateMutability": "nonpayable",
67
+ "type": "function"
68
+ },
69
+ {
70
+ "inputs": [
71
+ { "internalType": "address", "name": "guy", "type": "address" },
72
+ { "internalType": "uint256", "name": "wad", "type": "uint256" }
73
+ ],
74
+ "name": "exit",
75
+ "outputs": [],
76
+ "stateMutability": "nonpayable",
77
+ "type": "function"
78
+ },
79
+ {
80
+ "inputs": [],
81
+ "name": "gem",
82
+ "outputs": [
83
+ { "internalType": "contract GemLike_2", "name": "", "type": "address" }
84
+ ],
85
+ "stateMutability": "view",
86
+ "type": "function"
87
+ },
88
+ {
89
+ "inputs": [],
90
+ "name": "ilk",
91
+ "outputs": [{ "internalType": "bytes32", "name": "", "type": "bytes32" }],
92
+ "stateMutability": "view",
93
+ "type": "function"
94
+ },
95
+ {
96
+ "inputs": [
97
+ { "internalType": "address", "name": "urn", "type": "address" },
98
+ { "internalType": "uint256", "name": "wad", "type": "uint256" },
99
+ { "internalType": "address", "name": "_msgSender", "type": "address" }
100
+ ],
101
+ "name": "join",
102
+ "outputs": [],
103
+ "stateMutability": "nonpayable",
104
+ "type": "function"
105
+ },
106
+ {
107
+ "inputs": [],
108
+ "name": "live",
109
+ "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }],
110
+ "stateMutability": "view",
111
+ "type": "function"
112
+ },
113
+ {
114
+ "inputs": [{ "internalType": "address", "name": "usr", "type": "address" }],
115
+ "name": "rely",
116
+ "outputs": [],
117
+ "stateMutability": "nonpayable",
118
+ "type": "function"
119
+ },
120
+ {
121
+ "inputs": [],
122
+ "name": "vat",
123
+ "outputs": [
124
+ { "internalType": "contract VatLike_4", "name": "", "type": "address" }
125
+ ],
126
+ "stateMutability": "view",
127
+ "type": "function"
128
+ },
129
+ {
130
+ "inputs": [{ "internalType": "address", "name": "", "type": "address" }],
131
+ "name": "wards",
132
+ "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }],
133
+ "stateMutability": "view",
134
+ "type": "function"
135
+ }
136
+ ]
@@ -0,0 +1,185 @@
1
+ "use strict";
2
+ // /* eslint-disable no-console */
3
+ // import dotenv from 'dotenv';
4
+ // dotenv.config();
5
+ // import { Network } from '../../../constants';
6
+ // import { DummyDexHelper } from '../../../dex-helper';
7
+ // import { BlockHeader } from 'web3-eth';
8
+ // import { MakerPsmConfig } from '../config';
9
+ // import { BigNumber, ethers } from 'ethers';
10
+ // import { Interface } from '@ethersproject/abi';
11
+ // import _ from 'lodash';
12
+ // import vatABI from './vat.abi.json';
13
+ // import gemABI from './gem.abi.json';
14
+ // // @ts-ignore
15
+ // import { Tokens } from '../../../../tests/constants-e2e';
16
+ // const tokens = Tokens[Network.MAINNET];
17
+ // const vatInterface = new Interface(vatABI);
18
+ // const gemInterface = new Interface(gemABI);
19
+ // const erc20Interface = new Interface([
20
+ // {
21
+ // constant: true,
22
+ // inputs: [{ internalType: 'address', name: '', type: 'address' }],
23
+ // name: 'balanceOf',
24
+ // outputs: [{ internalType: 'uint256', name: '', type: 'uint256' }],
25
+ // payable: false,
26
+ // stateMutability: 'view',
27
+ // type: 'function',
28
+ // },
29
+ // ]);
30
+ // const network = Network.MAINNET;
31
+ // const vat = MakerPsmConfig.MakerPsm[Network.MAINNET].vatAddress;
32
+ // const MOVE_TOPIC =
33
+ // '0xbb35783b00000000000000000000000000000000000000000000000000000000';
34
+ // const dexHelper = new DummyDexHelper(network);
35
+ // async function findNewGems(): Promise<boolean> {
36
+ // const network = Network.MAINNET;
37
+ // const dexHelper = new DummyDexHelper(network);
38
+ // const lastBlockNumber = await dexHelper.provider.getBlockNumber();
39
+ // const startBlockNumber = lastBlockNumber - 1_000_000;
40
+ // const endBlockNumber = lastBlockNumber;
41
+ // // const startBlockNumber = endBlockNumber - 700_000;
42
+ // const totalRange = endBlockNumber - startBlockNumber;
43
+ // const smallChunkSize = 10_000;
44
+ // const bigChunkSize = 100_000;
45
+ // const bigChunks = Math.ceil(totalRange / bigChunkSize);
46
+ // const smallChunks = Math.ceil(bigChunkSize / smallChunkSize);
47
+ // const uniquePotentialGemJoinsSet = new Set();
48
+ // for (let i = 0; i < bigChunks; i++) {
49
+ // console.log('Processing chunk', i + 1, 'of', bigChunks);
50
+ // const from = startBlockNumber + i * bigChunkSize;
51
+ // console.log(
52
+ // new Array(smallChunks).fill(0).map((_, smallChunkNumber) => ({
53
+ // fromBlock: from + smallChunkNumber * smallChunkSize,
54
+ // toBlock: from + smallChunkNumber * smallChunkSize + smallChunkSize,
55
+ // })),
56
+ // );
57
+ // const logsToDispatch = (
58
+ // await Promise.all(
59
+ // new Array(smallChunks).fill(0).map((_, smallChunkNumber) =>
60
+ // dexHelper.provider.getLogs({
61
+ // fromBlock: from + smallChunkNumber * smallChunkSize,
62
+ // toBlock: from + smallChunkNumber * smallChunkSize + smallChunkSize,
63
+ // address: vat,
64
+ // }),
65
+ // ),
66
+ // )
67
+ // ).flat();
68
+ // const moveLogs = logsToDispatch.filter(l => l.topics[0] === MOVE_TOPIC);
69
+ // const potentialGemJoins = moveLogs.map(
70
+ // l => ethers.utils.defaultAbiCoder.decode(['address'], l.topics[1])[0],
71
+ // );
72
+ // potentialGemJoins.forEach(gemJoin =>
73
+ // uniquePotentialGemJoinsSet.add(gemJoin),
74
+ // );
75
+ // }
76
+ // const uniquePotentialGemJoins = Array.from(uniquePotentialGemJoinsSet);
77
+ // console.log('unique potential gem joins', uniquePotentialGemJoins.length);
78
+ // const gemJoinCalldata = uniquePotentialGemJoins
79
+ // .map(gemJoin => {
80
+ // return [
81
+ // {
82
+ // target: gemJoin,
83
+ // callData: vatInterface.encodeFunctionData('gemJoin'),
84
+ // },
85
+ // ];
86
+ // })
87
+ // .flat();
88
+ // const slicedGemJoinCallData = _.chunk(gemJoinCalldata, 500);
89
+ // const gemJoinData = (
90
+ // await Promise.all(
91
+ // slicedGemJoinCallData.map(async _multiCallData =>
92
+ // dexHelper.multiContract.methods
93
+ // .tryAggregate(false, _multiCallData)
94
+ // .call({}),
95
+ // ),
96
+ // )
97
+ // ).flat();
98
+ // // console.log(
99
+ // // gemJoinData
100
+ // // .map((data, i) => ({ ...data, index: i }))
101
+ // // .filter(d => d.returnData !== '0x' && d.returnData.length === 66)
102
+ // // .map(d => [d.returnData, gemJoinCalldata[d.index]]),
103
+ // // );
104
+ // const gemJoins = gemJoinData
105
+ // .filter(d => d.returnData !== '0x' && d.returnData.length === 66)
106
+ // .map(
107
+ // d => ethers.utils.defaultAbiCoder.decode(['address'], d.returnData)[0],
108
+ // );
109
+ // const uniqueGemJoins = [...new Set(gemJoins)];
110
+ // console.log('unique gem joins', uniqueGemJoins.length);
111
+ // const gemCalldata = uniqueGemJoins
112
+ // .map(gemJoin => {
113
+ // return [
114
+ // {
115
+ // target: gemJoin,
116
+ // callData: gemInterface.encodeFunctionData('gem'),
117
+ // },
118
+ // ];
119
+ // })
120
+ // .flat();
121
+ // const returnGemData = await dexHelper.multiContract.methods
122
+ // .tryAggregate(false, gemCalldata)
123
+ // .call({});
124
+ // const gems = returnGemData
125
+ // .filter((d: any) => d.returnData !== '0x')
126
+ // .map(
127
+ // (d: any) =>
128
+ // ethers.utils.defaultAbiCoder.decode(['address'], d.returnData)[0],
129
+ // );
130
+ // const balanceCalldata = gems
131
+ // .map((gem: any, i: number) => {
132
+ // return [
133
+ // {
134
+ // target: gem,
135
+ // callData: erc20Interface.encodeFunctionData('balanceOf', [
136
+ // uniqueGemJoins[i],
137
+ // ]),
138
+ // },
139
+ // ];
140
+ // })
141
+ // .flat();
142
+ // const returnBalanceData = await dexHelper.multiContract.methods
143
+ // .tryAggregate(false, balanceCalldata)
144
+ // .call({});
145
+ // console.log(returnBalanceData);
146
+ // const balances: BigNumber[] = returnBalanceData
147
+ // .filter((d: any) => d.returnData !== '0x')
148
+ // .map(
149
+ // (d: any) =>
150
+ // ethers.utils.defaultAbiCoder.decode(['uint256'], d.returnData)[0],
151
+ // );
152
+ // console.log(balances.map(b => b.toString()));
153
+ // const data = uniqueGemJoins.map((gemJoin, i) => {
154
+ // const token = Object.values(tokens).find(
155
+ // t => t.address.toLowerCase() === gems[i].toLowerCase(),
156
+ // );
157
+ // const symbol = token
158
+ // ? Object.entries(tokens).find(
159
+ // ([symbol, t]) => t.address.toLowerCase() === gems[i].toLowerCase(),
160
+ // )?.[0]
161
+ // : 'Not found';
162
+ // const balance = token
163
+ // ? Number(ethers.utils.formatUnits(balances[i], token.decimals))
164
+ // : balances[i].toString();
165
+ // return {
166
+ // gemJoin,
167
+ // gem: gems[i],
168
+ // balance,
169
+ // ...(token
170
+ // ? {
171
+ // address: gems[i],
172
+ // decimals: token.decimals,
173
+ // symbol,
174
+ // }
175
+ // : { address: gems[i] }),
176
+ // };
177
+ // });
178
+ // console.log(data);
179
+ // // const address = logsToDispatch[0].address;
180
+ // return true;
181
+ // }
182
+ // findNewGems()
183
+ // .then(() => console.log('Done'))
184
+ // .catch(e => console.error(e));
185
+ //# sourceMappingURL=validate-state.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"validate-state.js","sourceRoot":"","sources":["../../../../src/dex/maker-psm/scripts/validate-state.ts"],"names":[],"mappings":";AAAA,kCAAkC;AAClC,+BAA+B;AAC/B,mBAAmB;AAEnB,gDAAgD;AAChD,wDAAwD;AACxD,0CAA0C;AAC1C,8CAA8C;AAC9C,8CAA8C;AAC9C,kDAAkD;AAClD,0BAA0B;AAC1B,uCAAuC;AACvC,uCAAuC;AACvC,gBAAgB;AAChB,4DAA4D;AAE5D,0CAA0C;AAE1C,8CAA8C;AAC9C,8CAA8C;AAC9C,yCAAyC;AACzC,MAAM;AACN,sBAAsB;AACtB,wEAAwE;AACxE,yBAAyB;AACzB,yEAAyE;AACzE,sBAAsB;AACtB,+BAA+B;AAC/B,wBAAwB;AACxB,OAAO;AACP,MAAM;AAEN,mCAAmC;AACnC,mEAAmE;AACnE,qBAAqB;AACrB,0EAA0E;AAE1E,iDAAiD;AAEjD,mDAAmD;AACnD,qCAAqC;AACrC,mDAAmD;AAEnD,uEAAuE;AAEvE,0DAA0D;AAC1D,4CAA4C;AAC5C,0DAA0D;AAE1D,0DAA0D;AAE1D,mCAAmC;AACnC,kCAAkC;AAElC,4DAA4D;AAE5D,kEAAkE;AAElE,kDAAkD;AAElD,0CAA0C;AAC1C,+DAA+D;AAC/D,wDAAwD;AACxD,mBAAmB;AACnB,uEAAuE;AACvE,+DAA+D;AAC/D,8EAA8E;AAC9E,aAAa;AACb,SAAS;AAET,+BAA+B;AAC/B,2BAA2B;AAC3B,sEAAsE;AACtE,yCAAyC;AACzC,mEAAmE;AACnE,kFAAkF;AAClF,4BAA4B;AAC5B,gBAAgB;AAChB,aAAa;AACb,UAAU;AACV,gBAAgB;AAEhB,+EAA+E;AAE/E,8CAA8C;AAC9C,+EAA+E;AAC/E,SAAS;AAET,2CAA2C;AAC3C,iDAAiD;AACjD,SAAS;AACT,MAAM;AAEN,4EAA4E;AAC5E,+EAA+E;AAE/E,oDAAoD;AACpD,wBAAwB;AACxB,iBAAiB;AACjB,YAAY;AACZ,6BAA6B;AAC7B,kEAAkE;AAClE,aAAa;AACb,WAAW;AACX,SAAS;AACT,eAAe;AAEf,iEAAiE;AAEjE,0BAA0B;AAC1B,yBAAyB;AACzB,0DAA0D;AAC1D,0CAA0C;AAC1C,iDAAiD;AACjD,uBAAuB;AACvB,WAAW;AACX,QAAQ;AACR,cAAc;AAEd,oBAAoB;AACpB,qBAAqB;AACrB,sDAAsD;AACtD,6EAA6E;AAC7E,gEAAgE;AAChE,UAAU;AAEV,iCAAiC;AACjC,wEAAwE;AACxE,YAAY;AACZ,gFAAgF;AAChF,SAAS;AAET,mDAAmD;AACnD,4DAA4D;AAE5D,uCAAuC;AACvC,wBAAwB;AACxB,iBAAiB;AACjB,YAAY;AACZ,6BAA6B;AAC7B,8DAA8D;AAC9D,aAAa;AACb,WAAW;AACX,SAAS;AACT,eAAe;AAEf,gEAAgE;AAChE,wCAAwC;AACxC,iBAAiB;AAEjB,+BAA+B;AAC/B,iDAAiD;AACjD,YAAY;AACZ,oBAAoB;AACpB,6EAA6E;AAC7E,SAAS;AAET,iCAAiC;AACjC,sCAAsC;AACtC,iBAAiB;AACjB,YAAY;AACZ,yBAAyB;AACzB,uEAAuE;AACvE,iCAAiC;AACjC,gBAAgB;AAChB,aAAa;AACb,WAAW;AACX,SAAS;AACT,eAAe;AAEf,oEAAoE;AACpE,4CAA4C;AAC5C,iBAAiB;AAEjB,oCAAoC;AAEpC,oDAAoD;AACpD,iDAAiD;AACjD,YAAY;AACZ,oBAAoB;AACpB,6EAA6E;AAC7E,SAAS;AAET,kDAAkD;AAElD,sDAAsD;AACtD,gDAAgD;AAChD,gEAAgE;AAChE,SAAS;AACT,2BAA2B;AAC3B,uCAAuC;AACvC,gFAAgF;AAChF,iBAAiB;AACjB,uBAAuB;AACvB,4BAA4B;AAC5B,wEAAwE;AACxE,kCAAkC;AAElC,eAAe;AACf,iBAAiB;AACjB,sBAAsB;AACtB,iBAAiB;AACjB,kBAAkB;AAClB,cAAc;AACd,gCAAgC;AAChC,wCAAwC;AACxC,sBAAsB;AACtB,cAAc;AACd,mCAAmC;AACnC,SAAS;AACT,QAAQ;AAER,uBAAuB;AAEvB,kDAAkD;AAClD,iBAAiB;AACjB,IAAI;AAEJ,gBAAgB;AAChB,qCAAqC;AACrC,mCAAmC"}
@@ -0,0 +1,243 @@
1
+ [
2
+ {
3
+ "inputs": [
4
+ { "internalType": "address", "name": "gemJoin_", "type": "address" },
5
+ { "internalType": "address", "name": "daiJoin_", "type": "address" },
6
+ { "internalType": "address", "name": "vow_", "type": "address" }
7
+ ],
8
+ "stateMutability": "nonpayable",
9
+ "type": "constructor"
10
+ },
11
+ {
12
+ "anonymous": false,
13
+ "inputs": [
14
+ {
15
+ "indexed": true,
16
+ "internalType": "address",
17
+ "name": "owner",
18
+ "type": "address"
19
+ },
20
+ {
21
+ "indexed": false,
22
+ "internalType": "uint256",
23
+ "name": "value",
24
+ "type": "uint256"
25
+ },
26
+ {
27
+ "indexed": false,
28
+ "internalType": "uint256",
29
+ "name": "fee",
30
+ "type": "uint256"
31
+ }
32
+ ],
33
+ "name": "BuyGem",
34
+ "type": "event"
35
+ },
36
+ {
37
+ "anonymous": false,
38
+ "inputs": [
39
+ {
40
+ "indexed": false,
41
+ "internalType": "address",
42
+ "name": "user",
43
+ "type": "address"
44
+ }
45
+ ],
46
+ "name": "Deny",
47
+ "type": "event"
48
+ },
49
+ {
50
+ "anonymous": false,
51
+ "inputs": [
52
+ {
53
+ "indexed": true,
54
+ "internalType": "bytes32",
55
+ "name": "what",
56
+ "type": "bytes32"
57
+ },
58
+ {
59
+ "indexed": false,
60
+ "internalType": "uint256",
61
+ "name": "data",
62
+ "type": "uint256"
63
+ }
64
+ ],
65
+ "name": "File",
66
+ "type": "event"
67
+ },
68
+ {
69
+ "anonymous": false,
70
+ "inputs": [
71
+ {
72
+ "indexed": false,
73
+ "internalType": "address",
74
+ "name": "user",
75
+ "type": "address"
76
+ }
77
+ ],
78
+ "name": "Rely",
79
+ "type": "event"
80
+ },
81
+ {
82
+ "anonymous": false,
83
+ "inputs": [
84
+ {
85
+ "indexed": true,
86
+ "internalType": "address",
87
+ "name": "owner",
88
+ "type": "address"
89
+ },
90
+ {
91
+ "indexed": false,
92
+ "internalType": "uint256",
93
+ "name": "value",
94
+ "type": "uint256"
95
+ },
96
+ {
97
+ "indexed": false,
98
+ "internalType": "uint256",
99
+ "name": "fee",
100
+ "type": "uint256"
101
+ }
102
+ ],
103
+ "name": "SellGem",
104
+ "type": "event"
105
+ },
106
+ {
107
+ "inputs": [
108
+ { "internalType": "address", "name": "usr", "type": "address" },
109
+ { "internalType": "uint256", "name": "gemAmt", "type": "uint256" }
110
+ ],
111
+ "name": "buyGem",
112
+ "outputs": [],
113
+ "stateMutability": "nonpayable",
114
+ "type": "function"
115
+ },
116
+ {
117
+ "inputs": [],
118
+ "name": "dai",
119
+ "outputs": [
120
+ { "internalType": "contract DaiAbstract", "name": "", "type": "address" }
121
+ ],
122
+ "stateMutability": "view",
123
+ "type": "function"
124
+ },
125
+ {
126
+ "inputs": [],
127
+ "name": "daiJoin",
128
+ "outputs": [
129
+ {
130
+ "internalType": "contract DaiJoinAbstract",
131
+ "name": "",
132
+ "type": "address"
133
+ }
134
+ ],
135
+ "stateMutability": "view",
136
+ "type": "function"
137
+ },
138
+ {
139
+ "inputs": [{ "internalType": "address", "name": "usr", "type": "address" }],
140
+ "name": "deny",
141
+ "outputs": [],
142
+ "stateMutability": "nonpayable",
143
+ "type": "function"
144
+ },
145
+ {
146
+ "inputs": [
147
+ { "internalType": "bytes32", "name": "what", "type": "bytes32" },
148
+ { "internalType": "uint256", "name": "data", "type": "uint256" }
149
+ ],
150
+ "name": "file",
151
+ "outputs": [],
152
+ "stateMutability": "nonpayable",
153
+ "type": "function"
154
+ },
155
+ {
156
+ "inputs": [],
157
+ "name": "gemJoin",
158
+ "outputs": [
159
+ {
160
+ "internalType": "contract AuthGemJoinAbstract",
161
+ "name": "",
162
+ "type": "address"
163
+ }
164
+ ],
165
+ "stateMutability": "view",
166
+ "type": "function"
167
+ },
168
+ {
169
+ "inputs": [{ "internalType": "address", "name": "usr", "type": "address" }],
170
+ "name": "hope",
171
+ "outputs": [],
172
+ "stateMutability": "nonpayable",
173
+ "type": "function"
174
+ },
175
+ {
176
+ "inputs": [],
177
+ "name": "ilk",
178
+ "outputs": [{ "internalType": "bytes32", "name": "", "type": "bytes32" }],
179
+ "stateMutability": "view",
180
+ "type": "function"
181
+ },
182
+ {
183
+ "inputs": [{ "internalType": "address", "name": "usr", "type": "address" }],
184
+ "name": "nope",
185
+ "outputs": [],
186
+ "stateMutability": "nonpayable",
187
+ "type": "function"
188
+ },
189
+ {
190
+ "inputs": [{ "internalType": "address", "name": "usr", "type": "address" }],
191
+ "name": "rely",
192
+ "outputs": [],
193
+ "stateMutability": "nonpayable",
194
+ "type": "function"
195
+ },
196
+ {
197
+ "inputs": [
198
+ { "internalType": "address", "name": "usr", "type": "address" },
199
+ { "internalType": "uint256", "name": "gemAmt", "type": "uint256" }
200
+ ],
201
+ "name": "sellGem",
202
+ "outputs": [],
203
+ "stateMutability": "nonpayable",
204
+ "type": "function"
205
+ },
206
+ {
207
+ "inputs": [],
208
+ "name": "tin",
209
+ "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }],
210
+ "stateMutability": "view",
211
+ "type": "function"
212
+ },
213
+ {
214
+ "inputs": [],
215
+ "name": "tout",
216
+ "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }],
217
+ "stateMutability": "view",
218
+ "type": "function"
219
+ },
220
+ {
221
+ "inputs": [],
222
+ "name": "vat",
223
+ "outputs": [
224
+ { "internalType": "contract VatAbstract", "name": "", "type": "address" }
225
+ ],
226
+ "stateMutability": "view",
227
+ "type": "function"
228
+ },
229
+ {
230
+ "inputs": [],
231
+ "name": "vow",
232
+ "outputs": [{ "internalType": "address", "name": "", "type": "address" }],
233
+ "stateMutability": "view",
234
+ "type": "function"
235
+ },
236
+ {
237
+ "inputs": [{ "internalType": "address", "name": "", "type": "address" }],
238
+ "name": "wards",
239
+ "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }],
240
+ "stateMutability": "view",
241
+ "type": "function"
242
+ }
243
+ ]
@@ -0,0 +1,25 @@
1
+ import { Interface } from '@ethersproject/abi';
2
+ import { SwapSide } from '../constants';
3
+ import { AdapterExchangeParam, Address, SimpleExchangeParam } from '../types';
4
+ import { IDexTxBuilder } from './idex';
5
+ import { SimpleExchange } from './simple-exchange';
6
+ import { IDexHelper } from '../dex-helper';
7
+ export declare type OnebitData = {
8
+ router: Address;
9
+ };
10
+ declare type OnebitParam = [
11
+ srcToken: string,
12
+ destToken: string,
13
+ srcAmount: string,
14
+ destAmountMin: string,
15
+ to: string
16
+ ];
17
+ export declare class Onebit extends SimpleExchange implements IDexTxBuilder<OnebitData, OnebitParam> {
18
+ static dexKeys: string[];
19
+ exchangeRouterInterface: Interface;
20
+ needWrapNative: boolean;
21
+ constructor(dexHelper: IDexHelper);
22
+ getAdapterParam(srcToken: string, destToken: string, srcAmount: string, destAmount: string, data: OnebitData, side: SwapSide): AdapterExchangeParam;
23
+ getSimpleParam(srcToken: string, destToken: string, srcAmount: string, destAmount: string, data: OnebitData, side: SwapSide): Promise<SimpleExchangeParam>;
24
+ }
25
+ export {};
@@ -0,0 +1,42 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.Onebit = void 0;
7
+ const abi_1 = require("@ethersproject/abi");
8
+ const simple_exchange_1 = require("./simple-exchange");
9
+ const Onebit_json_1 = __importDefault(require("../abi/Onebit.json"));
10
+ var OnebitFunctions;
11
+ (function (OnebitFunctions) {
12
+ OnebitFunctions["swapTokensWithTrust"] = "swapTokensWithTrust";
13
+ })(OnebitFunctions || (OnebitFunctions = {}));
14
+ class Onebit extends simple_exchange_1.SimpleExchange {
15
+ constructor(dexHelper) {
16
+ super(dexHelper, 'omm1');
17
+ this.needWrapNative = true;
18
+ this.exchangeRouterInterface = new abi_1.Interface(Onebit_json_1.default);
19
+ }
20
+ getAdapterParam(srcToken, destToken, srcAmount, destAmount, data, side) {
21
+ return {
22
+ targetExchange: data.router,
23
+ payload: '0x',
24
+ networkFee: '0',
25
+ };
26
+ }
27
+ async getSimpleParam(srcToken, destToken, srcAmount, destAmount, data, side) {
28
+ const swapFunction = OnebitFunctions.swapTokensWithTrust;
29
+ const swapFunctionParams = [
30
+ srcToken,
31
+ destToken,
32
+ srcAmount,
33
+ destAmount,
34
+ this.augustusAddress,
35
+ ];
36
+ const swapData = this.exchangeRouterInterface.encodeFunctionData(swapFunction, swapFunctionParams);
37
+ return this.buildSimpleParamWithoutWETHConversion(srcToken, srcAmount, destToken, destAmount, swapData, data.router);
38
+ }
39
+ }
40
+ exports.Onebit = Onebit;
41
+ Onebit.dexKeys = ['omm1'];
42
+ //# sourceMappingURL=onebit.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"onebit.js","sourceRoot":"","sources":["../../src/dex/onebit.ts"],"names":[],"mappings":";;;;;;AAAA,4CAA6D;AAK7D,uDAAmD;AACnD,qEAA2C;AAc3C,IAAK,eAEJ;AAFD,WAAK,eAAe;IAClB,8DAA2C,CAAA;AAC7C,CAAC,EAFI,eAAe,KAAf,eAAe,QAEnB;AAED,MAAa,MACX,SAAQ,gCAAc;IAOtB,YAAY,SAAqB;QAC/B,KAAK,CAAC,SAAS,EAAE,MAAM,CAAC,CAAC;QAH3B,mBAAc,GAAG,IAAI,CAAC;QAIpB,IAAI,CAAC,uBAAuB,GAAG,IAAI,eAAS,CAAC,qBAA2B,CAAC,CAAC;IAC5E,CAAC;IAED,eAAe,CACb,QAAgB,EAChB,SAAiB,EACjB,SAAiB,EACjB,UAAkB,EAClB,IAAgB,EAChB,IAAc;QAEd,OAAO;YACL,cAAc,EAAE,IAAI,CAAC,MAAM;YAC3B,OAAO,EAAE,IAAI;YACb,UAAU,EAAE,GAAG;SAChB,CAAC;IACJ,CAAC;IAED,KAAK,CAAC,cAAc,CAClB,QAAgB,EAChB,SAAiB,EACjB,SAAiB,EACjB,UAAkB,EAClB,IAAgB,EAChB,IAAc;QAEd,MAAM,YAAY,GAAG,eAAe,CAAC,mBAAmB,CAAC;QACzD,MAAM,kBAAkB,GAAgB;YACtC,QAAQ;YACR,SAAS;YACT,SAAS;YACT,UAAU;YACV,IAAI,CAAC,eAAe;SACrB,CAAC;QACF,MAAM,QAAQ,GAAG,IAAI,CAAC,uBAAuB,CAAC,kBAAkB,CAC9D,YAAY,EACZ,kBAAkB,CACnB,CAAC;QAEF,OAAO,IAAI,CAAC,qCAAqC,CAC/C,QAAQ,EACR,SAAS,EACT,SAAS,EACT,UAAU,EACV,QAAQ,EACR,IAAI,CAAC,MAAM,CACZ,CAAC;IACJ,CAAC;;AAzDH,wBA0DC;AAtDQ,cAAO,GAAG,CAAC,MAAM,CAAC,CAAC"}