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
0b769e23
Commit
0b769e23
authored
Sep 06, 2021
by
hezhengjun
Committed by
vipwzw
Sep 07, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add SetFeeTo
parent
38e6e486
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
60 additions
and
0 deletions
+60
-0
chain33Cli.go
plugin/dapp/dex/boss/deploy/chain33/chain33Cli.go
+60
-0
No files found.
plugin/dapp/dex/boss/deploy/chain33/chain33Cli.go
View file @
0b769e23
...
@@ -7,6 +7,11 @@ import (
...
@@ -7,6 +7,11 @@ import (
"os"
"os"
"time"
"time"
"github.com/33cn/plugin/plugin/dapp/dex/contracts/pancake-swap-periphery/src/pancakeFactory"
evmAbi
"github.com/33cn/plugin/plugin/dapp/evm/executor/abi"
evmtypes
"github.com/33cn/plugin/plugin/dapp/evm/types"
"github.com/33cn/chain33/rpc/jsonclient"
"github.com/33cn/chain33/rpc/jsonclient"
"github.com/33cn/chain33/types"
"github.com/33cn/chain33/types"
"github.com/golang/protobuf/proto"
"github.com/golang/protobuf/proto"
...
@@ -23,11 +28,66 @@ func Chain33Cmd() *cobra.Command {
...
@@ -23,11 +28,66 @@ func Chain33Cmd() *cobra.Command {
deployMulticallCmd
(),
deployMulticallCmd
(),
deployERC20ContractCmd
(),
deployERC20ContractCmd
(),
deployPancakeContractCmd
(),
deployPancakeContractCmd
(),
setFeeToCmd
(),
farmCmd
(),
farmCmd
(),
)
)
return
cmd
return
cmd
}
}
func
setFeeToCmd
()
*
cobra
.
Command
{
cmd
:=
&
cobra
.
Command
{
Use
:
"setFeeTo"
,
Short
:
"set FeeTo address to factory"
,
Run
:
setFeeTo
,
}
addSetFeeToFlags
(
cmd
)
return
cmd
}
func
addSetFeeToFlags
(
cmd
*
cobra
.
Command
)
{
cmd
.
Flags
()
.
StringP
(
"factory"
,
"f"
,
""
,
"factory Addr "
)
_
=
cmd
.
MarkFlagRequired
(
"factory"
)
cmd
.
Flags
()
.
StringP
(
"feeTo"
,
"t"
,
""
,
"feeTo Addr "
)
_
=
cmd
.
MarkFlagRequired
(
"feeTo"
)
cmd
.
Flags
()
.
StringP
(
"key"
,
"k"
,
"CC38546E9E659D15E6B4893F0AB32A06D103931A8230B0BDE71459D2B27D6944"
,
"private key of feetoSetter"
)
}
func
setFeeTo
(
cmd
*
cobra
.
Command
,
args
[]
string
)
{
factroy
,
_
:=
cmd
.
Flags
()
.
GetString
(
"factory"
)
feeTo
,
_
:=
cmd
.
Flags
()
.
GetString
(
"feeTo"
)
chainID
,
_
:=
cmd
.
Flags
()
.
GetInt32
(
"chainID"
)
caller
,
_
:=
cmd
.
Flags
()
.
GetString
(
"caller"
)
paraName
,
_
:=
cmd
.
Flags
()
.
GetString
(
"paraName"
)
expire
,
_
:=
cmd
.
Flags
()
.
GetString
(
"expire"
)
rpcLaddr
,
_
:=
cmd
.
Flags
()
.
GetString
(
"rpc_laddr"
)
fee
,
_
:=
cmd
.
Flags
()
.
GetFloat64
(
"fee"
)
feeInt64
:=
uint64
(
fee
*
1e4
)
*
1e4
//function add(uint256 _allocPoint, IBEP20 _lpToken, bool _withUpdate) public onlyOwner
parameter
:=
fmt
.
Sprintf
(
"setFeeTo(%s)"
,
feeTo
)
_
,
packData
,
err
:=
evmAbi
.
Pack
(
parameter
,
pancakeFactory
.
PancakeFactoryABI
,
true
)
if
nil
!=
err
{
fmt
.
Println
(
"AddPool2FarmHandle"
,
"Failed to do abi.Pack due to:"
,
err
.
Error
())
return
}
action
:=
evmtypes
.
EVMContractAction
{
Amount
:
0
,
GasLimit
:
0
,
GasPrice
:
0
,
Note
:
parameter
,
Para
:
packData
,
ContractAddr
:
factroy
}
data
,
err
:=
createEvmTx
(
chainID
,
&
action
,
paraName
+
"evm"
,
caller
,
factroy
,
expire
,
rpcLaddr
,
feeInt64
)
if
err
!=
nil
{
fmt
.
Println
(
"AddPool2FarmHandle"
,
"Failed to do createEvmTx due to:"
,
err
.
Error
())
return
}
txhex
,
err
:=
sendTransactionRpc
(
data
,
rpcLaddr
)
if
err
!=
nil
{
fmt
.
Println
(
"AddPool2FarmHandle"
,
"Failed to do sendTransactionRpc due to:"
,
err
.
Error
())
return
}
fmt
.
Println
(
txhex
)
}
func
deployMulticallCmd
()
*
cobra
.
Command
{
func
deployMulticallCmd
()
*
cobra
.
Command
{
cmd
:=
&
cobra
.
Command
{
cmd
:=
&
cobra
.
Command
{
Use
:
"deployMulticall"
,
Use
:
"deployMulticall"
,
...
...
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