kyberdao

package
v0.0.15 Latest Latest
Warning

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

Go to latest
Published: Jul 18, 2020 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	StakingContract string
	DaoContract     string
	FeeHandler      string
	KNCContract     string
	CampaignCreator string
	EpochDuration   uint64
	StartDAOBlock   uint64
	MinCamDuration  uint64

	Epoch      uint64
	CampaignID uint64
)
View Source
var (
	Stake        *big.Int
	PendingStake *big.Int
	Delegation   string
)
View Source
var KyberDAOCmd = &cobra.Command{
	Use:              "kyber-dao",
	Short:            "participate to Kyber DAO 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 Preprocess

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

func PrintCampaignInformation added in v0.0.10

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

func PrintENV added in v0.0.10

func PrintENV()

func PrintStakeInformation added in v0.0.10

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

func PromptBRROption added in v0.0.10

func PromptBRROption(prompter string) *big.Int

Types

type Campaign

type Campaign struct {
	CampType                 uint8
	StartBlock               *big.Int
	EndBlock                 *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 added in v0.0.10

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 added in v0.0.10

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 added in v0.0.10

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

func (*KyberDAO) AllStakeRelatedInfo added in v0.0.10

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

func (*KyberDAO) AllTimeRelatedInfo added in v0.0.10

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) GetPoolMaster

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

func (*KyberDAO) GetRewardInfo

func (self *KyberDAO) GetRewardInfo(s string, e uint64) (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 added in v0.0.10

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
	DelegatedStake *big.Int
}

type TimeRelatedInfo added in v0.0.10

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

	NextEpoch           uint64
	NextEpochStartBlock *big.Int // the first block that the campaign is active
	NextEpochEndBlock   *big.Int // the last block that the campaign is active, not the first block that the campaign is ended
}

Jump to

Keyboard shortcuts

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