Convex

Convex

Account #72
Account 73 / 14299
FieldValueNotes
Account KeynullEd25519 public key (null for actors)
Balance
            0.000000000
Convex coin balance
Account Fields
FieldValueDescription
:sequence0Number of transactions executed by this account to date.
:keynilEd25519 public key of this account. If nil, account cannot execute external transactions (e.g. an actor).
:balance
            0.000000000
CVM balance of account. This is used for transaction fees and may be freely transferred.
:allowance0Memory allowance credit on the CVM. If positive, the account may allocated up to this amount of memory before incurring fees for additional memory.
:holdings0 value(s)Storage for holdings data referenced by other accounts.
:controller#6Account controller. If set, the controller can execute code in this account (e.g. change the key). If you don't trust the controller, don't trust the account!
:environment18 value(s)Symbols defined in this account. Typically used to store data or executable code.
:metadata17 value(s)Metadata attached to symbols defined in this account.
:parentnilParent account. This defines fallback values for symbols not defined in this account.
Environment (18)

The Environment contains symbols defined in this account. These may be referenced like: #45/symbol-name

SymbolValueDescription
-set-balance(fn [addr bal] (let [orec (get-holding %0) rec (cond %2 (assoc %2 0 %1) (vector %1 nil)) ] (set-holding %0 %3)))nil
unwrap(fn ([] (recur (call* #72 0 balance))) ([amount] (call* #72 %0 -unwrap %0)))nil
wrap(fn [amount] (call* #72 %0 wrap-offer))nil
decimals(fn [] 9)nil
total-supply(fn [] #72/supply)nil
quantity-add(fn [a b] (let [a (cond %0 (int %0) 0) b (cond %1 (int %1) 0) ] (+ %2 %3)))nil
balance(fn ([addr] (let [rec (get-holding %0) ] (cond (get %1 0) *result* 0))))nil
direct-transfer(fn [addr amount data] (let [addr (address %0) amount (#72/-qc %1) bal (#72/-get-balance *caller*) tbal (#72/-get-balance %3) ] (cond (< %4 0) (fail :ARGUMENT "negative transfer")) (cond (> %4 %5) (fail :FUNDS "insufficent token balance")) (cond (= *caller* %3) (do (log "TR" *caller* %3 %4 %5 %5 %2) (return %4)) nil) (let [nsb (- %5 %4) nrb (+ %6 %4) ] (log "TR" *caller* %3 %4 %7 %8 %2) (#72/-set-balance *caller* (- %5 %4)) (#72/-set-balance %3 (+ %6 %4)))))nil
-unwrap(fn [amt] (let [new-bal (- (#72/-get-balance *caller*) %0) ] (cond (>= %1 0) *result* (fail "Insufficient balance for unwrap")) (#72/-set-balance *caller* %1) (def supply (- #72/supply %0)) (transfer *caller* %0) %0))nil
quantity-subset?(fn [a b] (let [a (cond %0 (int %0) 0) b (cond %1 (int %1) 0) ] (<= %2 %3)))nil
offer(fn [receiver quantity] (let [quantity (#72/-qc %1) receiver (address %0) rec (get-holding *caller*) ] (cond %4 (let [os (nth %4 1) nrec (cond (<= %2 0) (assoc %4 1 (dissoc %5 %3)) (assoc %4 1 (assoc %5 %3 %2))) ] (set-holding *caller* %6)) (set-holding *caller* (vector 0 (hash-map %3 %2)))) %2))nil
-get-balance(fn [addr] (let [h (get-holding %0) bal (get %1 0 0) ] %2))nil
supply0nil
get-offer(fn [sender receiver] (let [offs (get (get-holding %0) 1) ] (cond (get %2 %1) *result* 0)))nil
wrap-offer(fn [] (let [amt *offer* new-bal (+ (#72/-get-balance *caller*) %0) ] (accept %0) (#72/-set-balance *caller* %1) (def supply (+ #72/supply %0)) %0))nil
-qc(fn [q] (cond (int? %0) %0 (nil? %0) 0 (fail :ARGUMENT "Invalid token quantity")))"Quantity check."
quantity-sub(fn [a b] (let [a (cond %0 (int %0) 0) b (cond %1 (int %1) 0) ] (cond (>= %2 %3) (- %2 %3) 0)))nil
accept(fn [sender quantity] (let [quantity (#72/-qc %1) _ (cond (zero? %2) (return 0) (< %2 0) (fail :ARGUMENT "Negative accept amount")) receiver *caller* rec (get-holding %0) ] (cond %4 (let [os (nth %4 1) off (cond (get %5 %3) *result* (fail :STATE "No offer to receiver")) _ (cond (< %6 %2) (fail :STATE "insufficient offer")) bal (nth %4 0) nbal (- %7 %2) _ (cond (< %8 0) (fail :FUNDS "Insufficent balance to accept")) noff (- %6 %2) nos (cond (<= %9 0) (dissoc %5 %3) (assoc %5 %3 %9)) nrec (vector %8 %10) ] (set-holding %0 %11) (#72/-set-balance %3 (+ (#72/-get-balance %3) %2)) %2) (fail "No offers from sender"))))nil
Holdings (Empty)

Holdings track token balances and other indexed values by address.

AddressValue