| Status | ERROR | Transaction failed with error |
| Error Message | "Can't convert value of type Address to type Function" | Error message from failed transaction |
| Error Code | :CAST | Argument cannot be cast to the required type |
| Juice Used | 48792 | Computational cost in juice units |
| Fees Paid | 0.000798720
| Transaction fees paid in Convex Coins |
| Stack Trace | ["Trying to get function for expression: ((def ^{:static true} trust (cond ((fn [sym] (get (#9/read %0) 0)) convex.trust) *result* (fail :NOBODY (str \"Could not resolve library name for import: \" convex.trust)))) (def allocator *caller*) (def distributor *caller*) nil (def available-coins 0) (def ^{:callable true} set-available (fn [amount] (do (cond (not (#50/trust/trusted? #50/allocator *caller* :set-available %0)) (fail :TRUST \"Not authorised as allocator\")) (cond (< %0 0) (fail :ARGUMENT \"Negative amount!\")) (def available-coins (int %0))))) (def ^{:callable true} distribute (fn [receiver amount] (do (cond (not (int? %1)) (fail :ARGUMENT \"amount must be an integer\")) (cond (not (#50/trust/trusted? #50/distributor *caller* :distribute %1)) (fail :TRUST \"Not authorised to distribute\")) (cond (> %1 #50/available-coins) (fail :FUNDS \"Insufficient available coins\")) (do (def available-coins (- #50/available-coins %1)) (transfer %0 %1))))) (def ^{:callable true} receive-coin (fn [_ _ _] (accept *offer*))) (def ^{:callable true} withdraw (fn [amount] (do (cond (not (#50/trust/trusted? #50/allocator *caller* :withdraw %0)) (fail :TRUST \"Not authorised to withdraw\")) (transfer *caller* %0)))))" "In core function: eval-as" "In expression: (eval-as #50 ((import convex.trust :as trust) (def allocator *caller*) (def distributor *caller*) (declare available-coins) (def available-coins 0) (defn ^{:callable true} set-available [amount] (if (not ((lookup trust trusted?) allocator *caller* :set-available amount)) (fail :TRUST \"Not authorised as allocator\")) (if (< amount 0) (fail :ARGUMENT \"Negative amount!\")) (set! available-coins (int amount))) (defn ^{:callable true} distribute [receiver amount] (if (not (int? amount)) (fail :ARGUMENT \"amount must be an integer\")) (if (not ((lookup trust trusted?) distributor *caller* :distribute amount)) (fail :TRUST \"Not authorised to distribute\")) (if (> amount available-coins) (fail :FUNDS \"Insufficient available coins\")) (do (set! available-coins (- available-coins amount)) (transfer receiver amount))) (defn ^{:callable true} receive-coin [_ _ _] (accept *offer*)) (defn ^{:callable true} withdraw [amount] (if (not ((lookup trust trusted?) allocator *caller* :withdraw amount)) (fail :TRUST \"Not authorised to withdraw\")) (transfer *caller* amount))))"] | Stack trace for error location |