Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
B
baas-ide
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
JIRA
JIRA
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
guxukai
baas-ide
Commits
3aef180b
Commit
3aef180b
authored
Aug 16, 2021
by
aniket-engg
Committed by
Aniket
Aug 17, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
handle uint from console log
parent
c417f7f9
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
5 deletions
+14
-5
web3VmProvider.ts
libs/remix-lib/src/web3Provider/web3VmProvider.ts
+14
-5
No files found.
libs/remix-lib/src/web3Provider/web3VmProvider.ts
View file @
3aef180b
...
...
@@ -215,11 +215,20 @@ export class Web3VmProvider {
const
stackLength
=
step
.
stack
.
length
const
payloadStart
=
parseInt
(
step
.
stack
[
stackLength
-
3
],
16
)
const
memory
=
step
.
memory
.
join
(
''
)
const
payload
=
memory
.
substring
(
payloadStart
*
2
,
memory
.
length
)
const
fnselector
=
parseInt
(
'0x'
+
payload
.
substring
(
0
,
8
))
const
iface
=
new
ethers
.
utils
.
Interface
([
`function log
${
ConsoleLogs
[
fnselector
]}
view`
])
const
functionDesc
=
iface
.
getFunction
(
`log
${
ConsoleLogs
[
fnselector
]}
`
)
const
consoleArgs
=
iface
.
decodeFunctionData
(
functionDesc
,
'0x'
+
payload
)
let
payload
=
memory
.
substring
(
payloadStart
*
2
,
memory
.
length
)
const
fnselectorStr
=
payload
.
substring
(
0
,
8
)
const
fnselectorStrInHex
=
'0x'
+
fnselectorStr
const
fnselector
=
parseInt
(
fnselectorStrInHex
)
const
fnArgs
=
ConsoleLogs
[
fnselector
]
const
iface
=
new
ethers
.
utils
.
Interface
([
`function log
${
fnArgs
}
view`
])
const
functionDesc
=
iface
.
getFunction
(
`log
${
fnArgs
}
`
)
const
sigHash
=
iface
.
getSighash
(
`log
${
fnArgs
}
`
)
if
(
fnArgs
.
includes
(
'uint'
)
&&
sigHash
!==
fnselectorStrInHex
)
{
payload
=
payload
.
replace
(
fnselectorStr
,
sigHash
)
}
else
{
payload
=
'0x'
+
payload
}
const
consoleArgs
=
iface
.
decodeFunctionData
(
functionDesc
,
payload
)
this
.
hhLogs
[
this
.
processingHash
]
=
this
.
hhLogs
[
this
.
processingHash
]
?
this
.
hhLogs
[
this
.
processingHash
]
:
[]
this
.
hhLogs
[
this
.
processingHash
].
push
(
consoleArgs
)
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment