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
920b82f5
Commit
920b82f5
authored
Dec 06, 2021
by
hezhengjun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
support burn back to different simlar ethereum blockchain platform token
parent
61ca50d4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
4 additions
and
12 deletions
+4
-12
chain33.go
plugin/dapp/cross2eth/ebrelayer/relayer/chain33/chain33.go
+1
-1
ethereum.go
plugin/dapp/cross2eth/ebrelayer/relayer/ethereum/ethereum.go
+3
-0
parser.go
...app/cross2eth/ebrelayer/relayer/ethereum/ethtxs/parser.go
+0
-8
chain33Event.go
...n/dapp/cross2eth/ebrelayer/relayer/events/chain33Event.go
+0
-3
No files found.
plugin/dapp/cross2eth/ebrelayer/relayer/chain33/chain33.go
View file @
920b82f5
...
...
@@ -407,7 +407,7 @@ func (chain33Relayer *Relayer4Chain33) relayLockBurnToChain33(claim *ebTypes.Eth
}
//因为发行的合约的精度为8,所以需要缩小,在进行burn的时候,再进行倍乘,在函数ParseBurnLock4chain33进行
if
ebTypes
.
SYMBOL_ETH
==
claim
.
Symbo
l
{
if
18
==
claim
.
Decima
l
{
bigAmount
.
Div
(
bigAmount
,
big
.
NewInt
(
int64
(
1e10
)))
claim
.
Amount
=
bigAmount
.
String
()
}
...
...
plugin/dapp/cross2eth/ebrelayer/relayer/ethereum/ethereum.go
View file @
920b82f5
...
...
@@ -514,6 +514,9 @@ func (ethRelayer *Relayer4Ethereum) handleChain33Msg(chain33Msg *events.Chain33M
}
tokenAddr
=
common
.
HexToAddress
(
addr
)
}
if
ebTypes
.
EthNilAddr
==
tokenAddr
.
String
()
{
prophecyClaim
.
Amount
=
prophecyClaim
.
Amount
.
Mul
(
prophecyClaim
.
Amount
,
big
.
NewInt
(
int64
(
1e10
)))
}
}
// Relay the Chain33Msg to the Ethereum network
...
...
plugin/dapp/cross2eth/ebrelayer/relayer/ethereum/ethtxs/parser.go
View file @
920b82f5
...
...
@@ -10,12 +10,9 @@ package ethtxs
// --------------------------------------------------------
import
(
"strings"
"github.com/33cn/chain33/common/address"
"github.com/33cn/plugin/plugin/dapp/cross2eth/ebrelayer/relayer/events"
ebrelayerTypes
"github.com/33cn/plugin/plugin/dapp/cross2eth/ebrelayer/types"
"github.com/ethereum/go-ethereum/common"
)
// LogLockToEthBridgeClaim : parses and packages a LockEvent struct with a validator address in an EthBridgeClaim msg
...
...
@@ -24,11 +21,6 @@ func LogLockToEthBridgeClaim(event *events.LockEvent, ethereumChainID int64, bri
if
0
==
len
(
recipient
)
{
return
nil
,
ebrelayerTypes
.
ErrEmptyAddress
}
// Symbol formatted to lowercase
symbol
:=
strings
.
ToLower
(
event
.
Symbol
)
if
symbol
==
"eth"
&&
event
.
Token
!=
common
.
HexToAddress
(
"0x0000000000000000000000000000000000000000"
)
{
return
nil
,
ebrelayerTypes
.
ErrAddress4Eth
}
chain33Receiver
:=
new
(
address
.
Address
)
chain33Receiver
.
SetBytes
(
recipient
)
...
...
plugin/dapp/cross2eth/ebrelayer/relayer/events/chain33Event.go
View file @
920b82f5
...
...
@@ -132,9 +132,6 @@ func ParseBurnLock4chain33(evmEventType Chain33EvmEvent, data []byte, bridgeBank
TxHash
:
chain33TxHash
,
Nonce
:
burnEvent
.
Nonce
.
Int64
(),
}
if
ebrelayerTypes
.
SYMBOL_ETH
==
burnEvent
.
Symbol
{
chain33Msg
.
Amount
=
chain33Msg
.
Amount
.
Mul
(
chain33Msg
.
Amount
,
big
.
NewInt
(
int64
(
1e10
)))
}
return
chain33Msg
,
nil
}
...
...
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