Commit c891cc83 authored by QM's avatar QM

rename ycc token name

parent b0d426c8
...@@ -1281,6 +1281,7 @@ golang.org/x/sys v0.0.0-20210906170528-6f6e22806c34/go.mod h1:oPkhp1MJrh7nUepCBc ...@@ -1281,6 +1281,7 @@ golang.org/x/sys v0.0.0-20210906170528-6f6e22806c34/go.mod h1:oPkhp1MJrh7nUepCBc
golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw= golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw=
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1 h1:v+OssWQX+hTHEmOBgwxdZxK4zHq3yOs8F9J7mk0PY8E= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1 h1:v+OssWQX+hTHEmOBgwxdZxK4zHq3yOs8F9J7mk0PY8E=
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
golang.org/x/term v0.0.0-20210615171337-6886f2dfbf5b h1:9zKuko04nR4gjZ4+DNjHqRlAJqbJETHwiNKDqTfOjfE=
golang.org/x/term v0.0.0-20210615171337-6886f2dfbf5b/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.0.0-20210615171337-6886f2dfbf5b/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
......
...@@ -23,11 +23,11 @@ chain33ReceiverAddr="12qyocayNF7Lv6C9qW4avxs2E7U41fKSfv" ...@@ -23,11 +23,11 @@ chain33ReceiverAddr="12qyocayNF7Lv6C9qW4avxs2E7U41fKSfv"
Chain33Cli="../../chain33-cli" Chain33Cli="../../chain33-cli"
chain33BridgeBank="" chain33BridgeBank=""
ethBridgeBank="" ethBridgeBank=""
#chain33BtyTokenAddr="1111111111111111111114oLvT2" #chain33BtyERC20TokenAddr="1111111111111111111114oLvT2"
#chain33EthTokenAddr="" #chain33EthBridgeTokenAddr=""
#ethereumBtyTokenAddr="" #ethereumBtyBridgeTokenAddr=""
#chain33YccTokenAddr="" #chain33BycBridgeTokenAddr=""
ethereumYccTokenAddr="" ethereumBycERC20TokenAddr=""
multisignChain33Addr="" multisignChain33Addr=""
multisignEthAddr="" multisignEthAddr=""
...@@ -146,15 +146,15 @@ function lock_eth_ycc_balance() { ...@@ -146,15 +146,15 @@ function lock_eth_ycc_balance() {
local bridgeBankBalance=$2 local bridgeBankBalance=$2
local multisignBalance=$3 local multisignBalance=$3
result=$(${CLIA} ethereum lock -m "${lockAmount}" -k "${ethDeployKey}" -r "${chain33ReceiverAddr}" -t "${ethereumYccTokenAddr}") result=$(${CLIA} ethereum lock -m "${lockAmount}" -k "${ethDeployKey}" -r "${chain33ReceiverAddr}" -t "${ethereumBycERC20TokenAddr}")
cli_ret "${result}" "lock" cli_ret "${result}" "lock"
# eth 等待 10 个区块 # eth 等待 10 个区块
eth_block_wait 2 eth_block_wait 2
result=$(${CLIA} ethereum balance -o "${ethBridgeBank}" -t "${ethereumYccTokenAddr}") result=$(${CLIA} ethereum balance -o "${ethBridgeBank}" -t "${ethereumBycERC20TokenAddr}")
cli_ret "${result}" "balance" ".balance" "${bridgeBankBalance}" cli_ret "${result}" "balance" ".balance" "${bridgeBankBalance}"
result=$(${CLIA} ethereum balance -o "${multisignEthAddr}" -t "${ethereumYccTokenAddr}") result=$(${CLIA} ethereum balance -o "${multisignEthAddr}" -t "${ethereumBycERC20TokenAddr}")
cli_ret "${result}" "balance" ".balance" "${multisignBalance}" cli_ret "${result}" "balance" ".balance" "${multisignBalance}"
} }
...@@ -162,12 +162,12 @@ function lockEthYcc() { ...@@ -162,12 +162,12 @@ function lockEthYcc() {
echo -e "${GRE}=========== $FUNCNAME begin ===========${NOC}" echo -e "${GRE}=========== $FUNCNAME begin ===========${NOC}"
# echo '2:#配置自动转离线钱包(ycc, 100, 40%)' # echo '2:#配置自动转离线钱包(ycc, 100, 40%)'
result=$(${CLIA} ethereum multisign set_offline_token -s YCC -m 100 -p 40 -t "${ethereumYccTokenAddr}") result=$(${CLIA} ethereum multisign set_offline_token -s BYC -m 100 -p 40 -t "${ethereumBycERC20TokenAddr}")
cli_ret "${result}" "set_offline_token -s YCC -m 100" cli_ret "${result}" "set_offline_token -s YCC -m 100"
result=$(${CLIA} ethereum balance -o "${ethBridgeBank}" -t "${ethereumYccTokenAddr}") result=$(${CLIA} ethereum balance -o "${ethBridgeBank}" -t "${ethereumBycERC20TokenAddr}")
cli_ret "${result}" "balance" ".balance" "0" cli_ret "${result}" "balance" ".balance" "0"
result=$(${CLIA} ethereum balance -o "${multisignEthAddr}" -t "${ethereumYccTokenAddr}") result=$(${CLIA} ethereum balance -o "${multisignEthAddr}" -t "${ethereumBycERC20TokenAddr}")
cli_ret "${result}" "balance" ".balance" "0" cli_ret "${result}" "balance" ".balance" "0"
lock_eth_ycc_balance 70 70 0 lock_eth_ycc_balance 70 70 0
......
...@@ -23,11 +23,11 @@ chain33ReceiverAddr="12qyocayNF7Lv6C9qW4avxs2E7U41fKSfv" ...@@ -23,11 +23,11 @@ chain33ReceiverAddr="12qyocayNF7Lv6C9qW4avxs2E7U41fKSfv"
Chain33Cli="../../chain33-cli" Chain33Cli="../../chain33-cli"
chain33BridgeBank="" chain33BridgeBank=""
ethBridgeBank="" ethBridgeBank=""
#chain33BtyTokenAddr="1111111111111111111114oLvT2" #chain33BtyERC20TokenAddr="1111111111111111111114oLvT2"
#chain33EthTokenAddr="" #chain33EthBridgeTokenAddr=""
#ethereumBtyTokenAddr="" #ethereumBtyBridgeTokenAddr=""
#chain33YccTokenAddr="" #chain33BycBridgeTokenAddr=""
ethereumYccTokenAddr="" ethereumBycERC20TokenAddr=""
multisignChain33Addr="" multisignChain33Addr=""
multisignEthAddr="" multisignEthAddr=""
...@@ -146,15 +146,15 @@ function lock_eth_ycc_balance() { ...@@ -146,15 +146,15 @@ function lock_eth_ycc_balance() {
local bridgeBankBalance=$2 local bridgeBankBalance=$2
local multisignBalance=$3 local multisignBalance=$3
result=$(${CLIA} ethereum lock -m "${lockAmount}" -k "${ethDeployKey}" -r "${chain33ReceiverAddr}" -t "${ethereumYccTokenAddr}") result=$(${CLIA} ethereum lock -m "${lockAmount}" -k "${ethDeployKey}" -r "${chain33ReceiverAddr}" -t "${ethereumBycERC20TokenAddr}")
cli_ret "${result}" "lock" cli_ret "${result}" "lock"
# eth 等待 10 个区块 # eth 等待 10 个区块
eth_block_wait 2 eth_block_wait 2
result=$(${CLIA} ethereum balance -o "${ethBridgeBank}" -t "${ethereumYccTokenAddr}") result=$(${CLIA} ethereum balance -o "${ethBridgeBank}" -t "${ethereumBycERC20TokenAddr}")
cli_ret "${result}" "balance" ".balance" "${bridgeBankBalance}" cli_ret "${result}" "balance" ".balance" "${bridgeBankBalance}"
result=$(${CLIA} ethereum balance -o "${multisignEthAddr}" -t "${ethereumYccTokenAddr}") result=$(${CLIA} ethereum balance -o "${multisignEthAddr}" -t "${ethereumBycERC20TokenAddr}")
cli_ret "${result}" "balance" ".balance" "${multisignBalance}" cli_ret "${result}" "balance" ".balance" "${multisignBalance}"
} }
...@@ -162,12 +162,12 @@ function lockEthYcc() { ...@@ -162,12 +162,12 @@ function lockEthYcc() {
echo -e "${GRE}=========== $FUNCNAME begin ===========${NOC}" echo -e "${GRE}=========== $FUNCNAME begin ===========${NOC}"
# echo '2:#配置自动转离线钱包(ycc, 100, 40%)' # echo '2:#配置自动转离线钱包(ycc, 100, 40%)'
result=$(${CLIA} ethereum multisign set_offline_token -s YCC -m 100 -p 40 -t "${ethereumYccTokenAddr}") result=$(${CLIA} ethereum multisign set_offline_token -s BYC -m 100 -p 40 -t "${ethereumBycERC20TokenAddr}")
cli_ret "${result}" "set_offline_token -s YCC -m 100" cli_ret "${result}" "set_offline_token -s YCC -m 100"
result=$(${CLIA} ethereum balance -o "${ethBridgeBank}" -t "${ethereumYccTokenAddr}") result=$(${CLIA} ethereum balance -o "${ethBridgeBank}" -t "${ethereumBycERC20TokenAddr}")
cli_ret "${result}" "balance" ".balance" "0" cli_ret "${result}" "balance" ".balance" "0"
result=$(${CLIA} ethereum balance -o "${multisignEthAddr}" -t "${ethereumYccTokenAddr}") result=$(${CLIA} ethereum balance -o "${multisignEthAddr}" -t "${ethereumBycERC20TokenAddr}")
cli_ret "${result}" "balance" ".balance" "0" cli_ret "${result}" "balance" ".balance" "0"
lock_eth_ycc_balance 70 70 0 lock_eth_ycc_balance 70 70 0
......
...@@ -29,11 +29,11 @@ chain33ReceiverAddrKey="4257d8692ef7fe13c68b65d6a52f03933db2fa5ce8faf210b5b8b80c ...@@ -29,11 +29,11 @@ chain33ReceiverAddrKey="4257d8692ef7fe13c68b65d6a52f03933db2fa5ce8faf210b5b8b80c
Chain33Cli="../../chain33-cli" Chain33Cli="../../chain33-cli"
chain33BridgeBank="" chain33BridgeBank=""
#ethBridgeBank="" #ethBridgeBank=""
chain33BtyTokenAddr="1111111111111111111114oLvT2" chain33BtyERC20TokenAddr="1111111111111111111114oLvT2"
chain33EthTokenAddr="" chain33EthBridgeTokenAddr=""
ethereumBtyTokenAddr="" ethereumBtyBridgeTokenAddr=""
chain33YccTokenAddr="" chain33BycBridgeTokenAddr=""
ethereumYccTokenAddr="" ethereumBycERC20TokenAddr=""
CLIA="./ebcli_A" CLIA="./ebcli_A"
chain33ID=0 chain33ID=0
...@@ -42,7 +42,7 @@ chain33ID=0 ...@@ -42,7 +42,7 @@ chain33ID=0
function LockTestChain33ToEthAssets() { function LockTestChain33ToEthAssets() {
echo -e "${GRE}=========== $FUNCNAME begin ===========${NOC}" echo -e "${GRE}=========== $FUNCNAME begin ===========${NOC}"
# chain33 lock bty # chain33 lock bty
hash=$(${Chain33Cli} send evm call -f 1 -a 1 -k "${chain33DeployAddr}" -e "${chain33BridgeBank}" -p "lock(${ethSendAddress}, ${chain33BtyTokenAddr}, 100000000)" --khainID "${chain33ID}") hash=$(${Chain33Cli} send evm call -f 1 -a 1 -k "${chain33DeployAddr}" -e "${chain33BridgeBank}" -p "lock(${ethSendAddress}, ${chain33BtyERC20TokenAddr}, 100000000)" --khainID "${chain33ID}")
check_tx "${Chain33Cli}" "${hash}" check_tx "${Chain33Cli}" "${hash}"
echo -e "${GRE}=========== $FUNCNAME end ===========${NOC}" echo -e "${GRE}=========== $FUNCNAME end ===========${NOC}"
} }
...@@ -51,7 +51,7 @@ function LockTestChain33ToEthAssets() { ...@@ -51,7 +51,7 @@ function LockTestChain33ToEthAssets() {
function BurnTestChain33ToEthAssets() { function BurnTestChain33ToEthAssets() {
echo -e "${GRE}=========== $FUNCNAME begin ===========${NOC}" echo -e "${GRE}=========== $FUNCNAME begin ===========${NOC}"
# eth burn # eth burn
result=$(${CLIA} ethereum burn -m 1 -k "${ethSendPrivateKeys}" -r "${chain33DeployAddr}" -t "${ethereumBtyTokenAddr}") #--node_addr https://ropsten.infura.io/v3/9e83f296716142ffbaeaafc05790f26c) result=$(${CLIA} ethereum burn -m 1 -k "${ethSendPrivateKeys}" -r "${chain33DeployAddr}" -t "${ethereumBtyBridgeTokenAddr}") #--node_addr https://ropsten.infura.io/v3/9e83f296716142ffbaeaafc05790f26c)
cli_ret "${result}" "burn" cli_ret "${result}" "burn"
echo -e "${GRE}=========== $FUNCNAME end ===========${NOC}" echo -e "${GRE}=========== $FUNCNAME end ===========${NOC}"
} }
...@@ -68,15 +68,15 @@ function LockTestETH2Chain33Assets() { ...@@ -68,15 +68,15 @@ function LockTestETH2Chain33Assets() {
# eth to chain33 在以太坊上锁定 ETH 资产,然后在 chain33 上 burn # eth to chain33 在以太坊上锁定 ETH 资产,然后在 chain33 上 burn
function BurnTestETH2Chain33Assets() { function BurnTestETH2Chain33Assets() {
echo -e "${GRE}=========== $FUNCNAME begin ===========${NOC}" echo -e "${GRE}=========== $FUNCNAME begin ===========${NOC}"
result=$(${CLIA} chain33 burn -m 2 -k "${chain33ReceiverAddrKey}" -r "${ethSendAddress}" -t "${chain33EthTokenAddr}") result=$(${CLIA} chain33 burn -m 2 -k "${chain33ReceiverAddrKey}" -r "${ethSendAddress}" -t "${chain33EthBridgeTokenAddr}")
cli_ret "${result}" "burn" cli_ret "${result}" "burn"
echo -e "${GRE}=========== $FUNCNAME end ===========${NOC}" echo -e "${GRE}=========== $FUNCNAME end ===========${NOC}"
} }
function LockTestETH2Chain33Ycc() { function LockTestETH2Chain33Ycc() {
echo -e "${GRE}=========== $FUNCNAME begin ===========${NOC}" echo -e "${GRE}=========== $FUNCNAME begin ===========${NOC}"
# ETH 这端 lock 7个 YCC # ETH 这端 lock 3个 BYC
result=$(${CLIA} ethereum lock -m 3 -k "${ethSendPrivateKeys}" -r "${chain33ReceiverAddr}" -t "${ethereumYccTokenAddr}") result=$(${CLIA} ethereum lock -m 3 -k "${ethSendPrivateKeys}" -r "${chain33ReceiverAddr}" -t "${ethereumBycERC20TokenAddr}")
cli_ret "${result}" "lock" cli_ret "${result}" "lock"
echo -e "${GRE}=========== $FUNCNAME end ===========${NOC}" echo -e "${GRE}=========== $FUNCNAME end ===========${NOC}"
} }
...@@ -84,7 +84,7 @@ function LockTestETH2Chain33Ycc() { ...@@ -84,7 +84,7 @@ function LockTestETH2Chain33Ycc() {
function BurnTestETH2Chain33Ycc() { function BurnTestETH2Chain33Ycc() {
echo -e "${GRE}=========== $FUNCNAME begin ===========${NOC}" echo -e "${GRE}=========== $FUNCNAME begin ===========${NOC}"
echo '#5.burn YCC from Chain33 YCC(Chain33)-----> Ethereum' echo '#5.burn YCC from Chain33 YCC(Chain33)-----> Ethereum'
result=$(${CLIA} chain33 burn -m 3 -k "${chain33ReceiverAddrKey}" -r "${ethSendAddress}" -t "${chain33YccTokenAddr}") result=$(${CLIA} chain33 burn -m 3 -k "${chain33ReceiverAddrKey}" -r "${ethSendAddress}" -t "${chain33BycBridgeTokenAddr}")
cli_ret "${result}" "burn" cli_ret "${result}" "burn"
echo -e "${GRE}=========== $FUNCNAME end ===========${NOC}" echo -e "${GRE}=========== $FUNCNAME end ===========${NOC}"
} }
...@@ -94,7 +94,7 @@ function mainTest() { ...@@ -94,7 +94,7 @@ function mainTest() {
start_trufflesuite start_trufflesuite
AllRelayerStart AllRelayerStart
${CLIA} ethereum token token_transfer -k "${ethDeployKey}" -m 10000 -r "${ethSendAddress}" -t "${ethereumYccTokenAddr}" ${CLIA} ethereum token token_transfer -k "${ethDeployKey}" -m 10000 -r "${ethSendAddress}" -t "${ethereumBycERC20TokenAddr}"
for ((i = 0; i < 10; i++)); do for ((i = 0; i < 10; i++)); do
LockTestChain33ToEthAssets LockTestChain33ToEthAssets
......
...@@ -20,15 +20,15 @@ chain33DeployAddr="1N6HstkyLFS8QCeVfdvYxx1xoryXoJtvvZ" ...@@ -20,15 +20,15 @@ chain33DeployAddr="1N6HstkyLFS8QCeVfdvYxx1xoryXoJtvvZ"
Chain33Cli="../../chain33-cli" Chain33Cli="../../chain33-cli"
chain33BridgeBank="" chain33BridgeBank=""
ethBridgeBank="" ethBridgeBank=""
chain33BtyTokenAddr="1111111111111111111114oLvT2" chain33BtyERC20TokenAddr="1111111111111111111114oLvT2"
#chain33EthTokenAddr="" #chain33EthBridgeTokenAddr=""
#ethereumBtyTokenAddr="" #ethereumBtyBridgeTokenAddr=""
#chain33YccTokenAddr="" #chain33BycBridgeTokenAddr=""
ethereumYccTokenAddr="" ethereumBycERC20TokenAddr=""
multisignChain33Addr="" multisignChain33Addr=""
multisignEthAddr="" multisignEthAddr=""
ethBridgeToeknYccAddr="" ethereumYccBridgeTokenAddr=""
chain33YccErc20Addr="" chain33YccERC20TokenAddr=""
CLIA="./ebcli_A" CLIA="./ebcli_A"
chain33ID=0 chain33ID=0
...@@ -39,7 +39,7 @@ multisignChain33Addr=1b193HbfvVUunUL2DVXrqt9jnbAWwLjcT ...@@ -39,7 +39,7 @@ multisignChain33Addr=1b193HbfvVUunUL2DVXrqt9jnbAWwLjcT
function lockBty() { function lockBty() {
echo -e "${GRE}=========== $FUNCNAME begin ===========${NOC}" echo -e "${GRE}=========== $FUNCNAME begin ===========${NOC}"
# echo '2:#配置自动转离线钱包(bty, 100, 50%)' # echo '2:#配置自动转离线钱包(bty, 100, 50%)'
hash=$(${Chain33Cli} send evm call -f 1 -k "${chain33DeployAddr}" -e ${chain33BridgeBank} -p "configLockedTokenOfflineSave(${chain33BtyTokenAddr},BTY,10000000000,50)" --khainID "${chain33ID}") hash=$(${Chain33Cli} send evm call -f 1 -k "${chain33DeployAddr}" -e ${chain33BridgeBank} -p "configLockedTokenOfflineSave(${chain33BtyERC20TokenAddr},BTY,10000000000,50)" --khainID "${chain33ID}")
check_tx "${Chain33Cli}" "${hash}" check_tx "${Chain33Cli}" "${hash}"
result=$(${Chain33Cli} account balance -a "${chain33BridgeBank}" -e evm) result=$(${Chain33Cli} account balance -a "${chain33BridgeBank}" -e evm)
...@@ -81,7 +81,7 @@ function lockBty() { ...@@ -81,7 +81,7 @@ function lockBty() {
function lockChain33Ycc() { function lockChain33Ycc() {
echo -e "${GRE}=========== $FUNCNAME begin ===========${NOC}" echo -e "${GRE}=========== $FUNCNAME begin ===========${NOC}"
# echo '2:#配置自动转离线钱包(YCC, 100, 60%)' # echo '2:#配置自动转离线钱包(YCC, 100, 60%)'
hash=$(${Chain33Cli} send evm call -f 1 -k "${chain33DeployAddr}" -e ${chain33BridgeBank} -p "configLockedTokenOfflineSave(${chain33YccErc20Addr},YCC,10000000000,60)" --chainID "${chain33ID}") hash=$(${Chain33Cli} send evm call -f 1 -k "${chain33DeployAddr}" -e ${chain33BridgeBank} -p "configLockedTokenOfflineSave(${chain33YccERC20TokenAddr},YCC,10000000000,60)" --chainID "${chain33ID}")
check_tx "${Chain33Cli}" "${hash}" check_tx "${Chain33Cli}" "${hash}"
lock_chain33_ycc_multisign 30 30 0 lock_chain33_ycc_multisign 30 30 0
...@@ -91,25 +91,25 @@ function lockChain33Ycc() { ...@@ -91,25 +91,25 @@ function lockChain33Ycc() {
# transfer test # transfer test
# shellcheck disable=SC2154 # shellcheck disable=SC2154
hash=$(${CLIA} chain33 multisign transfer -a 10 -r "${chain33BridgeBank}" -t "${chain33YccErc20Addr}" -k "${chain33MultisignKeyA},${chain33MultisignKeyB},${chain33MultisignKeyC},${chain33MultisignKeyD}" | jq -r ".msg") hash=$(${CLIA} chain33 multisign transfer -a 10 -r "${chain33BridgeBank}" -t "${chain33YccERC20TokenAddr}" -k "${chain33MultisignKeyA},${chain33MultisignKeyB},${chain33MultisignKeyC},${chain33MultisignKeyD}" | jq -r ".msg")
check_tx "${Chain33Cli}" "${hash}" check_tx "${Chain33Cli}" "${hash}"
sleep 2 sleep 2
result=$(${Chain33Cli} evm query -a "${chain33YccErc20Addr}" -c "${chain33BridgeBank}" -b "balanceOf(${chain33BridgeBank})") result=$(${Chain33Cli} evm query -a "${chain33YccERC20TokenAddr}" -c "${chain33BridgeBank}" -b "balanceOf(${chain33BridgeBank})")
is_equal "${result}" "6200000000" is_equal "${result}" "6200000000"
result=$(${Chain33Cli} evm query -a "${chain33YccErc20Addr}" -c "${multisignChain33Addr}" -b "balanceOf(${multisignChain33Addr})") result=$(${Chain33Cli} evm query -a "${chain33YccERC20TokenAddr}" -c "${multisignChain33Addr}" -b "balanceOf(${multisignChain33Addr})")
is_equal "${result}" "30800000000" is_equal "${result}" "30800000000"
# shellcheck disable=SC2154 # shellcheck disable=SC2154
hash=$(${CLIA} chain33 multisign transfer -a 5 -r "${chain33MultisignA}" -t "${chain33YccErc20Addr}" -k "${chain33MultisignKeyA},${chain33MultisignKeyB},${chain33MultisignKeyC},${chain33MultisignKeyD}" | jq -r ".msg") hash=$(${CLIA} chain33 multisign transfer -a 5 -r "${chain33MultisignA}" -t "${chain33YccERC20TokenAddr}" -k "${chain33MultisignKeyA},${chain33MultisignKeyB},${chain33MultisignKeyC},${chain33MultisignKeyD}" | jq -r ".msg")
check_tx "${Chain33Cli}" "${hash}" check_tx "${Chain33Cli}" "${hash}"
sleep 2 sleep 2
result=$(${Chain33Cli} evm query -a "${chain33YccErc20Addr}" -c "${chain33MultisignA}" -b "balanceOf(${chain33MultisignA})") result=$(${Chain33Cli} evm query -a "${chain33YccERC20TokenAddr}" -c "${chain33MultisignA}" -b "balanceOf(${chain33MultisignA})")
is_equal "${result}" "500000000" is_equal "${result}" "500000000"
result=$(${Chain33Cli} evm query -a "${chain33YccErc20Addr}" -c "${multisignChain33Addr}" -b "balanceOf(${multisignChain33Addr})") result=$(${Chain33Cli} evm query -a "${chain33YccERC20TokenAddr}" -c "${multisignChain33Addr}" -b "balanceOf(${multisignChain33Addr})")
is_equal "${result}" "30300000000" is_equal "${result}" "30300000000"
# 判断 ETH 这端是否金额一致 # 判断 ETH 这端是否金额一致
result=$(${CLIA} ethereum balance -o "${ethDeployAddr}" -t "${ethBridgeToeknYccAddr}") result=$(${CLIA} ethereum balance -o "${ethDeployAddr}" -t "${ethereumYccBridgeTokenAddr}")
cli_ret "${result}" "balance" ".balance" "370" cli_ret "${result}" "balance" ".balance" "370"
echo -e "${GRE}=========== $FUNCNAME end ===========${NOC}" echo -e "${GRE}=========== $FUNCNAME end ===========${NOC}"
...@@ -154,12 +154,12 @@ function lockEth() { ...@@ -154,12 +154,12 @@ function lockEth() {
function lockEthYcc() { function lockEthYcc() {
echo -e "${GRE}=========== $FUNCNAME begin ===========${NOC}" echo -e "${GRE}=========== $FUNCNAME begin ===========${NOC}"
# echo '2:#配置自动转离线钱包(ycc, 100, 40%)' # echo '2:#配置自动转离线钱包(ycc, 100, 40%)'
result=$(${CLIA} ethereum multisign set_offline_token -s YCC -m 100 -p 40 -t "${ethereumYccTokenAddr}") result=$(${CLIA} ethereum multisign set_offline_token -s BYC -m 100 -p 40 -t "${ethereumBycERC20TokenAddr}")
cli_ret "${result}" "set_offline_token -s YCC -m 100" cli_ret "${result}" "set_offline_token -s YCC -m 100"
result=$(${CLIA} ethereum balance -o "${ethBridgeBank}" -t "${ethereumYccTokenAddr}") result=$(${CLIA} ethereum balance -o "${ethBridgeBank}" -t "${ethereumBycERC20TokenAddr}")
cli_ret "${result}" "balance" ".balance" "0" cli_ret "${result}" "balance" ".balance" "0"
result=$(${CLIA} ethereum balance -o "${multisignEthAddr}" -t "${ethereumYccTokenAddr}") result=$(${CLIA} ethereum balance -o "${multisignEthAddr}" -t "${ethereumBycERC20TokenAddr}")
cli_ret "${result}" "balance" ".balance" "0" cli_ret "${result}" "balance" ".balance" "0"
lock_ethereum_ycc_multisign 70 70 0 lock_ethereum_ycc_multisign 70 70 0
...@@ -171,19 +171,19 @@ function lockEthYcc() { ...@@ -171,19 +171,19 @@ function lockEthYcc() {
./ebcli_A ethereum transfer -k "${ethDeployKey}" -m 10 -r "${multisignEthAddr}" ./ebcli_A ethereum transfer -k "${ethDeployKey}" -m 10 -r "${multisignEthAddr}"
# transfer # transfer
${CLIA} ethereum multisign transfer -a 8 -r "${ethBridgeBank}" -t "${ethereumYccTokenAddr}" -k "${ethMultisignKeyA},${ethMultisignKeyB},${ethMultisignKeyC},${ethMultisignKeyD}" ${CLIA} ethereum multisign transfer -a 8 -r "${ethBridgeBank}" -t "${ethereumBycERC20TokenAddr}" -k "${ethMultisignKeyA},${ethMultisignKeyB},${ethMultisignKeyC},${ethMultisignKeyD}"
sleep 2 sleep 2
result=$(${CLIA} ethereum balance -o "${ethBridgeBank}" -t "${ethereumYccTokenAddr}") result=$(${CLIA} ethereum balance -o "${ethBridgeBank}" -t "${ethereumBycERC20TokenAddr}")
cli_ret "${result}" "balance" ".balance" "80" cli_ret "${result}" "balance" ".balance" "80"
result=$(${CLIA} ethereum balance -o "${multisignEthAddr}" -t "${ethereumYccTokenAddr}") result=$(${CLIA} ethereum balance -o "${multisignEthAddr}" -t "${ethereumBycERC20TokenAddr}")
cli_ret "${result}" "balance" ".balance" "80" cli_ret "${result}" "balance" ".balance" "80"
# transfer # transfer
${CLIA} ethereum multisign transfer -a 10 -r "${ethMultisignA}" -t "${ethereumYccTokenAddr}" -k "${ethMultisignKeyA},${ethMultisignKeyB},${ethMultisignKeyC},${ethMultisignKeyD}" ${CLIA} ethereum multisign transfer -a 10 -r "${ethMultisignA}" -t "${ethereumBycERC20TokenAddr}" -k "${ethMultisignKeyA},${ethMultisignKeyB},${ethMultisignKeyC},${ethMultisignKeyD}"
sleep 2 sleep 2
result=$(${CLIA} ethereum balance -o "${ethMultisignA}" -t "${ethereumYccTokenAddr}") result=$(${CLIA} ethereum balance -o "${ethMultisignA}" -t "${ethereumBycERC20TokenAddr}")
cli_ret "${result}" "balance" ".balance" "10" cli_ret "${result}" "balance" ".balance" "10"
result=$(${CLIA} ethereum balance -o "${multisignEthAddr}" -t "${ethereumYccTokenAddr}") result=$(${CLIA} ethereum balance -o "${multisignEthAddr}" -t "${ethereumBycERC20TokenAddr}")
cli_ret "${result}" "balance" ".balance" "70" cli_ret "${result}" "balance" ".balance" "70"
echo -e "${GRE}=========== $FUNCNAME end ===========${NOC}" echo -e "${GRE}=========== $FUNCNAME end ===========${NOC}"
} }
......
...@@ -32,16 +32,16 @@ chain33ID=0 ...@@ -32,16 +32,16 @@ chain33ID=0
chain33BridgeBank="" chain33BridgeBank=""
#BridgeRegistryOnEth="" #BridgeRegistryOnEth=""
ethBridgeBank="" ethBridgeBank=""
chain33BtyTokenAddr="1111111111111111111114oLvT2" chain33BtyERC20TokenAddr="1111111111111111111114oLvT2"
chain33EthTokenAddr="" chain33EthBridgeTokenAddr=""
ethereumBtyTokenAddr="" ethereumBtyBridgeTokenAddr=""
chain33YccTokenAddr="" chain33BycBridgeTokenAddr=""
ethereumYccTokenAddr="" ethereumBycERC20TokenAddr=""
# chain33 lock BTY, eth burn BTY # chain33 lock BTY, eth burn BTY
function TestChain33ToEthAssets() { function TestChain33ToEthAssets() {
echo -e "${GRE}=========== $FUNCNAME begin ===========${NOC}" echo -e "${GRE}=========== $FUNCNAME begin ===========${NOC}"
result=$(${CLIA} ethereum balance -o "${ethDeployAddr}" -t "${ethereumBtyTokenAddr}") result=$(${CLIA} ethereum balance -o "${ethDeployAddr}" -t "${ethereumBtyBridgeTokenAddr}")
cli_ret "${result}" "balance" ".balance" "0" cli_ret "${result}" "balance" ".balance" "0"
# 原来的地址金额 # 原来的地址金额
...@@ -49,7 +49,7 @@ function TestChain33ToEthAssets() { ...@@ -49,7 +49,7 @@ function TestChain33ToEthAssets() {
# balance=$(cli_ret "${result}" "balance" ".balance") # balance=$(cli_ret "${result}" "balance" ".balance")
# chain33 lock bty # chain33 lock bty
hash=$(${Chain33Cli} send evm call -f 1 -a 5 -k "${chain33DeployAddr}" -e "${chain33BridgeBank}" -p "lock(${ethDeployAddr}, ${chain33BtyTokenAddr}, 500000000)" --khainID "${chain33ID}") hash=$(${Chain33Cli} send evm call -f 1 -a 5 -k "${chain33DeployAddr}" -e "${chain33BridgeBank}" -p "lock(${ethDeployAddr}, ${chain33BtyERC20TokenAddr}, 500000000)" --khainID "${chain33ID}")
check_tx "${Chain33Cli}" "${hash}" check_tx "${Chain33Cli}" "${hash}"
# 原来的地址金额 减少了 5 # 原来的地址金额 减少了 5
...@@ -64,17 +64,17 @@ function TestChain33ToEthAssets() { ...@@ -64,17 +64,17 @@ function TestChain33ToEthAssets() {
eth_block_wait 2 eth_block_wait 2
# eth 这端 金额是否增加了 5 # eth 这端 金额是否增加了 5
result=$(${CLIA} ethereum balance -o "${ethDeployAddr}" -t "${ethereumBtyTokenAddr}") result=$(${CLIA} ethereum balance -o "${ethDeployAddr}" -t "${ethereumBtyBridgeTokenAddr}")
cli_ret "${result}" "balance" ".balance" "5" cli_ret "${result}" "balance" ".balance" "5"
# eth burn # eth burn
result=$(${CLIA} ethereum burn -m 3 -k "${ethDeployKey}" -r "${chain33ReceiverAddr}" -t "${ethereumBtyTokenAddr}") #--node_addr https://ropsten.infura.io/v3/9e83f296716142ffbaeaafc05790f26c) result=$(${CLIA} ethereum burn -m 3 -k "${ethDeployKey}" -r "${chain33ReceiverAddr}" -t "${ethereumBtyBridgeTokenAddr}") #--node_addr https://ropsten.infura.io/v3/9e83f296716142ffbaeaafc05790f26c)
cli_ret "${result}" "burn" cli_ret "${result}" "burn"
eth_block_wait 2 eth_block_wait 2
# eth 这端 金额是否减少了 3 # eth 这端 金额是否减少了 3
result=$(${CLIA} ethereum balance -o "${ethDeployAddr}" -t "${ethereumBtyTokenAddr}") result=$(${CLIA} ethereum balance -o "${ethDeployAddr}" -t "${ethereumBtyBridgeTokenAddr}")
cli_ret "${result}" "balance" ".balance" "2" cli_ret "${result}" "balance" ".balance" "2"
sleep ${maturityDegree} sleep ${maturityDegree}
...@@ -110,8 +110,8 @@ function TestETH2Chain33Assets() { ...@@ -110,8 +110,8 @@ function TestETH2Chain33Assets() {
sleep ${maturityDegree} sleep ${maturityDegree}
# chain33 chain33EthTokenAddr(ETH合约中)查询 lock 金额 # chain33 chain33EthBridgeTokenAddr(ETH合约中)查询 lock 金额
result=$(${Chain33Cli} evm query -a "${chain33EthTokenAddr}" -c "${chain33DeployAddr}" -b "balanceOf(${chain33ReceiverAddr})") result=$(${Chain33Cli} evm query -a "${chain33EthBridgeTokenAddr}" -c "${chain33DeployAddr}" -b "balanceOf(${chain33ReceiverAddr})")
# 结果是 11 * le8 # 结果是 11 * le8
is_equal "${result}" "1100000000" is_equal "${result}" "1100000000"
...@@ -120,12 +120,12 @@ function TestETH2Chain33Assets() { ...@@ -120,12 +120,12 @@ function TestETH2Chain33Assets() {
cli_ret "${result}" "balance" ".balance" "100" cli_ret "${result}" "balance" ".balance" "100"
echo '#5.burn ETH from Chain33 ETH(Chain33)-----> Ethereum' echo '#5.burn ETH from Chain33 ETH(Chain33)-----> Ethereum'
${CLIA} chain33 burn -m 5 -k "${chain33ReceiverAddrKey}" -r "${ethValidatorAddrB}" -t "${chain33EthTokenAddr}" ${CLIA} chain33 burn -m 5 -k "${chain33ReceiverAddrKey}" -r "${ethValidatorAddrB}" -t "${chain33EthBridgeTokenAddr}"
sleep ${maturityDegree} sleep ${maturityDegree}
echo "check the balance on chain33" echo "check the balance on chain33"
result=$(${Chain33Cli} evm query -a "${chain33EthTokenAddr}" -c "${chain33DeployAddr}" -b "balanceOf(${chain33ReceiverAddr})") result=$(${Chain33Cli} evm query -a "${chain33EthBridgeTokenAddr}" -c "${chain33DeployAddr}" -b "balanceOf(${chain33ReceiverAddr})")
# 结果是 11-5 * le8 # 结果是 11-5 * le8
is_equal "${result}" "600000000" is_equal "${result}" "600000000"
...@@ -144,47 +144,47 @@ function TestETH2Chain33Ycc() { ...@@ -144,47 +144,47 @@ function TestETH2Chain33Ycc() {
echo -e "${GRE}=========== $FUNCNAME begin ===========${NOC}" echo -e "${GRE}=========== $FUNCNAME begin ===========${NOC}"
# 查询 ETH 这端 bridgeBank 地址原来是 0 # 查询 ETH 这端 bridgeBank 地址原来是 0
result=$(${CLIA} ethereum balance -o "${ethBridgeBank}" -t "${ethereumYccTokenAddr}") result=$(${CLIA} ethereum balance -o "${ethBridgeBank}" -t "${ethereumBycERC20TokenAddr}")
cli_ret "${result}" "balance" ".balance" "0" cli_ret "${result}" "balance" ".balance" "0"
# ETH 这端 lock 7个 YCC # ETH 这端 lock 7个 YCC
result=$(${CLIA} ethereum lock -m 7 -k "${ethDeployKey}" -r "${chain33ReceiverAddr}" -t "${ethereumYccTokenAddr}") result=$(${CLIA} ethereum lock -m 7 -k "${ethDeployKey}" -r "${chain33ReceiverAddr}" -t "${ethereumBycERC20TokenAddr}")
cli_ret "${result}" "lock" cli_ret "${result}" "lock"
# eth 等待 10 个区块 # eth 等待 10 个区块
eth_block_wait 2 eth_block_wait 2
# 查询 ETH 这端 bridgeBank 地址 7 YCC # 查询 ETH 这端 bridgeBank 地址 7 YCC
result=$(${CLIA} ethereum balance -o "${ethBridgeBank}" -t "${ethereumYccTokenAddr}") result=$(${CLIA} ethereum balance -o "${ethBridgeBank}" -t "${ethereumBycERC20TokenAddr}")
cli_ret "${result}" "balance" ".balance" "7" cli_ret "${result}" "balance" ".balance" "7"
sleep ${maturityDegree} sleep ${maturityDegree}
# chain33 chain33EthTokenAddr(ETH合约中)查询 lock 金额 # chain33 chain33EthBridgeTokenAddr(ETH合约中)查询 lock 金额
result=$(${Chain33Cli} evm query -a "${chain33YccTokenAddr}" -c "${chain33DeployAddr}" -b "balanceOf(${chain33ReceiverAddr})") result=$(${Chain33Cli} evm query -a "${chain33BycBridgeTokenAddr}" -c "${chain33DeployAddr}" -b "balanceOf(${chain33ReceiverAddr})")
# 结果是 7 * le8 # 结果是 7 * le8
is_equal "${result}" "700000000" is_equal "${result}" "700000000"
# 原来的数额 0 # 原来的数额 0
result=$(${CLIA} ethereum balance -o "${ethValidatorAddrB}" -t "${ethereumYccTokenAddr}") result=$(${CLIA} ethereum balance -o "${ethValidatorAddrB}" -t "${ethereumBycERC20TokenAddr}")
cli_ret "${result}" "balance" ".balance" "0" cli_ret "${result}" "balance" ".balance" "0"
echo '#5.burn YCC from Chain33 YCC(Chain33)-----> Ethereum' echo '#5.burn YCC from Chain33 YCC(Chain33)-----> Ethereum'
${CLIA} chain33 burn -m 5 -k "${chain33ReceiverAddrKey}" -r "${ethValidatorAddrB}" -t "${chain33YccTokenAddr}" ${CLIA} chain33 burn -m 5 -k "${chain33ReceiverAddrKey}" -r "${ethValidatorAddrB}" -t "${chain33BycBridgeTokenAddr}"
sleep ${maturityDegree} sleep ${maturityDegree}
echo "check the balance on chain33" echo "check the balance on chain33"
result=$(${Chain33Cli} evm query -a "${chain33YccTokenAddr}" -c "${chain33DeployAddr}" -b "balanceOf(${chain33ReceiverAddr})") result=$(${Chain33Cli} evm query -a "${chain33BycBridgeTokenAddr}" -c "${chain33DeployAddr}" -b "balanceOf(${chain33ReceiverAddr})")
# 结果是 7-5 * le8 # 结果是 7-5 * le8
is_equal "${result}" "200000000" is_equal "${result}" "200000000"
# 查询 ETH 这端 bridgeBank 地址 2 # 查询 ETH 这端 bridgeBank 地址 2
result=$(${CLIA} ethereum balance -o "${ethBridgeBank}" -t "${ethereumYccTokenAddr}") result=$(${CLIA} ethereum balance -o "${ethBridgeBank}" -t "${ethereumBycERC20TokenAddr}")
cli_ret "${result}" "balance" ".balance" "2" cli_ret "${result}" "balance" ".balance" "2"
# 更新后的金额 5 # 更新后的金额 5
result=$(${CLIA} ethereum balance -o "${ethValidatorAddrB}" -t "${ethereumYccTokenAddr}") result=$(${CLIA} ethereum balance -o "${ethValidatorAddrB}" -t "${ethereumBycERC20TokenAddr}")
cli_ret "${result}" "balance" ".balance" "5" cli_ret "${result}" "balance" ".balance" "5"
echo -e "${GRE}=========== $FUNCNAME end ===========${NOC}" echo -e "${GRE}=========== $FUNCNAME end ===========${NOC}"
......
...@@ -28,15 +28,15 @@ maturityDegree=10 ...@@ -28,15 +28,15 @@ maturityDegree=10
chain33BridgeBank="" chain33BridgeBank=""
ethBridgeBank="" ethBridgeBank=""
chain33BtyTokenAddr="1111111111111111111114oLvT2" chain33BtyERC20TokenAddr="1111111111111111111114oLvT2"
chain33EthTokenAddr="" chain33EthBridgeTokenAddr=""
ethereumBtyTokenAddr="" ethereumBtyBridgeTokenAddr=""
chain33YccTokenAddr="" chain33BycBridgeTokenAddr=""
ethereumYccTokenAddr="" ethereumBycERC20TokenAddr=""
BridgeRegistryOnChain33="" BridgeRegistryOnChain33=""
chain33YccErc20Addr="" chain33YccERC20TokenAddr=""
BridgeRegistryOnEth="" BridgeRegistryOnEth=""
ethBridgeToeknYccAddr="" ethereumYccBridgeTokenAddr=""
# validatorsAddr=["0x8afdadfc88a1087c9a1d6c0f5dd04634b87f303a", "0x0df9a824699bc5878232c9e612fe1a5346a5a368", "0xcb074cb21cdddf3ce9c3c0a7ac4497d633c9d9f1", "0xd9dab021e74ecf475788ed7b61356056b2095830"] # validatorsAddr=["0x8afdadfc88a1087c9a1d6c0f5dd04634b87f303a", "0x0df9a824699bc5878232c9e612fe1a5346a5a368", "0xcb074cb21cdddf3ce9c3c0a7ac4497d633c9d9f1", "0xd9dab021e74ecf475788ed7b61356056b2095830"]
#ethValidatorAddrKeyA="8656d2bc732a8a816a461ba5e2d8aac7c7f85c26a813df30d5327210465eb230" #ethValidatorAddrKeyA="8656d2bc732a8a816a461ba5e2d8aac7c7f85c26a813df30d5327210465eb230"
...@@ -151,17 +151,17 @@ function StartDockerRelayerDeploy() { ...@@ -151,17 +151,17 @@ function StartDockerRelayerDeploy() {
# 设置 token 地址 # 设置 token 地址
InitTokenAddr InitTokenAddr
docker cp "${chain33EthTokenAddr}.abi" "${dockerNamePrefix}_ebrelayera_1":/root/${chain33EthTokenAddr}.abi docker cp "${chain33EthBridgeTokenAddr}.abi" "${dockerNamePrefix}_ebrelayera_1":/root/${chain33EthBridgeTokenAddr}.abi
docker cp "${chain33YccTokenAddr}.abi" "${dockerNamePrefix}_ebrelayera_1":/root/${chain33YccTokenAddr}.abi docker cp "${chain33BycBridgeTokenAddr}.abi" "${dockerNamePrefix}_ebrelayera_1":/root/${chain33BycBridgeTokenAddr}.abi
docker cp "${chain33YccErc20Addr}.abi" "${dockerNamePrefix}_ebrelayera_1":/root/${chain33YccErc20Addr}.abi docker cp "${chain33YccERC20TokenAddr}.abi" "${dockerNamePrefix}_ebrelayera_1":/root/${chain33YccERC20TokenAddr}.abi
docker cp "${ethBridgeToeknYccAddr}.abi" "${dockerNamePrefix}_ebrelayera_1":/root/${ethBridgeToeknYccAddr}.abi docker cp "${ethereumYccBridgeTokenAddr}.abi" "${dockerNamePrefix}_ebrelayera_1":/root/${ethereumYccBridgeTokenAddr}.abi
echo -e "${GRE}=========== $FUNCNAME end ===========${NOC}" echo -e "${GRE}=========== $FUNCNAME end ===========${NOC}"
} }
# chain33 lock BTY, eth burn BTY # chain33 lock BTY, eth burn BTY
function TestChain33ToEthAssets() { function TestChain33ToEthAssets() {
echo -e "${GRE}=========== $FUNCNAME begin ===========${NOC}" echo -e "${GRE}=========== $FUNCNAME begin ===========${NOC}"
result=$(${CLIA} ethereum balance -o "${ethDeployAddr}" -t "${ethereumBtyTokenAddr}") result=$(${CLIA} ethereum balance -o "${ethDeployAddr}" -t "${ethereumBtyBridgeTokenAddr}")
cli_ret "${result}" "balance" ".balance" "0" cli_ret "${result}" "balance" ".balance" "0"
# 原来的地址金额 # 原来的地址金额
...@@ -169,7 +169,7 @@ function TestChain33ToEthAssets() { ...@@ -169,7 +169,7 @@ function TestChain33ToEthAssets() {
# balance=$(cli_ret "${result}" "balance" ".balance") # balance=$(cli_ret "${result}" "balance" ".balance")
# chain33 lock bty # chain33 lock bty
hash=$(${Chain33Cli} send evm call -f 1 -a 5 -k "${chain33DeployAddr}" -e "${chain33BridgeBank}" -p "lock(${ethDeployAddr}, ${chain33BtyTokenAddr}, 500000000)") hash=$(${Chain33Cli} send evm call -f 1 -a 5 -k "${chain33DeployAddr}" -e "${chain33BridgeBank}" -p "lock(${ethDeployAddr}, ${chain33BtyERC20TokenAddr}, 500000000)")
check_tx "${Chain33Cli}" "${hash}" check_tx "${Chain33Cli}" "${hash}"
# 原来的地址金额 减少了 5 # 原来的地址金额 减少了 5
...@@ -185,18 +185,18 @@ function TestChain33ToEthAssets() { ...@@ -185,18 +185,18 @@ function TestChain33ToEthAssets() {
# eth_block_wait 2 "${ethUrl}" # eth_block_wait 2 "${ethUrl}"
# eth 这端 金额是否增加了 5 # eth 这端 金额是否增加了 5
result=$(${CLIA} ethereum balance -o "${ethDeployAddr}" -t "${ethereumBtyTokenAddr}") result=$(${CLIA} ethereum balance -o "${ethDeployAddr}" -t "${ethereumBtyBridgeTokenAddr}")
cli_ret "${result}" "balance" ".balance" "5" cli_ret "${result}" "balance" ".balance" "5"
# eth burn # eth burn
result=$(${CLIA} ethereum burn -m 3 -k "${ethDeployKey}" -r "${chain33ReceiverAddr}" -t "${ethereumBtyTokenAddr}") #--node_addr https://ropsten.infura.io/v3/9e83f296716142ffbaeaafc05790f26c) result=$(${CLIA} ethereum burn -m 3 -k "${ethDeployKey}" -r "${chain33ReceiverAddr}" -t "${ethereumBtyBridgeTokenAddr}") #--node_addr https://ropsten.infura.io/v3/9e83f296716142ffbaeaafc05790f26c)
cli_ret "${result}" "burn" cli_ret "${result}" "burn"
sleep 2 sleep 2
# eth_block_wait 2 "${ethUrl}" # eth_block_wait 2 "${ethUrl}"
# eth 这端 金额是否减少了 3 # eth 这端 金额是否减少了 3
result=$(${CLIA} ethereum balance -o "${ethDeployAddr}" -t "${ethereumBtyTokenAddr}") result=$(${CLIA} ethereum balance -o "${ethDeployAddr}" -t "${ethereumBtyBridgeTokenAddr}")
cli_ret "${result}" "balance" ".balance" "2" cli_ret "${result}" "balance" ".balance" "2"
sleep ${maturityDegree} sleep ${maturityDegree}
...@@ -233,8 +233,8 @@ function TestETH2Chain33Assets() { ...@@ -233,8 +233,8 @@ function TestETH2Chain33Assets() {
sleep ${maturityDegree} sleep ${maturityDegree}
# chain33 chain33EthTokenAddr(ETH合约中)查询 lock 金额 # chain33 chain33EthBridgeTokenAddr(ETH合约中)查询 lock 金额
result=$(${Chain33Cli} evm query -a "${chain33EthTokenAddr}" -c "${chain33DeployAddr}" -b "balanceOf(${chain33ReceiverAddr})") result=$(${Chain33Cli} evm query -a "${chain33EthBridgeTokenAddr}" -c "${chain33DeployAddr}" -b "balanceOf(${chain33ReceiverAddr})")
# 结果是 11 * le8 # 结果是 11 * le8
is_equal "${result}" "1100000000" is_equal "${result}" "1100000000"
...@@ -243,12 +243,12 @@ function TestETH2Chain33Assets() { ...@@ -243,12 +243,12 @@ function TestETH2Chain33Assets() {
cli_ret "${result}" "balance" ".balance" "100" cli_ret "${result}" "balance" ".balance" "100"
echo '#5.burn ETH from Chain33 ETH(Chain33)-----> Ethereum' echo '#5.burn ETH from Chain33 ETH(Chain33)-----> Ethereum'
${CLIA} chain33 burn -m 5 -k "${chain33ReceiverAddrKey}" -r "${ethReceiverAddr1}" -t "${chain33EthTokenAddr}" ${CLIA} chain33 burn -m 5 -k "${chain33ReceiverAddrKey}" -r "${ethReceiverAddr1}" -t "${chain33EthBridgeTokenAddr}"
sleep ${maturityDegree} sleep ${maturityDegree}
echo "check the balance on chain33" echo "check the balance on chain33"
result=$(${Chain33Cli} evm query -a "${chain33EthTokenAddr}" -c "${chain33DeployAddr}" -b "balanceOf(${chain33ReceiverAddr})") result=$(${Chain33Cli} evm query -a "${chain33EthBridgeTokenAddr}" -c "${chain33DeployAddr}" -b "balanceOf(${chain33ReceiverAddr})")
# 结果是 11-5 * le8 # 结果是 11-5 * le8
is_equal "${result}" "600000000" is_equal "${result}" "600000000"
...@@ -266,11 +266,11 @@ function TestETH2Chain33Assets() { ...@@ -266,11 +266,11 @@ function TestETH2Chain33Assets() {
function TestETH2Chain33Ycc() { function TestETH2Chain33Ycc() {
echo -e "${GRE}=========== $FUNCNAME begin ===========${NOC}" echo -e "${GRE}=========== $FUNCNAME begin ===========${NOC}"
# 查询 ETH 这端 bridgeBank 地址原来是 0 # 查询 ETH 这端 bridgeBank 地址原来是 0
result=$(${CLIA} ethereum balance -o "${ethBridgeBank}" -t "${ethereumYccTokenAddr}") result=$(${CLIA} ethereum balance -o "${ethBridgeBank}" -t "${ethereumBycERC20TokenAddr}")
cli_ret "${result}" "balance" ".balance" "0" cli_ret "${result}" "balance" ".balance" "0"
# ETH 这端 lock 7个 YCC # ETH 这端 lock 7个 YCC
result=$(${CLIA} ethereum lock -m 7 -k "${ethDeployKey}" -r "${chain33ReceiverAddr}" -t "${ethereumYccTokenAddr}") result=$(${CLIA} ethereum lock -m 7 -k "${ethDeployKey}" -r "${chain33ReceiverAddr}" -t "${ethereumBycERC20TokenAddr}")
cli_ret "${result}" "lock" cli_ret "${result}" "lock"
# eth 等待 10 个区块 # eth 等待 10 个区块
...@@ -278,36 +278,36 @@ function TestETH2Chain33Ycc() { ...@@ -278,36 +278,36 @@ function TestETH2Chain33Ycc() {
# eth_block_wait 2 "${ethUrl}" # eth_block_wait 2 "${ethUrl}"
# 查询 ETH 这端 bridgeBank 地址 7 YCC # 查询 ETH 这端 bridgeBank 地址 7 YCC
result=$(${CLIA} ethereum balance -o "${ethBridgeBank}" -t "${ethereumYccTokenAddr}") result=$(${CLIA} ethereum balance -o "${ethBridgeBank}" -t "${ethereumBycERC20TokenAddr}")
cli_ret "${result}" "balance" ".balance" "7" cli_ret "${result}" "balance" ".balance" "7"
sleep ${maturityDegree} sleep ${maturityDegree}
# chain33 chain33EthTokenAddr(ETH合约中)查询 lock 金额 # chain33 chain33EthBridgeTokenAddr(ETH合约中)查询 lock 金额
result=$(${Chain33Cli} evm query -a "${chain33YccTokenAddr}" -c "${chain33DeployAddr}" -b "balanceOf(${chain33ReceiverAddr})") result=$(${Chain33Cli} evm query -a "${chain33BycBridgeTokenAddr}" -c "${chain33DeployAddr}" -b "balanceOf(${chain33ReceiverAddr})")
# 结果是 7 * le8 # 结果是 7 * le8
is_equal "${result}" "700000000" is_equal "${result}" "700000000"
# 原来的数额 0 # 原来的数额 0
result=$(${CLIA} ethereum balance -o "${ethReceiverAddr1}" -t "${ethereumYccTokenAddr}") result=$(${CLIA} ethereum balance -o "${ethReceiverAddr1}" -t "${ethereumBycERC20TokenAddr}")
cli_ret "${result}" "balance" ".balance" "0" cli_ret "${result}" "balance" ".balance" "0"
echo '#5.burn YCC from Chain33 YCC(Chain33)-----> Ethereum' echo '#5.burn YCC from Chain33 YCC(Chain33)-----> Ethereum'
${CLIA} chain33 burn -m 5 -k "${chain33ReceiverAddrKey}" -r "${ethReceiverAddr1}" -t "${chain33YccTokenAddr}" ${CLIA} chain33 burn -m 5 -k "${chain33ReceiverAddrKey}" -r "${ethReceiverAddr1}" -t "${chain33BycBridgeTokenAddr}"
sleep ${maturityDegree} sleep ${maturityDegree}
echo "check the balance on chain33" echo "check the balance on chain33"
result=$(${Chain33Cli} evm query -a "${chain33YccTokenAddr}" -c "${chain33DeployAddr}" -b "balanceOf(${chain33ReceiverAddr})") result=$(${Chain33Cli} evm query -a "${chain33BycBridgeTokenAddr}" -c "${chain33DeployAddr}" -b "balanceOf(${chain33ReceiverAddr})")
# 结果是 7-5 * le8 # 结果是 7-5 * le8
is_equal "${result}" "200000000" is_equal "${result}" "200000000"
# 查询 ETH 这端 bridgeBank 地址 2 # 查询 ETH 这端 bridgeBank 地址 2
result=$(${CLIA} ethereum balance -o "${ethBridgeBank}" -t "${ethereumYccTokenAddr}") result=$(${CLIA} ethereum balance -o "${ethBridgeBank}" -t "${ethereumBycERC20TokenAddr}")
cli_ret "${result}" "balance" ".balance" "2" cli_ret "${result}" "balance" ".balance" "2"
# 更新后的金额 5 # 更新后的金额 5
result=$(${CLIA} ethereum balance -o "${ethReceiverAddr1}" -t "${ethereumYccTokenAddr}") result=$(${CLIA} ethereum balance -o "${ethReceiverAddr1}" -t "${ethereumBycERC20TokenAddr}")
cli_ret "${result}" "balance" ".balance" "5" cli_ret "${result}" "balance" ".balance" "5"
echo -e "${GRE}=========== $FUNCNAME end ===========${NOC}" echo -e "${GRE}=========== $FUNCNAME end ===========${NOC}"
......
...@@ -20,12 +20,12 @@ source "./multisignPublicTest.sh" ...@@ -20,12 +20,12 @@ source "./multisignPublicTest.sh"
#Chain33Cli="../../chain33-cli" #Chain33Cli="../../chain33-cli"
#chain33BridgeBank="" #chain33BridgeBank=""
#ethBridgeBank="" #ethBridgeBank=""
#chain33BtyTokenAddr="1111111111111111111114oLvT2" #chain33BtyERC20TokenAddr="1111111111111111111114oLvT2"
#ethereumYccTokenAddr="" #ethereumBycERC20TokenAddr=""
#multisignChain33Addr="" #multisignChain33Addr=""
#multisignEthAddr="" #multisignEthAddr=""
#ethBridgeToeknYccAddr="" #ethereumYccBridgeTokenAddr=""
#chain33YccErc20Addr="" #chain33YccERC20TokenAddr=""
# #
#CLIA="./ebcli_A" #CLIA="./ebcli_A"
chain33ID=0 chain33ID=0
......
...@@ -19,12 +19,12 @@ chain33DeployAddr="1N6HstkyLFS8QCeVfdvYxx1xoryXoJtvvZ" ...@@ -19,12 +19,12 @@ chain33DeployAddr="1N6HstkyLFS8QCeVfdvYxx1xoryXoJtvvZ"
Chain33Cli="../../chain33-cli" Chain33Cli="../../chain33-cli"
chain33BridgeBank="" chain33BridgeBank=""
ethBridgeBank="" ethBridgeBank=""
chain33BtyTokenAddr="1111111111111111111114oLvT2" chain33BtyERC20TokenAddr="1111111111111111111114oLvT2"
ethereumYccTokenAddr="" ethereumBycERC20TokenAddr=""
multisignChain33Addr="" multisignChain33Addr=""
multisignEthAddr="" multisignEthAddr=""
ethBridgeToeknYccAddr="" ethereumYccBridgeTokenAddr=""
chain33YccErc20Addr="" chain33YccERC20TokenAddr=""
CLIA="./ebcli_A" CLIA="./ebcli_A"
chain33ID=0 chain33ID=0
...@@ -33,7 +33,7 @@ function set_offline_token_Bty() { ...@@ -33,7 +33,7 @@ function set_offline_token_Bty() {
echo -e "${GRE}=========== $FUNCNAME begin ===========${NOC}" echo -e "${GRE}=========== $FUNCNAME begin ===========${NOC}"
echo -e "${GRE}===== chain33 端 configLockedTokenOfflineSave BTY ======${NOC}" echo -e "${GRE}===== chain33 端 configLockedTokenOfflineSave BTY ======${NOC}"
# echo '2:#配置自动转离线钱包(bty, 1000, 50%)' # echo '2:#配置自动转离线钱包(bty, 1000, 50%)'
hash=$(${Chain33Cli} send evm call -f 1 -k "${chain33DeployAddr}" -e "${chain33BridgeBank}" -p "configLockedTokenOfflineSave(${chain33BtyTokenAddr},BTY,100000000000,50)" --khainID "${chain33ID}") hash=$(${Chain33Cli} send evm call -f 1 -k "${chain33DeployAddr}" -e "${chain33BridgeBank}" -p "configLockedTokenOfflineSave(${chain33BtyERC20TokenAddr},BTY,100000000000,50)" --khainID "${chain33ID}")
check_tx "${Chain33Cli}" "${hash}" check_tx "${Chain33Cli}" "${hash}"
echo -e "${GRE}=========== $FUNCNAME end ===========${NOC}" echo -e "${GRE}=========== $FUNCNAME end ===========${NOC}"
...@@ -87,7 +87,7 @@ function set_offline_token_Chain33Ycc() { ...@@ -87,7 +87,7 @@ function set_offline_token_Chain33Ycc() {
echo -e "${GRE}===== chain33 端 configLockedTokenOfflineSave ERC20 YCC ======${NOC}" echo -e "${GRE}===== chain33 端 configLockedTokenOfflineSave ERC20 YCC ======${NOC}"
# echo '2:#配置自动转离线钱包(YCC, 100, 60%)' # echo '2:#配置自动转离线钱包(YCC, 100, 60%)'
hash=$(${Chain33Cli} send evm call -f 1 -k "${chain33DeployAddr}" -e "${chain33BridgeBank}" -p "configLockedTokenOfflineSave(${chain33YccErc20Addr},YCC,10000000000,60)" --chainID "${chain33ID}") hash=$(${Chain33Cli} send evm call -f 1 -k "${chain33DeployAddr}" -e "${chain33BridgeBank}" -p "configLockedTokenOfflineSave(${chain33YccERC20TokenAddr},YCC,10000000000,60)" --chainID "${chain33ID}")
check_tx "${Chain33Cli}" "${hash}" check_tx "${Chain33Cli}" "${hash}"
echo -e "${GRE}=========== $FUNCNAME end ===========${NOC}" echo -e "${GRE}=========== $FUNCNAME end ===========${NOC}"
...@@ -106,24 +106,24 @@ function transfer_multisign_Chain33Ycc_test() { ...@@ -106,24 +106,24 @@ function transfer_multisign_Chain33Ycc_test() {
echo -e "${GRE}=========== $FUNCNAME begin ===========${NOC}" echo -e "${GRE}=========== $FUNCNAME begin ===========${NOC}"
# transfer test # transfer test
hash=$(${CLIA} chain33 multisign transfer -a 10 -r "${chain33BridgeBank}" -t "${chain33YccErc20Addr}" -k "${chain33MultisignKeyA},${chain33MultisignKeyB},${chain33MultisignKeyC},${chain33MultisignKeyD}" | jq -r ".msg") hash=$(${CLIA} chain33 multisign transfer -a 10 -r "${chain33BridgeBank}" -t "${chain33YccERC20TokenAddr}" -k "${chain33MultisignKeyA},${chain33MultisignKeyB},${chain33MultisignKeyC},${chain33MultisignKeyD}" | jq -r ".msg")
check_tx "${Chain33Cli}" "${hash}" check_tx "${Chain33Cli}" "${hash}"
sleep 2 sleep 2
result=$(${Chain33Cli} evm query -a "${chain33YccErc20Addr}" -c "${chain33BridgeBank}" -b "balanceOf(${chain33BridgeBank})") result=$(${Chain33Cli} evm query -a "${chain33YccERC20TokenAddr}" -c "${chain33BridgeBank}" -b "balanceOf(${chain33BridgeBank})")
is_equal "${result}" "6200000000" is_equal "${result}" "6200000000"
result=$(${Chain33Cli} evm query -a "${chain33YccErc20Addr}" -c "${multisignChain33Addr}" -b "balanceOf(${multisignChain33Addr})") result=$(${Chain33Cli} evm query -a "${chain33YccERC20TokenAddr}" -c "${multisignChain33Addr}" -b "balanceOf(${multisignChain33Addr})")
is_equal "${result}" "30800000000" is_equal "${result}" "30800000000"
hash=$(${CLIA} chain33 multisign transfer -a 5 -r "${chain33MultisignA}" -t "${chain33YccErc20Addr}" -k "${chain33MultisignKeyA},${chain33MultisignKeyB},${chain33MultisignKeyC},${chain33MultisignKeyD}" | jq -r ".msg") hash=$(${CLIA} chain33 multisign transfer -a 5 -r "${chain33MultisignA}" -t "${chain33YccERC20TokenAddr}" -k "${chain33MultisignKeyA},${chain33MultisignKeyB},${chain33MultisignKeyC},${chain33MultisignKeyD}" | jq -r ".msg")
check_tx "${Chain33Cli}" "${hash}" check_tx "${Chain33Cli}" "${hash}"
sleep 2 sleep 2
result=$(${Chain33Cli} evm query -a "${chain33YccErc20Addr}" -c "${chain33MultisignA}" -b "balanceOf(${chain33MultisignA})") result=$(${Chain33Cli} evm query -a "${chain33YccERC20TokenAddr}" -c "${chain33MultisignA}" -b "balanceOf(${chain33MultisignA})")
is_equal "${result}" "500000000" is_equal "${result}" "500000000"
result=$(${Chain33Cli} evm query -a "${chain33YccErc20Addr}" -c "${multisignChain33Addr}" -b "balanceOf(${multisignChain33Addr})") result=$(${Chain33Cli} evm query -a "${chain33YccERC20TokenAddr}" -c "${multisignChain33Addr}" -b "balanceOf(${multisignChain33Addr})")
is_equal "${result}" "30300000000" is_equal "${result}" "30300000000"
# 判断 ETH 这端是否金额一致 # 判断 ETH 这端是否金额一致
result=$(${CLIA} ethereum balance -o "${ethDeployAddr}" -t "${ethBridgeToeknYccAddr}") result=$(${CLIA} ethereum balance -o "${ethDeployAddr}" -t "${ethereumYccBridgeTokenAddr}")
cli_ret "${result}" "balance" ".balance" "370" cli_ret "${result}" "balance" ".balance" "370"
echo -e "${GRE}=========== $FUNCNAME end ===========${NOC}" echo -e "${GRE}=========== $FUNCNAME end ===========${NOC}"
...@@ -196,8 +196,8 @@ function lockEth() { ...@@ -196,8 +196,8 @@ function lockEth() {
function set_offline_token_EthYcc() { function set_offline_token_EthYcc() {
echo -e "${GRE}=========== $FUNCNAME begin ===========${NOC}" echo -e "${GRE}=========== $FUNCNAME begin ===========${NOC}"
# echo '2:#配置自动转离线钱包(ycc, 100, 40%)' # echo '2:#配置自动转离线钱包(ycc, 100, 40%)'
result=$(${CLIA} ethereum multisign set_offline_token -s YCC -m 100 -p 40 -t "${ethereumYccTokenAddr}") result=$(${CLIA} ethereum multisign set_offline_token -s BYC -m 100 -p 40 -t "${ethereumBycERC20TokenAddr}")
cli_ret "${result}" "set_offline_token -s YCC -m 100" cli_ret "${result}" "set_offline_token -s BYC -m 100"
echo -e "${GRE}=========== $FUNCNAME end ===========${NOC}" echo -e "${GRE}=========== $FUNCNAME end ===========${NOC}"
} }
...@@ -205,9 +205,9 @@ function set_offline_token_EthYcc() { ...@@ -205,9 +205,9 @@ function set_offline_token_EthYcc() {
function lock_multisign_EthYcc() { function lock_multisign_EthYcc() {
echo -e "${GRE}=========== $FUNCNAME begin ===========${NOC}" echo -e "${GRE}=========== $FUNCNAME begin ===========${NOC}"
result=$(${CLIA} ethereum balance -o "${ethBridgeBank}" -t "${ethereumYccTokenAddr}") result=$(${CLIA} ethereum balance -o "${ethBridgeBank}" -t "${ethereumBycERC20TokenAddr}")
cli_ret "${result}" "balance" ".balance" "0" cli_ret "${result}" "balance" ".balance" "0"
result=$(${CLIA} ethereum balance -o "${multisignEthAddr}" -t "${ethereumYccTokenAddr}") result=$(${CLIA} ethereum balance -o "${multisignEthAddr}" -t "${ethereumBycERC20TokenAddr}")
cli_ret "${result}" "balance" ".balance" "0" cli_ret "${result}" "balance" ".balance" "0"
lock_ethereum_ycc_multisign 70 70 0 lock_ethereum_ycc_multisign 70 70 0
...@@ -225,19 +225,19 @@ function transfer_multisign_EthYcc() { ...@@ -225,19 +225,19 @@ function transfer_multisign_EthYcc() {
sleep 2 sleep 2
# transfer # transfer
${CLIA} ethereum multisign transfer -a 8 -r "${ethBridgeBank}" -t "${ethereumYccTokenAddr}" -k "${ethMultisignKeyA},${ethMultisignKeyB},${ethMultisignKeyC},${ethMultisignKeyD}" ${CLIA} ethereum multisign transfer -a 8 -r "${ethBridgeBank}" -t "${ethereumBycERC20TokenAddr}" -k "${ethMultisignKeyA},${ethMultisignKeyB},${ethMultisignKeyC},${ethMultisignKeyD}"
sleep 2 sleep 2
result=$(${CLIA} ethereum balance -o "${ethBridgeBank}" -t "${ethereumYccTokenAddr}") result=$(${CLIA} ethereum balance -o "${ethBridgeBank}" -t "${ethereumBycERC20TokenAddr}")
cli_ret "${result}" "balance" ".balance" "80" cli_ret "${result}" "balance" ".balance" "80"
result=$(${CLIA} ethereum balance -o "${multisignEthAddr}" -t "${ethereumYccTokenAddr}") result=$(${CLIA} ethereum balance -o "${multisignEthAddr}" -t "${ethereumBycERC20TokenAddr}")
cli_ret "${result}" "balance" ".balance" "80" cli_ret "${result}" "balance" ".balance" "80"
# transfer # transfer
${CLIA} ethereum multisign transfer -a 10 -r "${ethMultisignA}" -t "${ethereumYccTokenAddr}" -k "${ethMultisignKeyA},${ethMultisignKeyB},${ethMultisignKeyC},${ethMultisignKeyD}" ${CLIA} ethereum multisign transfer -a 10 -r "${ethMultisignA}" -t "${ethereumBycERC20TokenAddr}" -k "${ethMultisignKeyA},${ethMultisignKeyB},${ethMultisignKeyC},${ethMultisignKeyD}"
sleep 2 sleep 2
result=$(${CLIA} ethereum balance -o "${ethMultisignA}" -t "${ethereumYccTokenAddr}") result=$(${CLIA} ethereum balance -o "${ethMultisignA}" -t "${ethereumBycERC20TokenAddr}")
cli_ret "${result}" "balance" ".balance" "10" cli_ret "${result}" "balance" ".balance" "10"
result=$(${CLIA} ethereum balance -o "${multisignEthAddr}" -t "${ethereumYccTokenAddr}") result=$(${CLIA} ethereum balance -o "${multisignEthAddr}" -t "${ethereumBycERC20TokenAddr}")
cli_ret "${result}" "balance" ".balance" "70" cli_ret "${result}" "balance" ".balance" "70"
echo -e "${GRE}=========== $FUNCNAME end ===========${NOC}" echo -e "${GRE}=========== $FUNCNAME end ===========${NOC}"
} }
......
#!/usr/bin/env bash
# shellcheck disable=SC2128
# shellcheck source=/dev/null
set -x
set +e
# 主要在平行链上测试
source "./offlinePublic.sh"
maturityDegree=10
chain33BridgeBank=""
ethBridgeBank=""
chain33BtyERC20TokenAddr="1111111111111111111114oLvT2"
chain33EthBridgeTokenAddr=""
ethereumBtyBridgeTokenAddr=""
chain33BycBridgeTokenAddr=""
ethereumBycERC20TokenAddr=""
BridgeRegistryOnChain33=""
chain33YccERC20TokenAddr=""
BridgeRegistryOnEth=""
ethereumYccBridgeTokenAddr=""
chain33ZbcERC20TokenAddr=""
ethereumZbcBridgeTokenAddr=""
multisignChain33Addr=""
multisignEthAddr=""
chain33ID=0
# shellcheck disable=SC2034
{
# ETH 部署合约者的私钥 用于部署合约时签名使用
ethDeployAddr="0x8AFDADFC88a1087c9A1D6c0F5Dd04634b87F303a"
ethDeployKey="0x8656d2bc732a8a816a461ba5e2d8aac7c7f85c26a813df30d5327210465eb230"
# chain33 部署合约者的私钥 用于部署合约时签名使用
chain33DeployAddr="1JxhYLYsrscjTaQfaMoVUrnSdrejP7XRQD"
chain33DeployKey="0x9ef82623a5e9aac58d3a6b06392af66ec77289522b28896aed66abaaede66903"
# validatorsAddr=["0x92C8b16aFD6d423652559C6E266cBE1c29Bfd84f", "0x0df9a824699bc5878232c9e612fe1a5346a5a368", "0xcb074cb21cdddf3ce9c3c0a7ac4497d633c9d9f1", "0xd9dab021e74ecf475788ed7b61356056b2095830"]# shellcheck disable=SC2034
# eth 验证者私钥
ethValidatorAddra="0x92C8b16aFD6d423652559C6E266cBE1c29Bfd84f"
ethValidatorAddrb="0x0df9a824699bc5878232c9e612fe1a5346a5a368"
ethValidatorAddrc="0xcb074cb21cdddf3ce9c3c0a7ac4497d633c9d9f1"
ethValidatorAddrd="0xd9dab021e74ecf475788ed7b61356056b2095830"
ethValidatorAddrKeya="3fa21584ae2e4fd74db9b58e2386f5481607dfa4d7ba0617aaa7858e5025dc1e"
ethValidatorAddrKeyb="a5f3063552f4483cfc20ac4f40f45b798791379862219de9e915c64722c1d400"
ethValidatorAddrKeyc="bbf5e65539e9af0eb0cfac30bad475111054b09c11d668fc0731d54ea777471e"
ethValidatorAddrKeyd="c9fa31d7984edf81b8ef3b40c761f1847f6fcd5711ab2462da97dc458f1f896b"
# 新增地址 chain33 需要导入地址 转入 10 bty当收费费
chain33Validatora="1N6HstkyLFS8QCeVfdvYxx1xoryXoJtvvZ"
chain33Validatorb="155ooMPBTF8QQsGAknkK7ei5D78rwDEFe6"
chain33Validatorc="13zBdQwuyDh7cKN79oT2odkxYuDbgQiXFv"
chain33Validatord="113ZzVamKfAtGt9dq45fX1mNsEoDiN95HG"
chain33ValidatorKeya="0x027ca96466c71c7e7c5d73b7e1f43cb889b3bd65ebd2413eefd31c6709c262ae"
chain33ValidatorKeyb="0x9d539bc5fd084eb7fe86ad631dba9aa086dba38418725c38d9751459f567da66"
chain33ValidatorKeyc="0x0a6671f101e30a2cc2d79d77436b62cdf2664ed33eb631a9c9e3f3dd348a23be"
chain33ValidatorKeyd="0x3818b257b05ee75b6e43ee0e3cfc2d8502342cf67caed533e3756966690b62a5"
ethTestAddr1=0xbc333839E37bc7fAAD0137aBaE2275030555101f
ethTestAddrKey1=0x0c61f5a879d70807686e43eccc1f52987a15230ae0472902834af4d1933674f2
ethTestAddr2=0x495953A743ef169EC5D4aC7b5F786BF2Bd56aFd5
ethTestAddrKey2=0x2809477ede1261da21270096776ba7dc68b89c9df5f029965eaa5fe7f0b80697
ethReceiverAddr1="0xa4ea64a583f6e51c3799335b28a8f0529570a635"
#ethReceiverAddrKey1="355b876d7cbcb930d5dfab767f66336ce327e082cbaa1877210c1bae89b1df71"
chain33TestAddr1="1Cj1rqUenPmkeD6A8MGEzkBKQFN2H9yL3x"
chain33TestAddrKey1="0x7269a7a87d476310da37a9ca1ddc9333c9d7a0dfe1f2998b84758843a895433b"
chain33TestAddr2="1BCGLhdcdthNutQowV2YShuuN9fJRRGLxu"
chain33TestAddrKey2="0xb74acfd4eebbbd07bcae212baa7f094235ab8dc04f2f1d828681477b98b24008"
chain33ReceiverAddr="12qyocayNF7Lv6C9qW4avxs2E7U41fKSfv"
chain33ReceiverAddrKey="4257d8692ef7fe13c68b65d6a52f03933db2fa5ce8faf210b5b8b80c721ced01"
}
# shellcheck disable=SC2120
function offline_set_offline_token_Bty() {
echo -e "${GRE}=========== $FUNCNAME begin ===========${NOC}"
echo -e "${GRE}===== chain33 端 configLockedTokenOfflineSave BTY ======${NOC}"
# echo '2:#配置自动转离线钱包(bty, 100, 50%)'
local threshold=10000000000
local percents=50
if [[ $# -eq 2 ]]; then
threshold=$1
percents=$2
fi
# shellcheck disable=SC2086
${Boss4xCLI} chain33 offline set_offline_token -c "${chain33BridgeBank}" -s BTY -m ${threshold} -p ${percents} -k "${chain33DeployKey}" --chainID "${chain33ID}"
chain33_offline_send "chain33_set_offline_token.txt"
echo -e "${GRE}=========== $FUNCNAME end ===========${NOC}"
}
# shellcheck disable=SC2120
function offline_set_offline_token_Chain33Ycc() {
echo -e "${GRE}=========== $FUNCNAME begin ===========${NOC}"
echo -e "${GRE}===== chain33 端 configLockedTokenOfflineSave ERC20 YCC ======${NOC}"
# echo '2:#配置自动转离线钱包(YCC, 100, 60%)'
local threshold=10000000000
local percents=60
if [[ $# -eq 2 ]]; then
threshold=$1
percents=$2
fi
# shellcheck disable=SC2086
${Boss4xCLI} chain33 offline set_offline_token -c "${chain33BridgeBank}" -t "${chain33YccERC20TokenAddr}" -s YCC -m ${threshold} -p ${percents} -k "${chain33DeployKey}" --chainID "${chain33ID}"
chain33_offline_send "chain33_set_offline_token.txt"
echo -e "${GRE}=========== $FUNCNAME end ===========${NOC}"
}
# shellcheck disable=SC2120
function offline_set_offline_token_Eth() {
echo -e "${GRE}=========== $FUNCNAME begin ===========${NOC}"
# echo '2:#配置自动转离线钱包(eth, 20, 50%)'
local threshold=20
local percents=50
if [[ $# -eq 2 ]]; then
threshold=$1
percents=$2
fi
# shellcheck disable=SC2086
${Boss4xCLI} ethereum offline set_offline_token -s ETH -m ${threshold} -p ${percents} -c "${ethBridgeBank}" -d "${ethDeployAddr}"
ethereum_offline_sign_send "set_offline_token.txt"
echo -e "${GRE}=========== $FUNCNAME end ===========${NOC}"
}
# shellcheck disable=SC2120
function offline_set_offline_token_EthYcc() {
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 BYC -m ${threshold} -p ${percents} -t "${ethereumBycERC20TokenAddr}" -c "${ethBridgeBank}" -d "${ethDeployAddr}"
ethereum_offline_sign_send "set_offline_token.txt"
echo -e "${GRE}=========== $FUNCNAME end ===========${NOC}"
}
function MainTest() {
set +e
chain33ID=0
chain33BridgeBank=15Myyvq97WinTWto8zcEdm838zXmvJKfnX
ethBridgeBank=0xC65B02a22B714b55D708518E2426a22ffB79113d
# ethereumBtyBridgeTokenAddr=0x9c3d40a44a2f61ef8d46fa8c7a731c08fb16ccef
# chain33EthBridgeTokenAddr=1JVFbJhFUWUNH41PxbV7NqwUd3F9BJ3nqV
ethereumBycERC20TokenAddr=0x20a32A5680EBf55740B0C98B54cDE8e6FD5a4FB0
# ethereumYccBridgeTokenAddr=0x05f3f31c7d53bcb71a6487dff3115d86370698bd
# chain33BycBridgeTokenAddr=1BdREGqsjbcKkvRheXWYKRq37vJHMs22Uy
chain33YccERC20TokenAddr=17yu1yULdGFddUz26PEeaHpJtkFGEpzYrA
# chain33ZbcERC20TokenAddr=1AqRwUa4T3q9DuCyUwn5ucHgtUhbUP2yfu
# ethereumZbcBridgeTokenAddr=0x89bb32184e466a9c8ea50c31174b575c2bcd64c2
dockerNamePrefix="build"
docker_chain33_ip=$(get_docker_addr "${dockerNamePrefix}_chain33_1")
# MainCli="./chain33-cli --rpc_laddr http://${docker_chain33_ip}:8801"
# Para8801Cli="./chain33-cli --rpc_laddr http://${docker_chain33_ip}:8901 --paraName user.p.para."
Para8901Cli="./chain33-cli --rpc_laddr http://${docker_chain33_ip}:8901 --paraName user.p.para."
# shellcheck disable=SC2034
{
CLIA="docker exec ${dockerNamePrefix}_ebrelayera_1 /root/ebcli_A"
CLIB="docker exec ${dockerNamePrefix}_ebrelayerb_1 /root/ebcli_A"
CLIC="docker exec ${dockerNamePrefix}_ebrelayerc_1 /root/ebcli_A"
CLID="docker exec ${dockerNamePrefix}_ebrelayerd_1 /root/ebcli_A"
docker_ganachetest_ip=$(get_docker_addr "${dockerNamePrefix}_ganachetest_1")
Boss4xCLI="docker exec ${dockerNamePrefix}_ebrelayera_1 /root/boss4x --rpc_laddr http://${docker_chain33_ip}:8901 --rpc_laddr_ethereum http://${docker_ganachetest_ip}:8545 --paraName user.p.para."
echo "${Boss4xCLI}"
}
Chain33Cli=${Para8901Cli}
# 离线多签地址转入阈值设大
offline_set_offline_token_Bty 100000000000000 10
offline_set_offline_token_Chain33Ycc 100000000000000 10
offline_set_offline_token_Eth 100000000000000 10
offline_set_offline_token_EthYcc 100000000000000 10
echo -e "${GRE}=========== $FUNCNAME end ===========${NOC}"
}
MainTest
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment