Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
P
plugin
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
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
link33
plugin
Commits
f159931f
Commit
f159931f
authored
Jul 13, 2021
by
hezhengjun
Committed by
vipwzw
Jul 19, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
enable evm's asset map from other contractrs configurable
parent
92a81c2c
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
2 deletions
+11
-2
chain33.para.toml
chain33.para.toml
+4
-0
exec.go
plugin/dapp/evm/executor/exec.go
+7
-2
No files found.
chain33.para.toml
View file @
f159931f
...
...
@@ -194,6 +194,10 @@ paraConsensusStopBlocks=30000
total
=
"16htvcBNSEA7fZhAdLJphDwQRQJaHpyHTp"
useBalance
=
false
[exec.sub.evm]
#平行链evm合约ETH资产映射的合约和资产类型(symbol)
ethMapFromExecutor
=
"paracross"
ethMapFromSymbol
=
"coins.bty"
#系统中所有的fork,默认用chain33的测试网络的
#但是我们可以替换
...
...
plugin/dapp/evm/executor/exec.go
View file @
f159931f
...
...
@@ -19,7 +19,6 @@ import (
"github.com/33cn/plugin/plugin/dapp/evm/executor/vm/runtime"
"github.com/33cn/plugin/plugin/dapp/evm/executor/vm/state"
evmtypes
"github.com/33cn/plugin/plugin/dapp/evm/types"
pt
"github.com/33cn/plugin/plugin/dapp/paracross/types"
)
// Exec 本合约执行逻辑
...
...
@@ -180,7 +179,13 @@ func (evm *EVMExecutor) CheckInit() {
return
}
//平行链
accountDB
,
_
:=
account
.
NewAccountDB
(
evm
.
GetAPI
()
.
GetConfig
(),
pt
.
ParaX
,
"coins.bty"
,
evm
.
GetStateDB
())
conf
:=
types
.
ConfSub
(
cfg
,
evmtypes
.
ExecutorName
)
ethMapFromExecutor
:=
conf
.
GStr
(
"ethMapFromExecutor"
)
ethMapFromSymbol
:=
conf
.
GStr
(
"ethMapFromSymbol"
)
if
""
==
ethMapFromExecutor
||
""
==
ethMapFromSymbol
{
panic
(
"Both ethMapFromExecutor and ethMapFromSymbol should be configured, "
+
"ethMapFromExecutor="
+
ethMapFromExecutor
+
", ethMapFromSymbol="
+
ethMapFromSymbol
)
}
accountDB
,
_
:=
account
.
NewAccountDB
(
evm
.
GetAPI
()
.
GetConfig
(),
ethMapFromExecutor
,
ethMapFromSymbol
,
evm
.
GetStateDB
())
evm
.
mStateDB
=
state
.
NewMemoryStateDB
(
evm
.
GetStateDB
(),
evm
.
GetLocalDB
(),
accountDB
,
evm
.
GetHeight
(),
evm
.
GetAPI
())
}
...
...
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