-
Notifications
You must be signed in to change notification settings - Fork 12
/
keys.go
50 lines (42 loc) · 1.5 KB
/
keys.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
package staking
import (
"github.com/ethereum/go-ethereum/accounts/abi"
"github.com/ethereum/go-ethereum/common"
"github.com/functionx/fx-core/v5/contract"
fxtypes "github.com/functionx/fx-core/v5/types"
)
const (
DelegateGas = 40_000 // 98000 - 160000 // 165000
UndelegateGas = 45_000 // 94000 - 163000 // 172000
WithdrawGas = 30_000 // 94000 // 120000
DelegationGas = 30_000 // 98000
DelegationRewardsGas = 30_000 // 94000
TransferSharesGas = 50_000 // 134000 - 190000
ApproveSharesGas = 10_000 // 4400
AllowanceSharesGas = 5_000 // 1240
TransferFromSharesGas = 60_000 // 134000 - 200000
DelegateMethodName = "delegate"
UndelegateMethodName = "undelegate"
WithdrawMethodName = "withdraw"
DelegationMethodName = "delegation"
DelegationRewardsMethodName = "delegationRewards"
ApproveSharesMethodName = "approveShares"
AllowanceSharesMethodName = "allowanceShares"
TransferSharesMethodName = "transferShares"
TransferFromSharesMethodName = "transferFromShares"
DelegateEventName = "Delegate"
UndelegateEventName = "Undelegate"
WithdrawEventName = "Withdraw"
TransferSharesEventName = "TransferShares"
ApproveSharesEventName = "ApproveShares"
)
var (
stakingAddress = common.HexToAddress(fxtypes.StakingAddress)
stakingABI = fxtypes.MustABIJson(contract.IStakingMetaData.ABI)
)
func GetAddress() common.Address {
return stakingAddress
}
func GetABI() abi.ABI {
return stakingABI
}