good morning!!!!
Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
B
bor
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container registry
Harbor Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
open
bor
Commits
b608a80e
Commit
b608a80e
authored
Jan 19, 2014
by
Jeffrey Wilcke
Browse files
Options
Downloads
Patches
Plain Diff
More opcodes
parent
489576b6
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
block_manager.go
+26
-0
26 additions, 0 deletions
block_manager.go
with
26 additions
and
0 deletions
block_manager.go
+
26
−
0
View file @
b608a80e
...
...
@@ -524,7 +524,16 @@ out:
case
oIND
:
bm
.
stack
.
Push
(
big
.
NewInt
(
int64
(
pc
)))
case
oEXTRO
:
memAddr
:=
bm
.
stack
.
Pop
()
contractAddr
:=
bm
.
stack
.
Pop
()
.
Bytes
()
// Push the contract's memory on to the stack
bm
.
stack
.
Push
(
getContractMemory
(
block
,
contractAddr
,
memAddr
))
case
oBALANCE
:
// Pushes the balance of the popped value on to the stack
d
:=
block
.
State
()
.
Get
(
bm
.
stack
.
Pop
()
.
String
())
ether
:=
ethutil
.
NewEtherFromData
([]
byte
(
d
))
bm
.
stack
.
Push
(
ether
.
Amount
)
case
oMKTX
:
case
oSUICIDE
:
}
...
...
@@ -533,3 +542,20 @@ out:
bm
.
stack
.
Print
()
}
// Returns an address from the specified contract's address
func
getContractMemory
(
block
*
ethutil
.
Block
,
contractAddr
[]
byte
,
memAddr
*
big
.
Int
)
*
big
.
Int
{
contract
:=
block
.
GetContract
(
contractAddr
)
if
contract
==
nil
{
log
.
Panicf
(
"invalid contract addr %x"
,
contractAddr
)
}
val
:=
contract
.
State
()
.
Get
(
memAddr
.
String
())
// decode the object as a big integer
decoder
:=
ethutil
.
NewRlpDecoder
([]
byte
(
val
))
if
decoder
.
IsNil
()
{
return
ethutil
.
BigFalse
}
return
decoder
.
AsBigInt
()
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment