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
f7699199
Commit
f7699199
authored
Nov 26, 2021
by
QM
Committed by
33cn
Dec 08, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add bridgevmxgo erc20 USTD
parent
eafc0aa7
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
253 additions
and
11 deletions
+253
-11
dockerRelayerTestEvm.sh
plugin/dapp/bridgevmxgo/cmd/build/dockerRelayerTestEvm.sh
+169
-9
offlinePublic.sh
plugin/dapp/bridgevmxgo/cmd/build/public/offlinePublic.sh
+64
-2
relayerPublic.sh
plugin/dapp/bridgevmxgo/cmd/build/public/relayerPublic.sh
+20
-0
No files found.
plugin/dapp/bridgevmxgo/cmd/build/dockerRelayerTestEvm.sh
View file @
f7699199
...
@@ -19,6 +19,9 @@ chain33EthBridgeTokenAddr=""
...
@@ -19,6 +19,9 @@ chain33EthBridgeTokenAddr=""
ethereumBycERC20TokenAddr
=
""
ethereumBycERC20TokenAddr
=
""
chain33BycBridgeTokenAddr
=
""
chain33BycBridgeTokenAddr
=
""
ethereumUSTDERC20TokenAddr
=
""
chain33USTDBridgeTokenAddr
=
""
chain33YccERC20TokenAddr
=
""
chain33YccERC20TokenAddr
=
""
ethereumYccBridgeTokenAddr
=
""
ethereumYccBridgeTokenAddr
=
""
...
@@ -334,7 +337,7 @@ function TestETH2Chain33Assets() {
...
@@ -334,7 +337,7 @@ function TestETH2Chain33Assets() {
function
TestETH2Chain33Byc
()
{
function
TestETH2Chain33Byc
()
{
echo
-e
"
${
GRE
}
===========
$FUNCNAME
begin ===========
${
NOC
}
"
echo
-e
"
${
GRE
}
===========
$FUNCNAME
begin ===========
${
NOC
}
"
echo
-e
"
${
GRE
}
=========== eth to chain33 在以太坊上锁定
yc
c 资产,然后在 chain33 上 burn ===========
${
NOC
}
"
echo
-e
"
${
GRE
}
=========== eth to chain33 在以太坊上锁定
by
c 资产,然后在 chain33 上 burn ===========
${
NOC
}
"
# 查询 ETH 这端 bridgeBank 地址原来是 0
# 查询 ETH 这端 bridgeBank 地址原来是 0
result
=
$(${
CLIA
}
ethereum balance
-o
"
${
ethBridgeBank
}
"
-t
"
${
ethereumBycERC20TokenAddr
}
"
)
result
=
$(${
CLIA
}
ethereum balance
-o
"
${
ethBridgeBank
}
"
-t
"
${
ethereumBycERC20TokenAddr
}
"
)
cli_ret
"
${
result
}
"
"balance"
".balance"
"0"
cli_ret
"
${
result
}
"
"balance"
".balance"
"0"
...
@@ -402,6 +405,75 @@ function TestETH2Chain33Byc() {
...
@@ -402,6 +405,75 @@ function TestETH2Chain33Byc() {
echo
-e
"
${
GRE
}
===========
$FUNCNAME
end ===========
${
NOC
}
"
echo
-e
"
${
GRE
}
===========
$FUNCNAME
end ===========
${
NOC
}
"
}
}
function
TestETH2Chain33USTD
()
{
echo
-e
"
${
GRE
}
===========
$FUNCNAME
begin ===========
${
NOC
}
"
echo
-e
"
${
GRE
}
=========== eth to chain33 在以太坊上锁定 USTD 资产,然后在 chain33 上 burn ===========
${
NOC
}
"
# 查询 ETH 这端 bridgeBank 地址原来是 0
result
=
$(${
CLIA
}
ethereum balance
-o
"
${
ethBridgeBank
}
"
-t
"
${
ethereumUSTDERC20TokenAddr
}
"
)
cli_ret
"
${
result
}
"
"balance"
".balance"
"0"
# ETH 这端 lock 12个 USTD
result
=
$(${
CLIA
}
ethereum lock
-m
12
-k
"
${
ethTestAddrKey1
}
"
-r
"
${
chain33ReceiverAddr
}
"
-t
"
${
ethereumUSTDERC20TokenAddr
}
"
)
cli_ret
"
${
result
}
"
"lock"
# eth 等待 2 个区块
sleep
4
# 查询 ETH 这端 bridgeBank 地址 12 USTD
result
=
$(${
CLIA
}
ethereum balance
-o
"
${
ethBridgeBank
}
"
-t
"
${
ethereumUSTDERC20TokenAddr
}
"
)
cli_ret
"
${
result
}
"
"balance"
".balance"
"12"
sleep
${
maturityDegree
}
# chain33 chain33EthBridgeTokenAddr(ETH合约中)查询 lock 金额
result
=
$(${
Chain33Cli
}
evm query
-a
"
${
chain33USTDBridgeTokenAddr
}
"
-c
"
${
chain33TestAddr1
}
"
-b
"balanceOf(
${
chain33ReceiverAddr
}
)"
)
# 结果是 12 * le8
is_equal
"
${
result
}
"
"1200000000"
# 原来的数额 0
result
=
$(${
CLIA
}
ethereum balance
-o
"
${
ethReceiverAddr1
}
"
-t
"
${
ethereumUSTDERC20TokenAddr
}
"
)
cli_ret
"
${
result
}
"
"balance"
".balance"
"0"
echo
'#5.burn YCC from Chain33 YCC(Chain33)-----> Ethereum'
result
=
$(${
CLIA
}
chain33 burn
-m
5
-k
"
${
chain33ReceiverAddrKey
}
"
-r
"
${
ethReceiverAddr1
}
"
-t
"
${
chain33USTDBridgeTokenAddr
}
"
)
cli_ret
"
${
result
}
"
"burn"
sleep
${
maturityDegree
}
echo
"check the balance on chain33"
result
=
$(${
Chain33Cli
}
evm query
-a
"
${
chain33USTDBridgeTokenAddr
}
"
-c
"
${
chain33TestAddr1
}
"
-b
"balanceOf(
${
chain33ReceiverAddr
}
)"
)
# 结果是 12-5 * le8
is_equal
"
${
result
}
"
"700000000"
# 查询 ETH 这端 bridgeBank 地址 7
result
=
$(${
CLIA
}
ethereum balance
-o
"
${
ethBridgeBank
}
"
-t
"
${
ethereumUSTDERC20TokenAddr
}
"
)
cli_ret
"
${
result
}
"
"balance"
".balance"
"7"
# 更新后的金额 5
result
=
$(${
CLIA
}
ethereum balance
-o
"
${
ethReceiverAddr1
}
"
-t
"
${
ethereumUSTDERC20TokenAddr
}
"
)
cli_ret
"
${
result
}
"
"balance"
".balance"
"5"
echo
'#5.burn USTD from Chain33 USTD(Chain33)-----> Ethereum'
result
=
$(${
CLIA
}
chain33 burn
-m
7
-k
"
${
chain33ReceiverAddrKey
}
"
-r
"
${
ethReceiverAddr1
}
"
-t
"
${
chain33USTDBridgeTokenAddr
}
"
)
cli_ret
"
${
result
}
"
"burn"
sleep
${
maturityDegree
}
echo
"check the balance on chain33"
result
=
$(${
Chain33Cli
}
evm query
-a
"
${
chain33USTDBridgeTokenAddr
}
"
-c
"
${
chain33TestAddr1
}
"
-b
"balanceOf(
${
chain33ReceiverAddr
}
)"
)
is_equal
"
${
result
}
"
"0"
# 查询 ETH 这端 bridgeBank 地址 0
result
=
$(${
CLIA
}
ethereum balance
-o
"
${
ethBridgeBank
}
"
-t
"
${
ethereumUSTDERC20TokenAddr
}
"
)
cli_ret
"
${
result
}
"
"balance"
".balance"
"0"
# 更新后的金额 12
result
=
$(${
CLIA
}
ethereum balance
-o
"
${
ethReceiverAddr1
}
"
-t
"
${
ethereumUSTDERC20TokenAddr
}
"
)
cli_ret
"
${
result
}
"
"balance"
".balance"
"12"
echo
-e
"
${
GRE
}
===========
$FUNCNAME
end ===========
${
NOC
}
"
}
# shellcheck disable=SC2120
# shellcheck disable=SC2120
function
offline_set_offline_token_Bty
()
{
function
offline_set_offline_token_Bty
()
{
echo
-e
"
${
GRE
}
===========
$FUNCNAME
begin ===========
${
NOC
}
"
echo
-e
"
${
GRE
}
===========
$FUNCNAME
begin ===========
${
NOC
}
"
...
@@ -470,6 +542,22 @@ function offline_set_offline_token_EthByc() {
...
@@ -470,6 +542,22 @@ function offline_set_offline_token_EthByc() {
echo
-e
"
${
GRE
}
===========
$FUNCNAME
end ===========
${
NOC
}
"
echo
-e
"
${
GRE
}
===========
$FUNCNAME
end ===========
${
NOC
}
"
}
}
# shellcheck disable=SC2120
function
offline_set_offline_token_EthUSTD
()
{
echo
-e
"
${
GRE
}
===========
$FUNCNAME
begin ===========
${
NOC
}
"
local
threshold
=
100
local
percents
=
40
if
[[
$#
-eq
2
]]
;
then
threshold
=
$1
percents
=
$2
fi
# shellcheck disable=SC2086
${
Boss4xCLI
}
ethereum offline set_offline_token
-s
USTD
-m
${
threshold
}
-p
${
percents
}
-t
"
${
ethereumUSTDERC20TokenAddr
}
"
-c
"
${
ethBridgeBank
}
"
-d
"
${
ethDeployAddr
}
"
ethereum_offline_sign_send
"set_offline_token.txt"
echo
-e
"
${
GRE
}
===========
$FUNCNAME
end ===========
${
NOC
}
"
}
function
offline_transfer_multisign_Bty_test
()
{
function
offline_transfer_multisign_Bty_test
()
{
echo
-e
"
${
GRE
}
===========
$FUNCNAME
begin ===========
${
NOC
}
"
echo
-e
"
${
GRE
}
===========
$FUNCNAME
begin ===========
${
NOC
}
"
# transfer test
# transfer test
...
@@ -532,6 +620,12 @@ function initPara() {
...
@@ -532,6 +620,12 @@ function initPara() {
coins_cross_transfer
"
${
chain33DeployKey
}
"
"
${
chain33DeployAddr
}
"
1000 800 500
coins_cross_transfer
"
${
chain33DeployKey
}
"
"
${
chain33DeployAddr
}
"
1000 800 500
coins_cross_transfer
"
${
chain33TestAddrKey1
}
"
"
${
chain33TestAddr1
}
"
1000 800 500
coins_cross_transfer
"
${
chain33TestAddrKey1
}
"
"
${
chain33TestAddr1
}
"
1000 800 500
coins_cross_transfer
"
${
chain33TestAddrKey2
}
"
"
${
chain33TestAddr2
}
"
1000 800 500
coins_cross_transfer
"
${
chain33TestAddrKey2
}
"
"
${
chain33TestAddr2
}
"
1000 800 500
# 平行链共识节点增加测试币
${
MainCli
}
send coins transfer
-a
1000
-n
test
-t
"1KSBd17H7ZK8iT37aJztFB22XGwsPTdwE4"
-k
"
${
chain33ReceiverAddrKey
}
"
${
MainCli
}
send coins transfer
-a
1000
-n
test
-t
"1JRNjdEqp4LJ5fqycUBm9ayCKSeeskgMKR"
-k
"
${
chain33ReceiverAddrKey
}
"
${
MainCli
}
send coins transfer
-a
1000
-n
test
-t
"1NLHPEcbTWWxxU3dGUZBhayjrCHD3psX7k"
-k
"
${
chain33ReceiverAddrKey
}
"
${
MainCli
}
send coins transfer
-a
1000
-n
test
-t
"1MCftFynyvG2F4ED5mdHYgziDxx6vDrScs"
-k
"
${
chain33ReceiverAddrKey
}
"
}
}
# lock bty 判断是否转入多签地址金额是否正确
# lock bty 判断是否转入多签地址金额是否正确
...
@@ -623,6 +717,27 @@ function lockEthByc() {
...
@@ -623,6 +717,27 @@ function lockEthByc() {
echo
-e
"
${
GRE
}
===========
$FUNCNAME
end ===========
${
NOC
}
"
echo
-e
"
${
GRE
}
===========
$FUNCNAME
end ===========
${
NOC
}
"
}
}
function
lockEthUSTD
()
{
echo
-e
"
${
GRE
}
===========
$FUNCNAME
begin ===========
${
NOC
}
"
echo
-e
"
${
GRE
}
===== ethereum 端 lock ERC20 USTD ======
${
NOC
}
"
# echo '2:#配置自动转离线钱包(ycc, 100, 40%)'
offline_set_offline_token_EthUSTD
# 重启 nonce 会不统一 要重启一下
restart_ebrelayerA
lock_ethereum_ustd_multisign 70 70 0
lock_ethereum_ustd_multisign 30 60 40
lock_ethereum_ustd_multisign 60 72 88
# multisignEthAddr 要有手续费
${
CLIA
}
ethereum transfer
-k
"
${
ethDeployKey
}
"
-m
10
-r
"
${
multisignEthAddr
}
"
sleep
10
# transfer
offline_transfer_multisign_EthUSTD
echo
-e
"
${
GRE
}
===========
$FUNCNAME
end ===========
${
NOC
}
"
}
function
StartDockerRelayerDeploy
()
{
function
StartDockerRelayerDeploy
()
{
echo
-e
"
${
GRE
}
===========
$FUNCNAME
begin ===========
${
NOC
}
"
echo
-e
"
${
GRE
}
===========
$FUNCNAME
begin ===========
${
NOC
}
"
...
@@ -701,11 +816,14 @@ function StartDockerRelayerDeploy() {
...
@@ -701,11 +816,14 @@ function StartDockerRelayerDeploy() {
offline_create_bridge_token_eth_YCC
offline_create_bridge_token_eth_YCC
offline_deploy_erc20_chain33_ZBC
offline_deploy_erc20_chain33_ZBC
offline_create_bridge_token_eth_ZBC
offline_create_bridge_token_eth_ZBC
offline_deploy_erc20_eth_USTD
offline_create_bridge_token_chain33_USTD
# shellcheck disable=SC2086
# shellcheck disable=SC2086
{
{
docker
cp
"
${
chain33EthBridgeTokenAddr
}
.abi"
"
${
dockerNamePrefix
}
_ebrelayera_1"
:/root/
${
chain33EthBridgeTokenAddr
}
.abi
docker
cp
"
${
chain33EthBridgeTokenAddr
}
.abi"
"
${
dockerNamePrefix
}
_ebrelayera_1"
:/root/
${
chain33EthBridgeTokenAddr
}
.abi
docker
cp
"
${
chain33BycBridgeTokenAddr
}
.abi"
"
${
dockerNamePrefix
}
_ebrelayera_1"
:/root/
${
chain33BycBridgeTokenAddr
}
.abi
docker
cp
"
${
chain33BycBridgeTokenAddr
}
.abi"
"
${
dockerNamePrefix
}
_ebrelayera_1"
:/root/
${
chain33BycBridgeTokenAddr
}
.abi
docker
cp
"
${
chain33USTDBridgeTokenAddr
}
.abi"
"
${
dockerNamePrefix
}
_ebrelayera_1"
:/root/
${
chain33USTDBridgeTokenAddr
}
.abi
docker
cp
"
${
chain33YccERC20TokenAddr
}
.abi"
"
${
dockerNamePrefix
}
_ebrelayera_1"
:/root/
${
chain33YccERC20TokenAddr
}
.abi
docker
cp
"
${
chain33YccERC20TokenAddr
}
.abi"
"
${
dockerNamePrefix
}
_ebrelayera_1"
:/root/
${
chain33YccERC20TokenAddr
}
.abi
docker
cp
"
${
ethereumYccBridgeTokenAddr
}
.abi"
"
${
dockerNamePrefix
}
_ebrelayera_1"
:/root/
${
ethereumYccBridgeTokenAddr
}
.abi
docker
cp
"
${
ethereumYccBridgeTokenAddr
}
.abi"
"
${
dockerNamePrefix
}
_ebrelayera_1"
:/root/
${
ethereumYccBridgeTokenAddr
}
.abi
}
}
...
@@ -725,8 +843,10 @@ function echo_addrs() {
...
@@ -725,8 +843,10 @@ function echo_addrs() {
echo
-e
"
${
GRE
}
chain33BtyERC20TokenAddr:
${
chain33BtyERC20TokenAddr
}
${
NOC
}
"
echo
-e
"
${
GRE
}
chain33BtyERC20TokenAddr:
${
chain33BtyERC20TokenAddr
}
${
NOC
}
"
echo
-e
"
${
GRE
}
chain33EthBridgeTokenAddr:
${
chain33EthBridgeTokenAddr
}
${
NOC
}
"
echo
-e
"
${
GRE
}
chain33EthBridgeTokenAddr:
${
chain33EthBridgeTokenAddr
}
${
NOC
}
"
echo
-e
"
${
GRE
}
ethereumBtyBridgeTokenAddr:
${
ethereumBtyBridgeTokenAddr
}
${
NOC
}
"
echo
-e
"
${
GRE
}
ethereumBtyBridgeTokenAddr:
${
ethereumBtyBridgeTokenAddr
}
${
NOC
}
"
echo
-e
"
${
GRE
}
chain33BycBridgeTokenAddr:
${
chain33BycBridgeTokenAddr
}
${
NOC
}
"
echo
-e
"
${
GRE
}
ethereumBycERC20TokenAddr:
${
ethereumBycERC20TokenAddr
}
${
NOC
}
"
echo
-e
"
${
GRE
}
ethereumBycERC20TokenAddr:
${
ethereumBycERC20TokenAddr
}
${
NOC
}
"
echo
-e
"
${
GRE
}
chain33BycBridgeTokenAddr:
${
chain33BycBridgeTokenAddr
}
${
NOC
}
"
echo
-e
"
${
GRE
}
ethereumUSTDERC20TokenAddr:
${
ethereumUSTDERC20TokenAddr
}
${
NOC
}
"
echo
-e
"
${
GRE
}
chain33USTDBridgeTokenAddr:
${
chain33USTDBridgeTokenAddr
}
${
NOC
}
"
echo
-e
"
${
GRE
}
chain33YccERC20TokenAddr:
${
chain33YccERC20TokenAddr
}
${
NOC
}
"
echo
-e
"
${
GRE
}
chain33YccERC20TokenAddr:
${
chain33YccERC20TokenAddr
}
${
NOC
}
"
echo
-e
"
${
GRE
}
ethereumYccBridgeTokenAddr:
${
ethereumYccBridgeTokenAddr
}
${
NOC
}
"
echo
-e
"
${
GRE
}
ethereumYccBridgeTokenAddr:
${
ethereumYccBridgeTokenAddr
}
${
NOC
}
"
echo
-e
"
${
GRE
}
chain33ZbcERC20TokenAddr:
${
chain33ZbcERC20TokenAddr
}
${
NOC
}
"
echo
-e
"
${
GRE
}
chain33ZbcERC20TokenAddr:
${
chain33ZbcERC20TokenAddr
}
${
NOC
}
"
...
@@ -786,6 +906,9 @@ function DeployEvmxgo() {
...
@@ -786,6 +906,9 @@ function DeployEvmxgo() {
${
EvmxgoBoss4xCLI
}
chain33 offline create_add_lock_list
-s
BYC
-t
"
${
chain33BycBridgeTokenAddr
}
"
-c
"
${
XgoChain33BridgeBank
}
"
-k
"
${
chain33DeployKey
}
"
-f
1
--chainID
"
${
chain33ID
}
"
${
EvmxgoBoss4xCLI
}
chain33 offline create_add_lock_list
-s
BYC
-t
"
${
chain33BycBridgeTokenAddr
}
"
-c
"
${
XgoChain33BridgeBank
}
"
-k
"
${
chain33DeployKey
}
"
-f
1
--chainID
"
${
chain33ID
}
"
chain33_offline_send_evm
"create_add_lock_list.txt"
chain33_offline_send_evm
"create_add_lock_list.txt"
${
EvmxgoBoss4xCLI
}
chain33 offline create_add_lock_list
-s
USTD
-t
"
${
chain33USTDBridgeTokenAddr
}
"
-c
"
${
XgoChain33BridgeBank
}
"
-k
"
${
chain33DeployKey
}
"
-f
1
--chainID
"
${
chain33ID
}
"
chain33_offline_send_evm
"create_add_lock_list.txt"
# 重启,需要重新启动relayer,更新nonce
# 重启,需要重新启动relayer,更新nonce
restart_ebrelayerA
restart_ebrelayerA
}
}
...
@@ -896,6 +1019,45 @@ function Testethereum2EVMToChain33_byc() {
...
@@ -896,6 +1019,45 @@ function Testethereum2EVMToChain33_byc() {
# is_equal "${result}" "500000000"
# is_equal "${result}" "500000000"
}
}
function
Testethereum2EVMToChain33_ustd
()
{
# 查询 ETH 这端 bridgeBank 地址原来是
result
=
$(${
CLIA
}
ethereum balance
-o
"
${
ethBridgeBank
}
"
-t
"
${
ethereumUSTDERC20TokenAddr
}
"
)
# cli_ret "${result}" "balance" ".balance" "0"
# ETH 这端 lock 12个
result
=
$(${
CLIA
}
ethereum lock
-m
12
-k
"
${
ethTestAddrKey1
}
"
-r
"
${
chain33ReceiverAddr
}
"
-t
"
${
ethereumUSTDERC20TokenAddr
}
"
)
cli_ret
"
${
result
}
"
"lock"
# eth 等待 2 个区块
sleep
4
# 查询 ETH 这端 bridgeBank 地址 12
result
=
$(${
CLIA
}
ethereum balance
-o
"
${
ethBridgeBank
}
"
-t
"
${
ethereumUSTDERC20TokenAddr
}
"
)
# cli_ret "${result}" "balance" ".balance" "12"
sleep
${
maturityDegree
}
# chain33 chain33EthBridgeTokenAddr(ETH合约中)查询 lock 金额
result
=
$(${
Chain33Cli
}
evm query
-a
"
${
chain33USTDBridgeTokenAddr
}
"
-c
"
${
chain33TestAddr1
}
"
-b
"balanceOf(
${
chain33ReceiverAddr
}
)"
)
# 结果是 7 * le8
# is_equal "${result}" "700000000"
updateConfig
"USTD"
"
${
chain33USTDBridgeTokenAddr
}
"
configbridgevmxgoAddr
"
${
XgoChain33BridgeBank
}
"
${
EvmxgoBoss4xCLI
}
chain33 offline approve_erc20
-a
330000000000
-s
"
${
XgoChain33BridgeBank
}
"
-c
"
${
chain33USTDBridgeTokenAddr
}
"
-k
"
${
chain33ReceiverAddrKey
}
"
-f
1
--chainID
"
${
chain33ID
}
"
chain33_offline_send_evm
"approve_erc20.txt"
hash
=
$(${
Chain33Cli
}
send evm call
-f
1
-k
"
${
chain33ReceiverAddr
}
"
-e
"
${
XgoChain33BridgeBank
}
"
-p
"lock(
${
chain33TestAddr2
}
,
${
chain33USTDBridgeTokenAddr
}
, 500000000)"
--chainID
"
${
chain33ID
}
"
)
check_tx
"
${
Chain33Cli
}
"
"
${
hash
}
"
result
=
$(${
Chain33Cli
}
evm query
-a
"
${
chain33USTDBridgeTokenAddr
}
"
-c
"
${
chain33DeployAddr
}
"
-b
"balanceOf(
${
chain33ReceiverAddr
}
)"
)
# is_equal "${result}" "4200000000"
result
=
$(${
Chain33Cli
}
evm query
-a
"
${
chain33USTDBridgeTokenAddr
}
"
-c
"
${
chain33DeployAddr
}
"
-b
"balanceOf(
${
XgoChain33BridgeBank
}
)"
)
# is_equal "${result}" "500000000"
}
function
AllRelayerMainTest
()
{
function
AllRelayerMainTest
()
{
set
+e
set
+e
...
@@ -944,29 +1106,27 @@ function AllRelayerMainTest() {
...
@@ -944,29 +1106,27 @@ function AllRelayerMainTest() {
TestETH2Chain33Assets
TestETH2Chain33Assets
TestChain33ToEthZBCAssets
TestChain33ToEthZBCAssets
TestETH2Chain33Byc
TestETH2Chain33Byc
TestETH2Chain33USTD
Chain33Cli
=
${
Para8901Cli
}
Chain33Cli
=
${
Para8901Cli
}
lockBty
lockBty
lockChain33Ycc
lockChain33Ycc
lockEth
lockEth
lockEthByc
lockEthByc
lockEthUSTD
# 离线多签地址转入阈值设大
# 离线多签地址转入阈值设大
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_EthYcc 100000000000000 10
offline_set_offline_token_EthByc 100000000000000 10
offline_set_offline_token_EthUSTD 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_ustd
# 平行链共识节点增加测试币
${
MainCli
}
send coins transfer
-a
1000
-n
test
-t
"1KSBd17H7ZK8iT37aJztFB22XGwsPTdwE4"
-k
"
${
chain33ReceiverAddrKey
}
"
${
MainCli
}
send coins transfer
-a
1000
-n
test
-t
"1JRNjdEqp4LJ5fqycUBm9ayCKSeeskgMKR"
-k
"
${
chain33ReceiverAddrKey
}
"
${
MainCli
}
send coins transfer
-a
1000
-n
test
-t
"1NLHPEcbTWWxxU3dGUZBhayjrCHD3psX7k"
-k
"
${
chain33ReceiverAddrKey
}
"
${
MainCli
}
send coins transfer
-a
1000
-n
test
-t
"1MCftFynyvG2F4ED5mdHYgziDxx6vDrScs"
-k
"
${
chain33ReceiverAddrKey
}
"
echo_addrs
echo_addrs
echo
-e
"
${
GRE
}
===========
$FUNCNAME
end ===========
${
NOC
}
"
echo
-e
"
${
GRE
}
===========
$FUNCNAME
end ===========
${
NOC
}
"
...
...
plugin/dapp/bridgevmxgo/cmd/build/public/offlinePublic.sh
View file @
f7699199
...
@@ -99,7 +99,7 @@ function InitAndOfflineDeploy() {
...
@@ -99,7 +99,7 @@ function InitAndOfflineDeploy() {
}
}
function
offline_deploy_erc20_eth_BYC
()
{
function
offline_deploy_erc20_eth_BYC
()
{
# eth 上 铸币
YC
C
# eth 上 铸币
BY
C
echo
-e
"
${
GRE
}
======= 在 ethereum 上创建 ERC20 BYC ======
${
NOC
}
"
echo
-e
"
${
GRE
}
======= 在 ethereum 上创建 ERC20 BYC ======
${
NOC
}
"
# shellcheck disable=SC2154
# shellcheck disable=SC2154
${
Boss4xCLI
}
ethereum offline create_erc20
-m
33000000000000000000
-s
BYC
-o
"
${
ethTestAddr1
}
"
-d
"
${
ethDeployAddr
}
"
${
Boss4xCLI
}
ethereum offline create_erc20
-m
33000000000000000000
-s
BYC
-o
"
${
ethTestAddr1
}
"
-d
"
${
ethDeployAddr
}
"
...
@@ -114,8 +114,24 @@ function offline_deploy_erc20_eth_BYC() {
...
@@ -114,8 +114,24 @@ function offline_deploy_erc20_eth_BYC() {
ethereum_offline_sign_send
"create_add_lock_list.txt"
ethereum_offline_sign_send
"create_add_lock_list.txt"
}
}
function
offline_deploy_erc20_eth_USTD
()
{
# eth 上 铸币 USTD
echo
-e
"
${
GRE
}
======= 在 ethereum 上创建 ERC20 USTD ======
${
NOC
}
"
# shellcheck disable=SC2154
${
Boss4xCLI
}
ethereum offline create_erc20
-m
33000000000000000000
-s
USTD
-o
"
${
ethTestAddr1
}
"
-d
"
${
ethDeployAddr
}
"
${
Boss4xCLI
}
ethereum offline sign
-f
"deployErc20USTD.txt"
-k
"
${
ethDeployKey
}
"
sleep
10
result
=
$(${
Boss4xCLI
}
ethereum offline send
-f
"deploysigntxs.txt"
)
hash
=
$(
echo
"
${
result
}
"
| jq
-r
".[0].TxHash"
)
check_eth_tx
"
${
hash
}
"
ethereumUSTDERC20TokenAddr
=
$(
echo
"
${
result
}
"
| jq
-r
".[0].ContractAddr"
)
${
Boss4xCLI
}
ethereum offline create_add_lock_list
-s
USTD
-t
"
${
ethereumUSTDERC20TokenAddr
}
"
-c
"
${
ethBridgeBank
}
"
-d
"
${
ethDeployAddr
}
"
ethereum_offline_sign_send
"create_add_lock_list.txt"
}
function
offline_create_bridge_token_chain33_BYC
()
{
function
offline_create_bridge_token_chain33_BYC
()
{
# 在chain33上创建bridgeToken
YC
C
# 在chain33上创建bridgeToken
BY
C
echo
-e
"
${
GRE
}
======= 在 chain33 上创建 bridgeToken BYC ======
${
NOC
}
"
echo
-e
"
${
GRE
}
======= 在 chain33 上创建 bridgeToken BYC ======
${
NOC
}
"
# shellcheck disable=SC2154
# shellcheck disable=SC2154
${
Boss4xCLI
}
chain33 offline create_bridge_token
-c
"
${
chain33BridgeBank
}
"
-s
BYC
-k
"
${
chain33DeployKey
}
"
--chainID
"
${
chain33ID
}
"
${
Boss4xCLI
}
chain33 offline create_bridge_token
-c
"
${
chain33BridgeBank
}
"
-s
BYC
-k
"
${
chain33DeployKey
}
"
--chainID
"
${
chain33ID
}
"
...
@@ -131,6 +147,23 @@ function offline_create_bridge_token_chain33_BYC() {
...
@@ -131,6 +147,23 @@ function offline_create_bridge_token_chain33_BYC() {
${
CLIA
}
chain33 token
set
-t
"
${
chain33BycBridgeTokenAddr
}
"
-s
BYC
${
CLIA
}
chain33 token
set
-t
"
${
chain33BycBridgeTokenAddr
}
"
-s
BYC
}
}
function
offline_create_bridge_token_chain33_USTD
()
{
# 在chain33上创建bridgeToken USTD
echo
-e
"
${
GRE
}
======= 在 chain33 上创建 bridgeToken USTD ======
${
NOC
}
"
# shellcheck disable=SC2154
${
Boss4xCLI
}
chain33 offline create_bridge_token
-c
"
${
chain33BridgeBank
}
"
-s
USTD
-k
"
${
chain33DeployKey
}
"
--chainID
"
${
chain33ID
}
"
chain33_offline_send
"create_bridge_token.txt"
chain33USTDBridgeTokenAddr
=
$(${
Chain33Cli
}
evm query
-a
"
${
chain33BridgeBank
}
"
-c
"
${
chain33DeployAddr
}
"
-b
"getToken2address(USTD)"
)
echo
"USTD Bridge Token Addr =
${
chain33USTDBridgeTokenAddr
}
"
cp
BridgeToken.abi
"
${
chain33USTDBridgeTokenAddr
}
.abi"
result
=
$(${
Chain33Cli
}
evm query
-a
"
${
chain33USTDBridgeTokenAddr
}
"
-c
"
${
chain33USTDBridgeTokenAddr
}
"
-b
"symbol()"
)
is_equal
"
${
result
}
"
"USTD"
${
CLIA
}
chain33 token
set
-t
"
${
chain33USTDBridgeTokenAddr
}
"
-s
USTD
}
function
offline_deploy_erc20_chain33_YCC
()
{
function
offline_deploy_erc20_chain33_YCC
()
{
# chain33 token create YCC
# chain33 token create YCC
echo
-e
"
${
GRE
}
======= 在 chain33 上创建 ERC20 YCC ======
${
NOC
}
"
echo
-e
"
${
GRE
}
======= 在 chain33 上创建 ERC20 YCC ======
${
NOC
}
"
...
@@ -307,6 +340,35 @@ function offline_transfer_multisign_EthByc() {
...
@@ -307,6 +340,35 @@ function offline_transfer_multisign_EthByc() {
echo
-e
"
${
GRE
}
===========
$FUNCNAME
end ===========
${
NOC
}
"
echo
-e
"
${
GRE
}
===========
$FUNCNAME
end ===========
${
NOC
}
"
}
}
function
offline_transfer_multisign_EthUSTD
()
{
echo
-e
"
${
GRE
}
===========
$FUNCNAME
begin ===========
${
NOC
}
"
# transfer
${
Boss4xCLI
}
ethereum offline multisign_transfer_prepare
-a
8
-r
"
${
ethBridgeBank
}
"
-c
"
${
multisignEthAddr
}
"
-d
"
${
ethTestAddr1
}
"
-t
"
${
ethereumUSTDERC20TokenAddr
}
"
${
Boss4xCLI
}
ethereum offline sign_multisign_tx
-k
"
${
ethMultisignKeyA
}
,
${
ethMultisignKeyB
}
,
${
ethMultisignKeyC
}
,
${
ethMultisignKeyD
}
"
${
Boss4xCLI
}
ethereum offline create_multisign_tx
ethereum_offline_sign_send create_multisign_tx.txt
"
${
ethTestAddrKey1
}
"
sleep
10
result
=
$(${
CLIA
}
ethereum balance
-o
"
${
ethBridgeBank
}
"
-t
"
${
ethereumUSTDERC20TokenAddr
}
"
)
cli_ret
"
${
result
}
"
"balance"
".balance"
"80"
result
=
$(${
CLIA
}
ethereum balance
-o
"
${
multisignEthAddr
}
"
-t
"
${
ethereumUSTDERC20TokenAddr
}
"
)
cli_ret
"
${
result
}
"
"balance"
".balance"
"80"
# transfer
# ${CLIA} ethereum multisign transfer -a 10 -r "${ethMultisignA}" -o "${ethValidatorAddrKeyB}" -t "${ethereumUSTDERC20TokenAddr}" -k "${ethMultisignKeyA},${ethMultisignKeyB},${ethMultisignKeyC},${ethMultisignKeyD}"
${
Boss4xCLI
}
ethereum offline multisign_transfer_prepare
-a
10
-r
"
${
ethMultisignA
}
"
-c
"
${
multisignEthAddr
}
"
-d
"
${
ethTestAddr1
}
"
-t
"
${
ethereumUSTDERC20TokenAddr
}
"
${
Boss4xCLI
}
ethereum offline sign_multisign_tx
-k
"
${
ethMultisignKeyA
}
,
${
ethMultisignKeyB
}
,
${
ethMultisignKeyC
}
,
${
ethMultisignKeyD
}
"
${
Boss4xCLI
}
ethereum offline create_multisign_tx
ethereum_offline_sign_send create_multisign_tx.txt
"
${
ethTestAddrKey1
}
"
sleep
10
result
=
$(${
CLIA
}
ethereum balance
-o
"
${
ethMultisignA
}
"
-t
"
${
ethereumUSTDERC20TokenAddr
}
"
)
cli_ret
"
${
result
}
"
"balance"
".balance"
"10"
result
=
$(${
CLIA
}
ethereum balance
-o
"
${
multisignEthAddr
}
"
-t
"
${
ethereumUSTDERC20TokenAddr
}
"
)
cli_ret
"
${
result
}
"
"balance"
".balance"
"70"
echo
-e
"
${
GRE
}
===========
$FUNCNAME
end ===========
${
NOC
}
"
}
function
offline_transfer_multisign_Chain33Ycc_test
()
{
function
offline_transfer_multisign_Chain33Ycc_test
()
{
echo
-e
"
${
GRE
}
===========
$FUNCNAME
begin ===========
${
NOC
}
"
echo
-e
"
${
GRE
}
===========
$FUNCNAME
begin ===========
${
NOC
}
"
# transfer test
# transfer test
...
...
plugin/dapp/bridgevmxgo/cmd/build/public/relayerPublic.sh
View file @
f7699199
...
@@ -656,6 +656,26 @@ function lock_ethereum_byc_multisign() {
...
@@ -656,6 +656,26 @@ function lock_ethereum_byc_multisign() {
fi
fi
}
}
function
lock_ethereum_ustd_multisign
()
{
local
lockAmount
=
$1
# shellcheck disable=SC2154
result
=
$(${
CLIA
}
ethereum lock
-m
"
${
lockAmount
}
"
-k
"
${
ethTestAddrKey1
}
"
-r
"
${
chain33ReceiverAddr
}
"
-t
"
${
ethereumUSTDERC20TokenAddr
}
"
)
cli_ret
"
${
result
}
"
"lock"
if
[[
$#
-eq
3
]]
;
then
local
bridgeBankBalance
=
$2
local
multisignBalance
=
$3
# eth 等待 2 个区块
sleep
4
result
=
$(${
CLIA
}
ethereum balance
-o
"
${
ethBridgeBank
}
"
-t
"
${
ethereumUSTDERC20TokenAddr
}
"
)
cli_ret
"
${
result
}
"
"balance"
".balance"
"
${
bridgeBankBalance
}
"
result
=
$(${
CLIA
}
ethereum balance
-o
"
${
multisignEthAddr
}
"
-t
"
${
ethereumUSTDERC20TokenAddr
}
"
)
cli_ret
"
${
result
}
"
"balance"
".balance"
"
${
multisignBalance
}
"
fi
}
# 检查交易是否执行成功 $1:交易hash
# 检查交易是否执行成功 $1:交易hash
function
check_eth_tx
()
{
function
check_eth_tx
()
{
local
tx
=
${
1
}
local
tx
=
${
1
}
...
...
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