Documentation ¶
Index ¶
- Constants
- Variables
- func BlockToBytes(number types.BlockNum) []byte
- func ContractAddress() *common.Address
- func Get[T Field](v *Validators, validator_address *common.Address) (ret *T)
- func Max(x, y uint64) uint64
- func Modify[T Field](v *Validators, address *common.Address, data *T)
- func Save[T Field](v *Validators, address *common.Address, data *T)
- type API
- func (api *API) GetConfigByBlockNum(blk_n uint64) chain_config.ChainConfig
- func (api *API) Init(cfg chain_config.ChainConfig) *API
- func (api *API) InitAndRegisterAllContracts(storage contract_storage.Storage, blk_n types.BlockNum, ...)
- func (api *API) NewContract(storage contract_storage.Storage, reader Reader, evm *vm.EVM) *Contract
- func (api *API) NewDelayedReader(blk_n types.BlockNum, ...) (ret Reader)
- func (api *API) NewReader(blk_n types.BlockNum, ...) (ret Reader)
- func (api *API) NewSlashingContract(storage contract_storage.Storage, reader slashing.Reader, evm *vm.EVM) *slashing.Contract
- func (api *API) NewSlashingReader(blk_n types.BlockNum, ...) (ret slashing.Reader)
- func (api *API) UpdateConfig(blk_n types.BlockNum, cfg chain_config.ChainConfig)
- type Contract
- func (self *Contract) ApplyGenesis(get_account func(*common.Address) vm.StateAccount) error
- func (self *Contract) CommitCall(readStorage Reader)
- func (self *Contract) DistributeRewards(rewardsStats *rewards_stats.RewardsStats) *uint256.Int
- func (self *Contract) EndBlockCall(block_num uint64)
- func (self *Contract) GetOldClaimAllRewardsABI(input []byte, blockNum types.BlockNum) *abi.Method
- func (self *Contract) Init(cfg chain_config.ChainConfig, storage storage.Storage, readStorage Reader, ...) *Contract
- func (self *Contract) IsFicusHardfork(block types.BlockNum) bool
- func (self *Contract) IsTransferIntoDPoSContract(input []byte, blockNum types.BlockNum) bool
- func (self *Contract) Register(registry func(*common.Address, vm.PrecompiledContract))
- func (self *Contract) RequiredGas(ctx vm.CallFrame, evm *vm.EVM) uint64
- func (self *Contract) Run(ctx vm.CallFrame, evm *vm.EVM) ([]byte, error)
- func (self *Contract) UpdateConfig(cfg chain_config.ChainConfig)
- func (self *Contract) UpdateStorage(readStorage Reader)
- type Delegation
- type Delegations
- func (self *Delegations) CreateDelegation(delegator_address *common.Address, validator_address *common.Address, ...)
- func (self *Delegations) DelegationExists(delegator_address *common.Address, validator_address *common.Address) bool
- func (self *Delegations) GetAllDelegatorValidatorsAddresses(delegator_address *common.Address) []common.Address
- func (self *Delegations) GetDelegation(delegator_address *common.Address, validator_address *common.Address) (delegation *Delegation)
- func (self *Delegations) GetDelegationsCount(delegator_address *common.Address) uint32
- func (self *Delegations) GetDelegatorValidatorsAddresses(delegator_address *common.Address, batch uint32, count uint32) ([]common.Address, bool)
- func (self *Delegations) Init(stor *contract_storage.StorageWrapper, prefix []byte)
- func (self *Delegations) ModifyDelegation(delegator_address *common.Address, validator_address *common.Address, ...)
- func (self *Delegations) RemoveDelegation(delegator_address *common.Address, validator_address *common.Address)
- type DposConfigWithBlock
- type Field
- type GenesisTransfer
- type Logs
- func (self *Logs) Init(events map[string]abi.Event) *Logs
- func (self *Logs) MakeCommissionRewardsClaimedLog(account, validator *common.Address, amount *big.Int) vm.LogRecord
- func (self *Logs) MakeCommissionSetLog(account *common.Address, amount uint16) vm.LogRecord
- func (self *Logs) MakeDelegatedLog(delegator, validator *common.Address, amount *big.Int) vm.LogRecord
- func (self *Logs) MakeRedelegatedLog(delegator, from, to *common.Address, amount *big.Int) vm.LogRecord
- func (self *Logs) MakeRewardsClaimedLog(account, validator *common.Address, amount *big.Int) vm.LogRecord
- func (self *Logs) MakeUndelegateCanceledLog(delegator, validator *common.Address, amount *big.Int) vm.LogRecord
- func (self *Logs) MakeUndelegateConfirmedLog(delegator, validator *common.Address, amount *big.Int) vm.LogRecord
- func (self *Logs) MakeUndelegatedLog(delegator, validator *common.Address, amount *big.Int) vm.LogRecord
- func (self *Logs) MakeValidatorInfoSetLog(account *common.Address) vm.LogRecord
- func (self *Logs) MakeValidatorRegisteredLog(account *common.Address) vm.LogRecord
- type Reader
- func (r Reader) GetEligibleVoteCount(addr *common.Address) (ret uint64)
- func (r Reader) GetStakingBalance(addr *common.Address) (ret *big.Int)
- func (r Reader) GetTotalSupply() *big.Int
- func (r Reader) GetValidatorsTotalStakes() (ret []ValidatorStake)
- func (r Reader) GetValidatorsVoteCounts() (ret []ValidatorVoteCount)
- func (r Reader) GetVrfKey(addr *common.Address) (ret []byte)
- func (r Reader) GetYield() uint64
- func (r *Reader) Init(cfg *chain_config.ChainConfig, blk_n types.BlockNum, ...) *Reader
- func (r *Reader) InitDelayedReader(cfg *chain_config.ChainConfig, blk_n types.BlockNum, ...) *Reader
- func (r Reader) IsEligible(address *common.Address) bool
- func (r Reader) TotalAmountDelegated() (ret *big.Int)
- func (r Reader) TotalEligibleVoteCount() (ret uint64)
- type State
- type Undelegation
- type Undelegations
- func (self *Undelegations) CreateUndelegation(delegator_address *common.Address, validator_address *common.Address, ...)
- func (self *Undelegations) GetDelegatorValidatorsAddresses(delegator_address *common.Address, batch uint32, count uint32) ([]common.Address, bool)
- func (self *Undelegations) GetUndelegation(delegator_address *common.Address, validator_address *common.Address) (undelegation *Undelegation)
- func (self *Undelegations) GetUndelegationsCount(delegator_address *common.Address) uint32
- func (self *Undelegations) Init(stor *contract_storage.StorageWrapper, prefix []byte)
- func (self *Undelegations) RemoveUndelegation(delegator_address *common.Address, validator_address *common.Address)
- func (self *Undelegations) UndelegationExists(delegator_address *common.Address, validator_address *common.Address) bool
- type Validator
- type ValidatorInfo
- type ValidatorRewards
- type ValidatorStake
- type ValidatorV1
- type ValidatorVoteCount
- type Validators
- func (self *Validators) AddValidatorRewards(validator_address *common.Address, commission_reward, reward *big.Int)
- func (self *Validators) CheckValidatorOwner(owner, validator *common.Address) bool
- func (self *Validators) CreateValidator(extended_validator bool, owner_address *common.Address, ...) (validator *Validator)
- func (self *Validators) DeleteValidator(validator_address *common.Address)
- func (self *Validators) GetValidator(validator_address *common.Address) (validator *Validator)
- func (self *Validators) GetValidatorInfo(validator_address *common.Address) (validator_info *ValidatorInfo)
- func (self *Validators) GetValidatorOwner(validator *common.Address) (ret common.Address)
- func (self *Validators) GetValidatorRewards(validator_address *common.Address) (rewards *ValidatorRewards)
- func (self *Validators) GetValidatorsAddresses(batch uint32, count uint32) ([]common.Address, bool)
- func (self *Validators) GetValidatorsCount() uint32
- func (self *Validators) GetVrfKey(validator *common.Address) (ret []byte)
- func (self *Validators) Init(stor *contract_storage.StorageWrapper, prefix []byte) *Validators
- func (self *Validators) ModifyValidator(extended_validator bool, validator_address *common.Address, ...)
- func (self *Validators) ModifyValidatorInfo(validator_address *common.Address, validator_info *ValidatorInfo)
- func (self *Validators) ModifyValidatorRewards(validator_address *common.Address, rewards *ValidatorRewards)
- func (self *Validators) ValidatorExists(validator_address *common.Address) bool
- type YieldCurve
- func (self *YieldCurve) CalculateBlockReward(current_total_delegation, current_total_dly_supply *uint256.Int) (block_reward *uint256.Int, yield *uint256.Int)
- func (self *YieldCurve) CalculateTotalSupply(minted_tokens *uint256.Int) *uint256.Int
- func (self *YieldCurve) Init(cfg chain_config.ChainConfig)
Constants ¶
const ( RegisterValidatorGas uint64 = 80000 SetCommissionGas uint64 = 20000 DelegateGas uint64 = 40000 UndelegateGas uint64 = 60000 ConfirmUndelegateGas uint64 = 20000 CancelUndelegateGas uint64 = 60000 ReDelegateGas uint64 = 80000 ClaimRewardsGas uint64 = 40000 ClaimCommissionRewardsGas uint64 = 20000 SetValidatorInfoGas uint64 = 20000 DposGetMethodsGas uint64 = 5000 DposBatchGetMethodsGas uint64 = 5000 DefaultDposMethodGas uint64 = 20000 TransferIntoDPoSContractGas uint64 = 1000 )
Gas constants - gas is determined based on storage writes. Each 32Bytes == 20k gas
const ( // Max num of characters in url MaxEndpointLength = 50 // Max num of characters in description MaxDescriptionLength = 100 // Maximal commission [%] * 100 so 1% is 100 & 100% is 10000 MaxCommission = uint64(10000) // Length of vrf public key VrfKeyLength = 32 // Maximum number of validators per batch that delegator get claim rewards from ClaimAllRewardsMaxCount = 10 // Maximum number of validators per batch returned by getValidators call GetValidatorsMaxCount = 20 // Maximum number of delegations per batch returned by getDelegations call GetDelegationsMaxCount = 20 // Maximum number of undelegations per batch returned by getUndelegations call GetUndelegationsMaxCount = 20 )
Variables ¶
var ( ErrInsufficientBalance = util.ErrorString("Insufficient balance") ErrNonExistentValidator = util.ErrorString("Validator does not exist") ErrNonExistentDelegation = util.ErrorString("Delegation does not exist") ErrExistentDelegation = util.ErrorString("Delegation already exist") ErrExistentUndelegation = util.ErrorString("Undelegation already exist") ErrNonExistentUndelegation = util.ErrorString("Undelegation does not exist") ErrLockedUndelegation = util.ErrorString("Undelegation is not yet ready to be withdrawn") ErrExistentValidator = util.ErrorString("Validator already exist") ErrSameValidator = util.ErrorString("From and to validators are the same") ErrInvalidRedelegation = util.ErrorString("Redelegation has to be more than 0") ErrBrokenState = util.ErrorString("Fatal error state is broken") ErrValidatorsMaxStakeExceeded = util.ErrorString("Validator's max stake exceeded") ErrInsufficientDelegation = util.ErrorString("Insufficient delegation") ErrCallIsNotToplevel = util.ErrorString("only top-level calls are allowed") ErrWrongProof = util.ErrorString("Wrong proof, validator address could not be recovered") ErrWrongOwnerAcc = util.ErrorString("This account is not owner of specified validator") ErrWrongVrfKey = util.ErrorString("Wrong vrf key specified in validator arguments") ErrForbiddenCommissionChange = util.ErrorString("Forbidden commission change") ErrCommissionOverflow = util.ErrorString("Commission is bigger than maximum value") ErrMaxEndpointLengthExceeded = util.ErrorString("Max endpoint length exceeded") ErrMaxDescriptionLengthExceeded = util.ErrorString("Max description length exceeded") )
Contract methods error return values
var TransferIntoDPoSContractMethod []byte = common.Hex2Bytes("44df8e70")
var YieldFractionDecimalPrecision = uint256.NewInt(1e+6)
Yield is calculated with 6 decimal precision
Functions ¶
func ContractAddress ¶
Types ¶
type API ¶
type API struct {
// contains filtered or unexported fields
}
func (*API) GetConfigByBlockNum ¶
func (api *API) GetConfigByBlockNum(blk_n uint64) chain_config.ChainConfig
func (*API) Init ¶
func (api *API) Init(cfg chain_config.ChainConfig) *API
func (*API) InitAndRegisterAllContracts ¶
func (api *API) InitAndRegisterAllContracts(storage contract_storage.Storage, blk_n types.BlockNum, storage_factory func(types.BlockNum) contract_storage.StorageReader, evm *vm.EVM, registry func(*common.Address, vm.PrecompiledContract))
func (*API) NewContract ¶
func (*API) NewDelayedReader ¶
func (api *API) NewDelayedReader(blk_n types.BlockNum, storage_factory func(types.BlockNum) contract_storage.StorageReader) (ret Reader)
func (*API) NewReader ¶
func (api *API) NewReader(blk_n types.BlockNum, storage_factory func(types.BlockNum) contract_storage.StorageReader) (ret Reader)
func (*API) NewSlashingContract ¶
func (*API) NewSlashingReader ¶
func (api *API) NewSlashingReader(blk_n types.BlockNum, storage_factory func(types.BlockNum) contract_storage.StorageReader) (ret slashing.Reader)
func (*API) UpdateConfig ¶
func (api *API) UpdateConfig(blk_n types.BlockNum, cfg chain_config.ChainConfig)
type Contract ¶
type Contract struct { // ABI of the contract Abi abi.ABI // contains filtered or unexported fields }
Main contract class
func (*Contract) ApplyGenesis ¶
Fills contract based on genesis values
func (*Contract) CommitCall ¶
Should be called on each block commit - updates delayedStorage
func (*Contract) DistributeRewards ¶
func (self *Contract) DistributeRewards(rewardsStats *rewards_stats.RewardsStats) *uint256.Int
func (*Contract) EndBlockCall ¶
Should be called from EndBlock on each block
func (*Contract) GetOldClaimAllRewardsABI ¶
GetOldClaimAllRewardsABI returns the *old* ABI method for claiming all rewards in the DPOS contract. It should be there, so we don't have a different result during the syncing. And it is hardcoded because we don't need it in the actual interface. If the block number is part of the Aspen hardfork, it returns nil. If the input matches the specified hex value, it returns the ABI method for claiming all rewards.
func (*Contract) Init ¶
func (self *Contract) Init(cfg chain_config.ChainConfig, storage storage.Storage, readStorage Reader, evm *vm.EVM) *Contract
Initialize contract class
func (*Contract) IsTransferIntoDPoSContract ¶
func (*Contract) Register ¶
func (self *Contract) Register(registry func(*common.Address, vm.PrecompiledContract))
Register this precompiled contract
func (*Contract) RequiredGas ¶
Calculate required gas for call to this contract
func (*Contract) Run ¶
This is called on each call to contract It translates call and tries to execute them
func (*Contract) UpdateConfig ¶
func (self *Contract) UpdateConfig(cfg chain_config.ChainConfig)
Updates config - for HF
func (*Contract) UpdateStorage ¶
Updates delayed storage after each commited block
type Delegation ¶
type Delegations ¶
type Delegations struct {
// contains filtered or unexported fields
}
Delegations type groups together all functionality related to creating/deleting/modifying/etc... delegations as such info is stored under multiple independent storage keys, it is important that caller does not need to think about all implementation details, but just calls functions on Delegations type
func (*Delegations) CreateDelegation ¶
func (*Delegations) DelegationExists ¶
func (self *Delegations) DelegationExists(delegator_address *common.Address, validator_address *common.Address) bool
Checks if delegation exists
func (*Delegations) GetAllDelegatorValidatorsAddresses ¶
func (self *Delegations) GetAllDelegatorValidatorsAddresses(delegator_address *common.Address) []common.Address
func (*Delegations) GetDelegation ¶
func (self *Delegations) GetDelegation(delegator_address *common.Address, validator_address *common.Address) (delegation *Delegation)
Gets delegation
func (*Delegations) GetDelegationsCount ¶
func (self *Delegations) GetDelegationsCount(delegator_address *common.Address) uint32
Returns number of delegations for specified address
func (*Delegations) GetDelegatorValidatorsAddresses ¶
func (*Delegations) Init ¶
func (self *Delegations) Init(stor *contract_storage.StorageWrapper, prefix []byte)
func (*Delegations) ModifyDelegation ¶
func (self *Delegations) ModifyDelegation(delegator_address *common.Address, validator_address *common.Address, delegation *Delegation)
func (*Delegations) RemoveDelegation ¶
func (self *Delegations) RemoveDelegation(delegator_address *common.Address, validator_address *common.Address)
type DposConfigWithBlock ¶
type DposConfigWithBlock struct { DposConfig chain_config.DPOSConfig Blk_n types.BlockNum }
type Field ¶
type Field interface { ValidatorV1 | Validator | ValidatorInfo | ValidatorRewards }
type Logs ¶
func (*Logs) MakeCommissionRewardsClaimedLog ¶
func (self *Logs) MakeCommissionRewardsClaimedLog(account, validator *common.Address, amount *big.Int) vm.LogRecord
event CommissionRewardsClaimed(address indexed account, address indexed validator);
func (*Logs) MakeCommissionSetLog ¶
event CommissionSet(address indexed validator, uint16 commission);
func (*Logs) MakeDelegatedLog ¶
func (self *Logs) MakeDelegatedLog(delegator, validator *common.Address, amount *big.Int) vm.LogRecord
event Delegated(address indexed delegator, address indexed validator, uint256 amount);
func (*Logs) MakeRedelegatedLog ¶
func (self *Logs) MakeRedelegatedLog(delegator, from, to *common.Address, amount *big.Int) vm.LogRecord
event Redelegated(address indexed delegator, address indexed from, address indexed to, uint256 amount);
func (*Logs) MakeRewardsClaimedLog ¶
func (self *Logs) MakeRewardsClaimedLog(account, validator *common.Address, amount *big.Int) vm.LogRecord
event RewardsClaimed(address indexed account, address indexed validator);
func (*Logs) MakeUndelegateCanceledLog ¶
func (self *Logs) MakeUndelegateCanceledLog(delegator, validator *common.Address, amount *big.Int) vm.LogRecord
event UndelegateCanceled(address indexed delegator, address indexed validator, uint256 amount);
func (*Logs) MakeUndelegateConfirmedLog ¶
func (self *Logs) MakeUndelegateConfirmedLog(delegator, validator *common.Address, amount *big.Int) vm.LogRecord
event UndelegateConfirmed(address indexed delegator, address indexed validator, uint256 amount);
func (*Logs) MakeUndelegatedLog ¶
func (self *Logs) MakeUndelegatedLog(delegator, validator *common.Address, amount *big.Int) vm.LogRecord
event Undelegated(address indexed delegator, address indexed validator, uint256 amount);
func (*Logs) MakeValidatorInfoSetLog ¶
event ValidatorInfoSet(address indexed validator);
type Reader ¶
type Reader struct {
// contains filtered or unexported fields
}
func (Reader) GetEligibleVoteCount ¶
func (Reader) GetStakingBalance ¶
func (Reader) GetTotalSupply ¶
func (Reader) GetValidatorsTotalStakes ¶
func (r Reader) GetValidatorsTotalStakes() (ret []ValidatorStake)
func (Reader) GetValidatorsVoteCounts ¶
func (r Reader) GetValidatorsVoteCounts() (ret []ValidatorVoteCount)
func (*Reader) Init ¶
func (r *Reader) Init(cfg *chain_config.ChainConfig, blk_n types.BlockNum, storage_factory func(types.BlockNum) storage.StorageReader) *Reader
func (*Reader) InitDelayedReader ¶
func (r *Reader) InitDelayedReader(cfg *chain_config.ChainConfig, blk_n types.BlockNum, storage_factory func(types.BlockNum) storage.StorageReader) *Reader
func (Reader) TotalAmountDelegated ¶
func (Reader) TotalEligibleVoteCount ¶
type State ¶
type State struct { // represents number of rewards per 1 stake RewardsPer1Stake *big.Int // number of references Count uint32 }
State of the rewards distribution algorithm
type Undelegation ¶
type Undelegations ¶
type Undelegations struct {
// contains filtered or unexported fields
}
func (*Undelegations) CreateUndelegation ¶
func (self *Undelegations) CreateUndelegation(delegator_address *common.Address, validator_address *common.Address, block types.BlockNum, amount *big.Int)
Creates undelegation object in storage
func (*Undelegations) GetDelegatorValidatorsAddresses ¶
func (self *Undelegations) GetDelegatorValidatorsAddresses(delegator_address *common.Address, batch uint32, count uint32) ([]common.Address, bool)
Returns all addressess of validators, from which is delegator <delegator_address> currently undelegating
func (*Undelegations) GetUndelegation ¶
func (self *Undelegations) GetUndelegation(delegator_address *common.Address, validator_address *common.Address) (undelegation *Undelegation)
Returns undelegation object from queue
func (*Undelegations) GetUndelegationsCount ¶
func (self *Undelegations) GetUndelegationsCount(delegator_address *common.Address) uint32
Returns number of undelegations for specified address
func (*Undelegations) Init ¶
func (self *Undelegations) Init(stor *contract_storage.StorageWrapper, prefix []byte)
func (*Undelegations) RemoveUndelegation ¶
func (self *Undelegations) RemoveUndelegation(delegator_address *common.Address, validator_address *common.Address)
Removes undelegation object from storage
func (*Undelegations) UndelegationExists ¶
func (self *Undelegations) UndelegationExists(delegator_address *common.Address, validator_address *common.Address) bool
Returns true if for given values there is undelegation in queue
type Validator ¶
type Validator struct { *ValidatorV1 // Number of ongoing/unclaimed undelegations from the validator UndelegationsCount uint16 }
type ValidatorInfo ¶
type ValidatorRewards ¶
type ValidatorRewards struct { // Rewards accumulated RewardsPool *big.Int // Rewards accumulated CommissionRewardsPool *big.Int }
func (*ValidatorRewards) Empty ¶
func (self *ValidatorRewards) Empty() bool
type ValidatorV1 ¶
type ValidatorV1 struct { // TotalStake == sum of all delegated tokens to the validator TotalStake *big.Int // Commission Commission uint16 // Block number related to commission LastCommissionChange types.BlockNum // Block number pointing to latest state LastUpdated types.BlockNum }
Pre-hardfork validator struct without UndelegationsCount member
type ValidatorVoteCount ¶
type Validators ¶
type Validators struct {
// contains filtered or unexported fields
}
Validators type groups together all functionality related to creating/deleting/modifying/etc... validators as such info is stored under multiple independent storage keys, it is important that caller does not need to think about all implementation details, but just calls functions on Validators type
func (*Validators) AddValidatorRewards ¶
func (self *Validators) AddValidatorRewards(validator_address *common.Address, commission_reward, reward *big.Int)
func (*Validators) CheckValidatorOwner ¶
func (self *Validators) CheckValidatorOwner(owner, validator *common.Address) bool
Checks if correct account is trying to access validator object
func (*Validators) CreateValidator ¶
func (*Validators) DeleteValidator ¶
func (self *Validators) DeleteValidator(validator_address *common.Address)
func (*Validators) GetValidator ¶
func (self *Validators) GetValidator(validator_address *common.Address) (validator *Validator)
func (*Validators) GetValidatorInfo ¶
func (self *Validators) GetValidatorInfo(validator_address *common.Address) (validator_info *ValidatorInfo)
func (*Validators) GetValidatorOwner ¶
func (self *Validators) GetValidatorOwner(validator *common.Address) (ret common.Address)
Checks if correct account is trying to access validator object
func (*Validators) GetValidatorRewards ¶
func (self *Validators) GetValidatorRewards(validator_address *common.Address) (rewards *ValidatorRewards)
func (*Validators) GetValidatorsAddresses ¶
func (*Validators) GetValidatorsCount ¶
func (self *Validators) GetValidatorsCount() uint32
func (*Validators) GetVrfKey ¶
func (self *Validators) GetVrfKey(validator *common.Address) (ret []byte)
Returns public vrf key for validator
func (*Validators) Init ¶
func (self *Validators) Init(stor *contract_storage.StorageWrapper, prefix []byte) *Validators
func (*Validators) ModifyValidator ¶
func (self *Validators) ModifyValidator(extended_validator bool, validator_address *common.Address, validator *Validator)
func (*Validators) ModifyValidatorInfo ¶
func (self *Validators) ModifyValidatorInfo(validator_address *common.Address, validator_info *ValidatorInfo)
func (*Validators) ModifyValidatorRewards ¶
func (self *Validators) ModifyValidatorRewards(validator_address *common.Address, rewards *ValidatorRewards)
func (*Validators) ValidatorExists ¶
func (self *Validators) ValidatorExists(validator_address *common.Address) bool
Checks is validator exists
type YieldCurve ¶
type YieldCurve struct {
// contains filtered or unexported fields
}
func (*YieldCurve) CalculateBlockReward ¶
func (*YieldCurve) CalculateTotalSupply ¶
func (self *YieldCurve) CalculateTotalSupply(minted_tokens *uint256.Int) *uint256.Int
Calculates total supply based on minted_toknes + genesis balances + total generated rewards until Aspen hardfork
func (*YieldCurve) Init ¶
func (self *YieldCurve) Init(cfg chain_config.ChainConfig)