@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,309 @@
|
|
|
1
|
+
export declare function getVDODOTokenContractAddressByChainId(chainId: number): string;
|
|
2
|
+
/**
|
|
3
|
+
* fetch _CAN_TRANSFER_
|
|
4
|
+
* @param {number} chainId - number
|
|
5
|
+
* @returns {boolean} __output0 - bool
|
|
6
|
+
*/
|
|
7
|
+
export declare function fetchVDODOToken_CAN_TRANSFER_(chainId: number): Promise<boolean>;
|
|
8
|
+
/**
|
|
9
|
+
* fetch _DODO_APPROVE_PROXY_
|
|
10
|
+
* @param {number} chainId - number
|
|
11
|
+
* @returns {string} __output0 - address
|
|
12
|
+
*/
|
|
13
|
+
export declare function fetchVDODOToken_DODO_APPROVE_PROXY_(chainId: number): Promise<string>;
|
|
14
|
+
/**
|
|
15
|
+
* fetch _DODO_CIRCULATION_HELPER_
|
|
16
|
+
* @param {number} chainId - number
|
|
17
|
+
* @returns {string} __output0 - address
|
|
18
|
+
*/
|
|
19
|
+
export declare function fetchVDODOToken_DODO_CIRCULATION_HELPER_(chainId: number): Promise<string>;
|
|
20
|
+
/**
|
|
21
|
+
* fetch _DODO_FEE_BURN_RATIO_
|
|
22
|
+
* @param {number} chainId - number
|
|
23
|
+
* @returns {bigint} __output0 - uint256
|
|
24
|
+
*/
|
|
25
|
+
export declare function fetchVDODOToken_DODO_FEE_BURN_RATIO_(chainId: number): Promise<bigint>;
|
|
26
|
+
/**
|
|
27
|
+
* fetch _DODO_PER_BLOCK_
|
|
28
|
+
* @param {number} chainId - number
|
|
29
|
+
* @returns {bigint} __output0 - uint256
|
|
30
|
+
*/
|
|
31
|
+
export declare function fetchVDODOToken_DODO_PER_BLOCK_(chainId: number): Promise<bigint>;
|
|
32
|
+
/**
|
|
33
|
+
* fetch _DODO_RATIO_
|
|
34
|
+
* @param {number} chainId - number
|
|
35
|
+
* @returns {bigint} __output0 - uint256
|
|
36
|
+
*/
|
|
37
|
+
export declare function fetchVDODOToken_DODO_RATIO_(chainId: number): Promise<bigint>;
|
|
38
|
+
/**
|
|
39
|
+
* fetch _DODO_TEAM_
|
|
40
|
+
* @param {number} chainId - number
|
|
41
|
+
* @returns {string} __output0 - address
|
|
42
|
+
*/
|
|
43
|
+
export declare function fetchVDODOToken_DODO_TEAM_(chainId: number): Promise<string>;
|
|
44
|
+
/**
|
|
45
|
+
* fetch _DODO_TOKEN_
|
|
46
|
+
* @param {number} chainId - number
|
|
47
|
+
* @returns {string} __output0 - address
|
|
48
|
+
*/
|
|
49
|
+
export declare function fetchVDODOToken_DODO_TOKEN_(chainId: number): Promise<string>;
|
|
50
|
+
/**
|
|
51
|
+
* fetch _DOOD_GOV_
|
|
52
|
+
* @param {number} chainId - number
|
|
53
|
+
* @returns {string} __output0 - address
|
|
54
|
+
*/
|
|
55
|
+
export declare function fetchVDODOToken_DOOD_GOV_(chainId: number): Promise<string>;
|
|
56
|
+
/**
|
|
57
|
+
* fetch _LAST_REWARD_BLOCK_
|
|
58
|
+
* @param {number} chainId - number
|
|
59
|
+
* @returns {bigint} __output0 - uint32
|
|
60
|
+
*/
|
|
61
|
+
export declare function fetchVDODOToken_LAST_REWARD_BLOCK_(chainId: number): Promise<bigint>;
|
|
62
|
+
/**
|
|
63
|
+
* fetch _NEW_OWNER_
|
|
64
|
+
* @param {number} chainId - number
|
|
65
|
+
* @returns {string} __output0 - address
|
|
66
|
+
*/
|
|
67
|
+
export declare function fetchVDODOToken_NEW_OWNER_(chainId: number): Promise<string>;
|
|
68
|
+
/**
|
|
69
|
+
* fetch _OWNER_
|
|
70
|
+
* @param {number} chainId - number
|
|
71
|
+
* @returns {string} __output0 - address
|
|
72
|
+
*/
|
|
73
|
+
export declare function fetchVDODOToken_OWNER_(chainId: number): Promise<string>;
|
|
74
|
+
/**
|
|
75
|
+
* fetch _SUPERIOR_RATIO_
|
|
76
|
+
* @param {number} chainId - number
|
|
77
|
+
* @returns {bigint} __output0 - uint256
|
|
78
|
+
*/
|
|
79
|
+
export declare function fetchVDODOToken_SUPERIOR_RATIO_(chainId: number): Promise<bigint>;
|
|
80
|
+
/**
|
|
81
|
+
* fetch _TOTAL_BLOCK_DISTRIBUTION_
|
|
82
|
+
* @param {number} chainId - number
|
|
83
|
+
* @returns {bigint} __output0 - uint112
|
|
84
|
+
*/
|
|
85
|
+
export declare function fetchVDODOToken_TOTAL_BLOCK_DISTRIBUTION_(chainId: number): Promise<bigint>;
|
|
86
|
+
/**
|
|
87
|
+
* fetch _TOTAL_BLOCK_REWARD_
|
|
88
|
+
* @param {number} chainId - number
|
|
89
|
+
* @returns {bigint} __output0 - uint256
|
|
90
|
+
*/
|
|
91
|
+
export declare function fetchVDODOToken_TOTAL_BLOCK_REWARD_(chainId: number): Promise<bigint>;
|
|
92
|
+
/**
|
|
93
|
+
* fetch _TOTAL_STAKING_POWER_
|
|
94
|
+
* @param {number} chainId - number
|
|
95
|
+
* @returns {bigint} __output0 - uint256
|
|
96
|
+
*/
|
|
97
|
+
export declare function fetchVDODOToken_TOTAL_STAKING_POWER_(chainId: number): Promise<bigint>;
|
|
98
|
+
/**
|
|
99
|
+
* fetch allowance
|
|
100
|
+
* @param {number} chainId - number
|
|
101
|
+
* @param {string} owner - address
|
|
102
|
+
* @param {string} spender - address
|
|
103
|
+
* @returns {bigint} __output0 - uint256
|
|
104
|
+
*/
|
|
105
|
+
export declare function fetchVDODOTokenAllowance(chainId: number, owner: string, spender: string): Promise<bigint>;
|
|
106
|
+
/**
|
|
107
|
+
* fetch alpha
|
|
108
|
+
* @param {number} chainId - number
|
|
109
|
+
* @returns {bigint} __output0 - uint112
|
|
110
|
+
*/
|
|
111
|
+
export declare function fetchVDODOTokenAlpha(chainId: number): Promise<bigint>;
|
|
112
|
+
/**
|
|
113
|
+
* fetch availableBalanceOf
|
|
114
|
+
* @param {number} chainId - number
|
|
115
|
+
* @param {string} account - address
|
|
116
|
+
* @returns {bigint} vDODOAmount - uint256
|
|
117
|
+
*/
|
|
118
|
+
export declare function fetchVDODOTokenAvailableBalanceOf(chainId: number, account: string): Promise<bigint>;
|
|
119
|
+
/**
|
|
120
|
+
* fetch balanceOf
|
|
121
|
+
* @param {number} chainId - number
|
|
122
|
+
* @param {string} account - address
|
|
123
|
+
* @returns {bigint} vDODOAmount - uint256
|
|
124
|
+
*/
|
|
125
|
+
export declare function fetchVDODOTokenBalanceOf(chainId: number, account: string): Promise<bigint>;
|
|
126
|
+
/**
|
|
127
|
+
* fetch decimals
|
|
128
|
+
* @param {number} chainId - number
|
|
129
|
+
* @returns {bigint} __output0 - uint8
|
|
130
|
+
*/
|
|
131
|
+
export declare function fetchVDODOTokenDecimals(chainId: number): Promise<bigint>;
|
|
132
|
+
/**
|
|
133
|
+
* fetch dodoBalanceOf
|
|
134
|
+
* @param {number} chainId - number
|
|
135
|
+
* @param {string} account - address
|
|
136
|
+
* @returns {bigint} dodoAmount - uint256
|
|
137
|
+
*/
|
|
138
|
+
export declare function fetchVDODOTokenDodoBalanceOf(chainId: number, account: string): Promise<bigint>;
|
|
139
|
+
/**
|
|
140
|
+
* fetch getDODOWithdrawFeeRatio
|
|
141
|
+
* @param {number} chainId - number
|
|
142
|
+
* @returns {bigint} feeRatio - uint256
|
|
143
|
+
*/
|
|
144
|
+
export declare function fetchVDODOTokenGetDODOWithdrawFeeRatio(chainId: number): Promise<bigint>;
|
|
145
|
+
/**
|
|
146
|
+
* fetch getLatestAlpha
|
|
147
|
+
* @param {number} chainId - number
|
|
148
|
+
* @returns {bigint} newAlpha - uint256
|
|
149
|
+
* @returns {bigint} curDistribution - uint256
|
|
150
|
+
*/
|
|
151
|
+
export declare function fetchVDODOTokenGetLatestAlpha(chainId: number): Promise<{
|
|
152
|
+
newAlpha: bigint;
|
|
153
|
+
curDistribution: bigint;
|
|
154
|
+
}>;
|
|
155
|
+
/**
|
|
156
|
+
* fetch getSuperior
|
|
157
|
+
* @param {number} chainId - number
|
|
158
|
+
* @param {string} account - address
|
|
159
|
+
* @returns {string} superior - address
|
|
160
|
+
*/
|
|
161
|
+
export declare function fetchVDODOTokenGetSuperior(chainId: number, account: string): Promise<string>;
|
|
162
|
+
/**
|
|
163
|
+
* fetch getWithdrawResult
|
|
164
|
+
* @param {number} chainId - number
|
|
165
|
+
* @param {number} dodoAmount - uint256
|
|
166
|
+
* @returns {bigint} dodoReceive - uint256
|
|
167
|
+
* @returns {bigint} burnDodoAmount - uint256
|
|
168
|
+
* @returns {bigint} withdrawFeeDodoAmount - uint256
|
|
169
|
+
*/
|
|
170
|
+
export declare function fetchVDODOTokenGetWithdrawResult(chainId: number, dodoAmount: number): Promise<{
|
|
171
|
+
dodoReceive: bigint;
|
|
172
|
+
burnDodoAmount: bigint;
|
|
173
|
+
withdrawFeeDodoAmount: bigint;
|
|
174
|
+
}>;
|
|
175
|
+
/**
|
|
176
|
+
* fetch name
|
|
177
|
+
* @param {number} chainId - number
|
|
178
|
+
* @returns {string} __output0 - string
|
|
179
|
+
*/
|
|
180
|
+
export declare function fetchVDODOTokenName(chainId: number): Promise<string>;
|
|
181
|
+
/**
|
|
182
|
+
* fetch symbol
|
|
183
|
+
* @param {number} chainId - number
|
|
184
|
+
* @returns {string} __output0 - string
|
|
185
|
+
*/
|
|
186
|
+
export declare function fetchVDODOTokenSymbol(chainId: number): Promise<string>;
|
|
187
|
+
/**
|
|
188
|
+
* fetch totalSupply
|
|
189
|
+
* @param {number} chainId - number
|
|
190
|
+
* @returns {bigint} vDODOSupply - uint256
|
|
191
|
+
*/
|
|
192
|
+
export declare function fetchVDODOTokenTotalSupply(chainId: number): Promise<bigint>;
|
|
193
|
+
/**
|
|
194
|
+
* fetch userInfo
|
|
195
|
+
* @param {number} chainId - number
|
|
196
|
+
* @param {string} __input1 - address
|
|
197
|
+
* @returns {bigint} stakingPower - uint128
|
|
198
|
+
* @returns {bigint} superiorSP - uint128
|
|
199
|
+
* @returns {string} superior - address
|
|
200
|
+
* @returns {bigint} credit - uint256
|
|
201
|
+
*/
|
|
202
|
+
export declare function fetchVDODOTokenUserInfo(chainId: number, __input1: string): Promise<{
|
|
203
|
+
stakingPower: bigint;
|
|
204
|
+
superiorSP: bigint;
|
|
205
|
+
superior: string;
|
|
206
|
+
credit: bigint;
|
|
207
|
+
}>;
|
|
208
|
+
/**
|
|
209
|
+
* encode approve
|
|
210
|
+
* @param {string} spender - address
|
|
211
|
+
* @param {number} vDODOAmount - uint256
|
|
212
|
+
* @returns {string} encode data
|
|
213
|
+
*/
|
|
214
|
+
export declare function encodeVDODOTokenApprove(spender: string, vDODOAmount: number): string;
|
|
215
|
+
/**
|
|
216
|
+
* encode changePerReward
|
|
217
|
+
* @param {number} dodoPerBlock - uint256
|
|
218
|
+
* @returns {string} encode data
|
|
219
|
+
*/
|
|
220
|
+
export declare function encodeVDODOTokenChangePerReward(dodoPerBlock: number): string;
|
|
221
|
+
/**
|
|
222
|
+
* encode claimOwnership
|
|
223
|
+
|
|
224
|
+
* @returns {string} encode data
|
|
225
|
+
*/
|
|
226
|
+
export declare function encodeVDODOTokenClaimOwnership(): string;
|
|
227
|
+
/**
|
|
228
|
+
* encode donate
|
|
229
|
+
* @param {number} dodoAmount - uint256
|
|
230
|
+
* @returns {string} encode data
|
|
231
|
+
*/
|
|
232
|
+
export declare function encodeVDODOTokenDonate(dodoAmount: number): string;
|
|
233
|
+
/**
|
|
234
|
+
* encode emergencyWithdraw
|
|
235
|
+
|
|
236
|
+
* @returns {string} encode data
|
|
237
|
+
*/
|
|
238
|
+
export declare function encodeVDODOTokenEmergencyWithdraw(): string;
|
|
239
|
+
/**
|
|
240
|
+
* encode initOwner
|
|
241
|
+
* @param {string} newOwner - address
|
|
242
|
+
* @returns {string} encode data
|
|
243
|
+
*/
|
|
244
|
+
export declare function encodeVDODOTokenInitOwner(newOwner: string): string;
|
|
245
|
+
/**
|
|
246
|
+
* encode mint
|
|
247
|
+
* @param {number} dodoAmount - uint256
|
|
248
|
+
* @param {string} superiorAddress - address
|
|
249
|
+
* @returns {string} encode data
|
|
250
|
+
*/
|
|
251
|
+
export declare function encodeVDODOTokenMint(dodoAmount: number, superiorAddress: string): string;
|
|
252
|
+
/**
|
|
253
|
+
* encode preDepositedBlockReward
|
|
254
|
+
* @param {number} dodoAmount - uint256
|
|
255
|
+
* @returns {string} encode data
|
|
256
|
+
*/
|
|
257
|
+
export declare function encodeVDODOTokenPreDepositedBlockReward(dodoAmount: number): string;
|
|
258
|
+
/**
|
|
259
|
+
* encode redeem
|
|
260
|
+
* @param {number} vdodoAmount - uint256
|
|
261
|
+
* @param {boolean} all - bool
|
|
262
|
+
* @returns {string} encode data
|
|
263
|
+
*/
|
|
264
|
+
export declare function encodeVDODOTokenRedeem(vdodoAmount: number, all: boolean): string;
|
|
265
|
+
/**
|
|
266
|
+
* encode setCantransfer
|
|
267
|
+
* @param {boolean} allowed - bool
|
|
268
|
+
* @returns {string} encode data
|
|
269
|
+
*/
|
|
270
|
+
export declare function encodeVDODOTokenSetCantransfer(allowed: boolean): string;
|
|
271
|
+
/**
|
|
272
|
+
* encode transfer
|
|
273
|
+
* @param {string} to - address
|
|
274
|
+
* @param {number} vDODOAmount - uint256
|
|
275
|
+
* @returns {string} encode data
|
|
276
|
+
*/
|
|
277
|
+
export declare function encodeVDODOTokenTransfer(to: string, vDODOAmount: number): string;
|
|
278
|
+
/**
|
|
279
|
+
* encode transferFrom
|
|
280
|
+
* @param {string} from - address
|
|
281
|
+
* @param {string} to - address
|
|
282
|
+
* @param {number} vDODOAmount - uint256
|
|
283
|
+
* @returns {string} encode data
|
|
284
|
+
*/
|
|
285
|
+
export declare function encodeVDODOTokenTransferFrom(from: string, to: string, vDODOAmount: number): string;
|
|
286
|
+
/**
|
|
287
|
+
* encode transferOwnership
|
|
288
|
+
* @param {string} newOwner - address
|
|
289
|
+
* @returns {string} encode data
|
|
290
|
+
*/
|
|
291
|
+
export declare function encodeVDODOTokenTransferOwnership(newOwner: string): string;
|
|
292
|
+
/**
|
|
293
|
+
* encode updateDODOCirculationHelper
|
|
294
|
+
* @param {string} helper - address
|
|
295
|
+
* @returns {string} encode data
|
|
296
|
+
*/
|
|
297
|
+
export declare function encodeVDODOTokenUpdateDODOCirculationHelper(helper: string): string;
|
|
298
|
+
/**
|
|
299
|
+
* encode updateDODOFeeBurnRatio
|
|
300
|
+
* @param {number} dodoFeeBurnRatio - uint256
|
|
301
|
+
* @returns {string} encode data
|
|
302
|
+
*/
|
|
303
|
+
export declare function encodeVDODOTokenUpdateDODOFeeBurnRatio(dodoFeeBurnRatio: number): string;
|
|
304
|
+
/**
|
|
305
|
+
* encode updateGovernance
|
|
306
|
+
* @param {string} governance - address
|
|
307
|
+
* @returns {string} encode data
|
|
308
|
+
*/
|
|
309
|
+
export declare function encodeVDODOTokenUpdateGovernance(governance: string): string;
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
export { setContractRequests } from './contractRequests';
|
|
2
|
+
export * from './contract/BuyoutModel';
|
|
3
|
+
export * from './contract/CP';
|
|
4
|
+
export * from './contract/CloneFactory';
|
|
5
|
+
export * from './contract/CrowdPoolingFactory';
|
|
6
|
+
export * from './contract/CustomERC20';
|
|
7
|
+
export * from './contract/CustomMintableERC20';
|
|
8
|
+
export * from './contract/D3Proxy';
|
|
9
|
+
export * from './contract/D3Vault';
|
|
10
|
+
export * from './contract/DODOApprove';
|
|
11
|
+
export * from './contract/DODOApproveProxy';
|
|
12
|
+
export * from './contract/DODOCalleeHelper';
|
|
13
|
+
export * from './contract/DODOCirculationHelper';
|
|
14
|
+
export * from './contract/DODOCpProxy';
|
|
15
|
+
export * from './contract/DODOCpProxyWithoutGlobalQuota';
|
|
16
|
+
export * from './contract/DODODppProxy';
|
|
17
|
+
export * from './contract/DODODspProxy';
|
|
18
|
+
export * from './contract/DODODspProxyWithoutGSP';
|
|
19
|
+
export * from './contract/DODOIncentive';
|
|
20
|
+
export * from './contract/DODOMineV2Factory';
|
|
21
|
+
export * from './contract/DODOMineV3Proxy';
|
|
22
|
+
export * from './contract/DODOMineV3ProxyWithoutPlatform';
|
|
23
|
+
export * from './contract/DODOMineV3Registry';
|
|
24
|
+
export * from './contract/DODONFT';
|
|
25
|
+
export * from './contract/DODONFT1155';
|
|
26
|
+
export * from './contract/DODONFTApprove';
|
|
27
|
+
export * from './contract/DODONFTPoolProxy';
|
|
28
|
+
export * from './contract/DODONFTProxy';
|
|
29
|
+
export * from './contract/DODONFTRegistry';
|
|
30
|
+
export * from './contract/DODONFTRouteHelper';
|
|
31
|
+
export * from './contract/DODOSellHelper';
|
|
32
|
+
export * from './contract/DODOStarterProxy';
|
|
33
|
+
export * from './contract/DODOV1';
|
|
34
|
+
export * from './contract/DODOV1Adapter';
|
|
35
|
+
export * from './contract/DODOV1PmmHelper';
|
|
36
|
+
export * from './contract/DODOV1Proxy';
|
|
37
|
+
export * from './contract/DODOV2Proxy02';
|
|
38
|
+
export * from './contract/DODOV2RouteHelper';
|
|
39
|
+
export * from './contract/DPPAdvanced';
|
|
40
|
+
export * from './contract/DPPAdvancedAdmin';
|
|
41
|
+
export * from './contract/DPPFactory';
|
|
42
|
+
export * from './contract/DSP';
|
|
43
|
+
export * from './contract/DSPFactory';
|
|
44
|
+
export * from './contract/DVM';
|
|
45
|
+
export * from './contract/DVMFactory';
|
|
46
|
+
export * from './contract/ERC20';
|
|
47
|
+
export * from './contract/ERC20Helper';
|
|
48
|
+
export * from './contract/ERC20MineV3';
|
|
49
|
+
export * from './contract/ERC20V3Factory';
|
|
50
|
+
export * from './contract/FeeRateDIP3Impl';
|
|
51
|
+
export * from './contract/FeeRateModel';
|
|
52
|
+
export * from './contract/GSP';
|
|
53
|
+
export * from './contract/GSPFactory';
|
|
54
|
+
export * from './contract/InitializableERC20';
|
|
55
|
+
export * from './contract/LimitOrder';
|
|
56
|
+
export * from './contract/LimitOrderBot';
|
|
57
|
+
export * from './contract/MulticallWithValid';
|
|
58
|
+
export * from './contract/PermissionManager';
|
|
59
|
+
export * from './contract/dodoTeam';
|
|
60
|
+
export * from './contract/vDODOToken';
|
package/package.json
ADDED
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@dodoex/dodo-contract-request",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "",
|
|
5
|
+
"source": "src/index.ts",
|
|
6
|
+
"main": "dist/index.js",
|
|
7
|
+
"types": "./dist/types/index.d.ts",
|
|
8
|
+
"scripts": {
|
|
9
|
+
"build": "rollup --config",
|
|
10
|
+
"contract:generate": "export $(cat .env | xargs) && env tsx scripts/contract-generate",
|
|
11
|
+
"prerelease": "yarn run build",
|
|
12
|
+
"release": "semantic-release",
|
|
13
|
+
"type-check": "tsc --noEmit"
|
|
14
|
+
},
|
|
15
|
+
"exports": {
|
|
16
|
+
".": {
|
|
17
|
+
"types": "./dist/types/index.d.ts",
|
|
18
|
+
"default": "./dist/index.js"
|
|
19
|
+
},
|
|
20
|
+
"./config": {
|
|
21
|
+
"types": "./dist/types/config/index.d.ts",
|
|
22
|
+
"default": "./dist/config.js"
|
|
23
|
+
}
|
|
24
|
+
},
|
|
25
|
+
"author": "",
|
|
26
|
+
"license": "ISC",
|
|
27
|
+
"devDependencies": {
|
|
28
|
+
"@babel/core": "^7.26.0",
|
|
29
|
+
"@babel/preset-env": "^7.26.0",
|
|
30
|
+
"@babel/preset-typescript": "^7.26.0",
|
|
31
|
+
"@rollup/plugin-babel": "^6.0.4",
|
|
32
|
+
"@rollup/plugin-commonjs": "^28.0.1",
|
|
33
|
+
"@rollup/plugin-terser": "^0.4.4",
|
|
34
|
+
"@rollup/plugin-typescript": "^12.1.1",
|
|
35
|
+
"rollup-plugin-clear": "^2.0.7",
|
|
36
|
+
"tsx": "^4.19.1"
|
|
37
|
+
},
|
|
38
|
+
"dependencies": {
|
|
39
|
+
"typescript": "^5"
|
|
40
|
+
}
|
|
41
|
+
}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import commonjs from '@rollup/plugin-commonjs';
|
|
2
|
+
import typescript from '@rollup/plugin-typescript';
|
|
3
|
+
import terser from '@rollup/plugin-terser';
|
|
4
|
+
import pkg from './package.json' with { type: 'json' };
|
|
5
|
+
import clear from 'rollup-plugin-clear';
|
|
6
|
+
import { babel } from '@rollup/plugin-babel';
|
|
7
|
+
|
|
8
|
+
const extensions = ['.js', '.ts'];
|
|
9
|
+
const baseConfig = {
|
|
10
|
+
input: pkg.source,
|
|
11
|
+
plugins: [
|
|
12
|
+
typescript(),
|
|
13
|
+
commonjs(),
|
|
14
|
+
babel({
|
|
15
|
+
extensions,
|
|
16
|
+
babelHelpers: 'bundled',
|
|
17
|
+
}),
|
|
18
|
+
clear({
|
|
19
|
+
// required, point out which directories should be clear.
|
|
20
|
+
targets: ['dist'],
|
|
21
|
+
// optional, whether clear the directores when rollup recompile on --watch mode.
|
|
22
|
+
watch: true, // default: false
|
|
23
|
+
}),
|
|
24
|
+
],
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
export default [
|
|
28
|
+
{
|
|
29
|
+
...baseConfig,
|
|
30
|
+
output: [
|
|
31
|
+
{
|
|
32
|
+
dir: 'dist',
|
|
33
|
+
format: 'es',
|
|
34
|
+
plugins: [terser()],
|
|
35
|
+
},
|
|
36
|
+
],
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
...baseConfig,
|
|
40
|
+
input: 'src/config/index.ts',
|
|
41
|
+
output: [
|
|
42
|
+
{
|
|
43
|
+
dir: 'dist',
|
|
44
|
+
format: 'es',
|
|
45
|
+
entryFileNames: 'config.js',
|
|
46
|
+
chunkFileNames: 'config-[hash].js',
|
|
47
|
+
plugins: [terser()],
|
|
48
|
+
},
|
|
49
|
+
],
|
|
50
|
+
},
|
|
51
|
+
];
|
|
@@ -0,0 +1,192 @@
|
|
|
1
|
+
import { ContractRequests } from '@dodoex/contract-request';
|
|
2
|
+
import {
|
|
3
|
+
ContractCallGenerate,
|
|
4
|
+
ContractCodeGenerateParameters,
|
|
5
|
+
} from '@dodoex/contract-call-generate';
|
|
6
|
+
import path from 'path';
|
|
7
|
+
import fs from 'fs';
|
|
8
|
+
import fsExtra from 'fs-extra';
|
|
9
|
+
|
|
10
|
+
const CONTRACT_CONFIG_DIR = path.join(path.resolve(), 'contract-config');
|
|
11
|
+
const OUTPUT_BASE_DIR = path.join(path.resolve(), 'src');
|
|
12
|
+
const CONTRACT_FUNCTION_FILENAME = 'contract';
|
|
13
|
+
const CONTRACT_ADDRESS_FILENAME = 'config';
|
|
14
|
+
const OUTPUT_CONTRACT_FUNCTION_DIR = path.join(
|
|
15
|
+
OUTPUT_BASE_DIR,
|
|
16
|
+
CONTRACT_FUNCTION_FILENAME,
|
|
17
|
+
);
|
|
18
|
+
const OUTPUT_CONTRACT_ADDRESS_DIR = path.join(
|
|
19
|
+
OUTPUT_BASE_DIR,
|
|
20
|
+
CONTRACT_ADDRESS_FILENAME,
|
|
21
|
+
);
|
|
22
|
+
const OUTPUT_CONTRACT_ADDRESS_FILE = path.join(
|
|
23
|
+
OUTPUT_CONTRACT_ADDRESS_DIR,
|
|
24
|
+
'index.ts',
|
|
25
|
+
);
|
|
26
|
+
const OUTPUT_FILE = path.join(path.resolve(), 'src/index.ts');
|
|
27
|
+
const EXCLUDE_CONFIG_KEYS = ['ChainId', 'Chain', 'Account'];
|
|
28
|
+
const DYNAMIC_CONFIG_KEYS = ['Templates'];
|
|
29
|
+
|
|
30
|
+
type ChainIdAndNameObject = {
|
|
31
|
+
[chainId: string]: string;
|
|
32
|
+
};
|
|
33
|
+
type ContractConfig = {
|
|
34
|
+
[key: string]: string;
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
async function main() {
|
|
38
|
+
const {
|
|
39
|
+
chainIdAndNameObject,
|
|
40
|
+
contractAddressData,
|
|
41
|
+
dynamicContractAddressData,
|
|
42
|
+
} = getConfig();
|
|
43
|
+
const etherscanAPIkey = process.env.ETHERSCAN_API_KEY;
|
|
44
|
+
if (!etherscanAPIkey) {
|
|
45
|
+
throw new Error('ETHERSCAN_API_KEY is undefined');
|
|
46
|
+
}
|
|
47
|
+
const contractCallGenerate = new ContractCallGenerate({
|
|
48
|
+
etherscanAPIkey,
|
|
49
|
+
contractAddressData,
|
|
50
|
+
dynamicContractAddressData,
|
|
51
|
+
contractRequests: new ContractRequests(),
|
|
52
|
+
fetchSecondLimit: 5,
|
|
53
|
+
});
|
|
54
|
+
await contractCallGenerate.generate(OUTPUT_CONTRACT_FUNCTION_DIR);
|
|
55
|
+
generateContractAddressConfig(chainIdAndNameObject, contractAddressData);
|
|
56
|
+
generateExportCode();
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
function getConfig() {
|
|
60
|
+
const contractAddressData =
|
|
61
|
+
{} as ContractCodeGenerateParameters['contractAddressData'];
|
|
62
|
+
const dynamicContractAddressData =
|
|
63
|
+
{} as ContractCodeGenerateParameters['dynamicContractAddressData'];
|
|
64
|
+
const chainIdAndNameObject = {} as ChainIdAndNameObject;
|
|
65
|
+
fs.readdirSync(CONTRACT_CONFIG_DIR).forEach((fileName) => {
|
|
66
|
+
const config = fsExtra.readJSONSync(
|
|
67
|
+
path.join(CONTRACT_CONFIG_DIR, fileName),
|
|
68
|
+
);
|
|
69
|
+
const chainId = config.ChainId;
|
|
70
|
+
chainIdAndNameObject[chainId] = config.Chain;
|
|
71
|
+
const currentContractAddressData = {} as ContractConfig;
|
|
72
|
+
const currentDynamicContractAddressData = {} as ContractConfig;
|
|
73
|
+
Object.entries(config).forEach(([key, value]: [string, any]) => {
|
|
74
|
+
if (EXCLUDE_CONFIG_KEYS.includes(key)) return;
|
|
75
|
+
if (DYNAMIC_CONFIG_KEYS.includes(key)) {
|
|
76
|
+
assignConfig(currentDynamicContractAddressData, value);
|
|
77
|
+
return;
|
|
78
|
+
}
|
|
79
|
+
if (key === 'Token') {
|
|
80
|
+
if (value.WETH) {
|
|
81
|
+
currentDynamicContractAddressData.ERC20 = value.WETH;
|
|
82
|
+
}
|
|
83
|
+
if (value.vDODOToken) {
|
|
84
|
+
currentContractAddressData.vDODOToken = value.vDODOToken;
|
|
85
|
+
}
|
|
86
|
+
return;
|
|
87
|
+
}
|
|
88
|
+
assignConfig(currentContractAddressData, value);
|
|
89
|
+
});
|
|
90
|
+
if (Object.keys(currentContractAddressData).length) {
|
|
91
|
+
contractAddressData[chainId] = currentContractAddressData;
|
|
92
|
+
}
|
|
93
|
+
if (Object.keys(currentDynamicContractAddressData).length) {
|
|
94
|
+
dynamicContractAddressData[chainId] = currentDynamicContractAddressData;
|
|
95
|
+
}
|
|
96
|
+
});
|
|
97
|
+
|
|
98
|
+
return {
|
|
99
|
+
chainIdAndNameObject,
|
|
100
|
+
contractAddressData,
|
|
101
|
+
dynamicContractAddressData,
|
|
102
|
+
};
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
function assignConfig(target: ContractConfig, source: ContractConfig) {
|
|
106
|
+
if (source) {
|
|
107
|
+
Object.entries(source).forEach(([key, value]) => {
|
|
108
|
+
if (value) {
|
|
109
|
+
if (target[key]) {
|
|
110
|
+
console.log(`Warn: Duplicate configuration key: ${key}`);
|
|
111
|
+
}
|
|
112
|
+
target[key] = value;
|
|
113
|
+
}
|
|
114
|
+
});
|
|
115
|
+
}
|
|
116
|
+
return target;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
function generateContractAddressConfig(
|
|
120
|
+
chainIdAndNameObject: ChainIdAndNameObject,
|
|
121
|
+
contractAddressData: ContractCodeGenerateParameters['contractAddressData'],
|
|
122
|
+
) {
|
|
123
|
+
let multiCallAddressObject = {};
|
|
124
|
+
const chainNameAndIdObject: {
|
|
125
|
+
[key: string]: string;
|
|
126
|
+
} = {};
|
|
127
|
+
Object.entries(contractAddressData).forEach(([key, config]) => {
|
|
128
|
+
if (config.MulticallWithValid) {
|
|
129
|
+
multiCallAddressObject[key] = config.MulticallWithValid;
|
|
130
|
+
}
|
|
131
|
+
const chainName = chainIdAndNameObject[key];
|
|
132
|
+
chainNameAndIdObject[chainName] = key;
|
|
133
|
+
fsExtra.outputFileSync(
|
|
134
|
+
path.join(OUTPUT_CONTRACT_ADDRESS_DIR, `${chainName}.ts`),
|
|
135
|
+
`
|
|
136
|
+
const CONTRACT_CONFIG = ${JSON.stringify(config)};
|
|
137
|
+
export default CONTRACT_CONFIG;
|
|
138
|
+
`,
|
|
139
|
+
);
|
|
140
|
+
});
|
|
141
|
+
|
|
142
|
+
let addressConfigCode = '';
|
|
143
|
+
const chainIdContractObject = {} as {
|
|
144
|
+
[chainId: string]: string;
|
|
145
|
+
};
|
|
146
|
+
fs.readdirSync(OUTPUT_CONTRACT_ADDRESS_DIR).forEach((file) => {
|
|
147
|
+
if (file === 'index.ts') return;
|
|
148
|
+
const fileName = file.replace(/\.ts$/, '');
|
|
149
|
+
const chainName = fileName.replace(/-([a-z])?/g, (_, p1) => {
|
|
150
|
+
return p1?.toUpperCase() ?? '';
|
|
151
|
+
});
|
|
152
|
+
addressConfigCode += `import { default as ${chainName} } from './${fileName}'\n`;
|
|
153
|
+
const chainId = chainNameAndIdObject[fileName];
|
|
154
|
+
chainIdContractObject[chainId] = chainName;
|
|
155
|
+
});
|
|
156
|
+
addressConfigCode += `\nexport function getConfig(chainId: number) {
|
|
157
|
+
switch (chainId) {
|
|
158
|
+
${Object.entries(chainIdContractObject)
|
|
159
|
+
.map(([key, value]) => {
|
|
160
|
+
return `case ${key}:
|
|
161
|
+
return ${value};
|
|
162
|
+
`;
|
|
163
|
+
})
|
|
164
|
+
.join('')}
|
|
165
|
+
default:
|
|
166
|
+
return null;
|
|
167
|
+
}
|
|
168
|
+
}\n\n`;
|
|
169
|
+
|
|
170
|
+
fs.readdirSync(OUTPUT_CONTRACT_ADDRESS_DIR).forEach((file) => {
|
|
171
|
+
if (file === 'index.ts') return;
|
|
172
|
+
const fileName = file.replace(/\.ts$/, '');
|
|
173
|
+
const chainName = fileName.replace(/-([a-z])?/g, (_, p1) => {
|
|
174
|
+
return p1?.toUpperCase() ?? '';
|
|
175
|
+
});
|
|
176
|
+
addressConfigCode += `export { default as ${chainName} } from './${fileName}'\n`;
|
|
177
|
+
});
|
|
178
|
+
addressConfigCode += `\nexport const multiCallAddressList = ${JSON.stringify(multiCallAddressObject)}
|
|
179
|
+
`;
|
|
180
|
+
fsExtra.outputFileSync(OUTPUT_CONTRACT_ADDRESS_FILE, addressConfigCode);
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
function generateExportCode() {
|
|
184
|
+
let result = `export { setContractRequests } from './contractRequests'\n\n`;
|
|
185
|
+
fs.readdirSync(OUTPUT_CONTRACT_FUNCTION_DIR).forEach((file) => {
|
|
186
|
+
const fileName = file.replace(/\.ts$/, '');
|
|
187
|
+
result += `export * from './${CONTRACT_FUNCTION_FILENAME}/${fileName}'\n`;
|
|
188
|
+
});
|
|
189
|
+
fsExtra.outputFileSync(OUTPUT_FILE, result);
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
main();
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
|
|
2
|
+
const CONTRACT_CONFIG = {"MulticallWithValid":"0x3b49d23C0322ecD24D01c7b35f26a57Ec7cF7901","DODOSellHelper":"0xA5F36E822540eFD11FcD77ec46626b916B217c3e","ERC20Helper":"0x7C062B9C584fA6eC2504270790D38240A2c5fE72","DODOCalleeHelper":"0xe3B40F8D8346d428EAB28d9Fd672b784d921cfBD","DODOV1PmmHelper":"0x4EE6398898F7FC3e648b3f6bA458310ac29cD352","DODOV2RouteHelper":"0x0C420970b2e5efcBB6e833601772D6E707155eA6","FeeRateDIP3Impl":"0x97bBF5BB1dcfC93A8c67e97E50Bea19DB3416A83","DVMFactory":"0xDa4c4411c55B0785e501332354A036c04833B72b","DSPFactory":"0xC8fE2440744dcd733246a4dB14093664DEFD5A53","DPPFactory":"0xa6Cf3d163358aF376ec5e8B7Cc5e102a05FdE63D","CrowdPoolingFactory":"0x6E5f239f729c83E976a7A280F81Dd1685dd89218","ERC20V3Factory":"0x5CA5e03228a3C16EF262d29E588Adb6c2445fDbC","DODOMineV2Factory":"0x5a2E2278A0fACcf224cEd1ce809eC4e4b1708759","DODOMineV3Registry":"0x2B40bC6c9C12c18787436aa1E2B761f684F42999","DODOApprove":"0xA867241cDC8d3b0C07C85cC06F25a0cD3b5474d8","DODOApproveProxy":"0x311E670c3305a0BD55184c1C6580eBeA1FA611F0","DODOV1Adapter":"0xd5a7E197bacE1F3B26E2760321d6ce06Ad07281a","DODOStarterProxy":"0x02b7011De29961dE1412dC3C31973909775406eD","DODOV1Proxy":"0x49186E32fEd50fd6B5604A2618c7B0b03Cd41414","DODOV2Proxy02":"0x88CBf433471A0CD8240D2a12354362988b4593E5","DODODspProxyWithoutGSP":"0x36E5238B4479d1ba0bFE47550B0B8e4f4f500EAA","DODODspProxy":"0xF0f8FB90039875e2682678E6C23828BdD16fAC9d","DODOCpProxyWithoutGlobalQuota":"0x467b6A4352924A4475e3deF0fb2910839D8D0F1a","DODODppProxy":"0xE8C9A78725D0451FA19878D5f8A3dC0D55FECF25","DODOMineV3ProxyWithoutPlatform":"0x9A74B169798bE874EF1C23b4092e5689969eF45E","LimitOrderBot":"0x0F278Ee5FDd139f9aE8c6498Cca0f2c2208684a2","LimitOrder":"0x91FbD0C9dbA8C42B7Fa636CC60344c72E7D065c9","DODONFTRouteHelper":"0xFcbd98cc89b2cf60362d3533463C1309f39c539D","DODONFTProxy":"0x6A51C8A1139B9233C31331D2Cf442E0652329f23","BuyoutModel":"0x23B06D1557e8cAe3f03f71DCbB3123E071693af7","DODONFTRegistry":"0x8327b093caf1a32985887CE89BD6c8F80A6B7535","DODONFT":"0x4ec636C32195DD4E4Be1D37c0838DB1a8E3E4E30","DODONFT1155":"0x3Ec5a174DAfF0A91DCD0935866ED9E6514441Ba8","DODONFTPoolProxy":"0xE55154D09265b18aC7CDAC6E646672A5460389a1","DODONFTApprove":"0xaeB5CF31b97dce6134e416129845e01106fFB177","D3Proxy":"0xbe9ec3C4825D87d77E0F049aA586449cF1d1E31b","D3Vault":"0xBAf350b14ed48429A7772F7D05B2CFc6620744D9"};
|
|
3
|
+
export default CONTRACT_CONFIG;
|
|
4
|
+
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
|
|
2
|
+
const CONTRACT_CONFIG = {"MulticallWithValid":"0x5a0C840a7089aa222c4458b3BE0947fe5a5006DE","DODOSellHelper":"0x72d220cE168C4f361dD4deE5D826a01AD8598f6C","ERC20Helper":"0xE8C9A78725D0451FA19878D5f8A3dC0D55FECF25","DODOCalleeHelper":"0x738Ebf387A0CE0eb46b0eF8Fa5DEa2EaE6B1Df51","DODOV1PmmHelper":"0xbAb9F4ff4A19a0e8EEBC56b06750253228ffAc6E","DODOV2RouteHelper":"0x49eAB58AAE044F31d3b136212058a00b282b2845","FeeRateDIP3Impl":"0x16601C94Ad6E26904a519C08a7A1fCBC8e1F9D9c","DVMFactory":"0x5515363c0412AdD5c72d3E302fE1bD7dCBCF93Fe","DSPFactory":"0xbe9a66e49503e84ae59a4d0545365AABedf33b40","DPPFactory":"0x40672211D4310ad71daDc8cDE7Aa3Fb90d420855","CrowdPoolingFactory":"0xc6962a577A3Be5311f9f9Ab9B8b6A69a25bBc817","ERC20V3Factory":"0xD6Bd9f3d4ad1b4464e8DdfF2da2bcAC1ff55D868","DODOMineV3Registry":"0xfDDCA6ffCE24dF5bE3e8AaD32081822f86178048","DODOApprove":"0x335aC99bb3E51BDbF22025f092Ebc1Cf2c5cC619","DODOApproveProxy":"0x6B4Fa0bc61Eddc928e0Df9c7f01e407BfcD3e5EF","DODOV1Adapter":"0x02fCB21dc1cf221939C1d4277fB54016b5d32bC7","DODOStarterProxy":"0x800A526b9aB8f2d13cE2ab9Cf000A8D64b0ab866","DODOV2Proxy02":"0xd9deC7c3C06e62a4c1BeEB07CadF568f496b14c2","DODODspProxyWithoutGSP":"0x53233ABD9108761258a4B6B7822abFD6716B129B","DODOCpProxyWithoutGlobalQuota":"0x471e1A083D76C4FC9e088FD259F64Eff0A37DAbD","DODODppProxy":"0x357c5E9cfA8B834EDcef7C7aAbD8F9Db09119d11","DODOMineV3ProxyWithoutPlatform":"0x4775b1858f1e417C9609D455C3Ad8751ec01daC4"};
|
|
3
|
+
export default CONTRACT_CONFIG;
|
|
4
|
+
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
|
|
2
|
+
const CONTRACT_CONFIG = {"MulticallWithValid":"0xbcd2FDC3B884Cf0dfD932f55Ec2Fe1fB7e8c62Da","DODOSellHelper":"0xF7c5311B618E6dFBBc34210c92D2C9675D7EdDCA","ERC20Helper":"0xC3528D128CC227fd60793007b5e3FdF7c2945282","DODOCalleeHelper":"0x4EfF1D851366b8cc51d553a87e2d12dA8Da46F2a","DODOV1PmmHelper":"0x790B4A80Fb1094589A3c0eFC8740aA9b0C1733fB","DODOV2RouteHelper":"0x686984f0aa37585504f51DEbA0Eb45B0f0CB7e4a","FeeRateDIP3Impl":"0xB2570F5381ee94dd75FbF303e6889F19199922AA","DVMFactory":"0xfF133A6D335b50bDAa6612D19E1352B049A8aE6a","DSPFactory":"0x2b0d94Eb7A63B8a2909dE1CB3951ecF7Ae76D2fE","DPPFactory":"0xb7865a5ceE051d35B09A48b624D7057d3362655a","CrowdPoolingFactory":"0x25B2f945Fec30F34b05d416C7c0b5c6c51A3ADdC","ERC20V3Factory":"0x00971e21955F1bb8021a5eF2546beC2Ff896EE42","DODOMineV3Registry":"0x0fe261aeE0d1C4DFdDee4102E82Dd425999065F4","DODOApprove":"0xCFea63e3DE31De53D68780Dd65675F169439e470","DODOApproveProxy":"0x96a75d73b3de29c009863fA6329D96b2181D3Dc4","DODOV1Adapter":"0x62F67e305850a2597c46cD5957BdFbe9d04F10Bd","DODOStarterProxy":"0xb8132c7112aAf11fed09c7218AD2fcB42Da84773","DODOV2Proxy02":"0x2cD18557E14aF72DAA8090BcAA95b231ffC9ea26","DODODspProxyWithoutGSP":"0xeCEaDe494FD5F913Fd937C5CAc4577236395Dc32","DODOCpProxyWithoutGlobalQuota":"0x973CAB76C35BB1da47e044A63546c69A8Ac1143c","DODODppProxy":"0xe44F14BFDe673B7339734a28152cCd6b821753C9","DODOMineV3ProxyWithoutPlatform":"0x5D6e6A0BFB2176AFCc4FB809822D8e009216b245","D3Proxy":"0xa71415675F68f29259ddD63215E5518d2735bf0a","D3Vault":"0xEAC4BFef7D1c872Ed705B01856af7f9802adC596"};
|
|
3
|
+
export default CONTRACT_CONFIG;
|
|
4
|
+
|