laneService
untyped stringlaneService is this engine's lane key into the DAO fee spine (memba\_market\_config), seeded there at 200 bps.
Value
"service"
PlatformFeePct
untyped bigintValue
(2 <untyped> bigint)
CancelFeePct
untyped bigintValue
(5 <untyped> bigint)
AutoRefundBlks
int64Value
864000
AutoResolveBlks
int64Value
806400
UnfundedExpiryBlks
int64Value
864000
MaxTitleLen
untyped bigint// bytes, after sanitising (also bounds the input)
Value
(200 <untyped> bigint)
MaxDescLen
untyped bigint// bytes, after sanitising (also bounds the input)
Value
(5000 <untyped> bigint)
MaxMilestones
untyped bigintValue
(20 <untyped> bigint)
MinMilestoneAmount
int64// 0.001 GNOT: below ~50 ugnot a 2% fee truncates to 0
Value
1000
maxMilestonesArgLen
untyped bigintValue
(5280 <untyped> bigint)
MaxActivePerClient
untyped bigintValue
(5 <untyped> bigint)
ContractStatus
typeValue
escrow_v4.ContractStatus
StatusActive
escrow_v4.ContractStatusValue
<gnolang.StringValue>
StatusCompleted
escrow_v4.ContractStatusValue
<gnolang.StringValue>
StatusDisputed
escrow_v4.ContractStatusValue
<gnolang.StringValue>
StatusCancelled
escrow_v4.ContractStatusValue
<gnolang.StringValue>
MilestoneStatus
typeValue
escrow_v4.MilestoneStatus
MsPending
escrow_v4.MilestoneStatusValue
<gnolang.StringValue>
MsFunded
escrow_v4.MilestoneStatusValue
<gnolang.StringValue>
MsCompleted
escrow_v4.MilestoneStatusValue
<gnolang.StringValue>
MsReleased
escrow_v4.MilestoneStatusValue
<gnolang.StringValue>
MsDisputed
escrow_v4.MilestoneStatusValue
<gnolang.StringValue>
MsRefunded
escrow_v4.MilestoneStatusValue
<gnolang.StringValue>
Contract
typeValue
escrow_v4.Contract
Milestone
typeValue
escrow_v4.Milestone
contracts
*avl.Tree// id -> \*Contract; live (not archived) contracts only
- OID
- 0e5fce…d11a:101
contracts details
clientSlots
*avl.Tree// client address -> int open contracts (removed on archive once 0); "c/\<client>/\<id>" -> nil client index
- OID
- 0e5fce…d11a:103
clientSlots details
nextID
int// monotonic, never reused
Value
0
activeCount
int// open contracts
Value
0
archivedCount
intValue
0
totalLiable
int64// NF-2: ugnot owed to funded, completed and disputed milestones
Value
0
init.32
func()- OID
- 0e5fce…d11a:9
init.32 details
resolveFee
func() (int64, .uverse.address)- OID
- 0e5fce…d11a:11
resolveFee details
callerOf
func() .uverse.address- OID
- 0e5fce…d11a:12
callerOf details
CreateContract
func(freelancer .uverse.address, title string, description string, milestones string) stringCreateContract creates a new escrow contract with milestones, as the caller's client. Milestones format: "title1:amount1,title2:amount2". The caller must be a user (a direct call or the user's own run script), so a realm cannot mint client identities with cur.Sub to hold slots.
- OID
- 0e5fce…d11a:13
CreateContract details
FundMilestone
func(contractId string, milestoneIdx int)FundMilestone deposits exactly the milestone amount. Client only, and only as a direct user call: the tx-level send lands on the message's target realm, so from an intermediary realm the coins would never reach escrow while the milestone was marked funded.
- OID
- 0e5fce…d11a:14
FundMilestone details
CompleteMilestone
func(contractId string, milestoneIdx int)CompleteMilestone marks a funded milestone delivered. Freelancer only.
- OID
- 0e5fce…d11a:15
CompleteMilestone details
ReleaseFunds
func(contractId string, milestoneIdx int)ReleaseFunds pays a completed milestone to the freelancer, minus the fee. Client, or admin as the trusted arbiter (v3 behaviour).
- OID
- 0e5fce…d11a:16
ReleaseFunds details
RaiseDispute
func(contractId string, milestoneIdx int)RaiseDispute escalates a funded or completed milestone to the admin. Client or freelancer.
- OID
- 0e5fce…d11a:17
RaiseDispute details
ResolveDispute
func(contractId string, milestoneIdx int, refundClient bool)ResolveDispute settles a disputed milestone. Admin only. refundClient=true refunds the client in full; false pays the freelancer minus the fee. The contract then returns to active, stays disputed if another milestone still is, or settles: completed if every milestone is released, cancelled if every milestone is released or refunded.
- OID
- 0e5fce…d11a:18
ResolveDispute details
CancelContract
func(contractId string)CancelContract cancels an active contract. Client only. Funded milestones are refunded minus CancelFeePct, which goes to the freelancer; completed milestones are paid to the freelancer minus the service fee.
- OID
- 0e5fce…d11a:19
CancelContract details
ExpireUnfunded
func(contractId string)ExpireUnfunded cancels a contract none of whose milestones was ever funded, once UnfundedExpiryBlks have passed since creation (blocking-window blocks excluded). Anyone may call. It frees the client's slot and moves no coins; it does not delete, so the storage deposit stays for the client's ArchiveContract.
- OID
- 0e5fce…d11a:20
ExpireUnfunded details
ClaimRefund
func(contractId string, milestoneIdx int)ClaimRefund refunds a funded milestone nobody completed within AutoRefundBlks (blocking-window blocks excluded). Anyone may call; the client receives the funds. If no milestone then holds funds the contract is cancelled, pending milestones included (v3 behaviour).
- OID
- 0e5fce…d11a:21
ClaimRefund details
ClaimDisputeTimeout
func(contractId string, milestoneIdx int)ClaimDisputeTimeout resolves a dispute the admin has not acted on within AutoResolveBlks (blocking-window blocks excluded), following the pre-dispute status: a delivered milestone (MsCompleted) pays the freelancer minus the fee, an undelivered one (MsFunded) refunds the client. Anyone may call.
- OID
- 0e5fce…d11a:22
ClaimDisputeTimeout details
ArchiveContract
func(contractId string)ArchiveContract deletes a settled contract (completed or cancelled, with nothing escrowed). Client only. The freed bytes shrink the realm's storage, and the chain refunds their storage deposit to the signer of this message (see DESIGN.md), so the client, who paid for the contract when creating it, gets that deposit back. The id is never reused. The ContractArchived event is the permanent record; nothing of the contract stays in realm state.
- OID
- 0e5fce…d11a:23
ArchiveContract details
isOpen
func(c *escrow_v4.Contract) boolisOpen reports whether c still holds an active slot.
- OID
- 0e5fce…d11a:24
isOpen details
clientActive
func(client .uverse.address) int- OID
- 0e5fce…d11a:25
clientActive details
takeSlot
func(client .uverse.address)- OID
- 0e5fce…d11a:26
takeSlot details
settle
func(c *escrow_v4.Contract, status escrow_v4.ContractStatus)settle moves an open contract to a terminal status and releases its slot. Terminal statuses are absorbing, so this runs at most once per contract.
- OID
- 0e5fce…d11a:27
settle details
settleIfFinished
func(c *escrow_v4.Contract)settleIfFinished settles an open contract whose milestones are all released (completed) or all released or refunded (cancelled). A pending, funded, completed or disputed milestone keeps it open.
- OID
- 0e5fce…d11a:28
settleIfFinished details
payout
typeValue
escrow_v4.payout
send
func(to .uverse.address, amount int64)- OID
- 0e5fce…d11a:29
send details
payFreelancer
func(c *escrow_v4.Contract, amount int64) escrow_v4.payoutpayFreelancer pays amount to the freelancer minus the service fee read live from the fee spine, which goes to the treasury.
- OID
- 0e5fce…d11a:30
payFreelancer details
getContract
func(id string) *escrow_v4.Contract- OID
- 0e5fce…d11a:31
getContract details
milestoneAt
func(c *escrow_v4.Contract, idx int) *escrow_v4.Milestone- OID
- 0e5fce…d11a:32
milestoneAt details
allMilestonesReleased
func(c *escrow_v4.Contract) bool- OID
- 0e5fce…d11a:33
allMilestonesReleased details
anyMilestoneDisputed
func(c *escrow_v4.Contract) bool- OID
- 0e5fce…d11a:34
anyMilestoneDisputed details
allMilestonesTerminal
func(c *escrow_v4.Contract) boolallMilestonesTerminal reports whether no milestone holds funds (pending with no funds counts as terminal).
- OID
- 0e5fce…d11a:35
allMilestonesTerminal details
parseMilestones
func(input string) []escrow_v4.MilestoneparseMilestones parses "title1:amount1,title2:amount2". Blank entries are skipped; any other malformed entry panics.
- OID
- 0e5fce…d11a:36
parseMilestones details
MaxPauseBlks
int64Value
183273
PauseCooldownBlks
int64Value
183273
paused
boolValue
false
pausedAt
int64// height of the current pause; 0 when not paused
Value
0
pauseCooldownUntil
int64// first height at which Pause is accepted again
Value
0
pausedBlocksDone
int64// blocking-window blocks of finished pauses
Value
0
PauseInfo
typePauseInfo is the read-back of the pause state.
Value
escrow_v4.PauseInfo
PauseState
func() escrow_v4.PauseInfoPauseState returns the pause state at the current height.
- OID
- 0e5fce…d11a:41
PauseState details
IsPaused
func() boolIsPaused reports whether the pause flag is set. Exits may already have reopened: see PauseState().ExitsOpen.
- OID
- 0e5fce…d11a:42
IsPaused details
Pause
func()Pause stops new money and, for MaxPauseBlks, every other state change. Admin only. Refused while paused and during the cooldown after an Unpause.
- OID
- 0e5fce…d11a:43
Pause details
Unpause
func()Unpause resumes normal operation and starts the cooldown. Admin only.
- OID
- 0e5fce…d11a:44
Unpause details
inBlockingWindow
func(now int64) boolinBlockingWindow reports whether now falls in the first MaxPauseBlks blocks of the current pause.
- OID
- 0e5fce…d11a:45
inBlockingWindow details
pausedBlocksAt
func(now int64) int64pausedBlocksAt returns the blocking-window blocks up to now, finished pauses included. Timeout clocks subtract the growth of this value.
- OID
- 0e5fce…d11a:46
pausedBlocksAt details
assertAcceptsNewMoney
func()assertAcceptsNewMoney guards CreateContract and FundMilestone.
- OID
- 0e5fce…d11a:47
assertAcceptsNewMoney details
assertOpen
func()assertOpen guards every other state-changing user and admin entrypoint.
- OID
- 0e5fce…d11a:48
assertOpen details
elapsedOpen
func(since int64, mark int64) int64elapsedOpen returns the blocks since \`since\` that fell outside any blocking window, given pausedBlocksAt(since) recorded as mark.
- OID
- 0e5fce…d11a:49
elapsedOpen details
admin
.uverse.addressValue
<gnolang.StringValue>
pendingAdmin
.uverse.addressValue
<zero>
feeRecipient
.uverse.addressValue
<gnolang.StringValue>
pendingFeeRecipient
.uverse.addressValue
<zero>
assertAdmin
func()assertAdmin rejects a stale or sibling \`cur\`, then checks the caller.
- OID
- 0e5fce…d11a:54
assertAdmin details
TransferOwnership
func(newAdmin .uverse.address)TransferOwnership stages a handoff to newAdmin. Admin only. Calling it again replaces the staged address.
- OID
- 0e5fce…d11a:55
TransferOwnership details
AcceptOwnership
func()AcceptOwnership completes the handoff. Only the staged address may call it, so the outgoing admin cannot collapse the two steps into one.
- OID
- 0e5fce…d11a:56
AcceptOwnership details
CancelOwnershipTransfer
func()CancelOwnershipTransfer clears a staged handoff. Admin only.
- OID
- 0e5fce…d11a:57
CancelOwnershipTransfer details
GetAdmin
func() stringGetAdmin returns the address that holds admin.
- OID
- 0e5fce…d11a:58
GetAdmin details
GetPendingAdmin
func() stringGetPendingAdmin returns the staged successor ("" when none).
- OID
- 0e5fce…d11a:59
GetPendingAdmin details
ProposeFeeRecipient
func(recipient .uverse.address)ProposeFeeRecipient stages a new fallback fee recipient. Admin only.
- OID
- 0e5fce…d11a:60
ProposeFeeRecipient details
AcceptFeeRecipient
func()AcceptFeeRecipient completes the rotation. Only the staged address may call it, which proves it can transact.
- OID
- 0e5fce…d11a:61
AcceptFeeRecipient details
CancelFeeRecipientProposal
func()CancelFeeRecipientProposal clears a staged fee recipient. Admin only.
- OID
- 0e5fce…d11a:62
CancelFeeRecipientProposal details
GetFeeRecipient
func() stringGetFeeRecipient returns the fallback fee recipient.
- OID
- 0e5fce…d11a:63
GetFeeRecipient details
GetPendingFeeRecipient
func() stringGetPendingFeeRecipient returns the staged fee recipient ("" when none).
- OID
- 0e5fce…d11a:64
GetPendingFeeRecipient details
basisPointsFee
func(amount int64, bps int64) int64basisPointsFee computes floor(amount\*bps/10000) without overflowing the intermediate product. For nonnegative amount and bps \<= 10000, the quotient product and final sum are \<= amount; the remainder product is \< 100000000. Callers retain their existing configured rates, recipients and rounding.
- OID
- 0e5fce…d11a:65
basisPointsFee details
cleanText
func(s string, what string, max int) stringcleanText validates and sanitises user text before it is stored and rendered. It refuses input longer than max bytes, input that is not valid UTF-8 (the sanitiser would otherwise turn each bad byte into a 3-byte U+FFFD, storing up to three times the limit), and control or format characters (\\p{Cc}, \\p{Cf}: bidi overrides, zero-width characters), which could hide or reorder text. It then strips markdown-sensitive characters and line breaks and tabs, as v3 did. Stripping only removes bytes, so the result is within max; that is checked again because storage is bounded by it.
- OID
- 0e5fce…d11a:66
cleanText details
isStripped
func(c int32) boolisStripped reports the markdown-sensitive characters and line breaks and tabs removed from stored text, as in v3.
- OID
- 0e5fce…d11a:67
isStripped details
mayBeFormat
func(c int32) boolmayBeFormat is a cheap superset test for \\p{Cf} (every format character is U+00AD, in U+0600..U+206F, or at or above U+FEFF), so common text skips the table lookup.
- OID
- 0e5fce…d11a:68
mayBeFormat details
publisherAtLoad
func() .uverse.address- OID
- 0e5fce…d11a:69
publisherAtLoad details
requireExactSend
func(amount int64, caller .uverse.realm)requireExactSend panics unless caller (the entrypoint's cur.Previous()) is a direct user call and the transaction's send envelope holds exactly amount ugnot and no other denom. Only for a direct user call is the envelope credited to this realm, the message target; any other denom would be stranded here. The guard sits in this function, before the read, so the deployer's per-function fund-safety scan (lib/deploy.sh) sees it.
- OID
- 0e5fce…d11a:71
requireExactSend details
realmAddress
func() .uverse.address- OID
- 0e5fce…d11a:72
realmAddress details
TotalLiabilities
func() int64TotalLiabilities returns the ugnot the realm owes across funded, completed and disputed milestones.
- OID
- 0e5fce…d11a:73
TotalLiabilities details
RealmAddress
func() stringRealmAddress is the NF-2 canonical name for the realm's own address.
- OID
- 0e5fce…d11a:75
RealmAddress details
GetActiveCount
func() intGetActiveCount returns the number of open contracts (not completed or cancelled).
- OID
- 0e5fce…d11a:76
GetActiveCount details
GetClientActiveCount
func(client .uverse.address) intGetClientActiveCount returns the open contracts created by client, bounded by MaxActivePerClient.
- OID
- 0e5fce…d11a:77
GetClientActiveCount details
GetLiveCount
func() intGetLiveCount returns the contracts still stored: open ones plus settled ones their client has not archived.
- OID
- 0e5fce…d11a:78
GetLiveCount details
GetArchivedCount
func() intGetArchivedCount returns the contracts deleted by ArchiveContract.
- OID
- 0e5fce…d11a:79
GetArchivedCount details
GetCreatedCount
func() intGetCreatedCount returns every contract ever created; ids run from 0 to GetCreatedCount()-1 and are never reused.
- OID
- 0e5fce…d11a:80
GetCreatedCount details
GovernanceMilestone
typeValue
escrow_v4.GovernanceMilestone
GovernanceContract
typeValue
escrow_v4.GovernanceContract
GetGovernanceContract
func(id string) escrow_v4.GovernanceContract- OID
- 0e5fce…d11a:81
GetGovernanceContract details
contentHash
func(c *escrow_v4.Contract) stringcontentHash digests the immutable metadata of a contract (parties, texts, creation height, milestone titles and amounts), not its state.
- OID
- 0e5fce…d11a:82
contentHash details
GovernanceFeeTerms
typeValue
escrow_v4.GovernanceFeeTerms
GetGovernanceFeeTerms
func() escrow_v4.GovernanceFeeTerms- OID
- 0e5fce…d11a:83
GetGovernanceFeeTerms details
escrowMetadataField
func(value string) string- OID
- 0e5fce…d11a:84
escrowMetadataField details
maxPageSize
untyped bigintValue
(50 <untyped> bigint)
indexPrefix
untyped stringindexPrefix keys the client index inside clientSlots (the per-client slot counters are keyed by the bare address, which never starts with "c/"): one tree instead of two keeps the package smaller.
Value
"c/"
GetContractJSON
func(id string) stringGetContractJSON returns one contract as JSON.
- OID
- 0e5fce…d11a:85
GetContractJSON details
GetClientContractsJSON
func(client .uverse.address, before string, limit int) stringGetClientContractsJSON pages the live contracts a client created, newest first: {"items":\[{"id","status","createdAtHeight"}...],"next":cursor|null}. before is "" for the first page or the previous page's next cursor; limit is clamped to 1..50.
- OID
- 0e5fce…d11a:86
GetClientContractsJSON details
GetPauseStateJSON
func() stringGetPauseStateJSON returns PauseState() as JSON.
- OID
- 0e5fce…d11a:87
GetPauseStateJSON details
contractsPage
func(who .uverse.address, before string, limit int) string- OID
- 0e5fce…d11a:88
contractsPage details
indexKey
func(who .uverse.address, id int) stringindexKey orders a party's contracts by id: 10-digit zero padding.
- OID
- 0e5fce…d11a:89
indexKey details
deadline
func(since int64, mark int64, span int64) int64deadline is the height at which a clock started at since (pause mark taken then) reaches span unpaused blocks, assuming no pause after the current one.
- OID
- 0e5fce…d11a:90
deadline details
minHeight
func(a int64, b int64) int64- OID
- 0e5fce…d11a:91
minHeight details
jint
func(n int64) string- OID
- 0e5fce…d11a:92
jint details
jheight
func(n int64) stringjheight encodes 0 (not set) as null.
- OID
- 0e5fce…d11a:93
jheight details
jstr
func(s string) stringjstr quotes s as a JSON string. Stored text is valid UTF-8 without control characters; ids passed by callers are escaped the same way.
- OID
- 0e5fce…d11a:94
jstr details
RenderPageSize
untyped bigintRenderPageSize is the number of contracts listed per home page.
Value
(20 <untyped> bigint)
Render
func(path string) string- OID
- 0e5fce…d11a:95
Render details
renderHome
func(page int) string- OID
- 0e5fce…d11a:96
renderHome details
renderContract
func(id string) string- OID
- 0e5fce…d11a:97
renderContract details
renderStats
func() string- OID
- 0e5fce…d11a:98
renderStats details
contractTotal
func(c *escrow_v4.Contract) int64contractTotal cannot overflow: CreateContract refuses totals above int64.
- OID
- 0e5fce…d11a:99
contractTotal details
truncAddr
func(addr .uverse.address) string- OID
- 0e5fce…d11a:100