Transfer method is not working, I am getting a returned error - "Gas Required"

I have deployed a successful smart contract based on openzeppelin. I have tried to get ticker name and total supply of contract, It seems working well. When I am transferring tokens to another address, I am getting following issue
RETURNED ERROR :- GAS REQUIRED. EXCEED ALLOWANCE 9947373 or always failing transaction

:computer: Environment

Solidity:- v0.5.0
Token is on mainnet and I am usign mainnet infura.


I have tried various ways to transfer token from contract to other eth address. But I am getting an issue that “Gas Required”.
I have deployed this contract using metamask. Though when I tried to add token using custom search and put contract address, Balance of token is showing 0.
I have tried with myetherwallet and a custom php code as well, I am getting supply and ticker successfully but not able to transfer tokens.

Here is my contract :-

Please see contract code here

I can share private key as well to test transaction.

:1234: Code to reproduce

Private key: - DB943CF265CD54E8094D91A2011918BE3BB2D25834A47923BCF7813A735B8A69

Creator Address:-

Contract Address :-

Contract ABI :-


I am using above details to transfer tokens, But always getting an error. Later on I want to interact this token with website and transfer tokens dynamically.

Kindly help !!

When I am trying to transfer coins using php code, I am getting issue 'Nonce too low"

Can anyone help ? I really appreciate

1 Like

Hi @dinis174,

Looking at your code, you have set a total supply of tokens but didn’t assign any tokens to any account, nor do you have a way to mint any tokens. When you try to call transfer it fails due to having a balance of 0.

I assume you deployed your token using Remix.

You may want to look at the following example and try deploying to a public testnet:

Hello Abcoathup, Thank you for prompt reply!

I really appreciate your help. I simply deploy contract and try to assign token to Token creator address by adding contract address in to custom search of “ADD TOKEN”. By default 0 token added. So I am helpless here.

When I am trying to 'Transfer token from remix, I am getting following issue
“Gas estimation errored with the following message (see below). The transaction execution will likely fail. Do you want to force sending?
gas required exceeds allowance (8000029) or always failing transaction”

I know you are super busy, kindly help me out with it. I am in trouble right now.

1 Like

Hi @dinis174,

Your current smart contract doesn’t assign any tokens to anyone. Rather than fix it, I recommend starting with the OpenZeppelin Contracts ERC20 implementation. A good place to start it to deploy the simple example to a public testnet and experiment with that:

Hello @abcoathup, Hope you are well!

I am able to run this smart contract and make transactions successfully. Everything is working perfectly now. Tokens are transferring to other addresses as well.
I am just getting one last issue that, Contract balance address is still remain same on

Eg: Initial supply was 10,000,000. I have sent 1000 tokens successfully. So on etherscan it should show 9999000

Can you please suggest, How can I do it?

1 Like

Hi @dinis174,

If you transfer tokens, then the total supply doesn’t change, only the addresses that hold those tokens.

If you share your contract address (and which network), I can show you how to see this on Etherscan.

Hello @abcoathup, Thank you for writing back!

You are right, Contract is showing transfer token perfectly. Can you please let know if still there is any way so that I can update Total Supply.

I look forward to your response.

1 Like

Hi @dinis174,

To create an ERC20 that you can increase the total supply you can inherit from ERC20Mintable