Skip to content

Commit e446c75

Browse files
committed
Merge remote-tracking branch 'origin/master' into eip_7702
2 parents 50d7c33 + f6dfdbb commit e446c75

File tree

9 files changed

+84
-13
lines changed

9 files changed

+84
-13
lines changed

apps/remix-ide-e2e/src/tests/debugger.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -282,7 +282,7 @@ module.exports = {
282282
.clickFunction('callA - transact (not payable)')
283283
.debugTransaction(1)
284284
.pause(4000)
285-
.goToVMTraceStep(79)
285+
.goToVMTraceStep(80)
286286
.waitForElementVisible('*[data-id="debugGoToRevert"]', 60000)
287287
.click('*[data-id="debugGoToRevert"]')
288288
.waitForElementContainsText('*[data-id="asmitems"] div[selected="selected"]', '114 REVERT')

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ export class Blockchain extends Plugin {
9797
this.txRunner = new TxRunner(web3Runner, {})
9898
this.networkcallid = 0
9999
this.registeredPluginEvents = []
100-
this.defaultPinnedProviders = ['vm-pectra', 'vm-mainnet-fork', 'walletconnect', 'injected-MetaMask', 'basic-http-provider', 'hardhat-provider', 'foundry-provider']
100+
this.defaultPinnedProviders = ['vm-pectra', 'vm-cancun', 'vm-mainnet-fork', 'walletconnect', 'injected-MetaMask', 'basic-http-provider', 'hardhat-provider', 'foundry-provider']
101101
this.networkStatus = { network: { name: this.defaultPinnedProviders[0], id: ' - ' } }
102102
this.pinnedProviders = []
103103
this.setupEvents()

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,8 @@ export class TxListener {
103103
addExecutionCosts(txResult, tx, execResult)
104104
tx.envMode = this.executionContext.getProvider()
105105
tx.status = txResult.receipt.status
106+
tx.isUserOp = txResult.tx.isUserOp
107+
tx.originTo = txResult.tx.originTo
106108
this._resolve([tx])
107109
}).catch(error=>console.log(error))
108110
})

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

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ export class TxRunnerWeb3 {
6161
// eslint-disable-next-line no-async-promise-executor
6262
return new Promise(async (resolve, reject) => {
6363
const receipt = await tryTillReceiptAvailable(resp, this.getWeb3())
64+
const originTo = tx.to
6465
tx = await tryTillTxAvailable(resp, this.getWeb3())
6566
if (isCreation && !receipt.contractAddress) {
6667
// if it is a isCreation, contractAddress should be defined.
@@ -75,7 +76,11 @@ export class TxRunnerWeb3 {
7576
}
7677
}
7778
currentDateTime = new Date();
78-
if (isUserOp && contractAddress && !receipt.contractAddress) (receipt as any).contractAddress = contractAddress
79+
if (isUserOp) {
80+
tx.isUserOp = isUserOp
81+
tx.originTo = originTo
82+
if (contractAddress && !receipt.contractAddress) (receipt as any).contractAddress = contractAddress
83+
}
7984
resolve({
8085
receipt,
8186
tx,

libs/remix-ui/solidity-compiler/src/lib/logic/compileTabLogic.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ export class CompileTabLogic {
2828
this.contentImport = contentImport
2929
this.event = new EventEmitter()
3030
this.compiler = new Compiler((url, cb) => api.resolveContentAndSave(url).then((result) => cb(null, result)).catch((error) => cb(error.message)))
31-
this.evmVersions = ['default', 'cancun', 'shanghai', 'paris', 'london', 'berlin', 'istanbul', 'petersburg', 'constantinople', 'byzantium', 'spuriousDragon', 'tangerineWhistle', 'homestead']
31+
this.evmVersions = ['default', 'prague', 'cancun', 'shanghai', 'paris', 'london', 'berlin', 'istanbul', 'petersburg', 'constantinople', 'byzantium', 'spuriousDragon', 'tangerineWhistle', 'homestead']
3232
}
3333

3434
init () {

libs/remix-ui/terminal/src/lib/components/RenderKnownTransactions.tsx

Lines changed: 27 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,29 @@ const RenderKnownTransactions = ({ tx, receipt, resolvedData, logs, index, plugi
2525
}
2626
}
2727

28-
const from = tx.from
29-
const to = resolvedData.contractName + '.' + resolvedData.fn
28+
let from = tx.from
29+
let to = resolvedData.contractName + '.' + resolvedData.fn
30+
if (tx.isUserOp) {
31+
// Track event with signature: ExecutionFromModuleSuccess (index_topic_1 address module)
32+
// to get sender smart account address
33+
const fromAddrLog = receipt.logs.find(e => e.topics[0] === "0x6895c13664aa4f67288b25d7a21d7aaa34916e355fb9b6fae0a139a9085becb8")
34+
// Track event with signature: UserOperationSponsored (index_topic_1 bytes32 userOpHash, index_topic_2 address user, uint8 paymasterMode, address token, uint256 tokenAmountPaid, uint256 exchangeRate)
35+
// to get paymaster address
36+
const paymasterAddrLog = receipt.logs.find(e => e.topics[0] === "0x7a270f29ae17e8e2304ff1245deb50c3b6206bca82928d904f3e284d35c5ffd2")
37+
if (fromAddrLog) {
38+
from = fromAddrLog.address
39+
tx.bundler = tx.from
40+
}
41+
if (paymasterAddrLog) tx.paymaster = paymasterAddrLog.address
42+
if (tx.to) {
43+
tx.entrypoint = tx.to
44+
to = null // for deployment transaction
45+
}
46+
if (tx.originTo) {
47+
to = tx.originTo
48+
}
49+
50+
}
3051
const txType = 'knownTx'
3152
const options = { from, to, tx, logs }
3253
return (
@@ -49,6 +70,10 @@ const RenderKnownTransactions = ({ tx, receipt, resolvedData, logs, index, plugi
4970
{showTableHash.includes(tx.hash)
5071
? showTable(
5172
{
73+
'isUserOp': tx.isUserOp,
74+
'bundler': tx.bundler,
75+
'paymaster': tx.paymaster,
76+
'entrypoint': tx.entrypoint,
5277
'hash': tx.hash,
5378
'status': receipt !== null ? receipt.status : null,
5479
'isCall': tx.isCall,

libs/remix-ui/terminal/src/lib/components/RenderUnknownTransactions.tsx

Lines changed: 28 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import Context from './Context' // eslint-disable-line
55
import showTable from './Table'
66

77
const RenderUnKnownTransactions = ({ tx, receipt, index, plugin, showTableHash, txDetails, modal, provider }) => {
8+
89
const intl = useIntl()
910
const debug = (event, tx) => {
1011
event.stopPropagation()
@@ -22,9 +23,30 @@ const RenderUnKnownTransactions = ({ tx, receipt, index, plugin, showTableHash,
2223
plugin.event.trigger('debuggingRequested', [tx.hash])
2324
}
2425
}
26+
let from = tx.from
27+
let to = tx.to
28+
29+
if (tx.isUserOp) {
30+
// Track event with signature: ExecutionFromModuleSuccess (index_topic_1 address module)
31+
// to get sender smart account address
32+
const fromAddrLog = receipt.logs.find(e => e.topics[0] === "0x6895c13664aa4f67288b25d7a21d7aaa34916e355fb9b6fae0a139a9085becb8")
33+
// Track event with signature: UserOperationSponsored (index_topic_1 bytes32 userOpHash, index_topic_2 address user, uint8 paymasterMode, address token, uint256 tokenAmountPaid, uint256 exchangeRate)
34+
// to get paymaster address
35+
const paymasterAddrLog = receipt.logs.find(e => e.topics[0] === "0x7a270f29ae17e8e2304ff1245deb50c3b6206bca82928d904f3e284d35c5ffd2")
36+
if (fromAddrLog) {
37+
from = fromAddrLog.address
38+
tx.bundler = tx.from
39+
}
40+
if (paymasterAddrLog) tx.paymaster = paymasterAddrLog.address
41+
if (tx.to) {
42+
tx.entrypoint = tx.to
43+
to = null // for deployment transaction
44+
}
45+
if (tx.originTo) {
46+
to = tx.originTo
47+
}
2548

26-
const from = tx.from
27-
const to = tx.to
49+
}
2850
const txType = 'unknown' + (tx.isCall ? 'Call' : 'Tx')
2951
const options = {
3052
from,
@@ -54,6 +76,10 @@ const RenderUnKnownTransactions = ({ tx, receipt, index, plugin, showTableHash,
5476
{showTableHash.includes(tx.hash)
5577
? showTable(
5678
{
79+
'isUserOp': tx.isUserOp,
80+
'bundler': tx.bundler,
81+
'paymaster': tx.paymaster,
82+
'entrypoint': tx.entrypoint,
5783
'hash': tx.hash,
5884
'status': receipt ? receipt.status : null,
5985
'isCall': tx.isCall,

libs/remix-ui/terminal/src/lib/components/Table.tsx

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,14 @@ import {CopyToClipboard} from '@remix-ui/clipboard' // eslint-disable-line
44
import { shortenHexData } from '@remix-ui/helper'
55
import { execution } from '@remix-project/remix-lib'
66
const typeConversion = execution.typeConversion
7+
import { toChecksumAddress } from '@ethereumjs/util'
78

89
const showTable = (opts, showTableHash) => {
910
const intl = useIntl()
1011
let msg = ''
1112
let toHash
1213
const data = opts.data // opts.data = data.tx
13-
if (data.to && opts.to !== data.to) {
14+
if (!opts.isUserOp && data.to && opts.to !== data.to) {
1415
toHash = opts.to + ' ' + data.to
1516
} else {
1617
toHash = opts.to
@@ -98,19 +99,27 @@ const showTable = (opts, showTableHash) => {
9899
from
99100
</td>
100101
<td className="remix_ui_terminal_td" data-id={`txLoggerTableFrom${opts.hash}`} data-shared={`pair_${opts.hash}`}>
101-
{opts.from}
102+
{toChecksumAddress(opts.from)}
102103
<CopyToClipboard content={opts.from} />
104+
{ opts.isUserOp && opts.bundler ? (<>
105+
(BUNDLER: {toChecksumAddress(opts.bundler)}) <CopyToClipboard content={opts.bundler} />
106+
</>
107+
) : null }
103108
</td>
104109
</tr>
105110
) : null}
106-
{opts.to ? (
111+
{opts.to || (opts.isUserOp && opts.entrypoint)? (
107112
<tr className="remix_ui_terminal_tr">
108113
<td className="remix_ui_terminal_td" data-shared={`key_${opts.hash}`}>
109114
to
110115
</td>
111116
<td className="remix_ui_terminal_td" data-id={`txLoggerTableTo${opts.hash}`} data-shared={`pair_${opts.hash}`}>
112117
{toHash}
113-
<CopyToClipboard content={data.to ? data.to : toHash} />
118+
{ opts.to ? <CopyToClipboard content={data.to ? data.to : toHash} /> : null }
119+
{ opts.isUserOp && opts.entrypoint ? (<>
120+
(ENTRYPOINT: {toChecksumAddress(opts.entrypoint)}) <CopyToClipboard content={opts.entrypoint} />
121+
</>
122+
) : null }
114123
</td>
115124
</tr>
116125
) : null}
@@ -133,6 +142,10 @@ const showTable = (opts, showTableHash) => {
133142
<td className="remix_ui_terminal_td" data-id={`txLoggerTableTransactionCost${opts.hash}`} data-shared={`pair_${opts.hash}`}>
134143
{opts.transactionCost} gas {callWarning}
135144
<CopyToClipboard content={opts.transactionCost} />
145+
{ opts.isUserOp && opts.paymaster ? (<>
146+
(PAYMASTER: {toChecksumAddress(opts.paymaster)}) <CopyToClipboard content={opts.paymaster} />
147+
</>
148+
) : null }
136149
</td>
137150
</tr>
138151
) : null}

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"license": "MIT",
55
"description": "Ethereum Remix Monorepo",
66
"main": "index.js",
7-
"defaultVersion": "soljson-v0.8.26+commit.8a97fa7a.js",
7+
"defaultVersion": "soljson-v0.8.30+commit.73712a01.js",
88
"keywords": [
99
"ethereum",
1010
"solidity",

0 commit comments

Comments
 (0)