Search Apps Documentation Source Content File Folder Download Copy Actions Download State String Boolean Number Struct Map Slice Pointer Function Closure Reference Nil Package Type Interface Unknown

v1 state

Back to all declarations

assertIsRlmCurrent

func(int, rlm .uverse.realm)
Open
OID
0b8694…2e59:3
assertIsRlmCurrent details

Inspect func

isAllowedBatchInstruction

func(opcode uint8) bool

isAllowedBatchInstruction reports whether opcode may appear in a batch.

Open
OID
0b8694…2e59:5
isAllowedBatchInstruction details

Inspect func

callSuccessAck

func() (types.RecvPacketResult, .uverse.error)

callSuccessAck builds the empty success acknowledgement a completed call writes.

Open
OID
0b8694…2e59:7
callSuccessAck details

Inspect func

safeCallOnZkgm

func(int, rlm .uverse.realm, receiver zkgm.Zkgmable, env zkgm.CallEnv) (err .uverse.error, panicked bool)

safeCallOnZkgm runs the receiver and reports a failure as panicked=true. revive is preferred since it also catches cross-realm aborts. The recover fallback, used only when revive is unsupported, catches ordinary panics.

Open
OID
0b8694…2e59:9
safeCallOnZkgm details

Inspect func

safeCallOnIntentZkgm

func(int, rlm .uverse.realm, receiver zkgm.Zkgmable, env zkgm.IntentCallEnv) (err .uverse.error, panicked bool)

safeCallOnIntentZkgm runs the receiver's intent callback and reports a failure as panicked=true, mirroring safeCallOnZkgm for the OnIntentZkgm path.

Open
OID
0b8694…2e59:10
safeCallOnIntentZkgm details

Inspect func

canRevive

func() ok bool

canRevive reports whether revive works in the current runtime. revive panics rather than returning when the interpreter lacks support for it.

Open
OID
0b8694…2e59:11
canRevive details

Inspect func

callErrAck

func(int, rlm .uverse.realm, err .uverse.error) types.RecvPacketResult

callErrAck encodes err as a failure acknowledgement for the call.

Open
OID
0b8694…2e59:12
callErrAck details

Inspect func

ChannelBalanceKeyV2

func(channelId types.ChannelId, path *uint256.Uint, baseToken []uint8, quoteToken []uint8) string

ChannelBalanceKeyV2 returns the storage key for a v2 channel balance entry.

Open
OID
0b8694…2e59:13
ChannelBalanceKeyV2 details

Inspect func

ibcDenomPrefix

untyped string

ibcDenomPrefix is the prefix of wrapped IBC voucher denoms (mirrors z.PredictWrappedToken\*). Used to detect and trim wrapped denoms.

Value

"ibc/"

IBC_TOKEN

untyped bigint

Value

(0 <untyped> bigint)

GRC20_TOKEN

untyped bigint

Value

(1 <untyped> bigint)

NATIVE_COIN

untyped bigint

Value

(2 <untyped> bigint)

isIBCTokenDenom

func(denom string) bool
Open
OID
0b8694…2e59:15
isIBCTokenDenom details

Inspect func

getTokenType

func(denom string) int
Open
OID
0b8694…2e59:17
getTokenType details

Inspect func

parseCoins

func(s string) chain.Coins

parseCoins parses a comma-separated \<amount>\<denom> string into Coins.

Open
OID
0b8694…2e59:18
parseCoins details

Inspect func

funds

type

funds is the gno analog of the reference contract's threaded \`funds: &mut Coins\` (the message's attached coins). It is decremented as each token order consumes its BaseAmount during verification.

Value

v1.funds

newFunds

func(sent chain.Coins) *v1.funds

newFunds snapshots the attached coins into a mutable spend budget.

Open
OID
0b8694…2e59:19
newFunds details

Inspect func

execFatal

type

execFatal is a sentinel panic value. Unlike ordinary panics, values of this type are re-panicked by the recover handler so the VM can observe the failure after transaction rollback.

Value

v1.execFatal

decodeOrderInstruction

func(instruction zkgm.Instruction) (zkgm.TokenOrderV2, .uverse.error)

decodeOrderInstruction decodes a v2 token order, rejecting unsupported instruction versions.

Open
OID
0b8694…2e59:20
decodeOrderInstruction details

Inspect func

decodeCallInstruction

func(instruction zkgm.Instruction) (zkgm.Call, .uverse.error)

decodeCallInstruction decodes a call, rejecting unsupported instruction versions.

