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 vault is the demo vault, version 1. Users deposit ugnot and withdraw it later. It has a bug Bouncer finds and...

Overview

Package vault is the demo vault, version 1. Users deposit ugnot and withdraw it later. It has a bug Bouncer finds and proves: Ledger hands out a live pointer to the balances tree (security guide §5.1).

Functions 5

func Deposit

crossing Action
1func Deposit(cur realm)
source

Deposit credits the caller with the ugnot sent with the call.

func Ledger

Action
1func Ledger() *avl.Tree
source

Ledger returns the balances, for frontends that list depositors.

func Withdraw

crossing Action
1func Withdraw(cur realm, amount int64)
source

Withdraw pays the caller back up to their balance.

Dependencies

Source Files 2