Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
G
Geth-Modification
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
张蕾
Geth-Modification
Commits
48125a25
Commit
48125a25
authored
Oct 28, 2014
by
obscuren
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added missing requires on SSTORE SLOAD
parent
7849b7e9
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
12 deletions
+17
-12
common.go
vm/common.go
+12
-11
vm_debug.go
vm/vm_debug.go
+5
-1
No files found.
vm/common.go
View file @
48125a25
...
...
@@ -19,17 +19,18 @@ const (
)
var
(
GasStep
=
big
.
NewInt
(
1
)
GasSha
=
big
.
NewInt
(
20
)
GasSLoad
=
big
.
NewInt
(
20
)
GasSStore
=
big
.
NewInt
(
100
)
GasBalance
=
big
.
NewInt
(
20
)
GasCreate
=
big
.
NewInt
(
100
)
GasCall
=
big
.
NewInt
(
20
)
GasMemory
=
big
.
NewInt
(
1
)
GasData
=
big
.
NewInt
(
5
)
GasTx
=
big
.
NewInt
(
500
)
GasLog
=
big
.
NewInt
(
32
)
GasStep
=
big
.
NewInt
(
1
)
GasSha
=
big
.
NewInt
(
20
)
GasSLoad
=
big
.
NewInt
(
20
)
GasSStore
=
big
.
NewInt
(
100
)
GasSStoreRefund
=
big
.
NewInt
(
100
)
GasBalance
=
big
.
NewInt
(
20
)
GasCreate
=
big
.
NewInt
(
100
)
GasCall
=
big
.
NewInt
(
20
)
GasMemory
=
big
.
NewInt
(
1
)
GasData
=
big
.
NewInt
(
5
)
GasTx
=
big
.
NewInt
(
500
)
GasLog
=
big
.
NewInt
(
32
)
Pow256
=
ethutil
.
BigPow
(
2
,
256
)
...
...
vm/vm_debug.go
View file @
48125a25
...
...
@@ -169,9 +169,13 @@ func (self *DebugVm) RunClosure(closure *Closure) (ret []byte, err error) {
gas
.
Set
(
ethutil
.
Big0
)
case
SLOAD
:
require
(
1
)
gas
.
Set
(
GasSLoad
)
// Memory resize & Gas
case
SSTORE
:
require
(
2
)
var
mult
*
big
.
Int
y
,
x
:=
stack
.
Peekn
()
val
:=
closure
.
GetStorage
(
x
)
...
...
@@ -179,7 +183,7 @@ func (self *DebugVm) RunClosure(closure *Closure) (ret []byte, err error) {
// 0 => non 0
mult
=
ethutil
.
Big3
}
else
if
val
.
BigInt
()
.
Cmp
(
ethutil
.
Big0
)
!=
0
&&
len
(
y
.
Bytes
())
==
0
{
state
.
Refund
(
closure
.
caller
.
Address
(),
big
.
NewInt
(
100
)
,
closure
.
Price
)
state
.
Refund
(
closure
.
caller
.
Address
(),
GasSStoreRefund
,
closure
.
Price
)
mult
=
ethutil
.
Big0
}
else
{
...
...
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