Linked Questions

6
votes
2answers
2k 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 ...
2
votes
2answers
1k 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. ...
3
votes
2answers
3k 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 ...
1
vote
1answer
1k 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 ...
2
votes
1answer
585 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 ...
9
votes
1answer
523 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. ...
0
votes
1answer
529 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 ...
2
votes
1answer
490 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 ...
1
vote
1answer
424 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? ...
0
votes
1answer
238 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 ...