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
c22f4b85
Commit
c22f4b85
authored
Dec 17, 2021
by
QM
Committed by
vipwzw
Dec 20, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
delete ethereum multisign_setup set_offline_addr
parent
c8ca1c7e
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
119 additions
and
85 deletions
+119
-85
deploy.toml
plugin/dapp/cross2eth/boss4x/ethereum/deploy.toml
+9
-4
deployCrossX2Eth.go
...app/cross2eth/boss4x/ethereum/offline/deployCrossX2Eth.go
+64
-12
deploy_ethereum.md
.../cross2eth/boss4x/ethereum/offline/doc/deploy_ethereum.md
+26
-36
offline.go
plugin/dapp/cross2eth/boss4x/ethereum/offline/offline.go
+7
-6
mainPubilcRelayerTest.sh
.../dapp/cross2eth/cmd/build/public/mainPubilcRelayerTest.sh
+1
-15
offlinePublic.sh
plugin/dapp/cross2eth/cmd/build/public/offlinePublic.sh
+12
-12
No files found.
plugin/dapp/cross2eth/boss4x/ethereum/deploy.toml
View file @
c22f4b85
#
合约部署人员私钥,用于部署合约时签名使用
#
合约部署人
deployerPrivateKey
=
"8656d2bc732a8a816a461ba5e2d8aac7c7f85c26a813df30d5327210465eb230
"
operatorAddr
=
"0x8afdadfc88a1087c9a1d6c0f5dd04634b87f303a
"
#验证人地址,至少配置3个以上,即大于等于3个
#
验证人地址,至少配置3个以上,即大于等于3个
validatorsAddr
=[
"0x8afdadfc88a1087c9a1d6c0f5dd04634b87f303a"
,
"0x0df9a824699bc5878232c9e612fe1a5346a5a368"
,
"0xcb074cb21cdddf3ce9c3c0a7ac4497d633c9d9f1"
,
"0xd9dab021e74ecf475788ed7b61356056b2095830"
]
validatorsAddr
=[
"0x8afdadfc88a1087c9a1d6c0f5dd04634b87f303a"
,
"0x0df9a824699bc5878232c9e612fe1a5346a5a368"
,
"0xcb074cb21cdddf3ce9c3c0a7ac4497d633c9d9f1"
,
"0xd9dab021e74ecf475788ed7b61356056b2095830"
]
#验证人权重
#
验证人权重
initPowers
=[
96
,
1
,
1
,
1
]
initPowers
=[
96
,
1
,
1
,
1
]
# 主链symbol
symbol
=
"ETH"
# 离线多签地址
multisignAddrs
=[
"0x4c85848a7E2985B76f06a7Ed338FCB3aF94a7DCf"
,
"0x6F163E6daf0090D897AD7016484f10e0cE844994"
,
"0xbc333839E37bc7fAAD0137aBaE2275030555101f"
,
"0x495953A743ef169EC5D4aC7b5F786BF2Bd56aFd5"
]
\ No newline at end of file
plugin/dapp/cross2eth/boss4x/ethereum/offline/deployCrossX2Eth.go
View file @
c22f4b85
...
@@ -4,6 +4,7 @@ import (
...
@@ -4,6 +4,7 @@ import (
"context"
"context"
"encoding/json"
"encoding/json"
"fmt"
"fmt"
ebTypes
"github.com/33cn/plugin/plugin/dapp/cross2eth/ebrelayer/types"
"math/big"
"math/big"
"strconv"
"strconv"
"strings"
"strings"
...
@@ -141,11 +142,15 @@ func addCreateFlags(cmd *cobra.Command) {
...
@@ -141,11 +142,15 @@ func addCreateFlags(cmd *cobra.Command) {
_
=
cmd
.
MarkFlagRequired
(
"owner"
)
_
=
cmd
.
MarkFlagRequired
(
"owner"
)
cmd
.
Flags
()
.
StringP
(
"symbol"
,
"s"
,
""
,
"symbol"
)
cmd
.
Flags
()
.
StringP
(
"symbol"
,
"s"
,
""
,
"symbol"
)
_
=
cmd
.
MarkFlagRequired
(
"symbol"
)
_
=
cmd
.
MarkFlagRequired
(
"symbol"
)
cmd
.
Flags
()
.
StringP
(
"multisignAddrs"
,
"m"
,
""
,
"multisignAddrs, as: 'addr,addr,addr,addr'"
)
_
=
cmd
.
MarkFlagRequired
(
"multisignAddrs"
)
}
}
func
createTx
(
cmd
*
cobra
.
Command
,
_
[]
string
)
{
func
createTx
(
cmd
*
cobra
.
Command
,
_
[]
string
)
{
url
,
_
:=
cmd
.
Flags
()
.
GetString
(
"rpc_laddr_ethereum"
)
url
,
_
:=
cmd
.
Flags
()
.
GetString
(
"rpc_laddr_ethereum"
)
validatorsAddrs
,
_
:=
cmd
.
Flags
()
.
GetString
(
"validatorsAddrs"
)
validatorsAddrs
,
_
:=
cmd
.
Flags
()
.
GetString
(
"validatorsAddrs"
)
multisignAddrs
,
_
:=
cmd
.
Flags
()
.
GetString
(
"multisignAddrs"
)
multisignAddrsArray
:=
strings
.
Split
(
multisignAddrs
,
","
)
initpowers
,
_
:=
cmd
.
Flags
()
.
GetString
(
"initPowers"
)
initpowers
,
_
:=
cmd
.
Flags
()
.
GetString
(
"initPowers"
)
owner
,
_
:=
cmd
.
Flags
()
.
GetString
(
"owner"
)
owner
,
_
:=
cmd
.
Flags
()
.
GetString
(
"owner"
)
deployerAddr
:=
common
.
HexToAddress
(
owner
)
deployerAddr
:=
common
.
HexToAddress
(
owner
)
...
@@ -163,7 +168,7 @@ func createTx(cmd *cobra.Command, _ []string) {
...
@@ -163,7 +168,7 @@ func createTx(cmd *cobra.Command, _ []string) {
return
return
}
}
var
validators
[]
common
.
Address
var
validators
,
multisigns
[]
common
.
Address
var
initPowers
[]
*
big
.
Int
var
initPowers
[]
*
big
.
Int
for
_
,
v
:=
range
validatorsAddrsArray
{
for
_
,
v
:=
range
validatorsAddrsArray
{
validators
=
append
(
validators
,
common
.
HexToAddress
(
v
))
validators
=
append
(
validators
,
common
.
HexToAddress
(
v
))
...
@@ -177,13 +182,17 @@ func createTx(cmd *cobra.Command, _ []string) {
...
@@ -177,13 +182,17 @@ func createTx(cmd *cobra.Command, _ []string) {
initPowers
=
append
(
initPowers
,
big
.
NewInt
(
vint64
))
initPowers
=
append
(
initPowers
,
big
.
NewInt
(
vint64
))
}
}
err
:=
createDeployTxs
(
url
,
deployerAddr
,
validators
,
initPowers
,
symbol
)
for
_
,
v
:=
range
multisignAddrsArray
{
multisigns
=
append
(
multisigns
,
common
.
HexToAddress
(
v
))
}
err
:=
createDeployTxs
(
url
,
deployerAddr
,
validators
,
multisigns
,
initPowers
,
symbol
)
if
err
!=
nil
{
if
err
!=
nil
{
panic
(
err
)
panic
(
err
)
}
}
}
}
func
createDeployTxs
(
url
string
,
deployerAddr
common
.
Address
,
validators
[]
common
.
Address
,
initPowers
[]
*
big
.
Int
,
symbol
string
)
error
{
func
createDeployTxs
(
url
string
,
deployerAddr
common
.
Address
,
validators
,
multisigns
[]
common
.
Address
,
initPowers
[]
*
big
.
Int
,
symbol
string
)
error
{
client
,
err
:=
ethclient
.
Dial
(
url
)
client
,
err
:=
ethclient
.
Dial
(
url
)
if
err
!=
nil
{
if
err
!=
nil
{
return
err
return
err
...
@@ -269,6 +278,22 @@ func createDeployTxs(url string, deployerAddr common.Address, validators []commo
...
@@ -269,6 +278,22 @@ func createDeployTxs(url string, deployerAddr common.Address, validators []commo
packData
=
common
.
FromHex
(
gnosis
.
GnosisSafeBin
)
packData
=
common
.
FromHex
(
gnosis
.
GnosisSafeBin
)
mulSignAddr
:=
crypto
.
CreateAddress
(
deployerAddr
,
startNonce
)
mulSignAddr
:=
crypto
.
CreateAddress
(
deployerAddr
,
startNonce
)
infos
=
append
(
infos
,
&
DeployInfo
{
PackData
:
packData
,
ContractorAddr
:
mulSignAddr
,
Name
:
"mulSignAddr"
,
Nonce
:
startNonce
,
To
:
nil
})
infos
=
append
(
infos
,
&
DeployInfo
{
PackData
:
packData
,
ContractorAddr
:
mulSignAddr
,
Name
:
"mulSignAddr"
,
Nonce
:
startNonce
,
To
:
nil
})
startNonce
+=
1
//step10 multisign configOfflineSaveAccount
packData
,
err
=
offlineSaveAccount
(
mulSignAddr
)
if
err
!=
nil
{
return
err
}
infos
=
append
(
infos
,
&
DeployInfo
{
PackData
:
packData
,
ContractorAddr
:
common
.
Address
{},
Name
:
"configOfflineSaveAccount"
,
Nonce
:
startNonce
,
To
:
&
bridgeBankAddr
})
//step11 multisignSetup
packData
,
err
=
multisignSetup
(
multisigns
)
if
err
!=
nil
{
return
err
}
infos
=
append
(
infos
,
&
DeployInfo
{
PackData
:
packData
,
ContractorAddr
:
common
.
Address
{},
Name
:
"multisignSetup"
,
Nonce
:
startNonce
,
To
:
&
mulSignAddr
})
startNonce
+=
1
return
NewTxWrite
(
infos
,
deployerAddr
,
url
,
"deploytxs.txt"
)
return
NewTxWrite
(
infos
,
deployerAddr
,
url
,
"deploytxs.txt"
)
}
}
...
@@ -438,6 +463,36 @@ func setSymbol(symbol string) ([]byte, error) {
...
@@ -438,6 +463,36 @@ func setSymbol(symbol string) ([]byte, error) {
return
abiData
,
nil
return
abiData
,
nil
}
}
//step 10
func
offlineSaveAccount
(
multisignContract
common
.
Address
)
([]
byte
,
error
)
{
bridgeAbi
,
err
:=
abi
.
JSON
(
strings
.
NewReader
(
generated
.
BridgeBankABI
))
if
err
!=
nil
{
return
nil
,
err
}
abiData
,
err
:=
bridgeAbi
.
Pack
(
"configOfflineSaveAccount"
,
multisignContract
)
if
err
!=
nil
{
return
nil
,
err
}
return
abiData
,
nil
}
//step 11
func
multisignSetup
(
multisigns
[]
common
.
Address
)
([]
byte
,
error
)
{
AddressZero
:=
common
.
HexToAddress
(
ebTypes
.
EthNilAddr
)
gnoAbi
,
err
:=
abi
.
JSON
(
strings
.
NewReader
(
gnosis
.
GnosisSafeABI
))
if
err
!=
nil
{
return
nil
,
err
}
abiData
,
err
:=
gnoAbi
.
Pack
(
"setup"
,
multisigns
,
big
.
NewInt
(
int64
(
len
(
multisigns
))),
AddressZero
,
[]
byte
{
'0'
,
'x'
},
AddressZero
,
AddressZero
,
big
.
NewInt
(
int64
(
0
)),
AddressZero
)
if
err
!=
nil
{
return
nil
,
err
}
return
abiData
,
nil
}
func
CreateWithFileCmd
()
*
cobra
.
Command
{
func
CreateWithFileCmd
()
*
cobra
.
Command
{
cmd
:=
&
cobra
.
Command
{
cmd
:=
&
cobra
.
Command
{
Use
:
"create_file"
,
//first step
Use
:
"create_file"
,
//first step
...
@@ -458,13 +513,6 @@ func createWithFileTx(cmd *cobra.Command, _ []string) {
...
@@ -458,13 +513,6 @@ func createWithFileTx(cmd *cobra.Command, _ []string) {
cfgpath
,
_
:=
cmd
.
Flags
()
.
GetString
(
"conf"
)
cfgpath
,
_
:=
cmd
.
Flags
()
.
GetString
(
"conf"
)
var
deployCfg
DeployConfigInfo
var
deployCfg
DeployConfigInfo
InitCfg
(
cfgpath
,
&
deployCfg
)
InitCfg
(
cfgpath
,
&
deployCfg
)
deployPrivateKey
,
err
:=
crypto
.
ToECDSA
(
common
.
FromHex
(
deployCfg
.
DeployerPrivateKey
))
if
err
!=
nil
{
fmt
.
Println
(
"crypto.ToECDSA Err:"
,
err
)
return
}
deployerAddr
:=
crypto
.
PubkeyToAddress
(
deployPrivateKey
.
PublicKey
)
if
len
(
deployCfg
.
InitPowers
)
!=
len
(
deployCfg
.
ValidatorsAddr
)
{
if
len
(
deployCfg
.
InitPowers
)
!=
len
(
deployCfg
.
ValidatorsAddr
)
{
panic
(
"not same number for validator address and power"
)
panic
(
"not same number for validator address and power"
)
}
}
...
@@ -473,14 +521,18 @@ func createWithFileTx(cmd *cobra.Command, _ []string) {
...
@@ -473,14 +521,18 @@ func createWithFileTx(cmd *cobra.Command, _ []string) {
panic
(
"the number of validator must be not less than 3"
)
panic
(
"the number of validator must be not less than 3"
)
}
}
var
validators
[]
common
.
Address
var
validators
,
multisigns
[]
common
.
Address
var
initPowers
[]
*
big
.
Int
var
initPowers
[]
*
big
.
Int
for
i
,
addr
:=
range
deployCfg
.
ValidatorsAddr
{
for
i
,
addr
:=
range
deployCfg
.
ValidatorsAddr
{
validators
=
append
(
validators
,
common
.
HexToAddress
(
addr
))
validators
=
append
(
validators
,
common
.
HexToAddress
(
addr
))
initPowers
=
append
(
initPowers
,
big
.
NewInt
(
deployCfg
.
InitPowers
[
i
]))
initPowers
=
append
(
initPowers
,
big
.
NewInt
(
deployCfg
.
InitPowers
[
i
]))
}
}
err
=
createDeployTxs
(
url
,
deployerAddr
,
validators
,
initPowers
,
deployCfg
.
Symbol
)
for
_
,
addr
:=
range
deployCfg
.
MultisignAddrs
{
multisigns
=
append
(
multisigns
,
common
.
HexToAddress
(
addr
))
}
err
:=
createDeployTxs
(
url
,
common
.
HexToAddress
(
deployCfg
.
OperatorAddr
),
validators
,
multisigns
,
initPowers
,
deployCfg
.
Symbol
)
if
err
!=
nil
{
if
err
!=
nil
{
fmt
.
Println
(
"createDeployTxs Err:"
,
err
)
fmt
.
Println
(
"createDeployTxs Err:"
,
err
)
return
return
...
...
plugin/dapp/cross2eth/boss4x/ethereum/offline/doc/deploy_ethereum.md
View file @
c22f4b85
...
@@ -26,16 +26,21 @@
...
@@ -26,16 +26,21 @@
交易7: 设置 symbol
交易7: 设置 symbol
交易8: 部署合约: BridgeRegistry
交易8: 部署合约: BridgeRegistry
交易9: 部署合约: MulSign
交易9: 部署合约: MulSign
交易10: 设置 bridgebank 合约地址可以转到多签合约地址
交易11: 设置离线多签地址信息
```
##### 命令部署
```
命令:
命令:
./boss4x ethereum offline create -s "ETH" -p "25,25,25,25" -o "${ethDeployAddr}" -v "${ethValidatorAddra},${ethValidatorAddrb},${ethValidatorAddrc},${ethValidatorAddrd}"
./boss4x ethereum offline create -s "ETH" -p "25,25,25,25" -o "${ethDeployAddr}" -v "${ethValidatorAddra},${ethValidatorAddrb},${ethValidatorAddrc},${ethValidatorAddrd}"
-m "${ethMultisignA},${ethMultisignB},${ethMultisignC},${ethMultisignD}"
参数说明:
参数说明:
-p, --initPowers string 验证者权重, as: '25,25,25,25'
-p, --initPowers string 验证者权重, as: '25,25,25,25'
-m, --multisignAddrs string 离线多签地址, as: 'addr,addr,addr,addr'
-o, --owner string 部署者地址
-o, --owner string 部署者地址
-s, --symbol string symbol
-s, --symbol string symbol
-v, --validatorsAddrs string 验证者地址, as: 'addr,addr,addr,addr'
-v, --validatorsAddrs string 验证者地址, as: 'addr,addr,addr,addr'
--rpc_laddr_ethereum string ethereum url 地址 (默认 "http://localhost:7545")
--rpc_laddr_ethereum string ethereum url 地址 (默认 "http://localhost:7545")
输出:
输出:
...
@@ -43,6 +48,24 @@ tx is written to file: deploytxs.txt
...
@@ -43,6 +48,24 @@ tx is written to file: deploytxs.txt
把交易信息写入文件中
把交易信息写入文件中
```
```
##### 文件部署
把要部署需要的数据写入 deploy.toml 配置文件
```
toml
# 合约部署人
operatorAddr
=
"0x8afdadfc88a1087c9a1d6c0f5dd04634b87f303a"
# 验证人地址,至少配置3个以上,即大于等于3个
validatorsAddr
=[
"0x8afdadfc88a1087c9a1d6c0f5dd04634b87f303a"
,
"0x0df9a824699bc5878232c9e612fe1a5346a5a368"
,
"0xcb074cb21cdddf3ce9c3c0a7ac4497d633c9d9f1"
,
"0xd9dab021e74ecf475788ed7b61356056b2095830"
]
# 验证人权重
initPowers
=[
96
,
1
,
1
,
1
]
# 主链symbol
symbol
=
"ETH"
# 离线多签地址
multisignAddrs
=[
"0x4c85848a7E2985B76f06a7Ed338FCB3aF94a7DCf"
,
"0x6F163E6daf0090D897AD7016484f10e0cE844994"
,
"0xbc333839E37bc7fAAD0137aBaE2275030555101f"
,
"0x495953A743ef169EC5D4aC7b5F786BF2Bd56aFd5"
]
```
命令:
```
shell
./boss4x ethereum offline create_file
-c
deploy.toml
```
*
离线签名交易
*
离线签名交易
```
```
...
@@ -57,7 +80,6 @@ tx is written to file: deploytxs.txt
...
@@ -57,7 +80,6 @@ tx is written to file: deploytxs.txt
```
```
./boss4x ethereum offline send -f deploysigntxs.txt
./boss4x ethereum offline send -f deploysigntxs.txt
```
```
***
*
输出
*
输出
```
```
...
@@ -66,38 +88,6 @@ tx is written to file: deploytxs.txt
...
@@ -66,38 +88,6 @@ tx is written to file: deploytxs.txt
交易9: 部署合约: MulSign
交易9: 部署合约: MulSign
```
```
#### 设置离线多签地址信息
*
在线创建交易
```
命令:
./boss4x ethereum offline multisign_setup -m "${multisignEthAddr}" -d "${ethDeployAddr}" -o "${ethMultisignA},${ethMultisignB},${ethMultisignC},${ethMultisignD}"
参数说明:
-d, --deployAddr string 部署者地址
-m, --multisign string 离线多签合约地址
-o, --owner string 多签的地址, 用','分隔
输出
tx is written to file: multisign_setup.txt
```
***
#### 设置 bridgebank 合约地址可以转到多签合约地址
*
在线创建交易
```
命令:
./boss4x ethereum offline set_offline_addr -a "${multisignEthAddr}" -c "${ethBridgeBank}" -d "${ethDeployAddr}"
参数说明:
-a, --address string 离线多签地址
-c, --contract string bridgebank 合约地址
-d, --deployAddr string 部署合约地址
输出
tx is written to file: set_offline_addr.txt
```
***
***
#### 设置 symbol 允许被 lock
#### 设置 symbol 允许被 lock
...
...
plugin/dapp/cross2eth/boss4x/ethereum/offline/offline.go
View file @
c22f4b85
...
@@ -35,8 +35,8 @@ func DeployOfflineContractsCmd() *cobra.Command {
...
@@ -35,8 +35,8 @@ func DeployOfflineContractsCmd() *cobra.Command {
CreateWithFileCmd
(),
CreateWithFileCmd
(),
DeployERC20Cmd
(),
DeployERC20Cmd
(),
DeployTetherUSDTCmd
(),
DeployTetherUSDTCmd
(),
CreateCfgAccountTxCmd
(),
// set_offline_addr 设置离线多签地址
//
CreateCfgAccountTxCmd(), // set_offline_addr 设置离线多签地址
SetupCmd
(),
//
SetupCmd(),
ConfigLockedTokenOfflineSaveCmd
(),
ConfigLockedTokenOfflineSaveCmd
(),
CreateAddToken2LockListTxCmd
(),
CreateAddToken2LockListTxCmd
(),
CreateBridgeTokenTxCmd
(),
CreateBridgeTokenTxCmd
(),
...
@@ -64,10 +64,11 @@ type DeployInfo struct {
...
@@ -64,10 +64,11 @@ type DeployInfo struct {
}
}
type
DeployConfigInfo
struct
{
type
DeployConfigInfo
struct
{
DeployerPrivateKey
string
`toml:"deployerPrivateKey"`
OperatorAddr
string
`toml:"operatorAddr"`
ValidatorsAddr
[]
string
`toml:"validatorsAddr"`
ValidatorsAddr
[]
string
`toml:"validatorsAddr"`
InitPowers
[]
int64
`toml:"initPowers"`
InitPowers
[]
int64
`toml:"initPowers"`
Symbol
string
`toml:"symbol"`
Symbol
string
`toml:"symbol"`
MultisignAddrs
[]
string
`toml:"multisignAddrs"`
}
}
func
CreateTxInfoAndWrite
(
abiData
[]
byte
,
deployAddr
,
contract
,
name
,
url
string
)
{
func
CreateTxInfoAndWrite
(
abiData
[]
byte
,
deployAddr
,
contract
,
name
,
url
string
)
{
...
...
plugin/dapp/cross2eth/cmd/build/public/mainPubilcRelayerTest.sh
View file @
c22f4b85
...
@@ -775,16 +775,12 @@ function StartDockerRelayerDeploy() {
...
@@ -775,16 +775,12 @@ function StartDockerRelayerDeploy() {
# 部署合约 设置 bridgeRegistry 地址
# 部署合约 设置 bridgeRegistry 地址
InitAndOfflineDeploy
InitAndOfflineDeploy
# 设置 ethereum symbol
# ${Boss4xCLI} ethereum offline set_symbol -s "ETH" -c "${ethBridgeBank}" -d "${ethDeployAddr}"
# ethereum_offline_sign_send "set_symbol.txt"
# 设置离线多签数据
# 设置离线多签数据
Chain33Cli
=
${
MainCli
}
Chain33Cli
=
${
MainCli
}
initMultisignChain33Addr
initMultisignChain33Addr
Chain33Cli
=
${
Para8901Cli
}
Chain33Cli
=
${
Para8901Cli
}
offline_setupChain33Multisign
offline_setupChain33Multisign
offline_setupEthMultisign
#
offline_setupEthMultisign
Chain33Cli
=
${
MainCli
}
Chain33Cli
=
${
MainCli
}
transferChain33MultisignFee
transferChain33MultisignFee
Chain33Cli
=
${
Para8901Cli
}
Chain33Cli
=
${
Para8901Cli
}
...
@@ -807,23 +803,13 @@ function StartDockerRelayerDeploy() {
...
@@ -807,23 +803,13 @@ function StartDockerRelayerDeploy() {
# InitTokenAddr
# InitTokenAddr
offline_create_bridge_token_eth_BTY
offline_create_bridge_token_eth_BTY
offline_create_bridge_token_chain33_ETH
"ETH"
offline_create_bridge_token_chain33_ETH
"ETH"
# offline_deploy_erc20_eth_BYC
# offline_create_bridge_token_chain33_BYC
# offline_deploy_erc20_chain33_YCC
# offline_create_bridge_token_eth_YCC
# offline_deploy_erc20_chain33_ZBC
# offline_create_bridge_token_eth_ZBC
# offline_deploy_erc20_eth_USDT
offline_deploy_erc20_create_tether_usdt_USDT
offline_deploy_erc20_create_tether_usdt_USDT
offline_create_bridge_token_chain33_USDT
offline_create_bridge_token_chain33_USDT
# 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
"
${
chain33USDTBridgeTokenAddr
}
.abi"
"
${
dockerNamePrefix
}
_ebrelayera_1"
:/root/
${
chain33USDTBridgeTokenAddr
}
.abi
docker
cp
"
${
chain33USDTBridgeTokenAddr
}
.abi"
"
${
dockerNamePrefix
}
_ebrelayera_1"
:/root/
${
chain33USDTBridgeTokenAddr
}
.abi
# docker cp "${chain33YccERC20TokenAddr}.abi" "${dockerNamePrefix}_ebrelayera_1":/root/${chain33YccERC20TokenAddr}.abi
# docker cp "${ethereumYccBridgeTokenAddr}.abi" "${dockerNamePrefix}_ebrelayera_1":/root/${ethereumYccBridgeTokenAddr}.abi
}
}
# 重启,因为relayerA的验证人地址和部署人的地址是一样的,所以需要重新启动relayer,更新nonce
# 重启,因为relayerA的验证人地址和部署人的地址是一样的,所以需要重新启动relayer,更新nonce
...
...
plugin/dapp/cross2eth/cmd/build/public/offlinePublic.sh
View file @
c22f4b85
...
@@ -70,7 +70,7 @@ function InitAndOfflineDeploy() {
...
@@ -70,7 +70,7 @@ function InitAndOfflineDeploy() {
# 在 Eth 上部署合约
# 在 Eth 上部署合约
# shellcheck disable=SC2154
# shellcheck disable=SC2154
${
Boss4xCLI
}
ethereum offline create
-s
"ETH"
-p
"25,25,25,25"
-o
"
${
ethDeployAddr
}
"
-v
"
${
ethValidatorAddra
}
,
${
ethValidatorAddrb
}
,
${
ethValidatorAddrc
}
,
${
ethValidatorAddrd
}
"
${
Boss4xCLI
}
ethereum offline create
-s
"ETH"
-p
"25,25,25,25"
-o
"
${
ethDeployAddr
}
"
-v
"
${
ethValidatorAddra
}
,
${
ethValidatorAddrb
}
,
${
ethValidatorAddrc
}
,
${
ethValidatorAddrd
}
"
-m
"
${
ethMultisignA
}
,
${
ethMultisignB
}
,
${
ethMultisignC
}
,
${
ethMultisignD
}
"
${
Boss4xCLI
}
ethereum offline sign
-k
"
${
ethDeployKey
}
"
${
Boss4xCLI
}
ethereum offline sign
-k
"
${
ethDeployKey
}
"
result
=
$(${
Boss4xCLI
}
ethereum offline send
-f
"deploysigntxs.txt"
)
result
=
$(${
Boss4xCLI
}
ethereum offline send
-f
"deploysigntxs.txt"
)
for
i
in
{
0..7
}
;
do
for
i
in
{
0..7
}
;
do
...
@@ -289,17 +289,17 @@ function offline_setupChain33Multisign() {
...
@@ -289,17 +289,17 @@ function offline_setupChain33Multisign() {
echo
-e
"
${
GRE
}
===========
$FUNCNAME
end ===========
${
NOC
}
"
echo
-e
"
${
GRE
}
===========
$FUNCNAME
end ===========
${
NOC
}
"
}
}
function
offline_setupEthMultisign
()
{
#
function offline_setupEthMultisign() {
echo
-e
"
${
GRE
}
===========
$FUNCNAME
begin ===========
${
NOC
}
"
#
echo -e "${GRE}=========== $FUNCNAME begin ===========${NOC}"
echo
-e
"
${
GRE
}
=========== 设置 ETH 离线钱包合约 ===========
${
NOC
}
"
#
echo -e "${GRE}=========== 设置 ETH 离线钱包合约 ===========${NOC}"
# shellcheck disable=SC2154
#
# shellcheck disable=SC2154
${
Boss4xCLI
}
ethereum offline multisign_setup
-m
"
${
multisignEthAddr
}
"
-d
"
${
ethDeployAddr
}
"
-o
"
${
ethMultisignA
}
,
${
ethMultisignB
}
,
${
ethMultisignC
}
,
${
ethMultisignD
}
"
#
${Boss4xCLI} ethereum offline multisign_setup -m "${multisignEthAddr}" -d "${ethDeployAddr}" -o "${ethMultisignA},${ethMultisignB},${ethMultisignC},${ethMultisignD}"
ethereum_offline_sign_send
"multisign_setup.txt"
#
ethereum_offline_sign_send "multisign_setup.txt"
#
${
Boss4xCLI
}
ethereum offline set_offline_addr
-a
"
${
multisignEthAddr
}
"
-c
"
${
ethBridgeBank
}
"
-d
"
${
ethDeployAddr
}
"
#
${Boss4xCLI} ethereum offline set_offline_addr -a "${multisignEthAddr}" -c "${ethBridgeBank}" -d "${ethDeployAddr}"
ethereum_offline_sign_send
"set_offline_addr.txt"
#
ethereum_offline_sign_send "set_offline_addr.txt"
echo
-e
"
${
GRE
}
===========
$FUNCNAME
end ===========
${
NOC
}
"
#
echo -e "${GRE}=========== $FUNCNAME end ===========${NOC}"
}
#
}
function
offline_transfer_multisign_Eth_test
()
{
function
offline_transfer_multisign_Eth_test
()
{
echo
-e
"
${
GRE
}
===========
$FUNCNAME
begin ===========
${
NOC
}
"
echo
-e
"
${
GRE
}
===========
$FUNCNAME
begin ===========
${
NOC
}
"
...
...
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