Error: gas required exceeds allowance (8000000) or always failing transaction

Hey @mmurthy! I think the problem may be related to the opcode repricing from the Istanbul hard fork. As @nventuro explained in this post, the repricing affects all OpenZeppelin upgradeable contracts who are to receive a transfer from another contract.

In this case, going through the transaction that @abcoathup set up (thanks Andy for the help in reproducing the issue!), it seems the very last internal transaction is an ETH transfer with 2300 gas. This succeeds when the destination contract is a regular one, but fails when it’s upgradeable.

I’ve opened an issue on ENS so they stop using Solidity’s transfer as it has been advised, but I’m not sure how easily they can push that fix, since the ENS contracts are not upgradeable.

In the meantime, you should be able to work around this problem by setting up your contract as non-upgradeable in the oz CLI, by setting the --minimal flag when running oz create. Let me know if this works! And apologies for the hassle, but the repricing from the hard fork is breaking applications in ways we could not anticipate.

1 Like