Skip to content

Commit

Permalink
add gas estimate
Browse files Browse the repository at this point in the history
  • Loading branch information
isaacsolo committed Jan 10, 2023
1 parent a6042e7 commit e46cef8
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion identity-service/src/relay/txRelay.js
Original file line number Diff line number Diff line change
Expand Up @@ -457,10 +457,16 @@ async function relayToNethermind(encodedABI, contractAddress, gasLimit) {
const start = new Date().getTime()

try {
const estimatedGas = await ethWeb3.eth.estimateGas({
from: toChecksumAddress(wallet.address),
to: toChecksumAddress(contractAddress),
data: encodedABI
})

const transaction = {
to: contractAddress,
value: 0,
gas: gasLimit,
gas: estimatedGas,
gasPrice: 0,
data: encodedABI
}
Expand Down

0 comments on commit e46cef8

Please sign in to comment.