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
891f7259
Commit
891f7259
authored
Apr 10, 2014
by
obscuren
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added better address format
parent
969e748d
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
18 additions
and
4 deletions
+18
-4
stack.go
ethchain/stack.go
+1
-0
vm.go
ethchain/vm.go
+10
-1
vm_test.go
ethchain/vm_test.go
+3
-2
parsing.go
ethutil/parsing.go
+4
-1
No files found.
ethchain/stack.go
View file @
891f7259
...
...
@@ -55,6 +55,7 @@ const (
// 0x50 range - 'storage' and execution
oPUSH
=
0x50
oPUSH20
=
0x80
oPOP
=
0x51
oDUP
=
0x52
oSWAP
=
0x53
...
...
ethchain/vm.go
View file @
891f7259
...
...
@@ -301,7 +301,6 @@ func (vm *Vm) RunClosure(closure *Closure) []byte {
// 0x50 range
case
oPUSH
:
// Push PC+1 on to the stack
pc
.
Add
(
pc
,
ethutil
.
Big1
)
//val := closure.GetMem(pc).BigInt()
data
:=
closure
.
Gets
(
pc
,
big
.
NewInt
(
32
))
val
:=
ethutil
.
BigD
(
data
.
Bytes
())
...
...
@@ -309,6 +308,16 @@ func (vm *Vm) RunClosure(closure *Closure) []byte {
stack
.
Push
(
val
)
pc
.
Add
(
pc
,
big
.
NewInt
(
31
))
case
oPUSH20
:
pc
.
Add
(
pc
,
ethutil
.
Big1
)
data
:=
closure
.
Gets
(
pc
,
big
.
NewInt
(
20
))
val
:=
ethutil
.
BigD
(
data
.
Bytes
())
// Push value to stack
stack
.
Push
(
val
)
pc
.
Add
(
pc
,
big
.
NewInt
(
19
))
case
oPOP
:
stack
.
Pop
()
case
oDUP
:
...
...
ethchain/vm_test.go
View file @
891f7259
...
...
@@ -114,12 +114,13 @@ func TestRun4(t *testing.T) {
int8 ret = 0
int8 arg = 10
call(938726394128221156290138488023434115948430767407, 0, 100000000, arg, ret)
addr address = "a46df28529eb8aa8b8c025b0b413c5f4b688352f"
call(address, 0, 100000000, arg, ret)
`
),
false
)
if
err
!=
nil
{
fmt
.
Println
(
err
)
}
asm
=
append
(
asm
,
"LOG"
)
//
asm = append(asm, "LOG")
fmt
.
Println
(
asm
)
callerScript
:=
ethutil
.
Assemble
(
asm
...
)
...
...
ethutil/parsing.go
View file @
891f7259
...
...
@@ -52,6 +52,9 @@ var OpCodes = map[string]byte{
// 0x50 range - 'storage' and execution
"PUSH"
:
0x50
,
"PUSH20"
:
0x80
,
"POP"
:
0x51
,
"DUP"
:
0x52
,
"SWAP"
:
0x53
,
...
...
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