Skip to content Search Apps Documentation Source Content Run Reset Eval Playground File Folder Download Copy Actions State String Boolean Number Struct Map Slice Pointer Function Closure Reference Nil Package Type Interface Unknown

Community realm. Read the code first. Community realm, deployed by its author. Read the code before you interact or send coins.

v1 source realm

Package treasury holds the funds and accounting for Shared Budget programs.

Overview

Package treasury holds the funds and accounting for Shared Budget programs.

Constants 2

Functions 19

func CreateProgram

crossing Action
1func CreateProgram(cur realm, maintenancePath, reimbursementsPath string, maintenancePeriodCap, maintenanceItemCap, reimbursementsPeriodCap, reimbursementsItemCap, periodBlocks, issueBlocks, maxHold int64) int64
source

CreateProgram pins both policy packages. The sponsor can fund the program after each policy has configured its roles and registered.

func Expire

crossing Action
1func Expire(cur realm, programID int64, lane string, itemID int64)
source

func FinalizeClose

crossing Action
1func FinalizeClose(cur realm, programID int64)
source

FinalizeClose turns the remainder into a sponsor claim. Recipient claims continue to be payable after the program closes.

func Reserve

crossing Action
1func Reserve(cur realm, programID, itemID int64, recipient address, amount, deadline int64) int64
source

Reserve is callable by the registered policy for its own spending lane.

func Withdraw

crossing Action
1func Withdraw(cur realm, programID int64, lane string, itemID int64)
source

Withdraw pays an approved item. Use lane "refund" and item ID 0 for the sponsor claim created by FinalizeClose.

Types 4

type ClaimView

struct
1type ClaimView struct {
2	Exists    bool
3	Recipient address
4	Amount    int64
5	Paid      bool
6}
source

type PolicyView

struct
1type PolicyView struct {
2	Path       string
3	Address    address
4	PeriodCap  int64
5	ItemCap    int64
6	Registered bool
7	Used       int64
8}
source

type ProgramView

struct
 1type ProgramView struct {
 2	ID                 int64
 3	Sponsor            address
 4	Status             string
 5	StartHeight        int64
 6	IssueEndHeight     int64
 7	PeriodBlocks       int64
 8	MaxHoldBlocks      int64
 9	CurrentPeriod      int64
10	ActiveReservations int64
11	Balance            budget.Ledger
12	Maintenance        PolicyView
13	Reimbursements     PolicyView
14}
source

type ReservationView

struct
 1type ReservationView struct {
 2	ID              int64
 3	Lane            string
 4	Recipient       address
 5	Amount          int64
 6	Status          string
 7	Period          int64
 8	Deadline        int64
 9	ExpiredAtHeight bool
10	Paid            bool
11}
source

Dependencies

Source Files 3