@dodoex/dodo-contract-request 1.0.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.
- package/.cache/contract-info/BuyoutModel.json +1 -0
- package/.cache/contract-info/CP.json +1 -0
- package/.cache/contract-info/CloneFactory.json +1 -0
- package/.cache/contract-info/CrowdPoolingFactory.json +1 -0
- package/.cache/contract-info/CustomERC20.json +1 -0
- package/.cache/contract-info/CustomMintableERC20.json +1 -0
- package/.cache/contract-info/D3Proxy.json +1 -0
- package/.cache/contract-info/D3Vault.json +1 -0
- package/.cache/contract-info/DODOApprove.json +1 -0
- package/.cache/contract-info/DODOApproveProxy.json +1 -0
- package/.cache/contract-info/DODOCalleeHelper.json +1 -0
- package/.cache/contract-info/DODOCirculationHelper.json +1 -0
- package/.cache/contract-info/DODOCpProxy.json +148 -0
- package/.cache/contract-info/DODOCpProxyWithoutGlobalQuota.json +1 -0
- package/.cache/contract-info/DODODppProxy.json +1 -0
- package/.cache/contract-info/DODODspProxy.json +1 -0
- package/.cache/contract-info/DODODspProxyWithoutGSP.json +1 -0
- package/.cache/contract-info/DODOIncentive.json +1 -0
- package/.cache/contract-info/DODOMineV2Factory.json +1 -0
- package/.cache/contract-info/DODOMineV3Proxy.json +373 -0
- package/.cache/contract-info/DODOMineV3ProxyWithoutPlatform.json +1 -0
- package/.cache/contract-info/DODOMineV3Registry.json +1 -0
- package/.cache/contract-info/DODONFT.json +1 -0
- package/.cache/contract-info/DODONFT1155.json +1 -0
- package/.cache/contract-info/DODONFTApprove.json +1 -0
- package/.cache/contract-info/DODONFTPoolProxy.json +1 -0
- package/.cache/contract-info/DODONFTProxy.json +1 -0
- package/.cache/contract-info/DODONFTRegistry.json +1 -0
- package/.cache/contract-info/DODONFTRouteHelper.json +1 -0
- package/.cache/contract-info/DODOSellHelper.json +1 -0
- package/.cache/contract-info/DODOStarterProxy.json +1 -0
- package/.cache/contract-info/DODOV1.json +1 -0
- package/.cache/contract-info/DODOV1Adapter.json +1 -0
- package/.cache/contract-info/DODOV1PmmHelper.json +88 -0
- package/.cache/contract-info/DODOV1Proxy.json +1 -0
- package/.cache/contract-info/DODOV2Proxy02.json +1 -0
- package/.cache/contract-info/DODOV2RouteHelper.json +1 -0
- package/.cache/contract-info/DPPAdvanced.json +1 -0
- package/.cache/contract-info/DPPAdvancedAdmin.json +1 -0
- package/.cache/contract-info/DPPFactory.json +1 -0
- package/.cache/contract-info/DSP.json +1 -0
- package/.cache/contract-info/DSPFactory.json +1 -0
- package/.cache/contract-info/DVM.json +1 -0
- package/.cache/contract-info/DVMFactory.json +1 -0
- package/.cache/contract-info/ERC20.json +1 -0
- package/.cache/contract-info/ERC20Helper.json +1 -0
- package/.cache/contract-info/ERC20MineV3.json +1 -0
- package/.cache/contract-info/ERC20V3Factory.json +1 -0
- package/.cache/contract-info/FeeRateDIP3Impl.json +1 -0
- package/.cache/contract-info/FeeRateModel.json +1 -0
- package/.cache/contract-info/GSP.json +1 -0
- package/.cache/contract-info/GSPFactory.json +1 -0
- package/.cache/contract-info/InitializableERC20.json +1 -0
- package/.cache/contract-info/LimitOrder.json +1 -0
- package/.cache/contract-info/LimitOrderBot.json +1 -0
- package/.cache/contract-info/MulticallWithValid.json +1 -0
- package/.cache/contract-info/PermissionManager.json +1 -0
- package/.cache/contract-info/dodoTeam.json +1 -0
- package/.cache/contract-info/vDODOToken.json +1 -0
- package/.env.sample +1 -0
- package/.releaserc.json +31 -0
- package/CHANGELOG.md +16 -0
- package/README.md +75 -0
- package/babel.config.js +6 -0
- package/contract-config/arbitrum.json +85 -0
- package/contract-config/aurora.json +84 -0
- package/contract-config/avalanche.json +84 -0
- package/contract-config/base.json +84 -0
- package/contract-config/berachain-testnet.json +65 -0
- package/contract-config/bitlayer.json +84 -0
- package/contract-config/bsc.json +85 -0
- package/contract-config/conflux.json +84 -0
- package/contract-config/eth.json +90 -0
- package/contract-config/linea.json +84 -0
- package/contract-config/manta.json +84 -0
- package/contract-config/mantle.json +85 -0
- package/contract-config/morph.json +65 -0
- package/contract-config/optimism.json +84 -0
- package/contract-config/polygon.json +84 -0
- package/contract-config/scroll.json +84 -0
- package/contract-config/sepolia.json +85 -0
- package/contract-config/taiko.json +65 -0
- package/contract-config/x-layer.json +84 -0
- package/contract-config/zero-mainnet.json +65 -0
- package/contract-config/zircuit-mainnet.json +84 -0
- package/dist/config.js +1 -0
- package/dist/index.js +1 -0
- package/dist/types/config/arbitrum.d.ts +40 -0
- package/dist/types/config/aurora.d.ts +25 -0
- package/dist/types/config/avalanche.d.ts +27 -0
- package/dist/types/config/base.d.ts +23 -0
- package/dist/types/config/berachain-testnet.d.ts +30 -0
- package/dist/types/config/bitlayer.d.ts +24 -0
- package/dist/types/config/bsc.d.ts +40 -0
- package/dist/types/config/conflux.d.ts +23 -0
- package/dist/types/config/ethereum.d.ts +45 -0
- package/dist/types/config/index.d.ts +179 -0
- package/dist/types/config/linea.d.ts +24 -0
- package/dist/types/config/manta.d.ts +24 -0
- package/dist/types/config/mantle.d.ts +24 -0
- package/dist/types/config/morph.d.ts +30 -0
- package/dist/types/config/optimism.d.ts +26 -0
- package/dist/types/config/polygon.d.ts +38 -0
- package/dist/types/config/scroll.d.ts +24 -0
- package/dist/types/config/sepolia.d.ts +27 -0
- package/dist/types/config/taiko.d.ts +30 -0
- package/dist/types/config/x-layer.d.ts +25 -0
- package/dist/types/config/zero-mainnet.d.ts +30 -0
- package/dist/types/config/zircuit-mainnet.d.ts +24 -0
- package/dist/types/contract/BuyoutModel.d.ts +83 -0
- package/dist/types/contract/CP.d.ts +317 -0
- package/dist/types/contract/CloneFactory.d.ts +6 -0
- package/dist/types/contract/CrowdPoolingFactory.d.ts +207 -0
- package/dist/types/contract/CustomERC20.d.ts +145 -0
- package/dist/types/contract/CustomMintableERC20.d.ts +158 -0
- package/dist/types/contract/D3Proxy.d.ts +104 -0
- package/dist/types/contract/D3Vault.d.ts +639 -0
- package/dist/types/contract/DODOApprove.d.ts +89 -0
- package/dist/types/contract/DODOApproveProxy.d.ts +103 -0
- package/dist/types/contract/DODOCalleeHelper.d.ts +42 -0
- package/dist/types/contract/DODOCirculationHelper.d.ts +74 -0
- package/dist/types/contract/DODOCpProxy.d.ts +40 -0
- package/dist/types/contract/DODOCpProxyWithoutGlobalQuota.d.ts +40 -0
- package/dist/types/contract/DODODppProxy.d.ts +45 -0
- package/dist/types/contract/DODODspProxy.d.ts +67 -0
- package/dist/types/contract/DODODspProxyWithoutGSP.d.ts +45 -0
- package/dist/types/contract/DODOIncentive.d.ts +137 -0
- package/dist/types/contract/DODOMineV2Factory.d.ts +99 -0
- package/dist/types/contract/DODOMineV3Proxy.d.ts +88 -0
- package/dist/types/contract/DODOMineV3ProxyWithoutPlatform.d.ts +88 -0
- package/dist/types/contract/DODOMineV3Registry.d.ts +89 -0
- package/dist/types/contract/DODONFT.d.ts +172 -0
- package/dist/types/contract/DODONFT1155.d.ts +117 -0
- package/dist/types/contract/DODONFTApprove.d.ts +117 -0
- package/dist/types/contract/DODONFTPoolProxy.d.ts +181 -0
- package/dist/types/contract/DODONFTProxy.d.ts +152 -0
- package/dist/types/contract/DODONFTRegistry.d.ts +101 -0
- package/dist/types/contract/DODONFTRouteHelper.d.ts +16 -0
- package/dist/types/contract/DODOSellHelper.d.ts +17 -0
- package/dist/types/contract/DODOStarterProxy.d.ts +22 -0
- package/dist/types/contract/DODOV1.d.ts +514 -0
- package/dist/types/contract/DODOV1Adapter.d.ts +23 -0
- package/dist/types/contract/DODOV1PmmHelper.d.ts +8 -0
- package/dist/types/contract/DODOV1Proxy.d.ts +55 -0
- package/dist/types/contract/DODOV2Proxy02.d.ts +280 -0
- package/dist/types/contract/DODOV2RouteHelper.d.ts +28 -0
- package/dist/types/contract/DPPAdvanced.d.ts +320 -0
- package/dist/types/contract/DPPAdvancedAdmin.d.ts +115 -0
- package/dist/types/contract/DPPFactory.d.ts +194 -0
- package/dist/types/contract/DSP.d.ts +392 -0
- package/dist/types/contract/DSPFactory.d.ts +134 -0
- package/dist/types/contract/DVM.d.ts +363 -0
- package/dist/types/contract/DVMFactory.d.ts +134 -0
- package/dist/types/contract/ERC20.d.ts +79 -0
- package/dist/types/contract/ERC20Helper.d.ts +67 -0
- package/dist/types/contract/ERC20MineV3.d.ts +204 -0
- package/dist/types/contract/ERC20V3Factory.d.ts +161 -0
- package/dist/types/contract/FeeRateDIP3Impl.d.ts +158 -0
- package/dist/types/contract/FeeRateModel.d.ts +53 -0
- package/dist/types/contract/GSP.d.ts +488 -0
- package/dist/types/contract/GSPFactory.d.ts +137 -0
- package/dist/types/contract/InitializableERC20.d.ts +84 -0
- package/dist/types/contract/LimitOrder.d.ts +164 -0
- package/dist/types/contract/LimitOrderBot.d.ts +102 -0
- package/dist/types/contract/MulticallWithValid.d.ts +51 -0
- package/dist/types/contract/PermissionManager.d.ts +83 -0
- package/dist/types/contract/dodoTeam.d.ts +244 -0
- package/dist/types/contract/vDODOToken.d.ts +309 -0
- package/dist/types/contractRequests.d.ts +3 -0
- package/dist/types/index.d.ts +60 -0
- package/package.json +41 -0
- package/rollup.config.mjs +51 -0
- package/scripts/contract-generate.ts +192 -0
- package/src/config/arbitrum.ts +4 -0
- package/src/config/aurora.ts +4 -0
- package/src/config/avalanche.ts +4 -0
- package/src/config/base.ts +4 -0
- package/src/config/berachain-testnet.ts +4 -0
- package/src/config/bitlayer.ts +4 -0
- package/src/config/bsc.ts +4 -0
- package/src/config/conflux.ts +4 -0
- package/src/config/ethereum.ts +4 -0
- package/src/config/index.ts +95 -0
- package/src/config/linea.ts +4 -0
- package/src/config/manta.ts +4 -0
- package/src/config/mantle.ts +4 -0
- package/src/config/morph.ts +4 -0
- package/src/config/optimism.ts +4 -0
- package/src/config/polygon.ts +4 -0
- package/src/config/scroll.ts +4 -0
- package/src/config/sepolia.ts +4 -0
- package/src/config/taiko.ts +4 -0
- package/src/config/x-layer.ts +4 -0
- package/src/config/zero-mainnet.ts +4 -0
- package/src/config/zircuit-mainnet.ts +4 -0
- package/src/contract/BuyoutModel.ts +158 -0
- package/src/contract/CP.ts +532 -0
- package/src/contract/CloneFactory.ts +15 -0
- package/src/contract/CrowdPoolingFactory.ts +397 -0
- package/src/contract/CustomERC20.ts +241 -0
- package/src/contract/CustomMintableERC20.ts +262 -0
- package/src/contract/D3Proxy.ts +177 -0
- package/src/contract/D3Vault.ts +1124 -0
- package/src/contract/DODOApprove.ts +172 -0
- package/src/contract/DODOApproveProxy.ts +197 -0
- package/src/contract/DODOCalleeHelper.ts +74 -0
- package/src/contract/DODOCirculationHelper.ts +152 -0
- package/src/contract/DODOCpProxy.ts +78 -0
- package/src/contract/DODOCpProxyWithoutGlobalQuota.ts +78 -0
- package/src/contract/DODODppProxy.ts +83 -0
- package/src/contract/DODODspProxy.ts +116 -0
- package/src/contract/DODODspProxyWithoutGSP.ts +83 -0
- package/src/contract/DODOIncentive.ts +259 -0
- package/src/contract/DODOMineV2Factory.ts +189 -0
- package/src/contract/DODOMineV3Proxy.ts +167 -0
- package/src/contract/DODOMineV3ProxyWithoutPlatform.ts +167 -0
- package/src/contract/DODOMineV3Registry.ts +168 -0
- package/src/contract/DODONFT.ts +323 -0
- package/src/contract/DODONFT1155.ts +214 -0
- package/src/contract/DODONFTApprove.ts +212 -0
- package/src/contract/DODONFTPoolProxy.ts +316 -0
- package/src/contract/DODONFTProxy.ts +293 -0
- package/src/contract/DODONFTRegistry.ts +187 -0
- package/src/contract/DODONFTRouteHelper.ts +39 -0
- package/src/contract/DODOSellHelper.ts +40 -0
- package/src/contract/DODOStarterProxy.ts +49 -0
- package/src/contract/DODOV1.ts +854 -0
- package/src/contract/DODOV1Adapter.ts +47 -0
- package/src/contract/DODOV1PmmHelper.ts +24 -0
- package/src/contract/DODOV1Proxy.ts +99 -0
- package/src/contract/DODOV2Proxy02.ts +456 -0
- package/src/contract/DODOV2RouteHelper.ts +65 -0
- package/src/contract/DPPAdvanced.ts +492 -0
- package/src/contract/DPPAdvancedAdmin.ts +191 -0
- package/src/contract/DPPFactory.ts +353 -0
- package/src/contract/DSP.ts +608 -0
- package/src/contract/DSPFactory.ts +248 -0
- package/src/contract/DVM.ts +564 -0
- package/src/contract/DVMFactory.ts +248 -0
- package/src/contract/ERC20.ts +134 -0
- package/src/contract/ERC20Helper.ts +104 -0
- package/src/contract/ERC20MineV3.ts +326 -0
- package/src/contract/ERC20V3Factory.ts +291 -0
- package/src/contract/FeeRateDIP3Impl.ts +281 -0
- package/src/contract/FeeRateModel.ts +94 -0
- package/src/contract/GSP.ts +766 -0
- package/src/contract/GSPFactory.ts +248 -0
- package/src/contract/InitializableERC20.ts +140 -0
- package/src/contract/LimitOrder.ts +267 -0
- package/src/contract/LimitOrderBot.ts +189 -0
- package/src/contract/MulticallWithValid.ts +113 -0
- package/src/contract/PermissionManager.ts +144 -0
- package/src/contract/dodoTeam.ts +415 -0
- package/src/contract/vDODOToken.ts +592 -0
- package/src/contractRequests.ts +10 -0
- package/src/index.ts +61 -0
- package/tsconfig.json +21 -0
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { defaultAbiCoder, concat, hexlify } from '@dodoex/contract-request';
|
|
2
|
+
|
|
3
|
+
import { contractRequests } from '../contractRequests';
|
|
4
|
+
|
|
5
|
+
export function getDODOV1AdapterContractAddressByChainId(chainId: number) {
|
|
6
|
+
const contractAddressObject = {"1":"0x91E1c84BA8786B1FaE2570202F0126C0b88F6Ec7","10":"0xDd0951b69bc0CF9d39111E5037685FB573204c86","56":"0x8E4842d0570c85Ba3805A9508Dce7C6A458359d0","137":"0xDBFaF391C37339c903503495395Ad7D6B096E192","42161":"0xd5a7E197bacE1F3B26E2760321d6ce06Ad07281a","43114":"0x62F67e305850a2597c46cD5957BdFbe9d04F10Bd","1313161554":"0x02fCB21dc1cf221939C1d4277fB54016b5d32bC7"};
|
|
7
|
+
const result = contractAddressObject[String(chainId) as keyof typeof contractAddressObject];
|
|
8
|
+
if (!result) throw new Error(`Not support ChainId: ${chainId}.`)
|
|
9
|
+
return result
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* fetch _DODO_SELL_HELPER_
|
|
14
|
+
* @param {number} chainId - number
|
|
15
|
+
* @returns {string} __output0 - address
|
|
16
|
+
*/
|
|
17
|
+
export function fetchDODOV1Adapter_DODO_SELL_HELPER_(chainId: number) {
|
|
18
|
+
const __to = getDODOV1AdapterContractAddressByChainId(chainId);
|
|
19
|
+
|
|
20
|
+
const __encodeData = defaultAbiCoder.encode([], []);
|
|
21
|
+
const __data = hexlify(concat(['0xaf1280b0', __encodeData]));
|
|
22
|
+
return contractRequests.batchCall<string>(chainId, __to, __data, ["address"])
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* encode sellBase
|
|
27
|
+
* @param {string} to - address
|
|
28
|
+
* @param {string} pool - address
|
|
29
|
+
* @param {string} __input1 - bytes
|
|
30
|
+
* @returns {string} encode data
|
|
31
|
+
*/
|
|
32
|
+
export function encodeDODOV1AdapterSellBase(to: string, pool: string, __input1: string) {
|
|
33
|
+
const __encodeData = defaultAbiCoder.encode(["address","address","bytes"], [to,pool,__input1]);
|
|
34
|
+
return hexlify(concat(['0x30e6ae31', __encodeData]));
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* encode sellQuote
|
|
39
|
+
* @param {string} to - address
|
|
40
|
+
* @param {string} pool - address
|
|
41
|
+
* @param {string} __input1 - bytes
|
|
42
|
+
* @returns {string} encode data
|
|
43
|
+
*/
|
|
44
|
+
export function encodeDODOV1AdapterSellQuote(to: string, pool: string, __input1: string) {
|
|
45
|
+
const __encodeData = defaultAbiCoder.encode(["address","address","bytes"], [to,pool,__input1]);
|
|
46
|
+
return hexlify(concat(['0x6f7929f2', __encodeData]));
|
|
47
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { defaultAbiCoder, concat, hexlify } from '@dodoex/contract-request';
|
|
2
|
+
|
|
3
|
+
import { contractRequests } from '../contractRequests';
|
|
4
|
+
|
|
5
|
+
export function getDODOV1PmmHelperContractAddressByChainId(chainId: number) {
|
|
6
|
+
const contractAddressObject = {"1":"0x6373ceB657C83C91088d328622573FB766064Ac4","10":"0x6373ceB657C83C91088d328622573FB766064Ac4","56":"0x2BBD66fC4898242BDBD2583BBe1d76E8b8f71445","137":"0x18DFdE99F578A0735410797e949E8D3e2AFCB9D2","196":"0xd5cf3f9DFCfC1c3F8b476D881f2F7e79142E319B","1030":"0xAC716E87b0853C0712674e8E3a8435a489F276b4","2818":"0x187210CE04F5B3179F0e483FCf292c34BA7568Dd","5000":"0xa1609A1fa7DC16c025feA194c02b2822441b8c10","8453":"0x17644d3B366273faC75A07996E2F90A99A2946a7","10169":"0x17644d3B366273faC75A07996E2F90A99A2946a7","42161":"0x4EE6398898F7FC3e648b3f6bA458310ac29cD352","43114":"0x790B4A80Fb1094589A3c0eFC8740aA9b0C1733fB","48900":"0xd5cf3f9DFCfC1c3F8b476D881f2F7e79142E319B","59144":"0x44023441f2Bad375b6b5C6354B03c3E9AD01E269","80084":"0x895B2caf85Ae70E8d1b77C8b30B25F07b461Dc45","167000":"0x187210CE04F5B3179F0e483FCf292c34BA7568Dd","200901":"0x6CE6892b402D7D39A618e7D169fB8f0f449068d4","534352":"0x17644d3B366273faC75A07996E2F90A99A2946a7","543210":"0xA32ccf8468a7a7a43E26052F118646A8eE8a2926","11155111":"0x3dD629473A2eD7f3C6299FFD9F3e0C283d073f11","1313161554":"0xbAb9F4ff4A19a0e8EEBC56b06750253228ffAc6E"};
|
|
7
|
+
const result = contractAddressObject[String(chainId) as keyof typeof contractAddressObject];
|
|
8
|
+
if (!result) throw new Error(`Not support ChainId: ${chainId}.`)
|
|
9
|
+
return result
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* fetch getPairDetail
|
|
14
|
+
* @param {number} chainId - number
|
|
15
|
+
* @param {string} pool - address
|
|
16
|
+
* @returns {[bigint, bigint, bigint, bigint, bigint, bigint, bigint, bigint, bigint, string, string, string, bigint]} res - tuple[]
|
|
17
|
+
*/
|
|
18
|
+
export function fetchDODOV1PmmHelperGetPairDetail(chainId: number, pool: string) {
|
|
19
|
+
const __to = getDODOV1PmmHelperContractAddressByChainId(chainId);
|
|
20
|
+
|
|
21
|
+
const __encodeData = defaultAbiCoder.encode(["address"], [pool]);
|
|
22
|
+
const __data = hexlify(concat(['0x2bd8c5ac', __encodeData]));
|
|
23
|
+
return contractRequests.batchCall<[bigint, bigint, bigint, bigint, bigint, bigint, bigint, bigint, bigint, string, string, string, bigint]>(chainId, __to, __data, ["tuple[]"])
|
|
24
|
+
}
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
import { defaultAbiCoder, concat, hexlify } from '@dodoex/contract-request';
|
|
2
|
+
|
|
3
|
+
import { contractRequests } from '../contractRequests';
|
|
4
|
+
|
|
5
|
+
export function getDODOV1ProxyContractAddressByChainId(chainId: number) {
|
|
6
|
+
const contractAddressObject = {"1":"0x8dD0Fea5FA2f7df535F87f312641Cc15d8B151BA","56":"0x4Fc222194862081866FC636893DDeCB3E4341A10","137":"0x58E27C46c162F2a781d750BbE1119E1b2DfE82e0","42161":"0x49186E32fEd50fd6B5604A2618c7B0b03Cd41414"};
|
|
7
|
+
const result = contractAddressObject[String(chainId) as keyof typeof contractAddressObject];
|
|
8
|
+
if (!result) throw new Error(`Not support ChainId: ${chainId}.`)
|
|
9
|
+
return result
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* fetch owner
|
|
14
|
+
* @param {number} chainId - number
|
|
15
|
+
* @returns {string} __output0 - address
|
|
16
|
+
*/
|
|
17
|
+
export function fetchDODOV1ProxyOwner(chainId: number) {
|
|
18
|
+
const __to = getDODOV1ProxyContractAddressByChainId(chainId);
|
|
19
|
+
|
|
20
|
+
const __encodeData = defaultAbiCoder.encode([], []);
|
|
21
|
+
const __data = hexlify(concat(['0x8da5cb5b', __encodeData]));
|
|
22
|
+
return contractRequests.batchCall<string>(chainId, __to, __data, ["address"])
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* encode renounceOwnership
|
|
27
|
+
|
|
28
|
+
* @returns {string} encode data
|
|
29
|
+
*/
|
|
30
|
+
export function encodeDODOV1ProxyRenounceOwnership() {
|
|
31
|
+
const __encodeData = defaultAbiCoder.encode([], []);
|
|
32
|
+
return hexlify(concat(['0x715018a6', __encodeData]));
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* encode transferOwnership
|
|
37
|
+
* @param {string} newOwner - address
|
|
38
|
+
* @returns {string} encode data
|
|
39
|
+
*/
|
|
40
|
+
export function encodeDODOV1ProxyTransferOwnership(newOwner: string) {
|
|
41
|
+
const __encodeData = defaultAbiCoder.encode(["address"], [newOwner]);
|
|
42
|
+
return hexlify(concat(['0xf2fde38b', __encodeData]));
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* encode withdrawAllBase
|
|
47
|
+
* @param {string} pool - address
|
|
48
|
+
* @param {number} minReceive - uint256
|
|
49
|
+
* @returns {string} encode data
|
|
50
|
+
*/
|
|
51
|
+
export function encodeDODOV1ProxyWithdrawAllBase(pool: string, minReceive: number) {
|
|
52
|
+
const __encodeData = defaultAbiCoder.encode(["address","uint256"], [pool,minReceive]);
|
|
53
|
+
return hexlify(concat(['0x092b955d', __encodeData]));
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
/**
|
|
57
|
+
* encode withdrawAllQuote
|
|
58
|
+
* @param {string} pool - address
|
|
59
|
+
* @param {number} minReceive - uint256
|
|
60
|
+
* @returns {string} encode data
|
|
61
|
+
*/
|
|
62
|
+
export function encodeDODOV1ProxyWithdrawAllQuote(pool: string, minReceive: number) {
|
|
63
|
+
const __encodeData = defaultAbiCoder.encode(["address","uint256"], [pool,minReceive]);
|
|
64
|
+
return hexlify(concat(['0xf7cdbb10', __encodeData]));
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
/**
|
|
68
|
+
* encode withdrawBase
|
|
69
|
+
* @param {string} pool - address
|
|
70
|
+
* @param {number} amount - uint256
|
|
71
|
+
* @param {number} minReceive - uint256
|
|
72
|
+
* @returns {string} encode data
|
|
73
|
+
*/
|
|
74
|
+
export function encodeDODOV1ProxyWithdrawBase(pool: string, amount: number, minReceive: number) {
|
|
75
|
+
const __encodeData = defaultAbiCoder.encode(["address","uint256","uint256"], [pool,amount,minReceive]);
|
|
76
|
+
return hexlify(concat(['0xa77febfc', __encodeData]));
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
/**
|
|
80
|
+
* encode withdrawLeftToken
|
|
81
|
+
* @param {string} token - address
|
|
82
|
+
* @returns {string} encode data
|
|
83
|
+
*/
|
|
84
|
+
export function encodeDODOV1ProxyWithdrawLeftToken(token: string) {
|
|
85
|
+
const __encodeData = defaultAbiCoder.encode(["address"], [token]);
|
|
86
|
+
return hexlify(concat(['0x8202dada', __encodeData]));
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
/**
|
|
90
|
+
* encode withdrawQuote
|
|
91
|
+
* @param {string} pool - address
|
|
92
|
+
* @param {number} amount - uint256
|
|
93
|
+
* @param {number} minReceive - uint256
|
|
94
|
+
* @returns {string} encode data
|
|
95
|
+
*/
|
|
96
|
+
export function encodeDODOV1ProxyWithdrawQuote(pool: string, amount: number, minReceive: number) {
|
|
97
|
+
const __encodeData = defaultAbiCoder.encode(["address","uint256","uint256"], [pool,amount,minReceive]);
|
|
98
|
+
return hexlify(concat(['0xde3a5a0b', __encodeData]));
|
|
99
|
+
}
|
|
@@ -0,0 +1,456 @@
|
|
|
1
|
+
import { defaultAbiCoder, concat, hexlify } from '@dodoex/contract-request';
|
|
2
|
+
|
|
3
|
+
import { contractRequests } from '../contractRequests';
|
|
4
|
+
|
|
5
|
+
export function getDODOV2Proxy02ContractAddressByChainId(chainId: number) {
|
|
6
|
+
const contractAddressObject = {"1":"0xa356867fDCEa8e71AEaF87805808803806231FdC","10":"0xfD9D2827AD469B72B69329dAA325ba7AfbDb3C98","56":"0x8F8Dd7DB1bDA5eD3da8C9daf3bfa471c12d58486","137":"0xa222e6a71D1A1Dd5F279805fbe38d5329C1d0e70","196":"0x7Ad992fcebd899ddbEF7f031dCF96f382b81ECea","1030":"0xbce44767af0a53A108b3B7ba4F740E03D228Ec0A","2818":"0xfcd8EF54A4dA96dE6B2DDF67C6265C7405a3A9c6","5000":"0xe7979E2F3e77196Bb2AB206eaa67Ea278A3E33A2","8453":"0x4CAD0052524648A7Fa2cfE279997b00239295F33","10169":"0x2F86652dAEF5f1728c54191C955F065Ec3C188c7","42161":"0x88CBf433471A0CD8240D2a12354362988b4593E5","43114":"0x2cD18557E14aF72DAA8090BcAA95b231ffC9ea26","48900":"0x5e132c0ABB9e4E5f1471eF6d1C9740c276Fe520e","59144":"0x4CAD0052524648A7Fa2cfE279997b00239295F33","80084":"0x0976e26eE276DC0703d046DB46d0ca8A1EeC3bAe","167000":"0xfcd8EF54A4dA96dE6B2DDF67C6265C7405a3A9c6","200901":"0x33c5C92ECc5e64c8b1634E0E06193EF8A9308751","534352":"0xe49781e6186214d88aACFd9eBc8cE40E3CDc066D","543210":"0x016B4cD52EC7A49Ad33140252Ba55C5B24079Ad6","11155111":"0x6292e8f7647b3b9dDf5795b1Fb77D0187e30E0F9","1313161554":"0xd9deC7c3C06e62a4c1BeEB07CadF568f496b14c2"};
|
|
7
|
+
const result = contractAddressObject[String(chainId) as keyof typeof contractAddressObject];
|
|
8
|
+
if (!result) throw new Error(`Not support ChainId: ${chainId}.`)
|
|
9
|
+
return result
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* fetch _CHI_TOKEN_
|
|
14
|
+
* @param {number} chainId - number
|
|
15
|
+
* @returns {string} __output0 - address
|
|
16
|
+
*/
|
|
17
|
+
export function fetchDODOV2Proxy02_CHI_TOKEN_(chainId: number) {
|
|
18
|
+
const __to = getDODOV2Proxy02ContractAddressByChainId(chainId);
|
|
19
|
+
|
|
20
|
+
const __encodeData = defaultAbiCoder.encode([], []);
|
|
21
|
+
const __data = hexlify(concat(['0x056fc2ee', __encodeData]));
|
|
22
|
+
return contractRequests.batchCall<string>(chainId, __to, __data, ["address"])
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* fetch _CP_FACTORY_
|
|
27
|
+
* @param {number} chainId - number
|
|
28
|
+
* @returns {string} __output0 - address
|
|
29
|
+
*/
|
|
30
|
+
export function fetchDODOV2Proxy02_CP_FACTORY_(chainId: number) {
|
|
31
|
+
const __to = getDODOV2Proxy02ContractAddressByChainId(chainId);
|
|
32
|
+
|
|
33
|
+
const __encodeData = defaultAbiCoder.encode([], []);
|
|
34
|
+
const __data = hexlify(concat(['0xfaa980e4', __encodeData]));
|
|
35
|
+
return contractRequests.batchCall<string>(chainId, __to, __data, ["address"])
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* fetch _DODO_APPROVE_PROXY_
|
|
40
|
+
* @param {number} chainId - number
|
|
41
|
+
* @returns {string} __output0 - address
|
|
42
|
+
*/
|
|
43
|
+
export function fetchDODOV2Proxy02_DODO_APPROVE_PROXY_(chainId: number) {
|
|
44
|
+
const __to = getDODOV2Proxy02ContractAddressByChainId(chainId);
|
|
45
|
+
|
|
46
|
+
const __encodeData = defaultAbiCoder.encode([], []);
|
|
47
|
+
const __data = hexlify(concat(['0xeb99be12', __encodeData]));
|
|
48
|
+
return contractRequests.batchCall<string>(chainId, __to, __data, ["address"])
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* fetch _DODO_INCENTIVE_
|
|
53
|
+
* @param {number} chainId - number
|
|
54
|
+
* @returns {string} __output0 - address
|
|
55
|
+
*/
|
|
56
|
+
export function fetchDODOV2Proxy02_DODO_INCENTIVE_(chainId: number) {
|
|
57
|
+
const __to = getDODOV2Proxy02ContractAddressByChainId(chainId);
|
|
58
|
+
|
|
59
|
+
const __encodeData = defaultAbiCoder.encode([], []);
|
|
60
|
+
const __data = hexlify(concat(['0x41cf7160', __encodeData]));
|
|
61
|
+
return contractRequests.batchCall<string>(chainId, __to, __data, ["address"])
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
/**
|
|
65
|
+
* fetch _DODO_SELL_HELPER_
|
|
66
|
+
* @param {number} chainId - number
|
|
67
|
+
* @returns {string} __output0 - address
|
|
68
|
+
*/
|
|
69
|
+
export function fetchDODOV2Proxy02_DODO_SELL_HELPER_(chainId: number) {
|
|
70
|
+
const __to = getDODOV2Proxy02ContractAddressByChainId(chainId);
|
|
71
|
+
|
|
72
|
+
const __encodeData = defaultAbiCoder.encode([], []);
|
|
73
|
+
const __data = hexlify(concat(['0xaf1280b0', __encodeData]));
|
|
74
|
+
return contractRequests.batchCall<string>(chainId, __to, __data, ["address"])
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
/**
|
|
78
|
+
* fetch _DPP_FACTORY_
|
|
79
|
+
* @param {number} chainId - number
|
|
80
|
+
* @returns {string} __output0 - address
|
|
81
|
+
*/
|
|
82
|
+
export function fetchDODOV2Proxy02_DPP_FACTORY_(chainId: number) {
|
|
83
|
+
const __to = getDODOV2Proxy02ContractAddressByChainId(chainId);
|
|
84
|
+
|
|
85
|
+
const __encodeData = defaultAbiCoder.encode([], []);
|
|
86
|
+
const __data = hexlify(concat(['0xb730d150', __encodeData]));
|
|
87
|
+
return contractRequests.batchCall<string>(chainId, __to, __data, ["address"])
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
/**
|
|
91
|
+
* fetch _DVM_FACTORY_
|
|
92
|
+
* @param {number} chainId - number
|
|
93
|
+
* @returns {string} __output0 - address
|
|
94
|
+
*/
|
|
95
|
+
export function fetchDODOV2Proxy02_DVM_FACTORY_(chainId: number) {
|
|
96
|
+
const __to = getDODOV2Proxy02ContractAddressByChainId(chainId);
|
|
97
|
+
|
|
98
|
+
const __encodeData = defaultAbiCoder.encode([], []);
|
|
99
|
+
const __data = hexlify(concat(['0x69e4e417', __encodeData]));
|
|
100
|
+
return contractRequests.batchCall<string>(chainId, __to, __data, ["address"])
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
/**
|
|
104
|
+
* fetch _GAS_DODO_MAX_RETURN_
|
|
105
|
+
* @param {number} chainId - number
|
|
106
|
+
* @returns {bigint} __output0 - uint256
|
|
107
|
+
*/
|
|
108
|
+
export function fetchDODOV2Proxy02_GAS_DODO_MAX_RETURN_(chainId: number) {
|
|
109
|
+
const __to = getDODOV2Proxy02ContractAddressByChainId(chainId);
|
|
110
|
+
|
|
111
|
+
const __encodeData = defaultAbiCoder.encode([], []);
|
|
112
|
+
const __data = hexlify(concat(['0x9f687322', __encodeData]));
|
|
113
|
+
return contractRequests.batchCall<bigint>(chainId, __to, __data, ["uint256"])
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
/**
|
|
117
|
+
* fetch _GAS_EXTERNAL_RETURN_
|
|
118
|
+
* @param {number} chainId - number
|
|
119
|
+
* @returns {bigint} __output0 - uint256
|
|
120
|
+
*/
|
|
121
|
+
export function fetchDODOV2Proxy02_GAS_EXTERNAL_RETURN_(chainId: number) {
|
|
122
|
+
const __to = getDODOV2Proxy02ContractAddressByChainId(chainId);
|
|
123
|
+
|
|
124
|
+
const __encodeData = defaultAbiCoder.encode([], []);
|
|
125
|
+
const __data = hexlify(concat(['0x69dba8ee', __encodeData]));
|
|
126
|
+
return contractRequests.batchCall<bigint>(chainId, __to, __data, ["uint256"])
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
/**
|
|
130
|
+
* fetch _NEW_OWNER_
|
|
131
|
+
* @param {number} chainId - number
|
|
132
|
+
* @returns {string} __output0 - address
|
|
133
|
+
*/
|
|
134
|
+
export function fetchDODOV2Proxy02_NEW_OWNER_(chainId: number) {
|
|
135
|
+
const __to = getDODOV2Proxy02ContractAddressByChainId(chainId);
|
|
136
|
+
|
|
137
|
+
const __encodeData = defaultAbiCoder.encode([], []);
|
|
138
|
+
const __data = hexlify(concat(['0x8456db15', __encodeData]));
|
|
139
|
+
return contractRequests.batchCall<string>(chainId, __to, __data, ["address"])
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
/**
|
|
143
|
+
* fetch _OWNER_
|
|
144
|
+
* @param {number} chainId - number
|
|
145
|
+
* @returns {string} __output0 - address
|
|
146
|
+
*/
|
|
147
|
+
export function fetchDODOV2Proxy02_OWNER_(chainId: number) {
|
|
148
|
+
const __to = getDODOV2Proxy02ContractAddressByChainId(chainId);
|
|
149
|
+
|
|
150
|
+
const __encodeData = defaultAbiCoder.encode([], []);
|
|
151
|
+
const __data = hexlify(concat(['0x16048bc4', __encodeData]));
|
|
152
|
+
return contractRequests.batchCall<string>(chainId, __to, __data, ["address"])
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
/**
|
|
156
|
+
* fetch _WETH_
|
|
157
|
+
* @param {number} chainId - number
|
|
158
|
+
* @returns {string} __output0 - address
|
|
159
|
+
*/
|
|
160
|
+
export function fetchDODOV2Proxy02_WETH_(chainId: number) {
|
|
161
|
+
const __to = getDODOV2Proxy02ContractAddressByChainId(chainId);
|
|
162
|
+
|
|
163
|
+
const __encodeData = defaultAbiCoder.encode([], []);
|
|
164
|
+
const __data = hexlify(concat(['0x0d4eec8f', __encodeData]));
|
|
165
|
+
return contractRequests.batchCall<string>(chainId, __to, __data, ["address"])
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
/**
|
|
169
|
+
* fetch isWhiteListed
|
|
170
|
+
* @param {number} chainId - number
|
|
171
|
+
* @param {string} __input1 - address
|
|
172
|
+
* @returns {boolean} __output0 - bool
|
|
173
|
+
*/
|
|
174
|
+
export function fetchDODOV2Proxy02IsWhiteListed(chainId: number, __input1: string) {
|
|
175
|
+
const __to = getDODOV2Proxy02ContractAddressByChainId(chainId);
|
|
176
|
+
|
|
177
|
+
const __encodeData = defaultAbiCoder.encode(["address"], [__input1]);
|
|
178
|
+
const __data = hexlify(concat(['0x6f9170f6', __encodeData]));
|
|
179
|
+
return contractRequests.batchCall<boolean>(chainId, __to, __data, ["bool"])
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
/**
|
|
183
|
+
* encode addDVMLiquidity
|
|
184
|
+
* @param {string} dvmAddress - address
|
|
185
|
+
* @param {number} baseInAmount - uint256
|
|
186
|
+
* @param {number} quoteInAmount - uint256
|
|
187
|
+
* @param {number} baseMinAmount - uint256
|
|
188
|
+
* @param {number} quoteMinAmount - uint256
|
|
189
|
+
* @param {number} flag - uint8
|
|
190
|
+
* @param {number} deadLine - uint256
|
|
191
|
+
* @returns {string} encode data
|
|
192
|
+
*/
|
|
193
|
+
export function encodeDODOV2Proxy02AddDVMLiquidity(dvmAddress: string, baseInAmount: number, quoteInAmount: number, baseMinAmount: number, quoteMinAmount: number, flag: number, deadLine: number) {
|
|
194
|
+
const __encodeData = defaultAbiCoder.encode(["address","uint256","uint256","uint256","uint256","uint8","uint256"], [dvmAddress,baseInAmount,quoteInAmount,baseMinAmount,quoteMinAmount,flag,deadLine]);
|
|
195
|
+
return hexlify(concat(['0x674d9422', __encodeData]));
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
/**
|
|
199
|
+
* encode addLiquidityToV1
|
|
200
|
+
* @param {string} pair - address
|
|
201
|
+
* @param {number} baseAmount - uint256
|
|
202
|
+
* @param {number} quoteAmount - uint256
|
|
203
|
+
* @param {number} baseMinShares - uint256
|
|
204
|
+
* @param {number} quoteMinShares - uint256
|
|
205
|
+
* @param {number} flag - uint8
|
|
206
|
+
* @param {number} deadLine - uint256
|
|
207
|
+
* @returns {string} encode data
|
|
208
|
+
*/
|
|
209
|
+
export function encodeDODOV2Proxy02AddLiquidityToV1(pair: string, baseAmount: number, quoteAmount: number, baseMinShares: number, quoteMinShares: number, flag: number, deadLine: number) {
|
|
210
|
+
const __encodeData = defaultAbiCoder.encode(["address","uint256","uint256","uint256","uint256","uint8","uint256"], [pair,baseAmount,quoteAmount,baseMinShares,quoteMinShares,flag,deadLine]);
|
|
211
|
+
return hexlify(concat(['0x99882c8f', __encodeData]));
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
/**
|
|
215
|
+
* encode addWhiteList
|
|
216
|
+
* @param {string} contractAddr - address
|
|
217
|
+
* @returns {string} encode data
|
|
218
|
+
*/
|
|
219
|
+
export function encodeDODOV2Proxy02AddWhiteList(contractAddr: string) {
|
|
220
|
+
const __encodeData = defaultAbiCoder.encode(["address"], [contractAddr]);
|
|
221
|
+
return hexlify(concat(['0xe7cd4a04', __encodeData]));
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
/**
|
|
225
|
+
* encode bid
|
|
226
|
+
* @param {string} cpAddress - address
|
|
227
|
+
* @param {number} quoteAmount - uint256
|
|
228
|
+
* @param {number} flag - uint8
|
|
229
|
+
* @param {number} deadLine - uint256
|
|
230
|
+
* @returns {string} encode data
|
|
231
|
+
*/
|
|
232
|
+
export function encodeDODOV2Proxy02Bid(cpAddress: string, quoteAmount: number, flag: number, deadLine: number) {
|
|
233
|
+
const __encodeData = defaultAbiCoder.encode(["address","uint256","uint8","uint256"], [cpAddress,quoteAmount,flag,deadLine]);
|
|
234
|
+
return hexlify(concat(['0xdb70b5c7', __encodeData]));
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
/**
|
|
238
|
+
* encode claimOwnership
|
|
239
|
+
|
|
240
|
+
* @returns {string} encode data
|
|
241
|
+
*/
|
|
242
|
+
export function encodeDODOV2Proxy02ClaimOwnership() {
|
|
243
|
+
const __encodeData = defaultAbiCoder.encode([], []);
|
|
244
|
+
return hexlify(concat(['0x4e71e0c8', __encodeData]));
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
/**
|
|
248
|
+
* encode createCrowdPooling
|
|
249
|
+
* @param {string} baseToken - address
|
|
250
|
+
* @param {string} quoteToken - address
|
|
251
|
+
* @param {number} baseInAmount - uint256
|
|
252
|
+
* @param {Array<number>} timeLine - uint256[]
|
|
253
|
+
* @param {Array<number>} valueList - uint256[]
|
|
254
|
+
* @param {boolean} isOpenTWAP - bool
|
|
255
|
+
* @param {number} deadLine - uint256
|
|
256
|
+
* @returns {string} encode data
|
|
257
|
+
*/
|
|
258
|
+
export function encodeDODOV2Proxy02CreateCrowdPooling(baseToken: string, quoteToken: string, baseInAmount: number, timeLine: Array<number>, valueList: Array<number>, isOpenTWAP: boolean, deadLine: number) {
|
|
259
|
+
const __encodeData = defaultAbiCoder.encode(["address","address","uint256","uint256[]","uint256[]","bool","uint256"], [baseToken,quoteToken,baseInAmount,timeLine,valueList,isOpenTWAP,deadLine]);
|
|
260
|
+
return hexlify(concat(['0x018c9fda', __encodeData]));
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
/**
|
|
264
|
+
* encode createDODOPrivatePool
|
|
265
|
+
* @param {string} baseToken - address
|
|
266
|
+
* @param {string} quoteToken - address
|
|
267
|
+
* @param {number} baseInAmount - uint256
|
|
268
|
+
* @param {number} quoteInAmount - uint256
|
|
269
|
+
* @param {number} lpFeeRate - uint256
|
|
270
|
+
* @param {number} i - uint256
|
|
271
|
+
* @param {number} k - uint256
|
|
272
|
+
* @param {boolean} isOpenTwap - bool
|
|
273
|
+
* @param {number} deadLine - uint256
|
|
274
|
+
* @returns {string} encode data
|
|
275
|
+
*/
|
|
276
|
+
export function encodeDODOV2Proxy02CreateDODOPrivatePool(baseToken: string, quoteToken: string, baseInAmount: number, quoteInAmount: number, lpFeeRate: number, i: number, k: number, isOpenTwap: boolean, deadLine: number) {
|
|
277
|
+
const __encodeData = defaultAbiCoder.encode(["address","address","uint256","uint256","uint256","uint256","uint256","bool","uint256"], [baseToken,quoteToken,baseInAmount,quoteInAmount,lpFeeRate,i,k,isOpenTwap,deadLine]);
|
|
278
|
+
return hexlify(concat(['0x0d9be500', __encodeData]));
|
|
279
|
+
}
|
|
280
|
+
|
|
281
|
+
/**
|
|
282
|
+
* encode createDODOVendingMachine
|
|
283
|
+
* @param {string} baseToken - address
|
|
284
|
+
* @param {string} quoteToken - address
|
|
285
|
+
* @param {number} baseInAmount - uint256
|
|
286
|
+
* @param {number} quoteInAmount - uint256
|
|
287
|
+
* @param {number} lpFeeRate - uint256
|
|
288
|
+
* @param {number} i - uint256
|
|
289
|
+
* @param {number} k - uint256
|
|
290
|
+
* @param {boolean} isOpenTWAP - bool
|
|
291
|
+
* @param {number} deadLine - uint256
|
|
292
|
+
* @returns {string} encode data
|
|
293
|
+
*/
|
|
294
|
+
export function encodeDODOV2Proxy02CreateDODOVendingMachine(baseToken: string, quoteToken: string, baseInAmount: number, quoteInAmount: number, lpFeeRate: number, i: number, k: number, isOpenTWAP: boolean, deadLine: number) {
|
|
295
|
+
const __encodeData = defaultAbiCoder.encode(["address","address","uint256","uint256","uint256","uint256","uint256","bool","uint256"], [baseToken,quoteToken,baseInAmount,quoteInAmount,lpFeeRate,i,k,isOpenTWAP,deadLine]);
|
|
296
|
+
return hexlify(concat(['0x8b3bb089', __encodeData]));
|
|
297
|
+
}
|
|
298
|
+
|
|
299
|
+
/**
|
|
300
|
+
* encode dodoSwapV1
|
|
301
|
+
* @param {string} fromToken - address
|
|
302
|
+
* @param {string} toToken - address
|
|
303
|
+
* @param {number} fromTokenAmount - uint256
|
|
304
|
+
* @param {number} minReturnAmount - uint256
|
|
305
|
+
* @param {Array<string>} dodoPairs - address[]
|
|
306
|
+
* @param {number} directions - uint256
|
|
307
|
+
* @param {boolean} isIncentive - bool
|
|
308
|
+
* @param {number} deadLine - uint256
|
|
309
|
+
* @returns {string} encode data
|
|
310
|
+
*/
|
|
311
|
+
export function encodeDODOV2Proxy02DodoSwapV1(fromToken: string, toToken: string, fromTokenAmount: number, minReturnAmount: number, dodoPairs: Array<string>, directions: number, isIncentive: boolean, deadLine: number) {
|
|
312
|
+
const __encodeData = defaultAbiCoder.encode(["address","address","uint256","uint256","address[]","uint256","bool","uint256"], [fromToken,toToken,fromTokenAmount,minReturnAmount,dodoPairs,directions,isIncentive,deadLine]);
|
|
313
|
+
return hexlify(concat(['0x0dd4ebd9', __encodeData]));
|
|
314
|
+
}
|
|
315
|
+
|
|
316
|
+
/**
|
|
317
|
+
* encode dodoSwapV2ETHToToken
|
|
318
|
+
* @param {string} toToken - address
|
|
319
|
+
* @param {number} minReturnAmount - uint256
|
|
320
|
+
* @param {Array<string>} dodoPairs - address[]
|
|
321
|
+
* @param {number} directions - uint256
|
|
322
|
+
* @param {boolean} isIncentive - bool
|
|
323
|
+
* @param {number} deadLine - uint256
|
|
324
|
+
* @returns {string} encode data
|
|
325
|
+
*/
|
|
326
|
+
export function encodeDODOV2Proxy02DodoSwapV2ETHToToken(toToken: string, minReturnAmount: number, dodoPairs: Array<string>, directions: number, isIncentive: boolean, deadLine: number) {
|
|
327
|
+
const __encodeData = defaultAbiCoder.encode(["address","uint256","address[]","uint256","bool","uint256"], [toToken,minReturnAmount,dodoPairs,directions,isIncentive,deadLine]);
|
|
328
|
+
return hexlify(concat(['0x5028bb95', __encodeData]));
|
|
329
|
+
}
|
|
330
|
+
|
|
331
|
+
/**
|
|
332
|
+
* encode dodoSwapV2TokenToETH
|
|
333
|
+
* @param {string} fromToken - address
|
|
334
|
+
* @param {number} fromTokenAmount - uint256
|
|
335
|
+
* @param {number} minReturnAmount - uint256
|
|
336
|
+
* @param {Array<string>} dodoPairs - address[]
|
|
337
|
+
* @param {number} directions - uint256
|
|
338
|
+
* @param {boolean} isIncentive - bool
|
|
339
|
+
* @param {number} deadLine - uint256
|
|
340
|
+
* @returns {string} encode data
|
|
341
|
+
*/
|
|
342
|
+
export function encodeDODOV2Proxy02DodoSwapV2TokenToETH(fromToken: string, fromTokenAmount: number, minReturnAmount: number, dodoPairs: Array<string>, directions: number, isIncentive: boolean, deadLine: number) {
|
|
343
|
+
const __encodeData = defaultAbiCoder.encode(["address","uint256","uint256","address[]","uint256","bool","uint256"], [fromToken,fromTokenAmount,minReturnAmount,dodoPairs,directions,isIncentive,deadLine]);
|
|
344
|
+
return hexlify(concat(['0x1e6d24c2', __encodeData]));
|
|
345
|
+
}
|
|
346
|
+
|
|
347
|
+
/**
|
|
348
|
+
* encode dodoSwapV2TokenToToken
|
|
349
|
+
* @param {string} fromToken - address
|
|
350
|
+
* @param {string} toToken - address
|
|
351
|
+
* @param {number} fromTokenAmount - uint256
|
|
352
|
+
* @param {number} minReturnAmount - uint256
|
|
353
|
+
* @param {Array<string>} dodoPairs - address[]
|
|
354
|
+
* @param {number} directions - uint256
|
|
355
|
+
* @param {boolean} isIncentive - bool
|
|
356
|
+
* @param {number} deadLine - uint256
|
|
357
|
+
* @returns {string} encode data
|
|
358
|
+
*/
|
|
359
|
+
export function encodeDODOV2Proxy02DodoSwapV2TokenToToken(fromToken: string, toToken: string, fromTokenAmount: number, minReturnAmount: number, dodoPairs: Array<string>, directions: number, isIncentive: boolean, deadLine: number) {
|
|
360
|
+
const __encodeData = defaultAbiCoder.encode(["address","address","uint256","uint256","address[]","uint256","bool","uint256"], [fromToken,toToken,fromTokenAmount,minReturnAmount,dodoPairs,directions,isIncentive,deadLine]);
|
|
361
|
+
return hexlify(concat(['0xf87dc1b7', __encodeData]));
|
|
362
|
+
}
|
|
363
|
+
|
|
364
|
+
/**
|
|
365
|
+
* encode externalSwap
|
|
366
|
+
* @param {string} fromToken - address
|
|
367
|
+
* @param {string} toToken - address
|
|
368
|
+
* @param {string} approveTarget - address
|
|
369
|
+
* @param {string} swapTarget - address
|
|
370
|
+
* @param {number} fromTokenAmount - uint256
|
|
371
|
+
* @param {number} minReturnAmount - uint256
|
|
372
|
+
* @param {string} callDataConcat - bytes
|
|
373
|
+
* @param {boolean} isIncentive - bool
|
|
374
|
+
* @param {number} deadLine - uint256
|
|
375
|
+
* @returns {string} encode data
|
|
376
|
+
*/
|
|
377
|
+
export function encodeDODOV2Proxy02ExternalSwap(fromToken: string, toToken: string, approveTarget: string, swapTarget: string, fromTokenAmount: number, minReturnAmount: number, callDataConcat: string, isIncentive: boolean, deadLine: number) {
|
|
378
|
+
const __encodeData = defaultAbiCoder.encode(["address","address","address","address","uint256","uint256","bytes","bool","uint256"], [fromToken,toToken,approveTarget,swapTarget,fromTokenAmount,minReturnAmount,callDataConcat,isIncentive,deadLine]);
|
|
379
|
+
return hexlify(concat(['0x54bacd13', __encodeData]));
|
|
380
|
+
}
|
|
381
|
+
|
|
382
|
+
/**
|
|
383
|
+
* encode initOwner
|
|
384
|
+
* @param {string} newOwner - address
|
|
385
|
+
* @returns {string} encode data
|
|
386
|
+
*/
|
|
387
|
+
export function encodeDODOV2Proxy02InitOwner(newOwner: string) {
|
|
388
|
+
const __encodeData = defaultAbiCoder.encode(["address"], [newOwner]);
|
|
389
|
+
return hexlify(concat(['0x0d009297', __encodeData]));
|
|
390
|
+
}
|
|
391
|
+
|
|
392
|
+
/**
|
|
393
|
+
* encode mixSwap
|
|
394
|
+
* @param {string} fromToken - address
|
|
395
|
+
* @param {string} toToken - address
|
|
396
|
+
* @param {number} fromTokenAmount - uint256
|
|
397
|
+
* @param {number} minReturnAmount - uint256
|
|
398
|
+
* @param {Array<string>} mixAdapters - address[]
|
|
399
|
+
* @param {Array<string>} mixPairs - address[]
|
|
400
|
+
* @param {Array<string>} assetTo - address[]
|
|
401
|
+
* @param {number} directions - uint256
|
|
402
|
+
* @param {boolean} isIncentive - bool
|
|
403
|
+
* @param {number} deadLine - uint256
|
|
404
|
+
* @returns {string} encode data
|
|
405
|
+
*/
|
|
406
|
+
export function encodeDODOV2Proxy02MixSwap(fromToken: string, toToken: string, fromTokenAmount: number, minReturnAmount: number, mixAdapters: Array<string>, mixPairs: Array<string>, assetTo: Array<string>, directions: number, isIncentive: boolean, deadLine: number) {
|
|
407
|
+
const __encodeData = defaultAbiCoder.encode(["address","address","uint256","uint256","address[]","address[]","address[]","uint256","bool","uint256"], [fromToken,toToken,fromTokenAmount,minReturnAmount,mixAdapters,mixPairs,assetTo,directions,isIncentive,deadLine]);
|
|
408
|
+
return hexlify(concat(['0x23c38fa3', __encodeData]));
|
|
409
|
+
}
|
|
410
|
+
|
|
411
|
+
/**
|
|
412
|
+
* encode removeWhiteList
|
|
413
|
+
* @param {string} contractAddr - address
|
|
414
|
+
* @returns {string} encode data
|
|
415
|
+
*/
|
|
416
|
+
export function encodeDODOV2Proxy02RemoveWhiteList(contractAddr: string) {
|
|
417
|
+
const __encodeData = defaultAbiCoder.encode(["address"], [contractAddr]);
|
|
418
|
+
return hexlify(concat(['0x2042e5c2', __encodeData]));
|
|
419
|
+
}
|
|
420
|
+
|
|
421
|
+
/**
|
|
422
|
+
* encode resetDODOPrivatePool
|
|
423
|
+
* @param {string} dppAddress - address
|
|
424
|
+
* @param {Array<number>} paramList - uint256[]
|
|
425
|
+
* @param {Array<number>} amountList - uint256[]
|
|
426
|
+
* @param {number} flag - uint8
|
|
427
|
+
* @param {number} minBaseReserve - uint256
|
|
428
|
+
* @param {number} minQuoteReserve - uint256
|
|
429
|
+
* @param {number} deadLine - uint256
|
|
430
|
+
* @returns {string} encode data
|
|
431
|
+
*/
|
|
432
|
+
export function encodeDODOV2Proxy02ResetDODOPrivatePool(dppAddress: string, paramList: Array<number>, amountList: Array<number>, flag: number, minBaseReserve: number, minQuoteReserve: number, deadLine: number) {
|
|
433
|
+
const __encodeData = defaultAbiCoder.encode(["address","uint256[]","uint256[]","uint8","uint256","uint256","uint256"], [dppAddress,paramList,amountList,flag,minBaseReserve,minQuoteReserve,deadLine]);
|
|
434
|
+
return hexlify(concat(['0x12ff148d', __encodeData]));
|
|
435
|
+
}
|
|
436
|
+
|
|
437
|
+
/**
|
|
438
|
+
* encode transferOwnership
|
|
439
|
+
* @param {string} newOwner - address
|
|
440
|
+
* @returns {string} encode data
|
|
441
|
+
*/
|
|
442
|
+
export function encodeDODOV2Proxy02TransferOwnership(newOwner: string) {
|
|
443
|
+
const __encodeData = defaultAbiCoder.encode(["address"], [newOwner]);
|
|
444
|
+
return hexlify(concat(['0xf2fde38b', __encodeData]));
|
|
445
|
+
}
|
|
446
|
+
|
|
447
|
+
/**
|
|
448
|
+
* encode updateGasReturn
|
|
449
|
+
* @param {number} newDodoGasReturn - uint256
|
|
450
|
+
* @param {number} newExternalGasReturn - uint256
|
|
451
|
+
* @returns {string} encode data
|
|
452
|
+
*/
|
|
453
|
+
export function encodeDODOV2Proxy02UpdateGasReturn(newDodoGasReturn: number, newExternalGasReturn: number) {
|
|
454
|
+
const __encodeData = defaultAbiCoder.encode(["uint256","uint256"], [newDodoGasReturn,newExternalGasReturn]);
|
|
455
|
+
return hexlify(concat(['0xd6354c3e', __encodeData]));
|
|
456
|
+
}
|