vaultwatch

package
v1.8.2 Latest Latest
Warning

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

Go to latest
Published: Oct 8, 2026 License: AGPL-3.0 Imports: 12 Imported by: 0

Documentation

Overview

Package vaultwatch is the on-chain allowlist's detect-and-quarantine watcher (Option D of the compliance design, defense-in-depth alongside the contract's own gating). It watches the vault contract's Soroban events on a wall-clock cadence and confirms every deposit, mint and share transfer's participants were actually allowlisted at the time.

This is a bespoke ticker rather than an mgpoller.Runner[T], for the same reason the M-Pesa Pull sweep is: it walks a ledger window, not a queue of due rows.

It is a canary, not a second enforcer. Once the contract's own gating is live, an unallowlisted deposit or transfer should be impossible — a mismatch here means the gate itself is broken (a bug, a bad upgrade, or a misconfiguration), which is why a mismatch is logged at alert level rather than silently corrected.

Index

Constants

View Source
const (
	SubjectExitWindowClosing       = "Depositor exit window closing"
	SubjectFrozenDepositorWithdrew = "Frozen depositor withdrew"
)

Ops alert subjects. The frozen one pages: the contract should make it impossible.

Variables

This section is empty.

Functions

This section is empty.

Types

type Watcher

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

Watcher is the compliance watcher described in doc.go.

func NewWatcher

func NewWatcher(deps WatcherDeps) *Watcher

NewWatcher builds the watcher.

func (*Watcher) Start

func (w *Watcher) Start(ctx context.Context)

Start runs the watch loop until ctx is cancelled.

type WatcherDeps

type WatcherDeps struct {
	Client     eventsClient
	Allowlist  allowlistChecker
	Deadlines  exitDeadlineStore
	Alerts     alerts.Service
	Cursor     repository.VaultWatchCursorRepository
	ContractID string
	Interval   time.Duration
	Logger     *slog.Logger
}

WatcherDeps are Watcher's collaborators; all required except Logger.

Jump to

Keyboard shortcuts

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