Get the price of gas from a smart contract


I’m just looking for get gas price of a smart contract can u help me please :smiley:

Best regards.

1 Like

Hi @AnoStart, have you generated the Java wrapper for your contract?

If you have the contract address, you need to load the contract using one of the load methods of the contract wrapper. If you have to deploy it, use one of the deploy methods.

In any case you’ll have to specify the gas price you want for that contract wrapper object. That will be used in the interactions with Ethereum nodes.

You can also get the gas price from a contract wrapper using the method getGasPrice().

I hope that helps.