@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,262 @@
|
|
|
1
|
+
import { defaultAbiCoder, concat, hexlify } from '@dodoex/contract-request';
|
|
2
|
+
|
|
3
|
+
import { contractRequests } from '../contractRequests';
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* fetch _NEW_OWNER_
|
|
9
|
+
* @param {number} chainId - number
|
|
10
|
+
* @param {string} __to - string
|
|
11
|
+
* @returns {string} __output0 - address
|
|
12
|
+
*/
|
|
13
|
+
export function fetchCustomMintableERC20_NEW_OWNER_(chainId: number, __to: string) {
|
|
14
|
+
const __encodeData = defaultAbiCoder.encode([], []);
|
|
15
|
+
const __data = hexlify(concat(['0x8456db15', __encodeData]));
|
|
16
|
+
return contractRequests.batchCall<string>(chainId, __to, __data, ["address"])
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* fetch _OWNER_
|
|
21
|
+
* @param {number} chainId - number
|
|
22
|
+
* @param {string} __to - string
|
|
23
|
+
* @returns {string} __output0 - address
|
|
24
|
+
*/
|
|
25
|
+
export function fetchCustomMintableERC20_OWNER_(chainId: number, __to: string) {
|
|
26
|
+
const __encodeData = defaultAbiCoder.encode([], []);
|
|
27
|
+
const __data = hexlify(concat(['0x16048bc4', __encodeData]));
|
|
28
|
+
return contractRequests.batchCall<string>(chainId, __to, __data, ["address"])
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* fetch allowance
|
|
33
|
+
* @param {number} chainId - number
|
|
34
|
+
* @param {string} __to - string
|
|
35
|
+
* @param {string} owner - address
|
|
36
|
+
* @param {string} spender - address
|
|
37
|
+
* @returns {bigint} __output0 - uint256
|
|
38
|
+
*/
|
|
39
|
+
export function fetchCustomMintableERC20Allowance(chainId: number, __to: string, owner: string, spender: string) {
|
|
40
|
+
const __encodeData = defaultAbiCoder.encode(["address","address"], [owner,spender]);
|
|
41
|
+
const __data = hexlify(concat(['0xdd62ed3e', __encodeData]));
|
|
42
|
+
return contractRequests.batchCall<bigint>(chainId, __to, __data, ["uint256"])
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* fetch balanceOf
|
|
47
|
+
* @param {number} chainId - number
|
|
48
|
+
* @param {string} __to - string
|
|
49
|
+
* @param {string} owner - address
|
|
50
|
+
* @returns {bigint} balance - uint256
|
|
51
|
+
*/
|
|
52
|
+
export function fetchCustomMintableERC20BalanceOf(chainId: number, __to: string, owner: string) {
|
|
53
|
+
const __encodeData = defaultAbiCoder.encode(["address"], [owner]);
|
|
54
|
+
const __data = hexlify(concat(['0x70a08231', __encodeData]));
|
|
55
|
+
return contractRequests.batchCall<bigint>(chainId, __to, __data, ["uint256"])
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
/**
|
|
59
|
+
* fetch decimals
|
|
60
|
+
* @param {number} chainId - number
|
|
61
|
+
* @param {string} __to - string
|
|
62
|
+
* @returns {bigint} __output0 - uint8
|
|
63
|
+
*/
|
|
64
|
+
export function fetchCustomMintableERC20Decimals(chainId: number, __to: string) {
|
|
65
|
+
const __encodeData = defaultAbiCoder.encode([], []);
|
|
66
|
+
const __data = hexlify(concat(['0x313ce567', __encodeData]));
|
|
67
|
+
return contractRequests.batchCall<bigint>(chainId, __to, __data, ["uint8"])
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
/**
|
|
71
|
+
* fetch name
|
|
72
|
+
* @param {number} chainId - number
|
|
73
|
+
* @param {string} __to - string
|
|
74
|
+
* @returns {string} __output0 - string
|
|
75
|
+
*/
|
|
76
|
+
export function fetchCustomMintableERC20Name(chainId: number, __to: string) {
|
|
77
|
+
const __encodeData = defaultAbiCoder.encode([], []);
|
|
78
|
+
const __data = hexlify(concat(['0x06fdde03', __encodeData]));
|
|
79
|
+
return contractRequests.batchCall<string>(chainId, __to, __data, ["string"])
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
/**
|
|
83
|
+
* fetch symbol
|
|
84
|
+
* @param {number} chainId - number
|
|
85
|
+
* @param {string} __to - string
|
|
86
|
+
* @returns {string} __output0 - string
|
|
87
|
+
*/
|
|
88
|
+
export function fetchCustomMintableERC20Symbol(chainId: number, __to: string) {
|
|
89
|
+
const __encodeData = defaultAbiCoder.encode([], []);
|
|
90
|
+
const __data = hexlify(concat(['0x95d89b41', __encodeData]));
|
|
91
|
+
return contractRequests.batchCall<string>(chainId, __to, __data, ["string"])
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
/**
|
|
95
|
+
* fetch team
|
|
96
|
+
* @param {number} chainId - number
|
|
97
|
+
* @param {string} __to - string
|
|
98
|
+
* @returns {string} __output0 - address
|
|
99
|
+
*/
|
|
100
|
+
export function fetchCustomMintableERC20Team(chainId: number, __to: string) {
|
|
101
|
+
const __encodeData = defaultAbiCoder.encode([], []);
|
|
102
|
+
const __data = hexlify(concat(['0x85f2aef2', __encodeData]));
|
|
103
|
+
return contractRequests.batchCall<string>(chainId, __to, __data, ["address"])
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
/**
|
|
107
|
+
* fetch totalSupply
|
|
108
|
+
* @param {number} chainId - number
|
|
109
|
+
* @param {string} __to - string
|
|
110
|
+
* @returns {bigint} __output0 - uint256
|
|
111
|
+
*/
|
|
112
|
+
export function fetchCustomMintableERC20TotalSupply(chainId: number, __to: string) {
|
|
113
|
+
const __encodeData = defaultAbiCoder.encode([], []);
|
|
114
|
+
const __data = hexlify(concat(['0x18160ddd', __encodeData]));
|
|
115
|
+
return contractRequests.batchCall<bigint>(chainId, __to, __data, ["uint256"])
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
/**
|
|
119
|
+
* fetch tradeBurnRatio
|
|
120
|
+
* @param {number} chainId - number
|
|
121
|
+
* @param {string} __to - string
|
|
122
|
+
* @returns {bigint} __output0 - uint256
|
|
123
|
+
*/
|
|
124
|
+
export function fetchCustomMintableERC20TradeBurnRatio(chainId: number, __to: string) {
|
|
125
|
+
const __encodeData = defaultAbiCoder.encode([], []);
|
|
126
|
+
const __data = hexlify(concat(['0xe59850f7', __encodeData]));
|
|
127
|
+
return contractRequests.batchCall<bigint>(chainId, __to, __data, ["uint256"])
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
/**
|
|
131
|
+
* fetch tradeFeeRatio
|
|
132
|
+
* @param {number} chainId - number
|
|
133
|
+
* @param {string} __to - string
|
|
134
|
+
* @returns {bigint} __output0 - uint256
|
|
135
|
+
*/
|
|
136
|
+
export function fetchCustomMintableERC20TradeFeeRatio(chainId: number, __to: string) {
|
|
137
|
+
const __encodeData = defaultAbiCoder.encode([], []);
|
|
138
|
+
const __data = hexlify(concat(['0x870c66d6', __encodeData]));
|
|
139
|
+
return contractRequests.batchCall<bigint>(chainId, __to, __data, ["uint256"])
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
/**
|
|
143
|
+
* encode abandonOwnership
|
|
144
|
+
* @param {string} zeroAddress - address
|
|
145
|
+
* @returns {string} encode data
|
|
146
|
+
*/
|
|
147
|
+
export function encodeCustomMintableERC20AbandonOwnership(zeroAddress: string) {
|
|
148
|
+
const __encodeData = defaultAbiCoder.encode(["address"], [zeroAddress]);
|
|
149
|
+
return hexlify(concat(['0xb4c50ff4', __encodeData]));
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
/**
|
|
153
|
+
* encode approve
|
|
154
|
+
* @param {string} spender - address
|
|
155
|
+
* @param {number} amount - uint256
|
|
156
|
+
* @returns {string} encode data
|
|
157
|
+
*/
|
|
158
|
+
export function encodeCustomMintableERC20Approve(spender: string, amount: number) {
|
|
159
|
+
const __encodeData = defaultAbiCoder.encode(["address","uint256"], [spender,amount]);
|
|
160
|
+
return hexlify(concat(['0x095ea7b3', __encodeData]));
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
/**
|
|
164
|
+
* encode burn
|
|
165
|
+
* @param {number} value - uint256
|
|
166
|
+
* @returns {string} encode data
|
|
167
|
+
*/
|
|
168
|
+
export function encodeCustomMintableERC20Burn(value: number) {
|
|
169
|
+
const __encodeData = defaultAbiCoder.encode(["uint256"], [value]);
|
|
170
|
+
return hexlify(concat(['0x42966c68', __encodeData]));
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
/**
|
|
174
|
+
* encode changeTeamAccount
|
|
175
|
+
* @param {string} newTeam - address
|
|
176
|
+
* @returns {string} encode data
|
|
177
|
+
*/
|
|
178
|
+
export function encodeCustomMintableERC20ChangeTeamAccount(newTeam: string) {
|
|
179
|
+
const __encodeData = defaultAbiCoder.encode(["address"], [newTeam]);
|
|
180
|
+
return hexlify(concat(['0x3a625ee6', __encodeData]));
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
/**
|
|
184
|
+
* encode claimOwnership
|
|
185
|
+
|
|
186
|
+
* @returns {string} encode data
|
|
187
|
+
*/
|
|
188
|
+
export function encodeCustomMintableERC20ClaimOwnership() {
|
|
189
|
+
const __encodeData = defaultAbiCoder.encode([], []);
|
|
190
|
+
return hexlify(concat(['0x4e71e0c8', __encodeData]));
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
/**
|
|
194
|
+
* encode init
|
|
195
|
+
* @param {string} _creator - address
|
|
196
|
+
* @param {number} _initSupply - uint256
|
|
197
|
+
* @param {string} _name - string
|
|
198
|
+
* @param {string} _symbol - string
|
|
199
|
+
* @param {number} _decimals - uint8
|
|
200
|
+
* @param {number} _tradeBurnRatio - uint256
|
|
201
|
+
* @param {number} _tradeFeeRatio - uint256
|
|
202
|
+
* @param {string} _team - address
|
|
203
|
+
* @returns {string} encode data
|
|
204
|
+
*/
|
|
205
|
+
export function encodeCustomMintableERC20Init(_creator: string, _initSupply: number, _name: string, _symbol: string, _decimals: number, _tradeBurnRatio: number, _tradeFeeRatio: number, _team: string) {
|
|
206
|
+
const __encodeData = defaultAbiCoder.encode(["address","uint256","string","string","uint8","uint256","uint256","address"], [_creator,_initSupply,_name,_symbol,_decimals,_tradeBurnRatio,_tradeFeeRatio,_team]);
|
|
207
|
+
return hexlify(concat(['0x4ca60825', __encodeData]));
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
/**
|
|
211
|
+
* encode initOwner
|
|
212
|
+
* @param {string} newOwner - address
|
|
213
|
+
* @returns {string} encode data
|
|
214
|
+
*/
|
|
215
|
+
export function encodeCustomMintableERC20InitOwner(newOwner: string) {
|
|
216
|
+
const __encodeData = defaultAbiCoder.encode(["address"], [newOwner]);
|
|
217
|
+
return hexlify(concat(['0x0d009297', __encodeData]));
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
/**
|
|
221
|
+
* encode mint
|
|
222
|
+
* @param {string} user - address
|
|
223
|
+
* @param {number} value - uint256
|
|
224
|
+
* @returns {string} encode data
|
|
225
|
+
*/
|
|
226
|
+
export function encodeCustomMintableERC20Mint(user: string, value: number) {
|
|
227
|
+
const __encodeData = defaultAbiCoder.encode(["address","uint256"], [user,value]);
|
|
228
|
+
return hexlify(concat(['0x40c10f19', __encodeData]));
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
/**
|
|
232
|
+
* encode transfer
|
|
233
|
+
* @param {string} to - address
|
|
234
|
+
* @param {number} amount - uint256
|
|
235
|
+
* @returns {string} encode data
|
|
236
|
+
*/
|
|
237
|
+
export function encodeCustomMintableERC20Transfer(to: string, amount: number) {
|
|
238
|
+
const __encodeData = defaultAbiCoder.encode(["address","uint256"], [to,amount]);
|
|
239
|
+
return hexlify(concat(['0xa9059cbb', __encodeData]));
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
/**
|
|
243
|
+
* encode transferFrom
|
|
244
|
+
* @param {string} from - address
|
|
245
|
+
* @param {string} to - address
|
|
246
|
+
* @param {number} amount - uint256
|
|
247
|
+
* @returns {string} encode data
|
|
248
|
+
*/
|
|
249
|
+
export function encodeCustomMintableERC20TransferFrom(from: string, to: string, amount: number) {
|
|
250
|
+
const __encodeData = defaultAbiCoder.encode(["address","address","uint256"], [from,to,amount]);
|
|
251
|
+
return hexlify(concat(['0x23b872dd', __encodeData]));
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
/**
|
|
255
|
+
* encode transferOwnership
|
|
256
|
+
* @param {string} newOwner - address
|
|
257
|
+
* @returns {string} encode data
|
|
258
|
+
*/
|
|
259
|
+
export function encodeCustomMintableERC20TransferOwnership(newOwner: string) {
|
|
260
|
+
const __encodeData = defaultAbiCoder.encode(["address"], [newOwner]);
|
|
261
|
+
return hexlify(concat(['0xf2fde38b', __encodeData]));
|
|
262
|
+
}
|
|
@@ -0,0 +1,177 @@
|
|
|
1
|
+
import { defaultAbiCoder, concat, hexlify } from '@dodoex/contract-request';
|
|
2
|
+
|
|
3
|
+
import { contractRequests } from '../contractRequests';
|
|
4
|
+
|
|
5
|
+
export function getD3ProxyContractAddressByChainId(chainId: number) {
|
|
6
|
+
const contractAddressObject = {"1":"0x411ec324598EF53b1E8663e335e9094464523e6B","10":"0xCb3dC90E800C961d4a206BeAAFd92A6d2E06495e","56":"0x8fb36F4CF67EF12Cc0b63CF951ca0b4f9a8F1953","137":"0x1c29eFa924770154fD44569c5B2bF8103feA45A1","42161":"0xbe9ec3C4825D87d77E0F049aA586449cF1d1E31b","43114":"0xa71415675F68f29259ddD63215E5518d2735bf0a","11155111":"0xF0a6A2cEb71Ed90b4E61f15BB36751d9a21eBfB6"};
|
|
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 _D3_VAULT_
|
|
14
|
+
* @param {number} chainId - number
|
|
15
|
+
* @returns {string} __output0 - address
|
|
16
|
+
*/
|
|
17
|
+
export function fetchD3Proxy_D3_VAULT_(chainId: number) {
|
|
18
|
+
const __to = getD3ProxyContractAddressByChainId(chainId);
|
|
19
|
+
|
|
20
|
+
const __encodeData = defaultAbiCoder.encode([], []);
|
|
21
|
+
const __data = hexlify(concat(['0x811a5b9e', __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 fetchD3Proxy_DODO_APPROVE_PROXY_(chainId: number) {
|
|
31
|
+
const __to = getD3ProxyContractAddressByChainId(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 _ETH_ADDRESS_
|
|
40
|
+
* @param {number} chainId - number
|
|
41
|
+
* @returns {string} __output0 - address
|
|
42
|
+
*/
|
|
43
|
+
export function fetchD3Proxy_ETH_ADDRESS_(chainId: number) {
|
|
44
|
+
const __to = getD3ProxyContractAddressByChainId(chainId);
|
|
45
|
+
|
|
46
|
+
const __encodeData = defaultAbiCoder.encode([], []);
|
|
47
|
+
const __data = hexlify(concat(['0xbd2ec319', __encodeData]));
|
|
48
|
+
return contractRequests.batchCall<string>(chainId, __to, __data, ["address"])
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* fetch _WETH_
|
|
53
|
+
* @param {number} chainId - number
|
|
54
|
+
* @returns {string} __output0 - address
|
|
55
|
+
*/
|
|
56
|
+
export function fetchD3Proxy_WETH_(chainId: number) {
|
|
57
|
+
const __to = getD3ProxyContractAddressByChainId(chainId);
|
|
58
|
+
|
|
59
|
+
const __encodeData = defaultAbiCoder.encode([], []);
|
|
60
|
+
const __data = hexlify(concat(['0x0d4eec8f', __encodeData]));
|
|
61
|
+
return contractRequests.batchCall<string>(chainId, __to, __data, ["address"])
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
/**
|
|
65
|
+
* encode buyTokens
|
|
66
|
+
* @param {string} pool - address
|
|
67
|
+
* @param {string} to - address
|
|
68
|
+
* @param {string} fromToken - address
|
|
69
|
+
* @param {string} toToken - address
|
|
70
|
+
* @param {number} quoteAmount - uint256
|
|
71
|
+
* @param {number} maxPayAmount - uint256
|
|
72
|
+
* @param {string} data - bytes
|
|
73
|
+
* @param {number} deadLine - uint256
|
|
74
|
+
* @returns {string} encode data
|
|
75
|
+
*/
|
|
76
|
+
export function encodeD3ProxyBuyTokens(pool: string, to: string, fromToken: string, toToken: string, quoteAmount: number, maxPayAmount: number, data: string, deadLine: number) {
|
|
77
|
+
const __encodeData = defaultAbiCoder.encode(["address","address","address","address","uint256","uint256","bytes","uint256"], [pool,to,fromToken,toToken,quoteAmount,maxPayAmount,data,deadLine]);
|
|
78
|
+
return hexlify(concat(['0xbe223e53', __encodeData]));
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
/**
|
|
82
|
+
* encode d3MMSwapCallBack
|
|
83
|
+
* @param {string} token - address
|
|
84
|
+
* @param {number} value - uint256
|
|
85
|
+
* @param {string} _data - bytes
|
|
86
|
+
* @returns {string} encode data
|
|
87
|
+
*/
|
|
88
|
+
export function encodeD3ProxyD3MMSwapCallBack(token: string, value: number, _data: string) {
|
|
89
|
+
const __encodeData = defaultAbiCoder.encode(["address","uint256","bytes"], [token,value,_data]);
|
|
90
|
+
return hexlify(concat(['0x3e88c8ab', __encodeData]));
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
/**
|
|
94
|
+
* encode makerDeposit
|
|
95
|
+
* @param {string} pool - address
|
|
96
|
+
* @param {string} token - address
|
|
97
|
+
* @param {number} amount - uint256
|
|
98
|
+
* @returns {string} encode data
|
|
99
|
+
*/
|
|
100
|
+
export function encodeD3ProxyMakerDeposit(pool: string, token: string, amount: number) {
|
|
101
|
+
const __encodeData = defaultAbiCoder.encode(["address","address","uint256"], [pool,token,amount]);
|
|
102
|
+
return hexlify(concat(['0x1f03c7c3', __encodeData]));
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
/**
|
|
106
|
+
* encode multicall
|
|
107
|
+
* @param {Array<string>} data - bytes[]
|
|
108
|
+
* @returns {string} encode data
|
|
109
|
+
*/
|
|
110
|
+
export function encodeD3ProxyMulticall(data: Array<string>) {
|
|
111
|
+
const __encodeData = defaultAbiCoder.encode(["bytes[]"], [data]);
|
|
112
|
+
return hexlify(concat(['0xac9650d8', __encodeData]));
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
/**
|
|
116
|
+
* encode refundETH
|
|
117
|
+
|
|
118
|
+
* @returns {string} encode data
|
|
119
|
+
*/
|
|
120
|
+
export function encodeD3ProxyRefundETH() {
|
|
121
|
+
const __encodeData = defaultAbiCoder.encode([], []);
|
|
122
|
+
return hexlify(concat(['0x12210e8a', __encodeData]));
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
/**
|
|
126
|
+
* encode sellTokens
|
|
127
|
+
* @param {string} pool - address
|
|
128
|
+
* @param {string} to - address
|
|
129
|
+
* @param {string} fromToken - address
|
|
130
|
+
* @param {string} toToken - address
|
|
131
|
+
* @param {number} fromAmount - uint256
|
|
132
|
+
* @param {number} minReceiveAmount - uint256
|
|
133
|
+
* @param {string} data - bytes
|
|
134
|
+
* @param {number} deadLine - uint256
|
|
135
|
+
* @returns {string} encode data
|
|
136
|
+
*/
|
|
137
|
+
export function encodeD3ProxySellTokens(pool: string, to: string, fromToken: string, toToken: string, fromAmount: number, minReceiveAmount: number, data: string, deadLine: number) {
|
|
138
|
+
const __encodeData = defaultAbiCoder.encode(["address","address","address","address","uint256","uint256","bytes","uint256"], [pool,to,fromToken,toToken,fromAmount,minReceiveAmount,data,deadLine]);
|
|
139
|
+
return hexlify(concat(['0x1d16bc3e', __encodeData]));
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
/**
|
|
143
|
+
* encode userDeposit
|
|
144
|
+
* @param {string} user - address
|
|
145
|
+
* @param {string} token - address
|
|
146
|
+
* @param {number} amount - uint256
|
|
147
|
+
* @param {number} minDtokenAmount - uint256
|
|
148
|
+
* @returns {string} encode data
|
|
149
|
+
*/
|
|
150
|
+
export function encodeD3ProxyUserDeposit(user: string, token: string, amount: number, minDtokenAmount: number) {
|
|
151
|
+
const __encodeData = defaultAbiCoder.encode(["address","address","uint256","uint256"], [user,token,amount,minDtokenAmount]);
|
|
152
|
+
return hexlify(concat(['0xf2f01e47', __encodeData]));
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
/**
|
|
156
|
+
* encode userWithdraw
|
|
157
|
+
* @param {string} to - address
|
|
158
|
+
* @param {string} token - address
|
|
159
|
+
* @param {number} dTokenAmount - uint256
|
|
160
|
+
* @param {number} minReceiveAmount - uint256
|
|
161
|
+
* @returns {string} encode data
|
|
162
|
+
*/
|
|
163
|
+
export function encodeD3ProxyUserWithdraw(to: string, token: string, dTokenAmount: number, minReceiveAmount: number) {
|
|
164
|
+
const __encodeData = defaultAbiCoder.encode(["address","address","uint256","uint256"], [to,token,dTokenAmount,minReceiveAmount]);
|
|
165
|
+
return hexlify(concat(['0x5fff4847', __encodeData]));
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
/**
|
|
169
|
+
* encode withdrawWETH
|
|
170
|
+
* @param {string} to - address
|
|
171
|
+
* @param {number} minAmount - uint256
|
|
172
|
+
* @returns {string} encode data
|
|
173
|
+
*/
|
|
174
|
+
export function encodeD3ProxyWithdrawWETH(to: string, minAmount: number) {
|
|
175
|
+
const __encodeData = defaultAbiCoder.encode(["address","uint256"], [to,minAmount]);
|
|
176
|
+
return hexlify(concat(['0x93113b5c', __encodeData]));
|
|
177
|
+
}
|