@paraswap/dex-lib 3.11.1 → 3.11.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/abi/Aave_GSM.json +751 -0
- package/build/abi/Balancer.json +257 -0
- package/build/abi/BalancerV2.json +1179 -0
- package/build/abi/RamsesV2Pool.abi.json +1554 -0
- package/build/abi/RamsesV2Quoter.abi.json +274 -0
- package/build/abi/USDM.json +807 -0
- package/build/abi/UniswapV2Router.json +397 -0
- package/build/abi/{wombat/pool.json → angle-transmuter/ChainlinkAccessControlledOffchainAggregator.json} +594 -637
- package/build/abi/angle-transmuter/ChainlinkEACAggregatorProxy.json +509 -0
- package/build/abi/cables/CablesMainnetRFQ.json +1083 -0
- package/build/abi/curve-v1/CurveBUSDv2.abi.json +1356 -0
- package/build/abi/curve-v1/CurveTokenV1.json +305 -0
- package/build/abi/curve-v1/CurveTokenV2.json +318 -0
- package/build/abi/curve-v1/CurveV1StableNg.json +1452 -0
- package/build/abi/curve-v1/CurveV2Swap.json +700 -0
- package/build/abi/curve-v1/FactoryCryptoRegistry.json +316 -0
- package/build/abi/curve-v1/FactoryRegistry.json +508 -0
- package/build/abi/curve-v1/StableSwapAave.json +1152 -0
- package/build/abi/curve-v1/StableSwapBUSD.json +814 -0
- package/build/abi/curve-v1/StableSwapCompound.json +814 -0
- package/build/abi/curve-v1/StableSwapIDLE.json +1253 -0
- package/build/abi/curve-v1/StableSwapPax.json +865 -0
- package/build/abi/curve-v1/StableSwapSnow.json +900 -0
- package/build/abi/curve-v1/StableSwapUSDN.json +1004 -0
- package/build/abi/curve-v1/StableSwapUSDT.json +814 -0
- package/build/abi/curve-v1/StableSwapY.json +814 -0
- package/build/abi/inception/inception-ineth.json +609 -0
- package/build/abi/kyberdmm/kyber-storage.abi.json +824 -0
- package/build/abi/kyberdmm.abi.json +1148 -0
- package/build/abi/maverick-v2/MaverickV2Quoter.json +278 -0
- package/build/abi/nerve/nerve-metapool.json +790 -0
- package/build/abi/uniswap-v3/UniswapV3Quoter.abi.json +193 -0
- package/build/abi/velodrome-slipstream/VelodromeSlipstreamQuoterV2.abi.json +267 -0
- package/build/config.js +1 -0
- package/build/config.js.map +1 -1
- package/build/dex/aave-v1/aave-v1.js +0 -1
- package/build/dex/aave-v1/aave-v1.js.map +1 -1
- package/build/dex/balancer-v1/balancer-pools.json +33333 -0
- package/build/dex/bebop/bebop.js +1 -1
- package/build/dex/bebop/bebop.js.map +1 -1
- package/build/dex/bebop/config.js +5 -0
- package/build/dex/bebop/config.js.map +1 -1
- package/build/dex/bebop/rate-fetcher.d.ts +3 -1
- package/build/dex/bebop/rate-fetcher.js +42 -2
- package/build/dex/bebop/rate-fetcher.js.map +1 -1
- package/build/dex/bebop/validators.d.ts +2 -0
- package/build/dex/bebop/validators.js +9 -1
- package/build/dex/bebop/validators.js.map +1 -1
- package/build/dex/bebop/websocket-fetcher.d.ts +35 -0
- package/build/dex/bebop/websocket-fetcher.js +87 -0
- package/build/dex/bebop/websocket-fetcher.js.map +1 -0
- package/build/dex/cables/cables.d.ts +57 -0
- package/build/dex/cables/cables.js +471 -0
- package/build/dex/cables/cables.js.map +1 -0
- package/build/dex/cables/config.d.ts +4 -0
- package/build/dex/cables/config.js +15 -0
- package/build/dex/cables/config.js.map +1 -0
- package/build/dex/cables/constants.d.ts +19 -0
- package/build/dex/cables/constants.js +26 -0
- package/build/dex/cables/constants.js.map +1 -0
- package/build/dex/cables/rate-fetcher.d.ts +34 -0
- package/build/dex/cables/rate-fetcher.js +106 -0
- package/build/dex/cables/rate-fetcher.js.map +1 -0
- package/build/dex/cables/types.d.ts +106 -0
- package/build/dex/cables/types.js +12 -0
- package/build/dex/cables/types.js.map +1 -0
- package/build/dex/cables/validators.d.ts +5 -0
- package/build/dex/cables/validators.js +49 -0
- package/build/dex/cables/validators.js.map +1 -0
- package/build/dex/idle-dao/idle-dao-pool.d.ts +56 -0
- package/build/dex/idle-dao/idle-dao-pool.js +176 -0
- package/build/dex/idle-dao/idle-dao-pool.js.map +1 -0
- package/build/dex/idle-dao/idle-dao-pooling-pool.d.ts +16 -0
- package/build/dex/idle-dao/idle-dao-pooling-pool.js +57 -0
- package/build/dex/idle-dao/idle-dao-pooling-pool.js.map +1 -0
- package/build/dex/idle-dao/scripts.d.ts +9 -0
- package/build/dex/idle-dao/scripts.js +552 -0
- package/build/dex/idle-dao/scripts.js.map +1 -0
- package/build/dex/inception/inception-event-pool.d.ts +4 -4
- package/build/dex/inception/inception-event-pool.js +9 -7
- package/build/dex/inception/inception-event-pool.js.map +1 -1
- package/build/dex/inception/inception-native.d.ts +43 -0
- package/build/dex/inception/inception-native.js +131 -0
- package/build/dex/inception/inception-native.js.map +1 -0
- package/build/dex/inception/inception-pool.d.ts +18 -0
- package/build/dex/inception/inception-pool.js +32 -0
- package/build/dex/inception/inception-pool.js.map +1 -0
- package/build/dex/inception/inception-price-feed.d.ts +19 -0
- package/build/dex/inception/inception-price-feed.js +51 -0
- package/build/dex/inception/inception-price-feed.js.map +1 -0
- package/build/dex/inception/inception.d.ts +6 -6
- package/build/dex/inception/inception.js +40 -16
- package/build/dex/inception/inception.js.map +1 -1
- package/build/dex/inception/utils.d.ts +0 -1
- package/build/dex/inception/utils.js +1 -22
- package/build/dex/inception/utils.js.map +1 -1
- package/build/dex/platypus/platypus.js +3 -17
- package/build/dex/platypus/platypus.js.map +1 -1
- package/build/dex/swaap-v1/swaap-v1.js +0 -4
- package/build/dex/swaap-v1/swaap-v1.js.map +1 -1
- package/build/executor/fixtures/executor01/exchange-params/price-route-multiswap-balancerv1-curvev1-eth-usdc-gusd.json +16 -0
- package/build/executor/fixtures/executor01/exchange-params/price-route-multiswap-balancerv1-sushiv3-wbtc-eth-sushi.json +16 -0
- package/build/executor/fixtures/executor01/exchange-params/price-route-multiswap-sushiv3-curvev1-eth-usdc-gusd.json +16 -0
- package/build/executor/fixtures/executor01/exchange-params/price-route-multiswap-sushiv3-curvev1-gusd-usdc-eth.json +16 -0
- package/build/executor/fixtures/executor01/exchange-params/price-route-multiswap-sushiv3-dai-usdc-eth.json +16 -0
- package/build/executor/fixtures/executor01/exchange-params/price-route-multiswap-sushiv3-eth-usdc-dai.json +16 -0
- package/build/executor/fixtures/executor01/exchange-params/price-route-multiswap-sushiv3-usdc-eth-wbtc.json +16 -0
- package/build/executor/fixtures/executor01/exchange-params/price-route-multiswap-sushiv3-usdt-usdc-dai.json +16 -0
- package/build/executor/fixtures/executor01/exchange-params/price-route-simpleSwap-balancerv1-eth-usdc.json +9 -0
- package/build/executor/fixtures/executor01/exchange-params/price-route-simpleSwap-balancerv1-usdc-eth.json +9 -0
- package/build/executor/fixtures/executor01/exchange-params/price-route-simpleSwap-balancerv1-usdc-wbtc.json +9 -0
- package/build/executor/fixtures/executor01/exchange-params/price-route-simpleSwap-curvev1-eth-steth.json +9 -0
- package/build/executor/fixtures/executor01/exchange-params/price-route-simpleSwap-curvev1-steth-eth.json +9 -0
- package/build/executor/fixtures/executor01/exchange-params/price-route-simpleSwap-curvev1-usdc-usdt.json +9 -0
- package/build/executor/fixtures/executor01/exchange-params/price-route-simpleSwap-univ3-eth-usdc.json +9 -0
- package/build/executor/fixtures/executor01/exchange-params/price-route-simpleSwap-univ3-usdc-eth.json +9 -0
- package/build/executor/fixtures/executor01/exchange-params/price-route-simpleSwap-univ3-usdc-usdt.json +9 -0
- package/build/executor/fixtures/executor01/maybe-weth-calldata/price-route-multiswap-balancerv1-sushiv3-wbtc-eth-sushi.json +12 -0
- package/build/executor/fixtures/executor01/maybe-weth-calldata/price-route-multiswap-sushiv3-curvev1-eth-usdc-gusd.json +7 -0
- package/build/executor/fixtures/executor01/maybe-weth-calldata/price-route-multiswap-sushiv3-curvev1-gusd-usdc-eth.json +7 -0
- package/build/executor/fixtures/executor01/maybe-weth-calldata/price-route-multiswap-sushiv3-dai-usdc-eth.json +7 -0
- package/build/executor/fixtures/executor01/maybe-weth-calldata/price-route-multiswap-sushiv3-eth-usdc-dai.json +7 -0
- package/build/executor/fixtures/executor01/maybe-weth-calldata/price-route-multiswap-sushiv3-usdc-eth-wbtc.json +12 -0
- package/build/executor/fixtures/executor01/maybe-weth-calldata/price-route-simpleSwap-univ3-eth-usdc.json +7 -0
- package/build/executor/fixtures/executor01/maybe-weth-calldata/price-route-simpleSwap-univ3-usdc-eth.json +7 -0
- package/build/executor/fixtures/executor01/routes/price-route-multiswap-balancerv1-curvev1-eth-usdc-gusd.json +78 -0
- package/build/executor/fixtures/executor01/routes/price-route-multiswap-balancerv1-sushiv3-wbtc-eth-sushi.json +81 -0
- package/build/executor/fixtures/executor01/routes/price-route-multiswap-sushiv3-curvev1-eth-usdc-gusd.json +78 -0
- package/build/executor/fixtures/executor01/routes/price-route-multiswap-sushiv3-curvev1-gusd-usdc-eth.json +78 -0
- package/build/executor/fixtures/executor01/routes/price-route-multiswap-sushiv3-dai-usdc-eth.json +81 -0
- package/build/executor/fixtures/executor01/routes/price-route-multiswap-sushiv3-eth-usdc-dai.json +81 -0
- package/build/executor/fixtures/executor01/routes/price-route-multiswap-sushiv3-usdc-eth-wbtc.json +81 -0
- package/build/executor/fixtures/executor01/routes/price-route-multiswap-sushiv3-usdt-usdc-dai.json +81 -0
- package/build/executor/fixtures/executor01/routes/price-route-simpleSwap-balancerv1-eth-usdc.json +64 -0
- package/build/executor/fixtures/executor01/routes/price-route-simpleSwap-balancerv1-usdc-eth.json +85 -0
- package/build/executor/fixtures/executor01/routes/price-route-simpleSwap-balancerv1-usdc-wbtc.json +64 -0
- package/build/executor/fixtures/executor01/routes/price-route-simpleSwap-curvev1-eth-steth.json +52 -0
- package/build/executor/fixtures/executor01/routes/price-route-simpleSwap-curvev1-steth-eth.json +52 -0
- package/build/executor/fixtures/executor01/routes/price-route-simpleSwap-curvev1-usdc-usdt.json +52 -0
- package/build/executor/fixtures/executor01/routes/price-route-simpleSwap-univ3-eth-usdc.json +55 -0
- package/build/executor/fixtures/executor01/routes/price-route-simpleSwap-univ3-usdc-eth.json +55 -0
- package/build/executor/fixtures/executor01/routes/price-route-simpleSwap-univ3-usdc-usdt.json +55 -0
- package/build/executor/fixtures/executor02/exchange-params/price-route-multiSwap-balancerv1-sushiv3-univ3-bal-eth-sushi.json +23 -0
- package/build/executor/fixtures/executor02/exchange-params/price-route-multiSwap-maverickv1-sushiv3-univ3-eth-usdc-mav.json +37 -0
- package/build/executor/fixtures/executor02/exchange-params/price-route-multiSwap-univ3-sushiv3-sushi-eth-wbtc.json +23 -0
- package/build/executor/fixtures/executor02/exchange-params/price-route-multiSwap-univ3-sushiv3-wbtc-eth-sushi.json +23 -0
- package/build/executor/fixtures/executor02/exchange-params/price-route-multiswap-curvev1-univ3-dai-usdc-eth.json +51 -0
- package/build/executor/fixtures/executor02/exchange-params/price-route-multiswap-univ3-usdt-dai-eth.json +58 -0
- package/build/executor/fixtures/executor02/exchange-params/price-route-simpleSwap-sushiv3-balancerv1-eth-usdc.json +23 -0
- package/build/executor/fixtures/executor02/exchange-params/price-route-simpleSwap-sushiv3-balancerv1-usdc-eth.json +23 -0
- package/build/executor/fixtures/executor02/exchange-params/price-route-simpleSwap-sushiv3-univ3-eth-sushi.json +9 -0
- package/build/executor/fixtures/executor02/exchange-params/price-route-simpleSwap-sushiv3-univ3-sushi-eth.json +16 -0
- package/build/executor/fixtures/executor02/exchange-params/price-route-simpleSwap-univ3-curvev1-usdt-dai.json +23 -0
- package/build/executor/fixtures/executor02/maybe-weth-calldata/price-route-multiSwap-balancerv1-sushiv3-univ3-bal-eth-sushi.json +12 -0
- package/build/executor/fixtures/executor02/maybe-weth-calldata/price-route-multiSwap-maverickv1-sushiv3-univ3-eth-usdc-mav.json +7 -0
- package/build/executor/fixtures/executor02/maybe-weth-calldata/price-route-multiSwap-univ3-sushiv3-sushi-eth-wbtc.json +12 -0
- package/build/executor/fixtures/executor02/maybe-weth-calldata/price-route-multiSwap-univ3-sushiv3-wbtc-eth-sushi.json +12 -0
- package/build/executor/fixtures/executor02/maybe-weth-calldata/price-route-multiswap-curvev1-univ3-dai-usdc-eth.json +7 -0
- package/build/executor/fixtures/executor02/maybe-weth-calldata/price-route-multiswap-univ3-usdt-dai-eth.json +7 -0
- package/build/executor/fixtures/executor02/maybe-weth-calldata/price-route-simpleSwap-sushiv3-balancerv1-eth-usdc.json +7 -0
- package/build/executor/fixtures/executor02/maybe-weth-calldata/price-route-simpleSwap-sushiv3-balancerv1-usdc-eth.json +7 -0
- package/build/executor/fixtures/executor02/maybe-weth-calldata/price-route-simpleSwap-sushiv3-univ3-eth-sushi.json +7 -0
- package/build/executor/fixtures/executor02/maybe-weth-calldata/price-route-simpleSwap-sushiv3-univ3-sushi-eth.json +7 -0
- package/build/executor/fixtures/executor02/routes/price-route-multiSwap-balancerv1-sushiv3-univ3-bal-eth-sushi.json +130 -0
- package/build/executor/fixtures/executor02/routes/price-route-multiSwap-maverickv1-sushiv3-univ3-eth-usdc-mav.json +136 -0
- package/build/executor/fixtures/executor02/routes/price-route-multiSwap-univ3-sushiv3-sushi-eth-wbtc.json +100 -0
- package/build/executor/fixtures/executor02/routes/price-route-multiSwap-univ3-sushiv3-wbtc-eth-sushi.json +100 -0
- package/build/executor/fixtures/executor02/routes/price-route-multiswap-curvev1-univ3-dai-usdc-eth.json +166 -0
- package/build/executor/fixtures/executor02/routes/price-route-multiswap-univ3-usdt-dai-eth.json +190 -0
- package/build/executor/fixtures/executor02/routes/price-route-simpleSwap-sushiv3-balancerv1-eth-usdc.json +114 -0
- package/build/executor/fixtures/executor02/routes/price-route-simpleSwap-sushiv3-balancerv1-usdc-eth.json +114 -0
- package/build/executor/fixtures/executor02/routes/price-route-simpleSwap-sushiv3-univ3-eth-sushi.json +55 -0
- package/build/executor/fixtures/executor02/routes/price-route-simpleSwap-sushiv3-univ3-sushi-eth.json +73 -0
- package/build/executor/fixtures/executor02/routes/price-route-simpleSwap-univ3-curvev1-usdt-dai.json +82 -0
- package/build/lib/fetcher/wsFetcher.d.ts +7 -3
- package/build/lib/fetcher/wsFetcher.js +64 -51
- package/build/lib/fetcher/wsFetcher.js.map +1 -1
- package/package.json +4 -2
- package/src/config.ts +1 -0
- package/src/dex/bebop/bebop-e2e.test.ts +21 -0
- package/src/dex/bebop/bebop.json +72 -0
- package/src/dex/bebop/bebop.proto +15 -0
- package/src/dex/bebop/bebop.ts +1 -1
- package/src/dex/bebop/config.ts +5 -0
- package/src/dex/bebop/rate-fetcher.ts +51 -6
- package/src/dex/bebop/validators.ts +10 -0
- package/src/lib/fetcher/wsFetcher.ts +79 -66
- package/.vscode/launch.json +0 -53
- package/.vscode/settings.json +0 -2
- package/.vscode/tasks.json +0 -15
- package/build/abi/uniswap-v3/AlienBaseV3Router.abi.json +0 -52
- package/build/dex/aave-v2/tokens-avalanche.json +0 -44
- package/build/dex/aave-v2/tokens-mainnet.json +0 -188
- package/build/dex/aave-v2/tokens-polygon.json +0 -44
- package/build/dex/bProtocol.d.ts +0 -18
- package/build/dex/bProtocol.js +0 -39
- package/build/dex/bProtocol.js.map +0 -1
- package/build/dex/balancer-v3/abi/balancerBatchRouter.d.ts +0 -729
- package/build/dex/balancer-v3/abi/balancerBatchRouter.js +0 -732
- package/build/dex/balancer-v3/abi/balancerBatchRouter.js.map +0 -1
- package/build/dex/balancer-v3/abi/balancerRouter.d.ts +0 -1406
- package/build/dex/balancer-v3/abi/balancerRouter.js +0 -1175
- package/build/dex/balancer-v3/abi/balancerRouter.js.map +0 -1
- package/build/dex/balancer-v3/abi/vaultExtension.V3.d.ts +0 -2081
- package/build/dex/balancer-v3/abi/vaultExtension.V3.js +0 -1851
- package/build/dex/balancer-v3/abi/vaultExtension.V3.js.map +0 -1
- package/build/dex/balancer-v3/balancer-v3-pool.d.ts +0 -76
- package/build/dex/balancer-v3/balancer-v3-pool.js +0 -383
- package/build/dex/balancer-v3/balancer-v3-pool.js.map +0 -1
- package/build/dex/balancer-v3/balancer-v3.d.ts +0 -57
- package/build/dex/balancer-v3/balancer-v3.js +0 -373
- package/build/dex/balancer-v3/balancer-v3.js.map +0 -1
- package/build/dex/balancer-v3/config.d.ts +0 -8
- package/build/dex/balancer-v3/config.js +0 -24
- package/build/dex/balancer-v3/config.js.map +0 -1
- package/build/dex/balancer-v3/getOnChainState.d.ts +0 -10
- package/build/dex/balancer-v3/getOnChainState.js +0 -158
- package/build/dex/balancer-v3/getOnChainState.js.map +0 -1
- package/build/dex/balancer-v3/getPoolsApi.d.ts +0 -2
- package/build/dex/balancer-v3/getPoolsApi.js +0 -81
- package/build/dex/balancer-v3/getPoolsApi.js.map +0 -1
- package/build/dex/balancer-v3/getTopPoolsApi.d.ts +0 -13
- package/build/dex/balancer-v3/getTopPoolsApi.js +0 -62
- package/build/dex/balancer-v3/getTopPoolsApi.js.map +0 -1
- package/build/dex/balancer-v3/types.d.ts +0 -63
- package/build/dex/balancer-v3/types.js +0 -3
- package/build/dex/balancer-v3/types.js.map +0 -1
- package/build/dex/bancor.d.ts +0 -26
- package/build/dex/bancor.js +0 -58
- package/build/dex/bancor.js.map +0 -1
- package/build/dex/compound.d.ts +0 -18
- package/build/dex/compound.js +0 -46
- package/build/dex/compound.js.map +0 -1
- package/build/dex/curve-v2.d.ts +0 -58
- package/build/dex/curve-v2.js +0 -180
- package/build/dex/curve-v2.js.map +0 -1
- package/build/dex/dodo-v1.d.ts +0 -33
- package/build/dex/dodo-v1.js +0 -63
- package/build/dex/dodo-v1.js.map +0 -1
- package/build/dex/fluid-dex/fluid-dex-pool.d.ts +0 -47
- package/build/dex/fluid-dex/fluid-dex-pool.js +0 -119
- package/build/dex/fluid-dex/fluid-dex-pool.js.map +0 -1
- package/build/dex/lido.d.ts +0 -19
- package/build/dex/lido.js +0 -42
- package/build/dex/lido.js.map +0 -1
- package/build/dex/maker-psm/scripts/gem.abi.json +0 -136
- package/build/dex/maker-psm/scripts/validate-state.d.ts +0 -0
- package/build/dex/maker-psm/scripts/validate-state.js +0 -185
- package/build/dex/maker-psm/scripts/validate-state.js.map +0 -1
- package/build/dex/maker-psm/scripts/vat.abi.json +0 -243
- package/build/dex/onebit.d.ts +0 -25
- package/build/dex/onebit.js +0 -42
- package/build/dex/onebit.js.map +0 -1
- package/build/dex/smoothy.d.ts +0 -26
- package/build/dex/smoothy.js +0 -48
- package/build/dex/smoothy.js.map +0 -1
- package/build/dex/solidly-v3/scripts/check-event-pool-event.d.ts +0 -1
- package/build/dex/solidly-v3/scripts/check-event-pool-event.js +0 -53
- package/build/dex/solidly-v3/scripts/check-event-pool-event.js.map +0 -1
- package/build/dex/stable-pool.d.ts +0 -28
- package/build/dex/stable-pool.js +0 -55
- package/build/dex/stable-pool.js.map +0 -1
- package/build/dex/trader-joe-v2.1/trader-joe-v2.1-new.d.ts +0 -7
- package/build/dex/trader-joe-v2.1/trader-joe-v2.1-new.js +0 -20
- package/build/dex/trader-joe-v2.1/trader-joe-v2.1-new.js.map +0 -1
- package/build/dex/trader-joe-v2.1.d.ts +0 -43
- package/build/dex/trader-joe-v2.1.js +0 -79
- package/build/dex/trader-joe-v2.1.js.map +0 -1
- package/build/dex/uniswap-v3/forks/alien-base-v3/alien-base-v3.d.ts +0 -17
- package/build/dex/uniswap-v3/forks/alien-base-v3/alien-base-v3.js +0 -64
- package/build/dex/uniswap-v3/forks/alien-base-v3/alien-base-v3.js.map +0 -1
- package/build/dex/uniswap-v3/forks/alien-v3/alien-v3.d.ts +0 -17
- package/build/dex/uniswap-v3/forks/alien-v3/alien-v3.js +0 -79
- package/build/dex/uniswap-v3/forks/alien-v3/alien-v3.js.map +0 -1
- package/build/dex/uniswap-v3/uniswap-v3-pricing.d.ts +0 -4
- package/build/dex/uniswap-v3/uniswap-v3-pricing.js +0 -43
- package/build/dex/uniswap-v3/uniswap-v3-pricing.js.map +0 -1
- package/build/dex/uniswap-v3/uniswap-v3-worker.d.ts +0 -1
- package/build/dex/uniswap-v3/uniswap-v3-worker.js +0 -10
- package/build/dex/uniswap-v3/uniswap-v3-worker.js.map +0 -1
package/build/dex/dodo-v1.d.ts
DELETED
|
@@ -1,33 +0,0 @@
|
|
|
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 { NumberAsString } from '@paraswap/core';
|
|
7
|
-
import { IDexHelper } from '../dex-helper';
|
|
8
|
-
export declare type DodoV1Data = {
|
|
9
|
-
fromToken: Address;
|
|
10
|
-
toToken: Address;
|
|
11
|
-
dodoPairs: Address[];
|
|
12
|
-
directions: string;
|
|
13
|
-
isIncentive: boolean;
|
|
14
|
-
deadLine: string;
|
|
15
|
-
};
|
|
16
|
-
declare type DodoV1Param = [
|
|
17
|
-
fromToken: Address,
|
|
18
|
-
toToken: Address,
|
|
19
|
-
fromTokenAmount: NumberAsString,
|
|
20
|
-
minReturnAmount: NumberAsString,
|
|
21
|
-
dodoPairs: Address[],
|
|
22
|
-
directions: NumberAsString,
|
|
23
|
-
isIncentive: boolean,
|
|
24
|
-
deadLine: NumberAsString
|
|
25
|
-
];
|
|
26
|
-
export declare class DodoV1 extends SimpleExchange implements IDexTxBuilder<DodoV1Data, DodoV1Param> {
|
|
27
|
-
static dexKeys: string[];
|
|
28
|
-
dodoV2Proxy: Interface;
|
|
29
|
-
constructor(dexHelper: IDexHelper);
|
|
30
|
-
getAdapterParam(srcToken: string, destToken: string, srcAmount: string, destAmount: string, data: DodoV1Data, side: SwapSide): AdapterExchangeParam;
|
|
31
|
-
getSimpleParam(srcToken: string, destToken: string, srcAmount: string, destAmount: string, data: DodoV1Data, side: SwapSide): Promise<SimpleExchangeParam>;
|
|
32
|
-
}
|
|
33
|
-
export {};
|
package/build/dex/dodo-v1.js
DELETED
|
@@ -1,63 +0,0 @@
|
|
|
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.DodoV1 = void 0;
|
|
7
|
-
const abi_1 = require("@ethersproject/abi");
|
|
8
|
-
const constants_1 = require("../constants");
|
|
9
|
-
const simple_exchange_1 = require("./simple-exchange");
|
|
10
|
-
const dodo_v2_proxy_json_1 = __importDefault(require("../abi/dodo-v2-proxy.json"));
|
|
11
|
-
// We use dodo-v2 proxy as the new proxy supports both v1 and v2
|
|
12
|
-
const DODOV2ProxyAddress = {
|
|
13
|
-
1: '0xa356867fdcea8e71aeaf87805808803806231fdc',
|
|
14
|
-
56: '0x8F8Dd7DB1bDA5eD3da8C9daf3bfa471c12d58486',
|
|
15
|
-
42161: '0x88CBf433471A0CD8240D2a12354362988b4593E5',
|
|
16
|
-
};
|
|
17
|
-
const DODOAproveAddress = {
|
|
18
|
-
1: '0xCB859eA579b28e02B87A1FDE08d087ab9dbE5149',
|
|
19
|
-
56: '0xa128Ba44B2738A558A1fdC06d6303d52D3Cef8c1',
|
|
20
|
-
42161: '0xA867241cDC8d3b0C07C85cC06F25a0cD3b5474d8',
|
|
21
|
-
};
|
|
22
|
-
var DodoV1Functions;
|
|
23
|
-
(function (DodoV1Functions) {
|
|
24
|
-
DodoV1Functions["dodoSwapV1"] = "dodoSwapV1";
|
|
25
|
-
})(DodoV1Functions || (DodoV1Functions = {}));
|
|
26
|
-
class DodoV1 extends simple_exchange_1.SimpleExchange {
|
|
27
|
-
constructor(dexHelper) {
|
|
28
|
-
super(dexHelper, 'dodov1');
|
|
29
|
-
this.dodoV2Proxy = new abi_1.Interface(dodo_v2_proxy_json_1.default);
|
|
30
|
-
}
|
|
31
|
-
getAdapterParam(srcToken, destToken, srcAmount, destAmount, data, side) {
|
|
32
|
-
const { dodoPairs, directions } = data;
|
|
33
|
-
const payload = this.abiCoder.encodeParameter({
|
|
34
|
-
ParentStruct: {
|
|
35
|
-
dodoPairs: 'address[]',
|
|
36
|
-
directions: 'uint256',
|
|
37
|
-
},
|
|
38
|
-
}, { dodoPairs, directions });
|
|
39
|
-
return {
|
|
40
|
-
targetExchange: DODOV2ProxyAddress[this.network],
|
|
41
|
-
payload,
|
|
42
|
-
networkFee: '0',
|
|
43
|
-
};
|
|
44
|
-
}
|
|
45
|
-
async getSimpleParam(srcToken, destToken, srcAmount, destAmount, data, side) {
|
|
46
|
-
const swapFunction = DodoV1Functions.dodoSwapV1;
|
|
47
|
-
const swapFunctionParams = [
|
|
48
|
-
srcToken,
|
|
49
|
-
destToken,
|
|
50
|
-
srcAmount,
|
|
51
|
-
destAmount,
|
|
52
|
-
data.dodoPairs,
|
|
53
|
-
data.directions,
|
|
54
|
-
data.isIncentive,
|
|
55
|
-
constants_1.MAX_UINT,
|
|
56
|
-
];
|
|
57
|
-
const swapData = this.dodoV2Proxy.encodeFunctionData(swapFunction, swapFunctionParams);
|
|
58
|
-
return this.buildSimpleParamWithoutWETHConversion(srcToken, srcAmount, destToken, destAmount, swapData, DODOV2ProxyAddress[this.network], DODOAproveAddress[this.network]);
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
exports.DodoV1 = DodoV1;
|
|
62
|
-
DodoV1.dexKeys = ['dodov1'];
|
|
63
|
-
//# sourceMappingURL=dodo-v1.js.map
|
package/build/dex/dodo-v1.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"dodo-v1.js","sourceRoot":"","sources":["../../src/dex/dodo-v1.ts"],"names":[],"mappings":";;;;;;AAAA,4CAA6D;AAC7D,4CAAkD;AAGlD,uDAAmD;AACnD,mFAAuD;AAKvD,gEAAgE;AAChE,MAAM,kBAAkB,GAAmC;IACzD,CAAC,EAAE,4CAA4C;IAC/C,EAAE,EAAE,4CAA4C;IAChD,KAAK,EAAE,4CAA4C;CACpD,CAAC;AAEF,MAAM,iBAAiB,GAAmC;IACxD,CAAC,EAAE,4CAA4C;IAC/C,EAAE,EAAE,4CAA4C;IAChD,KAAK,EAAE,4CAA4C;CACpD,CAAC;AAqB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AU,EACV,QAAQ,EACR,kBAAkB,CAAC,IAAI,CAAC,OAAO,CAAC,EAChC,iBAAiB,CAAC,IAAI,CAAC,OAAO,CAAC,CAChC,CAAC;IACJ,CAAC;;AAvEH,wBAwEC;AApEQ,cAAO,GAAG,CAAC,QAAQ,CAAC,CAAC"}
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
import { Interface } from '@ethersproject/abi';
|
|
2
|
-
import { DeepReadonly } from 'ts-essentials';
|
|
3
|
-
import { Log, Logger } from '../../types';
|
|
4
|
-
import { StatefulEventSubscriber } from '../../stateful-event-subscriber';
|
|
5
|
-
import { IDexHelper } from '../../dex-helper/idex-helper';
|
|
6
|
-
import { CommonAddresses, FluidDexPoolState } from './types';
|
|
7
|
-
import { Address } from '../../types';
|
|
8
|
-
export declare class FluidDexEventPool extends StatefulEventSubscriber<FluidDexPoolState> {
|
|
9
|
-
readonly parentName: string;
|
|
10
|
-
readonly pool: Address;
|
|
11
|
-
readonly commonAddresses: CommonAddresses;
|
|
12
|
-
protected network: number;
|
|
13
|
-
readonly dexHelper: IDexHelper;
|
|
14
|
-
handlers: {
|
|
15
|
-
[event: string]: (event: any, state: DeepReadonly<FluidDexPoolState>, log: Readonly<Log>) => Promise<DeepReadonly<FluidDexPoolState> | null>;
|
|
16
|
-
};
|
|
17
|
-
logDecoder: (log: Log) => any;
|
|
18
|
-
addressesSubscribed: Address[];
|
|
19
|
-
protected liquidityIface: Interface;
|
|
20
|
-
constructor(parentName: string, pool: Address, commonAddresses: CommonAddresses, network: number, dexHelper: IDexHelper, logger: Logger);
|
|
21
|
-
/**
|
|
22
|
-
* Handle a trade rate change on the pool.
|
|
23
|
-
*/
|
|
24
|
-
handleOperate(event: any, state: DeepReadonly<FluidDexPoolState>, log: Readonly<Log>): Promise<DeepReadonly<FluidDexPoolState> | null>;
|
|
25
|
-
/**
|
|
26
|
-
* The function is called every time any of the subscribed
|
|
27
|
-
* addresses release log. The function accepts the current
|
|
28
|
-
* state, updates the state according to the log, and returns
|
|
29
|
-
* the updated state.
|
|
30
|
-
* @param state - Current state of event subscriber
|
|
31
|
-
* @param log - Log released by one of the subscribed addresses
|
|
32
|
-
* @returns Updates state of the event subscriber after the log
|
|
33
|
-
*/
|
|
34
|
-
processLog(state: DeepReadonly<FluidDexPoolState>, log: Readonly<Log>): Promise<DeepReadonly<FluidDexPoolState> | null>;
|
|
35
|
-
getStateOrGenerate(blockNumber: number, readonly?: boolean): Promise<FluidDexPoolState>;
|
|
36
|
-
/**
|
|
37
|
-
* The function generates state using on-chain calls. This
|
|
38
|
-
* function is called to regenerate state if the event based
|
|
39
|
-
* system fails to fetch events and the local state is no
|
|
40
|
-
* more correct.
|
|
41
|
-
* @param blockNumber - Blocknumber for which the state should
|
|
42
|
-
* should be generated
|
|
43
|
-
* @returns state of the event subscriber at blocknumber
|
|
44
|
-
*/
|
|
45
|
-
generateState(blockNumber: number): Promise<DeepReadonly<FluidDexPoolState>>;
|
|
46
|
-
private convertToFluidDexPoolState;
|
|
47
|
-
}
|
|
@@ -1,119 +0,0 @@
|
|
|
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.FluidDexEventPool = void 0;
|
|
7
|
-
const abi_1 = require("@ethersproject/abi");
|
|
8
|
-
const utils_1 = require("../../utils");
|
|
9
|
-
const stateful_event_subscriber_1 = require("../../stateful-event-subscriber");
|
|
10
|
-
const resolver_abi_json_1 = __importDefault(require("../../abi/fluid-dex/resolver.abi.json"));
|
|
11
|
-
const liquidityUserModule_abi_json_1 = __importDefault(require("../../abi/fluid-dex/liquidityUserModule.abi.json"));
|
|
12
|
-
const ethers_1 = require("ethers");
|
|
13
|
-
class FluidDexEventPool extends stateful_event_subscriber_1.StatefulEventSubscriber {
|
|
14
|
-
constructor(parentName, pool, commonAddresses, network, dexHelper, logger) {
|
|
15
|
-
super(parentName, 'FluidDex_' + pool, dexHelper, logger);
|
|
16
|
-
this.parentName = parentName;
|
|
17
|
-
this.pool = pool;
|
|
18
|
-
this.commonAddresses = commonAddresses;
|
|
19
|
-
this.network = network;
|
|
20
|
-
this.dexHelper = dexHelper;
|
|
21
|
-
this.handlers = {};
|
|
22
|
-
this.liquidityIface = new abi_1.Interface(liquidityUserModule_abi_json_1.default);
|
|
23
|
-
this.logDecoder = (log) => this.liquidityIface.parseLog(log);
|
|
24
|
-
this.addressesSubscribed = [commonAddresses.liquidityProxy];
|
|
25
|
-
// Add handlers
|
|
26
|
-
this.handlers['LogOperate'] = this.handleOperate.bind(this);
|
|
27
|
-
}
|
|
28
|
-
/**
|
|
29
|
-
* Handle a trade rate change on the pool.
|
|
30
|
-
*/
|
|
31
|
-
async handleOperate(event, state, log) {
|
|
32
|
-
if (!(event.args.user in [this.pool])) {
|
|
33
|
-
return null;
|
|
34
|
-
}
|
|
35
|
-
const resolverContract = new ethers_1.Contract(this.commonAddresses.resolver, resolver_abi_json_1.default, this.dexHelper.provider);
|
|
36
|
-
const rawResult = await resolverContract.callStatic.getPoolReservesAdjusted(this.pool, {
|
|
37
|
-
blockTag: this.dexHelper.provider,
|
|
38
|
-
});
|
|
39
|
-
const generatedState = this.convertToFluidDexPoolState(rawResult);
|
|
40
|
-
this.setState(generatedState, await this.dexHelper.provider.getBlockNumber());
|
|
41
|
-
return generatedState;
|
|
42
|
-
}
|
|
43
|
-
/**
|
|
44
|
-
* The function is called every time any of the subscribed
|
|
45
|
-
* addresses release log. The function accepts the current
|
|
46
|
-
* state, updates the state according to the log, and returns
|
|
47
|
-
* the updated state.
|
|
48
|
-
* @param state - Current state of event subscriber
|
|
49
|
-
* @param log - Log released by one of the subscribed addresses
|
|
50
|
-
* @returns Updates state of the event subscriber after the log
|
|
51
|
-
*/
|
|
52
|
-
async processLog(state, log) {
|
|
53
|
-
try {
|
|
54
|
-
const event = this.logDecoder(log);
|
|
55
|
-
if (event.name in this.handlers) {
|
|
56
|
-
return await this.handlers[event.name](event, state, log);
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
catch (e) {
|
|
60
|
-
(0, utils_1.catchParseLogError)(e, this.logger);
|
|
61
|
-
}
|
|
62
|
-
return null;
|
|
63
|
-
}
|
|
64
|
-
async getStateOrGenerate(blockNumber, readonly = false) {
|
|
65
|
-
let state = this.getState(blockNumber);
|
|
66
|
-
if (!state) {
|
|
67
|
-
state = await this.generateState(blockNumber);
|
|
68
|
-
if (!readonly)
|
|
69
|
-
this.setState(state, blockNumber);
|
|
70
|
-
}
|
|
71
|
-
return state;
|
|
72
|
-
}
|
|
73
|
-
/**
|
|
74
|
-
* The function generates state using on-chain calls. This
|
|
75
|
-
* function is called to regenerate state if the event based
|
|
76
|
-
* system fails to fetch events and the local state is no
|
|
77
|
-
* more correct.
|
|
78
|
-
* @param blockNumber - Blocknumber for which the state should
|
|
79
|
-
* should be generated
|
|
80
|
-
* @returns state of the event subscriber at blocknumber
|
|
81
|
-
*/
|
|
82
|
-
async generateState(blockNumber) {
|
|
83
|
-
const resolverContract = new ethers_1.Contract(this.commonAddresses.resolver, resolver_abi_json_1.default, this.dexHelper.provider);
|
|
84
|
-
const rawResult = await resolverContract.callStatic.getPoolReservesAdjusted(this.pool, {
|
|
85
|
-
blockTag: blockNumber,
|
|
86
|
-
});
|
|
87
|
-
const convertedResult = this.convertToFluidDexPoolState(rawResult);
|
|
88
|
-
return convertedResult;
|
|
89
|
-
}
|
|
90
|
-
convertToFluidDexPoolState(input) {
|
|
91
|
-
// Ignore the first three addresses
|
|
92
|
-
const [, , , feeHex, collateralReservesHex, debtReservesHex] = input;
|
|
93
|
-
// Convert fee from hex to number
|
|
94
|
-
const fee = Number(feeHex.toString());
|
|
95
|
-
// Convert collateral reserves
|
|
96
|
-
const collateralReserves = {
|
|
97
|
-
token0RealReserves: BigInt(collateralReservesHex[0].toString()),
|
|
98
|
-
token1RealReserves: BigInt(collateralReservesHex[1].toString()),
|
|
99
|
-
token0ImaginaryReserves: BigInt(collateralReservesHex[2].toString()),
|
|
100
|
-
token1ImaginaryReserves: BigInt(collateralReservesHex[3].toString()),
|
|
101
|
-
};
|
|
102
|
-
// Convert debt reserves
|
|
103
|
-
const debtReserves = {
|
|
104
|
-
token0Debt: BigInt(debtReservesHex[0].toString()),
|
|
105
|
-
token1Debt: BigInt(debtReservesHex[1].toString()),
|
|
106
|
-
token0RealReserves: BigInt(debtReservesHex[2].toString()),
|
|
107
|
-
token1RealReserves: BigInt(debtReservesHex[3].toString()),
|
|
108
|
-
token0ImaginaryReserves: BigInt(debtReservesHex[4].toString()),
|
|
109
|
-
token1ImaginaryReserves: BigInt(debtReservesHex[5].toString()),
|
|
110
|
-
};
|
|
111
|
-
return {
|
|
112
|
-
collateralReserves,
|
|
113
|
-
debtReserves,
|
|
114
|
-
fee,
|
|
115
|
-
};
|
|
116
|
-
}
|
|
117
|
-
}
|
|
118
|
-
exports.FluidDexEventPool = FluidDexEventPool;
|
|
119
|
-
//# sourceMappingURL=fluid-dex-pool.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"fluid-dex-pool.js","sourceRoot":"","sources":["../../../src/dex/fluid-dex/fluid-dex-pool.ts"],"names":[],"mappings":";;;;;;AAAA,4CAA+C;AAG/C,uCAAiD;AACjD,+EAA0E;AAE1E,8FAAgE;AAChE,oHAA4E;AAQ5E,mCAAkC;AAElC,MAAa,iBAAkB,SAAQ,mDAA0C;IAc/E,YACW,UAAkB,EAClB,IAAa,EACb,eAAgC,EAC/B,OAAe,EAChB,SAAqB,EAC9B,MAAc;QAEd,KAAK,CAAC,UAAU,EAAE,WAAW,GAAG,IAAI,EAAE,SAAS,EAAE,MAAM,CAAC,CAAC;QAPhD,eAAU,GAAV,UAAU,CAAQ;QAClB,SAAI,GAAJ,IAAI,CAAS;QACb,oBAAe,GAAf,eAAe,CAAiB;QAC/B,YAAO,GAAP,OAAO,CA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ts
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { Interface } from '@ethersproject/abi';
|
|
2
|
-
import { NumberAsString, SwapSide } from '@paraswap/core';
|
|
3
|
-
import { AdapterExchangeParam, Address, SimpleExchangeParam } from '../types';
|
|
4
|
-
import { IDexTxBuilder } from './idex';
|
|
5
|
-
import { IDexHelper } from '../dex-helper';
|
|
6
|
-
export declare const stETH: any;
|
|
7
|
-
export declare enum stETHFunctions {
|
|
8
|
-
submit = "submit"
|
|
9
|
-
}
|
|
10
|
-
export declare type LidoData = {};
|
|
11
|
-
export declare class Lido implements IDexTxBuilder<LidoData, any> {
|
|
12
|
-
static dexKeys: string[];
|
|
13
|
-
stETHInterface: Interface;
|
|
14
|
-
needWrapNative: boolean;
|
|
15
|
-
private network;
|
|
16
|
-
constructor(dexHelper: IDexHelper);
|
|
17
|
-
getAdapterParam(srcToken: Address, destToken: Address, srcAmount: NumberAsString, destAmount: NumberAsString, data: LidoData, side: SwapSide): AdapterExchangeParam;
|
|
18
|
-
getSimpleParam(srcToken: Address, destToken: Address, srcAmount: NumberAsString, destAmount: NumberAsString, data: LidoData, side: SwapSide): Promise<SimpleExchangeParam>;
|
|
19
|
-
}
|
package/build/dex/lido.js
DELETED
|
@@ -1,42 +0,0 @@
|
|
|
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.Lido = exports.stETHFunctions = exports.stETH = void 0;
|
|
7
|
-
const abi_1 = require("@ethersproject/abi");
|
|
8
|
-
const stETH_json_1 = __importDefault(require("../abi/stETH.json"));
|
|
9
|
-
const constants_1 = require("../constants");
|
|
10
|
-
exports.stETH = {
|
|
11
|
-
1: '0xae7ab96520de3a18e5e111b5eaab095312d7fe84',
|
|
12
|
-
};
|
|
13
|
-
var stETHFunctions;
|
|
14
|
-
(function (stETHFunctions) {
|
|
15
|
-
stETHFunctions["submit"] = "submit";
|
|
16
|
-
})(stETHFunctions = exports.stETHFunctions || (exports.stETHFunctions = {}));
|
|
17
|
-
class Lido {
|
|
18
|
-
constructor(dexHelper) {
|
|
19
|
-
this.needWrapNative = false;
|
|
20
|
-
this.network = dexHelper.config.data.network;
|
|
21
|
-
this.stETHInterface = new abi_1.Interface(stETH_json_1.default);
|
|
22
|
-
}
|
|
23
|
-
getAdapterParam(srcToken, destToken, srcAmount, destAmount, data, side) {
|
|
24
|
-
return {
|
|
25
|
-
targetExchange: exports.stETH[this.network],
|
|
26
|
-
payload: '0x',
|
|
27
|
-
networkFee: '0',
|
|
28
|
-
};
|
|
29
|
-
}
|
|
30
|
-
async getSimpleParam(srcToken, destToken, srcAmount, destAmount, data, side) {
|
|
31
|
-
const swapData = this.stETHInterface.encodeFunctionData(stETHFunctions.submit, [constants_1.NULL_ADDRESS]);
|
|
32
|
-
return {
|
|
33
|
-
callees: [exports.stETH[this.network]],
|
|
34
|
-
calldata: [swapData],
|
|
35
|
-
values: [srcAmount],
|
|
36
|
-
networkFee: '0',
|
|
37
|
-
};
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
exports.Lido = Lido;
|
|
41
|
-
Lido.dexKeys = ['lido'];
|
|
42
|
-
//# sourceMappingURL=lido.js.map
|
package/build/dex/lido.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"lido.js","sourceRoot":"","sources":["../../src/dex/lido.ts"],"names":[],"mappings":";;;;;;AAAA,4CAA6D;AAI7D,mEAAyC;AACzC,4CAA4C;AAI/B,QAAA,KAAK,GAAQ;IACxB,CAAC,EAAE,4CAA4C;CAChD,CAAC;AAEF,IAAY,cAEX;AAFD,WAAY,cAAc;IACxB,mCAAiB,CAAA;AACnB,CAAC,EAFW,cAAc,GAAd,sBAAc,KAAd,sBAAc,QAEzB;AAID,MAAa,IAAI;IAQf,YAAY,SAAqB;QAJjC,mBAAc,GAAG,KAAK,CAAC;QAKrB,IAAI,CAAC,OAAO,GAAG,SAAS,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC;QAE7C,IAAI,CAAC,cAAc,GAAG,IAAI,eAAS,CAAC,oBAA0B,CAAC,CAAC;IAClE,CAAC;IAED,eAAe,CACb,QAAiB,EACjB,SAAkB,EAClB,SAAyB,EACzB,UAA0B,EAC1B,IAAc,EACd,IAAc;QAEd,OAAO;YACL,cAAc,EAAE,aAAK,CAAC,IAAI,CAAC,OAAO,CAAC;YACnC,OAAO,EAAE,IAAI;YACb,UAAU,EAAE,GAAG;SAChB,CAAC;IACJ,CAAC;IAED,KAAK,CAAC,cAAc,CAClB,QAAiB,EACjB,SAAkB,EAClB,SAAyB,EACzB,UAA0B,EAC1B,IAAc,EACd,IAAc;QAEd,MAAM,QAAQ,GAAG,IAAI,CAAC,cAAc,CAAC,kBAAkB,CACrD,cAAc,CAAC,MAAM,EACrB,CAAC,wBAAY,CAAC,CACf,CAAC;QAEF,OAAO;YACL,OAAO,EAAE,CAAC,aAAK,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;YAC9B,QAAQ,EAAE,CAAC,QAAQ,CAAC;YACpB,MAAM,EAAE,CAAC,SAAS,CAAC;YACnB,UAAU,EAAE,GAAG;SAChB,CAAC;IACJ,CAAC;;AAhDH,oBAiDC;AAhDQ,YAAO,GAAG,CAAC,MAAM,CAAC,CAAC"}
|
|
@@ -1,136 +0,0 @@
|
|
|
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
|
-
]
|
|
File without changes
|