kyberdao

package
v0.0.22 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 21, 2021 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	StakingContract         string
	DaoContract             string
	FeeHandler              string
	KNCContract             string
	CampaignCreator         string
	EpochDurationInSeconds  uint64
	StartDAOTimestamp       uint64
	MinCamDurationInSeconds uint64

	Epoch      uint64
	CampaignID uint64
)
View Source
var (
	Stake        *big.Int
	PendingStake *big.Int
	Delegation   string
)
View Source
var KIP2 bool
View Source
var KyberDAOCmd = &cobra.Command{
	Use:              "kyber-dao-v1",
	Short:            "participate to Kyber DAO V1 to get rewards",
	Long:             ``,
	TraverseChildren: true,
}
View Source
var MAX_ALLOWANCE = big.NewInt(0).Lsh(big.NewInt(1), 254)
View Source
var SAFE_ALLOWANCE = big.NewInt(0).Lsh(big.NewInt(1), 200)

Functions

func EncodeBRROption

func EncodeBRROption(rebate, reward uint64) *big.Int

func Preprocess

func Preprocess(cmd *cobra.Command, args []string) (err error)

func PrintCampaignInformation

func PrintCampaignInformation(cmd *cobra.Command, info *CampaignRelatedInfo)

func PrintENV

func PrintENV()

func PrintStakeInformation

func PrintStakeInformation(cmd *cobra.Command, info *StakeRelatedInfo)

func PromptBRROption

func PromptBRROption(prompter string) *big.Int

Types

type Campaign

type Campaign struct {
	CampaignType             uint8
	StartTimestamp           *big.Int
	EndTimestamp             *big.Int
	TotalKNCSupply           *big.Int
	MinPercentageInPrecision *big.Int
	CInPrecision             *big.Int
	TInPrecision             *big.Int
	Link                     []byte
	Options                  []*big.Int
	OptionPoints             []*big.Int
	TotalPoints              *big.Int
	WinningOption            *big.Int
	ID                       *big.Int
}

func NewEmptyCampaign

func NewEmptyCampaign() *Campaign

func (*Campaign) HasWinningOption

func (self *Campaign) HasWinningOption() bool

func (*Campaign) LinkStr

func (self *Campaign) LinkStr() string

func (*Campaign) Type

func (self *Campaign) Type() string

func (*Campaign) VerboseOption

func (self *Campaign) VerboseOption(option *big.Int, id uint64, votedID *big.Int) string

type CampaignRelatedInfo

type CampaignRelatedInfo struct {
	Campaign *Campaign
	Staker   string
	VotedID  *big.Int
}

type KyberDAO

type KyberDAO struct {
	// contains filtered or unexported fields
}

func NewKyberDAO

func NewKyberDAO(r *reader.EthReader, staking, dao, feeHandler string) *KyberDAO

func (*KyberDAO) AllCampaignRelatedInfo

func (self *KyberDAO) AllCampaignRelatedInfo(s string, camID *big.Int) (info *CampaignRelatedInfo, err error)

func (*KyberDAO) AllStakeRelatedInfo

func (self *KyberDAO) AllStakeRelatedInfo(s string, e uint64) (info *StakeRelatedInfo, err error)

func (*KyberDAO) AllTimeRelatedInfo

func (self *KyberDAO) AllTimeRelatedInfo() (*TimeRelatedInfo, error)

func (*KyberDAO) CurrentEpoch

func (self *KyberDAO) CurrentEpoch() (uint64, error)

func (*KyberDAO) GetCampaignDetail

func (self *KyberDAO) GetCampaignDetail(id *big.Int) (result *Campaign, err error)

func (*KyberDAO) GetCampaignIDs

func (self *KyberDAO) GetCampaignIDs(e uint64) ([]*big.Int, error)

func (*KyberDAO) GetDelegatedStake

func (self *KyberDAO) GetDelegatedStake(s string, e uint64) (*big.Int, error)

func (*KyberDAO) GetPendingDelegatedStake

func (self *KyberDAO) GetPendingDelegatedStake(s string) (*big.Int, error)

func (*KyberDAO) GetPendingPoolMaster

func (self *KyberDAO) GetPendingPoolMaster(s string) (common.Address, error)

func (*KyberDAO) GetPoolMaster

func (self *KyberDAO) GetPoolMaster(s string, e uint64) (common.Address, error)

func (*KyberDAO) GetRewardInfo

func (self *KyberDAO) GetRewardInfo(s string, e uint64, current bool) (reward *big.Int, totalReward *big.Int, share float64, isClaimed bool, err error)

func (*KyberDAO) GetStake

func (self *KyberDAO) GetStake(s string, e uint64) (*big.Int, error)

func (*KyberDAO) GetVotedOptionID

func (self *KyberDAO) GetVotedOptionID(s string, camID *big.Int) (*big.Int, error)

type StakeRelatedInfo

type StakeRelatedInfo struct {
	Staker                string
	Epoch                 uint64
	CurrentEpoch          uint64
	Stake                 *big.Int
	Balance               *big.Int
	Allowance             *big.Int
	FutureStake           *big.Int
	PendingStake          *big.Int
	Representative        string
	PendingRepresentative string
	DelegatedStake        *big.Int
	PendingDelegatedStake *big.Int
}

type TimeRelatedInfo

type TimeRelatedInfo struct {
	EpochDurationInSeconds uint64
	CurrentBlock           *big.Int
	CurrentBlockTimestamp  uint64
	CurrentEpoch           uint64
	TimeUntilNextEpoch     time.Duration

	NextEpoch               uint64
	NextEpochStartTimestamp uint64
	NextEpochEndTimestamp   uint64
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL