Convex

Convex

Account #135
Account 136 / 14299
FieldValueNotes
Account Key
Identicon for 5abb7143b3a48328300f99c5e0e711f829ce4bba8be328a40de2e410b2496d38
0x5abb7143b3a48328...
Ed25519 public key (null for actors)
Balance
           17.782602997
Convex coin balance
Account Fields
FieldValueDescription
:sequence165Number of transactions executed by this account to date.
:key
Identicon for 5abb7143b3a48328300f99c5e0e711f829ce4bba8be328a40de2e410b2496d38
0x5abb7143b3a48328300f99c5e0e711f829ce4bba8be328a40de2e410b2496d38
Ed25519 public key of this account. If nil, account cannot execute external transactions (e.g. an actor).
:balance
           17.782602997
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#11Account 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!
:environment19 value(s)Symbols defined in this account. Typically used to store data or executable code.
:metadata7 value(s)Metadata attached to symbols defined in this account.
:parentnilParent account. This defines fallback values for symbols not defined in this account.
Environment (19)

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

SymbolValueDescription
dummy#144nil
gateway#171nil
mk-tip-logic(fn [state gateway] (deploy (list do (def actor-name "tipper") (list def gateway %1) (list def state %0) (defn ^{:callable true} add-artifact [artifact] (if (not artifact) (fail :ARGUMENT "Arguments require an artifact") (call state (swap! update artifact merge {:sender *caller*})))) (defn ^{:callable true} add-recipient [artifact recipient] (when recipient (let [tips (call state (deref)) sender (:sender (get tips artifact))] (cond (not (= *caller* sender)) (fail :TRUST (str *caller* " not authorised to add recipient on behalf of " sender)) (not recipient) (fail :ARGUMENT "recipient field is nil") :else (call state (swap! assoc-in [artifact :recipient] recipient)))))) (defn ^{:callable true} add-amount [artifact amount] (let [tips (call state (deref)) sender (:sender (get tips artifact))] (cond (not (= *caller* sender)) (fail :TRUST (str *caller* " not authorised to add amount on behalf of " sender)) (not (> amount 0)) (fail :FUNDS "No tip offered!") :else (do (accept amount) (transfer gateway amount) (call state (swap! assoc-in [artifact :amount] amount)) (return "Thanks for the tip!"))))) (defn ^{:callable true} tip! [tip-map] (let [tips (call state (deref)) artifact (:artifact tip-map) amount (get-in tips [artifact :amount] *offer*) recipient (get-in tips [artifact :recipient] (:recipient tip-map))] (add-artifact artifact) (add-recipient artifact recipient) (add-amount artifact amount))) (def disabled? false) (def admin-account *caller*) (defn ^{:callable true} admin [code] (if disabled? (fail :STATE "Administrative access is permenantly disabled.") (if (not (= *caller* admin-account)) (fail :TRUST (str *caller* " is not authorised to administrate on behalf of admin " admin-account)) (eval code)))))))nil
tipper4#164nil
every-thousand-seconds(fn [] (cond (< 0 #135/a) (do (def a (dec #135/a)) (schedule* 1000000 (compile (every-thousand-seconds)))) nil))nil
mk-state-actor(fn [gateway] (deploy (list do (def actor-name "state") (list def gateway %0) (def state {}) (defn ^{:callable true} swap! [afn & args] (let [user-key *caller*] (def state (assoc state user-key (apply afn (get state user-key {}) args))))) (defn ^{:callable true} gateway-swap! [user-key afn & args] (if (not (= gateway *caller*)) (fail :TRUST "Cannot swap on behalf of gateway " gateway) (def state (assoc state user-key (apply afn (get state user-key {}) args))))) (defn ^{:callable true} deref [] (get state *caller* {})) (defn ^{:callable true} deref-as [as-account] (get state as-account {})) (def admin-account *caller*) (def disabled? false) (defn ^{:callable true} admin [code] (if disabled? (fail :STATE "Administrative access is permenantly disabled.") (if (not (= *caller* admin-account)) (fail :TRUST (str *caller* " is not authorised to administrate on behalf of parent " admin-account)) (eval code)))))))nil
mk-tip-gateway(fn [] (deploy (do (def actor-name "collect-tip") (defn ^{:callable true} receive-coin [sender amount data] (accept amount)) (defn ^{:callable true} collect [state from artifact] (let [tips (call state (deref-as from)) recipient (get-in tips [artifact :recipient])] (if (not ((lookup (resolve convex.trust) trusted?) recipient *caller*)) (fail :TRUST (str *caller* " is not authorised to collect funds on behalf of " recipient " for tips-state: " tips)) (let [amount (or (get-in tips [artifact :amount]) 0)] (call state (gateway-swap! from dissoc artifact)) (transfer *caller* amount))))) (def disabled? false) (def admin-account *caller*) (defn ^{:callable true} admin [code] (if disabled? (fail :STATE "Administrative access is permenantly disabled.") (if (not (= *caller* admin-account)) (fail :TRUST (str *caller* " is not authorised to administrate on behalf of parent " admin-account)) (eval code)))))))nil
state#172nil
hello"world"nil
test-upgradable-actor#138nil
tipper3#151nil
mk-tip-state(fn [state-addy] (deploy (list do (def actor-name "tip-state") (defn ^{:callable true} receive-coin [sender amount data] (accept amount)) (list def state %0) (defn ^{:callable true} collect [from artifact] (let [tips (call state (deref-as from)) recipient (get-in tips [artifact :recipient])] (if (not ((lookup (resolve convex.trust) trusted?) recipient *caller*)) (fail :TRUST (str *caller* " is not authorised to collect funds on behalf of " recipient " for tips-state: " tips)) (let [amount (or (get-in tips [artifact :amount]) 0)] (call state (swap! dissoc artifact)) (transfer *caller* amount))))) (def disabled? false) (def admin-account *caller*) (defn ^{:callable true} admin [code] (if disabled? (fail :STATE "Administrative access is permenantly disabled.") (if (not (= *caller* admin-account)) (fail :TRUST (str *caller* " is not authorised to administrate on behalf of parent " admin-account)) (eval code)))))))nil
mk-tipper(fn [original-caller state] (deploy (list do (def actor-name "tipper") (list def tip-state %1) (def state (lookup tip-state state)) (defn ^{:callable true} add-artifact [artifact] (if (not artifact) (fail :ARGUMENT "Arguments require an artifact") (call state (swap! update artifact merge {:sender *caller*})))) (defn ^{:callable true} add-recipient [artifact recipient] (when recipient (let [tips (call state (deref)) sender (:sender (get tips artifact))] (cond (not (= *caller* sender)) (fail :TRUST (str *caller* " not authorised to add recipient on behalf of " sender)) (not recipient) (fail :ARGUMENT "recipient field is nil") :else (call state (swap! assoc-in [artifact :recipient] recipient)))))) (defn ^{:callable true} add-amount [artifact amount] (let [tips (call state (deref)) sender (:sender (get tips artifact))] (cond (not (= *caller* sender)) (fail :TRUST (str *caller* " not authorised to add amount on behalf of " sender)) (not (> amount 0)) (fail :FUNDS "No tip offered!") :else (do (accept amount) (call state (swap! assoc-in [artifact :amount] amount)) (return "Thanks for the tip!"))))) (defn ^{:callable true} tip! [tip-map] (let [tips (call state (deref)) artifact (:artifact tip-map) amount (get-in tips [artifact :amount] *offer*) recipient (get-in tips [artifact :recipient] (:recipient tip-map))] (add-artifact artifact) (add-recipient artifact recipient) (add-amount artifact amount))) (def disabled? false) (list def original-caller %0) (def admin-account *caller*) (defn ^{:callable true} admin [code] (if disabled? (fail :STATE "Administrative access is permenantly disabled.") (if (not (= *caller* admin-account)) (fail :TRUST (str *caller* " is not authorised to administrate on behalf of admin " admin-account)) (eval code)))))))nil
tipper#173nil
tip-state(fn [] (deploy (do (def actor-name "tip-state") (def state (mk-state-actor)) (defn ^{:callable true} collect [artifact] (let [tips (call state (deref)) recipient (get-in tips [artifact :recipient])] (if (not ((lookup (resolve convex.trust) trusted?) recipient *caller*)) (fail :TRUST (str *caller* " is not authorised to collect funds on behalf of " recipient)) (let [amount (or (get-in tips [artifact :amount]) 0)] (call state (swap! dissoc artifact)) (transfer *caller* amount))))) (def disabled? false) (def parent *caller*) (defn ^{:callable true} admin [code] (if disabled? (fail :STATE "Administrative access is permenantly disabled.") (if (not (= *caller* parent)) (fail :TRUST (str *caller* " is not authorised to administrate on behalf of parent " parent)) (eval code)))))))nil
a0nil
tipper6#170nil
tipper5#167nil
tipper2#148nil
Holdings (Empty)

Holdings track token balances and other indexed values by address.

AddressValue