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
38e6e486
Commit
38e6e486
authored
Sep 06, 2021
by
hezhengjun
Committed by
vipwzw
Sep 07, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add contract address set for evm tx
parent
c39e8f14
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
8 deletions
+14
-8
farmCmd.go
plugin/dapp/dex/boss/deploy/chain33/farmCmd.go
+12
-6
farmCmd.go
plugin/dapp/dex/boss/deploy/chain33/offline/farmCmd.go
+2
-2
No files found.
plugin/dapp/dex/boss/deploy/chain33/farmCmd.go
View file @
38e6e486
...
...
@@ -4,6 +4,9 @@ import (
"fmt"
"os"
"github.com/33cn/chain33/common/address"
chain33Types
"github.com/33cn/chain33/types"
"github.com/33cn/plugin/plugin/dapp/dex/contracts/pancake-farm/src/masterChef"
"github.com/33cn/plugin/plugin/dapp/dex/contracts/pancake-farm/src/syrupBar"
evmAbi
"github.com/33cn/plugin/plugin/dapp/evm/executor/abi"
...
...
@@ -104,9 +107,10 @@ func AddPool2Farm(cmd *cobra.Command, args []string) {
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
}
exector
:=
chain33Types
.
GetExecName
(
"evm"
,
paraName
)
action
:=
evmtypes
.
EVMContractAction
{
Amount
:
0
,
GasLimit
:
0
,
GasPrice
:
0
,
Note
:
parameter
,
Para
:
packData
,
ContractAddr
:
address
.
ExecAddress
(
exector
)}
data
,
err
:=
createEvmTx
(
chainID
,
&
action
,
paraName
+
"evm"
,
caller
,
masterChefAddrStr
,
expire
,
rpcLaddr
,
feeInt64
)
data
,
err
:=
createEvmTx
(
chainID
,
&
action
,
exector
,
caller
,
masterChefAddrStr
,
expire
,
rpcLaddr
,
feeInt64
)
if
err
!=
nil
{
fmt
.
Println
(
"AddPool2FarmHandle"
,
"Failed to do createEvmTx due to:"
,
err
.
Error
())
return
...
...
@@ -170,9 +174,10 @@ func UpdateAllocPoint(cmd *cobra.Command, args []string) {
fmt
.
Println
(
"UpdateAllocPoint"
,
"Failed to do abi.Pack due to:"
,
err
.
Error
())
return
}
action
:=
evmtypes
.
EVMContractAction
{
Amount
:
0
,
GasLimit
:
0
,
GasPrice
:
0
,
Note
:
parameter
,
Para
:
packData
}
exector
:=
chain33Types
.
GetExecName
(
"evm"
,
paraName
)
action
:=
evmtypes
.
EVMContractAction
{
Amount
:
0
,
GasLimit
:
0
,
GasPrice
:
0
,
Note
:
parameter
,
Para
:
packData
,
ContractAddr
:
address
.
ExecAddress
(
exector
)}
data
,
err
:=
createEvmTx
(
chainID
,
&
action
,
paraName
+
"evm"
,
caller
,
masterChefAddrStr
,
expire
,
rpcLaddr
,
feeInt64
)
data
,
err
:=
createEvmTx
(
chainID
,
&
action
,
exector
,
caller
,
masterChefAddrStr
,
expire
,
rpcLaddr
,
feeInt64
)
if
err
!=
nil
{
fmt
.
Println
(
"UpdateAllocPoint"
,
"Failed to do createEvmTx due to:"
,
err
.
Error
())
return
...
...
@@ -229,9 +234,10 @@ func TransferOwnerShip(cmd *cobra.Command, args []string) {
fmt
.
Println
(
"TransferOwnerShip"
,
"Failed to do abi.Pack due to:"
,
err
.
Error
())
return
}
action
:=
evmtypes
.
EVMContractAction
{
Amount
:
0
,
GasLimit
:
0
,
GasPrice
:
0
,
Note
:
parameter
,
Para
:
packData
}
exector
:=
chain33Types
.
GetExecName
(
"evm"
,
paraName
)
action
:=
evmtypes
.
EVMContractAction
{
Amount
:
0
,
GasLimit
:
0
,
GasPrice
:
0
,
Note
:
parameter
,
Para
:
packData
,
ContractAddr
:
address
.
ExecAddress
(
exector
)}
data
,
err
:=
createEvmTx
(
chainID
,
&
action
,
paraName
+
"evm"
,
caller
,
contract
,
expire
,
rpcLaddr
,
feeInt64
)
data
,
err
:=
createEvmTx
(
chainID
,
&
action
,
exector
,
caller
,
contract
,
expire
,
rpcLaddr
,
feeInt64
)
if
err
!=
nil
{
fmt
.
Println
(
"TransferOwnerShip"
,
"Failed to do createEvmTx due to:"
,
err
.
Error
())
return
...
...
plugin/dapp/dex/boss/deploy/chain33/offline/farmCmd.go
View file @
38e6e486
...
...
@@ -328,7 +328,7 @@ func addPool(cmd *cobra.Command, args []string) {
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
}
action
:=
&
evmtypes
.
EVMContractAction
{
Amount
:
0
,
GasLimit
:
0
,
GasPrice
:
0
,
Note
:
parameter
,
Para
:
packData
,
ContractAddr
:
masterChefAddrStr
}
content
,
txHash
,
err
:=
utils
.
CallContractAndSign
(
info
,
action
,
masterChefAddrStr
)
if
nil
!=
err
{
fmt
.
Println
(
"Failed to create master chef due to cause:"
,
err
.
Error
())
...
...
@@ -414,7 +414,7 @@ func updateAllocPoint(cmd *cobra.Command, args []string) {
fmt
.
Println
(
"UpdateAllocPoint"
,
"Failed to do abi.Pack due to:"
,
err
.
Error
())
return
}
action
:=
&
evmtypes
.
EVMContractAction
{
Amount
:
0
,
GasLimit
:
0
,
GasPrice
:
0
,
Note
:
parameter
,
Para
:
packData
}
action
:=
&
evmtypes
.
EVMContractAction
{
Amount
:
0
,
GasLimit
:
0
,
GasPrice
:
0
,
Note
:
parameter
,
Para
:
packData
,
ContractAddr
:
masterChefAddrStr
}
content
,
txHash
,
err
:=
utils
.
CallContractAndSign
(
info
,
action
,
masterChefAddrStr
)
if
nil
!=
err
{
fmt
.
Println
(
"Failed to create master chef due to cause:"
,
err
.
Error
())
...
...
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