Skip to content

Commit 6e78707

Browse files
authored
Merge pull request #1478 from ethereum/fix_deploy_main_net_beta
fix deploying, defining a correct type
2 parents e1489e6 + 169cf64 commit 6e78707

File tree

11 files changed

+698
-638
lines changed

11 files changed

+698
-638
lines changed

apps/remix-ide/src/blockchain/blockchain.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ class Blockchain {
1919
this.events = new EventEmitter()
2020
this.config = config
2121
const web3Runner = new TxRunnerWeb3({
22-
config: config,
22+
config: this.config,
2323
detectNetwork: (cb) => {
2424
this.executionContext.detectNetwork(cb)
2525
},

libs/remix-analyzer/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
"ethereumjs-util": "^7.0.10",
2929
"ethers": "^5.4.2",
3030
"string-similarity": "^4.0.4",
31-
"web3": "1.2.4"
31+
"web3": "^1.5.1"
3232
},
3333
"publishConfig": {
3434
"access": "public"

libs/remix-astwalker/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@
4747
"tape": "^4.10.1",
4848
"ts-node": "^8.0.3",
4949
"typescript": "^3.4.3",
50-
"web3": "1.2.4"
50+
"web3": "^1.5.1"
5151
},
5252
"devDependencies": {
5353
"tap-spec": "^5.0.0"

libs/remix-debug/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
"ethereumjs-util": "^7.0.10",
3131
"ethers": "^5.4.2",
3232
"string-similarity": "^4.0.4",
33-
"web3": "^1.2.4"
33+
"web3": "^1.5.1"
3434
},
3535
"devDependencies": {
3636
"@babel/core": "^7.4.5",

libs/remix-lib/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
"events": "^3.0.0",
2424
"solc": "^0.7.4",
2525
"string-similarity": "^4.0.4",
26-
"web3": "^1.2.4"
26+
"web3": "^1.5.1"
2727
},
2828
"devDependencies": {
2929
"@babel/core": "^7.4.5",

libs/remix-lib/src/execution/txRunnerWeb3.ts

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,20 @@ export class TxRunnerWeb3 {
1515
this._api = api
1616
}
1717

18-
_executeTx (tx, txFee, api, promptCb, callback) {
18+
_executeTx (tx, network, txFee, api, promptCb, callback) {
19+
if (network && network.lastBlock && network.lastBlock.baseFeePerGas) {
20+
// the sending stack (web3.js / metamask need to have the type defined)
21+
// this is to avoid the following issue: https://github.com/MetaMask/metamask-extension/issues/11824
22+
tx.type = '0x2'
23+
}
1924
if (txFee) {
2025
if (txFee.baseFeePerGas) {
21-
tx.maxPriorityFee = this.getWeb3().utils.toHex(this.getWeb3().utils.toWei(txFee.maxPriorityFee, 'gwei'))
22-
tx.maxFee = this.getWeb3().utils.toHex(this.getWeb3().utils.toWei(txFee.maxFee, 'gwei'))
23-
tx.type = 2
26+
tx.maxPriorityFeePerGas = this.getWeb3().utils.toHex(this.getWeb3().utils.toWei(txFee.maxPriorityFee, 'gwei'))
27+
tx.maxFeePerGas = this.getWeb3().utils.toHex(this.getWeb3().utils.toWei(txFee.maxFee, 'gwei'))
28+
tx.type = '0x2'
2429
} else {
2530
tx.gasPrice = this.getWeb3().utils.toHex(this.getWeb3().utils.toWei(txFee.gasPrice, 'gwei'))
26-
tx.type = 1
31+
tx.type = '0x1'
2732
}
2833
}
2934

@@ -100,18 +105,18 @@ export class TxRunnerWeb3 {
100105
// callback is called whenever no error
101106
tx['gas'] = !gasEstimation ? gasLimit : gasEstimation
102107

103-
if (this._api.config.getUnpersistedProperty('doNotShowTransactionConfirmationAgain')) {
104-
return this._executeTx(tx, null, this._api, promptCb, callback)
105-
}
106-
107108
this._api.detectNetwork((err, network) => {
108109
if (err) {
109110
console.log(err)
110111
return
111112
}
112113

114+
if (this._api.config.getUnpersistedProperty('doNotShowTransactionConfirmationAgain')) {
115+
return this._executeTx(tx, network, null, this._api, promptCb, callback)
116+
}
117+
113118
confirmCb(network, tx, tx['gas'], (txFee) => {
114-
return this._executeTx(tx, txFee, this._api, promptCb, callback)
119+
return this._executeTx(tx, network, txFee, this._api, promptCb, callback)
115120
}, (error) => {
116121
callback(error)
117122
})

libs/remix-simulator/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
"merge": "^1.2.0",
3333
"string-similarity": "^4.0.4",
3434
"time-stamp": "^2.0.0",
35-
"web3": "^1.2.4"
35+
"web3": "^1.5.1"
3636
},
3737
"devDependencies": {
3838
"@babel/core": "^7.4.5",

libs/remix-solidity/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
"ethers": "^5.4.2",
2626
"solc": "^0.7.4",
2727
"string-similarity": "^4.0.4",
28-
"web3": "1.2.4",
28+
"web3": "^1.5.1",
2929
"webworkify-webpack": "^2.1.5"
3030
},
3131
"devDependencies": {

libs/remix-tests/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@
5757
"string-similarity": "^4.0.4",
5858
"time-stamp": "^2.2.0",
5959
"tslib": "^2.3.0",
60-
"web3": "^1.2.4",
60+
"web3": "^1.5.1",
6161
"winston": "^3.0.0"
6262
},
6363
"peerDependencies": {

0 commit comments

Comments
 (0)