@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,172 @@
|
|
|
1
|
+
import { defaultAbiCoder, concat, hexlify } from '@dodoex/contract-request';
|
|
2
|
+
|
|
3
|
+
import { contractRequests } from '../contractRequests';
|
|
4
|
+
|
|
5
|
+
export function getDODOApproveContractAddressByChainId(chainId: number) {
|
|
6
|
+
const contractAddressObject = {"1":"0xCB859eA579b28e02B87A1FDE08d087ab9dbE5149","10":"0xCB859eA579b28e02B87A1FDE08d087ab9dbE5149","56":"0xa128Ba44B2738A558A1fdC06d6303d52D3Cef8c1","137":"0x6D310348d5c12009854DFCf72e0DF9027e8cb4f4","196":"0x7Fca409caEb9662751b2D843201033cB1ce4f205","1030":"0x5BaF16d57620Cb361F622232F3cb4090e35F3da2","2818":"0x2629E610dB4AC081c108cCDf8b19ED39D702df43","5000":"0xa71415675F68f29259ddD63215E5518d2735bf0a","8453":"0x89872650fA1A391f58B4E144222bB02e44db7e3B","10169":"0x0226fCE8c969604C3A0AD19c37d1FAFac73e13c2","42161":"0xA867241cDC8d3b0C07C85cC06F25a0cD3b5474d8","43114":"0xCFea63e3DE31De53D68780Dd65675F169439e470","48900":"0x775B68337A5768d1D5cda0A1A598d5dCb92fA8D6","59144":"0x6de4d882a84A98f4CCD5D33ea6b3C99A07BAbeB1","80084":"0x09da628Df009Ad300e8e299497eebD8694AfBe95","167000":"0x2629E610dB4AC081c108cCDf8b19ED39D702df43","200901":"0x4c0f6C7AA981099CB7D74E8f08D85832c7FA5640","534352":"0x20E77aD760eC9E922Fd2dA8847ABFbB2471B92CD","543210":"0x00600dde05d74Fd8C7E7208aBcfE08426FA09e85","11155111":"0x66c45FF040e86DC613F239123A5E21FFdC3A3fEC","1313161554":"0x335aC99bb3E51BDbF22025f092Ebc1Cf2c5cC619"};
|
|
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_PROXY_
|
|
14
|
+
* @param {number} chainId - number
|
|
15
|
+
* @returns {string} __output0 - address
|
|
16
|
+
*/
|
|
17
|
+
export function fetchDODOApprove_DODO_PROXY_(chainId: number) {
|
|
18
|
+
const __to = getDODOApproveContractAddressByChainId(chainId);
|
|
19
|
+
|
|
20
|
+
const __encodeData = defaultAbiCoder.encode([], []);
|
|
21
|
+
const __data = hexlify(concat(['0xe54c8033', __encodeData]));
|
|
22
|
+
return contractRequests.batchCall<string>(chainId, __to, __data, ["address"])
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* fetch _NEW_OWNER_
|
|
27
|
+
* @param {number} chainId - number
|
|
28
|
+
* @returns {string} __output0 - address
|
|
29
|
+
*/
|
|
30
|
+
export function fetchDODOApprove_NEW_OWNER_(chainId: number) {
|
|
31
|
+
const __to = getDODOApproveContractAddressByChainId(chainId);
|
|
32
|
+
|
|
33
|
+
const __encodeData = defaultAbiCoder.encode([], []);
|
|
34
|
+
const __data = hexlify(concat(['0x8456db15', __encodeData]));
|
|
35
|
+
return contractRequests.batchCall<string>(chainId, __to, __data, ["address"])
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* fetch _OWNER_
|
|
40
|
+
* @param {number} chainId - number
|
|
41
|
+
* @returns {string} __output0 - address
|
|
42
|
+
*/
|
|
43
|
+
export function fetchDODOApprove_OWNER_(chainId: number) {
|
|
44
|
+
const __to = getDODOApproveContractAddressByChainId(chainId);
|
|
45
|
+
|
|
46
|
+
const __encodeData = defaultAbiCoder.encode([], []);
|
|
47
|
+
const __data = hexlify(concat(['0x16048bc4', __encodeData]));
|
|
48
|
+
return contractRequests.batchCall<string>(chainId, __to, __data, ["address"])
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* fetch _PENDING_DODO_PROXY_
|
|
53
|
+
* @param {number} chainId - number
|
|
54
|
+
* @returns {string} __output0 - address
|
|
55
|
+
*/
|
|
56
|
+
export function fetchDODOApprove_PENDING_DODO_PROXY_(chainId: number) {
|
|
57
|
+
const __to = getDODOApproveContractAddressByChainId(chainId);
|
|
58
|
+
|
|
59
|
+
const __encodeData = defaultAbiCoder.encode([], []);
|
|
60
|
+
const __data = hexlify(concat(['0x93773aec', __encodeData]));
|
|
61
|
+
return contractRequests.batchCall<string>(chainId, __to, __data, ["address"])
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
/**
|
|
65
|
+
* fetch _TIMELOCK_
|
|
66
|
+
* @param {number} chainId - number
|
|
67
|
+
* @returns {bigint} __output0 - uint256
|
|
68
|
+
*/
|
|
69
|
+
export function fetchDODOApprove_TIMELOCK_(chainId: number) {
|
|
70
|
+
const __to = getDODOApproveContractAddressByChainId(chainId);
|
|
71
|
+
|
|
72
|
+
const __encodeData = defaultAbiCoder.encode([], []);
|
|
73
|
+
const __data = hexlify(concat(['0xb75dbf68', __encodeData]));
|
|
74
|
+
return contractRequests.batchCall<bigint>(chainId, __to, __data, ["uint256"])
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
/**
|
|
78
|
+
* fetch getDODOProxy
|
|
79
|
+
* @param {number} chainId - number
|
|
80
|
+
* @returns {string} __output0 - address
|
|
81
|
+
*/
|
|
82
|
+
export function fetchDODOApproveGetDODOProxy(chainId: number) {
|
|
83
|
+
const __to = getDODOApproveContractAddressByChainId(chainId);
|
|
84
|
+
|
|
85
|
+
const __encodeData = defaultAbiCoder.encode([], []);
|
|
86
|
+
const __data = hexlify(concat(['0x31fa1319', __encodeData]));
|
|
87
|
+
return contractRequests.batchCall<string>(chainId, __to, __data, ["address"])
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
/**
|
|
91
|
+
* encode claimOwnership
|
|
92
|
+
|
|
93
|
+
* @returns {string} encode data
|
|
94
|
+
*/
|
|
95
|
+
export function encodeDODOApproveClaimOwnership() {
|
|
96
|
+
const __encodeData = defaultAbiCoder.encode([], []);
|
|
97
|
+
return hexlify(concat(['0x4e71e0c8', __encodeData]));
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
/**
|
|
101
|
+
* encode claimTokens
|
|
102
|
+
* @param {string} token - address
|
|
103
|
+
* @param {string} who - address
|
|
104
|
+
* @param {string} dest - address
|
|
105
|
+
* @param {number} amount - uint256
|
|
106
|
+
* @returns {string} encode data
|
|
107
|
+
*/
|
|
108
|
+
export function encodeDODOApproveClaimTokens(token: string, who: string, dest: string, amount: number) {
|
|
109
|
+
const __encodeData = defaultAbiCoder.encode(["address","address","address","uint256"], [token,who,dest,amount]);
|
|
110
|
+
return hexlify(concat(['0x0a5ea466', __encodeData]));
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
/**
|
|
114
|
+
* encode init
|
|
115
|
+
* @param {string} owner - address
|
|
116
|
+
* @param {string} initProxyAddress - address
|
|
117
|
+
* @returns {string} encode data
|
|
118
|
+
*/
|
|
119
|
+
export function encodeDODOApproveInit(owner: string, initProxyAddress: string) {
|
|
120
|
+
const __encodeData = defaultAbiCoder.encode(["address","address"], [owner,initProxyAddress]);
|
|
121
|
+
return hexlify(concat(['0xf09a4016', __encodeData]));
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
/**
|
|
125
|
+
* encode initOwner
|
|
126
|
+
* @param {string} newOwner - address
|
|
127
|
+
* @returns {string} encode data
|
|
128
|
+
*/
|
|
129
|
+
export function encodeDODOApproveInitOwner(newOwner: string) {
|
|
130
|
+
const __encodeData = defaultAbiCoder.encode(["address"], [newOwner]);
|
|
131
|
+
return hexlify(concat(['0x0d009297', __encodeData]));
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
/**
|
|
135
|
+
* encode lockSetProxy
|
|
136
|
+
|
|
137
|
+
* @returns {string} encode data
|
|
138
|
+
*/
|
|
139
|
+
export function encodeDODOApproveLockSetProxy() {
|
|
140
|
+
const __encodeData = defaultAbiCoder.encode([], []);
|
|
141
|
+
return hexlify(concat(['0x4f3cef84', __encodeData]));
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
/**
|
|
145
|
+
* encode setDODOProxy
|
|
146
|
+
|
|
147
|
+
* @returns {string} encode data
|
|
148
|
+
*/
|
|
149
|
+
export function encodeDODOApproveSetDODOProxy() {
|
|
150
|
+
const __encodeData = defaultAbiCoder.encode([], []);
|
|
151
|
+
return hexlify(concat(['0x8cdb6574', __encodeData]));
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
/**
|
|
155
|
+
* encode transferOwnership
|
|
156
|
+
* @param {string} newOwner - address
|
|
157
|
+
* @returns {string} encode data
|
|
158
|
+
*/
|
|
159
|
+
export function encodeDODOApproveTransferOwnership(newOwner: string) {
|
|
160
|
+
const __encodeData = defaultAbiCoder.encode(["address"], [newOwner]);
|
|
161
|
+
return hexlify(concat(['0xf2fde38b', __encodeData]));
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
/**
|
|
165
|
+
* encode unlockSetProxy
|
|
166
|
+
* @param {string} newDodoProxy - address
|
|
167
|
+
* @returns {string} encode data
|
|
168
|
+
*/
|
|
169
|
+
export function encodeDODOApproveUnlockSetProxy(newDodoProxy: string) {
|
|
170
|
+
const __encodeData = defaultAbiCoder.encode(["address"], [newDodoProxy]);
|
|
171
|
+
return hexlify(concat(['0x41c256c1', __encodeData]));
|
|
172
|
+
}
|
|
@@ -0,0 +1,197 @@
|
|
|
1
|
+
import { defaultAbiCoder, concat, hexlify } from '@dodoex/contract-request';
|
|
2
|
+
|
|
3
|
+
import { contractRequests } from '../contractRequests';
|
|
4
|
+
|
|
5
|
+
export function getDODOApproveProxyContractAddressByChainId(chainId: number) {
|
|
6
|
+
const contractAddressObject = {"1":"0x335aC99bb3E51BDbF22025f092Ebc1Cf2c5cC619","10":"0x8989A6909fe5af076AaA3D7b18BDe53153DbC348","56":"0xB76de21f04F677f07D9881174a1D8E624276314C","137":"0x01FEEA29da5Ae41B0b5F6b10b93EE34752eF80d7","196":"0xfbdEb92D8133cf35633eE2D40Be561476268DcFC","1030":"0xEfD2eC5F9fFe9899515C7032d86F925715eD9D05","2818":"0x7fB45a8AcA7DD30a136569B5E3eb7E1F1f0235a0","5000":"0xb546Add98c71D97Bb65De60B91021617AcD1262C","8453":"0x6de4d882a84A98f4CCD5D33ea6b3C99A07BAbeB1","10169":"0xa23137871C4A4ce8514f581EE82262CD1A49EEAE","42161":"0x311E670c3305a0BD55184c1C6580eBeA1FA611F0","43114":"0x96a75d73b3de29c009863fA6329D96b2181D3Dc4","48900":"0xcAcb29f0631612552eF50D4Fa02920910513b2B0","59144":"0xCb3dC90E800C961d4a206BeAAFd92A6d2E06495e","80084":"0x8bCcE4CCEEf7e841A2A8A48F3250B9FB3b25B0C3","167000":"0x7fB45a8AcA7DD30a136569B5E3eb7E1F1f0235a0","200901":"0xaE38E18D764AdF135A2D8b32A29C603772A7846b","534352":"0x0218E24dd47f9a1D05418eAa5B9cEDB13Ca48492","543210":"0x37B121f370B57059C6fe486440C2ECded71C0eF7","11155111":"0xE2004eE21f88a7D8e1A5EDc3c9617a0460CC7b99","1313161554":"0x6B4Fa0bc61Eddc928e0Df9c7f01e407BfcD3e5EF"};
|
|
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_APPROVE_
|
|
14
|
+
* @param {number} chainId - number
|
|
15
|
+
* @returns {string} __output0 - address
|
|
16
|
+
*/
|
|
17
|
+
export function fetchDODOApproveProxy_DODO_APPROVE_(chainId: number) {
|
|
18
|
+
const __to = getDODOApproveProxyContractAddressByChainId(chainId);
|
|
19
|
+
|
|
20
|
+
const __encodeData = defaultAbiCoder.encode([], []);
|
|
21
|
+
const __data = hexlify(concat(['0x46e74298', __encodeData]));
|
|
22
|
+
return contractRequests.batchCall<string>(chainId, __to, __data, ["address"])
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* fetch _IS_ALLOWED_PROXY_
|
|
27
|
+
* @param {number} chainId - number
|
|
28
|
+
* @param {string} __input1 - address
|
|
29
|
+
* @returns {boolean} __output0 - bool
|
|
30
|
+
*/
|
|
31
|
+
export function fetchDODOApproveProxy_IS_ALLOWED_PROXY_(chainId: number, __input1: string) {
|
|
32
|
+
const __to = getDODOApproveProxyContractAddressByChainId(chainId);
|
|
33
|
+
|
|
34
|
+
const __encodeData = defaultAbiCoder.encode(["address"], [__input1]);
|
|
35
|
+
const __data = hexlify(concat(['0x3b2f27bb', __encodeData]));
|
|
36
|
+
return contractRequests.batchCall<boolean>(chainId, __to, __data, ["bool"])
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* fetch _NEW_OWNER_
|
|
41
|
+
* @param {number} chainId - number
|
|
42
|
+
* @returns {string} __output0 - address
|
|
43
|
+
*/
|
|
44
|
+
export function fetchDODOApproveProxy_NEW_OWNER_(chainId: number) {
|
|
45
|
+
const __to = getDODOApproveProxyContractAddressByChainId(chainId);
|
|
46
|
+
|
|
47
|
+
const __encodeData = defaultAbiCoder.encode([], []);
|
|
48
|
+
const __data = hexlify(concat(['0x8456db15', __encodeData]));
|
|
49
|
+
return contractRequests.batchCall<string>(chainId, __to, __data, ["address"])
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* fetch _OWNER_
|
|
54
|
+
* @param {number} chainId - number
|
|
55
|
+
* @returns {string} __output0 - address
|
|
56
|
+
*/
|
|
57
|
+
export function fetchDODOApproveProxy_OWNER_(chainId: number) {
|
|
58
|
+
const __to = getDODOApproveProxyContractAddressByChainId(chainId);
|
|
59
|
+
|
|
60
|
+
const __encodeData = defaultAbiCoder.encode([], []);
|
|
61
|
+
const __data = hexlify(concat(['0x16048bc4', __encodeData]));
|
|
62
|
+
return contractRequests.batchCall<string>(chainId, __to, __data, ["address"])
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
/**
|
|
66
|
+
* fetch _PENDING_ADD_DODO_PROXY_
|
|
67
|
+
* @param {number} chainId - number
|
|
68
|
+
* @returns {string} __output0 - address
|
|
69
|
+
*/
|
|
70
|
+
export function fetchDODOApproveProxy_PENDING_ADD_DODO_PROXY_(chainId: number) {
|
|
71
|
+
const __to = getDODOApproveProxyContractAddressByChainId(chainId);
|
|
72
|
+
|
|
73
|
+
const __encodeData = defaultAbiCoder.encode([], []);
|
|
74
|
+
const __data = hexlify(concat(['0xcc646ed4', __encodeData]));
|
|
75
|
+
return contractRequests.batchCall<string>(chainId, __to, __data, ["address"])
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
/**
|
|
79
|
+
* fetch _TIMELOCK_
|
|
80
|
+
* @param {number} chainId - number
|
|
81
|
+
* @returns {bigint} __output0 - uint256
|
|
82
|
+
*/
|
|
83
|
+
export function fetchDODOApproveProxy_TIMELOCK_(chainId: number) {
|
|
84
|
+
const __to = getDODOApproveProxyContractAddressByChainId(chainId);
|
|
85
|
+
|
|
86
|
+
const __encodeData = defaultAbiCoder.encode([], []);
|
|
87
|
+
const __data = hexlify(concat(['0xb75dbf68', __encodeData]));
|
|
88
|
+
return contractRequests.batchCall<bigint>(chainId, __to, __data, ["uint256"])
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
/**
|
|
92
|
+
* fetch isAllowedProxy
|
|
93
|
+
* @param {number} chainId - number
|
|
94
|
+
* @param {string} _proxy - address
|
|
95
|
+
* @returns {boolean} __output0 - bool
|
|
96
|
+
*/
|
|
97
|
+
export function fetchDODOApproveProxyIsAllowedProxy(chainId: number, _proxy: string) {
|
|
98
|
+
const __to = getDODOApproveProxyContractAddressByChainId(chainId);
|
|
99
|
+
|
|
100
|
+
const __encodeData = defaultAbiCoder.encode(["address"], [_proxy]);
|
|
101
|
+
const __data = hexlify(concat(['0x48a4f993', __encodeData]));
|
|
102
|
+
return contractRequests.batchCall<boolean>(chainId, __to, __data, ["bool"])
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
/**
|
|
106
|
+
* encode addDODOProxy
|
|
107
|
+
|
|
108
|
+
* @returns {string} encode data
|
|
109
|
+
*/
|
|
110
|
+
export function encodeDODOApproveProxyAddDODOProxy() {
|
|
111
|
+
const __encodeData = defaultAbiCoder.encode([], []);
|
|
112
|
+
return hexlify(concat(['0x3e688589', __encodeData]));
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
/**
|
|
116
|
+
* encode claimOwnership
|
|
117
|
+
|
|
118
|
+
* @returns {string} encode data
|
|
119
|
+
*/
|
|
120
|
+
export function encodeDODOApproveProxyClaimOwnership() {
|
|
121
|
+
const __encodeData = defaultAbiCoder.encode([], []);
|
|
122
|
+
return hexlify(concat(['0x4e71e0c8', __encodeData]));
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
/**
|
|
126
|
+
* encode claimTokens
|
|
127
|
+
* @param {string} token - address
|
|
128
|
+
* @param {string} who - address
|
|
129
|
+
* @param {string} dest - address
|
|
130
|
+
* @param {number} amount - uint256
|
|
131
|
+
* @returns {string} encode data
|
|
132
|
+
*/
|
|
133
|
+
export function encodeDODOApproveProxyClaimTokens(token: string, who: string, dest: string, amount: number) {
|
|
134
|
+
const __encodeData = defaultAbiCoder.encode(["address","address","address","uint256"], [token,who,dest,amount]);
|
|
135
|
+
return hexlify(concat(['0x0a5ea466', __encodeData]));
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
/**
|
|
139
|
+
* encode init
|
|
140
|
+
* @param {string} owner - address
|
|
141
|
+
* @param {Array<string>} proxies - address[]
|
|
142
|
+
* @returns {string} encode data
|
|
143
|
+
*/
|
|
144
|
+
export function encodeDODOApproveProxyInit(owner: string, proxies: Array<string>) {
|
|
145
|
+
const __encodeData = defaultAbiCoder.encode(["address","address[]"], [owner,proxies]);
|
|
146
|
+
return hexlify(concat(['0x3c5a3cea', __encodeData]));
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
/**
|
|
150
|
+
* encode initOwner
|
|
151
|
+
* @param {string} newOwner - address
|
|
152
|
+
* @returns {string} encode data
|
|
153
|
+
*/
|
|
154
|
+
export function encodeDODOApproveProxyInitOwner(newOwner: string) {
|
|
155
|
+
const __encodeData = defaultAbiCoder.encode(["address"], [newOwner]);
|
|
156
|
+
return hexlify(concat(['0x0d009297', __encodeData]));
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
/**
|
|
160
|
+
* encode lockAddProxy
|
|
161
|
+
|
|
162
|
+
* @returns {string} encode data
|
|
163
|
+
*/
|
|
164
|
+
export function encodeDODOApproveProxyLockAddProxy() {
|
|
165
|
+
const __encodeData = defaultAbiCoder.encode([], []);
|
|
166
|
+
return hexlify(concat(['0x556d65a8', __encodeData]));
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
/**
|
|
170
|
+
* encode removeDODOProxy
|
|
171
|
+
* @param {string} oldDodoProxy - address
|
|
172
|
+
* @returns {string} encode data
|
|
173
|
+
*/
|
|
174
|
+
export function encodeDODOApproveProxyRemoveDODOProxy(oldDodoProxy: string) {
|
|
175
|
+
const __encodeData = defaultAbiCoder.encode(["address"], [oldDodoProxy]);
|
|
176
|
+
return hexlify(concat(['0x2c419f2f', __encodeData]));
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
/**
|
|
180
|
+
* encode transferOwnership
|
|
181
|
+
* @param {string} newOwner - address
|
|
182
|
+
* @returns {string} encode data
|
|
183
|
+
*/
|
|
184
|
+
export function encodeDODOApproveProxyTransferOwnership(newOwner: string) {
|
|
185
|
+
const __encodeData = defaultAbiCoder.encode(["address"], [newOwner]);
|
|
186
|
+
return hexlify(concat(['0xf2fde38b', __encodeData]));
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
/**
|
|
190
|
+
* encode unlockAddProxy
|
|
191
|
+
* @param {string} newDodoProxy - address
|
|
192
|
+
* @returns {string} encode data
|
|
193
|
+
*/
|
|
194
|
+
export function encodeDODOApproveProxyUnlockAddProxy(newDodoProxy: string) {
|
|
195
|
+
const __encodeData = defaultAbiCoder.encode(["address"], [newDodoProxy]);
|
|
196
|
+
return hexlify(concat(['0x374445b2', __encodeData]));
|
|
197
|
+
}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import { defaultAbiCoder, concat, hexlify } from '@dodoex/contract-request';
|
|
2
|
+
|
|
3
|
+
import { contractRequests } from '../contractRequests';
|
|
4
|
+
|
|
5
|
+
export function getDODOCalleeHelperContractAddressByChainId(chainId: number) {
|
|
6
|
+
const contractAddressObject = {"1":"0x45a7E2E9D780613E047f7e78a9d3902ff854B522","10":"0x45a7E2E9D780613E047f7e78a9d3902ff854B522","56":"0x2673E5333620bb22BD1bFB3af9Fc7012008E3b4B","137":"0x261F6cF4dF0e5c1432739cDAFD9299150FEd3dFc","196":"0xD54BE1b50b51BA83e88239024e85EF16Dd973B3B","1030":"0x5B2fd46E6E3Ff1E479d651ec0b210882Aa9871dF","2818":"0x94B66F3156353a12A6004d098A16F2fCfF9E8348","5000":"0x4aAe1d041C01078725dB016BA4D4F72455CaF931","8453":"0x44023441f2Bad375b6b5C6354B03c3E9AD01E269","10169":"0x44023441f2Bad375b6b5C6354B03c3E9AD01E269","42161":"0xe3B40F8D8346d428EAB28d9Fd672b784d921cfBD","43114":"0x4EfF1D851366b8cc51d553a87e2d12dA8Da46F2a","48900":"0xD54BE1b50b51BA83e88239024e85EF16Dd973B3B","59144":"0xB5c7BA1EAde74800cD6cf5F56b1c4562De373780","80084":"0x842b59E74Ca9851fF0C35741C5f0923c63825BA8","167000":"0x94B66F3156353a12A6004d098A16F2fCfF9E8348","200901":"0xf2668090476D10445dfd4Bd6aDd1f3294F48029d","534352":"0x44023441f2Bad375b6b5C6354B03c3E9AD01E269","543210":"0x094867f0713ac77786E0b9c2d74216bE934470F4","11155111":"0xCD536b4DECFD2fa0443666B6becD145F8aDe2E48","1313161554":"0x738Ebf387A0CE0eb46b0eF8Fa5DEa2EaE6B1Df51"};
|
|
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 _WETH_
|
|
14
|
+
* @param {number} chainId - number
|
|
15
|
+
* @returns {string} __output0 - address
|
|
16
|
+
*/
|
|
17
|
+
export function fetchDODOCalleeHelper_WETH_(chainId: number) {
|
|
18
|
+
const __to = getDODOCalleeHelperContractAddressByChainId(chainId);
|
|
19
|
+
|
|
20
|
+
const __encodeData = defaultAbiCoder.encode([], []);
|
|
21
|
+
const __data = hexlify(concat(['0x0d4eec8f', __encodeData]));
|
|
22
|
+
return contractRequests.batchCall<string>(chainId, __to, __data, ["address"])
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* encode CPCancelCall
|
|
27
|
+
* @param {string} assetTo - address
|
|
28
|
+
* @param {number} amount - uint256
|
|
29
|
+
* @param {string} __input1 - bytes
|
|
30
|
+
* @returns {string} encode data
|
|
31
|
+
*/
|
|
32
|
+
export function encodeDODOCalleeHelperCPCancelCall(assetTo: string, amount: number, __input1: string) {
|
|
33
|
+
const __encodeData = defaultAbiCoder.encode(["address","uint256","bytes"], [assetTo,amount,__input1]);
|
|
34
|
+
return hexlify(concat(['0x6430f110', __encodeData]));
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* encode CPClaimBidCall
|
|
39
|
+
* @param {string} assetTo - address
|
|
40
|
+
* @param {number} baseAmount - uint256
|
|
41
|
+
* @param {number} quoteAmount - uint256
|
|
42
|
+
* @param {string} __input1 - bytes
|
|
43
|
+
* @returns {string} encode data
|
|
44
|
+
*/
|
|
45
|
+
export function encodeDODOCalleeHelperCPClaimBidCall(assetTo: string, baseAmount: number, quoteAmount: number, __input1: string) {
|
|
46
|
+
const __encodeData = defaultAbiCoder.encode(["address","uint256","uint256","bytes"], [assetTo,baseAmount,quoteAmount,__input1]);
|
|
47
|
+
return hexlify(concat(['0x7ceef916', __encodeData]));
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* encode DVMSellShareCall
|
|
52
|
+
* @param {string} assetTo - address
|
|
53
|
+
* @param {number} __input1 - uint256
|
|
54
|
+
* @param {number} baseAmount - uint256
|
|
55
|
+
* @param {number} quoteAmount - uint256
|
|
56
|
+
* @param {string} __input2 - bytes
|
|
57
|
+
* @returns {string} encode data
|
|
58
|
+
*/
|
|
59
|
+
export function encodeDODOCalleeHelperDVMSellShareCall(assetTo: string, __input1: number, baseAmount: number, quoteAmount: number, __input2: string) {
|
|
60
|
+
const __encodeData = defaultAbiCoder.encode(["address","uint256","uint256","uint256","bytes"], [assetTo,__input1,baseAmount,quoteAmount,__input2]);
|
|
61
|
+
return hexlify(concat(['0x2411d338', __encodeData]));
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
/**
|
|
65
|
+
* encode NFTRedeemCall
|
|
66
|
+
* @param {string} assetTo - address
|
|
67
|
+
* @param {number} quoteAmount - uint256
|
|
68
|
+
* @param {string} __input1 - bytes
|
|
69
|
+
* @returns {string} encode data
|
|
70
|
+
*/
|
|
71
|
+
export function encodeDODOCalleeHelperNFTRedeemCall(assetTo: string, quoteAmount: number, __input1: string) {
|
|
72
|
+
const __encodeData = defaultAbiCoder.encode(["address","uint256","bytes"], [assetTo,quoteAmount,__input1]);
|
|
73
|
+
return hexlify(concat(['0x53c06360', __encodeData]));
|
|
74
|
+
}
|
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
import { defaultAbiCoder, concat, hexlify } from '@dodoex/contract-request';
|
|
2
|
+
|
|
3
|
+
import { contractRequests } from '../contractRequests';
|
|
4
|
+
|
|
5
|
+
export function getDODOCirculationHelperContractAddressByChainId(chainId: number) {
|
|
6
|
+
const contractAddressObject = {"1":"0x357c5e9cfa8b834edcef7c7aabd8f9db09119d11"};
|
|
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 _MAX_PENALTY_RATIO_
|
|
14
|
+
* @param {number} chainId - number
|
|
15
|
+
* @returns {bigint} __output0 - uint256
|
|
16
|
+
*/
|
|
17
|
+
export function fetchDODOCirculationHelper_MAX_PENALTY_RATIO_(chainId: number) {
|
|
18
|
+
const __to = getDODOCirculationHelperContractAddressByChainId(chainId);
|
|
19
|
+
|
|
20
|
+
const __encodeData = defaultAbiCoder.encode([], []);
|
|
21
|
+
const __data = hexlify(concat(['0x48afb913', __encodeData]));
|
|
22
|
+
return contractRequests.batchCall<bigint>(chainId, __to, __data, ["uint256"])
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* fetch _MIN_PENALTY_RATIO_
|
|
27
|
+
* @param {number} chainId - number
|
|
28
|
+
* @returns {bigint} __output0 - uint256
|
|
29
|
+
*/
|
|
30
|
+
export function fetchDODOCirculationHelper_MIN_PENALTY_RATIO_(chainId: number) {
|
|
31
|
+
const __to = getDODOCirculationHelperContractAddressByChainId(chainId);
|
|
32
|
+
|
|
33
|
+
const __encodeData = defaultAbiCoder.encode([], []);
|
|
34
|
+
const __data = hexlify(concat(['0xd549e74e', __encodeData]));
|
|
35
|
+
return contractRequests.batchCall<bigint>(chainId, __to, __data, ["uint256"])
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* fetch _NEW_OWNER_
|
|
40
|
+
* @param {number} chainId - number
|
|
41
|
+
* @returns {string} __output0 - address
|
|
42
|
+
*/
|
|
43
|
+
export function fetchDODOCirculationHelper_NEW_OWNER_(chainId: number) {
|
|
44
|
+
const __to = getDODOCirculationHelperContractAddressByChainId(chainId);
|
|
45
|
+
|
|
46
|
+
const __encodeData = defaultAbiCoder.encode([], []);
|
|
47
|
+
const __data = hexlify(concat(['0x8456db15', __encodeData]));
|
|
48
|
+
return contractRequests.batchCall<string>(chainId, __to, __data, ["address"])
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* fetch _OWNER_
|
|
53
|
+
* @param {number} chainId - number
|
|
54
|
+
* @returns {string} __output0 - address
|
|
55
|
+
*/
|
|
56
|
+
export function fetchDODOCirculationHelper_OWNER_(chainId: number) {
|
|
57
|
+
const __to = getDODOCirculationHelperContractAddressByChainId(chainId);
|
|
58
|
+
|
|
59
|
+
const __encodeData = defaultAbiCoder.encode([], []);
|
|
60
|
+
const __data = hexlify(concat(['0x16048bc4', __encodeData]));
|
|
61
|
+
return contractRequests.batchCall<string>(chainId, __to, __data, ["address"])
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
/**
|
|
65
|
+
* fetch geRatioValue
|
|
66
|
+
* @param {number} chainId - number
|
|
67
|
+
* @param {number} input - uint256
|
|
68
|
+
* @returns {bigint} __output0 - uint256
|
|
69
|
+
*/
|
|
70
|
+
export function fetchDODOCirculationHelperGeRatioValue(chainId: number, input: number) {
|
|
71
|
+
const __to = getDODOCirculationHelperContractAddressByChainId(chainId);
|
|
72
|
+
|
|
73
|
+
const __encodeData = defaultAbiCoder.encode(["uint256"], [input]);
|
|
74
|
+
const __data = hexlify(concat(['0x2358dbc0', __encodeData]));
|
|
75
|
+
return contractRequests.batchCall<bigint>(chainId, __to, __data, ["uint256"])
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
/**
|
|
79
|
+
* fetch getCirculation
|
|
80
|
+
* @param {number} chainId - number
|
|
81
|
+
* @returns {bigint} circulation - uint256
|
|
82
|
+
*/
|
|
83
|
+
export function fetchDODOCirculationHelperGetCirculation(chainId: number) {
|
|
84
|
+
const __to = getDODOCirculationHelperContractAddressByChainId(chainId);
|
|
85
|
+
|
|
86
|
+
const __encodeData = defaultAbiCoder.encode([], []);
|
|
87
|
+
const __data = hexlify(concat(['0xbf151cb8', __encodeData]));
|
|
88
|
+
return contractRequests.batchCall<bigint>(chainId, __to, __data, ["uint256"])
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
/**
|
|
92
|
+
* fetch getDodoWithdrawFeeRatio
|
|
93
|
+
* @param {number} chainId - number
|
|
94
|
+
* @returns {bigint} ratio - uint256
|
|
95
|
+
*/
|
|
96
|
+
export function fetchDODOCirculationHelperGetDodoWithdrawFeeRatio(chainId: number) {
|
|
97
|
+
const __to = getDODOCirculationHelperContractAddressByChainId(chainId);
|
|
98
|
+
|
|
99
|
+
const __encodeData = defaultAbiCoder.encode([], []);
|
|
100
|
+
const __data = hexlify(concat(['0xdef0d15d', __encodeData]));
|
|
101
|
+
return contractRequests.batchCall<bigint>(chainId, __to, __data, ["uint256"])
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
/**
|
|
105
|
+
* encode addLockedContractAddress
|
|
106
|
+
* @param {string} lockedContract - address
|
|
107
|
+
* @returns {string} encode data
|
|
108
|
+
*/
|
|
109
|
+
export function encodeDODOCirculationHelperAddLockedContractAddress(lockedContract: string) {
|
|
110
|
+
const __encodeData = defaultAbiCoder.encode(["address"], [lockedContract]);
|
|
111
|
+
return hexlify(concat(['0xa82d6930', __encodeData]));
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
/**
|
|
115
|
+
* encode claimOwnership
|
|
116
|
+
|
|
117
|
+
* @returns {string} encode data
|
|
118
|
+
*/
|
|
119
|
+
export function encodeDODOCirculationHelperClaimOwnership() {
|
|
120
|
+
const __encodeData = defaultAbiCoder.encode([], []);
|
|
121
|
+
return hexlify(concat(['0x4e71e0c8', __encodeData]));
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
/**
|
|
125
|
+
* encode initOwner
|
|
126
|
+
* @param {string} newOwner - address
|
|
127
|
+
* @returns {string} encode data
|
|
128
|
+
*/
|
|
129
|
+
export function encodeDODOCirculationHelperInitOwner(newOwner: string) {
|
|
130
|
+
const __encodeData = defaultAbiCoder.encode(["address"], [newOwner]);
|
|
131
|
+
return hexlify(concat(['0x0d009297', __encodeData]));
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
/**
|
|
135
|
+
* encode removeLockedContractAddress
|
|
136
|
+
* @param {string} lockedContract - address
|
|
137
|
+
* @returns {string} encode data
|
|
138
|
+
*/
|
|
139
|
+
export function encodeDODOCirculationHelperRemoveLockedContractAddress(lockedContract: string) {
|
|
140
|
+
const __encodeData = defaultAbiCoder.encode(["address"], [lockedContract]);
|
|
141
|
+
return hexlify(concat(['0x188f4012', __encodeData]));
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
/**
|
|
145
|
+
* encode transferOwnership
|
|
146
|
+
* @param {string} newOwner - address
|
|
147
|
+
* @returns {string} encode data
|
|
148
|
+
*/
|
|
149
|
+
export function encodeDODOCirculationHelperTransferOwnership(newOwner: string) {
|
|
150
|
+
const __encodeData = defaultAbiCoder.encode(["address"], [newOwner]);
|
|
151
|
+
return hexlify(concat(['0xf2fde38b', __encodeData]));
|
|
152
|
+
}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import { defaultAbiCoder, concat, hexlify } from '@dodoex/contract-request';
|
|
2
|
+
|
|
3
|
+
import { contractRequests } from '../contractRequests';
|
|
4
|
+
|
|
5
|
+
export function getDODOCpProxyContractAddressByChainId(chainId: number) {
|
|
6
|
+
const contractAddressObject = {"1":"0x283e02d0D906F1395777799f0a153c20A83d0ef2","2818":"0x7386F6F2375a38FBD1F4dA1d3eb39cd8dD8d1b40","80084":"0x80465a300299e90132DFa2c7c3Fc3a12424599bB","167000":"0x7386F6F2375a38FBD1F4dA1d3eb39cd8dD8d1b40","543210":"0x4197fd29f757C24627dF590779EE3123B16dbf4D"};
|
|
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 _CP_FACTORY_
|
|
14
|
+
* @param {number} chainId - number
|
|
15
|
+
* @returns {string} __output0 - address
|
|
16
|
+
*/
|
|
17
|
+
export function fetchDODOCpProxy_CP_FACTORY_(chainId: number) {
|
|
18
|
+
const __to = getDODOCpProxyContractAddressByChainId(chainId);
|
|
19
|
+
|
|
20
|
+
const __encodeData = defaultAbiCoder.encode([], []);
|
|
21
|
+
const __data = hexlify(concat(['0xfaa980e4', __encodeData]));
|
|
22
|
+
return contractRequests.batchCall<string>(chainId, __to, __data, ["address"])
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* fetch _DODO_APPROVE_PROXY_
|
|
27
|
+
* @param {number} chainId - number
|
|
28
|
+
* @returns {string} __output0 - address
|
|
29
|
+
*/
|
|
30
|
+
export function fetchDODOCpProxy_DODO_APPROVE_PROXY_(chainId: number) {
|
|
31
|
+
const __to = getDODOCpProxyContractAddressByChainId(chainId);
|
|
32
|
+
|
|
33
|
+
const __encodeData = defaultAbiCoder.encode([], []);
|
|
34
|
+
const __data = hexlify(concat(['0xeb99be12', __encodeData]));
|
|
35
|
+
return contractRequests.batchCall<string>(chainId, __to, __data, ["address"])
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* fetch _WETH_
|
|
40
|
+
* @param {number} chainId - number
|
|
41
|
+
* @returns {string} __output0 - address
|
|
42
|
+
*/
|
|
43
|
+
export function fetchDODOCpProxy_WETH_(chainId: number) {
|
|
44
|
+
const __to = getDODOCpProxyContractAddressByChainId(chainId);
|
|
45
|
+
|
|
46
|
+
const __encodeData = defaultAbiCoder.encode([], []);
|
|
47
|
+
const __data = hexlify(concat(['0x0d4eec8f', __encodeData]));
|
|
48
|
+
return contractRequests.batchCall<string>(chainId, __to, __data, ["address"])
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* encode bid
|
|
53
|
+
* @param {string} cpAddress - address
|
|
54
|
+
* @param {number} quoteAmount - uint256
|
|
55
|
+
* @param {number} flag - uint8
|
|
56
|
+
* @param {number} deadLine - uint256
|
|
57
|
+
* @returns {string} encode data
|
|
58
|
+
*/
|
|
59
|
+
export function encodeDODOCpProxyBid(cpAddress: string, quoteAmount: number, flag: number, deadLine: number) {
|
|
60
|
+
const __encodeData = defaultAbiCoder.encode(["address","uint256","uint8","uint256"], [cpAddress,quoteAmount,flag,deadLine]);
|
|
61
|
+
return hexlify(concat(['0xdb70b5c7', __encodeData]));
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
/**
|
|
65
|
+
* encode createCrowdPooling
|
|
66
|
+
* @param {string} baseToken - address
|
|
67
|
+
* @param {string} quoteToken - address
|
|
68
|
+
* @param {number} baseInAmount - uint256
|
|
69
|
+
* @param {Array<number>} timeLine - uint256[]
|
|
70
|
+
* @param {Array<number>} valueList - uint256[]
|
|
71
|
+
* @param {Array<boolean>} switches - bool[]
|
|
72
|
+
* @param {number} deadLine - uint256
|
|
73
|
+
* @returns {string} encode data
|
|
74
|
+
*/
|
|
75
|
+
export function encodeDODOCpProxyCreateCrowdPooling(baseToken: string, quoteToken: string, baseInAmount: number, timeLine: Array<number>, valueList: Array<number>, switches: Array<boolean>, deadLine: number) {
|
|
76
|
+
const __encodeData = defaultAbiCoder.encode(["address","address","uint256","uint256[]","uint256[]","bool[]","uint256"], [baseToken,quoteToken,baseInAmount,timeLine,valueList,switches,deadLine]);
|
|
77
|
+
return hexlify(concat(['0x9b58c78c', __encodeData]));
|
|
78
|
+
}
|