使用ethers将一个大数传进合约里发生溢出后换成string传入报错(能直接给解决办法吗?)

匿名用户 提出于 2023-08-27 09:59 3348 浏览

const newPriceMes=await Promise.all(thisMaxPriceMes.map(async(item)=>{ const unixTime = (Date.parse(item.time))/1000; let stringAmount=item.amount.toString(); let thisAmount = ethers.utils.parseUnits(stringAmount,18); return{ buyPrice:item.price*1000, buyTime:unixTime, buyTotalAmount:thisAmount, buyerAddress:item.buyer, finishAmount:item.finishAmount, solderAddress:item.solder, tokenAddress:item.StableCoin, tradeId:item.id, tradeState:item.state } })) console.log("MaxMes:",newPriceMes[0]); const salePledge=await FactoryContract.SalePledge(newPriceMes[0],getEndNumber);

image.png

0 条评论 10 学分

1 个回答

Ric Li C 2023-08-27 10:54

写回答

你需要登录后才可以回答问题,登录