Documentation ¶
Index ¶
- Variables
- func GetAbiByContractAddress(addr types.Address) (string, error)
- func GetChainContract(addr types.Address, methodSelector []byte) (interface{}, bool, error)
- func GetChainContractName(addr types.Address, methodSelector []byte) (string, bool, error)
- func IsChainContract(addr types.Address) bool
- type AirdropRewords
- func (ar *AirdropRewords) DoPending(block *types.StateBlock) (*types.PendingKey, *types.PendingInfo, error)
- func (ar *AirdropRewords) DoReceive(ctx *vmstore.VMContext, block *types.StateBlock, input *types.StateBlock) ([]*ContractBlock, error)
- func (ar *AirdropRewords) DoSend(ctx *vmstore.VMContext, block *types.StateBlock) error
- func (ar *AirdropRewords) GetFee(ctx *vmstore.VMContext, block *types.StateBlock) (types.Balance, error)
- func (*AirdropRewords) GetRefundData() []byte
- type BlackHole
- func (b *BlackHole) DoGapPov(ctx *vmstore.VMContext, block *types.StateBlock) (uint64, error)
- func (b *BlackHole) DoReceive(ctx *vmstore.VMContext, block *types.StateBlock, input *types.StateBlock) ([]*ContractBlock, error)
- func (b *BlackHole) GetFee(ctx *vmstore.VMContext, block *types.StateBlock) (types.Balance, error)
- func (b *BlackHole) GetRefundData() []byte
- func (b *BlackHole) ProcessSend(ctx *vmstore.VMContext, block *types.StateBlock) (*types.PendingKey, *types.PendingInfo, error)
- type ChainContractV1
- type ChainContractV2
- type ConfidantRewards
- func (ar *ConfidantRewards) DoPending(block *types.StateBlock) (*types.PendingKey, *types.PendingInfo, error)
- func (*ConfidantRewards) DoReceive(ctx *vmstore.VMContext, block *types.StateBlock, input *types.StateBlock) ([]*ContractBlock, error)
- func (*ConfidantRewards) DoSend(ctx *vmstore.VMContext, block *types.StateBlock) error
- func (*ConfidantRewards) GetFee(ctx *vmstore.VMContext, block *types.StateBlock) (types.Balance, error)
- func (*ConfidantRewards) GetRefundData() []byte
- type ContractBlock
- type Describe
- type InternalContract
- type MinerReward
- func (m *MinerReward) DoGapPov(ctx *vmstore.VMContext, block *types.StateBlock) (uint64, error)
- func (m *MinerReward) DoReceive(ctx *vmstore.VMContext, block, input *types.StateBlock) ([]*ContractBlock, error)
- func (m *MinerReward) GetAvailRewardInfo(ctx *vmstore.VMContext, coinbase types.Address, nodeHeight uint64, ...) (*cabi.MinerRewardInfo, error)
- func (m *MinerReward) GetFee(ctx *vmstore.VMContext, block *types.StateBlock) (types.Balance, error)
- func (m *MinerReward) GetLastRewardHeight(ctx *vmstore.VMContext, coinbase types.Address) (uint64, error)
- func (m *MinerReward) GetNodeRewardHeight(ctx *vmstore.VMContext) (uint64, error)
- func (m *MinerReward) GetRefundData() []byte
- func (m *MinerReward) GetRewardHistory(ctx *vmstore.VMContext, coinbase types.Address) (*cabi.MinerRewardInfo, error)
- func (m *MinerReward) ProcessSend(ctx *vmstore.VMContext, block *types.StateBlock) (*types.PendingKey, *types.PendingInfo, error)
- func (m *MinerReward) SetStorage(ctx *vmstore.VMContext, endHeight uint64, RewardAmount *big.Int, ...) error
- type Mintage
- func (m *Mintage) DoPending(block *types.StateBlock) (*types.PendingKey, *types.PendingInfo, error)
- func (m *Mintage) DoReceive(ctx *vmstore.VMContext, block *types.StateBlock, input *types.StateBlock) ([]*ContractBlock, error)
- func (m *Mintage) DoSend(ctx *vmstore.VMContext, block *types.StateBlock) error
- func (m *Mintage) GetFee(ctx *vmstore.VMContext, block *types.StateBlock) (types.Balance, error)
- func (m *Mintage) GetRefundData() []byte
- type Nep5Pledge
- func (*Nep5Pledge) DoPending(block *types.StateBlock) (*types.PendingKey, *types.PendingInfo, error)
- func (*Nep5Pledge) DoReceive(ctx *vmstore.VMContext, block, input *types.StateBlock) ([]*ContractBlock, error)
- func (*Nep5Pledge) DoSend(ctx *vmstore.VMContext, block *types.StateBlock) error
- func (p *Nep5Pledge) GetFee(ctx *vmstore.VMContext, block *types.StateBlock) (types.Balance, error)
- func (*Nep5Pledge) GetRefundData() []byte
- type NoSignWithPending
- type RepReward
- func (r *RepReward) DoGapPov(ctx *vmstore.VMContext, block *types.StateBlock) (uint64, error)
- func (r *RepReward) DoReceive(ctx *vmstore.VMContext, block, input *types.StateBlock) ([]*ContractBlock, error)
- func (r *RepReward) GetAvailRewardInfo(ctx *vmstore.VMContext, account types.Address, nodeHeight uint64, ...) (*cabi.RepRewardInfo, error)
- func (r *RepReward) GetFee(ctx *vmstore.VMContext, block *types.StateBlock) (types.Balance, error)
- func (r *RepReward) GetLastRewardHeight(ctx *vmstore.VMContext, account types.Address) (uint64, error)
- func (r *RepReward) GetNodeRewardHeight(ctx *vmstore.VMContext) (uint64, error)
- func (r *RepReward) GetRefundData() []byte
- func (r *RepReward) GetRewardHistory(ctx *vmstore.VMContext, account types.Address) (*cabi.RepRewardInfo, error)
- func (r *RepReward) ProcessSend(ctx *vmstore.VMContext, block *types.StateBlock) (*types.PendingKey, *types.PendingInfo, error)
- func (r *RepReward) SetStorage(ctx *vmstore.VMContext, endHeight uint64, RewardAmount *big.Int, ...) error
- type WithSignAndPending
- type WithSignNoPending
- type WithdrawMintage
- func (m *WithdrawMintage) DoPending(block *types.StateBlock) (*types.PendingKey, *types.PendingInfo, error)
- func (m *WithdrawMintage) DoReceive(ctx *vmstore.VMContext, block, input *types.StateBlock) ([]*ContractBlock, error)
- func (m *WithdrawMintage) DoSend(ctx *vmstore.VMContext, block *types.StateBlock) error
- func (m *WithdrawMintage) GetFee(ctx *vmstore.VMContext, block *types.StateBlock) (types.Balance, error)
- func (m *WithdrawMintage) GetRefundData() []byte
- type WithdrawNep5Pledge
- func (m *WithdrawNep5Pledge) DoPending(block *types.StateBlock) (*types.PendingKey, *types.PendingInfo, error)
- func (*WithdrawNep5Pledge) DoReceive(ctx *vmstore.VMContext, block, input *types.StateBlock) ([]*ContractBlock, error)
- func (*WithdrawNep5Pledge) DoSend(ctx *vmstore.VMContext, block *types.StateBlock) (err error)
- func (*WithdrawNep5Pledge) GetFee(ctx *vmstore.VMContext, block *types.StateBlock) (types.Balance, error)
- func (*WithdrawNep5Pledge) GetRefundData() []byte
Constants ¶
This section is empty.
Variables ¶
View Source
var (
MinPledgeAmount = big.NewInt(5 * 1e13) // 50K QLC
)
Functions ¶
func GetAbiByContractAddress ¶ added in v1.3.0
func GetChainContract ¶
func GetChainContractName ¶ added in v1.2.0
func IsChainContract ¶
Types ¶
type AirdropRewords ¶ added in v1.2.0
type AirdropRewords struct {
NoSignWithPending
}
func (*AirdropRewords) DoPending ¶ added in v1.2.0
func (ar *AirdropRewords) DoPending(block *types.StateBlock) (*types.PendingKey, *types.PendingInfo, error)
func (*AirdropRewords) DoReceive ¶ added in v1.2.0
func (ar *AirdropRewords) DoReceive(ctx *vmstore.VMContext, block *types.StateBlock, input *types.StateBlock) ([]*ContractBlock, error)
func (*AirdropRewords) DoSend ¶ added in v1.2.0
func (ar *AirdropRewords) DoSend(ctx *vmstore.VMContext, block *types.StateBlock) error
func (*AirdropRewords) GetFee ¶ added in v1.2.0
func (ar *AirdropRewords) GetFee(ctx *vmstore.VMContext, block *types.StateBlock) (types.Balance, error)
func (*AirdropRewords) GetRefundData ¶ added in v1.2.0
func (*AirdropRewords) GetRefundData() []byte
type BlackHole ¶ added in v1.3.0
type BlackHole struct {
NoSignWithPending
}
func (*BlackHole) DoReceive ¶ added in v1.3.0
func (b *BlackHole) DoReceive(ctx *vmstore.VMContext, block *types.StateBlock, input *types.StateBlock) ([]*ContractBlock, error)
func (*BlackHole) GetRefundData ¶ added in v1.3.0
func (*BlackHole) ProcessSend ¶ added in v1.3.0
func (b *BlackHole) ProcessSend(ctx *vmstore.VMContext, block *types.StateBlock) (*types.PendingKey, *types.PendingInfo, error)
TODO: save contract data
type ChainContractV1 ¶ added in v1.3.0
type ChainContractV1 interface { InternalContract // DoPending generate pending info from send block DoPending(block *types.StateBlock) (*types.PendingKey, *types.PendingInfo, error) // ProcessSend verify or update StateBlock.Data DoSend(ctx *vmstore.VMContext, block *types.StateBlock) error }
type ChainContractV2 ¶ added in v1.3.0
type ChainContractV2 interface { InternalContract // ProcessSend verify or update StateBlock.Data ProcessSend(ctx *vmstore.VMContext, block *types.StateBlock) (*types.PendingKey, *types.PendingInfo, error) DoGapPov(ctx *vmstore.VMContext, block *types.StateBlock) (uint64, error) }
type ConfidantRewards ¶ added in v1.2.0
type ConfidantRewards struct {
NoSignWithPending
}
func (*ConfidantRewards) DoPending ¶ added in v1.2.0
func (ar *ConfidantRewards) DoPending(block *types.StateBlock) (*types.PendingKey, *types.PendingInfo, error)
func (*ConfidantRewards) DoReceive ¶ added in v1.2.0
func (*ConfidantRewards) DoReceive(ctx *vmstore.VMContext, block *types.StateBlock, input *types.StateBlock) ([]*ContractBlock, error)
func (*ConfidantRewards) DoSend ¶ added in v1.2.0
func (*ConfidantRewards) DoSend(ctx *vmstore.VMContext, block *types.StateBlock) error
func (*ConfidantRewards) GetFee ¶ added in v1.2.0
func (*ConfidantRewards) GetFee(ctx *vmstore.VMContext, block *types.StateBlock) (types.Balance, error)
func (*ConfidantRewards) GetRefundData ¶ added in v1.2.0
func (*ConfidantRewards) GetRefundData() []byte
type ContractBlock ¶
type ContractBlock struct { VMContext *vmstore.VMContext Block *types.StateBlock ToAddress types.Address BlockType types.BlockType Amount types.Balance Token types.Hash Data []byte }
ContractBlock generated by contract
type Describe ¶ added in v1.3.0
type Describe struct {
// contains filtered or unexported fields
}
func (Describe) WithPending ¶ added in v1.3.0
func (Describe) WithSignature ¶ added in v1.3.0
type InternalContract ¶ added in v1.3.0
type InternalContract interface { GetFee(ctx *vmstore.VMContext, block *types.StateBlock) (types.Balance, error) // check status, update state DoReceive(ctx *vmstore.VMContext, block *types.StateBlock, input *types.StateBlock) ([]*ContractBlock, error) // refund data at receive error GetRefundData() []byte GetDescribe() Describe }
type MinerReward ¶ added in v1.2.3
type MinerReward struct {
WithSignAndPending
}
func (*MinerReward) DoGapPov ¶ added in v1.3.0
func (m *MinerReward) DoGapPov(ctx *vmstore.VMContext, block *types.StateBlock) (uint64, error)
func (*MinerReward) DoReceive ¶ added in v1.2.3
func (m *MinerReward) DoReceive(ctx *vmstore.VMContext, block, input *types.StateBlock) ([]*ContractBlock, error)
func (*MinerReward) GetAvailRewardInfo ¶ added in v1.2.3
func (m *MinerReward) GetAvailRewardInfo(ctx *vmstore.VMContext, coinbase types.Address, nodeHeight uint64, lastRewardHeight uint64) (*cabi.MinerRewardInfo, error)
func (*MinerReward) GetFee ¶ added in v1.2.3
func (m *MinerReward) GetFee(ctx *vmstore.VMContext, block *types.StateBlock) (types.Balance, error)
func (*MinerReward) GetLastRewardHeight ¶ added in v1.3.0
func (*MinerReward) GetNodeRewardHeight ¶ added in v1.2.3
func (m *MinerReward) GetNodeRewardHeight(ctx *vmstore.VMContext) (uint64, error)
func (*MinerReward) GetRefundData ¶ added in v1.2.3
func (m *MinerReward) GetRefundData() []byte
func (*MinerReward) GetRewardHistory ¶ added in v1.3.0
func (m *MinerReward) GetRewardHistory(ctx *vmstore.VMContext, coinbase types.Address) (*cabi.MinerRewardInfo, error)
func (*MinerReward) ProcessSend ¶ added in v1.3.0
func (m *MinerReward) ProcessSend(ctx *vmstore.VMContext, block *types.StateBlock) (*types.PendingKey, *types.PendingInfo, error)
func (*MinerReward) SetStorage ¶ added in v1.3.1
func (m *MinerReward) SetStorage(ctx *vmstore.VMContext, endHeight uint64, RewardAmount *big.Int, RewardBlocks uint64, block *types.StateBlock) error
type Mintage ¶
type Mintage struct {
WithSignNoPending
}
func (*Mintage) DoPending ¶ added in v1.2.0
func (m *Mintage) DoPending(block *types.StateBlock) (*types.PendingKey, *types.PendingInfo, error)
func (*Mintage) DoReceive ¶
func (m *Mintage) DoReceive(ctx *vmstore.VMContext, block *types.StateBlock, input *types.StateBlock) ([]*ContractBlock, error)
TODO: verify input block timestamp
func (*Mintage) GetRefundData ¶
type Nep5Pledge ¶ added in v1.1.0
type Nep5Pledge struct {
WithSignNoPending
}
func (*Nep5Pledge) DoPending ¶ added in v1.2.0
func (*Nep5Pledge) DoPending(block *types.StateBlock) (*types.PendingKey, *types.PendingInfo, error)
func (*Nep5Pledge) DoReceive ¶ added in v1.1.0
func (*Nep5Pledge) DoReceive(ctx *vmstore.VMContext, block, input *types.StateBlock) ([]*ContractBlock, error)
func (*Nep5Pledge) DoSend ¶ added in v1.1.0
func (*Nep5Pledge) DoSend(ctx *vmstore.VMContext, block *types.StateBlock) error
check pledge chain coin - address is normal user address - small than min pledge amount transfer quota to beneficial address
func (*Nep5Pledge) GetFee ¶ added in v1.1.0
func (p *Nep5Pledge) GetFee(ctx *vmstore.VMContext, block *types.StateBlock) (types.Balance, error)
func (*Nep5Pledge) GetRefundData ¶ added in v1.1.0
func (*Nep5Pledge) GetRefundData() []byte
type NoSignWithPending ¶ added in v1.3.0
type NoSignWithPending struct { }
func (NoSignWithPending) GetDescribe ¶ added in v1.3.0
func (NoSignWithPending) GetDescribe() Describe
type RepReward ¶ added in v1.3.0
type RepReward struct {
WithSignAndPending
}
func (*RepReward) DoReceive ¶ added in v1.3.0
func (r *RepReward) DoReceive(ctx *vmstore.VMContext, block, input *types.StateBlock) ([]*ContractBlock, error)
func (*RepReward) GetAvailRewardInfo ¶ added in v1.3.0
func (*RepReward) GetLastRewardHeight ¶ added in v1.3.0
func (*RepReward) GetNodeRewardHeight ¶ added in v1.3.0
func (*RepReward) GetRefundData ¶ added in v1.3.0
func (*RepReward) GetRewardHistory ¶ added in v1.3.0
func (*RepReward) ProcessSend ¶ added in v1.3.0
func (r *RepReward) ProcessSend(ctx *vmstore.VMContext, block *types.StateBlock) (*types.PendingKey, *types.PendingInfo, error)
type WithSignAndPending ¶ added in v1.3.0
type WithSignAndPending struct { }
func (WithSignAndPending) GetDescribe ¶ added in v1.3.0
func (WithSignAndPending) GetDescribe() Describe
type WithSignNoPending ¶ added in v1.3.0
type WithSignNoPending struct { }
func (WithSignNoPending) GetDescribe ¶ added in v1.3.0
func (WithSignNoPending) GetDescribe() Describe
type WithdrawMintage ¶
type WithdrawMintage struct {
WithSignNoPending
}
func (*WithdrawMintage) DoPending ¶ added in v1.2.0
func (m *WithdrawMintage) DoPending(block *types.StateBlock) (*types.PendingKey, *types.PendingInfo, error)
func (*WithdrawMintage) DoReceive ¶
func (m *WithdrawMintage) DoReceive(ctx *vmstore.VMContext, block, input *types.StateBlock) ([]*ContractBlock, error)
func (*WithdrawMintage) DoSend ¶
func (m *WithdrawMintage) DoSend(ctx *vmstore.VMContext, block *types.StateBlock) error
func (*WithdrawMintage) GetFee ¶
func (m *WithdrawMintage) GetFee(ctx *vmstore.VMContext, block *types.StateBlock) (types.Balance, error)
func (*WithdrawMintage) GetRefundData ¶
func (m *WithdrawMintage) GetRefundData() []byte
type WithdrawNep5Pledge ¶ added in v1.1.0
type WithdrawNep5Pledge struct {
WithSignNoPending
}
func (*WithdrawNep5Pledge) DoPending ¶ added in v1.2.0
func (m *WithdrawNep5Pledge) DoPending(block *types.StateBlock) (*types.PendingKey, *types.PendingInfo, error)
func (*WithdrawNep5Pledge) DoReceive ¶ added in v1.1.0
func (*WithdrawNep5Pledge) DoReceive(ctx *vmstore.VMContext, block, input *types.StateBlock) ([]*ContractBlock, error)
func (*WithdrawNep5Pledge) DoSend ¶ added in v1.1.0
func (*WithdrawNep5Pledge) DoSend(ctx *vmstore.VMContext, block *types.StateBlock) (err error)
func (*WithdrawNep5Pledge) GetFee ¶ added in v1.1.0
func (*WithdrawNep5Pledge) GetFee(ctx *vmstore.VMContext, block *types.StateBlock) (types.Balance, error)
func (*WithdrawNep5Pledge) GetRefundData ¶ added in v1.1.0
func (*WithdrawNep5Pledge) GetRefundData() []byte
Source Files ¶
Click to show internal directories.
Click to hide internal directories.