Linked Questions

10 votes
2 answers
27k views

Correct syntax for estimating gas cost of a function in Web3?

Suppose I have the following function: function SetMessage (bytes32 _message) returns (bool success) { message = _message; return true; } Which might be called in Web3 as follows, for ...
ZhouW's user avatar
  • 1,348
7 votes
2 answers
4k views

getData() is not working

I want to call a function of the contract, something like this - module.exports.transfer = function(to,value,){ return token.methods.transfer.getData(to, value); } But I am facing the error ...
Satyam Agrawal's user avatar
3 votes
1 answer
6k views

Truffle and Ganache - do I need to set the same gas-price and gas-limit in both of them?

Or can I set different values? If I can set different values, then how will they be used in the system (i.e., what gas-price and gas-limit will apply in every transaction that I execute)? Here is my ...
goodvibration's user avatar
2 votes
2 answers
2k views

How to decide the amount of ether you need for your app?

Let say I am building a contract which works like a coins/mark point system. I know that when we deploy the contract we need ether. And the transaction will happen which then needs gas for the fee. ...
princegialai's user avatar
2 votes
1 answer
1k views

How is the block gas limit dynamically adjusted?

What mechanism lies behind adjusting the block gas limit dynamically? Is it the miner that mined the most recent block who decides whether to adjust the gas limit or not? How much can the block gas ...
Shuzheng's user avatar
  • 1,815
1 vote
1 answer
2k views

Is there any price for storing data in contracts? [duplicate]

I want to create contract, which will be able to store data like array of: struct Funder { address addr_first; address addr_second; } How can I calculate gas fee for transactions ...
sp41mer's user avatar
  • 92
9 votes
1 answer
1k views

In web3.js, how do I accurately find total gas cost to deploy a new contract (including constructor)?

I am using a public node as my web3 privider, so I must sign all transactions manually. This includes transactions that create contracts. Currently, I use the following method to deploy contracts. ...
user3431429's user avatar
1 vote
1 answer
2k views

How can I estimate gas on a transaction with custom data?

How can I estimate the gas I need for a string which may be quite long? I've found an example here, but in this estimate, it doesn't include any custom data. In my app I would like to save a string ...
joe's user avatar
  • 269
2 votes
1 answer
778 views

Is it ok to Use Javascript VM in remix IDE to know the Gas values?

Just wanted to know that using the Gas values generated for a contract in Remix IDE when Javascript VM option, does the Gas values are useful when deploying contracts to testnet or live, does the ...
Praveen Kumar's user avatar
1 vote
1 answer
477 views

GAS is the fuel of Ethereum network?

I want to know something about GAS...can you please explain... What is the relationship between Gas and Wei / Ether? Can you please give an example of how much the execution of a contract will cost? ...
TAMIM HAIDER's user avatar