Skip to content
This repository has been archived by the owner on Jul 20, 2024. It is now read-only.

Error: overflow [ See: https://links.ethers.org/v5-errors-NUMERIC_FAULT-overflow ] (fault="overflow", operation="BigNumber.from", value=9007199254740991, code=NUMERIC_FAULT, version=bignumber/5.7.0) #99

Open
krishnadude98 opened this issue Aug 1, 2023 · 1 comment

Comments

@krishnadude98
Copy link

const { networkConfig, developmentChains } = require("../helper-hardhat-config");
const { verify } = require("../utils/verify");
const fs = require("fs");

module.exports = async function ({ getNamedAccounts, deployments }) {
    const { deploy, log } = deployments;
    const { deployer } = await getNamedAccounts();

    let ethUsdPriceFeedAddress;
    const chainId = network.config.chainId;
    if (developmentChains.includes(network.name)) {
        const ethUsdAggregator = await ethers.getContract("MockV3Aggregator");
        ethUsdPriceFeedAddress = ethUsdAggregator.address;
    } else {
        ethUsdPriceFeedAddress = networkConfig[chainId].ethUsdPrice;
    }
    const lowSvg = fs.readFileSync("./images/dynamicNft/sad.svg", { encoding: "utf8" });
    const highSvg = fs.readFileSync("./images/dynamicNft/smiley.svg", { encoding: "utf8" });

    const args = [ethUsdPriceFeedAddress, lowSvg, highSvg];
    const dynamicSvgNft = await deploy("DynamicNft", {
        from: deployer,
        args: args,
        log: true,
        waitConfirmations: network.config.blockConfirmations || 1,
    });

    if (!developmentChains.includes(network.name) && process.env.POLYGON_API_KEY) {
        log("Verifying..........");
        await verify(dynamicSvgNft.address, args);
    }
};

module.exports.tags = ["all", "dynamicnft", "main"];``` 

in this deploy script for dynamic nft getting this error
```Error: overflow [ See: https://links.ethers.org/v5-errors-NUMERIC_FAULT-overflow ] (fault="overflow", operation="BigNumber.from", value=9007199254740991, code=NUMERIC_FAULT, version=bignumber/5.7.0)```
@gbr5
Copy link

gbr5 commented Aug 2, 2023

If its the same error as I had, which looks like, you have to add n at the end of the INITIAL_PRICE value in helper-hardhat-config, like so

    INITIAL_PRICE: 200000000000000000000n,

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants