tokenpolicy

package
v0.0.0-...-0864b09 Latest Latest
Warning

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

Go to latest
Published: Nov 19, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package tokenpolicy defines the shared input-token admission policy used by solvers.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Policy

type Policy struct {
	// contains filtered or unexported fields
}

Policy admits input tokens and marks the permissioned-only scope as single-route. Its zero value is the unrestricted "all" policy.

func New

func New(scope Scope, tokens []common.Address) (Policy, error)

New constructs a policy from typed values.

func Parse

func Parse(rawScope string, rawTokens []string) (Policy, error)

Parse validates the YAML-facing scope and permissioned-token list.

func (Policy) Allows

func (p Policy) Allows(token common.Address) bool

Allows reports whether token is in this solver's input-token scope.

func (Policy) RequiresSingleRoute

func (p Policy) RequiresSingleRoute(token common.Address) bool

RequiresSingleRoute reports whether an admitted token must use one physical route.

func (Policy) Scope

func (p Policy) Scope() Scope

Scope returns the normalized configured scope.

func (Policy) SingleRouteTokens

func (p Policy) SingleRouteTokens() map[common.Address]bool

SingleRouteTokens returns the strategy-facing single-route token set.

type Scope

type Scope string

Scope selects which input-token class a solver serves.

const (
	All            Scope = "all"
	Permissioned   Scope = "permissioned"
	Permissionless Scope = "permissionless"
)

Jump to

Keyboard shortcuts

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