use gasLimit

pull/4737/head^2
yann300 8 months ago committed by Aniket
parent 13fef4591f
commit 52659841c9
  1. 2
      libs/remix-lib/src/execution/txExecution.ts
  2. 10
      libs/remix-lib/src/execution/txRunnerWeb3.ts
  3. 2
      libs/remix-ui/run-tab/src/lib/reducers/runTab.ts

@ -171,6 +171,6 @@ export function checkError (execResult, compiledContracts) {
msg = '\tState changes is not allowed in Static Call context\n'
ret.error = true
}
ret.message = `${error}\n${exceptionError}\n${msg}\nDebug the transaction to get more information.`
ret.message = `${error}\n${exceptionError}\n${msg}\nYou may want to cautiously increase the gas limit if the transaction went out of gas.`
return ret
}

@ -137,8 +137,14 @@ export class TxRunnerWeb3 {
this.getWeb3().eth.estimateGas(txCopy)
.then(gasEstimation => {
gasEstimationForceSend(null, () => {
// callback is called whenever no error
tx['gas'] = !gasEstimation ? gasLimit : gasEstimation
/*
* gasLimit is a value that can be set in the UI to hardcap value that can be put in a tx.
* e.g if the gasestimate
*/
if (gasEstimation > gasLimit) {
return callback(`estimated gas for this transaction (${gasEstimation}) is higher than gasLimit set in the configuration (${gasLimit}). Please raise the gas limit.`)
}
tx['gas'] = gasLimit
if (this._api.config.getUnpersistedProperty('doNotShowTransactionConfirmationAgain')) {
return this._executeTx(tx, network, null, this._api, promptCb, callback)

@ -18,7 +18,7 @@ export const runTabInitialState: RunTabState = {
},
sendValue: '0',
sendUnit: 'wei',
gasLimit: 3000000,
gasLimit: 200000,
selectExEnv: 'vm-paris',
personalMode: false,
networkName: 'VM',

Loading…
Cancel
Save