Polygon: Solidity build failed for 'pragma solidity ^0.8.7' with chainlink

532 Views Asked by At

In polygon chain, the latest chainlink version not support.

If I remove chainlink library, it deploy sucessfully.

Chainlink 0.8 working fine in 'ropston test' network. But in 'Mumbai test net', not able to deploy contract.

hardhat.config.js [edit:1] enter image description here

error log: enter image description here

remix error log: enter image description here

1

There are 1 best solutions below

6
On

You can deploy the contract with Remix Ide Online, web3 connection with Metamask. Can you share your hardhat config file or error logs? This should be inside your hardhat env.

    mumbai: {
  url: "https://rpc-mumbai.matic.today",
  // url: API_URL, //or Infura API  URL   
  accounts: [`0x${PRIVATE_KEY}`],
    gasPrice: 10000000000,
    gasLimit: 9000000
},

Edit: It's failing because cant estimate gasLimit of the transaction. You can set it manually. Inside your deploy.js script set the gasPrice and gasLimit. Depending on you are using web3js or etherjs this code will be different. This is example of another minting function.

FT = await contract.ownerMint(WALLET_ADDRESS,{ gasLimit: 285000, gasPrice: ethers.utils.parseUnits('30', 'gwei')});

Edit2: you can always deploy it with remix online with Metamask enter image description here