Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions apps/remix-ide/src/app/tabs/web3-provider.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ export class Web3ProviderModule extends Plugin {
if (payload.method === 'eth_sendTransaction') {
if (payload.params.length && !payload.params[0].to && message.result) {
setTimeout(async () => {
this.emit('transactionBroadcasted', message.result)
const receipt = await this.tryTillReceiptAvailable(message.result)
if (!receipt.contractAddress) {
console.log('receipt available but contract address not present', receipt)
Expand Down
21 changes: 21 additions & 0 deletions apps/remix-ide/src/blockchain/blockchain.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -797,8 +797,29 @@ export class Blockchain extends Plugin {
(_) => this.executionContext.currentblockGasLimit()
)

const logTransaction = (txhash, origin) => {
this.detectNetwork((error, network) => {
console.log(`transaction sent: ${txhash}`, network)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you want to keep this console log?

if (network && network.id) {
_paq.push(['trackEvent', 'udapp', `sendTransaction-from-${origin}`, `${txhash}-${network.id}`])
} else {
try {
const networkString = JSON.stringify(network)
_paq.push(['trackEvent', 'udapp', `sendTransaction-from-${origin}`, `${txhash}-${networkString}`])
} catch (e) {
_paq.push(['trackEvent', 'udapp', `sendTransaction-from-${origin}`, `${txhash}-unknownnetwork`])
}
}
})
}

this.on('web3Provider', 'transactionBroadcasted', (txhash) => {
logTransaction(txhash, 'plugin')
})

web3Runner.event.register('transactionBroadcasted', (txhash, isUserOp) => {
if (isUserOp) _paq.push(['trackEvent', 'udapp', 'safeSmartAccount', `txBroadcastedFromSmartAccount`])
logTransaction(txhash, 'gui')
this.executionContext.detectNetwork(async (error, network) => {
if (error || !network) return
if (network.name === 'VM') return
Expand Down