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
aa329dd1
Commit
aa329dd1
authored
Dec 06, 2021
by
QM
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add HT symbol
parent
3eec054c
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
109 additions
and
14 deletions
+109
-14
EthBridgeBank.abi
plugin/dapp/bridgevmxgo/cmd/build/abi/EthBridgeBank.abi
+0
-0
dockerRelayerBsc.sh
plugin/dapp/bridgevmxgo/cmd/build/dockerRelayerBsc.sh
+17
-14
EthBridgeBank.abi
plugin/dapp/cross2eth/cmd/build/abi/EthBridgeBank.abi
+0
-0
ethereumRelayerCmd.go
plugin/dapp/cross2eth/ebcli/ethereumRelayerCmd.go
+28
-0
ethereum.go
plugin/dapp/cross2eth/ebrelayer/relayer/ethereum/ethereum.go
+5
-0
auxiliary.go
.../cross2eth/ebrelayer/relayer/ethereum/ethtxs/auxiliary.go
+42
-0
manager.go
plugin/dapp/cross2eth/ebrelayer/relayer/manager.go
+17
-0
No files found.
plugin/dapp/bridgevmxgo/cmd/build/abi/EthBridgeBank.abi
View file @
aa329dd1
This diff is collapsed.
Click to expand it.
plugin/dapp/bridgevmxgo/cmd/build/dockerRelayerBsc.sh
View file @
aa329dd1
...
@@ -777,6 +777,9 @@ function StartDockerRelayerDeploy() {
...
@@ -777,6 +777,9 @@ function StartDockerRelayerDeploy() {
# 部署合约 设置 bridgeRegistry 地址
# 部署合约 设置 bridgeRegistry 地址
InitAndOfflineDeploy
InitAndOfflineDeploy
result
=
$(${
CLIA
}
ethereum multisign set_symbol
-s
"HT"
)
cli_ret
"
${
result
}
"
"set_symbol"
# 设置离线多签数据
# 设置离线多签数据
Chain33Cli
=
${
MainCli
}
Chain33Cli
=
${
MainCli
}
initMultisignChain33Addr
initMultisignChain33Addr
...
@@ -913,7 +916,7 @@ function DeployEvmxgo() {
...
@@ -913,7 +916,7 @@ function DeployEvmxgo() {
function
updateConfig
()
{
function
updateConfig
()
{
local
symbol
=
$1
local
symbol
=
$1
local
bridgeTokenAddr
=
$2
local
bridgeTokenAddr
=
$2
tx
=
$(
curl
-s
--data-binary
'{"jsonrpc":"2.0","id":2,"method":"Chain33.CreateTransaction","params":[{"execer":"manage","actionName":"Modify","payload":{"key":"evmxgo-mint-'
"
${
symbol
}
"
'","value":"{\"address\":\"'
"
${
bridgeTokenAddr
}
"
'\",\"precision\":8,\"introduction\":\"symbol:'
"
${
symbol
}
"
', bridgeTokenAddr:'
"
${
bridgeTokenAddr
}
"
'\"}","op":"add","addr":""}}]}'
-H
'content-type:text/plain;'
"http://
127.0.0.1
:8901"
| jq
-r
".result"
)
tx
=
$(
curl
-s
--data-binary
'{"jsonrpc":"2.0","id":2,"method":"Chain33.CreateTransaction","params":[{"execer":"manage","actionName":"Modify","payload":{"key":"evmxgo-mint-'
"
${
symbol
}
"
'","value":"{\"address\":\"'
"
${
bridgeTokenAddr
}
"
'\",\"precision\":8,\"introduction\":\"symbol:'
"
${
symbol
}
"
', bridgeTokenAddr:'
"
${
bridgeTokenAddr
}
"
'\"}","op":"add","addr":""}}]}'
-H
'content-type:text/plain;'
"http://
${
docker_chain33_ip
}
:8901"
| jq
-r
".result"
)
if
[
"
${
tx
}
"
==
""
]
;
then
if
[
"
${
tx
}
"
==
""
]
;
then
echo
-e
"
${
RED
}
update config create tx 1
${
NOC
}
"
echo
-e
"
${
RED
}
update config create tx 1
${
NOC
}
"
exit
1
exit
1
...
@@ -926,7 +929,7 @@ function updateConfig() {
...
@@ -926,7 +929,7 @@ function updateConfig() {
function
configbridgevmxgoAddr
()
{
function
configbridgevmxgoAddr
()
{
local
bridgevmxgoAddr
=
$1
local
bridgevmxgoAddr
=
$1
tx
=
$(
curl
-s
--data-binary
'{"jsonrpc":"2.0","id":2,"method":"Chain33.CreateTransaction","params":[{"execer":"manage","actionName":"Modify","payload":{"key":"bridgevmxgo-contract-addr","value":"{\"address\":\"'
"
${
bridgevmxgoAddr
}
"
'\"}","op":"add","addr":""}}]}'
-H
'content-type:text/plain;'
"http://
127.0.0.1
:8901"
| jq
-r
".result"
)
tx
=
$(
curl
-s
--data-binary
'{"jsonrpc":"2.0","id":2,"method":"Chain33.CreateTransaction","params":[{"execer":"manage","actionName":"Modify","payload":{"key":"bridgevmxgo-contract-addr","value":"{\"address\":\"'
"
${
bridgevmxgoAddr
}
"
'\"}","op":"add","addr":""}}]}'
-H
'content-type:text/plain;'
"http://
${
docker_chain33_ip
}
:8901"
| jq
-r
".result"
)
if
[
"
${
tx
}
"
==
""
]
;
then
if
[
"
${
tx
}
"
==
""
]
;
then
echo
-e
"
${
RED
}
update config create tx 1
${
NOC
}
"
echo
-e
"
${
RED
}
update config create tx 1
${
NOC
}
"
exit
1
exit
1
...
@@ -1098,23 +1101,23 @@ function AllRelayerMainTest() {
...
@@ -1098,23 +1101,23 @@ function AllRelayerMainTest() {
TestETH2Chain33Byc
TestETH2Chain33Byc
TestETH2Chain33USDT
TestETH2Chain33USDT
#
Chain33Cli=${Para8901Cli}
Chain33Cli
=
${
Para8901Cli
}
#
lockBty
lockBty
#
lockChain33Ycc
lockChain33Ycc
#
lockEth
lockEth
#
lockEthByc
lockEthByc
#
lockEthUSDT
lockEthUSDT
# 离线多签地址转入阈值设大
# 离线多签地址转入阈值设大
#
offline_set_offline_token_Bty 100000000000000 10
offline_set_offline_token_Bty 100000000000000 10
#
offline_set_offline_token_Chain33Ycc 100000000000000 10
offline_set_offline_token_Chain33Ycc 100000000000000 10
#
offline_set_offline_token_Eth 100000000000000 10
offline_set_offline_token_Eth 100000000000000 10
#
offline_set_offline_token_EthByc 100000000000000 10
offline_set_offline_token_EthByc 100000000000000 10
#
offline_set_offline_token_EthUSDT 100000000000000 10
offline_set_offline_token_EthUSDT 100000000000000 10
EvmxgoBoss4xCLI
=
"./evmxgoboss4x --rpc_laddr http://
${
docker_chain33_ip
}
:8901 --paraName user.p.para."
EvmxgoBoss4xCLI
=
"./evmxgoboss4x --rpc_laddr http://
${
docker_chain33_ip
}
:8901 --paraName user.p.para."
DeployEvmxgo
DeployEvmxgo
#
TestETH2EVMToChain33
TestETH2EVMToChain33
Testethereum2EVMToChain33_byc
Testethereum2EVMToChain33_byc
Testethereum2EVMToChain33_usdt
Testethereum2EVMToChain33_usdt
...
...
plugin/dapp/cross2eth/cmd/build/abi/EthBridgeBank.abi
View file @
aa329dd1
This diff is collapsed.
Click to expand it.
plugin/dapp/cross2eth/ebcli/ethereumRelayerCmd.go
View file @
aa329dd1
...
@@ -46,6 +46,7 @@ func EthereumRelayerCmd() *cobra.Command {
...
@@ -46,6 +46,7 @@ func EthereumRelayerCmd() *cobra.Command {
TokenCmd
(),
TokenCmd
(),
MultiSignEthCmd
(),
MultiSignEthCmd
(),
TransferEthCmd
(),
TransferEthCmd
(),
ConfigplatformTokenSymbolCmd
(),
)
)
return
cmd
return
cmd
...
@@ -971,6 +972,33 @@ func ConfigOfflineSaveAccount(cmd *cobra.Command, args []string) {
...
@@ -971,6 +972,33 @@ func ConfigOfflineSaveAccount(cmd *cobra.Command, args []string) {
ctx
.
Run
()
ctx
.
Run
()
}
}
//ConfigplatformTokenSymbolCmd ...
func
ConfigplatformTokenSymbolCmd
()
*
cobra
.
Command
{
cmd
:=
&
cobra
.
Command
{
Use
:
"set_symbol"
,
Short
:
"save config symbol"
,
Run
:
ConfigplatformTokenSymbol
,
}
ConfigplatformTokenSymbolFlags
(
cmd
)
return
cmd
}
//ConfigplatformTokenSymbolFlags ...
func
ConfigplatformTokenSymbolFlags
(
cmd
*
cobra
.
Command
)
{
cmd
.
Flags
()
.
StringP
(
"symbol"
,
"s"
,
"ETH"
,
"symbol"
)
_
=
cmd
.
MarkFlagRequired
(
"symbol"
)
}
//ConfigplatformTokenSymbol ...
func
ConfigplatformTokenSymbol
(
cmd
*
cobra
.
Command
,
args
[]
string
)
{
rpcLaddr
,
_
:=
cmd
.
Flags
()
.
GetString
(
"rpc_laddr"
)
addr
,
_
:=
cmd
.
Flags
()
.
GetString
(
"address"
)
var
res
rpctypes
.
Reply
ctx
:=
jsonclient
.
NewRPCCtx
(
rpcLaddr
,
"Manager.ConfigplatformTokenSymbol"
,
addr
,
&
res
)
ctx
.
Run
()
}
//ConfigLockedTokenOfflineSaveCmd ...
//ConfigLockedTokenOfflineSaveCmd ...
func
ConfigLockedTokenOfflineSaveCmd
()
*
cobra
.
Command
{
func
ConfigLockedTokenOfflineSaveCmd
()
*
cobra
.
Command
{
cmd
:=
&
cobra
.
Command
{
cmd
:=
&
cobra
.
Command
{
...
...
plugin/dapp/cross2eth/ebrelayer/relayer/ethereum/ethereum.go
View file @
aa329dd1
...
@@ -995,6 +995,11 @@ func (ethRelayer *Relayer4Ethereum) ConfigOfflineSaveAccount(addr string) (strin
...
@@ -995,6 +995,11 @@ func (ethRelayer *Relayer4Ethereum) ConfigOfflineSaveAccount(addr string) (strin
return
txhash
,
err
return
txhash
,
err
}
}
func
(
ethRelayer
*
Relayer4Ethereum
)
ConfigplatformTokenSymbol
(
symbol
string
)
(
string
,
error
)
{
txhash
,
err
:=
ethtxs
.
ConfigplatformTokenSymbol
(
symbol
,
ethRelayer
.
clientSpec
,
ethRelayer
.
operatorInfo
,
ethRelayer
.
x2EthContracts
)
return
txhash
,
err
}
func
(
ethRelayer
*
Relayer4Ethereum
)
ConfigLockedTokenOfflineSave
(
addr
,
symbol
,
threshold
string
,
percents
uint32
)
(
string
,
error
)
{
func
(
ethRelayer
*
Relayer4Ethereum
)
ConfigLockedTokenOfflineSave
(
addr
,
symbol
,
threshold
string
,
percents
uint32
)
(
string
,
error
)
{
bn
:=
big
.
NewInt
(
1
)
bn
:=
big
.
NewInt
(
1
)
bn
,
_
=
bn
.
SetString
(
utils
.
TrimZeroAndDot
(
threshold
),
10
)
bn
,
_
=
bn
.
SetString
(
utils
.
TrimZeroAndDot
(
threshold
),
10
)
...
...
plugin/dapp/cross2eth/ebrelayer/relayer/ethereum/ethtxs/auxiliary.go
View file @
aa329dd1
...
@@ -760,6 +760,48 @@ func ConfigOfflineSaveAccount(addr string, client ethinterface.EthClientSpec, pa
...
@@ -760,6 +760,48 @@ func ConfigOfflineSaveAccount(addr string, client ethinterface.EthClientSpec, pa
return
tx
.
Hash
()
.
String
(),
nil
return
tx
.
Hash
()
.
String
(),
nil
}
}
func
ConfigplatformTokenSymbol
(
symbol
string
,
client
ethinterface
.
EthClientSpec
,
para
*
OperatorInfo
,
x2EthContracts
*
X2EthContracts
)
(
string
,
error
)
{
txslog
.
Info
(
"ConfigplatformTokenSymbol"
,
"symbol"
,
symbol
)
if
nil
==
para
{
return
""
,
errors
.
New
(
"no operator private key configured"
)
}
var
prepareDone
bool
var
err
error
defer
func
()
{
if
err
!=
nil
&&
prepareDone
{
_
,
_
=
revokeNonce
(
para
.
Address
)
}
}()
auth
,
err
:=
PrepareAuth
(
client
,
para
.
PrivateKey
,
para
.
Address
)
if
nil
!=
err
{
return
""
,
err
}
prepareDone
=
true
tx
,
err
:=
x2EthContracts
.
BridgeBank
.
BridgeBankTransactor
.
ConfigplatformTokenSymbol
(
auth
,
symbol
)
if
nil
!=
err
{
return
""
,
err
}
sim
,
isSim
:=
client
.
(
*
ethinterface
.
SimExtend
)
if
isSim
{
fmt
.
Println
(
"Use the simulator"
)
sim
.
Commit
()
}
txslog
.
Info
(
"ConfigplatformTokenSymbol"
,
"tx.Hash()"
,
tx
.
Hash
()
.
String
())
err
=
waitEthTxFinished
(
client
,
tx
.
Hash
(),
"ConfigplatformTokenSymbol"
)
if
nil
!=
err
{
return
""
,
err
}
return
tx
.
Hash
()
.
String
(),
nil
}
func
ConfigLockedTokenOfflineSave
(
addr
,
symbol
string
,
threshold
*
big
.
Int
,
percents
uint8
,
client
ethinterface
.
EthClientSpec
,
para
*
OperatorInfo
,
x2EthContracts
*
X2EthContracts
)
(
string
,
error
)
{
func
ConfigLockedTokenOfflineSave
(
addr
,
symbol
string
,
threshold
*
big
.
Int
,
percents
uint8
,
client
ethinterface
.
EthClientSpec
,
para
*
OperatorInfo
,
x2EthContracts
*
X2EthContracts
)
(
string
,
error
)
{
txslog
.
Info
(
"ConfigLockedTokenOfflineSave"
,
"addr"
,
addr
,
"symbol"
,
symbol
,
"threshold"
,
threshold
,
"percents"
,
percents
)
txslog
.
Info
(
"ConfigLockedTokenOfflineSave"
,
"addr"
,
addr
,
"symbol"
,
symbol
,
"threshold"
,
threshold
,
"percents"
,
percents
)
if
nil
==
para
{
if
nil
==
para
{
...
...
plugin/dapp/cross2eth/ebrelayer/relayer/manager.go
View file @
aa329dd1
...
@@ -996,6 +996,23 @@ func (manager *Manager) ConfigOfflineSaveAccount(addr string, result *interface{
...
@@ -996,6 +996,23 @@ func (manager *Manager) ConfigOfflineSaveAccount(addr string, result *interface{
return
nil
return
nil
}
}
func
(
manager
*
Manager
)
ConfigplatformTokenSymbol
(
symbol
string
,
result
*
interface
{})
error
{
manager
.
mtx
.
Lock
()
defer
manager
.
mtx
.
Unlock
()
if
err
:=
manager
.
checkPermission
();
nil
!=
err
{
return
err
}
txhash
,
err
:=
manager
.
ethRelayer
.
ConfigplatformTokenSymbol
(
symbol
)
if
nil
!=
err
{
return
err
}
*
result
=
rpctypes
.
Reply
{
IsOk
:
true
,
Msg
:
txhash
,
}
return
nil
}
func
(
manager
*
Manager
)
ConfigLockedTokenOfflineSave
(
config
relayerTypes
.
ETHConfigLockedTokenOffline
,
result
*
interface
{})
error
{
func
(
manager
*
Manager
)
ConfigLockedTokenOfflineSave
(
config
relayerTypes
.
ETHConfigLockedTokenOffline
,
result
*
interface
{})
error
{
manager
.
mtx
.
Lock
()
manager
.
mtx
.
Lock
()
defer
manager
.
mtx
.
Unlock
()
defer
manager
.
mtx
.
Unlock
()
...
...
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