Convex

Convex

Account #67
Account 68 / 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!
:environment13 value(s)Symbols defined in this account. Typically used to store data or executable code.
:metadata13 value(s)Metadata attached to symbols defined in this account.
:parentnilParent account. This defines fallback values for symbols not defined in this account.
Environment (13)

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

SymbolValueDescription
create(fn [] (let [id #67/counter owner *caller* owned-nfts (cond (get-holding %1) *result* #{}) ] (set-holding %1 (conj %2 %0)) (def counter (inc #67/counter)) %0))"Creates a new NFT with a fresh ID."
quantity-addunionnil
balance(fn [owner] (cond (get-holding %0) *result* #{}))nil
direct-transfer(fn [receiver quantity data] (#67/-direct-transfer *caller* %0 %1))nil
quantity-subset?subset?nil
-direct-transfer(fn [sender receiver quantity] (do (let [q (#67/-qc %2) receiver (address %1) sender-balance (cond (get-holding %0) *result* #{}) _ (cond (subset? %3 %5) *result* (fail :FUNDS "Insufficient NFT balance")) receiver-balance (cond (get-holding %4) *result* #{}) new-sender-balance (difference %5 %3) new-receiver-balance (union %6 %3) ] (set-holding %0 %7) (set-holding %4 %8)) %2))nil
offer(fn [receiver quantity] (let [q (#67/-qc %1) caller-offers (get #67/offers *caller* {}) ] (def offers (assoc #67/offers *caller* (assoc %3 %0 %2)))))nil
offers{}"Map of `owner` -> map of `recipient address` -> `set of NFT ids`"
burn(fn [nft-set] (let [owned-nfts (get-holding *caller*) nft-set (#67/-qc %0) ] (cond (subset? %2 %1) nil (fail :TRUST "Can only burn owned NFTs")) (set-holding *caller* (difference %1 %2)) %2))"Destroys a set of NFTs. NFTs must be owned by the caller."
-qc(fn [q] (cond (set? %0) %0 (int? %0) (hash-set %0) (nil? %0) #{} (fail :ARGUMENT "Invalid NFT quantity")))"Checks a NFT quantity."
counter0"Used for creating NFT ids."
quantity-subdifferencenil
accept(fn [sender quantity] (let [q (#67/-qc %1) sender (address %0) sender-offers (cond (get #67/offers %3) *result* {}) offer (get-in #67/offers (vector %3 *caller*) #{}) _ (cond (subset? %2 %5) *result* (fail :STATE "Insufficient offer to accept")) receiver-balance (cond (get-holding *caller*) *result* #{}) new-offer (difference %5 %2) ] (def offers (assoc #67/offers %3 (assoc %4 *caller* %7))) (#67/-direct-transfer %3 *caller* %2)))nil
Holdings (Empty)

Holdings track token balances and other indexed values by address.

AddressValue