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
47dc129b
Commit
47dc129b
authored
Aug 20, 2021
by
hezhengjun
Committed by
vipwzw
Aug 23, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix linter error
parent
87dfa6d4
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
26 additions
and
28 deletions
+26
-28
dockerRelayerTestInfinite.sh
plugin/dapp/cross2eth/cmd/build/dockerRelayerTestInfinite.sh
+4
-4
dockerRelayerMainTest.sh
...2eth/cmd/build/faultiness_online/dockerRelayerMainTest.sh
+2
-2
handler.go
plugin/dapp/cross2eth/contracts/gnosis/bsctest/handler.go
+1
-0
handler.go
...in/dapp/cross2eth/contracts/gnosis/chain33test/handler.go
+1
-0
abiUnpack_test.go
plugin/dapp/cross2eth/contracts/test/abiUnpack_test.go
+1
-0
cakeCmd.go
plugin/dapp/dex/boss/deploy/ethereum/cakeCmd.go
+10
-11
deployFarmCmd.go
...in/dapp/dex/boss/deploy/ethereum/offline/deployFarmCmd.go
+7
-11
No files found.
plugin/dapp/cross2eth/cmd/build/dockerRelayerTestInfinite.sh
View file @
47dc129b
...
...
@@ -37,10 +37,10 @@ chain33EthTokenAddr=""
ethereumBtyTokenAddr
=
""
chain33YccTokenAddr
=
""
ethereumYccTokenAddr
=
""
BridgeRegistryOnChain33
=
""
chain33YccErc20Addr
=
""
BridgeRegistryOnEth
=
""
ethBridgeToeknYccAddr
=
""
#
BridgeRegistryOnChain33=""
#
chain33YccErc20Addr=""
#
BridgeRegistryOnEth=""
#
ethBridgeToeknYccAddr=""
chain33ZBCErc20Addr
=
""
ethBridgeToeknZBCAddr
=
""
multisignChain33Addr
=
""
...
...
plugin/dapp/cross2eth/cmd/build/faultiness_online/dockerRelayerMainTest.sh
View file @
47dc129b
...
...
@@ -59,7 +59,7 @@ chain33ValidatorKeyd="0x3818b257b05ee75b6e43ee0e3cfc2d8502342cf67caed533e3756966
#CLIA="./ebcli_A"
ethUrl
=
""
#
ethUrl=""
function
start_docker_ebrelayerA
()
{
...
...
@@ -121,7 +121,7 @@ function StartDockerRelayerDeploy() {
# change EthProvider url
dockerAddr
=
$(
get_docker_addr
"
${
dockerNamePrefix
}
_ganachetest_1"
)
ethUrl
=
"http://
${
dockerAddr
}
:8545"
#
ethUrl="http://${dockerAddr}:8545"
# 修改 relayer.toml 配置文件
updata_relayer_a_toml
"
${
dockerAddr
}
"
"
${
dockerNamePrefix
}
_ebrelayera_1"
"./relayer.toml"
...
...
plugin/dapp/cross2eth/contracts/gnosis/bsctest/handler.go
View file @
47dc129b
package
main
//
//import (
// "context"
...
...
plugin/dapp/cross2eth/contracts/gnosis/chain33test/handler.go
View file @
47dc129b
package
main
//
//import (
// "context"
...
...
plugin/dapp/cross2eth/contracts/test/abiUnpack_test.go
View file @
47dc129b
package
test
//
//import (
// "encoding/hex"
...
...
plugin/dapp/dex/boss/deploy/ethereum/cakeCmd.go
View file @
47dc129b
...
...
@@ -70,7 +70,7 @@ func DeployPancakeCmd() *cobra.Command {
func
DeployContractsCake
(
cmd
*
cobra
.
Command
,
args
[]
string
)
{
ethNodeAddr
,
_
:=
cmd
.
Flags
()
.
GetString
(
"rpc_laddr_ethereum"
)
key
,
_
:=
cmd
.
Flags
()
.
GetString
(
"key"
)
key
,
_
:=
cmd
.
Flags
()
.
GetString
(
"key"
)
setupWebsocketEthClient
(
ethNodeAddr
)
err
:=
DeployPancake
(
key
)
if
nil
!=
err
{
...
...
@@ -102,7 +102,7 @@ func AddAllowance4LPFlags(cmd *cobra.Command) {
cmd
.
Flags
()
.
Int64P
(
"amount"
,
"p"
,
0
,
"amount to approve"
)
_
=
cmd
.
MarkFlagRequired
(
"amount"
)
cmd
.
Flags
()
.
StringP
(
"key"
,
"k"
,
""
,
"private key"
)
cmd
.
Flags
()
.
StringP
(
"key"
,
"k"
,
""
,
"private key"
)
}
...
...
@@ -111,11 +111,11 @@ func AddAllowance4LP(cmd *cobra.Command, args []string) {
amount
,
_
:=
cmd
.
Flags
()
.
GetInt64
(
"amount"
)
lpToken
,
_
:=
cmd
.
Flags
()
.
GetString
(
"lptoken"
)
ethNodeAddr
,
_
:=
cmd
.
Flags
()
.
GetString
(
"rpc_laddr_ethereum"
)
privkey
,
_
:=
cmd
.
Flags
()
.
GetString
(
"key"
)
privkey
,
_
:=
cmd
.
Flags
()
.
GetString
(
"key"
)
setupWebsocketEthClient
(
ethNodeAddr
)
//owner string, spender string, amount int64
err
:=
AddAllowance4LPHandle
(
lpToken
,
masterChefAddrStr
,
privkey
,
amount
)
err
:=
AddAllowance4LPHandle
(
lpToken
,
masterChefAddrStr
,
privkey
,
amount
)
if
nil
!=
err
{
fmt
.
Println
(
"Failed to AddPool2Farm due to:"
,
err
.
Error
())
return
...
...
@@ -142,21 +142,20 @@ func CheckAllowance4LPFlags(cmd *cobra.Command) {
cmd
.
Flags
()
.
StringP
(
"lptoken"
,
"l"
,
""
,
"lp Addr "
)
_
=
cmd
.
MarkFlagRequired
(
"lptoken"
)
cmd
.
Flags
()
.
StringP
(
"key"
,
"k"
,
""
,
"private key"
)
cmd
.
Flags
()
.
StringP
(
"key"
,
"k"
,
""
,
"private key"
)
}
func
CheckAllowance4LP
(
cmd
*
cobra
.
Command
,
args
[]
string
)
{
masterChefAddrStr
,
_
:=
cmd
.
Flags
()
.
GetString
(
"masterchef"
)
lpToken
,
_
:=
cmd
.
Flags
()
.
GetString
(
"lptoken"
)
privkey
,
_
:=
cmd
.
Flags
()
.
GetString
(
"key"
)
privkey
,
_
:=
cmd
.
Flags
()
.
GetString
(
"key"
)
ethNodeAddr
,
_
:=
cmd
.
Flags
()
.
GetString
(
"rpc_laddr_ethereum"
)
setupWebsocketEthClient
(
ethNodeAddr
)
//owner string, spender string, amount int64
err
:=
CheckAllowance4LPHandle
(
lpToken
,
masterChefAddrStr
,
privkey
)
err
:=
CheckAllowance4LPHandle
(
lpToken
,
masterChefAddrStr
,
privkey
)
if
nil
!=
err
{
fmt
.
Println
(
"Failed to CheckAllowance4LP due to:"
,
err
.
Error
())
return
...
...
@@ -179,18 +178,18 @@ func showPairInitCodeHashCmd() *cobra.Command {
func
showPairInitCodeHashFlags
(
cmd
*
cobra
.
Command
)
{
cmd
.
Flags
()
.
StringP
(
"factory"
,
"f"
,
""
,
"factory address"
)
_
=
cmd
.
MarkFlagRequired
(
"factory"
)
cmd
.
Flags
()
.
StringP
(
"key"
,
"k"
,
""
,
"private key"
)
cmd
.
Flags
()
.
StringP
(
"key"
,
"k"
,
""
,
"private key"
)
}
func
showPairInitCodeHash
(
cmd
*
cobra
.
Command
,
args
[]
string
)
{
factory
,
_
:=
cmd
.
Flags
()
.
GetString
(
"factory"
)
ethNodeAddr
,
_
:=
cmd
.
Flags
()
.
GetString
(
"rpc_laddr_ethereum"
)
privkey
,
_
:=
cmd
.
Flags
()
.
GetString
(
"key"
)
privkey
,
_
:=
cmd
.
Flags
()
.
GetString
(
"key"
)
setupWebsocketEthClient
(
ethNodeAddr
)
//owner string, spender string, amount int64
err
:=
showPairInitCodeHashHandle
(
factory
,
privkey
)
err
:=
showPairInitCodeHashHandle
(
factory
,
privkey
)
if
nil
!=
err
{
fmt
.
Println
(
"Failed to showPairInitCodeHash due to:"
,
err
.
Error
())
return
...
...
plugin/dapp/dex/boss/deploy/ethereum/offline/deployFarmCmd.go
View file @
47dc129b
...
...
@@ -15,7 +15,7 @@ import (
type
SignCakeToken
struct
{
}
func
(
s
*
SignCakeToken
)
reWriteDeployCakeToken
(
nonce
uint64
,
gasPrice
*
big
.
Int
,
key
*
ecdsa
.
PrivateKey
,
params
...
interface
{})
(
signedTx
,
hash
string
,
err
error
)
{
func
(
s
*
SignCakeToken
)
reWriteDeployCakeToken
(
nonce
uint64
,
gasPrice
*
big
.
Int
,
key
*
ecdsa
.
PrivateKey
,
params
...
interface
{})
(
signedTx
,
hash
string
,
err
error
)
{
parsed
,
err
:=
abi
.
JSON
(
strings
.
NewReader
(
cakeToken
.
CakeTokenABI
))
if
err
!=
nil
{
return
...
...
@@ -33,12 +33,10 @@ func (s *SignCakeToken) reWriteDeployCakeToken(nonce uint64, gasPrice *big.Int,
}
type
signsyrupBar
struct
{
}
func
(
s
*
signsyrupBar
)
reWriteDeploysyrupBar
(
nonce
uint64
,
gasPrice
*
big
.
Int
,
key
*
ecdsa
.
PrivateKey
,
cakeAddress
common
.
Address
)(
signedTx
,
hash
string
,
err
error
)
{
func
(
s
*
signsyrupBar
)
reWriteDeploysyrupBar
(
nonce
uint64
,
gasPrice
*
big
.
Int
,
key
*
ecdsa
.
PrivateKey
,
cakeAddress
common
.
Address
)
(
signedTx
,
hash
string
,
err
error
)
{
parsed
,
err
:=
abi
.
JSON
(
strings
.
NewReader
(
syrupBar
.
SyrupBarABI
))
if
err
!=
nil
{
return
...
...
@@ -51,20 +49,19 @@ func (s *signsyrupBar)reWriteDeploysyrupBar(nonce uint64, gasPrice *big.Int, ke
data
:=
append
(
common
.
FromHex
(
abiBin
),
input
...
)
var
amount
=
new
(
big
.
Int
)
ntx
:=
types
.
NewContractCreation
(
nonce
,
amount
,
gasLimit
,
gasPrice
,
data
)
ntx
:=
types
.
NewContractCreation
(
nonce
,
amount
,
gasLimit
,
gasPrice
,
data
)
return
SignTx
(
key
,
ntx
)
}
type
signMasterChef
struct
{
type
signMasterChef
struct
{
}
func
(
s
*
signMasterChef
)
reWriteDeployMasterChef
(
nonce
uint64
,
gasPrice
*
big
.
Int
,
key
*
ecdsa
.
PrivateKey
,
cakeAddress
,
syruBarAddress
,
fromaddr
common
.
Address
,
reward
,
_startBlock
*
big
.
Int
)(
signedTx
,
hash
string
,
err
error
)
{
func
(
s
*
signMasterChef
)
reWriteDeployMasterChef
(
nonce
uint64
,
gasPrice
*
big
.
Int
,
key
*
ecdsa
.
PrivateKey
,
cakeAddress
,
syruBarAddress
,
fromaddr
common
.
Address
,
reward
,
_startBlock
*
big
.
Int
)
(
signedTx
,
hash
string
,
err
error
)
{
parsed
,
err
:=
abi
.
JSON
(
strings
.
NewReader
(
masterChef
.
MasterChefABI
))
if
err
!=
nil
{
return
}
input
,
err
:=
parsed
.
Pack
(
""
,
cakeAddress
,
syruBarAddress
,
fromaddr
,
reward
,
_startBlock
)
input
,
err
:=
parsed
.
Pack
(
""
,
cakeAddress
,
syruBarAddress
,
fromaddr
,
reward
,
_startBlock
)
if
err
!=
nil
{
return
}
...
...
@@ -74,4 +71,4 @@ func (s *signMasterChef)reWriteDeployMasterChef(nonce uint64, gasPrice *big.Int,
var
amount
=
new
(
big
.
Int
)
ntx
:=
types
.
NewContractCreation
(
nonce
,
amount
,
gasLimit
,
gasPrice
,
data
)
return
SignTx
(
key
,
ntx
)
}
\ No newline at end of file
}
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