I have a contract that is deploying fine to rinkeby and kovan. I want to put it on polygon-main but thought I'd test with polygon-test (ie. mumbai) first. I'm using brownie. My deploy looks like this:
myContract = MyContract.deploy(
var_1,
var_2,
...
var8,
{"from": from_account},
publish_source=True
)
Deploying to polygon test results in an error saying:
Gas estimation failed: 'execution reverted'. This transaction will likely revert. If you wish to broadcast, you must set the gas limit manually.
If I remove the import of ChainlinkClient.sol from my contract I can deploy just fine to mumbai, but I need ChainlinkClient.sol for my contract, so removing it is not really an option. So, with ChainlinkClient.sol in my contract, I then try deploying with a gas_price and gas_limit like this:
myContract = MyContract.deploy(
var_1,
var_2,
...
var8,
{"from": from_account, 'gas_limit': 272692, gas_price': 9000000000},
publish_source=True
)
That results in this error:
ValueError: Execution reverted during call: 'out of gas'. This transaction will likely revert. If you wish to broadcast, include
allow_revert:True
as a transaction parameter.
So then I increase gas_limit a bit more (to 282692) and I get this error:
ValueError: Execution reverted during call: 'execution reverted'. This transaction will likely revert. If you wish to broadcast, include
allow_revert:True
as a transaction parameter.
I tried using allow_revert: True, but it didn't seem to do anything... though I'm not sure I'm using it correctly. I've tried putting it in like this:
{"from": from_account,'gas_limit': 282692, 'gas_price': 9000000000, 'allow_revert': True},
This didn't change anything... I got the same error as above.
The from_account has 0.9 MATIC on polygon mumbai... and it will deploy contracts (like if I remove the import of ChainlinkClient.sol). My contract is 340 lines and deploys to kovan and rinkeby without issue. I also tried sending to polygon-main and it gave the exact same errors... however, I do not have MATIC on polygon main, so I wouldn't expect it to work there (though I would think it would show a different error if the lack of MATIC was the issue).
Any help or insight would be greatly appreciated!