1

I am trying to deploy a contract using the following code:

 const Contract = await ethers.getContractFactory("Contract", {
    libraries: {
      UtilsLibrary: "0xF...e",
    }
 });
let pool = await Contract.deploy({gasLimit: 10000000, gasPrice: ethers.utils.parseUnits("1", "gwei")})

When I run this on Kovan, Goerly, Arbitrum Goerly, this works totally fine (obviously I correct the library address). When I run this on the Arbitrum mainnet I get an error saying "not enough funds for gas". I have changed multiple RPCs and result is not luck.

Contract takes about 5 mil gas to deploy and I have about 1 ETH in wallet. I really have no more ideas on what might be wrong here. Any suggestions appreciated.

UPD: I have deployed the UtilsLibrary totally fine as part of the script as well. So the correct signer is being used and it has funds.....

2 Answers 2

0

I had to increase the gas limit to 100mil and it took 80 mil to deploy. I am not sure why similar transaction only took 5mil on kovan and Arbitrum testnet

0

Arbitrum has a different way to compute gas cost, see here https://developer.offchainlabs.com/docs/Differences_Overview#fee-stats

In particular, calldata is more expensive than L1, and this explains the contract deployment extra cost.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.