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
6171000e
Commit
6171000e
authored
Jun 17, 2021
by
yann300
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
manage immutable
parent
8a712184
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
4 deletions
+11
-4
decodeInfo.ts
libs/remix-debug/src/solidity-decoder/decodeInfo.ts
+7
-4
stateDecoder.ts
libs/remix-debug/src/solidity-decoder/stateDecoder.ts
+4
-0
No files found.
libs/remix-debug/src/solidity-decoder/decodeInfo.ts
View file @
6171000e
...
@@ -336,7 +336,9 @@ function computeOffsets (types, stateDefinitions, contractName, location) {
...
@@ -336,7 +336,9 @@ function computeOffsets (types, stateDefinitions, contractName, location) {
console
.
log
(
'unable to retrieve decode info of '
+
variable
.
typeDescriptions
.
typeString
)
console
.
log
(
'unable to retrieve decode info of '
+
variable
.
typeDescriptions
.
typeString
)
return
null
return
null
}
}
if
(
!
variable
.
constant
&&
storagelocation
.
offset
+
type
.
storageBytes
>
32
)
{
const
immutable
=
variable
.
mutability
===
'immutable'
const
hasStorageSlots
=
!
immutable
&&
!
variable
.
constant
if
(
hasStorageSlots
&&
storagelocation
.
offset
+
type
.
storageBytes
>
32
)
{
storagelocation
.
slot
++
storagelocation
.
slot
++
storagelocation
.
offset
=
0
storagelocation
.
offset
=
0
}
}
...
@@ -344,12 +346,13 @@ function computeOffsets (types, stateDefinitions, contractName, location) {
...
@@ -344,12 +346,13 @@ function computeOffsets (types, stateDefinitions, contractName, location) {
name
:
variable
.
name
,
name
:
variable
.
name
,
type
:
type
,
type
:
type
,
constant
:
variable
.
constant
,
constant
:
variable
.
constant
,
immutable
,
storagelocation
:
{
storagelocation
:
{
offset
:
variable
.
constant
?
0
:
storagelocation
.
offset
,
offset
:
!
hasStorageSlots
?
0
:
storagelocation
.
offset
,
slot
:
variable
.
constant
?
0
:
storagelocation
.
slot
slot
:
!
hasStorageSlots
?
0
:
storagelocation
.
slot
}
}
})
})
if
(
!
variable
.
constant
)
{
if
(
hasStorageSlots
)
{
if
(
type
.
storageSlots
===
1
&&
storagelocation
.
offset
+
type
.
storageBytes
<=
32
)
{
if
(
type
.
storageSlots
===
1
&&
storagelocation
.
offset
+
type
.
storageBytes
<=
32
)
{
storagelocation
.
offset
+=
type
.
storageBytes
storagelocation
.
offset
+=
type
.
storageBytes
}
else
{
}
else
{
...
...
libs/remix-debug/src/solidity-decoder/stateDecoder.ts
View file @
6171000e
...
@@ -15,9 +15,13 @@ export async function decodeState (stateVars, storageResolver) {
...
@@ -15,9 +15,13 @@ export async function decodeState (stateVars, storageResolver) {
try
{
try
{
const
decoded
=
await
stateVar
.
type
.
decodeFromStorage
(
stateVar
.
storagelocation
,
storageResolver
)
const
decoded
=
await
stateVar
.
type
.
decodeFromStorage
(
stateVar
.
storagelocation
,
storageResolver
)
decoded
.
constant
=
stateVar
.
constant
decoded
.
constant
=
stateVar
.
constant
decoded
.
immutable
=
stateVar
.
immutable
if
(
decoded
.
constant
)
{
if
(
decoded
.
constant
)
{
decoded
.
value
=
'<constant>'
decoded
.
value
=
'<constant>'
}
}
if
(
decoded
.
immutable
)
{
decoded
.
value
=
'<immutable>'
}
ret
[
stateVar
.
name
]
=
decoded
ret
[
stateVar
.
name
]
=
decoded
}
catch
(
e
)
{
}
catch
(
e
)
{
console
.
log
(
e
)
console
.
log
(
e
)
...
...
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