Skip to content

Commit 3c45801

Browse files
committed
check if smart account
1 parent 6f75654 commit 3c45801

File tree

3 files changed

+8
-3
lines changed

3 files changed

+8
-3
lines changed

Diff for: apps/remix-ide/src/blockchain/blockchain.tsx

+3-1
Original file line numberDiff line numberDiff line change
@@ -861,11 +861,12 @@ export class Blockchain extends Plugin {
861861
// eslint-disable-next-line no-async-promise-executor
862862
return new Promise(async (resolve, reject) => {
863863
let fromAddress
864+
let fromSmartAccount
864865
let value
865866
let gasLimit
866867
try {
867868
fromAddress = await getAccount()
868-
console.log('isSmartAccount--->', this.isSmartAccount(fromAddress))
869+
fromSmartAccount = this.isSmartAccount(fromAddress)
869870
value = await queryValue()
870871
gasLimit = await getGasLimit()
871872
} catch (e) {
@@ -878,6 +879,7 @@ export class Blockchain extends Plugin {
878879
data: args.data.dataHex,
879880
useCall: args.useCall,
880881
from: fromAddress,
882+
fromSmartAccount,
881883
value: value,
882884
gasLimit: gasLimit,
883885
timestamp: args.data.timestamp

Diff for: libs/remix-lib/src/execution/txRunner.ts

+1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import { EventManager } from '../eventManager'
33

44
export type Transaction = {
55
from: string,
6+
fromSmartAccount: boolean,
67
to: string,
78
value: string,
89
data: string,

Diff for: libs/remix-lib/src/execution/txRunnerWeb3.ts

+4-2
Original file line numberDiff line numberDiff line change
@@ -92,17 +92,19 @@ export class TxRunnerWeb3 {
9292
}
9393

9494
execute (args: InternalTransaction, confirmationCb, gasEstimationForceSend, promptCb, callback) {
95+
console.log('execute txRunnerWeb3--->', args)
9596
let data = args.data
9697
if (data.slice(0, 2) !== '0x') {
9798
data = '0x' + data
9899
}
99100

100-
return this.runInNode(args.from, args.to, data, args.value, args.gasLimit, args.useCall, args.timestamp, confirmationCb, gasEstimationForceSend, promptCb, callback)
101+
return this.runInNode(args.from, args.fromSmartAccount, args.to, data, args.value, args.gasLimit, args.useCall, args.timestamp, confirmationCb, gasEstimationForceSend, promptCb, callback)
101102
}
102103

103-
runInNode (from, to, data, value, gasLimit, useCall, timestamp, confirmCb, gasEstimationForceSend, promptCb, callback) {
104+
runInNode (from, fromSmartAccount, to, data, value, gasLimit, useCall, timestamp, confirmCb, gasEstimationForceSend, promptCb, callback) {
104105
const tx = { from: from, to: to, data: data, value: value }
105106
if (!from) return callback('the value of "from" is not defined. Please make sure an account is selected.')
107+
if (fromSmartAccount) return callback('from address is from a smart account')
106108
if (useCall) {
107109
if (this._api && this._api.isVM()) {
108110
(this.getWeb3() as any).remix.registerCallId(timestamp)

0 commit comments

Comments
 (0)