I just tried to deploy a smart contract to the mainnet. The transaction failed: Etherscan link
The error is
Warning! Error encountered during contract execution [Reverted]
Before I tried to deploy this on the mainnet, I had tried it on Ropsten (same code), and it worked perfectly. The gas consumed on ropsten was 5,694,718. The gas limit set for the mainnet transaction was 6,000,000, but clearly the failure is not because of gas anyway, as the failed transaction consumed only 731,989.
Given the size of the transaction (and the unused gas in the transaction), I was expecting the gas used on the block overall to be less. The block gas limit was 7,959,257 out of which 7,976,645 was consumed (99.78%). Given that my transaction had more than 5,000,000 of unused gas, shouldn't the block's gas utilization by less as well?
Could that be a possible reason for the failure? That my contract creation never got to use all the gas it needed and the block gas limit got reached before? It would be strange behavior if that was the case.
I did try to debug the transaction in remix, but not very useful. The debugger loads but when I click on next, it doesn't even appear to hit the smart contract constructor.
Any thoughts on the problem would be very welcome.