Dear Anyone Who Can Help Me,

This is my first time posting and asking for help, I'm in the midst of Deploying and Running the Transactions in Remix IDE (as per the picture).

I'm stuck at the Gas Limit (as I don't know how much to put)

The same goes for Value in wei or gwei.

As I did try to enter the Gas Limit and Values, I got this error message below:

"Gas estimation failed- 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 (10000000) or always failing transaction"

Since on the left side, you can see my first deploy smart contract, what is your suggestion to put in Gas Limit and Value in wei or gwei?

Fyi, I'm running Injected Web3 via MetaMask.

The Code:

pragma solidity >=0.4.22 <0.6.0;

contract SWLCoin {
  // declare variables
  address owner;
  string name;
  string symbol;
  uint256 totalSWLCoins;

Please advice, many thanks. enter image description here

  • 1
    Your question is completely messed up. Please reorganize it to focus on one specific issue, and ask that issue in a single clear statement. Also, please provide all the relevant code (and only the relevant code). Commented Mar 29, 2020 at 14:02
  • 1
    For example, when you ask "How to Specify Gas Limit and Value", you need to explain where you specify it, because different entities may be expecting different input or even different type of input. Commented Mar 29, 2020 at 14:04
  • Okay my apology as this is my first time and I'm anxious
    – Jsim
    Commented Mar 29, 2020 at 14:06
  • What function in the contract are you trying to execute? Where is the code of that function? Please post it in plain text (no links or images). Commented Mar 29, 2020 at 14:26
  • I would like to create my Smart Contract, that's all
    – Jsim
    Commented Mar 29, 2020 at 14:37

1 Answer 1


Gas Limit (maximum number of gas units required for the transaction to execute):

For this contract, I believe that you won't need more than 1 million gas units. You can put 2 million, I guess there's not much harm in that except for making your transaction take longer to execute. But you cannot put more than the block limit, which is typically around 8 million, depending on what network you're deploying to (mainnet, ropsten, your own private network, etc).

Value (amount of wei-ether passed within the transaction to the contract):

Since you don't have a payable fallback function in the contract, you cannot put anything other than 0, because the transaction will fail otherwise (in fact, that's probably the reason for your error).

  • Thanks for your reply. Which means that in Gas Limit, I put 2 million and the Value, I leave it to "0"?
    – Jsim
    Commented Mar 30, 2020 at 0:38

Your Answer

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

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