config.gno
NewConfigTree
NewConfigTree creates an empty BPTree used to index configuration values by their encoded int64 version.
Return Values
*bptree.BPTree
*bptree.BPTree
empty configuration index tree
Reconfigure
Reconfigure updates the governance configuration parameters. Only callable by admin or governance.
Halt check: reverts while the Governance halt scope is active.
Parameters
cur
realm
Current realm context; callers use cross(cur) when crossing into this realm.
votingStartDelay
int64
delay before voting starts (seconds)
votingPeriod
int64
voting duration (seconds)
votingWeightSmoothingDuration
int64
weight smoothing duration (seconds)
quorum
int64
minimum voting weight required (percentage)
proposalCreationThreshold
int64
minimum weight to create proposal
executionDelay
int64
delay before execution (seconds)
executionWindow
int64
execution time window (seconds)
Return Values
int64
int64
new configuration version
Types
Config
Config represents the configuration of the governor contract. All parameters can be modified through Reconfigure by admin or governance.
Fields
VotingStartDelay int64(source)VotingPeriod int64(source)VotingWeightSmoothingDuration int64(source)Quorum int64(source)ProposalCreationThreshold int64(source)ExecutionDelay int64(source)ExecutionWindow int64(source)
Methods
IsValid
IsValid reports whether the configuration's durations, threshold, quorum, and cumulative schedule values satisfy the governance validation constraints.
Parameters
currentTime
int64
current time value included when checking that the cumulative schedule does not become negative
Return Values
error
error
nil when all fields and cumulative values are valid; otherwise an error describing the first invalid value
Constructors
func GetConfig(configVersion int64) (Config, error)(source)func GetLatestConfig() (Config, error)(source)func NewConfig(votingStartDelay int64, votingPeriod int64, votingWeightSmoothingDuration int64, quorum int64, proposalCreationThreshold int64, executionDelay int64, executionWindow int64) Config(source)func NewConfigPtr(votingStartDelay int64, votingPeriod int64, votingWeightSmoothingDuration int64, quorum int64, proposalCreationThreshold int64, executionDelay int64, executionWindow int64) *Config(source)func NewDefaultConfig() Config(source)
Last updated