Merge pull request #4215 from ethereum/fix_bsc

Fix bsc
pull/4219/head
yann300 1 year ago committed by GitHub
commit 6399eae728
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 3
      apps/remix-ide/src/blockchain/execution-context.js
  2. 2
      libs/ghaction-helper/src/methods.ts
  3. 4
      libs/remix-lib/src/execution/txRunnerWeb3.ts
  4. 4
      libs/remix-ui/terminal/src/lib/components/Table.tsx

@ -7,12 +7,14 @@ const _paq = window._paq = window._paq || []
let web3
const config = { defaultTransactionType: '0x0' }
if (typeof window !== 'undefined' && typeof window.ethereum !== 'undefined') {
var injectedProvider = window.ethereum
web3 = new Web3(injectedProvider)
} else {
web3 = new Web3(new Web3.providers.HttpProvider('http://localhost:8545'))
}
web3.eth.setConfig(config)
/*
trigger contextChanged, web3EndpointChanged
@ -59,6 +61,7 @@ export class ExecutionContext {
}
setWeb3 (context, web3) {
web3.setConfig(config)
this.customWeb3[context] = web3
}

@ -11,12 +11,14 @@ const providerConfig = {
blockNumber: global.blockNumber || null
}
const config = { defaultTransactionType: '0x0' }
global.remixProvider = new Provider(providerConfig)
global.remixProvider.init()
global.web3Provider = new ethers.providers.Web3Provider(global.remixProvider)
global.provider = global.web3Provider
global.ethereum = global.web3Provider
global.web3 = new Web3(global.web3Provider)
global.web3.eth.setConfig(config)
const isFactoryOptions = (signerOrOptions: any) => {
if (!signerOrOptions || signerOrOptions === undefined || signerOrOptions instanceof ethers.Signer) return false

@ -23,7 +23,7 @@ export class TxRunnerWeb3 {
// this is to avoid the following issue: https://github.com/MetaMask/metamask-extension/issues/11824
tx.type = '0x2'
} else {
tx.type = '0x1'
// tx.type = '0x1'
}
if (txFee) {
if (txFee.baseFeePerGas) {
@ -81,7 +81,7 @@ export class TxRunnerWeb3 {
)
} else {
try {
const res = await this.getWeb3().eth.sendTransaction(tx)
const res = await this.getWeb3().eth.sendTransaction(tx, null, { checkRevertBeforeSending: false })
cb(null, res.transactionHash)
} catch (e) {
console.log(`Send transaction failed: ${e.message} . if you use an injected provider, please check it is properly unlocked. `)

@ -75,8 +75,8 @@ const showTable = (opts, showTableHash) => {
<FormattedMessage id="terminal.blockNumber" />
</td>
<td className="remix_ui_terminal_td" data-id={`txLoggerTableContractAddress${opts.hash}`} data-shared={`pair_${opts.hash}`}>
{opts.blockNumber}
<CopyToClipboard content={opts.blockNumber} />
{opts.blockNumber.toString()}
<CopyToClipboard content={opts.blockNumber.toString()} />
</td>
</tr>
) : null}

Loading…
Cancel
Save