1package halt23// HaltConfig stores halt state for each operation type.4type HaltConfig map[OpType]bool56// IsHalted returns true if the specified operation is halted, false otherwise.7// Returns false if operation type is not found in configuration.8//9// Parameters:10// - op: operation type whose halt flag is queried.11//12// Returns:13// - halted: configured halt flag; false when op is absent from the configuration.14func (c HaltConfig) IsHalted(op OpType) bool {15 halted, exists := c[op]16 if !exists {17 return false18 }1920 return halted21}2223// Clone creates a deep copy of the halt configuration and returns it.24//25// Returns:26// - clone: independent map containing the same operation halt flags as the receiver.27func (c HaltConfig) Clone() HaltConfig {28 clone := make(HaltConfig)2930 for op, option := range c {31 clone[op] = option32 }3334 return clone35}3637// get retrieves halt state for the specified operation type.38//39// Errors:40// - errOpTypeNotFound: the specified operation type does not exist in the config41func (c HaltConfig) get(op OpType) (bool, error) {42 enabled, exists := c[op]43 if !exists {44 return false, makeErrorWithDetails(errOpTypeNotFound, op.String())45 }4647 return enabled, nil48}4950// set updates halt state for the specified operation type.51// Returns error if operation type is invalid.52func (c HaltConfig) set(op OpType, enabled bool) error {53 if !op.IsValid() {54 return makeErrorWithDetails(errInvalidOpType, op.String())55 }5657 c[op] = enabled5859 return nil60}6162// newNoneConfig creates configuration with all operations enabled (no halts).63func newNoneConfig() HaltConfig {64 return HaltConfig{65 OpTypePool: false,66 OpTypePosition: false,67 OpTypeProtocolFee: false,68 OpTypeRouter: false,69 OpTypeStaker: false,70 OpTypeLaunchpad: false,71 OpTypeGovernance: false,72 OpTypeGovStaker: false,73 OpTypeXGns: false,74 OpTypeCommunityPool: false,75 OpTypeEmission: false,76 OpTypeWithdraw: false,77 }78}7980// newSafeModeConfig creates configuration for safe mode with only withdrawals halted.81func newSafeModeConfig() HaltConfig {82 return HaltConfig{83 OpTypePool: false,84 OpTypePosition: false,85 OpTypeProtocolFee: false,86 OpTypeRouter: false,87 OpTypeStaker: false,88 OpTypeLaunchpad: false,89 OpTypeGovernance: false,90 OpTypeGovStaker: false,91 OpTypeXGns: false,92 OpTypeCommunityPool: false,93 OpTypeEmission: false,94 OpTypeWithdraw: true,95 }96}9798// newEmergencyConfig creates configuration for emergency mode with most operations halted.99// Only governance and withdraw operations remain enabled for emergency recovery.100func newEmergencyConfig() HaltConfig {101 return HaltConfig{102 OpTypePool: true,103 OpTypePosition: true,104 OpTypeProtocolFee: true,105 OpTypeRouter: true,106 OpTypeStaker: true,107 OpTypeLaunchpad: true,108 OpTypeGovernance: false,109 OpTypeGovStaker: true,110 OpTypeXGns: true,111 OpTypeCommunityPool: true,112 OpTypeEmission: true,113 OpTypeWithdraw: false,114 }115}116117// newCompleteConfig creates configuration with all operations halted for complete lockdown.118func newCompleteConfig() HaltConfig {119 return HaltConfig{120 OpTypePool: true,121 OpTypePosition: true,122 OpTypeProtocolFee: true,123 OpTypeRouter: true,124 OpTypeStaker: true,125 OpTypeLaunchpad: true,126 OpTypeGovernance: true,127 OpTypeGovStaker: true,128 OpTypeXGns: true,129 OpTypeCommunityPool: true,130 OpTypeEmission: true,131 OpTypeWithdraw: true,132 }133}134AssertIsNotHaltedCommunityPool()
AssertIsNotHaltedEmission()
AssertIsNotHaltedGovernance()
AssertIsNotHaltedGovStaker()
AssertIsNotHaltedLaunchpad()
AssertIsNotHaltedOperation(op string)
AssertIsNotHaltedPool()
AssertIsNotHaltedPosition()
AssertIsNotHaltedProtocolFee()
AssertIsNotHaltedRouter()
AssertIsNotHaltedStaker()
AssertIsNotHaltedWithdraw()
AssertIsNotHaltedXGns()
GetHaltConfig() map[gno.land/r/gnoswap/halt/v1.OpType]bool
GetHaltConfigJson() string
IsHalted(opTypes ...gno.land/r/gnoswap/halt/v1.OpType) (bool, interface {Error func() string})
IsHaltedCommunityPool() bool
IsHaltedEmission() bool
IsHaltedGovernance() bool
IsHaltedGovStaker() bool
IsHaltedLaunchpad() bool
IsHaltedPool() bool
IsHaltedPosition() bool
IsHaltedProtocolFee() bool
IsHaltedRouter() bool
IsHaltedStaker() bool
IsHaltedWithdraw() bool
IsHaltedXGns() bool
OpTypes() []gno.land/r/gnoswap/halt/v1.OpType
Render(path string) string
SetHaltLevel(cur interface {.seal func(); Address func() .uverse.address; IsCode func() bool; IsCurrent func() bool; IsEphemeral func() bool; IsUser func() bool; IsUserCall func() bool; IsUserRun func() bool; PkgPath func() string; Previous func() .uverse.realm; String func() string; Sub func(string) .uverse.realm; Subpath func() string}, level string)
SetOperationStatus(cur interface {.seal func(); Address func() .uverse.address; IsCode func() bool; IsCurrent func() bool; IsEphemeral func() bool; IsUser func() bool; IsUserCall func() bool; IsUserRun func() bool; PkgPath func() string; Previous func() .uverse.realm; String func() string; Sub func(string) .uverse.realm; Subpath func() string}, op string, halted bool)
Signatures reconstructed verbatim from vm/qfuncs — interface params keep their inline definitions.
vm/qrender output, sanitized (docs/render-security.md) and displayed in an empty-sandbox iframe — scripts, forms and popups cannot run. Links stay inert in-preview; right-click to open.