龚成明 2 жил өмнө
parent
commit
624289d7a5

+ 3 - 4
scripts/generate/index.js

@@ -1,11 +1,10 @@
 const web3 = require('hardhat').web3
 const logger = require("../../utils/logger")
 const BigNumber = require('ethers').BigNumber
-const replaceAll = require("hardhat/internal/util/strings").replaceAll
-const Time = require("../../utils/time")
-const Chain = require("../../model/chain")
 const ierc20abi = require('../../abi/IERC20_ABI.json')
 const contracts = require('../../config/contracts')
+const Time = require("../../utils/time")
+const Chain = require("../../model/chain")
 
 class LpGenerate {
   tokenInstance = {}
@@ -43,7 +42,7 @@ class LpGenerate {
       const symbol0 = info['2'].replace(/[^A-Za-z0-9]+/g, '').substring(0, 10)
       const symbol1 = info['6'].replace(/[^A-Za-z0-9]+/g, '').substring(0, 10)
       const name = `${routerObj.name}_${symbol0}_${symbol1}`
-      const sum2 = replaceAll(BigNumber.from(info['1']).add(BigNumber.from(info['5']))._hex, '0x0', '0x')
+      const sum2 = BigNumber.from(info['1']).add(BigNumber.from(info['5']))._hex.replace('0x0', '0x')
 
       return {
         LP: info['0'],