Versions in this module Expand all Collapse all v3 v3.0.1 Dec 26, 2023 v3.0.0 Dec 23, 2022 Changes in this version + const DistributionFromSlashing + const DistributionNotFromSlashing + const ErrorGetValueByKey + const KeyApproveFormat + const KeyBalanceFormat + const KeyBlockDistributionDetail + const KeyBlockHeight + const KeyCompletionUnbondingEpochNumber + const KeyConfigCache + const KeyCurrentEpoch + const KeyDecimals + const KeyDelegationFormat + const KeyDelegationSetFormat + const KeyDistributionFromSlashing + const KeyDistributionPerBlock + const KeyEpochBlockNumber + const KeyEpochDistributionDetail + const KeyEpochFormat + const KeyEpochMaxBlockNumber + const KeyEpochMaxValidatorNumber + const KeyEpochSlashingDetail + const KeyEpochValidatorNumber + const KeyGasExchangeRate + const KeyMinSelfDelegation + const KeyNodeIDFormat + const KeyOwner + const KeyRevNodeFormat + const KeySlashingPerBlock + const KeyTotalSupply + const KeyUnbondingDelegationFormat + const KeyValidatorFormat + var DefaultERC20Decimal = "1000000000000000000" + func BalanceKey(account string) string + func BlockHeightProposerKey(epochId uint64) string + func CheckSimContextKeyExist(key string) error + func CheckSum(beforeSum, part1, part2 *utils.BigInteger) error + func GasToERC20Balance(txSimContext protocol.TxSimContext, params map[string][]byte) ([]byte, error) + func GetSimContextData(txSimContext protocol.TxSimContext, contractName, key string) ([]byte, error) + func GetSlashingAddressBalance(context protocol.TxSimContext) (*utils.BigInteger, error) + func PutSimContextData(txSimContext protocol.TxSimContext, contractName, key string, value []byte) error + func ReadLatestEpoch(context protocol.TxSimContext) (*syscontract.Epoch, error) + func SlashingContractAddr() string + func StakeContractAddr() string + func ToDelegationKey(delegatorAddress, validatorAddress string) []byte + func ToDelegationPrefix(delegatorAddress string) []byte + func ToDelegationSetKey(delegatorAddress, validatorAddress string) []byte + func ToDelegationSetPrefix(validatorAddress string) []byte + func ToEpochKey(epochID string) []byte + func ToNodeIDKey(addr string) []byte + func ToReverseNodeIDKey(nodeID string) []byte + func ToUnbondingDelegationKey(epochID uint64, delegatorAddress, validatorAddress string) []byte + func ToUnbondingDelegationPrefix(epochID uint64) []byte + func ToValidatorKey(validatorAddress string) []byte + func ToValidatorPrefix() []byte + func ValidatorsElection(infos []*dpospb.CandidateInfo, n int, seed []byte, outSort bool) ([]*dpospb.CandidateInfo, error) + type AmountByRate map[string]string + type BlockProposerMap map[uint64]string + type CandidateInfos []*dpospb.CandidateInfo + func (s CandidateInfos) Len() int + func (s CandidateInfos) Less(i, j int) bool + func (s CandidateInfos) Swap(i, j int) + type Collections []string + func (s Collections) Len() int + func (s Collections) Less(i, j int) bool + func (s Collections) Swap(i, j int) + type DPoSDistributionContract struct + func NewDPoSDistributionContract(log protocol.Logger) *DPoSDistributionContract + type DPoSDistributionRuntime struct + func NewDPoSDistributionRuntime(log protocol.Logger) *DPoSDistributionRuntime + func (d *DPoSDistributionRuntime) GetDistributionDetail(context protocol.TxSimContext, params map[string][]byte) ([]byte, error) + func (d *DPoSDistributionRuntime) GetDistributionFromSlashing(context protocol.TxSimContext, params map[string][]byte) ([]byte, error) + func (d *DPoSDistributionRuntime) GetDistributionPerBlock(context protocol.TxSimContext, params map[string][]byte) ([]byte, error) + func (d *DPoSDistributionRuntime) GetGasExchangeRate(context protocol.TxSimContext, params map[string][]byte) ([]byte, error) + func (d *DPoSDistributionRuntime) Reward(context protocol.TxSimContext, params map[string][]byte) ([]byte, error) + func (d *DPoSDistributionRuntime) RewordFromSlashing(context protocol.TxSimContext, params map[string][]byte) ([]byte, error) + func (d *DPoSDistributionRuntime) SetDistributionFromSlashing(context protocol.TxSimContext, params map[string][]byte) ([]byte, error) + func (d *DPoSDistributionRuntime) SetDistributionPerBlock(context protocol.TxSimContext, params map[string][]byte) ([]byte, error) + func (d *DPoSDistributionRuntime) SetGasExchangeRate(context protocol.TxSimContext, params map[string][]byte) ([]byte, error) + type DPoSERC20Contract struct + func NewDPoSERC20Contract(log protocol.Logger) *DPoSERC20Contract + type DPoSRuntime struct + func NewDPoSRuntime(log protocol.Logger) *DPoSRuntime + func (r *DPoSRuntime) Allowance(txSimContext protocol.TxSimContext, params map[string][]byte) ([]byte, error) + func (r *DPoSRuntime) Approve(txSimContext protocol.TxSimContext, params map[string][]byte) (result []byte, err error) + func (r *DPoSRuntime) BalanceOf(txSimContext protocol.TxSimContext, params map[string][]byte) ([]byte, error) + func (r *DPoSRuntime) Burn(txSimContext protocol.TxSimContext, params map[string][]byte) (result []byte, err error) + func (r *DPoSRuntime) Decimals(txSimContext protocol.TxSimContext, params map[string][]byte) ([]byte, error) + func (r *DPoSRuntime) Mint(txSimContext protocol.TxSimContext, params map[string][]byte) (result []byte, err error) + func (r *DPoSRuntime) Owner(txSimContext protocol.TxSimContext, params map[string][]byte) (result []byte, err error) + func (r *DPoSRuntime) Total(txSimContext protocol.TxSimContext, params map[string][]byte) (result []byte, err error) + func (r *DPoSRuntime) Transfer(txSimContext protocol.TxSimContext, params map[string][]byte) ([]byte, error) + func (r *DPoSRuntime) TransferFrom(txSimContext protocol.TxSimContext, params map[string][]byte) ([]byte, error) + func (r *DPoSRuntime) TransferOwnership(txSimContext protocol.TxSimContext, params map[string][]byte) ([]byte, error) + type DPoSSlashingContract struct + func NewDPoSSlashingContract(log protocol.Logger) *DPoSSlashingContract + type DPoSSlashingRuntime struct + func NewDPoSSlashingRuntime(log protocol.Logger) *DPoSSlashingRuntime + func (d *DPoSSlashingRuntime) SetSlashingPerBlock(context protocol.TxSimContext, params map[string][]byte) ([]byte, error) + func (s *DPoSSlashingRuntime) GetSlashingAddress(context protocol.TxSimContext, params map[string][]byte) ([]byte, error) + func (s *DPoSSlashingRuntime) GetSlashingAddressBalance(context protocol.TxSimContext, params map[string][]byte) ([]byte, error) + func (s *DPoSSlashingRuntime) GetSlashingDetail(context protocol.TxSimContext, params map[string][]byte) ([]byte, error) + func (s *DPoSSlashingRuntime) GetSlashingPerBlock(context protocol.TxSimContext, params map[string][]byte) ([]byte, error) + func (s *DPoSSlashingRuntime) Punish(context protocol.TxSimContext, params map[string][]byte) ([]byte, error) + type DPoSStakeContract struct + func NewDPoSStakeContract(log protocol.Logger) *DPoSStakeContract + type DPoSStakeRuntime struct + func NewDPoSStakeRuntime(log protocol.Logger) *DPoSStakeRuntime + func (s *DPoSStakeRuntime) Delegate(context protocol.TxSimContext, params map[string][]byte) ([]byte, error) + func (s *DPoSStakeRuntime) GetAllCandidates(context protocol.TxSimContext, params map[string][]byte) ([]byte, error) + func (s *DPoSStakeRuntime) GetDelegationsByAddress(context protocol.TxSimContext, params map[string][]byte) ([]byte, error) + func (s *DPoSStakeRuntime) GetDelegationsByValidatorAddress(context protocol.TxSimContext, params map[string][]byte) ([]byte, error) + func (s *DPoSStakeRuntime) GetNodeID(context protocol.TxSimContext, params map[string][]byte) ([]byte, error) + func (s *DPoSStakeRuntime) GetUserDelegationByValidator(context protocol.TxSimContext, params map[string][]byte) ([]byte, error) + func (s *DPoSStakeRuntime) GetValidatorByAddress(context protocol.TxSimContext, params map[string][]byte) ([]byte, error) + func (s *DPoSStakeRuntime) ReadCompleteUnBoundingEpochNumber(context protocol.TxSimContext, params map[string][]byte) ([]byte, error) + func (s *DPoSStakeRuntime) ReadEpochBlockNumber(context protocol.TxSimContext, params map[string][]byte) ([]byte, error) + func (s *DPoSStakeRuntime) ReadEpochByID(context protocol.TxSimContext, params map[string][]byte) ([]byte, error) + func (s *DPoSStakeRuntime) ReadEpochValidatorNumber(context protocol.TxSimContext, params map[string][]byte) ([]byte, error) + func (s *DPoSStakeRuntime) ReadLatestEpoch(context protocol.TxSimContext, params map[string][]byte) ([]byte, error) + func (s *DPoSStakeRuntime) ReadMinSelfDelegation(context protocol.TxSimContext, params map[string][]byte) ([]byte, error) + func (s *DPoSStakeRuntime) ReadSystemContractAddr(context protocol.TxSimContext, params map[string][]byte) ([]byte, error) + func (s *DPoSStakeRuntime) SetNodeID(context protocol.TxSimContext, params map[string][]byte) ([]byte, error) + func (s *DPoSStakeRuntime) UnBounding(context protocol.TxSimContext, params map[string][]byte) ([]byte, error) + func (s *DPoSStakeRuntime) UnDelegate(context protocol.TxSimContext, params map[string][]byte) ([]byte, error) + func (s *DPoSStakeRuntime) UpdateEpochBlockNumber(context protocol.TxSimContext, params map[string][]byte) ([]byte, error) + func (s *DPoSStakeRuntime) UpdateEpochValidatorNumAndBlockNum(context protocol.TxSimContext, params map[string][]byte) ([]byte, error) + func (s *DPoSStakeRuntime) UpdateEpochValidatorNumber(context protocol.TxSimContext, params map[string][]byte) ([]byte, error) + func (s *DPoSStakeRuntime) UpdateMinSelfDelegation(context protocol.TxSimContext, params map[string][]byte) ([]byte, error) + type DelegatorRate map[string]float64 + type EpochAmountDetail map[string]AmountByRate + type KeyConfigCacheMap map[string]string + type SlashingDetail struct + Details []*SlashingDetailPerValidator + EpochId uint64 + SlashingBalanceAfter *utils.BigInteger + SlashingBalanceBefore *utils.BigInteger + Validators []string + type SlashingDetailPerValidator struct + DelegationAfter []*syscontract.Delegation + DelegationBefore []*syscontract.Delegation + DelegationRate *DelegatorRate + SlashingAmount *utils.BigInteger + ValidatorAddress string Other modules containing this package chainmaker.org/chainmaker/vm-native/v2