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
5c42a3b9
Commit
5c42a3b9
authored
Dec 01, 2021
by
QM
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
merge hzj/exchange_order_0929
parent
e44ba57b
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
86 additions
and
4 deletions
+86
-4
dockerRelayerTestEvm.sh
plugin/dapp/bridgevmxgo/cmd/build/dockerRelayerTestEvm.sh
+0
-0
offlinePublic.sh
plugin/dapp/bridgevmxgo/cmd/build/public/offlinePublic.sh
+65
-3
relayerPublic.sh
plugin/dapp/bridgevmxgo/cmd/build/public/relayerPublic.sh
+21
-1
No files found.
plugin/dapp/bridgevmxgo/cmd/build/dockerRelayerTestEvm.sh
View file @
5c42a3b9
This diff is collapsed.
Click to expand it.
plugin/dapp/bridgevmxgo/cmd/build/public/offlinePublic.sh
View file @
5c42a3b9
...
...
@@ -99,7 +99,7 @@ function InitAndOfflineDeploy() {
}
function
offline_deploy_erc20_eth_BYC
()
{
# eth 上 铸币
YC
C
# eth 上 铸币
BY
C
echo
-e
"
${
GRE
}
======= 在 ethereum 上创建 ERC20 BYC ======
${
NOC
}
"
# shellcheck disable=SC2154
${
Boss4xCLI
}
ethereum offline create_erc20
-m
33000000000000000000
-s
BYC
-o
"
${
ethTestAddr1
}
"
-d
"
${
ethDeployAddr
}
"
...
...
@@ -114,8 +114,24 @@ function offline_deploy_erc20_eth_BYC() {
ethereum_offline_sign_send
"create_add_lock_list.txt"
}
function
offline_deploy_erc20_eth_USDT
()
{
# eth 上 铸币 USDT
echo
-e
"
${
GRE
}
======= 在 ethereum 上创建 ERC20 USDT ======
${
NOC
}
"
# shellcheck disable=SC2154
${
Boss4xCLI
}
ethereum offline create_erc20
-m
33000000000000000000
-s
USDT
-o
"
${
ethTestAddr1
}
"
-d
"
${
ethDeployAddr
}
"
${
Boss4xCLI
}
ethereum offline sign
-f
"deployErc20USDT.txt"
-k
"
${
ethDeployKey
}
"
sleep
10
result
=
$(${
Boss4xCLI
}
ethereum offline send
-f
"deploysigntxs.txt"
)
hash
=
$(
echo
"
${
result
}
"
| jq
-r
".[0].TxHash"
)
check_eth_tx
"
${
hash
}
"
ethereumUSDTERC20TokenAddr
=
$(
echo
"
${
result
}
"
| jq
-r
".[0].ContractAddr"
)
${
Boss4xCLI
}
ethereum offline create_add_lock_list
-s
USDT
-t
"
${
ethereumUSDTERC20TokenAddr
}
"
-c
"
${
ethBridgeBank
}
"
-d
"
${
ethDeployAddr
}
"
ethereum_offline_sign_send
"create_add_lock_list.txt"
}
function
offline_create_bridge_token_chain33_BYC
()
{
# 在chain33上创建bridgeToken
YC
C
# 在chain33上创建bridgeToken
BY
C
echo
-e
"
${
GRE
}
======= 在 chain33 上创建 bridgeToken BYC ======
${
NOC
}
"
# shellcheck disable=SC2154
${
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() {
${
CLIA
}
chain33 token
set
-t
"
${
chain33BycBridgeTokenAddr
}
"
-s
BYC
}
function
offline_create_bridge_token_chain33_USDT
()
{
# 在chain33上创建bridgeToken USDT
echo
-e
"
${
GRE
}
======= 在 chain33 上创建 bridgeToken USDT ======
${
NOC
}
"
# shellcheck disable=SC2154
${
Boss4xCLI
}
chain33 offline create_bridge_token
-c
"
${
chain33BridgeBank
}
"
-s
USDT
-k
"
${
chain33DeployKey
}
"
--chainID
"
${
chain33ID
}
"
chain33_offline_send
"create_bridge_token.txt"
chain33USDTBridgeTokenAddr
=
$(${
Chain33Cli
}
evm query
-a
"
${
chain33BridgeBank
}
"
-c
"
${
chain33DeployAddr
}
"
-b
"getToken2address(USDT)"
)
echo
"USDT Bridge Token Addr =
${
chain33USDTBridgeTokenAddr
}
"
cp
BridgeToken.abi
"
${
chain33USDTBridgeTokenAddr
}
.abi"
result
=
$(${
Chain33Cli
}
evm query
-a
"
${
chain33USDTBridgeTokenAddr
}
"
-c
"
${
chain33USDTBridgeTokenAddr
}
"
-b
"symbol()"
)
is_equal
"
${
result
}
"
"USDT"
${
CLIA
}
chain33 token
set
-t
"
${
chain33USDTBridgeTokenAddr
}
"
-s
USDT
}
function
offline_deploy_erc20_chain33_YCC
()
{
# chain33 token create YCC
echo
-e
"
${
GRE
}
======= 在 chain33 上创建 ERC20 YCC ======
${
NOC
}
"
...
...
@@ -278,7 +311,7 @@ function offline_transfer_multisign_Eth_test() {
echo
-e
"
${
GRE
}
===========
$FUNCNAME
end ===========
${
NOC
}
"
}
function
offline_transfer_multisign_Eth
Yc
c
()
{
function
offline_transfer_multisign_Eth
By
c
()
{
echo
-e
"
${
GRE
}
===========
$FUNCNAME
begin ===========
${
NOC
}
"
# transfer
${
Boss4xCLI
}
ethereum offline multisign_transfer_prepare
-a
8
-r
"
${
ethBridgeBank
}
"
-c
"
${
multisignEthAddr
}
"
-d
"
${
ethTestAddr1
}
"
-t
"
${
ethereumBycERC20TokenAddr
}
"
...
...
@@ -307,6 +340,35 @@ function offline_transfer_multisign_EthYcc() {
echo
-e
"
${
GRE
}
===========
$FUNCNAME
end ===========
${
NOC
}
"
}
function
offline_transfer_multisign_EthUSDT
()
{
echo
-e
"
${
GRE
}
===========
$FUNCNAME
begin ===========
${
NOC
}
"
# transfer
${
Boss4xCLI
}
ethereum offline multisign_transfer_prepare
-a
8
-r
"
${
ethBridgeBank
}
"
-c
"
${
multisignEthAddr
}
"
-d
"
${
ethTestAddr1
}
"
-t
"
${
ethereumUSDTERC20TokenAddr
}
"
${
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
"
${
ethereumUSDTERC20TokenAddr
}
"
)
cli_ret
"
${
result
}
"
"balance"
".balance"
"80"
result
=
$(${
CLIA
}
ethereum balance
-o
"
${
multisignEthAddr
}
"
-t
"
${
ethereumUSDTERC20TokenAddr
}
"
)
cli_ret
"
${
result
}
"
"balance"
".balance"
"80"
# transfer
# ${CLIA} ethereum multisign transfer -a 10 -r "${ethMultisignA}" -o "${ethValidatorAddrKeyB}" -t "${ethereumUSDTERC20TokenAddr}" -k "${ethMultisignKeyA},${ethMultisignKeyB},${ethMultisignKeyC},${ethMultisignKeyD}"
${
Boss4xCLI
}
ethereum offline multisign_transfer_prepare
-a
10
-r
"
${
ethMultisignA
}
"
-c
"
${
multisignEthAddr
}
"
-d
"
${
ethTestAddr1
}
"
-t
"
${
ethereumUSDTERC20TokenAddr
}
"
${
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
"
${
ethereumUSDTERC20TokenAddr
}
"
)
cli_ret
"
${
result
}
"
"balance"
".balance"
"10"
result
=
$(${
CLIA
}
ethereum balance
-o
"
${
multisignEthAddr
}
"
-t
"
${
ethereumUSDTERC20TokenAddr
}
"
)
cli_ret
"
${
result
}
"
"balance"
".balance"
"70"
echo
-e
"
${
GRE
}
===========
$FUNCNAME
end ===========
${
NOC
}
"
}
function
offline_transfer_multisign_Chain33Ycc_test
()
{
echo
-e
"
${
GRE
}
===========
$FUNCNAME
begin ===========
${
NOC
}
"
# transfer test
...
...
plugin/dapp/bridgevmxgo/cmd/build/public/relayerPublic.sh
View file @
5c42a3b9
...
...
@@ -636,7 +636,7 @@ function lock_eth_multisign() {
}
# lock ethereum ycc erc20 判断是否转入多签地址金额是否正确
function
lock_ethereum_
yc
c_multisign
()
{
function
lock_ethereum_
by
c_multisign
()
{
local
lockAmount
=
$1
result
=
$(${
CLIA
}
ethereum lock
-m
"
${
lockAmount
}
"
-k
"
${
ethTestAddrKey1
}
"
-r
"
${
chain33ReceiverAddr
}
"
-t
"
${
ethereumBycERC20TokenAddr
}
"
)
cli_ret
"
${
result
}
"
"lock"
...
...
@@ -656,6 +656,26 @@ function lock_ethereum_ycc_multisign() {
fi
}
function
lock_ethereum_usdt_multisign
()
{
local
lockAmount
=
$1
# shellcheck disable=SC2154
result
=
$(${
CLIA
}
ethereum lock
-m
"
${
lockAmount
}
"
-k
"
${
ethTestAddrKey1
}
"
-r
"
${
chain33ReceiverAddr
}
"
-t
"
${
ethereumUSDTERC20TokenAddr
}
"
)
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
"
${
ethereumUSDTERC20TokenAddr
}
"
)
cli_ret
"
${
result
}
"
"balance"
".balance"
"
${
bridgeBankBalance
}
"
result
=
$(${
CLIA
}
ethereum balance
-o
"
${
multisignEthAddr
}
"
-t
"
${
ethereumUSDTERC20TokenAddr
}
"
)
cli_ret
"
${
result
}
"
"balance"
".balance"
"
${
multisignBalance
}
"
fi
}
# 检查交易是否执行成功 $1:交易hash
function
check_eth_tx
()
{
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