Open
OID
0b8694…2e59:22
decodeCallInstruction details

Inspect func

decodeBatchInstruction

func(instruction zkgm.Instruction) (zkgm.Batch, .uverse.error)

decodeBatchInstruction decodes a batch, rejecting unsupported instruction versions.

Open
OID
0b8694…2e59:23
decodeBatchInstruction details

Inspect func

decodeForwardInstruction

func(instruction zkgm.Instruction) (zkgm.Forward, .uverse.error)

decodeForwardInstruction decodes a forward, rejecting unsupported instruction versions.

Open
OID
0b8694…2e59:24
decodeForwardInstruction details

Inspect func

mustEncodeUniversalErrorAck

func() []uint8

mustEncodeUniversalErrorAck returns the ABI-encoded failure acknowledgement \`z.Ack{Tag: TAG\_ACK\_FAILURE, InnerAck: empty}\` that zkgm-internal recv failures emit. The empty inner ack matches union's \`Ack{tag: TAG\_ACK\_FAILURE, inner\_ack: Default::default()}\`; the encoded Ack itself is non-empty, satisfying core's non-empty acknowledgement requirement.

Open
OID
0b8694…2e59:25
mustEncodeUniversalErrorAck details

Inspect func

failureResult

func(ack []uint8) types.RecvPacketResult

failureResult wraps an ack as a failed recv result.

Open
OID
0b8694…2e59:26
failureResult details

Inspect func

universalErrorAck

func() []uint8

universalErrorAck returns the cached sentinel error acknowledgement.

Open
OID
0b8694…2e59:27
universalErrorAck details

Inspect func

tokenOrderDestinationChannel

func(channelId types.ChannelId) (uint32, .uverse.error)

tokenOrderDestinationChannel rejects the zero-channel sentinel so the derived destChan is safe to feed into UpdateChannelPath / PopChannelFromPath without colliding with the "no channel" slot. This mirrors the TokenOrder path helper's channel-zero rejection.

Open
OID
0b8694…2e59:28
tokenOrderDestinationChannel details

Inspect func

isOnlyMakerAck

func(ack []uint8) bool

isOnlyMakerAck reports whether ack is the only-maker sentinel.

Open
OID
0b8694…2e59:29
isOnlyMakerAck details

Inspect func

extractPanicMessage

func(r interface{...}) string

extractPanicMessage renders a recovered panic value as a string.

Open
OID
0b8694…2e59:30
extractPanicMessage details

Inspect func

errUnsupportedOpcode

untyped string

values; build them with makeError at the call site (see above).

Value

"unsupported opcode"

errUnsupportedTokenOrderVersion

untyped string

values; build them with makeError at the call site (see above).

Value

"unsupported token order version"

errUnsupportedCallVersion

untyped string

values; build them with makeError at the call site (see above).

Value

"unsupported call version"

errUnsupportedBatchVersion

untyped string

values; build them with makeError at the call site (see above).

Value

"unsupported batch version"

errUnsupportedForwardVersion

untyped string

values; build them with makeError at the call site (see above).

Value

"unsupported forward version"

errInvalidUnescrow

untyped string

values; build them with makeError at the call site (see above).

Value

"invalid token order unescrow"

errTokenOrderFeeUnderflow

untyped string

values; build them with makeError at the call site (see above).

Value

"token order fee underflow: quote amount exceeds base amount"

errUnknownTokenOrderKind

untyped string

values; build them with makeError at the call site (see above).

Value

"unknown token order kind"

errUnknownFillType

untyped string

values; build them with makeError at the call site (see above).

Value

"unknown fill type"

errUnsupportedTokenOrderKindForAck

untyped string

values; build them with makeError at the call site (see above).

Value

"unsupported token order kind for ack"

errUnsupportedTokenOrderKindForRefund

untyped string

values; build them with makeError at the call site (see above).

Value

"unsupported token order kind for refund"

errSolveNotImplemented

untyped string

values; build them with makeError at the call site (see above).

Value

"solve token order not implemented"

errInvalidTokenOrderDestChannel

untyped string

values; build them with makeError at the call site (see above).

Value

"invalid token order destination channel"

errInvalidTokenOrderTransferAmount

untyped string

values; build them with makeError at the call site (see above).

Value

"invalid token order transfer amount"

errMetadataDecimalsMismatch

untyped string

values; build them with makeError at the call site (see above).

Value

"token order: metadata decimals do not match the local token"

errEurekaUnsupported

untyped string

values; build them with makeError at the call site (see above).

Value

"eureka mode not supported"

errInvalidCallSender

untyped string

values; build them with makeError at the call site (see above).

Value

"invalid call sender"

errReceiverNotRegistered

untyped string

values; build them with makeError at the call site (see above).

Value

"receiver not registered"

errIsOnlyMakerAck

untyped string

values; build them with makeError at the call site (see above).

Value

"is only maker ack"

errInvalidForwardInstruction

untyped string

values; build them with makeError at the call site (see above).

Value

"invalid forward instruction"

errForwardMissingPrevDest

untyped string

values; build them with makeError at the call site (see above).

Value

"forward missing previous destination channel"

errForwardMissingNextSource

untyped string

values; build them with makeError at the call site (see above).

Value

"forward missing next source channel"

errForwardPrevDestMismatch

untyped string

values; build them with makeError at the call site (see above).

Value

"forward previous-destination mismatch"

errForwardZeroTimeout

untyped string

values; build them with makeError at the call site (see above).

Value

"forward timeout timestamp must be non-zero"

errInvalidBatchInstruction

untyped string

values; build them with makeError at the call site (see above).

Value

"invalid batch instruction"

errBatchAckCountMismatch

untyped string

values; build them with makeError at the call site (see above).

Value

"batch ack count mismatch"

errAmountOverflow

untyped string

values; build them with makeError at the call site (see above).

Value

"amount overflows int64"

errVoucherNotFound

untyped string

values; build them with makeError at the call site (see above).

Value

"voucher not found"

errVoucherSymbolAlreadyRegistered

untyped string

values; build them with makeError at the call site (see above).

Value

"voucher symbol already registered under a different denom"

errTokenBucketAbsent

untyped string

values; build them with makeError at the call site (see above).

Value

"token bucket is absent"

errCoinMismatch

untyped string

values; build them with makeError at the call site (see above).

Value

"zkgm/coins: sent coin mismatch"

errChannelBalanceUnderflow

untyped string

values; build them with makeError at the call site (see above).

Value

"zkgm/channel_balance: underflow"

errChannelBalanceOverflow

untyped string

values; build them with makeError at the call site (see above).

Value

"zkgm/channel_balance: overflow"

errSpoofedRealm

untyped string

values; build them with makeError at the call site (see above).

Value

"rlm does not match the current crossing frame"

makeError

func(msgs []string) .uverse.error
Open
OID
0b8694…2e59:31
makeError details

Inspect func

forwardInFlightKey

func(packet types.Packet) string

forwardInFlightKey derives the in-flight key from the child packet's commitment hash.

Open
OID
0b8694…2e59:33
forwardInFlightKey details

Inspect func

buildForwardChild

func(packet types.Packet, path *uint256.Uint, parentSalt [32]uint8, forward zkgm.Forward) (types.Packet, .uverse.error)

buildForwardChild builds the next-hop packet, advancing the channel path and namespacing the salt.

Open
OID
0b8694…2e59:35
buildForwardChild details

Inspect func

isAllowedForwardInstruction

func(opcode uint8) bool

isAllowedForwardInstruction reports whether opcode may be forwarded.

Open
OID
0b8694…2e59:36
isAllowedForwardInstruction details

Inspect func

cloneTokenBucket

func(bucket *tokenbucket.TokenBucket) *tokenbucket.TokenBucket
Open
OID
0b8694…2e59:37
cloneTokenBucket details

Inspect func

ucs03ZkgmV1

type

ucs03ZkgmV1 is the v1 implementation of the zkgm app. It holds the injected proxy state (zkgm.IStore) and contains all the protocol logic; the proxy keeps only the stable identity, the escrow funds, and the swap point. State writes go through the store's borrow-rule setters: v.store.SetXXX(0, rlm, ...).

Value

v1.ucs03ZkgmV1

NewUCS03ZkgmV1

func(store ucs03_zkgm.IStore) ucs03_zkgm.IApp

NewUCS03ZkgmV1 constructs a fresh v1 impl bound to the injected store.

Open
OID
0b8694…2e59:39
NewUCS03ZkgmV1 details

Inspect func

enforceVersion

func(version string)

enforceVersion rejects channels that do not speak the zkgm protocol version.

Open
OID
0b8694…2e59:41
enforceVersion details

Inspect func

tagAckSuccess

func() *uint256.Uint

tagAckSuccess returns a fresh copy of the success ack tag.

Open
OID
0b8694…2e59:44
tagAckSuccess details

Inspect func

tagAckFailure

func() *uint256.Uint
Open
OID
0b8694…2e59:46
tagAckFailure details

Inspect func

fillTypeProtocol

func() *uint256.Uint
Open
OID
0b8694…2e59:47
fillTypeProtocol details

Inspect func

fillTypeMarketMaker

func() *uint256.Uint
Open
OID
0b8694…2e59:48
fillTypeMarketMaker details

Inspect func

isZeroImage

func(image [32]uint8) bool

isZeroImage reports whether a metadata image is the zero value, selecting the V1 wrapped-token prediction when true.

Open
OID
0b8694…2e59:49
isZeroImage details

Inspect func

encodeTokenOrderSuccessAck

func(fillType *uint256.Uint, marketMaker []uint8) ([]uint8, .uverse.error)

encodeTokenOrderSuccessAck builds a success token-order ack with the given fill type.

Open
OID
0b8694…2e59:50
encodeTokenOrderSuccessAck details

Inspect func

canonicalDecimals

untyped bigint

canonicalDecimals is the ledger precision a wrapped voucher is capped to. A source token with more decimals overflows the grc20 int64 ledger, so its amounts are downscaled to this precision on the way in, and upscaled back on the way out.

Value

(6 <untyped> bigint)

sanitizeVoucherSymbol

func(candidate string, ibcDenom string) string

sanitizeVoucherSymbol derives a grc20-legal symbol (\<=MaxSymbolLen, \[A-Za-z0-9\_-]) from the candidate, falling back to a prefix of the IBC hash when empty.

Open
OID
0b8694…2e59:51
sanitizeVoucherSymbol details

Inspect func

scaleExpForDecimals

func(decimals uint8) int

scaleExpForDecimals returns the origin->ledger downscale exponent for \`decimals\`: the low-order digits dropped so the ledger holds canonicalDecimals. Tokens at or below canonicalDecimals return 0. Used at creation to cap the ledger, and by the INITIALIZE pre-flight check before a voucher exists.

Open
OID
0b8694…2e59:53
scaleExpForDecimals details

Inspect func

amountInt64

func(amount *uint256.Uint) (int64, .uverse.error)

amountInt64 narrows a uint256 to int64 for the native banker/grc20 paths (no scaling). It is the scaleExp-0 case of the shared downscaler, kept as a named helper for the native call sites (funds.sub, sendNative).

Open
OID
0b8694…2e59:54
amountInt64 details

Inspect func
assertIsRlmCurrent : func(int, rlm .uverse.realm) Inspect
isAllowedBatchInstruction : func(opcode uint8) bool Inspect
callSuccessAck : func() (types.RecvPacketResult, .uverse.error) Inspect
safeCallOnZkgm : func(int, rlm .uverse.realm, receiver zkgm.Zkgmable, env zkgm.CallEnv) (err .uverse.error, panicked bool) Inspect
safeCallOnIntentZkgm : func(int, rlm .uverse.realm, receiver zkgm.Zkgmable, env zkgm.IntentCallEnv) (err .uverse.error, panicked bool) Inspect
canRevive : func() ok bool Inspect
callErrAck : func(int, rlm .uverse.realm, err .uverse.error) types.RecvPacketResult Inspect
ChannelBalanceKeyV2 : func(channelId types.ChannelId, path *uint256.Uint, baseToken []uint8, quoteToken []uint8) string Inspect
ibcDenomPrefix : untyped string ="ibc/"
IBC_TOKEN : untyped bigint =(0 <untyped> bigint)
GRC20_TOKEN : untyped bigint =(1 <untyped> bigint)
NATIVE_COIN : untyped bigint =(2 <untyped> bigint)
isIBCTokenDenom : func(denom string) bool Inspect
getTokenType : func(denom string) int Inspect
parseCoins : func(s string) chain.Coins Inspect
funds : type =v1.funds
newFunds : func(sent chain.Coins) *v1.funds Inspect
execFatal : type =v1.execFatal
decodeOrderInstruction : func(instruction zkgm.Instruction) (zkgm.TokenOrderV2, .uverse.error) Inspect
decodeCallInstruction : func(instruction zkgm.Instruction) (zkgm.Call, .uverse.error) Inspect
decodeBatchInstruction : func(instruction zkgm.Instruction) (zkgm.Batch, .uverse.error) Inspect
decodeForwardInstruction : func(instruction zkgm.Instruction) (zkgm.Forward, .uverse.error) Inspect
mustEncodeUniversalErrorAck : func() []uint8 Inspect
failureResult : func(ack []uint8) types.RecvPacketResult Inspect
universalErrorAck : func() []uint8 Inspect
tokenOrderDestinationChannel : func(channelId types.ChannelId) (uint32, .uverse.error) Inspect
isOnlyMakerAck : func(ack []uint8) bool Inspect
extractPanicMessage : func(r interface{...}) string Inspect
errUnsupportedOpcode : untyped string ="unsupported opcode"
errUnsupportedTokenOrderVersion : untyped string ="unsupported token order version"
errUnsupportedCallVersion : untyped string ="unsupported call version"
errUnsupportedBatchVersion : untyped string ="unsupported batch version"
errUnsupportedForwardVersion : untyped string ="unsupported forward version"
errInvalidUnescrow : untyped string ="invalid token order unescrow"
errTokenOrderFeeUnderflow : untyped string ="token order fee underflow: quote amount exceeds base amount"
errUnknownTokenOrderKind : untyped string ="unknown token order kind"
errUnknownFillType : untyped string ="unknown fill type"
errUnsupportedTokenOrderKindForAck : untyped string ="unsupported token order kind for ack"
errUnsupportedTokenOrderKindForRefund : untyped string ="unsupported token order kind for refund"
errSolveNotImplemented : untyped string ="solve token order not implemented"
errInvalidTokenOrderDestChannel : untyped string ="invalid token order destination channel"
errInvalidTokenOrderTransferAmount : untyped string ="invalid token order transfer amount"
errMetadataDecimalsMismatch : untyped string ="token order: metadata decimals do not match the local token"
errEurekaUnsupported : untyped string ="eureka mode not supported"
errInvalidCallSender : untyped string ="invalid call sender"
errReceiverNotRegistered : untyped string ="receiver not registered"
errIsOnlyMakerAck : untyped string ="is only maker ack"
errInvalidForwardInstruction : untyped string ="invalid forward instruction"
errForwardMissingPrevDest : untyped string ="forward missing previous destination channel"
errForwardMissingNextSource : untyped string ="forward missing next source channel"
errForwardPrevDestMismatch : untyped string ="forward previous-destination mismatch"
errForwardZeroTimeout : untyped string ="forward timeout timestamp must be non-zero"
errInvalidBatchInstruction : untyped string ="invalid batch instruction"
errBatchAckCountMismatch : untyped string ="batch ack count mismatch"
errAmountOverflow : untyped string ="amount overflows int64"
errVoucherNotFound : untyped string ="voucher not found"
errVoucherSymbolAlreadyRegistered : untyped string ="voucher symbol already registered under a different denom"
errTokenBucketAbsent : untyped string ="token bucket is absent"
errCoinMismatch : untyped string ="zkgm/coins: sent coin mismatch"
errChannelBalanceUnderflow : untyped string ="zkgm/channel_balance: underflow"
errChannelBalanceOverflow : untyped string ="zkgm/channel_balance: overflow"
errSpoofedRealm : untyped string ="rlm does not match the current crossing frame"
makeError : func(msgs []string) .uverse.error Inspect
forwardInFlightKey : func(packet types.Packet) string Inspect
buildForwardChild : func(packet types.Packet, path *uint256.Uint, parentSalt [32]uint8, forward zkgm.Forward) (types.Packet, .uverse.error) Inspect
isAllowedForwardInstruction : func(opcode uint8) bool Inspect
cloneTokenBucket : func(bucket *tokenbucket.TokenBucket) *tokenbucket.TokenBucket Inspect
ucs03ZkgmV1 : type =v1.ucs03ZkgmV1
NewUCS03ZkgmV1 : func(store ucs03_zkgm.IStore) ucs03_zkgm.IApp Inspect
enforceVersion : func(version string) Inspect
init.70 : func() Inspect
tagAckSuccess : func() *uint256.Uint Inspect
tagAckFailure : func() *uint256.Uint Inspect
fillTypeProtocol : func() *uint256.Uint Inspect
fillTypeMarketMaker : func() *uint256.Uint Inspect
isZeroImage : func(image [32]uint8) bool Inspect
encodeTokenOrderSuccessAck : func(fillType *uint256.Uint, marketMaker []uint8) ([]uint8, .uverse.error) Inspect
canonicalDecimals : untyped bigint =(6 <untyped> bigint)
sanitizeVoucherSymbol : func(candidate string, ibcDenom string) string Inspect
scaleExpForDecimals : func(decimals uint8) int Inspect
amountInt64 : func(amount *uint256.Uint) (int64, .uverse.error) Inspect