deposit

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Jan 16, 2024 License: GPL-3.0 Imports: 13 Imported by: 1

Documentation

Index

Constants

View Source
const (
	//
	DayPerMonth = 30

	OneHundredDeposit  = 100
	FiveHundredDeposit = 500

	OneHundredDepositMaxTaskPerEpoch  = 100
	FiveHundredDepositMaxTaskPerEpoch = 100

	OneHundredDepositRewardPerMonth  = 1 * params.AMT
	FiveHundredDepositRewardPerMonth = 6.25 * params.AMT //max uint64 = ^uint64(0) ≈ 18.44 AMT so 15 AMT is ok

)

Variables

This section is empty.

Functions

This section is empty.

Types

type Deposit

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

func NewDeposit

func NewDeposit(ctx context.Context, bc common.IBlockChain, db kv.RwDB, depositContracts map[types.Address]DepositContract) *Deposit

func (*Deposit) IsDepositAction

func (d *Deposit) IsDepositAction(txs *transaction.Transaction) bool

func (*Deposit) Start

func (d *Deposit) Start()

func (*Deposit) Stop

func (d *Deposit) Stop() error

type DepositContract

type DepositContract interface {
	WithdrawnSignature() types.Hash
	DepositSignature() types.Hash
	UnpackDepositLogData(data []byte) (publicKey []byte, signature []byte, depositAmount *uint256.Int, err error)
	IsDepositAction(sig [4]byte) bool
}

DepositContract d

type Info

type Info struct {
	PublicKey         types.PublicKey `json:"PublicKey"`
	DepositAmount     *uint256.Int    `json:"DepositAmount"`
	RewardPerBlock    *uint256.Int    `json:"RewardPerBlock"`
	MaxRewardPerEpoch *uint256.Int    `json:"MaxRewardPerEpoch"`
}

func GetDepositInfo

func GetDepositInfo(tx kv.Tx, addr types.Address) *Info

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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