icmodule

package
v1.3.5 Latest Latest
Warning

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

Go to latest
Published: Apr 10, 2023 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DayBlock     = 24 * 60 * 60 / 2
	DayPerMonth  = 30
	MonthBlock   = DayBlock * DayPerMonth
	MonthPerYear = 12
	YearBlock    = MonthBlock * MonthPerYear
)

From iiss.calculator.go

View Source
const (
	ConfigFile               = "./icon_config.json"
	IScoreICXRatio           = 1_000
	VotedRewardMultiplier    = 100
	InitialTermPeriod        = DayBlock
	DecentralizedTermPeriod  = 43120
	InitialDepositTerm       = 1_296_000
	DisableDepositTerm       = 0
	InitialUnstakeSlotMax    = 1
	InitialDelegationSlotMax = 10
	IISS2BondRequirement     = 0
	InitialIRep              = 50_000 // in icx, not loop
	MinIRep                  = 10_000
	RewardPoint              = 0.7

	DefaultTermPeriod                            = InitialTermPeriod
	DefaultUnbondingPeriodMultiplier             = 7
	DefaultUnstakeSlotMax                        = 1000
	DefaultMainPRepCount                         = 22
	DefaultSubPRepCount                          = 78
	DefaultIRep                                  = 0
	DefaultRRep                                  = 1200
	DefaultBondRequirement                       = 5
	DefaultLockMinMultiplier                     = 5
	DefaultLockMaxMultiplier                     = 20
	DefaultIglobal                               = YearBlock * IScoreICXRatio
	DefaultIprep                                 = 50
	DefaultIcps                                  = 0
	DefaultIrelay                                = 0
	DefaultIvoter                                = 50
	DefaultUnbondingMax                          = 100
	DefaultValidationPenaltyCondition            = 660
	DefaultConsistentValidationPenaltyCondition  = 5
	DefaultConsistentValidationPenaltyMask       = 30
	DefaultConsistentValidationPenaltySlashRatio = 0 // 0%
	DefaultDelegationSlotMax                     = 100
	DefaultExtraMainPRepCount                    = 3
	DefaultNonVotePenaltySlashRatio              = 0 // 0%
)
View Source
const (
	CalculationFailedError = CodeIISS + iota
	CalculationNotFinishedError
)
View Source
const (
	Revision1 = iota + 1
	Revision2
	Revision3
	Revision4
	Revision5
	Revision6
	Revision7
	Revision8
	Revision9
	Revision10
	Revision11
	Revision12
	Revision13
	Revision14
	Revision15
	Revision16
	Revision17
	Revision18
	Revision19
	Revision20
	Revision21
	RevisionReserved
)
View Source
const (
	DefaultRevision = Revision1
	MaxRevision     = RevisionReserved - 1
	LatestRevision  = Revision20
)
View Source
const (
	RevisionIISS = Revision5

	RevisionDecentralize = Revision6

	RevisionFixTotalDelegated = Revision7

	RevisionFixBugDisabledPRep = Revision8

	RevisionFixBurnEventSignature     = Revision9
	RevisionMultipleUnstakes          = Revision9
	RevisionFixEmailValidation        = Revision9
	RevisionDelegationSlotMaxTo100    = Revision9
	RevisionSystemSCORE               = Revision9
	RevisionSetIRepViaNetworkProposal = Revision9
	RevisionPreventDuplicatedEndpoint = Revision9

	RevisionFixInvalidUnstake = Revision11

	RevisionBurnV2 = Revision12

	RevisionICON2R0              = Revision13
	RevisionFixClaimIScore       = Revision13
	RevisionFixSetDelegation     = Revision13
	RevisionFixRLPBug            = Revision13
	RevisionResetPenaltyMask     = Revision13
	RevisionEnableBondAPIs       = Revision13
	RevisionFixIllegalDelegation = Revision13
	RevisionStopICON1Support     = Revision13

	RevisionICON2R1       = Revision14
	RevisionEnableIISS3   = Revision14
	RevisionEnableFee3    = Revision14
	RevisionBlockAccounts = Revision14

	RevisionICON2R2      = Revision15
	RevisionEnableJavaEE = Revision15

	RevisionFixIGlobal = Revision16

	RevisionICON2R3             = Revision17
	RevisionEnableSetScoreOwner = Revision17
	RevisionExtraMainPReps      = Revision17
	RevisionFixVotingReward     = Revision17

	RevisionFixTransferRewardFund = Revision18

	RevisionBTP2 = Revision21
)
View Source
const (
	CodeIISS = errors.CodeCritical + errors.CodeSegment*(iota+1)
)
View Source
const (
	IllegalArgumentError = scoreresult.RevertedError + iota
)

Variables

View Source
var (
	BigIntZero           = new(big.Int)
	BigIntICX            = big.NewInt(1_000_000_000_000_000_000)
	BigIntInitialIRep    = new(big.Int).Mul(big.NewInt(InitialIRep), BigIntICX)
	BigIntMinIRep        = new(big.Int).Mul(big.NewInt(MinIRep), BigIntICX)
	BigIntIScoreICXRatio = big.NewInt(IScoreICXRatio)
	BigIntRegPRepFee     = new(big.Int).Mul(big.NewInt(2000), BigIntICX)
	BigIntDayBlocks      = big.NewInt(DayBlock)
)

The following variables are read-only

Functions

func ValueToRevision

func ValueToRevision(v int) module.Revision

Types

type CallContext added in v0.9.10

type CallContext interface {
	WorldContext
	From() module.Address
	HandleBurn(address module.Address, amount *big.Int) error
	SumOfStepUsed() *big.Int
	OnEvent(addr module.Address, indexed, data [][]byte)
	CallOnTimer(to module.Address, params []byte) error
	Governance() module.Address
	FrameLogger() *trace.Logger
	TransactionInfo() *state.TransactionInfo
}

type PenaltyType added in v0.9.10

type PenaltyType int
const (
	PenaltyNone PenaltyType = iota
	PenaltyPRepDisqualification
	PenaltyLowProductivity
	PenaltyBlockValidation
	PenaltyNonVote
)

type WorldContext added in v0.9.10

type WorldContext interface {
	Revision() module.Revision
	BlockHeight() int64
	Origin() module.Address
	Treasury() module.Address
	TransactionID() []byte
	ConsensusInfo() module.ConsensusInfo
	GetBalance(address module.Address) *big.Int
	Deposit(address module.Address, amount *big.Int, opType module.OpType) error
	Withdraw(address module.Address, amount *big.Int, opType module.OpType) error
	Transfer(from module.Address, to module.Address, amount *big.Int, opType module.OpType) error
	GetTotalSupply() *big.Int
	AddTotalSupply(amount *big.Int) (*big.Int, error)
	SetValidators(validators []module.Validator) error
	StepPrice() *big.Int
	GetScoreOwner(score module.Address) (module.Address, error)
	SetScoreOwner(from module.Address, score module.Address, owner module.Address) error
	GetBTPContext() state.BTPContext
}

Jump to

Keyboard shortcuts

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