Use Big number for handling max amount paid to deployers

This commit is contained in:
Shreerang Kale 2025-02-11 16:11:31 +05:30
parent a0cdb486c5
commit 462bb97cb0
2 changed files with 4 additions and 2 deletions

View File

@ -46,6 +46,7 @@
"axios": "^1.6.7", "axios": "^1.6.7",
"clsx": "^2.1.0", "clsx": "^2.1.0",
"date-fns": "^3.3.1", "date-fns": "^3.3.1",
"ethers": "^5.6.2",
"downshift": "^8.3.2", "downshift": "^8.3.2",
"framer-motion": "^11.0.8", "framer-motion": "^11.0.8",
"gql-client": "^1.0.0", "gql-client": "^1.0.0",

View File

@ -8,6 +8,7 @@ import {
AuctionParams, AuctionParams,
Deployer, Deployer,
} from 'gql-client'; } from 'gql-client';
import { BigNumber } from 'ethers';
import { Select, MenuItem, FormControl, FormHelperText } from '@mui/material'; import { Select, MenuItem, FormControl, FormHelperText } from '@mui/material';
@ -94,8 +95,8 @@ const Configure = () => {
if (selectedOption === 'LRN') { if (selectedOption === 'LRN') {
amount = selectedDeployer?.minimumPayment?.toString() ?? '0'; amount = selectedDeployer?.minimumPayment?.toString() ?? '0';
} else { } else {
// TODO: Use BigNumber const bigMaxPrice = BigNumber.from(selectedMaxPrice);
amount = (selectedNumProviders * Number(selectedMaxPrice)).toString(); amount = bigMaxPrice.mul(selectedNumProviders).toString();
} }
return amount.replace(/\D/g, ''); return amount.replace(/\D/g, '');