Convex

Convex

Account #9
Account 10 / 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.
:holdings24 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!
:environment21 value(s)Symbols defined in this account. Typically used to store data or executable code.
:metadata18 value(s)Metadata attached to symbols defined in this account.
:parentnilParent account. This defines fallback values for symbols not defined in this account.
Environment (21)

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

SymbolValueDescription
check-trusted?(fn [subject action object] (cond (empty? *scope*) (#9/trust/trusted? #9/root-controller %0 %1 %2) (let [[& ps pname] *scope* cont (get-in #9/cns-database (vector %3 %4 1)) ] (#9/trust/trusted? %5 %0 %1 %2))))nil
-check(fn [sym] (cond (symbol? %0) (split (name %0) \.) (fail :ARGUMENT "CNS name must be a Symbol")))nil
update(fn [sym value] (cond (#9/read %0) (let [rec *result* ] (apply #9/create %0 (assoc %2 0 %1))) (fail :STATE (str "CNS record to update does not exist: " %0))))"Updates a CNS entry with given value. Record must already exist."
change-control(fn [controller] (let [path *scope* ] (cond (not (#9/trust/trusted? (get #9/cns-owners %1) *caller* :control)) (fail :TRUST "Forbidden to change CNS node controller") nil) (def cns-owners (assoc-in #9/cns-owners (vector %1) %0))))"Changes controller for a CNS node. May only be performed by a current controller."
root-controller#6nil
resolve(fn [sym] (get (#9/read %0) 0))"Resolves a CNS entry. Returns nil if entry does not exist"
cns-write(fn [pname values] (do (cond (str? %0) *result* (fail :ARGUMENT "CNS path element must be a String")) (#9/-check-values %1) (let [sm (get #9/cns-database *scope*) ] (cond %2 *result* (#9/error :STATE "CNS Node key not valid")) (cond (get %2 %0) (let [rec *result* ] (cond (#9/trust/trusted? (get %3 1) *caller* :update) *result* (fail :TRUST "Forbidden to update CNS record"))) (cond (#9/trust/trusted? (#9/-controller *scope*) *caller* :create %0) *result* (fail :TRUST "Forbidden to create CNS record"))) (def cns-database (assoc-in #9/cns-database (vector *scope* %0) %1)) %1)))"Writes a CNS record from this Actor. Assumes a path vector passed in *scope*."
create(fn ([sym & vals] (let [nv (count %1) _ (cond (> %2 4) (fail :ARITY "Too many CNS record values")) path (#9/-check %0) n (count %3) ] (cond (zero? %4) (fail :ARGUMENT "CNS path must have at least one segment")) (loop [i 0 ref #9/root ] (let [pname (get %3 %5) ] (cond (nil? %6) (fail :STATE (str "No CNS child path at: " (slice %3 0 %5))) (>= (inc %5) %4) (let [rec (cond (< %2 4) (let [evs (call* %6 0 cns-read %7) evs (cond %8 *result* (vector nil *address* nil nil)) ] (concat %1 (slice %9 %2 4))) %1) ] (call* %6 0 cns-write %7 %8)) (let [rec (call* %6 0 cns-read %7) ] (cond (get %8 3) (let [child *result* ] (recur (inc %5) %9)) (let [cont (cond (get %1 1) *result* *address*) nref (call* %6 0 cns-create-node %7 %9) rec (cond %8 (assoc %8 3 %10) (vector nil %9 nil %10)) ] (call* %6 0 cns-write %7 %11) (recur (inc %5) %10))))))))))"Creates a CNS entry with given data [value, controller, metadata, child]"
cns-owners{["convex" "trust"] #6,["currency"] #6,["torus"] #6,["asset" "wrap"] #6,["asset"] #6,["asset" "box"] #6,["convex"] #6,["asset" "nft"] #6,[] #6}nil
root[#9 []]nil
cns-create-node(fn [pname owner] (do (cond (#9/trust/trusted? (get #9/cns-owners *scope*) *caller* :create %0) *result* (fail :TRUST "Forbidden to create CNS node")) (let [rec (get-in #9/cns-database (vector *scope* %0)) _ (cond (get %2 3) (let [existing *result* ] (return %3))) path (conj *scope* %0) ref (vector #9 %3) ] (def cns-owners (assoc-in #9/cns-owners (vector %3) %1)) (def cns-database (assoc-in #9/cns-database (vector %3) {})) %4)))"Creates a child CNS node, if it does not yet exist. Returns child node scoped reference."
cns-database{["convex" "trust"] {"whitelist" [#75 #6 nil nil],"delegate" [#74 #6 nil nil],"monitors" [#76 #6 nil nil],"ownership-monitor" [#73 #6 nil nil]},["currency"] {"GBPF" [#130 #6 nil nil],"USDF" [#128 #6 nil nil]},["torus"] {"exchange" [#66 #6 nil nil]},["asset" "wrap"] {"convex" [#72 #6 nil nil]},["asset"] {"wrap" [nil #6 nil [#9 ["asset" "wrap"]]],"nft" [nil #6 nil [#9 ["asset" "nft"]]],"box" [#70 #6 nil [#9 ["asset" "box"]]],"multi-token" [#71 #6 nil nil]},["asset" "box"] {"actor" [#69 #6 nil nil]},["convex"] {"core" [#8 #6 nil nil],"trust" [#10 #6 nil [#9 ["convex" "trust"]]],"fungible" [#64 #6 nil nil],"registry" [#9 #6 nil nil],"asset" [#65 #6 nil nil],"governance" [#77 #6 nil nil],"cns" [#9 #6 nil [#9 []]]},["asset" "nft"] {"simple" [#67 #6 nil nil],"basic" [#68 #6 nil nil]},[] {"currency" [nil #6 nil [#9 ["currency"]]],"torus" [nil #6 nil [#9 ["torus"]]],"asset" [nil #6 nil [#9 ["asset"]]],"init" [#1 #1 nil nil],"convex" [nil #6 nil [#9 ["convex"]]]}}nil
cns-read(fn [pname] (get-in #9/cns-database (vector *scope* %0)))"Reads a child CNS record from this CNS node. Assumes a path vector passed in *scope*."
cns-delete-node(fn [pname owner] (do (cond (#9/trust/trusted? (get #9/cns-owners *scope*) *caller* :delete %0) *result* (fail :TRUST "Forbidden to delete CNS node")) (let [path (conj *scope* %0) existing (get #9/cns-database %2) ] (cond %3 (do (def cns-owners (dissoc #9/cns-owners %2)) (def cns-database (dissoc #9/cns-database %2))) nil) (def cns-database (#8/dissoc-in #9/cns-database (vector *scope* %0))) (boolean %3))))"Deletes a child CNS node. Returns true if deleted"
trust#10nil
lookup(fn [addr] (get-holding (address %0)))"Looks up registry metadata for a given address."
-controller(fn [path] (cond (empty? %0) (cond (vector? %0) #9/root-controller (fail :ARGMENT "CNS path must be a vector")) (let [[& ps p] %0 ] (get-in #9/cns-database (vector %1 %2 1)))))nil
read(fn [sym] (query (let [path (#9/-check %0) n (count %1) ] (loop [i 0 ref #9/root ] (let [pname (nth %1 %3) rec (call* %4 0 cns-read %5) ] (cond (nil? %6) (return nil) (>= (inc %3) %2) (return %6) (cond (nth %6 3) (let [child *result* ] (recur (inc %3) %7)))))))))"Reads a CNS record as a [value controller metadata child] vector, or nil if record does not exist."
-check-values(fn [values] (cond (vector? %0) (cond (= 4 (count %0)) %0 (fail :ARGUMENT "CNS record must have 4 elements")) (fail :ARGUMENT "CNS record must be a Vector")))nil
register(fn [data] (set-holding *caller* %0))"Registers metadata for the *caller* account. Metadata can be an arbitrary value, but by convention is a map with defined fields."
control(fn [sym cont] (cond (#9/read %0) (let [rec *result* ] (apply #9/create %0 (assoc %2 1 %1))) (fail :STATE "CNS record does not exist")))"Change controller for a CNS node."
Holdings (24)

Holdings track token balances and other indexed values by address.

AddressValue
#2{:description "Master network governance account",:name "Foundation Governance"}
#3{:description "Unreleased Foundation coin reserve",:name "Foundation Reserve"}
#4{:description "Release curve unreleased coins",:name "Release Curve Reserve"}
#5{:description "Release curve coins for future distribution",:name "Release Curve Pre-Distribution"}
#6{:description "Network governance account",:name "Network Governance"}
#7{:description "Network admin accouns",:name "Network Admin"}
#8{:description "Core library accessible by default in any account",:name "Convex Core Library"}
#9{:description ["CNS Registry - for resolving arbitrary symbols to addresses." "Hosts the CNS root namespace(s)."],:name "Convex Name Service"}
#10{:description ["Based on the reference monitor security model." "See comments about trusted monitors in `trusted?`." "Provides for creation of upgradable actors."],:name "Trust monitor library"}
#11{:description "User account for genesis",:name "Genesis User"}
#12{:description "Genesis peer controller account",:name "Genesis Controller"}
#64{:description ["Provides library functions for building and managing standard fungible assets." "Quantity is expressed as a long representing the amount of an asset." "The `build-token` function creates deployable code that follows the interface described in `convex.asset`."],:name "Fungible token creation and management"}
#65{:description ["An asset is either:" "- A vector `[asset-path quantity]` indicating an asset managed by an actor" "- A map `asset-path` -> `quantity` indicating multiple assets" "Quantities are asset-specific." "For a fungible currency, quantity is the amount ; for a non-fungible token, quantity may be a set of token ids." "Key functions from this library are `balance`, `owns?`, and `transfer`." "Other functions such as `accept` and `offer` provide more fine-grained control when required." "Implementing a new asset means deploying an actor which defines the following callable functions:" "- `(accept sender quantity)`" "- `(balance owner)`" "- `(check-transfer sender receiver quantity)`" "- `(direct-transfer receiver quantity)`" "- `(get-offer sender receiver)`" "- `(offer receiver quantity)`" "- `(quantity-add asset-address a b)`" "- `(quantity-sub asset-address a b)`" "- `(quantity-subset a b)` ; returns true if `a` is considered a subset of `b`" "For more information, see those functions defined in this library whose purpose is to delegate to asset implementations in a generic way."],:name "Convex Asset API library"}
#66{:description ["Torus is a decentralised exchange (DEX) that is fully on-chain and native to Convex." "It establishes automated market makers for fungible assets (see `convex.fungible`)." "Each market offers CVX/Token trading pairs with a liquidity pool."],:name "Torus DEX"}
#67{:description ["Enables the creation of minimal NFT tokens." "A Simple NFT is merely an ownable Integer ID. Users can build an additional layer so that this ID points to anything." "Follows the interface described in `convex.asset`."],:name "Simple NFT creation and management"}
#68{:description ["Enables the creation of Basic NFTs." "A Basic NFT is merely an ownable Integer ID with immutable arbitrary metadata." "Follows the interface described in `convex.asset`."],:name "Basic NFT creation and management"}
#69{:description ["Default actor for `asset.box`." "Implements callable functions for `asset.box` and `convex.asset`."],:name "Asset box actor."}
#70{:description ["A box acts as a holder of arbitrary assets, bundling them together." "Assets are described in `convex.asset` and created using accounts such as `convex.fungible`." "The owner of the box has exclusive rights to put assets in or take assets out." "The box itself is an asset with the designator `[box-actor id]`." "This library uses `asset.box.actor` as default actor. An alternative implementation can be provided if required."],:name "Asset box API."}
#71{:description ["An actor that supports multiple mintable tokens"],:name "Multi-token actor"}
#128{:desc "Convex Foundation USD pre-payment credits",:name "Foundation USD"}
#130{:desc "Convex Foundation GBP pre-payment credits",:name "Foundation GBP"}
#133{:description ["Peace NFT collection actor."],:name "Peace Actor"}
#205{:name "Ash0"}
#207{:description "Scotland's monster coin",:name "Nessie"}