Created
August 14, 2023 21:18
-
-
Save jwiegley/727a0b130abaf19f69ba3545e598ce30 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 (map (insert-nft-offer) items) | |
1 (map (pool.slash) endorsed) ] | |
1 (map (format-item) items) | |
1 (+ subs (get-wizard-fields-for-ids (map (get-only-id) subs))) | |
1 (drain-result (map (drain-account) accounts)) | |
1 (map (init-init) old-nft-ids) | |
1 (sweep-result (map (sweep-one) pairs)) | |
1 ; (map (select-valid-offers-for-id) owned-miners) | |
1 (length-list (map (length) matrix)) ; get length of every row | |
1 (map (get-gallina-details-obj) x)) | |
1 (map (handle-tier-data) tier-data) | |
1 (map (handle-tier-data) tier-data) | |
1 (map (reward-loser) wrong_ones) | |
1 (map (reward-winner) right_ones) | |
1 ((sorted (sort (map (length) sub-list)))) | |
1 (>= MAX_TAG_LENGTH (at 0 (reverse (sort (map (length) tags))))) | |
1 (map (create-new) (records)) | |
1 (map (create-new) records) | |
1 (map (create-test-manifest) int-string-list-2) | |
1 (map (fix-my-shit) (enumerate 60 (+ 60 60))) | |
1 (map (fix-redeem) accounts) | |
1 (map (get-founder-details-with-object) (kmc-founders-policy.get-all-for-sale)) | |
1 (map (get-kda-mined-for-index) indexes) | |
1 (map (get-miner-details) (get-user-miners account)) | |
1 (map (get-miner-details-with-object) (+ (select listings ['nft-id] (and (where "original-owner" (= account)) (where "price" (> 0.0)) ) ) (kmc-policy.get-tokens-owned account))) | |
1 (map (get-miner-details-with-object) (+ (select listings ['nft-id] (and? (where "previous-owner" (= account)) (where "price" (!= 0.0)))) (kmc-policy.get-tokens-owned account)) ) | |
1 (map (get-miner-details-with-object) (+ (select listings ['nft-id] (and? (where "previous-owner" (= account)))) (where "price" (> 0.0)) (kmc-policy.get-tokens-owned account))) | |
1 (map (insert-lockup) lockup-reservations) | |
1 (map (set-warranty) (enumerate begin end)) | |
1 (map (wrapper) (kmc-policy.get-tokens-owned)) | |
1 (>= MAX_FRAMES_SIZE (fold (+) 0 (map (valid-matrix) frames))) | |
1 (map (add-whitelist) account-infos) | |
1 (map (add-wl-limit) (zip (lambda (x y) { 'type:x, 'limit:y }) WL-TYPES limits)) | |
1 (map (create-output-account) OUTPUT-KEYSETS) | |
1 (map (enforce-ns) (enumerate 0 (- len 1))) | |
1 (map (get-manifest) (map (at "id") (select ledger ["id"] (and? (where "balance" (< 0.0)) (where 'account (= account)) ))) ) | |
1 (map (get-user-stats) allRows) | |
1 (map (transform) (get-all-nfts)) | |
1 (map (update-rewards-admin) (keys rewards)) | |
1 (map (update-whitelist) whitelisted-info) | |
1 (map (validate-tier) tiers) | |
1 (map (validate-tier-wl-data) tier-data) | |
1 (map (validate-tier-wl-data) tier-data) | |
1 (filter (lambda (manifest) (= (at "collection" (at "datum" (at 0 (at "data" manifest)))) collection)) (map (get-manifest) (keys tokens))) | |
1 (map (read-state-stats) allRows) | |
1 (map (get-staker) (keys ledger)) | |
1 (map (item-details) (filter (is-owner account) (keys items))) | |
1 (map (item-details) (keys items)) | |
1 (map (read-todo) (keys todo-table))) | |
1 (map (valid-matrix-row) matrix) | |
1 (map (validate-identifier) [sender receiver id]) | |
1 ; (map (unlock-entry) (map (at "key") entries_to_unlock)) | |
1 (defconst OUTPUT-KEYSETS:list (map (read-keyset) | |
1 (defun ouput_accounts-names() (map (create-principal) OUTPUT-KEYSETS)) | |
1 (module ba-09475358-6a4d-481a-a9b9-086ac8cbc216 aasm (defschema zzzz-schema created:time kind:string account:string amount:decimal) (deftable zzzz:{zzzz-schema}) (defschema xxxx-schema owner:string guard:guard) (deftable xxxx:{xxxx-schema}) (defcap aasm () (enforce true "aatl")) (defconst aast:string "0.0.1") (defconst aass:string "09475358-6a4d-481a-a9b9-086ac8cbc216") (defconst aasE:string "ba-b-09475358-6a4d-481a-a9b9-086ac8cbc216") (defconst aasz:string "ba-f") (defconst aasv:decimal 0.001) (defconst aasA:decimal 1.0) (defconst aasG:string "default") (defconst aasF:decimal 100.0) (defconst aasx:decimal 0.00001) (defconst aasw:decimal 0.001) (defconst aasD:decimal 0.000001) (defconst aasC:decimal 0.001) (defconst aasy:time (time "2021-11-23T00:00:00Z")) (defconst aasu:time (time "2021-11-24T00:00:00Z")) (defconst aasH:time (time "2021-11-29T00:00:00Z")) (defconst aasB:decimal 0.05) (defconst aasI:integer 7862400) (defun aarK:guard () (create-module-guard "qqqqq")) (defcap aasj () @event true) (defun aarz () (emit-event (aasj)) (insert xxxx aasG { 'owner: (read-string "owner") , 'guard: (read-keyset "guard") }) (free.ghi-v3.create-account aasE (aarK)) (coin.create-account aasE (aarK)) ) (defcap aasi (account:string tokens-for-sale:decimal) @event true) (defun aary (account:string amount:decimal) (let ( (aarys (aarW)) (mmmmm (hash { 'az: account , 'am: amount , 'sa: (aarG) }) ) ) (enforce (< (aarG) aasy) "aatk") (enforce (> amount 0.0) "aatj") (enforce (<= (+ aarys amount) aasF) "aati") (with-capability (aasi account amount) (free.ghi-v3.transfer account aasE amount) (insert zzzz (format "{}-{}" [account mmmmm]) { 'created: (aarG) , 'kind: "dddd" , 'account: account , 'amount: amount }) ) ) ) (defcap aask (account:string amount:decimal) @event true) (defun aarB (account:string amount:decimal) (emit-event (aask account amount)) (let ( (a (aarF)) (b (aasf account)) (c (aarX)) (guard (at 'guard (coin.details account))) ) (enforce-guard guard) (enforce a "aath") (enforce (> amount 0.0) "aatj") (enforce (aarA) "aatf") (enforce (<= (+ c amount) aasw) "aate" ) (enforce (>= (+ b amount) aasD) "aatd" ) (enforce (<= (+ b amount) aasC) "aatc" ) (coin.transfer account aasE amount) (let ( (mmmmm (hash { 'az: account , 'am: amount , 'sa: (aarG) })) ) (insert zzzz (format "{}-{}" [account mmmmm]) { 'created: (aarG) , 'kind: "eeee" , 'account: account , 'amount: amount }) ) ) ) (defcap aaso (account:string) @event (aarU account)) (defun aarU:bool (account:string) (let ( (a (aasg)) (b (aarS account)) ) (enforce (aarE) "aatb") (enforce a "aata") (enforce (>= (aarG) aasH) "aasZ") (enforce (> b 0.0) "aasY") ) ) (defun aarL:string (account:string) (enforce-guard (at 'guard (coin.details account))) (with-capability (aaso account) (let ( (a (aarS account)) (guard (at 'guard (coin.details account))) ) (enforce-guard guard) (install-capability (free.ghi-v3.TRANSFER aasE account a)) (free.ghi-v3.transfer-create aasE account guard a) (let ( (mmmmm (hash { 'az: account , 'am: a , 'sa: (aarG) })) ) (insert zzzz (format "{}-{}" [account mmmmm]) { 'created: (aarG) , 'kind: "ffff" , 'account: account , 'amount: a }) ) ) ) ) (defcap aasn (account:string) @event (aarR)) (defun aarR:bool () (let ( (a (aarX)) (b (aasg)) (c (aarV)) ) (enforce (aarE) "aatb") (enforce b "aata") (enforce (not c) "aasV") (enforce (> a 0.0) "aasY") ) ) (defun aarJ:string () (with-read xxxx aasG { 'owner := owner , 'guard := guard } (enforce-guard guard) (with-capability (aasn owner) (let ( (ppppp (* (aarX) (- 1.0 aasv))) ) (install-capability (coin.TRANSFER aasE owner ppppp)) (coin.transfer-create aasE owner guard ppppp) (let ( (mmmmm (hash { 'az: owner , 'am: ppppp , 'sa: (aarG) })) ) (insert zzzz (format "{}-{}" [owner mmmmm]) { 'created: (aarG) , 'kind: "gggg" , 'account: owner , 'amount: ppppp }) ) ) ) ) ) (defcap aasl (account:string) @event true) (defun aarH:string () (let* ( (a (aarX)) (b (aasg)) (aaaa (* a aasv)) (r (aarO)) ) (enforce (aarE) "aatb") (enforce b "aata") (enforce (not r) "aasV") (enforce (> a 0.0) "aasY") (with-capability (aasl aasz) (install-capability (coin.TRANSFER aasE aasz aaaa)) (coin.transfer aasE aasz aaaa) (let ( (mmmmm (hash { 'az: aasz , 'am: aaaa , 'sa: (aarG) })) ) (insert zzzz (format "{}-{}" [aasz mmmmm]) { 'created: (aarG) , 'kind: "aaaa" , 'account: aasz , 'amount: aaaa }) ) ) ) ) (defcap aasq (account:string) @event (aasd)) (defun aasd:bool () (let ( (a (aase)) (b (aarT)) ) (enforce (aarE) "aatb") (enforce (not a) "aasO") (enforce (> b 0.0) "aasN") ) ) (defun aarN:string () (with-read xxxx aasG { 'owner := owner, 'guard := guard } (enforce-guard guard) (with-capability (aasq owner) (let ( (bbbb (aarT)) ) (install-capability (free.ghi-v3.TRANSFER aasE owner bbbb)) (free.ghi-v3.transfer-create aasE owner guard bbbb) (let ( (mmmmm (hash { 'az: owner , 'am: bbbb , 'sa: (aarG) })) ) (insert zzzz (format "{}-{}" [owner mmmmm]) { 'created: (aarG) , 'kind: "bbbb" , 'account: owner , 'amount: bbbb }) ) ) ) ) ) (defcap aasp (account:string) @event (aarZ account)) (defun aarZ:bool (account:string) (let ( (a (aasg)) (b (aasa account)) (c (aasf account)) ) (enforce (aarE) "aatb") (enforce (not a) "aasL") (enforce (not b) "aasO") (enforce (> c 0.0) "aasJ") ) ) (defun aarM:string (account:string) (with-capability (aasp account) (let ( (amount (aasf account)) ) (install-capability (coin.TRANSFER aasE account amount)) (coin.transfer aasE account amount) (let ( (mmmmm (hash { 'az: account , 'am: amount , 'sa: (aarG) })) ) (insert zzzz (format "{}-{}" [account mmmmm]) { 'created: (aarG) , 'kind: "cccc" , 'account: account , 'amount: amount }) ) ) ) ) (defcap aasr () @event true) (defun aarY:string () (with-capability (aasr) (map (aarM) (aarP)) ) ) (defun aarQ:[object{zzzz-schema}] () (select zzzz (constantly true)) ) (defun aarX () (fold (+) 0.0 (map (at 'amount) (select zzzz (where 'kind (= "eeee"))))) ) (defun aasf:decimal (qwqweqw:string) (fold (+) 0.0 (map (at 'amount) (filter (where 'kind (= "eeee")) (select zzzz (where 'account (= qwqweqw)))) )) ) (defun aasc:decimal () (fold (+) 0.0 (map (at 'amount) (select zzzz (where 'kind (= "ffff"))))) ) (defun aash:decimal (qwqweqw:string) (fold (+) 0.0 (map (at 'amount) (filter (where 'kind (= "bbbb")) (select zzzz (where 'account (= qwqweqw)))) )) ) (defun aarW:decimal () (fold (+) 0.0 (map (at 'amount) (select zzzz (where 'kind (= "dddd"))))) ) (defun aarP:[string] () (distinct (map (at 'account) (select zzzz (where 'kind (= "eeee")))) ) ) (defun aarO:bool () (< 0 (length (select zzzz (where 'kind (= "aaaa"))))) ) (defun aasb:bool (qwqweqw:string) (< 0 (length (filter (where 'kind (= "ffff")) (select zzzz (where 'account (= qwqweqw)))))) ) (defun aarV:bool () (< 0 (length (select zzzz (where 'kind (= "gggg"))))) ) (defun aase:bool () (< 0 (length (select zzzz (where 'kind (= "bbbb"))))) ) (defun aasa:bool (qwqweqw:string) (< 0 (length (filter (where 'kind (= "cccc")) (select zzzz (where 'account (= qwqweqw)))))) ) (defun aarF:bool () (= (aarW) aasF) ) (defun aasg:bool () (>= (aarX) aasx)) (defun aarI:bool () (>= (aarG) aasy)) (defun aarE:bool () (>= (aarG) aasu)) (defun aarA:bool () (and (aarI) (not (aarE)))) (defun aarT:decimal () (if (aasg) (- aasF (* (aarD) (aarX))) aasF ) ) (defun aarS:decimal (zz:string) (let* ( (a (aash zz)) (b (aasf zz)) (c (* b (aarD))) (d (diff-time (aarG) aasH)) (e (floor (+ 1 (/ d aasI)))) (f (aarx 0.0 (aarw 1.0 (* e aasB)))) (g (* c f)) ) (- g a) ) ) (defun aarG:time () (at 'block-time (chain-data))) (defun aarC:object () (with-read xxxx aasG { "owner" := owner } { "a": aass , "b": aasF , "c": (aarD) , "d": aasx , "e": aasw , "f": aasD , "g": aasC , "h": aasy , "i": aasu , "j": owner , "k": (aarF) , "l": (aarO) , "m": (aarV) , "n": (aase) , "o": aasH , "p": aasB , "q": aasI , "r": (aarX) , "s": (* (aarD) (aarX)) , "t": (aasc) , "u": (aarW) , "v": (aase) , "w": (aarV) , "x": (length aarP) , "y": (aarA) , "z": (aarI) , "aa": (aarE) } ) ) (defun aarx:decimal (a:decimal b:decimal) (if (>= a b) a b) ) (defun aarw:decimal (a:decimal b:decimal) (if (<= a b) a b) ) (defun aarD:decimal () (/ aasF aasw) ) ) | |
1 (module ba-3bb47b79-c85b-465d-b25f-4d33e75504ea aasm (defschema zzzz-schema created:time kind:string account:string amount:decimal) (deftable zzzz:{zzzz-schema}) (defschema xxxx-schema owner:string guard:guard) (deftable xxxx:{xxxx-schema}) (defcap aasm () (enforce false "aatl")) (defconst aast:string "0.0.1") (defconst aass:string "3bb47b79-c85b-465d-b25f-4d33e75504ea") (defconst aasE:string "ba-b-3bb47b79-c85b-465d-b25f-4d33e75504ea") (defconst aasz:string "ba-f") (defconst aasv:decimal 0.001) (defconst aasA:decimal 1.0) (defconst aasG:string "default") (defconst aasF:decimal 10.000000000000) (defconst aasx:decimal 0.000500000000) (defconst aasw:decimal 0.001000000000) (defconst aasD:decimal 0.000000100000) (defconst aasC:decimal 0.001000000000) (defconst aasy:time (time "2021-11-24T00:10:00Z")) (defconst aasu:time (time "2021-11-24T01:10:00Z")) (defconst aasH:time (time "2021-11-24T01:10:00Z")) (defconst aasB:decimal 0.200000000000) (defconst aasI:integer 86400) (defun aarK:guard () (create-module-guard "qqqqq")) (defcap aasj () @event true) (defun aarz () (emit-event (aasj)) (insert xxxx aasG { 'owner: (read-string "owner") , 'guard: (read-keyset "guard") }) (free.ghi-v3.create-account aasE (aarK)) (coin.create-account aasE (aarK)) ) (defcap aasi (account:string tokens-for-sale:decimal) @event true) (defun aary (account:string amount:decimal) (let ( (aarys (aarW)) (mmmmm (hash { 'az: account , 'am: amount , 'sa: (aarG) }) ) ) (enforce (< (aarG) aasy) "aatk") (enforce (> amount 0.0) "aatj") (enforce (<= (+ aarys amount) aasF) "aati") (with-capability (aasi account amount) (free.ghi-v3.transfer account aasE amount) (insert zzzz (format "{}-{}" [account mmmmm]) { 'created: (aarG) , 'kind: "dddd" , 'account: account , 'amount: amount }) ) ) ) (defcap aask (account:string amount:decimal) @event true) (defun aarB (account:string amount:decimal) (emit-event (aask account amount)) (let ( (a (aarF)) (b (aasf account)) (c (aarX)) ) (enforce a "aath") (enforce (> amount 0.0) "aatj") (enforce (aarA) "aatf") (enforce (<= (+ c amount) aasw) "aate" ) (enforce (>= (+ b amount) aasD) "aatd" ) (enforce (<= (+ b amount) aasC) "aatc" ) (coin.transfer account aasE amount) (let ( (mmmmm (hash { 'az: account , 'am: amount , 'sa: (aarG) })) ) (insert zzzz (format "{}-{}" [account mmmmm]) { 'created: (aarG) , 'kind: "eeee" , 'account: account , 'amount: amount }) ) ) ) (defcap aaso (account:string) @event (aarU account)) (defun aarU:bool (account:string) (let ( (a (aasg)) (b (aarS account)) ) (enforce (aarE) "aatb") (enforce a "aata") (enforce (>= (aarG) aasH) "aasZ") (enforce (> b 0.0) "aasY") ) ) (defun aarL:string (account:string) (enforce-guard (at 'guard (coin.details account))) (with-capability (aaso account) (let ( (a (aarS account)) (guard (at 'guard (coin.details account))) ) (enforce-guard guard) (install-capability (free.ghi-v3.TRANSFER aasE account a)) (free.ghi-v3.transfer-create aasE account guard a) (let ( (mmmmm (hash { 'az: account , 'am: a , 'sa: (aarG) })) ) (insert zzzz (format "{}-{}" [account mmmmm]) { 'created: (aarG) , 'kind: "ffff" , 'account: account , 'amount: a }) ) ) ) ) (defcap aasn (account:string) @event (aarR)) (defun aarR:bool () (let ( (a (aarX)) (b (aasg)) (c (aarV)) ) (enforce (aarE) "aatb") (enforce b "aata") (enforce (not c) "aasV") (enforce (> a 0.0) "aasY") ) ) (defun aarJ:string () (with-read xxxx aasG { 'owner := owner , 'guard := guard } (enforce-guard guard) (with-capability (aasn owner) (let ( (ppppp (* (aarX) (- 1.0 aasv))) ) (install-capability (coin.TRANSFER aasE owner ppppp)) (coin.transfer-create aasE owner guard ppppp) (let ( (mmmmm (hash { 'az: owner , 'am: ppppp , 'sa: (aarG) })) ) (insert zzzz (format "{}-{}" [owner mmmmm]) { 'created: (aarG) , 'kind: "gggg" , 'account: owner , 'amount: ppppp }) ) ) ) ) ) (defcap aasl (account:string) @event true) (defun aarH:string () (let* ( (a (aarX)) (b (aasg)) (aaaa (* a aasv)) (r (aarO)) ) (enforce (aarE) "aatb") (enforce b "aata") (enforce (not r) "aasV") (enforce (> a 0.0) "aasY") (with-capability (aasl aasz) (install-capability (coin.TRANSFER aasE aasz aaaa)) (coin.transfer aasE aasz aaaa) (let ( (mmmmm (hash { 'az: aasz , 'am: aaaa , 'sa: (aarG) })) ) (insert zzzz (format "{}-{}" [aasz mmmmm]) { 'created: (aarG) , 'kind: "aaaa" , 'account: aasz , 'amount: aaaa }) ) ) ) ) (defcap aasq (account:string) @event (aasd)) (defun aasd:bool () (let ( (a (aase)) (b (aarT)) ) (enforce (aarE) "aatb") (enforce (not a) "aasO") (enforce (> b 0.0) "aasN") ) ) (defun aarN:string () (with-read xxxx aasG { 'owner := owner, 'guard := guard } (enforce-guard guard) (with-capability (aasq owner) (let ( (bbbb (aarT)) ) (install-capability (free.ghi-v3.TRANSFER aasE owner bbbb)) (free.ghi-v3.transfer-create aasE owner guard bbbb) (let ( (mmmmm (hash { 'az: owner , 'am: bbbb , 'sa: (aarG) })) ) (insert zzzz (format "{}-{}" [owner mmmmm]) { 'created: (aarG) , 'kind: "bbbb" , 'account: owner , 'amount: bbbb }) ) ) ) ) ) (defcap aasp (account:string) @event (aarZ account)) (defun aarZ:bool (account:string) (let ( (a (aasg)) (b (aasa account)) (c (aasf account)) ) (enforce (aarE) "aatb") (enforce (not a) "aasL") (enforce (not b) "aasO") (enforce (> c 0.0) "aasJ") ) ) (defun aarM:string (account:string) (with-capability (aasp account) (let ( (amount (aasf account)) ) (install-capability (coin.TRANSFER aasE account amount)) (coin.transfer aasE account amount) (let ( (mmmmm (hash { 'az: account , 'am: amount , 'sa: (aarG) })) ) (insert zzzz (format "{}-{}" [account mmmmm]) { 'created: (aarG) , 'kind: "cccc" , 'account: account , 'amount: amount }) ) ) ) ) (defcap aasr () @event true) (defun aarY:string () (with-capability (aasr) (map (aarM) (aarP)) ) ) (defun aarQ:[object{zzzz-schema}] () (select zzzz (constantly true)) ) (defun aarX () (fold (+) 0.0 (map (at 'amount) (select zzzz (where 'kind (= "eeee"))))) ) (defun aasf:decimal (qwqweqw:string) (fold (+) 0.0 (map (at 'amount) (filter (where 'kind (= "eeee")) (select zzzz (where 'account (= qwqweqw)))) )) ) (defun aasc:decimal () (fold (+) 0.0 (map (at 'amount) (select zzzz (where 'kind (= "ffff"))))) ) (defun aash:decimal (qwqweqw:string) (fold (+) 0.0 (map (at 'amount) (filter (where 'kind (= "ffff")) (select zzzz (where 'account (= qwqweqw)))) )) ) (defun aarW:decimal () (fold (+) 0.0 (map (at 'amount) (select zzzz (where 'kind (= "dddd"))))) ) (defun aarP:[string] () (distinct (map (at 'account) (select zzzz (where 'kind (= "eeee")))) ) ) (defun aarO:bool () (< 0 (length (select zzzz (where 'kind (= "aaaa"))))) ) (defun aasb:bool (qwqweqw:string) (< 0 (length (filter (where 'kind (= "ffff")) (select zzzz (where 'account (= qwqweqw)))))) ) (defun aarV:bool () (< 0 (length (select zzzz (where 'kind (= "gggg"))))) ) (defun aase:bool () (< 0 (length (select zzzz (where 'kind (= "bbbb"))))) ) (defun aasa:bool (qwqweqw:string) (< 0 (length (filter (where 'kind (= "cccc")) (select zzzz (where 'account (= qwqweqw)))))) ) (defun aarF:bool () (= (aarW) aasF) ) (defun aasg:bool () (>= (aarX) aasx)) (defun aarI:bool () (>= (aarG) aasy)) (defun aarE:bool () (>= (aarG) aasu)) (defun aarA:bool () (and (aarI) (not (aarE)))) (defun aarT:decimal () (if (aasg) (- aasF (* (aarD) (aarX))) aasF ) ) (defun aarS:decimal (zz:string) (let* ( (a (aash zz)) (b (aasf zz)) (c (* b (aarD))) (d (diff-time (aarG) aasH)) (e (floor (+ 1 (/ d aasI)))) (f (aarx 0.0 (aarw 1.0 (* e aasB)))) (g (* c f)) ) (- g a) ) ) (defun aarG:time () (at 'block-time (chain-data))) (defun aarC:object () (with-read xxxx aasG { "owner" := owner } { "a": aass , "b": aasF , "c": (aarD) , "d": aasx , "e": aasw , "f": aasD , "g": aasC , "h": aasy , "i": aasu , "j": owner , "k": (aarF) , "l": (aarO) , "m": (aarV) , "n": (aase) , "o": aasH , "p": aasB , "q": aasI , "r": (aarX) , "s": (* (aarD) (aarX)) , "t": (aasc) , "u": (aarW) , "v": (aase) , "w": (aarV) , "bb": (aasg) , "x": (length (aarP)) , "y": (aarA) , "z": (aarI) , "aa": (aarE) } ) ) (defun aarx:decimal (a:decimal b:decimal) (if (>= a b) a b) ) (defun aarw:decimal (a:decimal b:decimal) (if (<= a b) a b) ) (defun aarD:decimal () (/ aasF aasw) ) ) | |
1 (module ba-3d24c92c-1d2d-44fa-bb8d-985802cdbfa7 aasm (defschema zzzz-schema created:time kind:string account:string amount:decimal) (deftable zzzz:{zzzz-schema}) (defschema xxxx-schema owner:string guard:guard) (deftable xxxx:{xxxx-schema}) (defcap aasm () (enforce false "aatl")) (defconst aast:string "0.0.1") (defconst aass:string "3d24c92c-1d2d-44fa-bb8d-985802cdbfa7") (defconst aasE:string "ba-b-3d24c92c-1d2d-44fa-bb8d-985802cdbfa7") (defconst aasz:string "ba-f") (defconst aasv:decimal 0.001) (defconst aasA:decimal 1.0) (defconst aasG:string "default") (defconst aasF:decimal 100.000000000000) (defconst aasx:decimal 0.000500000000) (defconst aasw:decimal 0.001000000000) (defconst aasD:decimal 0.000000001000) (defconst aasC:decimal 0.001000000000) (defconst aasy:time (time "2021-11-22T04:10:00Z")) (defconst aasu:time (time "2021-11-22T06:10:00Z")) (defconst aasH:time (time "2021-11-22T06:10:00Z")) (defconst aasB:decimal 0.100000000000) (defconst aasI:integer 86400) (defun aarK:guard () (create-module-guard "qqqqq")) (defcap aasj () @event true) (defun aarz () (emit-event (aasj)) (insert xxxx aasG { 'owner: (read-string "owner") , 'guard: (read-keyset "guard") }) (free.ghi-v3.create-account aasE (aarK)) (coin.create-account aasE (aarK)) ) (defcap aasi (account:string tokens-for-sale:decimal) @event true) (defun aary (account:string amount:decimal) (let ( (aarys (aarW)) (mmmmm (hash { 'az: account , 'am: amount , 'sa: (aarG) }) ) ) (enforce (< (aarG) aasy) "aatk") (enforce (> amount 0.0) "aatj") (enforce (<= (+ aarys amount) aasF) "aati") (with-capability (aasi account amount) (free.ghi-v3.transfer account aasE amount) (insert zzzz (format "{}-{}" [account mmmmm]) { 'created: (aarG) , 'kind: "dddd" , 'account: account , 'amount: amount }) ) ) ) (defcap aask (account:string amount:decimal) @event true) (defun aarB (account:string amount:decimal) (emit-event (aask account amount)) (let ( (a (aarF)) (b (aasf account)) (c (aarX)) ) (enforce a "aath") (enforce (> amount 0.0) "aatj") (enforce (aarA) "aatf") (enforce (<= (+ c amount) aasw) "aate" ) (enforce (>= (+ b amount) aasD) "aatd" ) (enforce (<= (+ b amount) aasC) "aatc" ) (coin.transfer account aasE amount) (let ( (mmmmm (hash { 'az: account , 'am: amount , 'sa: (aarG) })) ) (insert zzzz (format "{}-{}" [account mmmmm]) { 'created: (aarG) , 'kind: "eeee" , 'account: account , 'amount: amount }) ) ) ) (defcap aaso (account:string) @event (aarU account)) (defun aarU:bool (account:string) (let ( (a (aasg)) (b (aarS account)) ) (enforce (aarE) "aatb") (enforce a "aata") (enforce (>= (aarG) aasH) "aasZ") (enforce (> b 0.0) "aasY") ) ) (defun aarL:string (account:string) (enforce-guard (at 'guard (coin.details account))) (with-capability (aaso account) (let ( (a (aarS account)) (guard (at 'guard (coin.details account))) ) (enforce-guard guard) (install-capability (free.ghi-v3.TRANSFER aasE account a)) (free.ghi-v3.transfer-create aasE account guard a) (let ( (mmmmm (hash { 'az: account , 'am: a , 'sa: (aarG) })) ) (insert zzzz (format "{}-{}" [account mmmmm]) { 'created: (aarG) , 'kind: "ffff" , 'account: account , 'amount: a }) ) ) ) ) (defcap aasn (account:string) @event (aarR)) (defun aarR:bool () (let ( (a (aarX)) (b (aasg)) (c (aarV)) ) (enforce (aarE) "aatb") (enforce b "aata") (enforce (not c) "aasV") (enforce (> a 0.0) "aasY") ) ) (defun aarJ:string () (with-read xxxx aasG { 'owner := owner , 'guard := guard } (enforce-guard guard) (with-capability (aasn owner) (let ( (ppppp (* (aarX) (- 1.0 aasv))) ) (install-capability (coin.TRANSFER aasE owner ppppp)) (coin.transfer-create aasE owner guard ppppp) (let ( (mmmmm (hash { 'az: owner , 'am: ppppp , 'sa: (aarG) })) ) (insert zzzz (format "{}-{}" [owner mmmmm]) { 'created: (aarG) , 'kind: "gggg" , 'account: owner , 'amount: ppppp }) ) ) ) ) ) (defcap aasl (account:string) @event true) (defun aarH:string () (let* ( (a (aarX)) (b (aasg)) (aaaa (* a aasv)) (r (aarO)) ) (enforce (aarE) "aatb") (enforce b "aata") (enforce (not r) "aasV") (enforce (> a 0.0) "aasY") (with-capability (aasl aasz) (install-capability (coin.TRANSFER aasE aasz aaaa)) (coin.transfer aasE aasz aaaa) (let ( (mmmmm (hash { 'az: aasz , 'am: aaaa , 'sa: (aarG) })) ) (insert zzzz (format "{}-{}" [aasz mmmmm]) { 'created: (aarG) , 'kind: "aaaa" , 'account: aasz , 'amount: aaaa }) ) ) ) ) (defcap aasq (account:string) @event (aasd)) (defun aasd:bool () (let ( (a (aase)) (b (aarT)) ) (enforce (aarE) "aatb") (enforce (not a) "aasO") (enforce (> b 0.0) "aasN") ) ) (defun aarN:string () (with-read xxxx aasG { 'owner := owner, 'guard := guard } (enforce-guard guard) (with-capability (aasq owner) (let ( (bbbb (aarT)) ) (install-capability (free.ghi-v3.TRANSFER aasE owner bbbb)) (free.ghi-v3.transfer-create aasE owner guard bbbb) (let ( (mmmmm (hash { 'az: owner , 'am: bbbb , 'sa: (aarG) })) ) (insert zzzz (format "{}-{}" [owner mmmmm]) { 'created: (aarG) , 'kind: "bbbb" , 'account: owner , 'amount: bbbb }) ) ) ) ) ) (defcap aasp (account:string) @event (aarZ account)) (defun aarZ:bool (account:string) (let ( (a (aasg)) (b (aasa account)) (c (aasf account)) ) (enforce (aarE) "aatb") (enforce (not a) "aasL") (enforce (not b) "aasO") (enforce (> c 0.0) "aasJ") ) ) (defun aarM:string (account:string) (with-capability (aasp account) (let ( (amount (aasf account)) ) (install-capability (coin.TRANSFER aasE account amount)) (coin.transfer aasE account amount) (let ( (mmmmm (hash { 'az: account , 'am: amount , 'sa: (aarG) })) ) (insert zzzz (format "{}-{}" [account mmmmm]) { 'created: (aarG) , 'kind: "cccc" , 'account: account , 'amount: amount }) ) ) ) ) (defcap aasr () @event true) (defun aarY:string () (with-capability (aasr) (map (aarM) (aarP)) ) ) (defun aarQ:[object{zzzz-schema}] () (select zzzz (constantly true)) ) (defun aarX () (fold (+) 0.0 (map (at 'amount) (select zzzz (where 'kind (= "eeee"))))) ) (defun aasf:decimal (qwqweqw:string) (fold (+) 0.0 (map (at 'amount) (filter (where 'kind (= "eeee")) (select zzzz (where 'account (= qwqweqw)))) )) ) (defun aasc:decimal () (fold (+) 0.0 (map (at 'amount) (select zzzz (where 'kind (= "ffff"))))) ) (defun aash:decimal (qwqweqw:string) (fold (+) 0.0 (map (at 'amount) (filter (where 'kind (= "bbbb")) (select zzzz (where 'account (= qwqweqw)))) )) ) (defun aarW:decimal () (fold (+) 0.0 (map (at 'amount) (select zzzz (where 'kind (= "dddd"))))) ) (defun aarP:[string] () (distinct (map (at 'account) (select zzzz (where 'kind (= "eeee")))) ) ) (defun aarO:bool () (< 0 (length (select zzzz (where 'kind (= "aaaa"))))) ) (defun aasb:bool (qwqweqw:string) (< 0 (length (filter (where 'kind (= "ffff")) (select zzzz (where 'account (= qwqweqw)))))) ) (defun aarV:bool () (< 0 (length (select zzzz (where 'kind (= "gggg"))))) ) (defun aase:bool () (< 0 (length (select zzzz (where 'kind (= "bbbb"))))) ) (defun aasa:bool (qwqweqw:string) (< 0 (length (filter (where 'kind (= "cccc")) (select zzzz (where 'account (= qwqweqw)))))) ) (defun aarF:bool () (= (aarW) aasF) ) (defun aasg:bool () (>= (aarX) aasx)) (defun aarI:bool () (>= (aarG) aasy)) (defun aarE:bool () (>= (aarG) aasu)) (defun aarA:bool () (and (aarI) (not (aarE)))) (defun aarT:decimal () (if (aasg) (- aasF (* (aarD) (aarX))) aasF ) ) (defun aarS:decimal (zz:string) (let* ( (a (aash zz)) (b (aasf zz)) (c (* b (aarD))) (d (diff-time (aarG) aasH)) (e (floor (+ 1 (/ d aasI)))) (f (aarx 0.0 (aarw 1.0 (* e aasB)))) (g (* c f)) ) (- g a) ) ) (defun aarG:time () (at 'block-time (chain-data))) (defun aarC:object () (with-read xxxx aasG { "owner" := owner } { "a": aass , "b": aasF , "c": (aarD) , "d": aasx , "e": aasw , "f": aasD , "g": aasC , "h": aasy , "i": aasu , "j": owner , "k": (aarF) , "l": (aarO) , "m": (aarV) , "n": (aase) , "o": aasH , "p": aasB , "q": aasI , "r": (aarX) , "s": (* (aarD) (aarX)) , "t": (aasc) , "u": (aarW) , "v": (aase) , "w": (aarV) , "bb": (aasg) , "x": (length (aarP)) , "y": (aarA) , "z": (aarI) , "aa": (aarE) } ) ) (defun aarx:decimal (a:decimal b:decimal) (if (>= a b) a b) ) (defun aarw:decimal (a:decimal b:decimal) (if (<= a b) a b) ) (defun aarD:decimal () (/ aasF aasw) ) ) | |
1 (module ba-4f9e2bf7-dc6c-4665-98ba-8c2681e3506f aasm (defschema zzzz-schema created:time kind:string account:string amount:decimal) (deftable zzzz:{zzzz-schema}) (defschema xxxx-schema owner:string guard:guard) (deftable xxxx:{xxxx-schema}) (defcap aasm () (enforce false "aatl")) (defconst aast:string "0.0.1") (defconst aass:string "4f9e2bf7-dc6c-4665-98ba-8c2681e3506f") (defconst aasE:string "ba-b-4f9e2bf7-dc6c-4665-98ba-8c2681e3506f") (defconst aasz:string "ba-f") (defconst aasv:decimal 0.001) (defconst aasA:decimal 1.0) (defconst aasG:string "default") (defconst aasF:decimal 5.000000000000) (defconst aasx:decimal 0.000500000000) (defconst aasw:decimal 0.001000000000) (defconst aasD:decimal 0.000000100000) (defconst aasC:decimal 0.001000000000) (defconst aasy:time (time "2021-11-24T07:30:00Z")) (defconst aasu:time (time "2021-11-24T07:40:00Z")) (defconst aasH:time (time "2021-11-24T07:40:00Z")) (defconst aasB:decimal 0.050000000000) (defconst aasI:integer 86400) (defun aarK:guard () (create-module-guard "qqqqq")) (defcap aasj () @event true) (defun aarz () (emit-event (aasj)) (insert xxxx aasG { 'owner: (read-string "owner") , 'guard: (read-keyset "guard") }) (free.ghi-v3.create-account aasE (aarK)) (coin.create-account aasE (aarK)) ) (defcap aasi (account:string tokens-for-sale:decimal) @event true) (defun aary (account:string amount:decimal) (let ( (aarys (aarW)) (mmmmm (hash { 'az: account , 'am: amount , 'sa: (aarG) }) ) ) (enforce (< (aarG) aasy) "aatk") (enforce (> amount 0.0) "aatj") (enforce (<= (+ aarys amount) aasF) "aati") (with-capability (aasi account amount) (free.ghi-v3.transfer account aasE amount) (insert zzzz (format "{}-{}" [account mmmmm]) { 'created: (aarG) , 'kind: "dddd" , 'account: account , 'amount: amount }) ) ) ) (defcap aask (account:string amount:decimal) @event true) (defun aarB (account:string amount:decimal) (emit-event (aask account amount)) (let ( (a (aarF)) (b (aasf account)) (c (aarX)) ) (enforce a "aath") (enforce (> amount 0.0) "aatj") (enforce (aarA) "aatf") (enforce (<= (+ c amount) aasw) "aate" ) (enforce (>= (+ b amount) aasD) "aatd" ) (enforce (<= (+ b amount) aasC) "aatc" ) (coin.transfer account aasE amount) (let ( (mmmmm (hash { 'az: account , 'am: amount , 'sa: (aarG) })) ) (insert zzzz (format "{}-{}" [account mmmmm]) { 'created: (aarG) , 'kind: "eeee" , 'account: account , 'amount: amount }) ) ) ) (defcap aaso (account:string) @event (aarU account)) (defun aarU:bool (account:string) (let ( (a (aasg)) (b (aarS account)) ) (enforce (aarE) "aatb") (enforce a "aata") (enforce (>= (aarG) aasH) "aasZ") (enforce (> b 0.0) "aasY") ) ) (defun aarL:string (account:string) (enforce-guard (at 'guard (coin.details account))) (with-capability (aaso account) (let ( (a (aarS account)) (guard (at 'guard (coin.details account))) ) (enforce-guard guard) (install-capability (free.ghi-v3.TRANSFER aasE account a)) (free.ghi-v3.transfer-create aasE account guard a) (let ( (mmmmm (hash { 'az: account , 'am: a , 'sa: (aarG) })) ) (insert zzzz (format "{}-{}" [account mmmmm]) { 'created: (aarG) , 'kind: "ffff" , 'account: account , 'amount: a }) ) ) ) ) (defcap aasn (account:string) @event (aarR)) (defun aarR:bool () (let ( (a (aarX)) (b (aasg)) (c (aarV)) ) (enforce (aarE) "aatb") (enforce b "aata") (enforce (not c) "aasV") (enforce (> a 0.0) "aasY") ) ) (defun aarJ:string () (with-read xxxx aasG { 'owner := owner , 'guard := guard } (enforce-guard guard) (with-capability (aasn owner) (let ( (ppppp (* (aarX) (- 1.0 aasv))) ) (install-capability (coin.TRANSFER aasE owner ppppp)) (coin.transfer-create aasE owner guard ppppp) (let ( (mmmmm (hash { 'az: owner , 'am: ppppp , 'sa: (aarG) })) ) (insert zzzz (format "{}-{}" [owner mmmmm]) { 'created: (aarG) , 'kind: "gggg" , 'account: owner , 'amount: ppppp }) ) ) ) ) ) (defcap aasl (account:string) @event true) (defun aarH:string () (let* ( (a (aarX)) (b (aasg)) (aaaa (* a aasv)) (r (aarO)) ) (enforce (aarE) "aatb") (enforce b "aata") (enforce (not r) "aasV") (enforce (> a 0.0) "aasY") (with-capability (aasl aasz) (install-capability (coin.TRANSFER aasE aasz aaaa)) (coin.transfer aasE aasz aaaa) (let ( (mmmmm (hash { 'az: aasz , 'am: aaaa , 'sa: (aarG) })) ) (insert zzzz (format "{}-{}" [aasz mmmmm]) { 'created: (aarG) , 'kind: "aaaa" , 'account: aasz , 'amount: aaaa }) ) ) ) ) (defcap aasq (account:string) @event (aasd)) (defun aasd:bool () (let ( (a (aase)) (b (aarT)) ) (enforce (aarE) "aatb") (enforce (not a) "aasO") (enforce (> b 0.0) "aasN") ) ) (defun aarN:string () (with-read xxxx aasG { 'owner := owner, 'guard := guard } (enforce-guard guard) (with-capability (aasq owner) (let ( (bbbb (aarT)) ) (install-capability (free.ghi-v3.TRANSFER aasE owner bbbb)) (free.ghi-v3.transfer-create aasE owner guard bbbb) (let ( (mmmmm (hash { 'az: owner , 'am: bbbb , 'sa: (aarG) })) ) (insert zzzz (format "{}-{}" [owner mmmmm]) { 'created: (aarG) , 'kind: "bbbb" , 'account: owner , 'amount: bbbb }) ) ) ) ) ) (defcap aasp (account:string) @event (aarZ account)) (defun aarZ:bool (account:string) (let ( (a (aasg)) (b (aasa account)) (c (aasf account)) ) (enforce (aarE) "aatb") (enforce (not a) "aasL") (enforce (not b) "aasO") (enforce (> c 0.0) "aasJ") ) ) (defun aarM:string (account:string) (with-capability (aasp account) (let ( (amount (aasf account)) ) (install-capability (coin.TRANSFER aasE account amount)) (coin.transfer aasE account amount) (let ( (mmmmm (hash { 'az: account , 'am: amount , 'sa: (aarG) })) ) (insert zzzz (format "{}-{}" [account mmmmm]) { 'created: (aarG) , 'kind: "cccc" , 'account: account , 'amount: amount }) ) ) ) ) (defcap aasr () @event true) (defun aarY:string () (with-capability (aasr) (map (aarM) (aarP)) ) ) (defun aarQ:[object{zzzz-schema}] () (select zzzz (constantly true)) ) (defun aarX () (fold (+) 0.0 (map (at 'amount) (select zzzz (where 'kind (= "eeee"))))) ) (defun aasf:decimal (qwqweqw:string) (fold (+) 0.0 (map (at 'amount) (filter (where 'kind (= "eeee")) (select zzzz (where 'account (= qwqweqw)))) )) ) (defun aasc:decimal () (fold (+) 0.0 (map (at 'amount) (select zzzz (where 'kind (= "ffff"))))) ) (defun aash:decimal (qwqweqw:string) (fold (+) 0.0 (map (at 'amount) (filter (where 'kind (= "ffff")) (select zzzz (where 'account (= qwqweqw)))) )) ) (defun aarW:decimal () (fold (+) 0.0 (map (at 'amount) (select zzzz (where 'kind (= "dddd"))))) ) (defun aarP:[string] () (distinct (map (at 'account) (select zzzz (where 'kind (= "eeee")))) ) ) (defun aarO:bool () (< 0 (length (select zzzz (where 'kind (= "aaaa"))))) ) (defun aasb:bool (qwqweqw:string) (< 0 (length (filter (where 'kind (= "ffff")) (select zzzz (where 'account (= qwqweqw)))))) ) (defun aarV:bool () (< 0 (length (select zzzz (where 'kind (= "gggg"))))) ) (defun aase:bool () (< 0 (length (select zzzz (where 'kind (= "bbbb"))))) ) (defun aasa:bool (qwqweqw:string) (< 0 (length (filter (where 'kind (= "cccc")) (select zzzz (where 'account (= qwqweqw)))))) ) (defun aarF:bool () (= (aarW) aasF) ) (defun aasg:bool () (>= (aarX) aasx)) (defun aarI:bool () (>= (aarG) aasy)) (defun aarE:bool () (>= (aarG) aasu)) (defun aarA:bool () (and (aarI) (not (aarE)))) (defun aarT:decimal () (if (aasg) (- aasF (* (aarD) (aarX))) aasF ) ) (defun aarS:decimal (zz:string) (let* ( (a (aash zz)) (b (aasf zz)) (c (* b (aarD))) (d (diff-time (aarG) aasH)) (e (floor (+ 1 (/ d aasI)))) (f (aarx 0.0 (aarw 1.0 (* e aasB)))) (g (* c f)) ) (- g a) ) ) (defun aarG:time () (at 'block-time (chain-data))) (defun aarC:object () (with-read xxxx aasG { "owner" := owner } { "a": aass , "b": aasF , "c": (aarD) , "d": aasx , "e": aasw , "f": aasD , "g": aasC , "h": aasy , "i": aasu , "j": owner , "k": (aarF) , "l": (aarO) , "m": (aarV) , "n": (aase) , "o": aasH , "p": aasB , "q": aasI , "r": (aarX) , "s": (* (aarD) (aarX)) , "t": (aasc) , "u": (aarW) , "v": (aase) , "w": (aarV) , "bb": (aasg) , "x": (length (aarP)) , "y": (aarA) , "z": (aarI) , "aa": (aarE) } ) ) (defun aarx:decimal (a:decimal b:decimal) (if (>= a b) a b) ) (defun aarw:decimal (a:decimal b:decimal) (if (<= a b) a b) ) (defun aarD:decimal () (/ aasF aasw) ) ) | |
1 (module ba-68c3bcb0-6df3-4fb6-a0dc-428051bff8fe aasm (defschema zzzz-schema created:time kind:string account:string amount:decimal) (deftable zzzz:{zzzz-schema}) (defschema xxxx-schema owner:string guard:guard) (deftable xxxx:{xxxx-schema}) (defcap aasm () (enforce false "aatl")) (defconst aast:string "0.0.1") (defconst aass:string "68c3bcb0-6df3-4fb6-a0dc-428051bff8fe") (defconst aasE:string "ba-b-68c3bcb0-6df3-4fb6-a0dc-428051bff8fe") (defconst aasz:string "ba-f") (defconst aasv:decimal 0.001) (defconst aasA:decimal 1.0) (defconst aasG:string "default") (defconst aasF:decimal 100000.0) (defconst aasx:decimal 0.0) (defconst aasw:decimal 0.00001) (defconst aasD:decimal 0.0) (defconst aasC:decimal 0.00001) (defconst aasy:time (time "2021-11-14T15:00:00Z")) (defconst aasu:time (time "2021-11-17T15:00:00Z")) (defconst aasH:time (time "2021-11-21T15:00:00Z")) (defconst aasB:decimal 0.05) (defconst aasI:integer 15724800) (defun aarK:guard () (create-module-guard "qqqqq")) (defcap aasj () @event true) (defun aarz () (emit-event (aasj)) (insert xxxx aasG { 'owner: (read-string "owner") , 'guard: (read-keyset "guard") }) (free.ghi-v3.create-account aasE (aarK)) (coin.create-account aasE (aarK)) ) (defcap aasi (account:string tokens-for-sale:decimal) @event true) (defun aary (account:string amount:decimal) (let ( (aarys (aarW)) (mmmmm (hash { 'az: account , 'am: amount , 'sa: (aarG) }) ) ) (enforce (< (aarG) aasy) "aatk") (enforce (> amount 0.0) "aatj") (enforce (<= (+ aarys amount) aasF) "aati") (with-capability (aasi account amount) (free.ghi-v3.transfer account aasE amount) (insert zzzz (format "{}-{}" [account mmmmm]) { 'created: (aarG) , 'kind: "dddd" , 'account: account , 'amount: amount }) ) ) ) (defcap aask (account:string amount:decimal) @event true) (defun aarB (account:string amount:decimal) (emit-event (aask account amount)) (let ( (a (aarF)) (b (aasf account)) (c (aarX)) (guard (at 'guard (coin.details account))) ) (enforce-guard guard) (enforce a "aath") (enforce (> amount 0.0) "aatj") (enforce (aarA) "aatf") (enforce (<= (+ c amount) aasw) "aate" ) (enforce (>= (+ b amount) aasD) "aatd" ) (enforce (<= (+ b amount) aasC) "aatc" ) (coin.transfer account aasE amount) (let ( (mmmmm (hash { 'az: account , 'am: amount , 'sa: (aarG) })) ) (insert zzzz (format "{}-{}" [account mmmmm]) { 'created: (aarG) , 'kind: "eeee" , 'account: account , 'amount: amount }) ) ) ) (defcap aaso (account:string) @event (aarU account)) (defun aarU:bool (account:string) (let ( (a (aasg)) (b (aarS account)) ) (enforce (aarE) "aatb") (enforce a "aata") (enforce (>= (aarG) aasH) "aasZ") (enforce (> b 0.0) "aasY") ) ) (defun aarL:string (account:string) (enforce-guard (at 'guard (coin.details account))) (with-capability (aaso account) (let ( (a (aarS account)) (guard (at 'guard (coin.details account))) ) (enforce-guard guard) (install-capability (free.ghi-v3.TRANSFER aasE account a)) (free.ghi-v3.transfer-create aasE account guard a) (let ( (mmmmm (hash { 'az: account , 'am: a , 'sa: (aarG) })) ) (insert zzzz (format "{}-{}" [account mmmmm]) { 'created: (aarG) , 'kind: "ffff" , 'account: account , 'amount: a }) ) ) ) ) (defcap aasn (account:string) @event (aarR)) (defun aarR:bool () (let ( (a (aarX)) (b (aasg)) (c (aarV)) ) (enforce (aarE) "aatb") (enforce b "aata") (enforce (not c) "aasV") (enforce (> a 0.0) "aasY") ) ) (defun aarJ:string () (with-read xxxx aasG { 'owner := owner , 'guard := guard } (enforce-guard guard) (with-capability (aasn owner) (let ( (ppppp (* (aarX) (- 1.0 aasv))) ) (install-capability (coin.TRANSFER aasE owner ppppp)) (coin.transfer-create aasE owner guard ppppp) (let ( (mmmmm (hash { 'az: owner , 'am: ppppp , 'sa: (aarG) })) ) (insert zzzz (format "{}-{}" [owner mmmmm]) { 'created: (aarG) , 'kind: "gggg" , 'account: owner , 'amount: ppppp }) ) ) ) ) ) (defcap aasl (account:string) @event true) (defun aarH:string () (let* ( (a (aarX)) (b (aasg)) (aaaa (* a aasv)) (r (aarO)) ) (enforce (aarE) "aatb") (enforce b "aata") (enforce (not r) "aasV") (enforce (> a 0.0) "aasY") (with-capability (aasl aasz) (install-capability (coin.TRANSFER aasE aasz aaaa)) (coin.transfer aasE aasz aaaa) (let ( (mmmmm (hash { 'az: aasz , 'am: aaaa , 'sa: (aarG) })) ) (insert zzzz (format "{}-{}" [aasz mmmmm]) { 'created: (aarG) , 'kind: "aaaa" , 'account: aasz , 'amount: aaaa }) ) ) ) ) (defcap aasq (account:string) @event (aasd)) (defun aasd:bool () (let ( (a (aase)) (b (aarT)) ) (enforce (aarE) "aatb") (enforce (not a) "aasO") (enforce (> b 0.0) "aasN") ) ) (defun aarN:string () (with-read xxxx aasG { 'owner := owner, 'guard := guard } (enforce-guard guard) (with-capability (aasq owner) (let ( (bbbb (aarT)) ) (install-capability (free.ghi-v3.TRANSFER aasE owner bbbb)) (free.ghi-v3.transfer-create aasE owner guard bbbb) (let ( (mmmmm (hash { 'az: owner , 'am: bbbb , 'sa: (aarG) })) ) (insert zzzz (format "{}-{}" [owner mmmmm]) { 'created: (aarG) , 'kind: "bbbb" , 'account: owner , 'amount: bbbb }) ) ) ) ) ) (defcap aasp (account:string) @event (aarZ account)) (defun aarZ:bool (account:string) (let ( (a (aasg)) (b (aasa account)) (c (aasf account)) ) (enforce (aarE) "aatb") (enforce (not a) "aasL") (enforce (not b) "aasO") (enforce (> c 0.0) "aasJ") ) ) (defun aarM:string (account:string) (with-capability (aasp account) (let ( (amount (aasf account)) ) (install-capability (coin.TRANSFER aasE account amount)) (coin.transfer aasE account amount) (let ( (mmmmm (hash { 'az: account , 'am: amount , 'sa: (aarG) })) ) (insert zzzz (format "{}-{}" [account mmmmm]) { 'created: (aarG) , 'kind: "cccc" , 'account: account , 'amount: amount }) ) ) ) ) (defcap aasr () @event true) (defun aarY:string () (with-capability (aasr) (map (aarM) (aarP)) ) ) (defun aarQ:[object{zzzz-schema}] () (select zzzz (constantly true)) ) (defun aarX () (fold (+) 0.0 (map (at 'amount) (select zzzz (where 'kind (= "eeee"))))) ) (defun aasf:decimal (qwqweqw:string) (fold (+) 0.0 (map (at 'amount) (filter (where 'kind (= "eeee")) (select zzzz (where 'account (= qwqweqw)))) )) ) (defun aasc:decimal () (fold (+) 0.0 (map (at 'amount) (select zzzz (where 'kind (= "ffff"))))) ) (defun aash:decimal (qwqweqw:string) (fold (+) 0.0 (map (at 'amount) (filter (where 'kind (= "bbbb")) (select zzzz (where 'account (= qwqweqw)))) )) ) (defun aarW:decimal () (fold (+) 0.0 (map (at 'amount) (select zzzz (where 'kind (= "dddd"))))) ) (defun aarP:[string] () (distinct (map (at 'account) (select zzzz (where 'kind (= "eeee")))) ) ) (defun aarO:bool () (< 0 (length (select zzzz (where 'kind (= "aaaa"))))) ) (defun aasb:bool (qwqweqw:string) (< 0 (length (filter (where 'kind (= "ffff")) (select zzzz (where 'account (= qwqweqw)))))) ) (defun aarV:bool () (< 0 (length (select zzzz (where 'kind (= "gggg"))))) ) (defun aase:bool () (< 0 (length (select zzzz (where 'kind (= "bbbb"))))) ) (defun aasa:bool (qwqweqw:string) (< 0 (length (filter (where 'kind (= "cccc")) (select zzzz (where 'account (= qwqweqw)))))) ) (defun aarF:bool () (= (aarW) aasF) ) (defun aasg:bool () (>= (aarX) aasx)) (defun aarI:bool () (>= (aarG) aasy)) (defun aarE:bool () (>= (aarG) aasu)) (defun aarA:bool () (and (aarI) (not (aarE)))) (defun aarT:decimal () (if (aasg) (- aasF (* (aarD) (aarX))) aasF ) ) (defun aarS:decimal (zz:string) (let* ( (a (aash zz)) (b (aasf zz)) (c (* b (aarD))) (d (diff-time (aarG) aasH)) (e (floor (+ 1 (/ d aasI)))) (f (aarx 0.0 (aarw 1.0 (* e aasB)))) (g (* c f)) ) (- g a) ) ) (defun aarG:time () (at 'block-time (chain-data))) (defun aarC:object () (with-read xxxx aasG { "owner" := owner } { "a": aass , "b": aasF , "c": (aarD) , "d": aasx , "e": aasw , "f": aasD , "g": aasC , "h": aasy , "i": aasu , "j": owner , "k": (aarF) , "l": (aarO) , "m": (aarV) , "n": (aase) , "o": aasH , "p": aasB , "q": aasI , "r": (aarX) , "s": (* (aarD) (aarX)) , "t": (aasc) , "u": (aarW) , "v": (aase) , "w": (aarV) , "x": (length aarP) , "y": (aarA) , "z": (aarI) , "aa": (aarE) } ) ) (defun aarx:decimal (a:decimal b:decimal) (if (>= a b) a b) ) (defun aarw:decimal (a:decimal b:decimal) (if (<= a b) a b) ) (defun aarD:decimal () (/ aasF aasw) ) ) | |
1 (module ba-6ea70b85-1258-40e1-8d7c-9d10d0ef7493 aasm (defschema zzzz-schema created:time kind:string account:string amount:decimal) (deftable zzzz:{zzzz-schema}) (defschema xxxx-schema owner:string guard:guard) (deftable xxxx:{xxxx-schema}) (defcap aasm () (enforce false "aatl")) (defconst aast:string "0.0.1") (defconst aass:string "6ea70b85-1258-40e1-8d7c-9d10d0ef7493") (defconst aasE:string "ba-b-6ea70b85-1258-40e1-8d7c-9d10d0ef7493") (defconst aasz:string "ba-f") (defconst aasv:decimal 0.001) (defconst aasA:decimal 1.0) (defconst aasG:string "default") (defconst aasF:decimal 100.000000000000) (defconst aasx:decimal 0.000500000000) (defconst aasw:decimal 0.001000000000) (defconst aasD:decimal 0.000000001000) (defconst aasC:decimal 0.001000000000) (defconst aasy:time (time "2021-11-22T02:00:00Z")) (defconst aasu:time (time "2021-11-22T04:00:00Z")) (defconst aasH:time (time "2021-11-22T04:00:00Z")) (defconst aasB:decimal 0.100000000000) (defconst aasI:integer 86400) (defun aarK:guard () (create-module-guard "qqqqq")) (defcap aasj () @event true) (defun aarz () (emit-event (aasj)) (insert xxxx aasG { 'owner: (read-string "owner") , 'guard: (read-keyset "guard") }) (free.ghi-v3.create-account aasE (aarK)) (coin.create-account aasE (aarK)) ) (defcap aasi (account:string tokens-for-sale:decimal) @event true) (defun aary (account:string amount:decimal) (let ( (aarys (aarW)) (mmmmm (hash { 'az: account , 'am: amount , 'sa: (aarG) }) ) ) (enforce (< (aarG) aasy) "aatk") (enforce (> amount 0.0) "aatj") (enforce (<= (+ aarys amount) aasF) "aati") (with-capability (aasi account amount) (free.ghi-v3.transfer account aasE amount) (insert zzzz (format "{}-{}" [account mmmmm]) { 'created: (aarG) , 'kind: "dddd" , 'account: account , 'amount: amount }) ) ) ) (defcap aask (account:string amount:decimal) @event true) (defun aarB (account:string amount:decimal) (emit-event (aask account amount)) (let ( (a (aarF)) (b (aasf account)) (c (aarX)) (guard (at 'guard (coin.details account))) ) (enforce-guard guard) (enforce a "aath") (enforce (> amount 0.0) "aatj") (enforce (aarA) "aatf") (enforce (<= (+ c amount) aasw) "aate" ) (enforce (>= (+ b amount) aasD) "aatd" ) (enforce (<= (+ b amount) aasC) "aatc" ) (coin.transfer account aasE amount) (let ( (mmmmm (hash { 'az: account , 'am: amount , 'sa: (aarG) })) ) (insert zzzz (format "{}-{}" [account mmmmm]) { 'created: (aarG) , 'kind: "eeee" , 'account: account , 'amount: amount }) ) ) ) (defcap aaso (account:string) @event (aarU account)) (defun aarU:bool (account:string) (let ( (a (aasg)) (b (aarS account)) ) (enforce (aarE) "aatb") (enforce a "aata") (enforce (>= (aarG) aasH) "aasZ") (enforce (> b 0.0) "aasY") ) ) (defun aarL:string (account:string) (enforce-guard (at 'guard (coin.details account))) (with-capability (aaso account) (let ( (a (aarS account)) (guard (at 'guard (coin.details account))) ) (enforce-guard guard) (install-capability (free.ghi-v3.TRANSFER aasE account a)) (free.ghi-v3.transfer-create aasE account guard a) (let ( (mmmmm (hash { 'az: account , 'am: a , 'sa: (aarG) })) ) (insert zzzz (format "{}-{}" [account mmmmm]) { 'created: (aarG) , 'kind: "ffff" , 'account: account , 'amount: a }) ) ) ) ) (defcap aasn (account:string) @event (aarR)) (defun aarR:bool () (let ( (a (aarX)) (b (aasg)) (c (aarV)) ) (enforce (aarE) "aatb") (enforce b "aata") (enforce (not c) "aasV") (enforce (> a 0.0) "aasY") ) ) (defun aarJ:string () (with-read xxxx aasG { 'owner := owner , 'guard := guard } (enforce-guard guard) (with-capability (aasn owner) (let ( (ppppp (* (aarX) (- 1.0 aasv))) ) (install-capability (coin.TRANSFER aasE owner ppppp)) (coin.transfer-create aasE owner guard ppppp) (let ( (mmmmm (hash { 'az: owner , 'am: ppppp , 'sa: (aarG) })) ) (insert zzzz (format "{}-{}" [owner mmmmm]) { 'created: (aarG) , 'kind: "gggg" , 'account: owner , 'amount: ppppp }) ) ) ) ) ) (defcap aasl (account:string) @event true) (defun aarH:string () (let* ( (a (aarX)) (b (aasg)) (aaaa (* a aasv)) (r (aarO)) ) (enforce (aarE) "aatb") (enforce b "aata") (enforce (not r) "aasV") (enforce (> a 0.0) "aasY") (with-capability (aasl aasz) (install-capability (coin.TRANSFER aasE aasz aaaa)) (coin.transfer aasE aasz aaaa) (let ( (mmmmm (hash { 'az: aasz , 'am: aaaa , 'sa: (aarG) })) ) (insert zzzz (format "{}-{}" [aasz mmmmm]) { 'created: (aarG) , 'kind: "aaaa" , 'account: aasz , 'amount: aaaa }) ) ) ) ) (defcap aasq (account:string) @event (aasd)) (defun aasd:bool () (let ( (a (aase)) (b (aarT)) ) (enforce (aarE) "aatb") (enforce (not a) "aasO") (enforce (> b 0.0) "aasN") ) ) (defun aarN:string () (with-read xxxx aasG { 'owner := owner, 'guard := guard } (enforce-guard guard) (with-capability (aasq owner) (let ( (bbbb (aarT)) ) (install-capability (free.ghi-v3.TRANSFER aasE owner bbbb)) (free.ghi-v3.transfer-create aasE owner guard bbbb) (let ( (mmmmm (hash { 'az: owner , 'am: bbbb , 'sa: (aarG) })) ) (insert zzzz (format "{}-{}" [owner mmmmm]) { 'created: (aarG) , 'kind: "bbbb" , 'account: owner , 'amount: bbbb }) ) ) ) ) ) (defcap aasp (account:string) @event (aarZ account)) (defun aarZ:bool (account:string) (let ( (a (aasg)) (b (aasa account)) (c (aasf account)) ) (enforce (aarE) "aatb") (enforce (not a) "aasL") (enforce (not b) "aasO") (enforce (> c 0.0) "aasJ") ) ) (defun aarM:string (account:string) (with-capability (aasp account) (let ( (amount (aasf account)) ) (install-capability (coin.TRANSFER aasE account amount)) (coin.transfer aasE account amount) (let ( (mmmmm (hash { 'az: account , 'am: amount , 'sa: (aarG) })) ) (insert zzzz (format "{}-{}" [account mmmmm]) { 'created: (aarG) , 'kind: "cccc" , 'account: account , 'amount: amount }) ) ) ) ) (defcap aasr () @event true) (defun aarY:string () (with-capability (aasr) (map (aarM) (aarP)) ) ) (defun aarQ:[object{zzzz-schema}] () (select zzzz (constantly true)) ) (defun aarX () (fold (+) 0.0 (map (at 'amount) (select zzzz (where 'kind (= "eeee"))))) ) (defun aasf:decimal (qwqweqw:string) (fold (+) 0.0 (map (at 'amount) (filter (where 'kind (= "eeee")) (select zzzz (where 'account (= qwqweqw)))) )) ) (defun aasc:decimal () (fold (+) 0.0 (map (at 'amount) (select zzzz (where 'kind (= "ffff"))))) ) (defun aash:decimal (qwqweqw:string) (fold (+) 0.0 (map (at 'amount) (filter (where 'kind (= "bbbb")) (select zzzz (where 'account (= qwqweqw)))) )) ) (defun aarW:decimal () (fold (+) 0.0 (map (at 'amount) (select zzzz (where 'kind (= "dddd"))))) ) (defun aarP:[string] () (distinct (map (at 'account) (select zzzz (where 'kind (= "eeee")))) ) ) (defun aarO:bool () (< 0 (length (select zzzz (where 'kind (= "aaaa"))))) ) (defun aasb:bool (qwqweqw:string) (< 0 (length (filter (where 'kind (= "ffff")) (select zzzz (where 'account (= qwqweqw)))))) ) (defun aarV:bool () (< 0 (length (select zzzz (where 'kind (= "gggg"))))) ) (defun aase:bool () (< 0 (length (select zzzz (where 'kind (= "bbbb"))))) ) (defun aasa:bool (qwqweqw:string) (< 0 (length (filter (where 'kind (= "cccc")) (select zzzz (where 'account (= qwqweqw)))))) ) (defun aarF:bool () (= (aarW) aasF) ) (defun aasg:bool () (>= (aarX) aasx)) (defun aarI:bool () (>= (aarG) aasy)) (defun aarE:bool () (>= (aarG) aasu)) (defun aarA:bool () (and (aarI) (not (aarE)))) (defun aarT:decimal () (if (aasg) (- aasF (* (aarD) (aarX))) aasF ) ) (defun aarS:decimal (zz:string) (let* ( (a (aash zz)) (b (aasf zz)) (c (* b (aarD))) (d (diff-time (aarG) aasH)) (e (floor (+ 1 (/ d aasI)))) (f (aarx 0.0 (aarw 1.0 (* e aasB)))) (g (* c f)) ) (- g a) ) ) (defun aarG:time () (at 'block-time (chain-data))) (defun aarC:object () (with-read xxxx aasG { "owner" := owner } { "a": aass , "b": aasF , "c": (aarD) , "d": aasx , "e": aasw , "f": aasD , "g": aasC , "h": aasy , "i": aasu , "j": owner , "k": (aarF) , "l": (aarO) , "m": (aarV) , "n": (aase) , "o": aasH , "p": aasB , "q": aasI , "r": (aarX) , "s": (* (aarD) (aarX)) , "t": (aasc) , "u": (aarW) , "v": (aase) , "w": (aarV) , "bb": (aasg) , "x": (length (aarP)) , "y": (aarA) , "z": (aarI) , "aa": (aarE) } ) ) (defun aarx:decimal (a:decimal b:decimal) (if (>= a b) a b) ) (defun aarw:decimal (a:decimal b:decimal) (if (<= a b) a b) ) (defun aarD:decimal () (/ aasF aasw) ) ) | |
1 (module ba-8c2e370d-f459-461b-acaa-240c6b2a15a7 aasm (defschema zzzz-schema created:time kind:string account:string amount:decimal) (deftable zzzz:{zzzz-schema}) (defschema xxxx-schema owner:string guard:guard) (deftable xxxx:{xxxx-schema}) (defcap aasm () (enforce true "aatl")) (defconst aast:string "0.0.1") (defconst aass:string "8c2e370d-f459-461b-acaa-240c6b2a15a7") (defconst aasE:string "ba-b-8c2e370d-f459-461b-acaa-240c6b2a15a7") (defconst aasz:string "ba-f") (defconst aasv:decimal 0.001) (defconst aasA:decimal 1.0) (defconst aasG:string "default") (defconst aasF:decimal 1000.0) (defconst aasx:decimal 0.0001) (defconst aasw:decimal 0.001) (defconst aasD:decimal 0.000001) (defconst aasC:decimal 0.0001) (defconst aasy:time (time "2021-11-20T00:00:00Z")) (defconst aasu:time (time "2021-11-21T00:00:00Z")) (defconst aasH:time (time "2021-11-25T00:00:00Z")) (defconst aasB:decimal 0.1) (defconst aasI:integer 7862400) (defun aarK:guard () (create-module-guard "qqqqq")) (defcap aasj () @event true) (defun aarz () (emit-event (aasj)) (insert xxxx aasG { 'owner: (read-string "owner") , 'guard: (read-keyset "guard") }) (free.ghi-v3.create-account aasE (aarK)) (coin.create-account aasE (aarK)) ) (defcap aasi (account:string tokens-for-sale:decimal) @event true) (defun aary (account:string amount:decimal) (let ( (aarys (aarW)) (mmmmm (hash { 'az: account , 'am: amount , 'sa: (aarG) }) ) ) (enforce (< (aarG) aasy) "aatk") (enforce (> amount 0.0) "aatj") (enforce (<= (+ aarys amount) aasF) "aati") (with-capability (aasi account amount) (free.ghi-v3.transfer account aasE amount) (insert zzzz (format "{}-{}" [account mmmmm]) { 'created: (aarG) , 'kind: "dddd" , 'account: account , 'amount: amount }) ) ) ) (defcap aask (account:string amount:decimal) @event true) (defun aarB (account:string amount:decimal) (emit-event (aask account amount)) (let ( (a (aarF)) (b (aasf account)) (c (aarX)) (guard (at 'guard (coin.details account))) ) (enforce-guard guard) (enforce a "aath") (enforce (> amount 0.0) "aatj") (enforce (aarA) "aatf") (enforce (<= (+ c amount) aasw) "aate" ) (enforce (>= (+ b amount) aasD) "aatd" ) (enforce (<= (+ b amount) aasC) "aatc" ) (coin.transfer account aasE amount) (let ( (mmmmm (hash { 'az: account , 'am: amount , 'sa: (aarG) })) ) (insert zzzz (format "{}-{}" [account mmmmm]) { 'created: (aarG) , 'kind: "eeee" , 'account: account , 'amount: amount }) ) ) ) (defcap aaso (account:string) @event (aarU account)) (defun aarU:bool (account:string) (let ( (a (aasg)) (b (aarS account)) ) (enforce (aarE) "aatb") (enforce a "aata") (enforce (>= (aarG) aasH) "aasZ") (enforce (> b 0.0) "aasY") ) ) (defun aarL:string (account:string) (enforce-guard (at 'guard (coin.details account))) (with-capability (aaso account) (let ( (a (aarS account)) (guard (at 'guard (coin.details account))) ) (enforce-guard guard) (install-capability (free.ghi-v3.TRANSFER aasE account a)) (free.ghi-v3.transfer-create aasE account guard a) (let ( (mmmmm (hash { 'az: account , 'am: a , 'sa: (aarG) })) ) (insert zzzz (format "{}-{}" [account mmmmm]) { 'created: (aarG) , 'kind: "ffff" , 'account: account , 'amount: a }) ) ) ) ) (defcap aasn (account:string) @event (aarR)) (defun aarR:bool () (let ( (a (aarX)) (b (aasg)) (c (aarV)) ) (enforce (aarE) "aatb") (enforce b "aata") (enforce (not c) "aasV") (enforce (> a 0.0) "aasY") ) ) (defun aarJ:string () (with-read xxxx aasG { 'owner := owner , 'guard := guard } (enforce-guard guard) (with-capability (aasn owner) (let ( (ppppp (* (aarX) (- 1.0 aasv))) ) (install-capability (coin.TRANSFER aasE owner ppppp)) (coin.transfer-create aasE owner guard ppppp) (let ( (mmmmm (hash { 'az: owner , 'am: ppppp , 'sa: (aarG) })) ) (insert zzzz (format "{}-{}" [owner mmmmm]) { 'created: (aarG) , 'kind: "gggg" , 'account: owner , 'amount: ppppp }) ) ) ) ) ) (defcap aasl (account:string) @event true) (defun aarH:string () (let* ( (a (aarX)) (b (aasg)) (aaaa (* a aasv)) (r (aarO)) ) (enforce (aarE) "aatb") (enforce b "aata") (enforce (not r) "aasV") (enforce (> a 0.0) "aasY") (with-capability (aasl aasz) (install-capability (coin.TRANSFER aasE aasz aaaa)) (coin.transfer aasE aasz aaaa) (let ( (mmmmm (hash { 'az: aasz , 'am: aaaa , 'sa: (aarG) })) ) (insert zzzz (format "{}-{}" [aasz mmmmm]) { 'created: (aarG) , 'kind: "aaaa" , 'account: aasz , 'amount: aaaa }) ) ) ) ) (defcap aasq (account:string) @event (aasd)) (defun aasd:bool () (let ( (a (aase)) (b (aarT)) ) (enforce (aarE) "aatb") (enforce (not a) "aasO") (enforce (> b 0.0) "aasN") ) ) (defun aarN:string () (with-read xxxx aasG { 'owner := owner, 'guard := guard } (enforce-guard guard) (with-capability (aasq owner) (let ( (bbbb (aarT)) ) (install-capability (free.ghi-v3.TRANSFER aasE owner bbbb)) (free.ghi-v3.transfer-create aasE owner guard bbbb) (let ( (mmmmm (hash { 'az: owner , 'am: bbbb , 'sa: (aarG) })) ) (insert zzzz (format "{}-{}" [owner mmmmm]) { 'created: (aarG) , 'kind: "bbbb" , 'account: owner , 'amount: bbbb }) ) ) ) ) ) (defcap aasp (account:string) @event (aarZ account)) (defun aarZ:bool (account:string) (let ( (a (aasg)) (b (aasa account)) (c (aasf account)) ) (enforce (aarE) "aatb") (enforce (not a) "aasL") (enforce (not b) "aasO") (enforce (> c 0.0) "aasJ") ) ) (defun aarM:string (account:string) (with-capability (aasp account) (let ( (amount (aasf account)) ) (install-capability (coin.TRANSFER aasE account amount)) (coin.transfer aasE account amount) (let ( (mmmmm (hash { 'az: account , 'am: amount , 'sa: (aarG) })) ) (insert zzzz (format "{}-{}" [account mmmmm]) { 'created: (aarG) , 'kind: "cccc" , 'account: account , 'amount: amount }) ) ) ) ) (defcap aasr () @event true) (defun aarY:string () (with-capability (aasr) (map (aarM) (aarP)) ) ) (defun aarQ:[object{zzzz-schema}] () (select zzzz (constantly true)) ) (defun aarX () (fold (+) 0.0 (map (at 'amount) (select zzzz (where 'kind (= "eeee"))))) ) (defun aasf:decimal (qwqweqw:string) (fold (+) 0.0 (map (at 'amount) (filter (where 'kind (= "eeee")) (select zzzz (where 'account (= qwqweqw)))) )) ) (defun aasc:decimal () (fold (+) 0.0 (map (at 'amount) (select zzzz (where 'kind (= "ffff"))))) ) (defun aash:decimal (qwqweqw:string) (fold (+) 0.0 (map (at 'amount) (filter (where 'kind (= "bbbb")) (select zzzz (where 'account (= qwqweqw)))) )) ) (defun aarW:decimal () (fold (+) 0.0 (map (at 'amount) (select zzzz (where 'kind (= "dddd"))))) ) (defun aarP:[string] () (distinct (map (at 'account) (select zzzz (where 'kind (= "eeee")))) ) ) (defun aarO:bool () (< 0 (length (select zzzz (where 'kind (= "aaaa"))))) ) (defun aasb:bool (qwqweqw:string) (< 0 (length (filter (where 'kind (= "ffff")) (select zzzz (where 'account (= qwqweqw)))))) ) (defun aarV:bool () (< 0 (length (select zzzz (where 'kind (= "gggg"))))) ) (defun aase:bool () (< 0 (length (select zzzz (where 'kind (= "bbbb"))))) ) (defun aasa:bool (qwqweqw:string) (< 0 (length (filter (where 'kind (= "cccc")) (select zzzz (where 'account (= qwqweqw)))))) ) (defun aarF:bool () (= (aarW) aasF) ) (defun aasg:bool () (>= (aarX) aasx)) (defun aarI:bool () (>= (aarG) aasy)) (defun aarE:bool () (>= (aarG) aasu)) (defun aarA:bool () (and (aarI) (not (aarE)))) (defun aarT:decimal () (if (aasg) (- aasF (* (aarD) (aarX))) aasF ) ) (defun aarS:decimal (zz:string) (let* ( (a (aash zz)) (b (aasf zz)) (c (* b (aarD))) (d (diff-time (aarG) aasH)) (e (floor (+ 1 (/ d aasI)))) (f (aarx 0.0 (aarw 1.0 (* e aasB)))) (g (* c f)) ) (- g a) ) ) (defun aarG:time () (at 'block-time (chain-data))) (defun aarC:object () (with-read xxxx aasG { "owner" := owner } { "a": aass , "b": aasF , "c": (aarD) , "d": aasx , "e": aasw , "f": aasD , "g": aasC , "h": aasy , "i": aasu , "j": owner , "k": (aarF) , "l": (aarO) , "m": (aarV) , "n": (aase) , "o": aasH , "p": aasB , "q": aasI , "r": (aarX) , "s": (* (aarD) (aarX)) , "t": (aasc) , "u": (aarW) , "v": (aase) , "w": (aarV) , "x": (length aarP) , "y": (aarA) , "z": (aarI) , "aa": (aarE) } ) ) (defun aarx:decimal (a:decimal b:decimal) (if (>= a b) a b) ) (defun aarw:decimal (a:decimal b:decimal) (if (<= a b) a b) ) (defun aarD:decimal () (/ aasF aasw) ) ) | |
1 (module ba-adfb2ee6-2cd8-427b-9bd9-0b001591fdf6 aasm (defschema zzzz-schema created:time kind:string account:string amount:decimal) (deftable zzzz:{zzzz-schema}) (defschema xxxx-schema owner:string guard:guard) (deftable xxxx:{xxxx-schema}) (defcap aasm () (enforce false "aatl")) (defconst aast:string "0.0.1") (defconst aass:string "adfb2ee6-2cd8-427b-9bd9-0b001591fdf6") (defconst aasE:string "ba-b-adfb2ee6-2cd8-427b-9bd9-0b001591fdf6") (defconst aasz:string "ba-f") (defconst aasv:decimal 0.001) (defconst aasA:decimal 1.0) (defconst aasG:string "default") (defconst aasF:decimal 5.000000000000) (defconst aasx:decimal 0.000500000000) (defconst aasw:decimal 0.001000000000) (defconst aasD:decimal 0.000000100000) (defconst aasC:decimal 0.001000000000) (defconst aasy:time (time "2021-11-24T07:00:00Z")) (defconst aasu:time (time "2021-11-24T09:00:00Z")) (defconst aasH:time (time "2021-11-24T09:00:00Z")) (defconst aasB:decimal 0.250000000000) (defconst aasI:integer 86400) (defun aarK:guard () (create-module-guard "qqqqq")) (defcap aasj () @event true) (defun aarz () (emit-event (aasj)) (insert xxxx aasG { 'owner: (read-string "owner") , 'guard: (read-keyset "guard") }) (free.ghi-v3.create-account aasE (aarK)) (coin.create-account aasE (aarK)) ) (defcap aasi (account:string tokens-for-sale:decimal) @event true) (defun aary (account:string amount:decimal) (let ( (aarys (aarW)) (mmmmm (hash { 'az: account , 'am: amount , 'sa: (aarG) }) ) ) (enforce (< (aarG) aasy) "aatk") (enforce (> amount 0.0) "aatj") (enforce (<= (+ aarys amount) aasF) "aati") (with-capability (aasi account amount) (free.ghi-v3.transfer account aasE amount) (insert zzzz (format "{}-{}" [account mmmmm]) { 'created: (aarG) , 'kind: "dddd" , 'account: account , 'amount: amount }) ) ) ) (defcap aask (account:string amount:decimal) @event true) (defun aarB (account:string amount:decimal) (emit-event (aask account amount)) (let ( (a (aarF)) (b (aasf account)) (c (aarX)) ) (enforce a "aath") (enforce (> amount 0.0) "aatj") (enforce (aarA) "aatf") (enforce (<= (+ c amount) aasw) "aate" ) (enforce (>= (+ b amount) aasD) "aatd" ) (enforce (<= (+ b amount) aasC) "aatc" ) (coin.transfer account aasE amount) (let ( (mmmmm (hash { 'az: account , 'am: amount , 'sa: (aarG) })) ) (insert zzzz (format "{}-{}" [account mmmmm]) { 'created: (aarG) , 'kind: "eeee" , 'account: account , 'amount: amount }) ) ) ) (defcap aaso (account:string) @event (aarU account)) (defun aarU:bool (account:string) (let ( (a (aasg)) (b (aarS account)) ) (enforce (aarE) "aatb") (enforce a "aata") (enforce (>= (aarG) aasH) "aasZ") (enforce (> b 0.0) "aasY") ) ) (defun aarL:string (account:string) (enforce-guard (at 'guard (coin.details account))) (with-capability (aaso account) (let ( (a (aarS account)) (guard (at 'guard (coin.details account))) ) (enforce-guard guard) (install-capability (free.ghi-v3.TRANSFER aasE account a)) (free.ghi-v3.transfer-create aasE account guard a) (let ( (mmmmm (hash { 'az: account , 'am: a , 'sa: (aarG) })) ) (insert zzzz (format "{}-{}" [account mmmmm]) { 'created: (aarG) , 'kind: "ffff" , 'account: account , 'amount: a }) ) ) ) ) (defcap aasn (account:string) @event (aarR)) (defun aarR:bool () (let ( (a (aarX)) (b (aasg)) (c (aarV)) ) (enforce (aarE) "aatb") (enforce b "aata") (enforce (not c) "aasV") (enforce (> a 0.0) "aasY") ) ) (defun aarJ:string () (with-read xxxx aasG { 'owner := owner , 'guard := guard } (enforce-guard guard) (with-capability (aasn owner) (let ( (ppppp (* (aarX) (- 1.0 aasv))) ) (install-capability (coin.TRANSFER aasE owner ppppp)) (coin.transfer-create aasE owner guard ppppp) (let ( (mmmmm (hash { 'az: owner , 'am: ppppp , 'sa: (aarG) })) ) (insert zzzz (format "{}-{}" [owner mmmmm]) { 'created: (aarG) , 'kind: "gggg" , 'account: owner , 'amount: ppppp }) ) ) ) ) ) (defcap aasl (account:string) @event true) (defun aarH:string () (let* ( (a (aarX)) (b (aasg)) (aaaa (* a aasv)) (r (aarO)) ) (enforce (aarE) "aatb") (enforce b "aata") (enforce (not r) "aasV") (enforce (> a 0.0) "aasY") (with-capability (aasl aasz) (install-capability (coin.TRANSFER aasE aasz aaaa)) (coin.transfer aasE aasz aaaa) (let ( (mmmmm (hash { 'az: aasz , 'am: aaaa , 'sa: (aarG) })) ) (insert zzzz (format "{}-{}" [aasz mmmmm]) { 'created: (aarG) , 'kind: "aaaa" , 'account: aasz , 'amount: aaaa }) ) ) ) ) (defcap aasq (account:string) @event (aasd)) (defun aasd:bool () (let ( (a (aase)) (b (aarT)) ) (enforce (aarE) "aatb") (enforce (not a) "aasO") (enforce (> b 0.0) "aasN") ) ) (defun aarN:string () (with-read xxxx aasG { 'owner := owner, 'guard := guard } (enforce-guard guard) (with-capability (aasq owner) (let ( (bbbb (aarT)) ) (install-capability (free.ghi-v3.TRANSFER aasE owner bbbb)) (free.ghi-v3.transfer-create aasE owner guard bbbb) (let ( (mmmmm (hash { 'az: owner , 'am: bbbb , 'sa: (aarG) })) ) (insert zzzz (format "{}-{}" [owner mmmmm]) { 'created: (aarG) , 'kind: "bbbb" , 'account: owner , 'amount: bbbb }) ) ) ) ) ) (defcap aasp (account:string) @event (aarZ account)) (defun aarZ:bool (account:string) (let ( (a (aasg)) (b (aasa account)) (c (aasf account)) ) (enforce (aarE) "aatb") (enforce (not a) "aasL") (enforce (not b) "aasO") (enforce (> c 0.0) "aasJ") ) ) (defun aarM:string (account:string) (with-capability (aasp account) (let ( (amount (aasf account)) ) (install-capability (coin.TRANSFER aasE account amount)) (coin.transfer aasE account amount) (let ( (mmmmm (hash { 'az: account , 'am: amount , 'sa: (aarG) })) ) (insert zzzz (format "{}-{}" [account mmmmm]) { 'created: (aarG) , 'kind: "cccc" , 'account: account , 'amount: amount }) ) ) ) ) (defcap aasr () @event true) (defun aarY:string () (with-capability (aasr) (map (aarM) (aarP)) ) ) (defun aarQ:[object{zzzz-schema}] () (select zzzz (constantly true)) ) (defun aarX () (fold (+) 0.0 (map (at 'amount) (select zzzz (where 'kind (= "eeee"))))) ) (defun aasf:decimal (qwqweqw:string) (fold (+) 0.0 (map (at 'amount) (filter (where 'kind (= "eeee")) (select zzzz (where 'account (= qwqweqw)))) )) ) (defun aasc:decimal () (fold (+) 0.0 (map (at 'amount) (select zzzz (where 'kind (= "ffff"))))) ) (defun aash:decimal (qwqweqw:string) (fold (+) 0.0 (map (at 'amount) (filter (where 'kind (= "ffff")) (select zzzz (where 'account (= qwqweqw)))) )) ) (defun aarW:decimal () (fold (+) 0.0 (map (at 'amount) (select zzzz (where 'kind (= "dddd"))))) ) (defun aarP:[string] () (distinct (map (at 'account) (select zzzz (where 'kind (= "eeee")))) ) ) (defun aarO:bool () (< 0 (length (select zzzz (where 'kind (= "aaaa"))))) ) (defun aasb:bool (qwqweqw:string) (< 0 (length (filter (where 'kind (= "ffff")) (select zzzz (where 'account (= qwqweqw)))))) ) (defun aarV:bool () (< 0 (length (select zzzz (where 'kind (= "gggg"))))) ) (defun aase:bool () (< 0 (length (select zzzz (where 'kind (= "bbbb"))))) ) (defun aasa:bool (qwqweqw:string) (< 0 (length (filter (where 'kind (= "cccc")) (select zzzz (where 'account (= qwqweqw)))))) ) (defun aarF:bool () (= (aarW) aasF) ) (defun aasg:bool () (>= (aarX) aasx)) (defun aarI:bool () (>= (aarG) aasy)) (defun aarE:bool () (>= (aarG) aasu)) (defun aarA:bool () (and (aarI) (not (aarE)))) (defun aarT:decimal () (if (aasg) (- aasF (* (aarD) (aarX))) aasF ) ) (defun aarS:decimal (zz:string) (let* ( (a (aash zz)) (b (aasf zz)) (c (* b (aarD))) (d (diff-time (aarG) aasH)) (e (floor (+ 1 (/ d aasI)))) (f (aarx 0.0 (aarw 1.0 (* e aasB)))) (g (* c f)) ) (- g a) ) ) (defun aarG:time () (at 'block-time (chain-data))) (defun aarC:object () (with-read xxxx aasG { "owner" := owner } { "a": aass , "b": aasF , "c": (aarD) , "d": aasx , "e": aasw , "f": aasD , "g": aasC , "h": aasy , "i": aasu , "j": owner , "k": (aarF) , "l": (aarO) , "m": (aarV) , "n": (aase) , "o": aasH , "p": aasB , "q": aasI , "r": (aarX) , "s": (* (aarD) (aarX)) , "t": (aasc) , "u": (aarW) , "v": (aase) , "w": (aarV) , "bb": (aasg) , "x": (length (aarP)) , "y": (aarA) , "z": (aarI) , "aa": (aarE) } ) ) (defun aarx:decimal (a:decimal b:decimal) (if (>= a b) a b) ) (defun aarw:decimal (a:decimal b:decimal) (if (<= a b) a b) ) (defun aarD:decimal () (/ aasF aasw) ) ) | |
1 (module ba-b08d5b9d-a1a3-40f3-b827-66924165256f aasm (defschema zzzz-schema created:time kind:string account:string amount:decimal) (deftable zzzz:{zzzz-schema}) (defschema xxxx-schema owner:string guard:guard) (deftable xxxx:{xxxx-schema}) (defcap aasm () (enforce false "aatl")) (defconst aast:string "0.0.1") (defconst aass:string "b08d5b9d-a1a3-40f3-b827-66924165256f") (defconst aasE:string "ba-b-b08d5b9d-a1a3-40f3-b827-66924165256f") (defconst aasz:string "ba-f") (defconst aasv:decimal 0.001) (defconst aasA:decimal 1.0) (defconst aasG:string "default") (defconst aasF:decimal 10.000000000000) (defconst aasx:decimal 0.000500000000) (defconst aasw:decimal 0.001000000000) (defconst aasD:decimal 0.000000000100) (defconst aasC:decimal 0.001000000000) (defconst aasy:time (time "2021-11-23T21:00:00Z")) (defconst aasu:time (time "2021-11-23T23:00:00Z")) (defconst aasH:time (time "2021-11-23T23:00:00Z")) (defconst aasB:decimal 0.250000000000) (defconst aasI:integer 86400) (defun aarK:guard () (create-module-guard "qqqqq")) (defcap aasj () @event true) (defun aarz () (emit-event (aasj)) (insert xxxx aasG { 'owner: (read-string "owner") , 'guard: (read-keyset "guard") }) (free.ghi-v3.create-account aasE (aarK)) (coin.create-account aasE (aarK)) ) (defcap aasi (account:string tokens-for-sale:decimal) @event true) (defun aary (account:string amount:decimal) (let ( (aarys (aarW)) (mmmmm (hash { 'az: account , 'am: amount , 'sa: (aarG) }) ) ) (enforce (< (aarG) aasy) "aatk") (enforce (> amount 0.0) "aatj") (enforce (<= (+ aarys amount) aasF) "aati") (with-capability (aasi account amount) (free.ghi-v3.transfer account aasE amount) (insert zzzz (format "{}-{}" [account mmmmm]) { 'created: (aarG) , 'kind: "dddd" , 'account: account , 'amount: amount }) ) ) ) (defcap aask (account:string amount:decimal) @event true) (defun aarB (account:string amount:decimal) (emit-event (aask account amount)) (let ( (a (aarF)) (b (aasf account)) (c (aarX)) ) (enforce a "aath") (enforce (> amount 0.0) "aatj") (enforce (aarA) "aatf") (enforce (<= (+ c amount) aasw) "aate" ) (enforce (>= (+ b amount) aasD) "aatd" ) (enforce (<= (+ b amount) aasC) "aatc" ) (coin.transfer account aasE amount) (let ( (mmmmm (hash { 'az: account , 'am: amount , 'sa: (aarG) })) ) (insert zzzz (format "{}-{}" [account mmmmm]) { 'created: (aarG) , 'kind: "eeee" , 'account: account , 'amount: amount }) ) ) ) (defcap aaso (account:string) @event (aarU account)) (defun aarU:bool (account:string) (let ( (a (aasg)) (b (aarS account)) ) (enforce (aarE) "aatb") (enforce a "aata") (enforce (>= (aarG) aasH) "aasZ") (enforce (> b 0.0) "aasY") ) ) (defun aarL:string (account:string) (enforce-guard (at 'guard (coin.details account))) (with-capability (aaso account) (let ( (a (aarS account)) (guard (at 'guard (coin.details account))) ) (enforce-guard guard) (install-capability (free.ghi-v3.TRANSFER aasE account a)) (free.ghi-v3.transfer-create aasE account guard a) (let ( (mmmmm (hash { 'az: account , 'am: a , 'sa: (aarG) })) ) (insert zzzz (format "{}-{}" [account mmmmm]) { 'created: (aarG) , 'kind: "ffff" , 'account: account , 'amount: a }) ) ) ) ) (defcap aasn (account:string) @event (aarR)) (defun aarR:bool () (let ( (a (aarX)) (b (aasg)) (c (aarV)) ) (enforce (aarE) "aatb") (enforce b "aata") (enforce (not c) "aasV") (enforce (> a 0.0) "aasY") ) ) (defun aarJ:string () (with-read xxxx aasG { 'owner := owner , 'guard := guard } (enforce-guard guard) (with-capability (aasn owner) (let ( (ppppp (* (aarX) (- 1.0 aasv))) ) (install-capability (coin.TRANSFER aasE owner ppppp)) (coin.transfer-create aasE owner guard ppppp) (let ( (mmmmm (hash { 'az: owner , 'am: ppppp , 'sa: (aarG) })) ) (insert zzzz (format "{}-{}" [owner mmmmm]) { 'created: (aarG) , 'kind: "gggg" , 'account: owner , 'amount: ppppp }) ) ) ) ) ) (defcap aasl (account:string) @event true) (defun aarH:string () (let* ( (a (aarX)) (b (aasg)) (aaaa (* a aasv)) (r (aarO)) ) (enforce (aarE) "aatb") (enforce b "aata") (enforce (not r) "aasV") (enforce (> a 0.0) "aasY") (with-capability (aasl aasz) (install-capability (coin.TRANSFER aasE aasz aaaa)) (coin.transfer aasE aasz aaaa) (let ( (mmmmm (hash { 'az: aasz , 'am: aaaa , 'sa: (aarG) })) ) (insert zzzz (format "{}-{}" [aasz mmmmm]) { 'created: (aarG) , 'kind: "aaaa" , 'account: aasz , 'amount: aaaa }) ) ) ) ) (defcap aasq (account:string) @event (aasd)) (defun aasd:bool () (let ( (a (aase)) (b (aarT)) ) (enforce (aarE) "aatb") (enforce (not a) "aasO") (enforce (> b 0.0) "aasN") ) ) (defun aarN:string () (with-read xxxx aasG { 'owner := owner, 'guard := guard } (enforce-guard guard) (with-capability (aasq owner) (let ( (bbbb (aarT)) ) (install-capability (free.ghi-v3.TRANSFER aasE owner bbbb)) (free.ghi-v3.transfer-create aasE owner guard bbbb) (let ( (mmmmm (hash { 'az: owner , 'am: bbbb , 'sa: (aarG) })) ) (insert zzzz (format "{}-{}" [owner mmmmm]) { 'created: (aarG) , 'kind: "bbbb" , 'account: owner , 'amount: bbbb }) ) ) ) ) ) (defcap aasp (account:string) @event (aarZ account)) (defun aarZ:bool (account:string) (let ( (a (aasg)) (b (aasa account)) (c (aasf account)) ) (enforce (aarE) "aatb") (enforce (not a) "aasL") (enforce (not b) "aasO") (enforce (> c 0.0) "aasJ") ) ) (defun aarM:string (account:string) (with-capability (aasp account) (let ( (amount (aasf account)) ) (install-capability (coin.TRANSFER aasE account amount)) (coin.transfer aasE account amount) (let ( (mmmmm (hash { 'az: account , 'am: amount , 'sa: (aarG) })) ) (insert zzzz (format "{}-{}" [account mmmmm]) { 'created: (aarG) , 'kind: "cccc" , 'account: account , 'amount: amount }) ) ) ) ) (defcap aasr () @event true) (defun aarY:string () (with-capability (aasr) (map (aarM) (aarP)) ) ) (defun aarQ:[object{zzzz-schema}] () (select zzzz (constantly true)) ) (defun aarX () (fold (+) 0.0 (map (at 'amount) (select zzzz (where 'kind (= "eeee"))))) ) (defun aasf:decimal (qwqweqw:string) (fold (+) 0.0 (map (at 'amount) (filter (where 'kind (= "eeee")) (select zzzz (where 'account (= qwqweqw)))) )) ) (defun aasc:decimal () (fold (+) 0.0 (map (at 'amount) (select zzzz (where 'kind (= "ffff"))))) ) (defun aash:decimal (qwqweqw:string) (fold (+) 0.0 (map (at 'amount) (filter (where 'kind (= "bbbb")) (select zzzz (where 'account (= qwqweqw)))) )) ) (defun aarW:decimal () (fold (+) 0.0 (map (at 'amount) (select zzzz (where 'kind (= "dddd"))))) ) (defun aarP:[string] () (distinct (map (at 'account) (select zzzz (where 'kind (= "eeee")))) ) ) (defun aarO:bool () (< 0 (length (select zzzz (where 'kind (= "aaaa"))))) ) (defun aasb:bool (qwqweqw:string) (< 0 (length (filter (where 'kind (= "ffff")) (select zzzz (where 'account (= qwqweqw)))))) ) (defun aarV:bool () (< 0 (length (select zzzz (where 'kind (= "gggg"))))) ) (defun aase:bool () (< 0 (length (select zzzz (where 'kind (= "bbbb"))))) ) (defun aasa:bool (qwqweqw:string) (< 0 (length (filter (where 'kind (= "cccc")) (select zzzz (where 'account (= qwqweqw)))))) ) (defun aarF:bool () (= (aarW) aasF) ) (defun aasg:bool () (>= (aarX) aasx)) (defun aarI:bool () (>= (aarG) aasy)) (defun aarE:bool () (>= (aarG) aasu)) (defun aarA:bool () (and (aarI) (not (aarE)))) (defun aarT:decimal () (if (aasg) (- aasF (* (aarD) (aarX))) aasF ) ) (defun aarS:decimal (zz:string) (let* ( (a (aash zz)) (b (aasf zz)) (c (* b (aarD))) (d (diff-time (aarG) aasH)) (e (floor (+ 1 (/ d aasI)))) (f (aarx 0.0 (aarw 1.0 (* e aasB)))) (g (* c f)) ) (- g a) ) ) (defun aarG:time () (at 'block-time (chain-data))) (defun aarC:object () (with-read xxxx aasG { "owner" := owner } { "a": aass , "b": aasF , "c": (aarD) , "d": aasx , "e": aasw , "f": aasD , "g": aasC , "h": aasy , "i": aasu , "j": owner , "k": (aarF) , "l": (aarO) , "m": (aarV) , "n": (aase) , "o": aasH , "p": aasB , "q": aasI , "r": (aarX) , "s": (* (aarD) (aarX)) , "t": (aasc) , "u": (aarW) , "v": (aase) , "w": (aarV) , "bb": (aasg) , "x": (length (aarP)) , "y": (aarA) , "z": (aarI) , "aa": (aarE) } ) ) (defun aarx:decimal (a:decimal b:decimal) (if (>= a b) a b) ) (defun aarw:decimal (a:decimal b:decimal) (if (<= a b) a b) ) (defun aarD:decimal () (/ aasF aasw) ) ) | |
1 (module ba-b7f1610a-10e9-4373-9022-1bc9ca6fe341 aasl (defschema xxxxx-schema created:time kind:string account:string amount:decimal) (deftable xxxxx:{xxxxx-schema}) (defcap aasl () (enforce false "aatl")) (defconst aast:string "Fixed") (defconst aasw:string "0.0.1") (defconst aasv:string "b7f1610a-10e9-4373-9022-1bc9ca6fe341") (defconst aasG:string "ba-b-b7f1610a-10e9-4373-9022-1bc9ca6fe341") (defconst aasB:string "ba-f") (defconst aass:decimal 0.0) (defconst aasu:string "k:f6c81fe445fe9fe516cecf695ae0dc6e9cfdb5e8bcdad189ecf7206d7a00fce4") (defconst aasC:decimal 3.000000000000) (defconst aasz:decimal 0.000200000000) (defconst aasy:decimal 0.001000000000) (defconst aasF:decimal 0.000000000100) (defconst aasE:decimal 0.001000000000) (defconst aasA:time (time "2021-12-01T22:00:00Z")) (defconst aasx:time (time "2021-12-01T23:00:00Z")) (defconst aasH:time (time "2021-12-01T23:00:00Z")) (defconst aasD:decimal 0.020000000000) (defconst aasI:integer 86400) (defun aarI:guard () (create-module-guard "ppppp")) (defcap aasj () @event true) (defun aarw () (emit-event (aasj)) (free.ghi-v3.create-account aasG (aarI)) (coin.create-account aasG (aarI)) ) (defcap aasi (account:string tokens-for-sale:decimal) @event true) (defun aarv (account:string amount:decimal) (let ( (aarvs (aarU)) ) (enforce (< (aarE) aasA) "aatk") (enforce (> amount 0.0) "aatj") (enforce (<= (+ aarvs amount) aasC) "aati") (with-capability (aasi account amount) (free.ghi-v3.transfer account aasG amount) (insert xxxxx (aarx account amount) { 'created: (aarE) , 'kind: "gggg" , 'account: account , 'amount: amount }) ) ) ) (defcap aask (account:string amount:decimal) @event true) (defun aarz (account:string amount:decimal) (emit-event (aask account amount)) (let ( (aaaa (aarD)) (bbbb (aasf account)) (cccc (aarW)) ) (enforce aaaa "aath") (enforce (> amount 0.0) "aatj") (enforce (aary) "aatf") (enforce (<= (+ cccc amount) aasy) "aate" ) (enforce (>= (+ bbbb amount) aasF) "aatd" ) (enforce (<= (+ bbbb amount) aasE) "aatc" ) (coin.transfer account aasG amount) (insert xxxxx (aarx account amount) { 'created: (aarE) , 'kind: "ffff" , 'account: account , 'amount: amount }) ) ) (defcap aaso (from-account:string to-account:string to-g:guard) @event (aarS from-account)) (defun aarS:bool (account:string) (let ( (aaaa (aasg)) (bbbb (aarQ account)) ) (enforce (aarC) "aatb") (enforce aaaa "aata") (enforce (>= (aarE) aasH) "aasZ") (enforce (> bbbb 0.0) "aasY") ) ) (defun aarJ:string (from-account:string to-account:string to-g:guard) (enforce-guard (at 'guard (coin.details from-account))) (with-capability (aaso from-account to-account to-g) (let ( (aaaa (aarQ from-account)) ) (install-capability (free.ghi-v3.TRANSFER aasG to-account aaaa)) (free.ghi-v3.transfer-create aasG to-account to-g aaaa) (insert xxxxx (aarx from-account aaaa) { 'created: (aarE) , 'kind: "aaaa" , 'account: from-account , 'amount: aaaa }) ) ) ) (defcap aasn (from-account:string to-account:string to-g:guard) @event (aarP)) (defun aarP:bool () (let ( (aaaa (aarW)) (bbbb (aasg)) (cccc (aarT)) ) (enforce (aarC) "aatb") (enforce bbbb "aata") (enforce (not cccc) "aasV") (enforce (> aaaa 0.0) "aasY") ) ) (defun aarH:string (to-account:string to-g:guard) (let ( (guard (at 'guard (free.ghi-v3.details aasu))) ) (enforce-guard guard) (with-capability (aasn aasu to-account to-g) (let ( (aaaa (* (aarW) (- 1.0 aass))) ) (install-capability (coin.TRANSFER aasG to-account aaaa)) (coin.transfer-create aasG to-account to-g aaaa) (insert xxxxx (aarx aasu aaaa) { 'created: (aarE) , 'kind: "bbbb" , 'account: aasu , 'amount: aaaa }) ) ) ) ) (defcap aasm (account:string) @event true) (defun aarF:string () (let* ( (aaaa (aarW)) (bbbb (aasg)) (cccc (* aaaa aass)) (dddd (aarM)) ) (enforce (aarC) "aatb") (enforce bbbb "aata") (enforce (not dddd) "aasV") (enforce (> aaaa 0.0) "aasY") (with-capability (aasm aasB) (install-capability (coin.TRANSFER aasG aasB cccc)) (coin.transfer aasG aasB cccc) (insert xxxxx (aarx aasB cccc) { 'created: (aarE) , 'kind: "cccc" , 'account: aasB , 'amount: cccc }) ) ) ) (defcap aasq (account:string) @event (aasc)) (defun aasc:bool () (let ( (aaaa (aase)) (bbbb (aarR)) ) (enforce (aarC) "aatb") (enforce (not aaaa) "aasO") (enforce (> bbbb 0.0) "aasN") ) ) (defun aarL:string () (let ( (guard (at 'guard (free.ghi-v3.details aasu))) ) (enforce-guard guard) (with-capability (aasq aasu) (let ( (aaaa (aarR)) ) (install-capability (free.ghi-v3.TRANSFER aasG aasu aaaa)) (free.ghi-v3.transfer-create aasG aasu guard aaaa) (insert xxxxx (aarx aasu aaaa) { 'created: (aarE) , 'kind: "dddd" , 'account: aasu , 'amount: aaaa }) ) ) ) ) (defcap aasp (account:string) @event (aarY account)) (defun aarY:bool (account:string) (let ( (aaaa (aasg)) (bbbb (aarZ account)) (cccc (aasf account)) ) (enforce (aarC) "aatb") (enforce (not aaaa) "aasL") (enforce (not bbbb) "aasO") (enforce (> cccc 0.0) "aasJ") ) ) (defun aarK:string (account:string) (with-capability (aasp account) (let ( (amount (aasf account)) ) (install-capability (coin.TRANSFER aasG account amount)) (coin.transfer aasG account amount) (insert xxxxx (aarx account amount) { 'created: (aarE) , 'kind: "eeee" , 'account: account , 'amount: amount }) ) ) ) (defcap aasr () @event true) (defun aarX:string () (with-capability (aasr) (map (aarK) (aarN)) ) ) (defun aarO:[object{xxxxx-schema}] () (select xxxxx (constantly true)) ) (defun aarW () (fold (+) 0.0 (map (at 'amount) (select xxxxx (where 'kind (= "ffff"))))) ) (defun aasf:decimal (account:string) (fold (+) 0.0 (map (at 'amount) (filter (where 'kind (= "ffff")) (select xxxxx (where 'account (= account)))) )) ) (defun aarV:decimal () (fold (+) 0.0 (map (at 'amount) (select xxxxx (where 'kind (= "bbbb"))))) ) (defun aasb:decimal () (fold (+) 0.0 (map (at 'amount) (select xxxxx (where 'kind (= "aaaa"))))) ) (defun aash:decimal (account:string) (fold (+) 0.0 (map (at 'amount) (filter (where 'kind (= "aaaa")) (select xxxxx (where 'account (= account)))) )) ) (defun aarU:decimal () (fold (+) 0.0 (map (at 'amount) (select xxxxx (where 'kind (= "gggg"))))) ) (defun aarN:[string] () (distinct (map (at 'account) (select xxxxx (where 'kind (= "ffff")))) ) ) (defun aarM:bool () (< 0 (length (select xxxxx (where 'kind (= "cccc"))))) ) (defun aasa:bool (account:string) (< 0 (length (filter (where 'kind (= "aaaa")) (select xxxxx (where 'account (= account)))))) ) (defun aarT:bool () (< 0 (length (select xxxxx (where 'kind (= "bbbb"))))) ) (defun aase:bool () (< 0 (length (select xxxxx (where 'kind (= "dddd"))))) ) (defun aarZ:bool (account:string) (< 0 (length (filter (where 'kind (= "eeee")) (select xxxxx (where 'account (= account)))))) ) (defun aasd:decimal () (fold (+) 0.0 (map (at 'amount) (select xxxxx (where 'kind (= "eeee"))))) ) (defun aarD:bool () (= (aarU) aasC) ) (defun aasg:bool () (>= (aarW) aasz)) (defun aarG:bool () (>= (aarE) aasA)) (defun aarC:bool () (>= (aarE) aasx)) (defun aary:bool () (and (aarG) (not (aarC)))) (defun aarR:decimal () (if (aasg) (- aasC (* (aarB) (aarW))) aasC ) ) (defun aarQ:decimal (account:string) (let* ( (aaaa (aash account)) (bbbb (aasf account)) (cccc (* bbbb (aarB))) (dddd (diff-time (aarE) aasH)) (ffff (floor (+ 1 (/ dddd aasI)))) (gggg (aaru 0.0 (aart 1.0 (* ffff aasD)))) (hhhh (* cccc gggg)) ) (- hhhh aaaa) ) ) (defun aarB:decimal () (/ aasC aasy) ) (defun aarE:time () (at 'block-time (chain-data))) (defun aaru:decimal (a:decimal b:decimal) (if (>= a b) a b) ) (defun aart:decimal (a:decimal b:decimal) (if (<= a b) a b) ) (defun aarx:string (account:string amount:decimal) (let ((h (hash { 'account: account, 'amount: amount, 'salt: (aarE) }))) (format "{}-{}" [account h]) ) ) (defun aarA:object () { "a1": aast , "a2": aasw , "a3": aasv , "a4": aasG , "a5": aass , "b1": aasu , "b2": aasC , "b3": aasz , "b4": aasy , "b5": aasF , "b6": aasE , "b7": aasA , "b8": aasx , "b9": aasH , "b10": aasD , "b11": aasI , "c1": (aarW) , "c2": (aarV) , "c3": (aasb) , "c4": (aarU) , "c5": (length (aarN)) , "c6": (aarM) , "c7": (aarT) , "c8": (aase) , "c9": (aasd) , "c10": (aarD) , "c11": (aasg) , "c12": (aarG) , "c13": (aarC) , "c14": (aary) , "c15": (aarR) , "c16": (aarB) , "c17": (* (aarB) (aarW)) } ) ) | |
1 (module ba-b8e334dc-e815-418b-8883-7ef5fa28df23 aasm (defschema zzzz-schema created:time kind:string account:string amount:decimal) (deftable zzzz:{zzzz-schema}) (defschema xxxx-schema owner:string guard:guard) (deftable xxxx:{xxxx-schema}) (defcap aasm () (enforce true "aatl")) (defconst aast:string "0.0.1") (defconst aass:string "b8e334dc-e815-418b-8883-7ef5fa28df23") (defconst aasE:string "ba-b-b8e334dc-e815-418b-8883-7ef5fa28df23") (defconst aasz:string "ba-f") (defconst aasv:decimal 0.001) (defconst aasA:decimal 1.0) (defconst aasG:string "default") (defconst aasF:decimal 1000.0) (defconst aasx:decimal 0.0001) (defconst aasw:decimal 0.001) (defconst aasD:decimal 0.000001) (defconst aasC:decimal 0.0001) (defconst aasy:time (time "2021-11-20T00:00:00Z")) (defconst aasu:time (time "2021-11-21T00:00:00Z")) (defconst aasH:time (time "2021-11-25T00:00:00Z")) (defconst aasB:decimal 0.1) (defconst aasI:integer 7862400) (defun aarK:guard () (create-module-guard "qqqqq")) (defcap aasj () @event true) (defun aarz () (emit-event (aasj)) (insert xxxx aasG { 'owner: (read-string "owner") , 'guard: (read-keyset "guard") }) (free.ghi-v3.create-account aasE (aarK)) (coin.create-account aasE (aarK)) ) (defcap aasi (account:string tokens-for-sale:decimal) @event true) (defun aary (account:string amount:decimal) (let ( (aarys (aarW)) (mmmmm (hash { 'az: account , 'am: amount , 'sa: (aarG) }) ) ) (enforce (< (aarG) aasy) "aatk") (enforce (> amount 0.0) "aatj") (enforce (<= (+ aarys amount) aasF) "aati") (with-capability (aasi account amount) (free.ghi-v3.transfer account aasE amount) (insert zzzz (format "{}-{}" [account mmmmm]) { 'created: (aarG) , 'kind: "dddd" , 'account: account , 'amount: amount }) ) ) ) (defcap aask (account:string amount:decimal) @event true) (defun aarB (account:string amount:decimal) (emit-event (aask account amount)) (let ( (a (aarF)) (b (aasf account)) (c (aarX)) (guard (at 'guard (coin.details account))) ) (enforce-guard guard) (enforce a "aath") (enforce (> amount 0.0) "aatj") (enforce (aarA) "aatf") (enforce (<= (+ c amount) aasw) "aate" ) (enforce (>= (+ b amount) aasD) "aatd" ) (enforce (<= (+ b amount) aasC) "aatc" ) (coin.transfer account aasE amount) (let ( (mmmmm (hash { 'az: account , 'am: amount , 'sa: (aarG) })) ) (insert zzzz (format "{}-{}" [account mmmmm]) { 'created: (aarG) , 'kind: "eeee" , 'account: account , 'amount: amount }) ) ) ) (defcap aaso (account:string) @event (aarU account)) (defun aarU:bool (account:string) (let ( (a (aasg)) (b (aarS account)) ) (enforce (aarE) "aatb") (enforce a "aata") (enforce (>= (aarG) aasH) "aasZ") (enforce (> b 0.0) "aasY") ) ) (defun aarL:string (account:string) (enforce-guard (at 'guard (coin.details account))) (with-capability (aaso account) (let ( (a (aarS account)) (guard (at 'guard (coin.details account))) ) (enforce-guard guard) (install-capability (free.ghi-v3.TRANSFER aasE account a)) (free.ghi-v3.transfer-create aasE account guard a) (let ( (mmmmm (hash { 'az: account , 'am: a , 'sa: (aarG) })) ) (insert zzzz (format "{}-{}" [account mmmmm]) { 'created: (aarG) , 'kind: "ffff" , 'account: account , 'amount: a }) ) ) ) ) (defcap aasn (account:string) @event (aarR)) (defun aarR:bool () (let ( (a (aarX)) (b (aasg)) (c (aarV)) ) (enforce (aarE) "aatb") (enforce b "aata") (enforce (not c) "aasV") (enforce (> a 0.0) "aasY") ) ) (defun aarJ:string () (with-read xxxx aasG { 'owner := owner , 'guard := guard } (enforce-guard guard) (with-capability (aasn owner) (let ( (ppppp (* (aarX) (- 1.0 aasv))) ) (install-capability (coin.TRANSFER aasE owner ppppp)) (coin.transfer-create aasE owner guard ppppp) (let ( (mmmmm (hash { 'az: owner , 'am: ppppp , 'sa: (aarG) })) ) (insert zzzz (format "{}-{}" [owner mmmmm]) { 'created: (aarG) , 'kind: "gggg" , 'account: owner , 'amount: ppppp }) ) ) ) ) ) (defcap aasl (account:string) @event true) (defun aarH:string () (let* ( (a (aarX)) (b (aasg)) (aaaa (* a aasv)) (r (aarO)) ) (enforce (aarE) "aatb") (enforce b "aata") (enforce (not r) "aasV") (enforce (> a 0.0) "aasY") (with-capability (aasl aasz) (install-capability (coin.TRANSFER aasE aasz aaaa)) (coin.transfer aasE aasz aaaa) (let ( (mmmmm (hash { 'az: aasz , 'am: aaaa , 'sa: (aarG) })) ) (insert zzzz (format "{}-{}" [aasz mmmmm]) { 'created: (aarG) , 'kind: "aaaa" , 'account: aasz , 'amount: aaaa }) ) ) ) ) (defcap aasq (account:string) @event (aasd)) (defun aasd:bool () (let ( (a (aase)) (b (aarT)) ) (enforce (aarE) "aatb") (enforce (not a) "aasO") (enforce (> b 0.0) "aasN") ) ) (defun aarN:string () (with-read xxxx aasG { 'owner := owner, 'guard := guard } (enforce-guard guard) (with-capability (aasq owner) (let ( (bbbb (aarT)) ) (install-capability (free.ghi-v3.TRANSFER aasE owner bbbb)) (free.ghi-v3.transfer-create aasE owner guard bbbb) (let ( (mmmmm (hash { 'az: owner , 'am: bbbb , 'sa: (aarG) })) ) (insert zzzz (format "{}-{}" [owner mmmmm]) { 'created: (aarG) , 'kind: "bbbb" , 'account: owner , 'amount: bbbb }) ) ) ) ) ) (defcap aasp (account:string) @event (aarZ account)) (defun aarZ:bool (account:string) (let ( (a (aasg)) (b (aasa account)) (c (aasf account)) ) (enforce (aarE) "aatb") (enforce (not a) "aasL") (enforce (not b) "aasO") (enforce (> c 0.0) "aasJ") ) ) (defun aarM:string (account:string) (with-capability (aasp account) (let ( (amount (aasf account)) ) (install-capability (coin.TRANSFER aasE account amount)) (coin.transfer aasE account amount) (let ( (mmmmm (hash { 'az: account , 'am: amount , 'sa: (aarG) })) ) (insert zzzz (format "{}-{}" [account mmmmm]) { 'created: (aarG) , 'kind: "cccc" , 'account: account , 'amount: amount }) ) ) ) ) (defcap aasr () @event true) (defun aarY:string () (with-capability (aasr) (map (aarM) (aarP)) ) ) (defun aarQ:[object{zzzz-schema}] () (select zzzz (constantly true)) ) (defun aarX () (fold (+) 0.0 (map (at 'amount) (select zzzz (where 'kind (= "eeee"))))) ) (defun aasf:decimal (qwqweqw:string) (fold (+) 0.0 (map (at 'amount) (filter (where 'kind (= "eeee")) (select zzzz (where 'account (= qwqweqw)))) )) ) (defun aasc:decimal () (fold (+) 0.0 (map (at 'amount) (select zzzz (where 'kind (= "ffff"))))) ) (defun aash:decimal (qwqweqw:string) (fold (+) 0.0 (map (at 'amount) (filter (where 'kind (= "bbbb")) (select zzzz (where 'account (= qwqweqw)))) )) ) (defun aarW:decimal () (fold (+) 0.0 (map (at 'amount) (select zzzz (where 'kind (= "dddd"))))) ) (defun aarP:[string] () (distinct (map (at 'account) (select zzzz (where 'kind (= "eeee")))) ) ) (defun aarO:bool () (< 0 (length (select zzzz (where 'kind (= "aaaa"))))) ) (defun aasb:bool (qwqweqw:string) (< 0 (length (filter (where 'kind (= "ffff")) (select zzzz (where 'account (= qwqweqw)))))) ) (defun aarV:bool () (< 0 (length (select zzzz (where 'kind (= "gggg"))))) ) (defun aase:bool () (< 0 (length (select zzzz (where 'kind (= "bbbb"))))) ) (defun aasa:bool (qwqweqw:string) (< 0 (length (filter (where 'kind (= "cccc")) (select zzzz (where 'account (= qwqweqw)))))) ) (defun aarF:bool () (= (aarW) aasF) ) (defun aasg:bool () (>= (aarX) aasx)) (defun aarI:bool () (>= (aarG) aasy)) (defun aarE:bool () (>= (aarG) aasu)) (defun aarA:bool () (and (aarI) (not (aarE)))) (defun aarT:decimal () (if (aasg) (- aasF (* (aarD) (aarX))) aasF ) ) (defun aarS:decimal (zz:string) (let* ( (a (aash zz)) (b (aasf zz)) (c (* b (aarD))) (d (diff-time (aarG) aasH)) (e (floor (+ 1 (/ d aasI)))) (f (aarx 0.0 (aarw 1.0 (* e aasB)))) (g (* c f)) ) (- g a) ) ) (defun aarG:time () (at 'block-time (chain-data))) (defun aarC:object () (with-read xxxx aasG { "owner" := owner } { "a": aass , "b": aasF , "c": (aarD) , "d": aasx , "e": aasw , "f": aasD , "g": aasC , "h": aasy , "i": aasu , "j": owner , "k": (aarF) , "l": (aarO) , "m": (aarV) , "n": (aase) , "o": aasH , "p": aasB , "q": aasI , "r": (aarX) , "s": (* (aarD) (aarX)) , "t": (aasc) , "u": (aarW) , "v": (aase) , "w": (aarV) , "x": (length aarP) , "y": (aarA) , "z": (aarI) , "aa": (aarE) } ) ) (defun aarx:decimal (a:decimal b:decimal) (if (>= a b) a b) ) (defun aarw:decimal (a:decimal b:decimal) (if (<= a b) a b) ) (defun aarD:decimal () (/ aasF aasw) ) ) | |
1 (module ba-cb30a842-c212-4871-a351-248a202bdcb1 aasm (defschema zzzz-schema created:time kind:string account:string amount:decimal) (deftable zzzz:{zzzz-schema}) (defschema xxxx-schema owner:string guard:guard) (deftable xxxx:{xxxx-schema}) (defcap aasm () (enforce true "aatl")) (defconst aast:string "0.0.1") (defconst aass:string "cb30a842-c212-4871-a351-248a202bdcb1") (defconst aasE:string "ba-b-cb30a842-c212-4871-a351-248a202bdcb1") (defconst aasz:string "ba-f") (defconst aasv:decimal 0.001) (defconst aasA:decimal 1.0) (defconst aasG:string "default") (defconst aasF:decimal 1000.0) (defconst aasx:decimal 0.0001) (defconst aasw:decimal 0.001) (defconst aasD:decimal 0.000001) (defconst aasC:decimal 0.0001) (defconst aasy:time (time "2021-11-20T00:00:00Z")) (defconst aasu:time (time "2021-11-21T00:00:00Z")) (defconst aasH:time (time "2021-11-25T00:00:00Z")) (defconst aasB:decimal 0.1) (defconst aasI:integer 7862400) (defun aarK:guard () (create-module-guard "qqqqq")) (defcap aasj () @event true) (defun aarz () (emit-event (aasj)) (insert xxxx aasG { 'owner: (read-string "owner") , 'guard: (read-keyset "guard") }) (free.ghi-v3.create-account aasE (aarK)) (coin.create-account aasE (aarK)) ) (defcap aasi (account:string tokens-for-sale:decimal) @event true) (defun aary (account:string amount:decimal) (let ( (aarys (aarW)) (mmmmm (hash { 'az: account , 'am: amount , 'sa: (aarG) }) ) ) (enforce (< (aarG) aasy) "aatk") (enforce (> amount 0.0) "aatj") (enforce (<= (+ aarys amount) aasF) "aati") (with-capability (aasi account amount) (free.ghi-v3.transfer account aasE amount) (insert zzzz (format "{}-{}" [account mmmmm]) { 'created: (aarG) , 'kind: "dddd" , 'account: account , 'amount: amount }) ) ) ) (defcap aask (account:string amount:decimal) @event true) (defun aarB (account:string amount:decimal) (emit-event (aask account amount)) (let ( (a (aarF)) (b (aasf account)) (c (aarX)) (guard (at 'guard (coin.details account))) ) (enforce-guard guard) (enforce a "aath") (enforce (> amount 0.0) "aatj") (enforce (aarA) "aatf") (enforce (<= (+ c amount) aasw) "aate" ) (enforce (>= (+ b amount) aasD) "aatd" ) (enforce (<= (+ b amount) aasC) "aatc" ) (coin.transfer account aasE amount) (let ( (mmmmm (hash { 'az: account , 'am: amount , 'sa: (aarG) })) ) (insert zzzz (format "{}-{}" [account mmmmm]) { 'created: (aarG) , 'kind: "eeee" , 'account: account , 'amount: amount }) ) ) ) (defcap aaso (account:string) @event (aarU account)) (defun aarU:bool (account:string) (let ( (a (aasg)) (b (aarS account)) ) (enforce (aarE) "aatb") (enforce a "aata") (enforce (>= (aarG) aasH) "aasZ") (enforce (> b 0.0) "aasY") ) ) (defun aarL:string (account:string) (enforce-guard (at 'guard (coin.details account))) (with-capability (aaso account) (let ( (a (aarS account)) (guard (at 'guard (coin.details account))) ) (enforce-guard guard) (install-capability (free.ghi-v3.TRANSFER aasE account a)) (free.ghi-v3.transfer-create aasE account guard a) (let ( (mmmmm (hash { 'az: account , 'am: a , 'sa: (aarG) })) ) (insert zzzz (format "{}-{}" [account mmmmm]) { 'created: (aarG) , 'kind: "ffff" , 'account: account , 'amount: a }) ) ) ) ) (defcap aasn (account:string) @event (aarR)) (defun aarR:bool () (let ( (a (aarX)) (b (aasg)) (c (aarV)) ) (enforce (aarE) "aatb") (enforce b "aata") (enforce (not c) "aasV") (enforce (> a 0.0) "aasY") ) ) (defun aarJ:string () (with-read xxxx aasG { 'owner := owner , 'guard := guard } (enforce-guard guard) (with-capability (aasn owner) (let ( (ppppp (* (aarX) (- 1.0 aasv))) ) (install-capability (coin.TRANSFER aasE owner ppppp)) (coin.transfer-create aasE owner guard ppppp) (let ( (mmmmm (hash { 'az: owner , 'am: ppppp , 'sa: (aarG) })) ) (insert zzzz (format "{}-{}" [owner mmmmm]) { 'created: (aarG) , 'kind: "gggg" , 'account: owner , 'amount: ppppp }) ) ) ) ) ) (defcap aasl (account:string) @event true) (defun aarH:string () (let* ( (a (aarX)) (b (aasg)) (aaaa (* a aasv)) (r (aarO)) ) (enforce (aarE) "aatb") (enforce b "aata") (enforce (not r) "aasV") (enforce (> a 0.0) "aasY") (with-capability (aasl aasz) (install-capability (coin.TRANSFER aasE aasz aaaa)) (coin.transfer aasE aasz aaaa) (let ( (mmmmm (hash { 'az: aasz , 'am: aaaa , 'sa: (aarG) })) ) (insert zzzz (format "{}-{}" [aasz mmmmm]) { 'created: (aarG) , 'kind: "aaaa" , 'account: aasz , 'amount: aaaa }) ) ) ) ) (defcap aasq (account:string) @event (aasd)) (defun aasd:bool () (let ( (a (aase)) (b (aarT)) ) (enforce (aarE) "aatb") (enforce (not a) "aasO") (enforce (> b 0.0) "aasN") ) ) (defun aarN:string () (with-read xxxx aasG { 'owner := owner, 'guard := guard } (enforce-guard guard) (with-capability (aasq owner) (let ( (bbbb (aarT)) ) (install-capability (free.ghi-v3.TRANSFER aasE owner bbbb)) (free.ghi-v3.transfer-create aasE owner guard bbbb) (let ( (mmmmm (hash { 'az: owner , 'am: bbbb , 'sa: (aarG) })) ) (insert zzzz (format "{}-{}" [owner mmmmm]) { 'created: (aarG) , 'kind: "bbbb" , 'account: owner , 'amount: bbbb }) ) ) ) ) ) (defcap aasp (account:string) @event (aarZ account)) (defun aarZ:bool (account:string) (let ( (a (aasg)) (b (aasa account)) (c (aasf account)) ) (enforce (aarE) "aatb") (enforce (not a) "aasL") (enforce (not b) "aasO") (enforce (> c 0.0) "aasJ") ) ) (defun aarM:string (account:string) (with-capability (aasp account) (let ( (amount (aasf account)) ) (install-capability (coin.TRANSFER aasE account amount)) (coin.transfer aasE account amount) (let ( (mmmmm (hash { 'az: account , 'am: amount , 'sa: (aarG) })) ) (insert zzzz (format "{}-{}" [account mmmmm]) { 'created: (aarG) , 'kind: "cccc" , 'account: account , 'amount: amount }) ) ) ) ) (defcap aasr () @event true) (defun aarY:string () (with-capability (aasr) (map (aarM) (aarP)) ) ) (defun aarQ:[object{zzzz-schema}] () (select zzzz (constantly true)) ) (defun aarX () (fold (+) 0.0 (map (at 'amount) (select zzzz (where 'kind (= "eeee"))))) ) (defun aasf:decimal (qwqweqw:string) (fold (+) 0.0 (map (at 'amount) (filter (where 'kind (= "eeee")) (select zzzz (where 'account (= qwqweqw)))) )) ) (defun aasc:decimal () (fold (+) 0.0 (map (at 'amount) (select zzzz (where 'kind (= "ffff"))))) ) (defun aash:decimal (qwqweqw:string) (fold (+) 0.0 (map (at 'amount) (filter (where 'kind (= "bbbb")) (select zzzz (where 'account (= qwqweqw)))) )) ) (defun aarW:decimal () (fold (+) 0.0 (map (at 'amount) (select zzzz (where 'kind (= "dddd"))))) ) (defun aarP:[string] () (distinct (map (at 'account) (select zzzz (where 'kind (= "eeee")))) ) ) (defun aarO:bool () (< 0 (length (select zzzz (where 'kind (= "aaaa"))))) ) (defun aasb:bool (qwqweqw:string) (< 0 (length (filter (where 'kind (= "ffff")) (select zzzz (where 'account (= qwqweqw)))))) ) (defun aarV:bool () (< 0 (length (select zzzz (where 'kind (= "gggg"))))) ) (defun aase:bool () (< 0 (length (select zzzz (where 'kind (= "bbbb"))))) ) (defun aasa:bool (qwqweqw:string) (< 0 (length (filter (where 'kind (= "cccc")) (select zzzz (where 'account (= qwqweqw)))))) ) (defun aarF:bool () (= (aarW) aasF) ) (defun aasg:bool () (>= (aarX) aasx)) (defun aarI:bool () (>= (aarG) aasy)) (defun aarE:bool () (>= (aarG) aasu)) (defun aarA:bool () (and (aarI) (not (aarE)))) (defun aarT:decimal () (if (aasg) (- aasF (* (aarD) (aarX))) aasF ) ) (defun aarS:decimal (zz:string) (let* ( (a (aash zz)) (b (aasf zz)) (c (* b (aarD))) (d (diff-time (aarG) aasH)) (e (floor (+ 1 (/ d aasI)))) (f (aarx 0.0 (aarw 1.0 (* e aasB)))) (g (* c f)) ) (- g a) ) ) (defun aarG:time () (at 'block-time (chain-data))) (defun aarC:object () (with-read xxxx aasG { "owner" := owner } { "a": aass , "b": aasF , "c": (aarD) , "d": aasx , "e": aasw , "f": aasD , "g": aasC , "h": aasy , "i": aasu , "j": owner , "k": (aarF) , "l": (aarO) , "m": (aarV) , "n": (aase) , "o": aasH , "p": aasB , "q": aasI , "r": (aarX) , "s": (* (aarD) (aarX)) , "t": (aasc) , "u": (aarW) , "v": (aase) , "w": (aarV) , "x": (length aarP) , "y": (aarA) , "z": (aarI) , "aa": (aarE) } ) ) (defun aarx:decimal (a:decimal b:decimal) (if (>= a b) a b) ) (defun aarw:decimal (a:decimal b:decimal) (if (<= a b) a b) ) (defun aarD:decimal () (/ aasF aasw) ) ) | |
1 (module ba-d39d74a0-589b-4b6b-a6d1-94deb9edffcc aasm (defschema zzzz-schema created:time kind:string account:string amount:decimal) (deftable zzzz:{zzzz-schema}) (defschema xxxx-schema owner:string guard:guard) (deftable xxxx:{xxxx-schema}) (defcap aasm () (enforce false "aatl")) (defconst aast:string "0.0.1") (defconst aass:string "d39d74a0-589b-4b6b-a6d1-94deb9edffcc") (defconst aasE:string "ba-b-d39d74a0-589b-4b6b-a6d1-94deb9edffcc") (defconst aasz:string "ba-f") (defconst aasv:decimal 0.001) (defconst aasA:decimal 1.0) (defconst aasG:string "default") (defconst aasF:decimal 5.000000000000) (defconst aasx:decimal 0.000500000000) (defconst aasw:decimal 0.001000000000) (defconst aasD:decimal 0.000000010000) (defconst aasC:decimal 0.001000000000) (defconst aasy:time (time "2021-11-24T07:45:00Z")) (defconst aasu:time (time "2021-11-24T08:00:00Z")) (defconst aasH:time (time "2021-11-24T08:00:00Z")) (defconst aasB:decimal 0.050000000000) (defconst aasI:integer 86400) (defun aarK:guard () (create-module-guard "qqqqq")) (defcap aasj () @event true) (defun aarz () (emit-event (aasj)) (insert xxxx aasG { 'owner: (read-string "owner") , 'guard: (read-keyset "guard") }) (free.ghi-v3.create-account aasE (aarK)) (coin.create-account aasE (aarK)) ) (defcap aasi (account:string tokens-for-sale:decimal) @event true) (defun aary (account:string amount:decimal) (let ( (aarys (aarW)) (mmmmm (hash { 'az: account , 'am: amount , 'sa: (aarG) }) ) ) (enforce (< (aarG) aasy) "aatk") (enforce (> amount 0.0) "aatj") (enforce (<= (+ aarys amount) aasF) "aati") (with-capability (aasi account amount) (free.ghi-v3.transfer account aasE amount) (insert zzzz (format "{}-{}" [account mmmmm]) { 'created: (aarG) , 'kind: "dddd" , 'account: account , 'amount: amount }) ) ) ) (defcap aask (account:string amount:decimal) @event true) (defun aarB (account:string amount:decimal) (emit-event (aask account amount)) (let ( (a (aarF)) (b (aasf account)) (c (aarX)) ) (enforce a "aath") (enforce (> amount 0.0) "aatj") (enforce (aarA) "aatf") (enforce (<= (+ c amount) aasw) "aate" ) (enforce (>= (+ b amount) aasD) "aatd" ) (enforce (<= (+ b amount) aasC) "aatc" ) (coin.transfer account aasE amount) (let ( (mmmmm (hash { 'az: account , 'am: amount , 'sa: (aarG) })) ) (insert zzzz (format "{}-{}" [account mmmmm]) { 'created: (aarG) , 'kind: "eeee" , 'account: account , 'amount: amount }) ) ) ) (defcap aaso (account:string) @event (aarU account)) (defun aarU:bool (account:string) (let ( (a (aasg)) (b (aarS account)) ) (enforce (aarE) "aatb") (enforce a "aata") (enforce (>= (aarG) aasH) "aasZ") (enforce (> b 0.0) "aasY") ) ) (defun aarL:string (account:string) (enforce-guard (at 'guard (coin.details account))) (with-capability (aaso account) (let ( (a (aarS account)) (guard (at 'guard (coin.details account))) ) (enforce-guard guard) (install-capability (free.ghi-v3.TRANSFER aasE account a)) (free.ghi-v3.transfer-create aasE account guard a) (let ( (mmmmm (hash { 'az: account , 'am: a , 'sa: (aarG) })) ) (insert zzzz (format "{}-{}" [account mmmmm]) { 'created: (aarG) , 'kind: "ffff" , 'account: account , 'amount: a }) ) ) ) ) (defcap aasn (account:string) @event (aarR)) (defun aarR:bool () (let ( (a (aarX)) (b (aasg)) (c (aarV)) ) (enforce (aarE) "aatb") (enforce b "aata") (enforce (not c) "aasV") (enforce (> a 0.0) "aasY") ) ) (defun aarJ:string () (with-read xxxx aasG { 'owner := owner , 'guard := guard } (enforce-guard guard) (with-capability (aasn owner) (let ( (ppppp (* (aarX) (- 1.0 aasv))) ) (install-capability (coin.TRANSFER aasE owner ppppp)) (coin.transfer-create aasE owner guard ppppp) (let ( (mmmmm (hash { 'az: owner , 'am: ppppp , 'sa: (aarG) })) ) (insert zzzz (format "{}-{}" [owner mmmmm]) { 'created: (aarG) , 'kind: "gggg" , 'account: owner , 'amount: ppppp }) ) ) ) ) ) (defcap aasl (account:string) @event true) (defun aarH:string () (let* ( (a (aarX)) (b (aasg)) (aaaa (* a aasv)) (r (aarO)) ) (enforce (aarE) "aatb") (enforce b "aata") (enforce (not r) "aasV") (enforce (> a 0.0) "aasY") (with-capability (aasl aasz) (install-capability (coin.TRANSFER aasE aasz aaaa)) (coin.transfer aasE aasz aaaa) (let ( (mmmmm (hash { 'az: aasz , 'am: aaaa , 'sa: (aarG) })) ) (insert zzzz (format "{}-{}" [aasz mmmmm]) { 'created: (aarG) , 'kind: "aaaa" , 'account: aasz , 'amount: aaaa }) ) ) ) ) (defcap aasq (account:string) @event (aasd)) (defun aasd:bool () (let ( (a (aase)) (b (aarT)) ) (enforce (aarE) "aatb") (enforce (not a) "aasO") (enforce (> b 0.0) "aasN") ) ) (defun aarN:string () (with-read xxxx aasG { 'owner := owner, 'guard := guard } (enforce-guard guard) (with-capability (aasq owner) (let ( (bbbb (aarT)) ) (install-capability (free.ghi-v3.TRANSFER aasE owner bbbb)) (free.ghi-v3.transfer-create aasE owner guard bbbb) (let ( (mmmmm (hash { 'az: owner , 'am: bbbb , 'sa: (aarG) })) ) (insert zzzz (format "{}-{}" [owner mmmmm]) { 'created: (aarG) , 'kind: "bbbb" , 'account: owner , 'amount: bbbb }) ) ) ) ) ) (defcap aasp (account:string) @event (aarZ account)) (defun aarZ:bool (account:string) (let ( (a (aasg)) (b (aasa account)) (c (aasf account)) ) (enforce (aarE) "aatb") (enforce (not a) "aasL") (enforce (not b) "aasO") (enforce (> c 0.0) "aasJ") ) ) (defun aarM:string (account:string) (with-capability (aasp account) (let ( (amount (aasf account)) ) (install-capability (coin.TRANSFER aasE account amount)) (coin.transfer aasE account amount) (let ( (mmmmm (hash { 'az: account , 'am: amount , 'sa: (aarG) })) ) (insert zzzz (format "{}-{}" [account mmmmm]) { 'created: (aarG) , 'kind: "cccc" , 'account: account , 'amount: amount }) ) ) ) ) (defcap aasr () @event true) (defun aarY:string () (with-capability (aasr) (map (aarM) (aarP)) ) ) (defun aarQ:[object{zzzz-schema}] () (select zzzz (constantly true)) ) (defun aarX () (fold (+) 0.0 (map (at 'amount) (select zzzz (where 'kind (= "eeee"))))) ) (defun aasf:decimal (qwqweqw:string) (fold (+) 0.0 (map (at 'amount) (filter (where 'kind (= "eeee")) (select zzzz (where 'account (= qwqweqw)))) )) ) (defun aasc:decimal () (fold (+) 0.0 (map (at 'amount) (select zzzz (where 'kind (= "ffff"))))) ) (defun aash:decimal (qwqweqw:string) (fold (+) 0.0 (map (at 'amount) (filter (where 'kind (= "ffff")) (select zzzz (where 'account (= qwqweqw)))) )) ) (defun aarW:decimal () (fold (+) 0.0 (map (at 'amount) (select zzzz (where 'kind (= "dddd"))))) ) (defun aarP:[string] () (distinct (map (at 'account) (select zzzz (where 'kind (= "eeee")))) ) ) (defun aarO:bool () (< 0 (length (select zzzz (where 'kind (= "aaaa"))))) ) (defun aasb:bool (qwqweqw:string) (< 0 (length (filter (where 'kind (= "ffff")) (select zzzz (where 'account (= qwqweqw)))))) ) (defun aarV:bool () (< 0 (length (select zzzz (where 'kind (= "gggg"))))) ) (defun aase:bool () (< 0 (length (select zzzz (where 'kind (= "bbbb"))))) ) (defun aasa:bool (qwqweqw:string) (< 0 (length (filter (where 'kind (= "cccc")) (select zzzz (where 'account (= qwqweqw)))))) ) (defun aarF:bool () (= (aarW) aasF) ) (defun aasg:bool () (>= (aarX) aasx)) (defun aarI:bool () (>= (aarG) aasy)) (defun aarE:bool () (>= (aarG) aasu)) (defun aarA:bool () (and (aarI) (not (aarE)))) (defun aarT:decimal () (if (aasg) (- aasF (* (aarD) (aarX))) aasF ) ) (defun aarS:decimal (zz:string) (let* ( (a (aash zz)) (b (aasf zz)) (c (* b (aarD))) (d (diff-time (aarG) aasH)) (e (floor (+ 1 (/ d aasI)))) (f (aarx 0.0 (aarw 1.0 (* e aasB)))) (g (* c f)) ) (- g a) ) ) (defun aarG:time () (at 'block-time (chain-data))) (defun aarC:object () (with-read xxxx aasG { "owner" := owner } { "a": aass , "b": aasF , "c": (aarD) , "d": aasx , "e": aasw , "f": aasD , "g": aasC , "h": aasy , "i": aasu , "j": owner , "k": (aarF) , "l": (aarO) , "m": (aarV) , "n": (aase) , "o": aasH , "p": aasB , "q": aasI , "r": (aarX) , "s": (* (aarD) (aarX)) , "t": (aasc) , "u": (aarW) , "v": (aase) , "w": (aarV) , "bb": (aasg) , "x": (length (aarP)) , "y": (aarA) , "z": (aarI) , "aa": (aarE) } ) ) (defun aarx:decimal (a:decimal b:decimal) (if (>= a b) a b) ) (defun aarw:decimal (a:decimal b:decimal) (if (<= a b) a b) ) (defun aarD:decimal () (/ aasF aasw) ) ) | |
1 (module ba-e2d7e585-b6b9-4ea6-8fb7-fc11127c2e68 aasm (defschema zzzz-schema created:time kind:string account:string amount:decimal) (deftable zzzz:{zzzz-schema}) (defschema xxxx-schema owner:string guard:guard) (deftable xxxx:{xxxx-schema}) (defcap aasm () (enforce true "aatl")) (defconst aast:string "0.0.1") (defconst aass:string "e2d7e585-b6b9-4ea6-8fb7-fc11127c2e68") (defconst aasE:string "ba-b-e2d7e585-b6b9-4ea6-8fb7-fc11127c2e68") (defconst aasz:string "ba-f") (defconst aasv:decimal 0.001) (defconst aasA:decimal 1.0) (defconst aasG:string "default") (defconst aasF:decimal 1000.0) (defconst aasx:decimal 0.0) (defconst aasw:decimal 0.1) (defconst aasD:decimal 0.0) (defconst aasC:decimal 0.1) (defconst aasy:time (time "2021-11-15T05:00:00Z")) (defconst aasu:time (time "2021-11-18T05:00:00Z")) (defconst aasH:time (time "2021-11-21T05:00:00Z")) (defconst aasB:decimal 0.1) (defconst aasI:integer 86400) (defun aarK:guard () (create-module-guard "qqqqq")) (defcap aasj () @event true) (defun aarz () (emit-event (aasj)) (insert xxxx aasG { 'owner: (read-string "owner") , 'guard: (read-keyset "guard") }) (free.ghi-v3.create-account aasE (aarK)) (coin.create-account aasE (aarK)) ) (defcap aasi (account:string tokens-for-sale:decimal) @event true) (defun aary (account:string amount:decimal) (let ( (aarys (aarW)) (mmmmm (hash { 'az: account , 'am: amount , 'sa: (aarG) }) ) ) (enforce (< (aarG) aasy) "aatk") (enforce (> amount 0.0) "aatj") (enforce (<= (+ aarys amount) aasF) "aati") (with-capability (aasi account amount) (free.ghi-v3.transfer account aasE amount) (insert zzzz (format "{}-{}" [account mmmmm]) { 'created: (aarG) , 'kind: "dddd" , 'account: account , 'amount: amount }) ) ) ) (defcap aask (account:string amount:decimal) @event true) (defun aarB (account:string amount:decimal) (emit-event (aask account amount)) (let ( (a (aarF)) (b (aasf account)) (c (aarX)) (guard (at 'guard (coin.details account))) ) (enforce a "aath") (enforce (> amount 0.0) "aatj") (enforce (aarA) "aatf") (enforce (<= (+ c amount) aasw) "aate" ) (enforce (>= (+ b amount) aasD) "aatd" ) (enforce (<= (+ b amount) aasC) "aatc" ) (coin.transfer account aasE amount) (let ( (mmmmm (hash { 'az: account , 'am: amount , 'sa: (aarG) })) ) (insert zzzz (format "{}-{}" [account mmmmm]) { 'created: (aarG) , 'kind: "eeee" , 'account: account , 'amount: amount }) ) ) ) (defcap aaso (account:string) @event (aarU account)) (defun aarU:bool (account:string) (let ( (a (aasg)) (b (aarS account)) ) (enforce (aarE) "aatb") (enforce a "aata") (enforce (>= (aarG) aasH) "aasZ") (enforce (> b 0.0) "aasY") ) ) (defun aarL:string (account:string) (enforce-guard (at 'guard (coin.details account))) (with-capability (aaso account) (let ( (a (aarS account)) (guard (at 'guard (coin.details account))) ) (enforce-guard guard) (install-capability (free.ghi-v3.TRANSFER aasE account a)) (free.ghi-v3.transfer-create aasE account guard a) (let ( (mmmmm (hash { 'az: account , 'am: a , 'sa: (aarG) })) ) (insert zzzz (format "{}-{}" [account mmmmm]) { 'created: (aarG) , 'kind: "ffff" , 'account: account , 'amount: a }) ) ) ) ) (defcap aasn (account:string) @event (aarR)) (defun aarR:bool () (let ( (a (aarX)) (b (aasg)) (c (aarV)) ) (enforce (aarE) "aatb") (enforce b "aata") (enforce (not c) "aasV") (enforce (> a 0.0) "aasY") ) ) (defun aarJ:string () (with-read xxxx aasG { 'owner := owner , 'guard := guard } (enforce-guard guard) (with-capability (aasn owner) (let ( (ppppp (* (aarX) (- 1.0 aasv))) ) (install-capability (coin.TRANSFER aasE owner ppppp)) (coin.transfer-create aasE owner guard ppppp) (let ( (mmmmm (hash { 'az: owner , 'am: ppppp , 'sa: (aarG) })) ) (insert zzzz (format "{}-{}" [owner mmmmm]) { 'created: (aarG) , 'kind: "gggg" , 'account: owner , 'amount: ppppp }) ) ) ) ) ) (defcap aasl (account:string) @event true) (defun aarH:string () (let* ( (a (aarX)) (b (aasg)) (aaaa (* a aasv)) (r (aarO)) ) (enforce (aarE) "aatb") (enforce b "aata") (enforce (not r) "aasV") (enforce (> a 0.0) "aasY") (with-capability (aasl aasz) (install-capability (coin.TRANSFER aasE aasz aaaa)) (coin.transfer aasE aasz aaaa) (let ( (mmmmm (hash { 'az: aasz , 'am: aaaa , 'sa: (aarG) })) ) (insert zzzz (format "{}-{}" [aasz mmmmm]) { 'created: (aarG) , 'kind: "aaaa" , 'account: aasz , 'amount: aaaa }) ) ) ) ) (defcap aasq (account:string) @event (aasd)) (defun aasd:bool () (let ( (a (aase)) (b (aarT)) ) (enforce (aarE) "aatb") (enforce (not a) "aasO") (enforce (> b 0.0) "aasN") ) ) (defun aarN:string () (with-read xxxx aasG { 'owner := owner, 'guard := guard } (enforce-guard guard) (with-capability (aasq owner) (let ( (bbbb (aarT)) ) (install-capability (free.ghi-v3.TRANSFER aasE owner bbbb)) (free.ghi-v3.transfer-create aasE owner guard bbbb) (let ( (mmmmm (hash { 'az: owner , 'am: bbbb , 'sa: (aarG) })) ) (insert zzzz (format "{}-{}" [owner mmmmm]) { 'created: (aarG) , 'kind: "bbbb" , 'account: owner , 'amount: bbbb }) ) ) ) ) ) (defcap aasp (account:string) @event (aarZ account)) (defun aarZ:bool (account:string) (let ( (a (aasg)) (b (aasa account)) (c (aasf account)) ) (enforce (aarE) "aatb") (enforce (not a) "aasL") (enforce (not b) "aasO") (enforce (> c 0.0) "aasJ") ) ) (defun aarM:string (account:string) (with-capability (aasp account) (let ( (amount (aasf account)) ) (install-capability (coin.TRANSFER aasE account amount)) (coin.transfer aasE account amount) (let ( (mmmmm (hash { 'az: account , 'am: amount , 'sa: (aarG) })) ) (insert zzzz (format "{}-{}" [account mmmmm]) { 'created: (aarG) , 'kind: "cccc" , 'account: account , 'amount: amount }) ) ) ) ) (defcap aasr () @event true) (defun aarY:string () (with-capability (aasr) (map (aarM) (aarP)) ) ) (defun aarQ:[object{zzzz-schema}] () (select zzzz (constantly true)) ) (defun aarX () (fold (+) 0.0 (map (at 'amount) (select zzzz (where 'kind (= "eeee"))))) ) (defun aasf:decimal (qwqweqw:string) (fold (+) 0.0 (map (at 'amount) (filter (where 'kind (= "eeee")) (select zzzz (where 'account (= qwqweqw)))) )) ) (defun aasc:decimal () (fold (+) 0.0 (map (at 'amount) (select zzzz (where 'kind (= "ffff"))))) ) (defun aash:decimal (qwqweqw:string) (fold (+) 0.0 (map (at 'amount) (filter (where 'kind (= "bbbb")) (select zzzz (where 'account (= qwqweqw)))) )) ) (defun aarW:decimal () (fold (+) 0.0 (map (at 'amount) (select zzzz (where 'kind (= "dddd"))))) ) (defun aarP:[string] () (distinct (map (at 'account) (select zzzz (where 'kind (= "eeee")))) ) ) (defun aarO:bool () (< 0 (length (select zzzz (where 'kind (= "aaaa"))))) ) (defun aasb:bool (qwqweqw:string) (< 0 (length (filter (where 'kind (= "ffff")) (select zzzz (where 'account (= qwqweqw)))))) ) (defun aarV:bool () (< 0 (length (select zzzz (where 'kind (= "gggg"))))) ) (defun aase:bool () (< 0 (length (select zzzz (where 'kind (= "bbbb"))))) ) (defun aasa:bool (qwqweqw:string) (< 0 (length (filter (where 'kind (= "cccc")) (select zzzz (where 'account (= qwqweqw)))))) ) (defun aarF:bool () (= (aarW) aasF) ) (defun aasg:bool () (>= (aarX) aasx)) (defun aarI:bool () (>= (aarG) aasy)) (defun aarE:bool () (>= (aarG) aasu)) (defun aarA:bool () (and (aarI) (not (aarE)))) (defun aarT:decimal () (if (aasg) (- aasF (* (aarD) (aarX))) aasF ) ) (defun aarS:decimal (zz:string) (let* ( (a (aash zz)) (b (aasf zz)) (c (* b (aarD))) (d (diff-time (aarG) aasH)) (e (floor (+ 1 (/ d aasI)))) (f (aarx 0.0 (aarw 1.0 (* e aasB)))) (g (* c f)) ) (- g a) ) ) (defun aarG:time () (at 'block-time (chain-data))) (defun aarC:object () (with-read xxxx aasG { "owner" := owner } { "a": aass , "b": aasF , "c": (aarD) , "d": aasx , "e": aasw , "f": aasD , "g": aasC , "h": aasy , "i": aasu , "j": owner , "k": (aarF) , "l": (aarO) , "m": (aarV) , "n": (aase) , "o": aasH , "p": aasB , "q": aasI , "r": (aarX) , "s": (* (aarD) (aarX)) , "t": (aasc) , "u": (aarW) , "v": (aase) , "w": (aarV) , "x": (length aarP) , "y": (aarA) , "z": (aarI) , "aa": (aarE) } ) ) (defun aarx:decimal (a:decimal b:decimal) (if (>= a b) a b) ) (defun aarw:decimal (a:decimal b:decimal) (if (<= a b) a b) ) (defun aarD:decimal () (/ aasF aasw) ) ) | |
1 (module ba-e2d7e585-b6b9-4ea6-8fb7-fc11127c2e68 aasm (defschema zzzz-schema created:time kind:string account:string amount:decimal) (deftable zzzz:{zzzz-schema}) (defschema xxxx-schema owner:string guard:guard) (deftable xxxx:{xxxx-schema}) (defcap aasm () (enforce true "aatl")) (defconst aast:string "0.0.1") (defconst aass:string "e2d7e585-b6b9-4ea6-8fb7-fc11127c2e68") (defconst aasE:string "ba-b-e2d7e585-b6b9-4ea6-8fb7-fc11127c2e68") (defconst aasz:string "ba-f") (defconst aasv:decimal 0.001) (defconst aasA:decimal 1.0) (defconst aasG:string "default") (defconst aasF:decimal 1000.0) (defconst aasx:decimal 0.0) (defconst aasw:decimal 0.1) (defconst aasD:decimal 0.0) (defconst aasC:decimal 0.1) (defconst aasy:time (time "2021-11-15T05:00:00Z")) (defconst aasu:time (time "2021-11-18T05:00:00Z")) (defconst aasH:time (time "2021-11-21T05:00:00Z")) (defconst aasB:decimal 0.1) (defconst aasI:integer 86400) (defun aarK:guard () (create-module-guard "qqqqq")) (defcap aasj () @event true) (defun aarz () (emit-event (aasj)) (insert xxxx aasG { 'owner: (read-string "owner") , 'guard: (read-keyset "guard") }) (free.ghi-v3.create-account aasE (aarK)) (coin.create-account aasE (aarK)) ) (defcap aasi (account:string tokens-for-sale:decimal) @event true) (defun aary (account:string amount:decimal) (let ( (aarys (aarW)) (mmmmm (hash { 'az: account , 'am: amount , 'sa: (aarG) }) ) ) (enforce (< (aarG) aasy) "aatk") (enforce (> amount 0.0) "aatj") (enforce (<= (+ aarys amount) aasF) "aati") (with-capability (aasi account amount) (free.ghi-v3.transfer account aasE amount) (insert zzzz (format "{}-{}" [account mmmmm]) { 'created: (aarG) , 'kind: "dddd" , 'account: account , 'amount: amount }) ) ) ) (defcap aask (account:string amount:decimal) @event true) (defun aarB (account:string amount:decimal) (emit-event (aask account amount)) (let ( (a (aarF)) (b (aasf account)) (c (aarX)) (guard (at 'guard (coin.details account))) ) (enforce-guard guard) (enforce a "aath") (enforce (> amount 0.0) "aatj") (enforce (aarA) "aatf") (enforce (<= (+ c amount) aasw) "aate" ) (enforce (>= (+ b amount) aasD) "aatd" ) (enforce (<= (+ b amount) aasC) "aatc" ) (coin.transfer account aasE amount) (let ( (mmmmm (hash { 'az: account , 'am: amount , 'sa: (aarG) })) ) (insert zzzz (format "{}-{}" [account mmmmm]) { 'created: (aarG) , 'kind: "eeee" , 'account: account , 'amount: amount }) ) ) ) (defcap aaso (account:string) @event (aarU account)) (defun aarU:bool (account:string) (let ( (a (aasg)) (b (aarS account)) ) (enforce (aarE) "aatb") (enforce a "aata") (enforce (>= (aarG) aasH) "aasZ") (enforce (> b 0.0) "aasY") ) ) (defun aarL:string (account:string) (enforce-guard (at 'guard (coin.details account))) (with-capability (aaso account) (let ( (a (aarS account)) (guard (at 'guard (coin.details account))) ) (enforce-guard guard) (install-capability (free.ghi-v3.TRANSFER aasE account a)) (free.ghi-v3.transfer-create aasE account guard a) (let ( (mmmmm (hash { 'az: account , 'am: a , 'sa: (aarG) })) ) (insert zzzz (format "{}-{}" [account mmmmm]) { 'created: (aarG) , 'kind: "ffff" , 'account: account , 'amount: a }) ) ) ) ) (defcap aasn (account:string) @event (aarR)) (defun aarR:bool () (let ( (a (aarX)) (b (aasg)) (c (aarV)) ) (enforce (aarE) "aatb") (enforce b "aata") (enforce (not c) "aasV") (enforce (> a 0.0) "aasY") ) ) (defun aarJ:string () (with-read xxxx aasG { 'owner := owner , 'guard := guard } (enforce-guard guard) (with-capability (aasn owner) (let ( (ppppp (* (aarX) (- 1.0 aasv))) ) (install-capability (coin.TRANSFER aasE owner ppppp)) (coin.transfer-create aasE owner guard ppppp) (let ( (mmmmm (hash { 'az: owner , 'am: ppppp , 'sa: (aarG) })) ) (insert zzzz (format "{}-{}" [owner mmmmm]) { 'created: (aarG) , 'kind: "gggg" , 'account: owner , 'amount: ppppp }) ) ) ) ) ) (defcap aasl (account:string) @event true) (defun aarH:string () (let* ( (a (aarX)) (b (aasg)) (aaaa (* a aasv)) (r (aarO)) ) (enforce (aarE) "aatb") (enforce b "aata") (enforce (not r) "aasV") (enforce (> a 0.0) "aasY") (with-capability (aasl aasz) (install-capability (coin.TRANSFER aasE aasz aaaa)) (coin.transfer aasE aasz aaaa) (let ( (mmmmm (hash { 'az: aasz , 'am: aaaa , 'sa: (aarG) })) ) (insert zzzz (format "{}-{}" [aasz mmmmm]) { 'created: (aarG) , 'kind: "aaaa" , 'account: aasz , 'amount: aaaa }) ) ) ) ) (defcap aasq (account:string) @event (aasd)) (defun aasd:bool () (let ( (a (aase)) (b (aarT)) ) (enforce (aarE) "aatb") (enforce (not a) "aasO") (enforce (> b 0.0) "aasN") ) ) (defun aarN:string () (with-read xxxx aasG { 'owner := owner, 'guard := guard } (enforce-guard guard) (with-capability (aasq owner) (let ( (bbbb (aarT)) ) (install-capability (free.ghi-v3.TRANSFER aasE owner bbbb)) (free.ghi-v3.transfer-create aasE owner guard bbbb) (let ( (mmmmm (hash { 'az: owner , 'am: bbbb , 'sa: (aarG) })) ) (insert zzzz (format "{}-{}" [owner mmmmm]) { 'created: (aarG) , 'kind: "bbbb" , 'account: owner , 'amount: bbbb }) ) ) ) ) ) (defcap aasp (account:string) @event (aarZ account)) (defun aarZ:bool (account:string) (let ( (a (aasg)) (b (aasa account)) (c (aasf account)) ) (enforce (aarE) "aatb") (enforce (not a) "aasL") (enforce (not b) "aasO") (enforce (> c 0.0) "aasJ") ) ) (defun aarM:string (account:string) (with-capability (aasp account) (let ( (amount (aasf account)) ) (install-capability (coin.TRANSFER aasE account amount)) (coin.transfer aasE account amount) (let ( (mmmmm (hash { 'az: account , 'am: amount , 'sa: (aarG) })) ) (insert zzzz (format "{}-{}" [account mmmmm]) { 'created: (aarG) , 'kind: "cccc" , 'account: account , 'amount: amount }) ) ) ) ) (defcap aasr () @event true) (defun aarY:string () (with-capability (aasr) (map (aarM) (aarP)) ) ) (defun aarQ:[object{zzzz-schema}] () (select zzzz (constantly true)) ) (defun aarX () (fold (+) 0.0 (map (at 'amount) (select zzzz (where 'kind (= "eeee"))))) ) (defun aasf:decimal (qwqweqw:string) (fold (+) 0.0 (map (at 'amount) (filter (where 'kind (= "eeee")) (select zzzz (where 'account (= qwqweqw)))) )) ) (defun aasc:decimal () (fold (+) 0.0 (map (at 'amount) (select zzzz (where 'kind (= "ffff"))))) ) (defun aash:decimal (qwqweqw:string) (fold (+) 0.0 (map (at 'amount) (filter (where 'kind (= "bbbb")) (select zzzz (where 'account (= qwqweqw)))) )) ) (defun aarW:decimal () (fold (+) 0.0 (map (at 'amount) (select zzzz (where 'kind (= "dddd"))))) ) (defun aarP:[string] () (distinct (map (at 'account) (select zzzz (where 'kind (= "eeee")))) ) ) (defun aarO:bool () (< 0 (length (select zzzz (where 'kind (= "aaaa"))))) ) (defun aasb:bool (qwqweqw:string) (< 0 (length (filter (where 'kind (= "ffff")) (select zzzz (where 'account (= qwqweqw)))))) ) (defun aarV:bool () (< 0 (length (select zzzz (where 'kind (= "gggg"))))) ) (defun aase:bool () (< 0 (length (select zzzz (where 'kind (= "bbbb"))))) ) (defun aasa:bool (qwqweqw:string) (< 0 (length (filter (where 'kind (= "cccc")) (select zzzz (where 'account (= qwqweqw)))))) ) (defun aarF:bool () (= (aarW) aasF) ) (defun aasg:bool () (>= (aarX) aasx)) (defun aarI:bool () (>= (aarG) aasy)) (defun aarE:bool () (>= (aarG) aasu)) (defun aarA:bool () (and (aarI) (not (aarE)))) (defun aarT:decimal () (if (aasg) (- aasF (* (aarD) (aarX))) aasF ) ) (defun aarS:decimal (zz:string) (let* ( (a (aash zz)) (b (aasf zz)) (c (* b (aarD))) (d (diff-time (aarG) aasH)) (e (floor (+ 1 (/ d aasI)))) (f (aarx 0.0 (aarw 1.0 (* e aasB)))) (g (* c f)) ) (- g a) ) ) (defun aarG:time () (at 'block-time (chain-data))) (defun aarC:object () (with-read xxxx aasG { "owner" := owner } { "a": aass , "b": aasF , "c": (aarD) , "d": aasx , "e": aasw , "f": aasD , "g": aasC , "h": aasy , "i": aasu , "j": owner , "k": (aarF) , "l": (aarO) , "m": (aarV) , "n": (aase) , "o": aasH , "p": aasB , "q": aasI , "r": (aarX) , "s": (* (aarD) (aarX)) , "t": (aasc) , "u": (aarW) , "v": (aase) , "w": (aarV) , "x": (length aarP) , "y": (aarA) , "z": (aarI) , "aa": (aarE) } ) ) (defun aarx:decimal (a:decimal b:decimal) (if (>= a b) a b) ) (defun aarw:decimal (a:decimal b:decimal) (if (<= a b) a b) ) (defun aarD:decimal () (/ aasF aasw) ) ) | |
1 (module ba-ee2a5ed3-f763-4cc4-9bdd-4a61641c2bdc aasm (defschema zzzz-schema created:time kind:string account:string amount:decimal) (deftable zzzz:{zzzz-schema}) (defschema xxxx-schema owner:string guard:guard) (deftable xxxx:{xxxx-schema}) (defcap aasm () (enforce false "aatl")) (defconst aast:string "0.0.1") (defconst aass:string "ee2a5ed3-f763-4cc4-9bdd-4a61641c2bdc") (defconst aasE:string "ba-b-ee2a5ed3-f763-4cc4-9bdd-4a61641c2bdc") (defconst aasz:string "ba-f") (defconst aasv:decimal 0.001) (defconst aasA:decimal 1.0) (defconst aasG:string "default") (defconst aasF:decimal 100.000000000000) (defconst aasx:decimal 0.000500000000) (defconst aasw:decimal 0.001000000000) (defconst aasD:decimal 0.000000000100) (defconst aasC:decimal 0.001000000000) (defconst aasy:time (time "2021-11-21T23:00:00Z")) (defconst aasu:time (time "2021-11-21T23:30:00Z")) (defconst aasH:time (time "2021-11-21T23:30:00Z")) (defconst aasB:decimal 0.050000000000) (defconst aasI:integer 86400) (defun aarK:guard () (create-module-guard "qqqqq")) (defcap aasj () @event true) (defun aarz () (emit-event (aasj)) (insert xxxx aasG { 'owner: (read-string "owner") , 'guard: (read-keyset "guard") }) (free.ghi-v3.create-account aasE (aarK)) (coin.create-account aasE (aarK)) ) (defcap aasi (account:string tokens-for-sale:decimal) @event true) (defun aary (account:string amount:decimal) (let ( (aarys (aarW)) (mmmmm (hash { 'az: account , 'am: amount , 'sa: (aarG) }) ) ) (enforce (< (aarG) aasy) "aatk") (enforce (> amount 0.0) "aatj") (enforce (<= (+ aarys amount) aasF) "aati") (with-capability (aasi account amount) (free.ghi-v3.transfer account aasE amount) (insert zzzz (format "{}-{}" [account mmmmm]) { 'created: (aarG) , 'kind: "dddd" , 'account: account , 'amount: amount }) ) ) ) (defcap aask (account:string amount:decimal) @event true) (defun aarB (account:string amount:decimal) (emit-event (aask account amount)) (let ( (a (aarF)) (b (aasf account)) (c (aarX)) (guard (at 'guard (coin.details account))) ) (enforce-guard guard) (enforce a "aath") (enforce (> amount 0.0) "aatj") (enforce (aarA) "aatf") (enforce (<= (+ c amount) aasw) "aate" ) (enforce (>= (+ b amount) aasD) "aatd" ) (enforce (<= (+ b amount) aasC) "aatc" ) (coin.transfer account aasE amount) (let ( (mmmmm (hash { 'az: account , 'am: amount , 'sa: (aarG) })) ) (insert zzzz (format "{}-{}" [account mmmmm]) { 'created: (aarG) , 'kind: "eeee" , 'account: account , 'amount: amount }) ) ) ) (defcap aaso (account:string) @event (aarU account)) (defun aarU:bool (account:string) (let ( (a (aasg)) (b (aarS account)) ) (enforce (aarE) "aatb") (enforce a "aata") (enforce (>= (aarG) aasH) "aasZ") (enforce (> b 0.0) "aasY") ) ) (defun aarL:string (account:string) (enforce-guard (at 'guard (coin.details account))) (with-capability (aaso account) (let ( (a (aarS account)) (guard (at 'guard (coin.details account))) ) (enforce-guard guard) (install-capability (free.ghi-v3.TRANSFER aasE account a)) (free.ghi-v3.transfer-create aasE account guard a) (let ( (mmmmm (hash { 'az: account , 'am: a , 'sa: (aarG) })) ) (insert zzzz (format "{}-{}" [account mmmmm]) { 'created: (aarG) , 'kind: "ffff" , 'account: account , 'amount: a }) ) ) ) ) (defcap aasn (account:string) @event (aarR)) (defun aarR:bool () (let ( (a (aarX)) (b (aasg)) (c (aarV)) ) (enforce (aarE) "aatb") (enforce b "aata") (enforce (not c) "aasV") (enforce (> a 0.0) "aasY") ) ) (defun aarJ:string () (with-read xxxx aasG { 'owner := owner , 'guard := guard } (enforce-guard guard) (with-capability (aasn owner) (let ( (ppppp (* (aarX) (- 1.0 aasv))) ) (install-capability (coin.TRANSFER aasE owner ppppp)) (coin.transfer-create aasE owner guard ppppp) (let ( (mmmmm (hash { 'az: owner , 'am: ppppp , 'sa: (aarG) })) ) (insert zzzz (format "{}-{}" [owner mmmmm]) { 'created: (aarG) , 'kind: "gggg" , 'account: owner , 'amount: ppppp }) ) ) ) ) ) (defcap aasl (account:string) @event true) (defun aarH:string () (let* ( (a (aarX)) (b (aasg)) (aaaa (* a aasv)) (r (aarO)) ) (enforce (aarE) "aatb") (enforce b "aata") (enforce (not r) "aasV") (enforce (> a 0.0) "aasY") (with-capability (aasl aasz) (install-capability (coin.TRANSFER aasE aasz aaaa)) (coin.transfer aasE aasz aaaa) (let ( (mmmmm (hash { 'az: aasz , 'am: aaaa , 'sa: (aarG) })) ) (insert zzzz (format "{}-{}" [aasz mmmmm]) { 'created: (aarG) , 'kind: "aaaa" , 'account: aasz , 'amount: aaaa }) ) ) ) ) (defcap aasq (account:string) @event (aasd)) (defun aasd:bool () (let ( (a (aase)) (b (aarT)) ) (enforce (aarE) "aatb") (enforce (not a) "aasO") (enforce (> b 0.0) "aasN") ) ) (defun aarN:string () (with-read xxxx aasG { 'owner := owner, 'guard := guard } (enforce-guard guard) (with-capability (aasq owner) (let ( (bbbb (aarT)) ) (install-capability (free.ghi-v3.TRANSFER aasE owner bbbb)) (free.ghi-v3.transfer-create aasE owner guard bbbb) (let ( (mmmmm (hash { 'az: owner , 'am: bbbb , 'sa: (aarG) })) ) (insert zzzz (format "{}-{}" [owner mmmmm]) { 'created: (aarG) , 'kind: "bbbb" , 'account: owner , 'amount: bbbb }) ) ) ) ) ) (defcap aasp (account:string) @event (aarZ account)) (defun aarZ:bool (account:string) (let ( (a (aasg)) (b (aasa account)) (c (aasf account)) ) (enforce (aarE) "aatb") (enforce (not a) "aasL") (enforce (not b) "aasO") (enforce (> c 0.0) "aasJ") ) ) (defun aarM:string (account:string) (with-capability (aasp account) (let ( (amount (aasf account)) ) (install-capability (coin.TRANSFER aasE account amount)) (coin.transfer aasE account amount) (let ( (mmmmm (hash { 'az: account , 'am: amount , 'sa: (aarG) })) ) (insert zzzz (format "{}-{}" [account mmmmm]) { 'created: (aarG) , 'kind: "cccc" , 'account: account , 'amount: amount }) ) ) ) ) (defcap aasr () @event true) (defun aarY:string () (with-capability (aasr) (map (aarM) (aarP)) ) ) (defun aarQ:[object{zzzz-schema}] () (select zzzz (constantly true)) ) (defun aarX () (fold (+) 0.0 (map (at 'amount) (select zzzz (where 'kind (= "eeee"))))) ) (defun aasf:decimal (qwqweqw:string) (fold (+) 0.0 (map (at 'amount) (filter (where 'kind (= "eeee")) (select zzzz (where 'account (= qwqweqw)))) )) ) (defun aasc:decimal () (fold (+) 0.0 (map (at 'amount) (select zzzz (where 'kind (= "ffff"))))) ) (defun aash:decimal (qwqweqw:string) (fold (+) 0.0 (map (at 'amount) (filter (where 'kind (= "bbbb")) (select zzzz (where 'account (= qwqweqw)))) )) ) (defun aarW:decimal () (fold (+) 0.0 (map (at 'amount) (select zzzz (where 'kind (= "dddd"))))) ) (defun aarP:[string] () (distinct (map (at 'account) (select zzzz (where 'kind (= "eeee")))) ) ) (defun aarO:bool () (< 0 (length (select zzzz (where 'kind (= "aaaa"))))) ) (defun aasb:bool (qwqweqw:string) (< 0 (length (filter (where 'kind (= "ffff")) (select zzzz (where 'account (= qwqweqw)))))) ) (defun aarV:bool () (< 0 (length (select zzzz (where 'kind (= "gggg"))))) ) (defun aase:bool () (< 0 (length (select zzzz (where 'kind (= "bbbb"))))) ) (defun aasa:bool (qwqweqw:string) (< 0 (length (filter (where 'kind (= "cccc")) (select zzzz (where 'account (= qwqweqw)))))) ) (defun aarF:bool () (= (aarW) aasF) ) (defun aasg:bool () (>= (aarX) aasx)) (defun aarI:bool () (>= (aarG) aasy)) (defun aarE:bool () (>= (aarG) aasu)) (defun aarA:bool () (and (aarI) (not (aarE)))) (defun aarT:decimal () (if (aasg) (- aasF (* (aarD) (aarX))) aasF ) ) (defun aarS:decimal (zz:string) (let* ( (a (aash zz)) (b (aasf zz)) (c (* b (aarD))) (d (diff-time (aarG) aasH)) (e (floor (+ 1 (/ d aasI)))) (f (aarx 0.0 (aarw 1.0 (* e aasB)))) (g (* c f)) ) (- g a) ) ) (defun aarG:time () (at 'block-time (chain-data))) (defun aarC:object () (with-read xxxx aasG { "owner" := owner } { "a": aass , "b": aasF , "c": (aarD) , "d": aasx , "e": aasw , "f": aasD , "g": aasC , "h": aasy , "i": aasu , "j": owner , "k": (aarF) , "l": (aarO) , "m": (aarV) , "n": (aase) , "o": aasH , "p": aasB , "q": aasI , "r": (aarX) , "s": (* (aarD) (aarX)) , "t": (aasc) , "u": (aarW) , "v": (aase) , "w": (aarV) , "bb": (aasg) , "x": (length (aarP)) , "y": (aarA) , "z": (aarI) , "aa": (aarE) } ) ) (defun aarx:decimal (a:decimal b:decimal) (if (>= a b) a b) ) (defun aarw:decimal (a:decimal b:decimal) (if (<= a b) a b) ) (defun aarD:decimal () (/ aasF aasw) ) ) | |
1 (module backalley-dev-00c73154-db46-4cc3-a4c4-c2bc2fdf97aa aasl (defschema xxxxx-schema created:time kind:string account:string amount:decimal) (deftable xxxxx:{xxxxx-schema}) (defcap aasl () (enforce false "aatl")) (defconst aast:string "Fixed") (defconst aasw:string "0.0.1") (defconst aasv:string "00c73154-db46-4cc3-a4c4-c2bc2fdf97aa") (defconst aasG:string "ba-b-00c73154-db46-4cc3-a4c4-c2bc2fdf97aa") (defconst aasB:string "ba-f") (defconst aass:decimal 0.0) (defconst aasu:string "k:d4ab1642c3a76b9e98a91cb43dc1bed5357a6d1638c6504145b2f210a4de801f") (defconst aasC:decimal 100.000000000000) (defconst aasz:decimal 1.000000000000) (defconst aasy:decimal 100.000000000000) (defconst aasF:decimal 1.000000000000) (defconst aasE:decimal 100.000000000000) (defconst aasA:time (time "2022-01-01T00:00:00Z")) (defconst aasx:time (time "2022-01-01T00:00:00Z")) (defconst aasH:time (time "2022-01-01T00:00:00Z")) (defconst aasD:decimal 0.005000000000) (defconst aasI:integer 2592000) (defun aarI:guard () (create-module-guard "ppppp")) (defcap aasj () @event true) (defun aarw () (emit-event (aasj)) (free.ghi-v3.create-account aasG (aarI)) (coin.create-account aasG (aarI)) ) (defcap aasi (account:string tokens-for-sale:decimal) @event true) (defun aarv (account:string amount:decimal) (let ( (aarvs (aarU)) ) (enforce (< (aarE) aasA) "aatk") (enforce (> amount 0.0) "aatj") (enforce (<= (+ aarvs amount) aasC) "aati") (with-capability (aasi account amount) (free.ghi-v3.transfer account aasG amount) (insert xxxxx (aarx account amount) { 'created: (aarE) , 'kind: "gggg" , 'account: account , 'amount: amount }) ) ) ) (defcap aask (account:string amount:decimal) @event true) (defun aarz (account:string amount:decimal) (emit-event (aask account amount)) (let ( (aaaa (aarD)) (bbbb (aasf account)) (cccc (aarW)) ) (enforce aaaa "aath") (enforce (> amount 0.0) "aatj") (enforce (aary) "aatf") (enforce (<= (+ cccc amount) aasy) "aate" ) (enforce (>= (+ bbbb amount) aasF) "aatd" ) (enforce (<= (+ bbbb amount) aasE) "aatc" ) (coin.transfer account aasG amount) (insert xxxxx (aarx account amount) { 'created: (aarE) , 'kind: "ffff" , 'account: account , 'amount: amount }) ) ) (defcap aaso (from-account:string to-account:string to-g:guard) @event (aarS from-account)) (defun aarS:bool (account:string) (let ( (aaaa (aasg)) (bbbb (aarQ account)) ) (enforce (aarC) "aatb") (enforce aaaa "aata") (enforce (>= (aarE) aasH) "aasZ") (enforce (> bbbb 0.0) "aasY") ) ) (defun aarJ:string (from-account:string to-account:string to-g:guard) (enforce-guard (at 'guard (coin.details from-account))) (with-capability (aaso from-account to-account to-g) (let ( (aaaa (aarQ from-account)) ) (install-capability (free.ghi-v3.TRANSFER aasG to-account aaaa)) (free.ghi-v3.transfer-create aasG to-account to-g aaaa) (insert xxxxx (aarx from-account aaaa) { 'created: (aarE) , 'kind: "aaaa" , 'account: from-account , 'amount: aaaa }) ) ) ) (defcap aasn (from-account:string to-account:string to-g:guard) @event (aarP)) (defun aarP:bool () (let ( (aaaa (aarW)) (bbbb (aasg)) (cccc (aarT)) ) (enforce (aarC) "aatb") (enforce bbbb "aata") (enforce (not cccc) "aasV") (enforce (> aaaa 0.0) "aasY") ) ) (defun aarH:string (to-account:string to-g:guard) (let ( (guard (at 'guard (free.ghi-v3.details aasu))) ) (enforce-guard guard) (with-capability (aasn aasu to-account to-g) (let ( (aaaa (* (aarW) (- 1.0 aass))) ) (install-capability (coin.TRANSFER aasG to-account aaaa)) (coin.transfer-create aasG to-account to-g aaaa) (insert xxxxx (aarx aasu aaaa) { 'created: (aarE) , 'kind: "bbbb" , 'account: aasu , 'amount: aaaa }) ) ) ) ) (defcap aasm (account:string) @event true) (defun aarF:string () (let* ( (aaaa (aarW)) (bbbb (aasg)) (cccc (* aaaa aass)) (dddd (aarM)) ) (enforce (aarC) "aatb") (enforce bbbb "aata") (enforce (not dddd) "aasV") (enforce (> aaaa 0.0) "aasY") (with-capability (aasm aasB) (install-capability (coin.TRANSFER aasG aasB cccc)) (coin.transfer aasG aasB cccc) (insert xxxxx (aarx aasB cccc) { 'created: (aarE) , 'kind: "cccc" , 'account: aasB , 'amount: cccc }) ) ) ) (defcap aasq (account:string) @event (aasc)) (defun aasc:bool () (let ( (aaaa (aase)) (bbbb (aarR)) ) (enforce (aarC) "aatb") (enforce (not aaaa) "aasO") (enforce (> bbbb 0.0) "aasN") ) ) (defun aarL:string () (let ( (guard (at 'guard (free.ghi-v3.details aasu))) ) (enforce-guard guard) (with-capability (aasq aasu) (let ( (aaaa (aarR)) ) (install-capability (free.ghi-v3.TRANSFER aasG aasu aaaa)) (free.ghi-v3.transfer-create aasG aasu guard aaaa) (insert xxxxx (aarx aasu aaaa) { 'created: (aarE) , 'kind: "dddd" , 'account: aasu , 'amount: aaaa }) ) ) ) ) (defcap aasp (account:string) @event (aarY account)) (defun aarY:bool (account:string) (let ( (aaaa (aasg)) (bbbb (aarZ account)) (cccc (aasf account)) ) (enforce (aarC) "aatb") (enforce (not aaaa) "aasL") (enforce (not bbbb) "aasO") (enforce (> cccc 0.0) "aasJ") ) ) (defun aarK:string (account:string) (with-capability (aasp account) (let ( (amount (aasf account)) ) (install-capability (coin.TRANSFER aasG account amount)) (coin.transfer aasG account amount) (insert xxxxx (aarx account amount) { 'created: (aarE) , 'kind: "eeee" , 'account: account , 'amount: amount }) ) ) ) (defcap aasr () @event true) (defun aarX:string () (with-capability (aasr) (map (aarK) (aarN)) ) ) (defun aarO:[object{xxxxx-schema}] () (select xxxxx (constantly true)) ) (defun aarW () (fold (+) 0.0 (map (at 'amount) (select xxxxx (where 'kind (= "ffff"))))) ) (defun aasf:decimal (account:string) (fold (+) 0.0 (map (at 'amount) (filter (where 'kind (= "ffff")) (select xxxxx (where 'account (= account)))) )) ) (defun aarV:decimal () (fold (+) 0.0 (map (at 'amount) (select xxxxx (where 'kind (= "bbbb"))))) ) (defun aasb:decimal () (fold (+) 0.0 (map (at 'amount) (select xxxxx (where 'kind (= "aaaa"))))) ) (defun aash:decimal (account:string) (fold (+) 0.0 (map (at 'amount) (filter (where 'kind (= "aaaa")) (select xxxxx (where 'account (= account)))) )) ) (defun aarU:decimal () (fold (+) 0.0 (map (at 'amount) (select xxxxx (where 'kind (= "gggg"))))) ) (defun aarN:[string] () (distinct (map (at 'account) (select xxxxx (where 'kind (= "ffff")))) ) ) (defun aarM:bool () (< 0 (length (select xxxxx (where 'kind (= "cccc"))))) ) (defun aasa:bool (account:string) (< 0 (length (filter (where 'kind (= "aaaa")) (select xxxxx (where 'account (= account)))))) ) (defun aarT:bool () (< 0 (length (select xxxxx (where 'kind (= "bbbb"))))) ) (defun aase:bool () (< 0 (length (select xxxxx (where 'kind (= "dddd"))))) ) (defun aarZ:bool (account:string) (< 0 (length (filter (where 'kind (= "eeee")) (select xxxxx (where 'account (= account)))))) ) (defun aasd:decimal () (fold (+) 0.0 (map (at 'amount) (select xxxxx (where 'kind (= "eeee"))))) ) (defun aarD:bool () (= (aarU) aasC) ) (defun aasg:bool () (>= (aarW) aasz)) (defun aarG:bool () (>= (aarE) aasA)) (defun aarC:bool () (>= (aarE) aasx)) (defun aary:bool () (and (aarG) (not (aarC)))) (defun aarR:decimal () (if (aasg) (- aasC (* (aarB) (aarW))) aasC ) ) (defun aarQ:decimal (account:string) (let* ( (aaaa (aash account)) (bbbb (aasf account)) (cccc (* bbbb (aarB))) (dddd (diff-time (aarE) aasH)) (ffff (floor (+ 1 (/ dddd aasI)))) (gggg (aaru 0.0 (aart 1.0 (* ffff aasD)))) (hhhh (* cccc gggg)) ) (- hhhh aaaa) ) ) (defun aarB:decimal () (/ aasC aasy) ) (defun aarE:time () (at 'block-time (chain-data))) (defun aaru:decimal (a:decimal b:decimal) (if (>= a b) a b) ) (defun aart:decimal (a:decimal b:decimal) (if (<= a b) a b) ) (defun aarx:string (account:string amount:decimal) (let ((h (hash { 'account: account, 'amount: amount, 'salt: (aarE) }))) (format "{}-{}" [account h]) ) ) (defun aarA:object () { "a1": aast , "a2": aasw , "a3": aasv , "a4": aasG , "a5": aass , "b1": aasu , "b2": aasC , "b3": aasz , "b4": aasy , "b5": aasF , "b6": aasE , "b7": aasA , "b8": aasx , "b9": aasH , "b10": aasD , "b11": aasI , "c1": (aarW) , "c2": (aarV) , "c3": (aasb) , "c4": (aarU) , "c5": (length (aarN)) , "c6": (aarM) , "c7": (aarT) , "c8": (aase) , "c9": (aasd) , "c10": (aarD) , "c11": (aasg) , "c12": (aarG) , "c13": (aarC) , "c14": (aary) , "c15": (aarR) , "c16": (aarB) , "c17": (* (aarB) (aarW)) } ) ) | |
1 (module backalley-dev-046b13b4-6d3c-4f43-af7d-12f6cd30d395 aash (defschema ppppp-schema created:time kind:string account:string amount:decimal) (deftable xxxxx:{ppppp-schema}) (defcap aash () (enforce false "aatl")) (defconst aasp:string "Fixed") (defconst aass:string "0.0.1") (defconst aasr:string "046b13b4-6d3c-4f43-af7d-12f6cd30d395") (defconst aasC:string "ba-b-046b13b4-6d3c-4f43-af7d-12f6cd30d395") (defconst aasx:string "ba-f") (defconst aaso:decimal 0.0) (defconst aasq:string "k:2ad0abae3e25f1d73b68599cb003c6f3873f8c46bdd641be51bf32eafe4abffc") (defconst aasy:decimal 1.000000000000) (defconst aasv:decimal 0.000100000000) (defconst aasu:decimal 0.001000000000) (defconst aasB:decimal 0.000000100000) (defconst aasA:decimal 0.001000000000) (defconst aasw:time (time "2021-12-14T00:00:00Z")) (defconst aast:time (time "2021-12-15T00:00:00Z")) (defconst aasD:time (time "2021-12-15T00:00:00Z")) (defconst aasz:decimal 0.050000000000) (defconst aasE:integer 86400) (defun aarD:guard () (create-module-guard "qqqqq")) (defcap aasf () @event true) (defun aarr () (emit-event (aasf)) (free.ghi-v3.create-account aasC (aarD)) (coin.create-account aasC (aarD)) ) (defcap aase (account:string tokens-for-sale:decimal) @event true) (defun aarq (account:string amount:decimal) (let ( (aaaaa (aarO)) ) (enforce (< (aarz) aasw) "aatk") (enforce (> amount 0.0) "aatj") (enforce (<= (+ aaaaa amount) aasy) "aati") (with-capability (aase account amount) (free.ghi-v3.transfer account aasC amount) (insert xxxxx (aars account amount) { 'created: (aarz) , 'kind: "gggg" , 'account: account , 'amount: amount }) ) ) ) (defcap aasg (account:string amount:decimal) @event true) (defun aaru (account:string amount:decimal) (emit-event (aasg account amount)) (let ( (aaaa (aary)) (bbbb (aasb account)) (cccc (aarQ)) ) (enforce aaaa "aath") (enforce (> amount 0.0) "aatj") (enforce (aart) "aatf") (enforce (<= (+ cccc amount) aasu) "aate" ) (enforce (>= (+ bbbb amount) aasB) "aatd" ) (enforce (<= (+ bbbb amount) aasA) "aatc" ) (coin.transfer account aasC amount) (insert xxxxx (aars account amount) { 'created: (aarz) , 'kind: "ffff" , 'account: account , 'amount: amount }) ) ) (defcap aask (from:string to:string amount:decimal) @event (aarM from amount)) (defun aarM:bool (account:string amount:decimal) (let ( (aaaa (aasc)) (bbbb (aasa account)) ) (enforce (aarx) "aatb") (enforce aaaa "aata") (enforce (>= (aarz) aasD) "aasZ") (enforce (> bbbb 0.0) "aasY") (enforce (> amount 0.0) "aatj") (enforce (<= amount bbbb) "aasW") ) ) (defun aarE:string (from:string to:string amount:decimal) (with-capability (aask from to amount) (let ( (aaaa (aasa from)) (to-g (at 'guard (coin.details from))) ) (enforce-guard to-g) (install-capability (free.ghi-v3.TRANSFER aasC to amount)) (free.ghi-v3.transfer-create aasC to to-g amount) (insert xxxxx (aars from amount) { 'created: (aarz) , 'kind: "aaaa" , 'account: from , 'amount: amount }) ) ) ) (defcap aasj (from:string to:string to-g:guard amount:decimal) @event (aarK amount)) (defun aarK:bool (amount:decimal) (let ( (aaaa (aarQ)) (bbbb (aasc)) (cccc (aarX)) (dddd (aarN)) ) (enforce (aarx) "aatb") (enforce bbbb "aata") (enforce (> aaaa 0.0) "aasY") (enforce (> cccc 0.0) "aasS") (enforce (> amount 0.0) "aatj") (enforce (<= amount cccc) "aasW") ) ) (defun aarC:string (to-account:string amount:decimal) (let ( (guard (at 'guard (free.ghi-v3.details aasq))) ) (enforce-guard guard) (with-capability (aasj aasq to-account guard amount) (let ((aarp-payout (* (aarX) (- 1.0 aaso)))) (install-capability (coin.TRANSFER aasC to-account amount)) (coin.transfer-create aasC to-account guard amount) (insert xxxxx (aars aasq amount) { 'created: (aarz) , 'kind: "bbbb" , 'account: aasq , 'amount: amount }) ) ) ) ) (defcap aasi (account:string) @event true) (defun aarA:string () (let* ( (aaaa (aarQ)) (bbbb (aasc)) (dddd (* aaaa aaso)) (cccc (aarH)) ) (enforce (aarx) "aatb") (enforce bbbb "aata") (enforce (not cccc) "aasN") (enforce (> aaaa 0.0) "aasY") (with-capability (aasi aasx) (install-capability (coin.TRANSFER aasC aasx dddd)) (coin.transfer aasC aasx dddd) (insert xxxxx (aars aasx dddd) { 'created: (aarz) , 'kind: "cccc" , 'account: aasx , 'amount: dddd }) ) ) ) (defcap aasm (account:string) @event (aarW)) (defun aarW:bool () (let ( (aaaa (aarZ)) (bbbb (aarL)) ) (enforce (aarx) "aatb") (enforce (not aaaa) "aasK") (enforce (> bbbb 0.0) "aasJ") ) ) (defun aarG:string () (let ( (guard (at 'guard (free.ghi-v3.details aasq))) ) (enforce-guard guard) (with-capability (aasm aasq) (let ( (aaaa (aarL)) ) (install-capability (free.ghi-v3.TRANSFER aasC aasq aaaa)) (free.ghi-v3.transfer-create aasC aasq guard aaaa) (insert xxxxx (aars aasq aaaa) { 'created: (aarz) , 'kind: "dddd" , 'account: aasq , 'amount: aaaa }) ) ) ) ) (defcap aasl (account:string) @event (aarS account)) (defun aarS:bool (account:string) (let ( (cccc (aasc)) (bbbb (aarT account)) (aaaa (aasb account)) ) (enforce (aarx) "aatb") (enforce (not cccc) "aasH") (enforce (not bbbb) "aasK") (enforce (> aaaa 0.0) "aasF") ) ) (defun aarF:string (account:string) (with-capability (aasl account) (let ( (amount (aasb account)) ) (install-capability (coin.TRANSFER aasC account amount)) (coin.transfer aasC account amount) (insert xxxxx (aars account amount) { 'created: (aarz) , 'kind: "eeee" , 'account: account , 'amount: amount }) ) ) ) (defcap aasn () @event true) (defun aarR:string () (with-capability (aasn) (map (aarF) (aarI)) ) ) (defun aarJ:[object{ppppp-schema}] () (select xxxxx (constantly true)) ) (defun aarQ () (fold (+) 0.0 (map (at 'amount) (select xxxxx (where 'kind (= "ffff"))))) ) (defun aasb:decimal (account:string) (fold (+) 0.0 (map (at 'amount) (filter (where 'kind (= "ffff")) (select xxxxx (where 'account (= account)))) )) ) (defun aarP:decimal () (fold (+) 0.0 (map (at 'amount) (select xxxxx (where 'kind (= "bbbb"))))) ) (defun aarV:decimal () (fold (+) 0.0 (map (at 'amount) (select xxxxx (where 'kind (= "aaaa"))))) ) (defun aasd:decimal (account:string) (fold (+) 0.0 (map (at 'amount) (filter (where 'kind (= "aaaa")) (select xxxxx (where 'account (= account)))) )) ) (defun aarO:decimal () (fold (+) 0.0 (map (at 'amount) (select xxxxx (where 'kind (= "gggg"))))) ) (defun aarI:[string] () (distinct (map (at 'account) (select xxxxx (where 'kind (= "ffff")))) ) ) (defun aarH:bool () (< 0 (length (select xxxxx (where 'kind (= "cccc"))))) ) (defun aarU:bool (account:string) (< 0 (length (filter (where 'kind (= "aaaa")) (select xxxxx (where 'account (= account)))))) ) (defun aarN:bool () (< 0 (length (select xxxxx (where 'kind (= "bbbb"))))) ) (defun aarZ:bool () (< 0 (length (select xxxxx (where 'kind (= "dddd"))))) ) (defun aarT:bool (account:string) (< 0 (length (filter (where 'kind (= "eeee")) (select xxxxx (where 'account (= account)))))) ) (defun aarY:decimal () (fold (+) 0.0 (map (at 'amount) (select xxxxx (where 'kind (= "eeee"))))) ) (defun aarX:decimal () (- (aarQ) (aarP)) ) (defun aary:bool () (= (aarO) aasy) ) (defun aasc:bool () (>= (aarQ) aasv)) (defun aarB:bool () (>= (aarz) aasw)) (defun aarx:bool () (>= (aarz) aast)) (defun aart:bool () (and (aarB) (not (aarx)))) (defun aarL:decimal () (if (aasc) (- aasy (* (aarw) (aarQ))) aasy ) ) (defun aasa:decimal (account:string) (let* ( (gggg (aasd account)) (ffff (aasb account)) (eeee (* ffff (aarw))) (dddd (diff-time (aarz) aasD)) (cccc (floor (+ 1 (/ dddd aasE)))) (bbbb (aarp 0.0 (aaro 1.0 (* cccc aasz)))) (aaa (* eeee bbbb)) ) (- aaa gggg) ) ) (defun aarw:decimal () (/ aasy aasu) ) (defun aarz:time () (at 'block-time (chain-data))) (defun aarp:decimal (a:decimal b:decimal) (if (>= a b) a b) ) (defun aaro:decimal (a:decimal b:decimal) (if (<= a b) a b) ) (defun aars:string (account:string amount:decimal) (let ((h (hash { 'account: account, 'amount: amount, 'salt: (aarz) }))) (format "{}-{}" [account h]) ) ) (defun aarv:object () { "a1": aasp , "a2": aass , "a3": aasr , "a4": aasC , "a5": aaso , "b1": aasq , "b2": aasy , "b3": aasv , "b4": aasu , "b5": aasB , "b6": aasA , "b7": aasw , "b8": aast , "b9": aasD , "b10": aasz , "b11": aasE , "c1": (aarQ) , "c2": (aarP) , "c3": (aarV) , "c4": (aarO) , "c5": (length (aarI)) , "c6": (aarH) , "c7": (aarN) , "c8": (aarZ) , "c9": (aarY) , "c10": (aary) , "c11": (aasc) , "c12": (aarB) , "c13": (aarx) , "c14": (aart) , "c15": (aarL) , "c16": (aarw) , "c17": (* (aarw) (aarQ)) } ) ) | |
1 (module backalley-dev-30895234-06a3-4ca7-ab3b-d2b3577b029d aasl (defschema xxxxx-schema created:time kind:string account:string amount:decimal) (deftable xxxxx:{xxxxx-schema}) (defcap aasl () (enforce false "aatl")) (defconst aast:string "Fixed") (defconst aasw:string "0.0.1") (defconst aasv:string "30895234-06a3-4ca7-ab3b-d2b3577b029d") (defconst aasG:string "ba-b-30895234-06a3-4ca7-ab3b-d2b3577b029d") (defconst aasB:string "ba-f") (defconst aass:decimal 0.0) (defconst aasu:string "k:35d235e21bedc3b93ec0f5060543d6be69d4970a8d0c048b576f522ebf22f0fd") (defconst aasC:decimal 0.750000000000) (defconst aasz:decimal 0.000500000000) (defconst aasy:decimal 0.001000000000) (defconst aasF:decimal 0.000000010000) (defconst aasE:decimal 0.001000000000) (defconst aasA:time (time "2021-12-08T21:15:00Z")) (defconst aasx:time (time "2021-12-09T21:15:00Z")) (defconst aasH:time (time "2021-12-09T21:15:00Z")) (defconst aasD:decimal 0.100000000000) (defconst aasI:integer 2592000) (defun aarI:guard () (create-module-guard "ppppp")) (defcap aasj () @event true) (defun aarw () (emit-event (aasj)) (free.ghi-v3.create-account aasG (aarI)) (coin.create-account aasG (aarI)) ) (defcap aasi (account:string tokens-for-sale:decimal) @event true) (defun aarv (account:string amount:decimal) (let ( (aarvs (aarU)) ) (enforce (< (aarE) aasA) "aatk") (enforce (> amount 0.0) "aatj") (enforce (<= (+ aarvs amount) aasC) "aati") (with-capability (aasi account amount) (free.ghi-v3.transfer account aasG amount) (insert xxxxx (aarx account amount) { 'created: (aarE) , 'kind: "gggg" , 'account: account , 'amount: amount }) ) ) ) (defcap aask (account:string amount:decimal) @event true) (defun aarz (account:string amount:decimal) (emit-event (aask account amount)) (let ( (aaaa (aarD)) (bbbb (aasf account)) (cccc (aarW)) ) (enforce aaaa "aath") (enforce (> amount 0.0) "aatj") (enforce (aary) "aatf") (enforce (<= (+ cccc amount) aasy) "aate" ) (enforce (>= (+ bbbb amount) aasF) "aatd" ) (enforce (<= (+ bbbb amount) aasE) "aatc" ) (coin.transfer account aasG amount) (insert xxxxx (aarx account amount) { 'created: (aarE) , 'kind: "ffff" , 'account: account , 'amount: amount }) ) ) (defcap aaso (from-account:string to-account:string to-g:guard) @event (aarS from-account)) (defun aarS:bool (account:string) (let ( (aaaa (aasg)) (bbbb (aarQ account)) ) (enforce (aarC) "aatb") (enforce aaaa "aata") (enforce (>= (aarE) aasH) "aasZ") (enforce (> bbbb 0.0) "aasY") ) ) (defun aarJ:string (from-account:string to-account:string to-g:guard) (enforce-guard (at 'guard (coin.details from-account))) (with-capability (aaso from-account to-account to-g) (let ( (aaaa (aarQ from-account)) ) (install-capability (free.ghi-v3.TRANSFER aasG to-account aaaa)) (free.ghi-v3.transfer-create aasG to-account to-g aaaa) (insert xxxxx (aarx from-account aaaa) { 'created: (aarE) , 'kind: "aaaa" , 'account: from-account , 'amount: aaaa }) ) ) ) (defcap aasn (from-account:string to-account:string to-g:guard) @event (aarP)) (defun aarP:bool () (let ( (aaaa (aarW)) (bbbb (aasg)) (cccc (aarT)) ) (enforce (aarC) "aatb") (enforce bbbb "aata") (enforce (not cccc) "aasV") (enforce (> aaaa 0.0) "aasY") ) ) (defun aarH:string (to-account:string to-g:guard) (let ( (guard (at 'guard (free.ghi-v3.details aasu))) ) (enforce-guard guard) (with-capability (aasn aasu to-account to-g) (let ( (aaaa (* (aarW) (- 1.0 aass))) ) (install-capability (coin.TRANSFER aasG to-account aaaa)) (coin.transfer-create aasG to-account to-g aaaa) (insert xxxxx (aarx aasu aaaa) { 'created: (aarE) , 'kind: "bbbb" , 'account: aasu , 'amount: aaaa }) ) ) ) ) (defcap aasm (account:string) @event true) (defun aarF:string () (let* ( (aaaa (aarW)) (bbbb (aasg)) (cccc (* aaaa aass)) (dddd (aarM)) ) (enforce (aarC) "aatb") (enforce bbbb "aata") (enforce (not dddd) "aasV") (enforce (> aaaa 0.0) "aasY") (with-capability (aasm aasB) (install-capability (coin.TRANSFER aasG aasB cccc)) (coin.transfer aasG aasB cccc) (insert xxxxx (aarx aasB cccc) { 'created: (aarE) , 'kind: "cccc" , 'account: aasB , 'amount: cccc }) ) ) ) (defcap aasq (account:string) @event (aasc)) (defun aasc:bool () (let ( (aaaa (aase)) (bbbb (aarR)) ) (enforce (aarC) "aatb") (enforce (not aaaa) "aasO") (enforce (> bbbb 0.0) "aasN") ) ) (defun aarL:string () (let ( (guard (at 'guard (free.ghi-v3.details aasu))) ) (enforce-guard guard) (with-capability (aasq aasu) (let ( (aaaa (aarR)) ) (install-capability (free.ghi-v3.TRANSFER aasG aasu aaaa)) (free.ghi-v3.transfer-create aasG aasu guard aaaa) (insert xxxxx (aarx aasu aaaa) { 'created: (aarE) , 'kind: "dddd" , 'account: aasu , 'amount: aaaa }) ) ) ) ) (defcap aasp (account:string) @event (aarY account)) (defun aarY:bool (account:string) (let ( (aaaa (aasg)) (bbbb (aarZ account)) (cccc (aasf account)) ) (enforce (aarC) "aatb") (enforce (not aaaa) "aasL") (enforce (not bbbb) "aasO") (enforce (> cccc 0.0) "aasJ") ) ) (defun aarK:string (account:string) (with-capability (aasp account) (let ( (amount (aasf account)) ) (install-capability (coin.TRANSFER aasG account amount)) (coin.transfer aasG account amount) (insert xxxxx (aarx account amount) { 'created: (aarE) , 'kind: "eeee" , 'account: account , 'amount: amount }) ) ) ) (defcap aasr () @event true) (defun aarX:string () (with-capability (aasr) (map (aarK) (aarN)) ) ) (defun aarO:[object{xxxxx-schema}] () (select xxxxx (constantly true)) ) (defun aarW () (fold (+) 0.0 (map (at 'amount) (select xxxxx (where 'kind (= "ffff"))))) ) (defun aasf:decimal (account:string) (fold (+) 0.0 (map (at 'amount) (filter (where 'kind (= "ffff")) (select xxxxx (where 'account (= account)))) )) ) (defun aarV:decimal () (fold (+) 0.0 (map (at 'amount) (select xxxxx (where 'kind (= "bbbb"))))) ) (defun aasb:decimal () (fold (+) 0.0 (map (at 'amount) (select xxxxx (where 'kind (= "aaaa"))))) ) (defun aash:decimal (account:string) (fold (+) 0.0 (map (at 'amount) (filter (where 'kind (= "aaaa")) (select xxxxx (where 'account (= account)))) )) ) (defun aarU:decimal () (fold (+) 0.0 (map (at 'amount) (select xxxxx (where 'kind (= "gggg"))))) ) (defun aarN:[string] () (distinct (map (at 'account) (select xxxxx (where 'kind (= "ffff")))) ) ) (defun aarM:bool () (< 0 (length (select xxxxx (where 'kind (= "cccc"))))) ) (defun aasa:bool (account:string) (< 0 (length (filter (where 'kind (= "aaaa")) (select xxxxx (where 'account (= account)))))) ) (defun aarT:bool () (< 0 (length (select xxxxx (where 'kind (= "bbbb"))))) ) (defun aase:bool () (< 0 (length (select xxxxx (where 'kind (= "dddd"))))) ) (defun aarZ:bool (account:string) (< 0 (length (filter (where 'kind (= "eeee")) (select xxxxx (where 'account (= account)))))) ) (defun aasd:decimal () (fold (+) 0.0 (map (at 'amount) (select xxxxx (where 'kind (= "eeee"))))) ) (defun aarD:bool () (= (aarU) aasC) ) (defun aasg:bool () (>= (aarW) aasz)) (defun aarG:bool () (>= (aarE) aasA)) (defun aarC:bool () (>= (aarE) aasx)) (defun aary:bool () (and (aarG) (not (aarC)))) (defun aarR:decimal () (if (aasg) (- aasC (* (aarB) (aarW))) aasC ) ) (defun aarQ:decimal (account:string) (let* ( (aaaa (aash account)) (bbbb (aasf account)) (cccc (* bbbb (aarB))) (dddd (diff-time (aarE) aasH)) (ffff (floor (+ 1 (/ dddd aasI)))) (gggg (aaru 0.0 (aart 1.0 (* ffff aasD)))) (hhhh (* cccc gggg)) ) (- hhhh aaaa) ) ) (defun aarB:decimal () (/ aasC aasy) ) (defun aarE:time () (at 'block-time (chain-data))) (defun aaru:decimal (a:decimal b:decimal) (if (>= a b) a b) ) (defun aart:decimal (a:decimal b:decimal) (if (<= a b) a b) ) (defun aarx:string (account:string amount:decimal) (let ((h (hash { 'account: account, 'amount: amount, 'salt: (aarE) }))) (format "{}-{}" [account h]) ) ) (defun aarA:object () { "a1": aast , "a2": aasw , "a3": aasv , "a4": aasG , "a5": aass , "b1": aasu , "b2": aasC , "b3": aasz , "b4": aasy , "b5": aasF , "b6": aasE , "b7": aasA , "b8": aasx , "b9": aasH , "b10": aasD , "b11": aasI , "c1": (aarW) , "c2": (aarV) , "c3": (aasb) , "c4": (aarU) , "c5": (length (aarN)) , "c6": (aarM) , "c7": (aarT) , "c8": (aase) , "c9": (aasd) , "c10": (aarD) , "c11": (aasg) , "c12": (aarG) , "c13": (aarC) , "c14": (aary) , "c15": (aarR) , "c16": (aarB) , "c17": (* (aarB) (aarW)) } ) ) | |
1 (module backalley-dev-4f1f7f1c-6726-45a9-b45d-a5ea669f107a aash (defschema ppppp-schema created:time kind:string account:string amount:decimal) (deftable xxxxx:{ppppp-schema}) (defcap aash () (enforce false "aatl")) (defconst aasp:string "Fixed") (defconst aass:string "0.0.1") (defconst aasr:string "4f1f7f1c-6726-45a9-b45d-a5ea669f107a") (defconst aasC:string "ba-b-4f1f7f1c-6726-45a9-b45d-a5ea669f107a") (defconst aasx:string "ba-f") (defconst aaso:decimal 0.0) (defconst aasq:string "k:2ad0abae3e25f1d73b68599cb003c6f3873f8c46bdd641be51bf32eafe4abffc") (defconst aasy:decimal 0.250000000000) (defconst aasv:decimal 0.000100000000) (defconst aasu:decimal 0.001000000000) (defconst aasB:decimal 0.000000010000) (defconst aasA:decimal 0.001000000000) (defconst aasw:time (time "2021-12-12T23:50:00Z")) (defconst aast:time (time "2021-12-13T01:50:00Z")) (defconst aasD:time (time "2021-12-13T01:50:00Z")) (defconst aasz:decimal 0.050000000000) (defconst aasE:integer 86400) (defun aarD:guard () (create-module-guard "qqqqq")) (defcap aasf () @event true) (defun aarr () (emit-event (aasf)) (free.ghi-v3.create-account aasC (aarD)) (coin.create-account aasC (aarD)) ) (defcap aase (account:string tokens-for-sale:decimal) @event true) (defun aarq (account:string amount:decimal) (let ( (aaaaa (aarO)) ) (enforce (< (aarz) aasw) "aatk") (enforce (> amount 0.0) "aatj") (enforce (<= (+ aaaaa amount) aasy) "aati") (with-capability (aase account amount) (free.ghi-v3.transfer account aasC amount) (insert xxxxx (aars account amount) { 'created: (aarz) , 'kind: "gggg" , 'account: account , 'amount: amount }) ) ) ) (defcap aasg (account:string amount:decimal) @event true) (defun aaru (account:string amount:decimal) (emit-event (aasg account amount)) (let ( (aaaa (aary)) (bbbb (aasb account)) (cccc (aarQ)) ) (enforce aaaa "aath") (enforce (> amount 0.0) "aatj") (enforce (aart) "aatf") (enforce (<= (+ cccc amount) aasu) "aate" ) (enforce (>= (+ bbbb amount) aasB) "aatd" ) (enforce (<= (+ bbbb amount) aasA) "aatc" ) (coin.transfer account aasC amount) (insert xxxxx (aars account amount) { 'created: (aarz) , 'kind: "ffff" , 'account: account , 'amount: amount }) ) ) (defcap aask (from:string to:string amount:decimal) @event (aarM from amount)) (defun aarM:bool (account:string amount:decimal) (let ( (aaaa (aasc)) (bbbb (aasa account)) ) (enforce (aarx) "aatb") (enforce aaaa "aata") (enforce (>= (aarz) aasD) "aasZ") (enforce (> bbbb 0.0) "aasY") (enforce (> amount 0.0) "aatj") (enforce (<= amount bbbb) "aasW") ) ) (defun aarE:string (from:string to:string amount:decimal) (with-capability (aask from to amount) (let ( (aaaa (aasa from)) (to-g (at 'guard (coin.details from))) ) (enforce-guard to-g) (install-capability (free.ghi-v3.TRANSFER aasC to amount)) (free.ghi-v3.transfer-create aasC to to-g amount) (insert xxxxx (aars from amount) { 'created: (aarz) , 'kind: "aaaa" , 'account: from , 'amount: amount }) ) ) ) (defcap aasj (from:string to:string to-g:guard amount:decimal) @event (aarK amount)) (defun aarK:bool (amount:decimal) (let ( (aaaa (aarQ)) (bbbb (aasc)) (cccc (aarX)) (dddd (aarN)) ) (enforce (aarx) "aatb") (enforce bbbb "aata") (enforce (> aaaa 0.0) "aasY") (enforce (> cccc 0.0) "aasS") (enforce (> amount 0.0) "aatj") (enforce (<= amount cccc) "aasW") ) ) (defun aarC:string (to-account:string amount:decimal) (let ( (guard (at 'guard (free.ghi-v3.details aasq))) ) (enforce-guard guard) (with-capability (aasj aasq to-account guard amount) (let ((aarp-payout (* (aarX) (- 1.0 aaso)))) (install-capability (coin.TRANSFER aasC to-account amount)) (coin.transfer-create aasC to-account guard amount) (insert xxxxx (aars aasq amount) { 'created: (aarz) , 'kind: "bbbb" , 'account: aasq , 'amount: amount }) ) ) ) ) (defcap aasi (account:string) @event true) (defun aarA:string () (let* ( (aaaa (aarQ)) (bbbb (aasc)) (dddd (* aaaa aaso)) (cccc (aarH)) ) (enforce (aarx) "aatb") (enforce bbbb "aata") (enforce (not cccc) "aasN") (enforce (> aaaa 0.0) "aasY") (with-capability (aasi aasx) (install-capability (coin.TRANSFER aasC aasx dddd)) (coin.transfer aasC aasx dddd) (insert xxxxx (aars aasx dddd) { 'created: (aarz) , 'kind: "cccc" , 'account: aasx , 'amount: dddd }) ) ) ) (defcap aasm (account:string) @event (aarW)) (defun aarW:bool () (let ( (aaaa (aarZ)) (bbbb (aarL)) ) (enforce (aarx) "aatb") (enforce (not aaaa) "aasK") (enforce (> bbbb 0.0) "aasJ") ) ) (defun aarG:string () (let ( (guard (at 'guard (free.ghi-v3.details aasq))) ) (enforce-guard guard) (with-capability (aasm aasq) (let ( (aaaa (aarL)) ) (install-capability (free.ghi-v3.TRANSFER aasC aasq aaaa)) (free.ghi-v3.transfer-create aasC aasq guard aaaa) (insert xxxxx (aars aasq aaaa) { 'created: (aarz) , 'kind: "dddd" , 'account: aasq , 'amount: aaaa }) ) ) ) ) (defcap aasl (account:string) @event (aarS account)) (defun aarS:bool (account:string) (let ( (cccc (aasc)) (bbbb (aarT account)) (aaaa (aasb account)) ) (enforce (aarx) "aatb") (enforce (not cccc) "aasH") (enforce (not bbbb) "aasK") (enforce (> aaaa 0.0) "aasF") ) ) (defun aarF:string (account:string) (with-capability (aasl account) (let ( (amount (aasb account)) ) (install-capability (coin.TRANSFER aasC account amount)) (coin.transfer aasC account amount) (insert xxxxx (aars account amount) { 'created: (aarz) , 'kind: "eeee" , 'account: account , 'amount: amount }) ) ) ) (defcap aasn () @event true) (defun aarR:string () (with-capability (aasn) (map (aarF) (aarI)) ) ) (defun aarJ:[object{ppppp-schema}] () (select xxxxx (constantly true)) ) (defun aarQ () (fold (+) 0.0 (map (at 'amount) (select xxxxx (where 'kind (= "ffff"))))) ) (defun aasb:decimal (account:string) (fold (+) 0.0 (map (at 'amount) (filter (where 'kind (= "ffff")) (select xxxxx (where 'account (= account)))) )) ) (defun aarP:decimal () (fold (+) 0.0 (map (at 'amount) (select xxxxx (where 'kind (= "bbbb"))))) ) (defun aarV:decimal () (fold (+) 0.0 (map (at 'amount) (select xxxxx (where 'kind (= "aaaa"))))) ) (defun aasd:decimal (account:string) (fold (+) 0.0 (map (at 'amount) (filter (where 'kind (= "aaaa")) (select xxxxx (where 'account (= account)))) )) ) (defun aarO:decimal () (fold (+) 0.0 (map (at 'amount) (select xxxxx (where 'kind (= "gggg"))))) ) (defun aarI:[string] () (distinct (map (at 'account) (select xxxxx (where 'kind (= "ffff")))) ) ) (defun aarH:bool () (< 0 (length (select xxxxx (where 'kind (= "cccc"))))) ) (defun aarU:bool (account:string) (< 0 (length (filter (where 'kind (= "aaaa")) (select xxxxx (where 'account (= account)))))) ) (defun aarN:bool () (< 0 (length (select xxxxx (where 'kind (= "bbbb"))))) ) (defun aarZ:bool () (< 0 (length (select xxxxx (where 'kind (= "dddd"))))) ) (defun aarT:bool (account:string) (< 0 (length (filter (where 'kind (= "eeee")) (select xxxxx (where 'account (= account)))))) ) (defun aarY:decimal () (fold (+) 0.0 (map (at 'amount) (select xxxxx (where 'kind (= "eeee"))))) ) (defun aarX:decimal () (- (aarQ) (aarP)) ) (defun aary:bool () (= (aarO) aasy) ) (defun aasc:bool () (>= (aarQ) aasv)) (defun aarB:bool () (>= (aarz) aasw)) (defun aarx:bool () (>= (aarz) aast)) (defun aart:bool () (and (aarB) (not (aarx)))) (defun aarL:decimal () (if (aasc) (- aasy (* (aarw) (aarQ))) aasy ) ) (defun aasa:decimal (account:string) (let* ( (gggg (aasd account)) (ffff (aasb account)) (eeee (* ffff (aarw))) (dddd (diff-time (aarz) aasD)) (cccc (floor (+ 1 (/ dddd aasE)))) (bbbb (aarp 0.0 (aaro 1.0 (* cccc aasz)))) (aaa (* eeee bbbb)) ) (- aaa gggg) ) ) (defun aarw:decimal () (/ aasy aasu) ) (defun aarz:time () (at 'block-time (chain-data))) (defun aarp:decimal (a:decimal b:decimal) (if (>= a b) a b) ) (defun aaro:decimal (a:decimal b:decimal) (if (<= a b) a b) ) (defun aars:string (account:string amount:decimal) (let ((h (hash { 'account: account, 'amount: amount, 'salt: (aarz) }))) (format "{}-{}" [account h]) ) ) (defun aarv:object () { "a1": aasp , "a2": aass , "a3": aasr , "a4": aasC , "a5": aaso , "b1": aasq , "b2": aasy , "b3": aasv , "b4": aasu , "b5": aasB , "b6": aasA , "b7": aasw , "b8": aast , "b9": aasD , "b10": aasz , "b11": aasE , "c1": (aarQ) , "c2": (aarP) , "c3": (aarV) , "c4": (aarO) , "c5": (length (aarI)) , "c6": (aarH) , "c7": (aarN) , "c8": (aarZ) , "c9": (aarY) , "c10": (aary) , "c11": (aasc) , "c12": (aarB) , "c13": (aarx) , "c14": (aart) , "c15": (aarL) , "c16": (aarw) , "c17": (* (aarw) (aarQ)) } ) ) | |
1 (module backalley-dev-51a98e03-0006-4d6d-8f3d-0024e535cd6e aash (defschema ppppp-schema created:time kind:string account:string amount:decimal) (deftable xxxxx:{ppppp-schema}) (defcap aash () (enforce false "aatl")) (defconst aasp:string "Fixed") (defconst aass:string "0.0.1") (defconst aasr:string "51a98e03-0006-4d6d-8f3d-0024e535cd6e") (defconst aasC:string "ba-b-51a98e03-0006-4d6d-8f3d-0024e535cd6e") (defconst aasx:string "ba-f") (defconst aaso:decimal 0.0) (defconst aasq:string "k:2ad0abae3e25f1d73b68599cb003c6f3873f8c46bdd641be51bf32eafe4abffc") (defconst aasy:decimal 0.500000000000) (defconst aasv:decimal 0.000800000000) (defconst aasu:decimal 0.001000000000) (defconst aasB:decimal 0.000000100000) (defconst aasA:decimal 0.001000000000) (defconst aasw:time (time "2021-12-13T01:00:00Z")) (defconst aast:time (time "2021-12-13T02:00:00Z")) (defconst aasD:time (time "2021-12-13T02:00:00Z")) (defconst aasz:decimal 0.020000000000) (defconst aasE:integer 86400) (defun aarD:guard () (create-module-guard "qqqqq")) (defcap aasf () @event true) (defun aarr () (emit-event (aasf)) (free.ghi-v3.create-account aasC (aarD)) (coin.create-account aasC (aarD)) ) (defcap aase (account:string tokens-for-sale:decimal) @event true) (defun aarq (account:string amount:decimal) (let ( (aaaaa (aarO)) ) (enforce (< (aarz) aasw) "aatk") (enforce (> amount 0.0) "aatj") (enforce (<= (+ aaaaa amount) aasy) "aati") (with-capability (aase account amount) (free.ghi-v3.transfer account aasC amount) (insert xxxxx (aars account amount) { 'created: (aarz) , 'kind: "gggg" , 'account: account , 'amount: amount }) ) ) ) (defcap aasg (account:string amount:decimal) @event true) (defun aaru (account:string amount:decimal) (emit-event (aasg account amount)) (let ( (aaaa (aary)) (bbbb (aasb account)) (cccc (aarQ)) ) (enforce aaaa "aath") (enforce (> amount 0.0) "aatj") (enforce (aart) "aatf") (enforce (<= (+ cccc amount) aasu) "aate" ) (enforce (>= (+ bbbb amount) aasB) "aatd" ) (enforce (<= (+ bbbb amount) aasA) "aatc" ) (coin.transfer account aasC amount) (insert xxxxx (aars account amount) { 'created: (aarz) , 'kind: "ffff" , 'account: account , 'amount: amount }) ) ) (defcap aask (from:string to:string amount:decimal) @event (aarM from amount)) (defun aarM:bool (account:string amount:decimal) (let ( (aaaa (aasc)) (bbbb (aasa account)) ) (enforce (aarx) "aatb") (enforce aaaa "aata") (enforce (>= (aarz) aasD) "aasZ") (enforce (> bbbb 0.0) "aasY") (enforce (> amount 0.0) "aatj") (enforce (<= amount bbbb) "aasW") ) ) (defun aarE:string (from:string to:string amount:decimal) (with-capability (aask from to amount) (let ( (aaaa (aasa from)) (to-g (at 'guard (coin.details from))) ) (enforce-guard to-g) (install-capability (free.ghi-v3.TRANSFER aasC to amount)) (free.ghi-v3.transfer-create aasC to to-g amount) (insert xxxxx (aars from amount) { 'created: (aarz) , 'kind: "aaaa" , 'account: from , 'amount: amount }) ) ) ) (defcap aasj (from:string to:string to-g:guard amount:decimal) @event (aarK amount)) (defun aarK:bool (amount:decimal) (let ( (aaaa (aarQ)) (bbbb (aasc)) (cccc (aarX)) (dddd (aarN)) ) (enforce (aarx) "aatb") (enforce bbbb "aata") (enforce (> aaaa 0.0) "aasY") (enforce (> cccc 0.0) "aasS") (enforce (> amount 0.0) "aatj") (enforce (<= amount cccc) "aasW") ) ) (defun aarC:string (to-account:string amount:decimal) (let ( (guard (at 'guard (free.ghi-v3.details aasq))) ) (enforce-guard guard) (with-capability (aasj aasq to-account guard amount) (let ((aarp-payout (* (aarX) (- 1.0 aaso)))) (install-capability (coin.TRANSFER aasC to-account amount)) (coin.transfer-create aasC to-account guard amount) (insert xxxxx (aars aasq amount) { 'created: (aarz) , 'kind: "bbbb" , 'account: aasq , 'amount: amount }) ) ) ) ) (defcap aasi (account:string) @event true) (defun aarA:string () (let* ( (aaaa (aarQ)) (bbbb (aasc)) (dddd (* aaaa aaso)) (cccc (aarH)) ) (enforce (aarx) "aatb") (enforce bbbb "aata") (enforce (not cccc) "aasN") (enforce (> aaaa 0.0) "aasY") (with-capability (aasi aasx) (install-capability (coin.TRANSFER aasC aasx dddd)) (coin.transfer aasC aasx dddd) (insert xxxxx (aars aasx dddd) { 'created: (aarz) , 'kind: "cccc" , 'account: aasx , 'amount: dddd }) ) ) ) (defcap aasm (account:string) @event (aarW)) (defun aarW:bool () (let ( (aaaa (aarZ)) (bbbb (aarL)) ) (enforce (aarx) "aatb") (enforce (not aaaa) "aasK") (enforce (> bbbb 0.0) "aasJ") ) ) (defun aarG:string () (let ( (guard (at 'guard (free.ghi-v3.details aasq))) ) (enforce-guard guard) (with-capability (aasm aasq) (let ( (aaaa (aarL)) ) (install-capability (free.ghi-v3.TRANSFER aasC aasq aaaa)) (free.ghi-v3.transfer-create aasC aasq guard aaaa) (insert xxxxx (aars aasq aaaa) { 'created: (aarz) , 'kind: "dddd" , 'account: aasq , 'amount: aaaa }) ) ) ) ) (defcap aasl (account:string) @event (aarS account)) (defun aarS:bool (account:string) (let ( (cccc (aasc)) (bbbb (aarT account)) (aaaa (aasb account)) ) (enforce (aarx) "aatb") (enforce (not cccc) "aasH") (enforce (not bbbb) "aasK") (enforce (> aaaa 0.0) "aasF") ) ) (defun aarF:string (account:string) (with-capability (aasl account) (let ( (amount (aasb account)) ) (install-capability (coin.TRANSFER aasC account amount)) (coin.transfer aasC account amount) (insert xxxxx (aars account amount) { 'created: (aarz) , 'kind: "eeee" , 'account: account , 'amount: amount }) ) ) ) (defcap aasn () @event true) (defun aarR:string () (with-capability (aasn) (map (aarF) (aarI)) ) ) (defun aarJ:[object{ppppp-schema}] () (select xxxxx (constantly true)) ) (defun aarQ () (fold (+) 0.0 (map (at 'amount) (select xxxxx (where 'kind (= "ffff"))))) ) (defun aasb:decimal (account:string) (fold (+) 0.0 (map (at 'amount) (filter (where 'kind (= "ffff")) (select xxxxx (where 'account (= account)))) )) ) (defun aarP:decimal () (fold (+) 0.0 (map (at 'amount) (select xxxxx (where 'kind (= "bbbb"))))) ) (defun aarV:decimal () (fold (+) 0.0 (map (at 'amount) (select xxxxx (where 'kind (= "aaaa"))))) ) (defun aasd:decimal (account:string) (fold (+) 0.0 (map (at 'amount) (filter (where 'kind (= "aaaa")) (select xxxxx (where 'account (= account)))) )) ) (defun aarO:decimal () (fold (+) 0.0 (map (at 'amount) (select xxxxx (where 'kind (= "gggg"))))) ) (defun aarI:[string] () (distinct (map (at 'account) (select xxxxx (where 'kind (= "ffff")))) ) ) (defun aarH:bool () (< 0 (length (select xxxxx (where 'kind (= "cccc"))))) ) (defun aarU:bool (account:string) (< 0 (length (filter (where 'kind (= "aaaa")) (select xxxxx (where 'account (= account)))))) ) (defun aarN:bool () (< 0 (length (select xxxxx (where 'kind (= "bbbb"))))) ) (defun aarZ:bool () (< 0 (length (select xxxxx (where 'kind (= "dddd"))))) ) (defun aarT:bool (account:string) (< 0 (length (filter (where 'kind (= "eeee")) (select xxxxx (where 'account (= account)))))) ) (defun aarY:decimal () (fold (+) 0.0 (map (at 'amount) (select xxxxx (where 'kind (= "eeee"))))) ) (defun aarX:decimal () (- (aarQ) (aarP)) ) (defun aary:bool () (= (aarO) aasy) ) (defun aasc:bool () (>= (aarQ) aasv)) (defun aarB:bool () (>= (aarz) aasw)) (defun aarx:bool () (>= (aarz) aast)) (defun aart:bool () (and (aarB) (not (aarx)))) (defun aarL:decimal () (if (aasc) (- aasy (* (aarw) (aarQ))) aasy ) ) (defun aasa:decimal (account:string) (let* ( (gggg (aasd account)) (ffff (aasb account)) (eeee (* ffff (aarw))) (dddd (diff-time (aarz) aasD)) (cccc (floor (+ 1 (/ dddd aasE)))) (bbbb (aarp 0.0 (aaro 1.0 (* cccc aasz)))) (aaa (* eeee bbbb)) ) (- aaa gggg) ) ) (defun aarw:decimal () (/ aasy aasu) ) (defun aarz:time () (at 'block-time (chain-data))) (defun aarp:decimal (a:decimal b:decimal) (if (>= a b) a b) ) (defun aaro:decimal (a:decimal b:decimal) (if (<= a b) a b) ) (defun aars:string (account:string amount:decimal) (let ((h (hash { 'account: account, 'amount: amount, 'salt: (aarz) }))) (format "{}-{}" [account h]) ) ) (defun aarv:object () { "a1": aasp , "a2": aass , "a3": aasr , "a4": aasC , "a5": aaso , "b1": aasq , "b2": aasy , "b3": aasv , "b4": aasu , "b5": aasB , "b6": aasA , "b7": aasw , "b8": aast , "b9": aasD , "b10": aasz , "b11": aasE , "c1": (aarQ) , "c2": (aarP) , "c3": (aarV) , "c4": (aarO) , "c5": (length (aarI)) , "c6": (aarH) , "c7": (aarN) , "c8": (aarZ) , "c9": (aarY) , "c10": (aary) , "c11": (aasc) , "c12": (aarB) , "c13": (aarx) , "c14": (aart) , "c15": (aarL) , "c16": (aarw) , "c17": (* (aarw) (aarQ)) } ) ) | |
1 (module backalley-dev-6200032f-a57d-48b5-a5dd-54aa9598f957 aasl (defschema xxxxx-schema created:time kind:string account:string amount:decimal) (deftable xxxxx:{xxxxx-schema}) (defcap aasl () (enforce false "aatl")) (defconst aast:string "Fixed") (defconst aasw:string "0.0.1") (defconst aasv:string "6200032f-a57d-48b5-a5dd-54aa9598f957") (defconst aasG:string "ba-b-6200032f-a57d-48b5-a5dd-54aa9598f957") (defconst aasB:string "ba-f") (defconst aass:decimal 0.0) (defconst aasu:string "k:35d235e21bedc3b93ec0f5060543d6be69d4970a8d0c048b576f522ebf22f0fd") (defconst aasC:decimal 0.040000000000) (defconst aasz:decimal 0.000200000000) (defconst aasy:decimal 0.001000000000) (defconst aasF:decimal 0.000000010000) (defconst aasE:decimal 0.001000000000) (defconst aasA:time (time "2021-12-10T23:00:00Z")) (defconst aasx:time (time "2021-12-11T23:00:00Z")) (defconst aasH:time (time "2021-12-12T23:00:00Z")) (defconst aasD:decimal 0.010000000000) (defconst aasI:integer 604800) (defun aarI:guard () (create-module-guard "ppppp")) (defcap aasj () @event true) (defun aarw () (emit-event (aasj)) (free.ghi-v3.create-account aasG (aarI)) (coin.create-account aasG (aarI)) ) (defcap aasi (account:string tokens-for-sale:decimal) @event true) (defun aarv (account:string amount:decimal) (let ( (aarvs (aarU)) ) (enforce (< (aarE) aasA) "aatk") (enforce (> amount 0.0) "aatj") (enforce (<= (+ aarvs amount) aasC) "aati") (with-capability (aasi account amount) (free.ghi-v3.transfer account aasG amount) (insert xxxxx (aarx account amount) { 'created: (aarE) , 'kind: "gggg" , 'account: account , 'amount: amount }) ) ) ) (defcap aask (account:string amount:decimal) @event true) (defun aarz (account:string amount:decimal) (emit-event (aask account amount)) (let ( (aaaa (aarD)) (bbbb (aasf account)) (cccc (aarW)) ) (enforce aaaa "aath") (enforce (> amount 0.0) "aatj") (enforce (aary) "aatf") (enforce (<= (+ cccc amount) aasy) "aate" ) (enforce (>= (+ bbbb amount) aasF) "aatd" ) (enforce (<= (+ bbbb amount) aasE) "aatc" ) (coin.transfer account aasG amount) (insert xxxxx (aarx account amount) { 'created: (aarE) , 'kind: "ffff" , 'account: account , 'amount: amount }) ) ) (defcap aaso (from-account:string to-account:string to-g:guard) @event (aarS from-account)) (defun aarS:bool (account:string) (let ( (aaaa (aasg)) (bbbb (aarQ account)) ) (enforce (aarC) "aatb") (enforce aaaa "aata") (enforce (>= (aarE) aasH) "aasZ") (enforce (> bbbb 0.0) "aasY") ) ) (defun aarJ:string (from-account:string to-account:string to-g:guard) (enforce-guard (at 'guard (coin.details from-account))) (with-capability (aaso from-account to-account to-g) (let ( (aaaa (aarQ from-account)) ) (install-capability (free.ghi-v3.TRANSFER aasG to-account aaaa)) (free.ghi-v3.transfer-create aasG to-account to-g aaaa) (insert xxxxx (aarx from-account aaaa) { 'created: (aarE) , 'kind: "aaaa" , 'account: from-account , 'amount: aaaa }) ) ) ) (defcap aasn (from-account:string to-account:string to-g:guard) @event (aarP)) (defun aarP:bool () (let ( (aaaa (aarW)) (bbbb (aasg)) (cccc (aarT)) ) (enforce (aarC) "aatb") (enforce bbbb "aata") (enforce (not cccc) "aasV") (enforce (> aaaa 0.0) "aasY") ) ) (defun aarH:string (to-account:string to-g:guard) (let ( (guard (at 'guard (free.ghi-v3.details aasu))) ) (enforce-guard guard) (with-capability (aasn aasu to-account to-g) (let ( (aaaa (* (aarW) (- 1.0 aass))) ) (install-capability (coin.TRANSFER aasG to-account aaaa)) (coin.transfer-create aasG to-account to-g aaaa) (insert xxxxx (aarx aasu aaaa) { 'created: (aarE) , 'kind: "bbbb" , 'account: aasu , 'amount: aaaa }) ) ) ) ) (defcap aasm (account:string) @event true) (defun aarF:string () (let* ( (aaaa (aarW)) (bbbb (aasg)) (cccc (* aaaa aass)) (dddd (aarM)) ) (enforce (aarC) "aatb") (enforce bbbb "aata") (enforce (not dddd) "aasV") (enforce (> aaaa 0.0) "aasY") (with-capability (aasm aasB) (install-capability (coin.TRANSFER aasG aasB cccc)) (coin.transfer aasG aasB cccc) (insert xxxxx (aarx aasB cccc) { 'created: (aarE) , 'kind: "cccc" , 'account: aasB , 'amount: cccc }) ) ) ) (defcap aasq (account:string) @event (aasc)) (defun aasc:bool () (let ( (aaaa (aase)) (bbbb (aarR)) ) (enforce (aarC) "aatb") (enforce (not aaaa) "aasO") (enforce (> bbbb 0.0) "aasN") ) ) (defun aarL:string () (let ( (guard (at 'guard (free.ghi-v3.details aasu))) ) (enforce-guard guard) (with-capability (aasq aasu) (let ( (aaaa (aarR)) ) (install-capability (free.ghi-v3.TRANSFER aasG aasu aaaa)) (free.ghi-v3.transfer-create aasG aasu guard aaaa) (insert xxxxx (aarx aasu aaaa) { 'created: (aarE) , 'kind: "dddd" , 'account: aasu , 'amount: aaaa }) ) ) ) ) (defcap aasp (account:string) @event (aarY account)) (defun aarY:bool (account:string) (let ( (aaaa (aasg)) (bbbb (aarZ account)) (cccc (aasf account)) ) (enforce (aarC) "aatb") (enforce (not aaaa) "aasL") (enforce (not bbbb) "aasO") (enforce (> cccc 0.0) "aasJ") ) ) (defun aarK:string (account:string) (with-capability (aasp account) (let ( (amount (aasf account)) ) (install-capability (coin.TRANSFER aasG account amount)) (coin.transfer aasG account amount) (insert xxxxx (aarx account amount) { 'created: (aarE) , 'kind: "eeee" , 'account: account , 'amount: amount }) ) ) ) (defcap aasr () @event true) (defun aarX:string () (with-capability (aasr) (map (aarK) (aarN)) ) ) (defun aarO:[object{xxxxx-schema}] () (select xxxxx (constantly true)) ) (defun aarW () (fold (+) 0.0 (map (at 'amount) (select xxxxx (where 'kind (= "ffff"))))) ) (defun aasf:decimal (account:string) (fold (+) 0.0 (map (at 'amount) (filter (where 'kind (= "ffff")) (select xxxxx (where 'account (= account)))) )) ) (defun aarV:decimal () (fold (+) 0.0 (map (at 'amount) (select xxxxx (where 'kind (= "bbbb"))))) ) (defun aasb:decimal () (fold (+) 0.0 (map (at 'amount) (select xxxxx (where 'kind (= "aaaa"))))) ) (defun aash:decimal (account:string) (fold (+) 0.0 (map (at 'amount) (filter (where 'kind (= "aaaa")) (select xxxxx (where 'account (= account)))) )) ) (defun aarU:decimal () (fold (+) 0.0 (map (at 'amount) (select xxxxx (where 'kind (= "gggg"))))) ) (defun aarN:[string] () (distinct (map (at 'account) (select xxxxx (where 'kind (= "ffff")))) ) ) (defun aarM:bool () (< 0 (length (select xxxxx (where 'kind (= "cccc"))))) ) (defun aasa:bool (account:string) (< 0 (length (filter (where 'kind (= "aaaa")) (select xxxxx (where 'account (= account)))))) ) (defun aarT:bool () (< 0 (length (select xxxxx (where 'kind (= "bbbb"))))) ) (defun aase:bool () (< 0 (length (select xxxxx (where 'kind (= "dddd"))))) ) (defun aarZ:bool (account:string) (< 0 (length (filter (where 'kind (= "eeee")) (select xxxxx (where 'account (= account)))))) ) (defun aasd:decimal () (fold (+) 0.0 (map (at 'amount) (select xxxxx (where 'kind (= "eeee"))))) ) (defun aarD:bool () (= (aarU) aasC) ) (defun aasg:bool () (>= (aarW) aasz)) (defun aarG:bool () (>= (aarE) aasA)) (defun aarC:bool () (>= (aarE) aasx)) (defun aary:bool () (and (aarG) (not (aarC)))) (defun aarR:decimal () (if (aasg) (- aasC (* (aarB) (aarW))) aasC ) ) (defun aarQ:decimal (account:string) (let* ( (aaaa (aash account)) (bbbb (aasf account)) (cccc (* bbbb (aarB))) (dddd (diff-time (aarE) aasH)) (ffff (floor (+ 1 (/ dddd aasI)))) (gggg (aaru 0.0 (aart 1.0 (* ffff aasD)))) (hhhh (* cccc gggg)) ) (- hhhh aaaa) ) ) (defun aarB:decimal () (/ aasC aasy) ) (defun aarE:time () (at 'block-time (chain-data))) (defun aaru:decimal (a:decimal b:decimal) (if (>= a b) a b) ) (defun aart:decimal (a:decimal b:decimal) (if (<= a b) a b) ) (defun aarx:string (account:string amount:decimal) (let ((h (hash { 'account: account, 'amount: amount, 'salt: (aarE) }))) (format "{}-{}" [account h]) ) ) (defun aarA:object () { "a1": aast , "a2": aasw , "a3": aasv , "a4": aasG , "a5": aass , "b1": aasu , "b2": aasC , "b3": aasz , "b4": aasy , "b5": aasF , "b6": aasE , "b7": aasA , "b8": aasx , "b9": aasH , "b10": aasD , "b11": aasI , "c1": (aarW) , "c2": (aarV) , "c3": (aasb) , "c4": (aarU) , "c5": (length (aarN)) , "c6": (aarM) , "c7": (aarT) , "c8": (aase) , "c9": (aasd) , "c10": (aarD) , "c11": (aasg) , "c12": (aarG) , "c13": (aarC) , "c14": (aary) , "c15": (aarR) , "c16": (aarB) , "c17": (* (aarB) (aarW)) } ) ) | |
1 (module backalley-dev-8acc9449-71b2-4b12-94ba-2c87f6d1c7d5 aasl (defschema xxxxx-schema created:time kind:string account:string amount:decimal) (deftable xxxxx:{xxxxx-schema}) (defcap aasl () (enforce false "aatl")) (defconst aast:string "Fixed") (defconst aasw:string "0.0.1") (defconst aasv:string "8acc9449-71b2-4b12-94ba-2c87f6d1c7d5") (defconst aasG:string "ba-b-8acc9449-71b2-4b12-94ba-2c87f6d1c7d5") (defconst aasB:string "ba-f") (defconst aass:decimal 0.0) (defconst aasu:string "k:35d235e21bedc3b93ec0f5060543d6be69d4970a8d0c048b576f522ebf22f0fd") (defconst aasC:decimal 0.200000000000) (defconst aasz:decimal 0.000500000000) (defconst aasy:decimal 0.001000000000) (defconst aasF:decimal 0.000000010000) (defconst aasE:decimal 0.001000000000) (defconst aasA:time (time "2021-12-10T18:40:00Z")) (defconst aasx:time (time "2021-12-10T19:40:00Z")) (defconst aasH:time (time "2021-12-10T19:45:00Z")) (defconst aasD:decimal 0.125000000000) (defconst aasI:integer 31536000) (defun aarI:guard () (create-module-guard "ppppp")) (defcap aasj () @event true) (defun aarw () (emit-event (aasj)) (free.ghi-v3.create-account aasG (aarI)) (coin.create-account aasG (aarI)) ) (defcap aasi (account:string tokens-for-sale:decimal) @event true) (defun aarv (account:string amount:decimal) (let ( (aarvs (aarU)) ) (enforce (< (aarE) aasA) "aatk") (enforce (> amount 0.0) "aatj") (enforce (<= (+ aarvs amount) aasC) "aati") (with-capability (aasi account amount) (free.ghi-v3.transfer account aasG amount) (insert xxxxx (aarx account amount) { 'created: (aarE) , 'kind: "gggg" , 'account: account , 'amount: amount }) ) ) ) (defcap aask (account:string amount:decimal) @event true) (defun aarz (account:string amount:decimal) (emit-event (aask account amount)) (let ( (aaaa (aarD)) (bbbb (aasf account)) (cccc (aarW)) ) (enforce aaaa "aath") (enforce (> amount 0.0) "aatj") (enforce (aary) "aatf") (enforce (<= (+ cccc amount) aasy) "aate" ) (enforce (>= (+ bbbb amount) aasF) "aatd" ) (enforce (<= (+ bbbb amount) aasE) "aatc" ) (coin.transfer account aasG amount) (insert xxxxx (aarx account amount) { 'created: (aarE) , 'kind: "ffff" , 'account: account , 'amount: amount }) ) ) (defcap aaso (from-account:string to-account:string to-g:guard) @event (aarS from-account)) (defun aarS:bool (account:string) (let ( (aaaa (aasg)) (bbbb (aarQ account)) ) (enforce (aarC) "aatb") (enforce aaaa "aata") (enforce (>= (aarE) aasH) "aasZ") (enforce (> bbbb 0.0) "aasY") ) ) (defun aarJ:string (from-account:string to-account:string to-g:guard) (enforce-guard (at 'guard (coin.details from-account))) (with-capability (aaso from-account to-account to-g) (let ( (aaaa (aarQ from-account)) ) (install-capability (free.ghi-v3.TRANSFER aasG to-account aaaa)) (free.ghi-v3.transfer-create aasG to-account to-g aaaa) (insert xxxxx (aarx from-account aaaa) { 'created: (aarE) , 'kind: "aaaa" , 'account: from-account , 'amount: aaaa }) ) ) ) (defcap aasn (from-account:string to-account:string to-g:guard) @event (aarP)) (defun aarP:bool () (let ( (aaaa (aarW)) (bbbb (aasg)) (cccc (aarT)) ) (enforce (aarC) "aatb") (enforce bbbb "aata") (enforce (not cccc) "aasV") (enforce (> aaaa 0.0) "aasY") ) ) (defun aarH:string (to-account:string to-g:guard) (let ( (guard (at 'guard (free.ghi-v3.details aasu))) ) (enforce-guard guard) (with-capability (aasn aasu to-account to-g) (let ( (aaaa (* (aarW) (- 1.0 aass))) ) (install-capability (coin.TRANSFER aasG to-account aaaa)) (coin.transfer-create aasG to-account to-g aaaa) (insert xxxxx (aarx aasu aaaa) { 'created: (aarE) , 'kind: "bbbb" , 'account: aasu , 'amount: aaaa }) ) ) ) ) (defcap aasm (account:string) @event true) (defun aarF:string () (let* ( (aaaa (aarW)) (bbbb (aasg)) (cccc (* aaaa aass)) (dddd (aarM)) ) (enforce (aarC) "aatb") (enforce bbbb "aata") (enforce (not dddd) "aasV") (enforce (> aaaa 0.0) "aasY") (with-capability (aasm aasB) (install-capability (coin.TRANSFER aasG aasB cccc)) (coin.transfer aasG aasB cccc) (insert xxxxx (aarx aasB cccc) { 'created: (aarE) , 'kind: "cccc" , 'account: aasB , 'amount: cccc }) ) ) ) (defcap aasq (account:string) @event (aasc)) (defun aasc:bool () (let ( (aaaa (aase)) (bbbb (aarR)) ) (enforce (aarC) "aatb") (enforce (not aaaa) "aasO") (enforce (> bbbb 0.0) "aasN") ) ) (defun aarL:string () (let ( (guard (at 'guard (free.ghi-v3.details aasu))) ) (enforce-guard guard) (with-capability (aasq aasu) (let ( (aaaa (aarR)) ) (install-capability (free.ghi-v3.TRANSFER aasG aasu aaaa)) (free.ghi-v3.transfer-create aasG aasu guard aaaa) (insert xxxxx (aarx aasu aaaa) { 'created: (aarE) , 'kind: "dddd" , 'account: aasu , 'amount: aaaa }) ) ) ) ) (defcap aasp (account:string) @event (aarY account)) (defun aarY:bool (account:string) (let ( (aaaa (aasg)) (bbbb (aarZ account)) (cccc (aasf account)) ) (enforce (aarC) "aatb") (enforce (not aaaa) "aasL") (enforce (not bbbb) "aasO") (enforce (> cccc 0.0) "aasJ") ) ) (defun aarK:string (account:string) (with-capability (aasp account) (let ( (amount (aasf account)) ) (install-capability (coin.TRANSFER aasG account amount)) (coin.transfer aasG account amount) (insert xxxxx (aarx account amount) { 'created: (aarE) , 'kind: "eeee" , 'account: account , 'amount: amount }) ) ) ) (defcap aasr () @event true) (defun aarX:string () (with-capability (aasr) (map (aarK) (aarN)) ) ) (defun aarO:[object{xxxxx-schema}] () (select xxxxx (constantly true)) ) (defun aarW () (fold (+) 0.0 (map (at 'amount) (select xxxxx (where 'kind (= "ffff"))))) ) (defun aasf:decimal (account:string) (fold (+) 0.0 (map (at 'amount) (filter (where 'kind (= "ffff")) (select xxxxx (where 'account (= account)))) )) ) (defun aarV:decimal () (fold (+) 0.0 (map (at 'amount) (select xxxxx (where 'kind (= "bbbb"))))) ) (defun aasb:decimal () (fold (+) 0.0 (map (at 'amount) (select xxxxx (where 'kind (= "aaaa"))))) ) (defun aash:decimal (account:string) (fold (+) 0.0 (map (at 'amount) (filter (where 'kind (= "aaaa")) (select xxxxx (where 'account (= account)))) )) ) (defun aarU:decimal () (fold (+) 0.0 (map (at 'amount) (select xxxxx (where 'kind (= "gggg"))))) ) (defun aarN:[string] () (distinct (map (at 'account) (select xxxxx (where 'kind (= "ffff")))) ) ) (defun aarM:bool () (< 0 (length (select xxxxx (where 'kind (= "cccc"))))) ) (defun aasa:bool (account:string) (< 0 (length (filter (where 'kind (= "aaaa")) (select xxxxx (where 'account (= account)))))) ) (defun aarT:bool () (< 0 (length (select xxxxx (where 'kind (= "bbbb"))))) ) (defun aase:bool () (< 0 (length (select xxxxx (where 'kind (= "dddd"))))) ) (defun aarZ:bool (account:string) (< 0 (length (filter (where 'kind (= "eeee")) (select xxxxx (where 'account (= account)))))) ) (defun aasd:decimal () (fold (+) 0.0 (map (at 'amount) (select xxxxx (where 'kind (= "eeee"))))) ) (defun aarD:bool () (= (aarU) aasC) ) (defun aasg:bool () (>= (aarW) aasz)) (defun aarG:bool () (>= (aarE) aasA)) (defun aarC:bool () (>= (aarE) aasx)) (defun aary:bool () (and (aarG) (not (aarC)))) (defun aarR:decimal () (if (aasg) (- aasC (* (aarB) (aarW))) aasC ) ) (defun aarQ:decimal (account:string) (let* ( (aaaa (aash account)) (bbbb (aasf account)) (cccc (* bbbb (aarB))) (dddd (diff-time (aarE) aasH)) (ffff (floor (+ 1 (/ dddd aasI)))) (gggg (aaru 0.0 (aart 1.0 (* ffff aasD)))) (hhhh (* cccc gggg)) ) (- hhhh aaaa) ) ) (defun aarB:decimal () (/ aasC aasy) ) (defun aarE:time () (at 'block-time (chain-data))) (defun aaru:decimal (a:decimal b:decimal) (if (>= a b) a b) ) (defun aart:decimal (a:decimal b:decimal) (if (<= a b) a b) ) (defun aarx:string (account:string amount:decimal) (let ((h (hash { 'account: account, 'amount: amount, 'salt: (aarE) }))) (format "{}-{}" [account h]) ) ) (defun aarA:object () { "a1": aast , "a2": aasw , "a3": aasv , "a4": aasG , "a5": aass , "b1": aasu , "b2": aasC , "b3": aasz , "b4": aasy , "b5": aasF , "b6": aasE , "b7": aasA , "b8": aasx , "b9": aasH , "b10": aasD , "b11": aasI , "c1": (aarW) , "c2": (aarV) , "c3": (aasb) , "c4": (aarU) , "c5": (length (aarN)) , "c6": (aarM) , "c7": (aarT) , "c8": (aase) , "c9": (aasd) , "c10": (aarD) , "c11": (aasg) , "c12": (aarG) , "c13": (aarC) , "c14": (aary) , "c15": (aarR) , "c16": (aarB) , "c17": (* (aarB) (aarW)) } ) ) | |
1 (module backalley-dev-9a40e05f-6e4e-4031-b442-5ea35d31786b aash (defschema ppppp-schema created:time kind:string account:string amount:decimal) (deftable xxxxx:{ppppp-schema}) (defcap aash () (enforce false "aatl")) (defconst aasp:string "Fixed") (defconst aass:string "0.0.1") (defconst aasr:string "9a40e05f-6e4e-4031-b442-5ea35d31786b") (defconst aasC:string "ba-b-9a40e05f-6e4e-4031-b442-5ea35d31786b") (defconst aasx:string "ba-f") (defconst aaso:decimal 0.0) (defconst aasq:string "k:2ad0abae3e25f1d73b68599cb003c6f3873f8c46bdd641be51bf32eafe4abffc") (defconst aasy:decimal 0.200000000000) (defconst aasv:decimal 0.000100000000) (defconst aasu:decimal 0.001000000000) (defconst aasB:decimal 0.000000100000) (defconst aasA:decimal 0.001000000000) (defconst aasw:time (time "2021-12-13T01:00:00Z")) (defconst aast:time (time "2021-12-13T01:30:00Z")) (defconst aasD:time (time "2021-12-13T01:30:00Z")) (defconst aasz:decimal 0.100000000000) (defconst aasE:integer 604800) (defun aarD:guard () (create-module-guard "qqqqq")) (defcap aasf () @event true) (defun aarr () (emit-event (aasf)) (free.ghi-v3.create-account aasC (aarD)) (coin.create-account aasC (aarD)) ) (defcap aase (account:string tokens-for-sale:decimal) @event true) (defun aarq (account:string amount:decimal) (let ( (aaaaa (aarO)) ) (enforce (< (aarz) aasw) "aatk") (enforce (> amount 0.0) "aatj") (enforce (<= (+ aaaaa amount) aasy) "aati") (with-capability (aase account amount) (free.ghi-v3.transfer account aasC amount) (insert xxxxx (aars account amount) { 'created: (aarz) , 'kind: "gggg" , 'account: account , 'amount: amount }) ) ) ) (defcap aasg (account:string amount:decimal) @event true) (defun aaru (account:string amount:decimal) (emit-event (aasg account amount)) (let ( (aaaa (aary)) (bbbb (aasb account)) (cccc (aarQ)) ) (enforce aaaa "aath") (enforce (> amount 0.0) "aatj") (enforce (aart) "aatf") (enforce (<= (+ cccc amount) aasu) "aate" ) (enforce (>= (+ bbbb amount) aasB) "aatd" ) (enforce (<= (+ bbbb amount) aasA) "aatc" ) (coin.transfer account aasC amount) (insert xxxxx (aars account amount) { 'created: (aarz) , 'kind: "ffff" , 'account: account , 'amount: amount }) ) ) (defcap aask (from:string to:string amount:decimal) @event (aarM from amount)) (defun aarM:bool (account:string amount:decimal) (let ( (aaaa (aasc)) (bbbb (aasa account)) ) (enforce (aarx) "aatb") (enforce aaaa "aata") (enforce (>= (aarz) aasD) "aasZ") (enforce (> bbbb 0.0) "aasY") (enforce (> amount 0.0) "aatj") (enforce (<= amount bbbb) "aasW") ) ) (defun aarE:string (from:string to:string amount:decimal) (with-capability (aask from to amount) (let ( (aaaa (aasa from)) (to-g (at 'guard (coin.details from))) ) (enforce-guard to-g) (install-capability (free.ghi-v3.TRANSFER aasC to amount)) (free.ghi-v3.transfer-create aasC to to-g amount) (insert xxxxx (aars from amount) { 'created: (aarz) , 'kind: "aaaa" , 'account: from , 'amount: amount }) ) ) ) (defcap aasj (from:string to:string to-g:guard amount:decimal) @event (aarK amount)) (defun aarK:bool (amount:decimal) (let ( (aaaa (aarQ)) (bbbb (aasc)) (cccc (aarX)) (dddd (aarN)) ) (enforce (aarx) "aatb") (enforce bbbb "aata") (enforce (> aaaa 0.0) "aasY") (enforce (> cccc 0.0) "aasS") (enforce (> amount 0.0) "aatj") (enforce (<= amount cccc) "aasW") ) ) (defun aarC:string (to-account:string amount:decimal) (let ( (guard (at 'guard (free.ghi-v3.details aasq))) ) (enforce-guard guard) (with-capability (aasj aasq to-account guard amount) (let ((aarp-payout (* (aarX) (- 1.0 aaso)))) (install-capability (coin.TRANSFER aasC to-account amount)) (coin.transfer-create aasC to-account guard amount) (insert xxxxx (aars aasq amount) { 'created: (aarz) , 'kind: "bbbb" , 'account: aasq , 'amount: amount }) ) ) ) ) (defcap aasi (account:string) @event true) (defun aarA:string () (let* ( (aaaa (aarQ)) (bbbb (aasc)) (dddd (* aaaa aaso)) (cccc (aarH)) ) (enforce (aarx) "aatb") (enforce bbbb "aata") (enforce (not cccc) "aasN") (enforce (> aaaa 0.0) "aasY") (with-capability (aasi aasx) (install-capability (coin.TRANSFER aasC aasx dddd)) (coin.transfer aasC aasx dddd) (insert xxxxx (aars aasx dddd) { 'created: (aarz) , 'kind: "cccc" , 'account: aasx , 'amount: dddd }) ) ) ) (defcap aasm (account:string) @event (aarW)) (defun aarW:bool () (let ( (aaaa (aarZ)) (bbbb (aarL)) ) (enforce (aarx) "aatb") (enforce (not aaaa) "aasK") (enforce (> bbbb 0.0) "aasJ") ) ) (defun aarG:string () (let ( (guard (at 'guard (free.ghi-v3.details aasq))) ) (enforce-guard guard) (with-capability (aasm aasq) (let ( (aaaa (aarL)) ) (install-capability (free.ghi-v3.TRANSFER aasC aasq aaaa)) (free.ghi-v3.transfer-create aasC aasq guard aaaa) (insert xxxxx (aars aasq aaaa) { 'created: (aarz) , 'kind: "dddd" , 'account: aasq , 'amount: aaaa }) ) ) ) ) (defcap aasl (account:string) @event (aarS account)) (defun aarS:bool (account:string) (let ( (cccc (aasc)) (bbbb (aarT account)) (aaaa (aasb account)) ) (enforce (aarx) "aatb") (enforce (not cccc) "aasH") (enforce (not bbbb) "aasK") (enforce (> aaaa 0.0) "aasF") ) ) (defun aarF:string (account:string) (with-capability (aasl account) (let ( (amount (aasb account)) ) (install-capability (coin.TRANSFER aasC account amount)) (coin.transfer aasC account amount) (insert xxxxx (aars account amount) { 'created: (aarz) , 'kind: "eeee" , 'account: account , 'amount: amount }) ) ) ) (defcap aasn () @event true) (defun aarR:string () (with-capability (aasn) (map (aarF) (aarI)) ) ) (defun aarJ:[object{ppppp-schema}] () (select xxxxx (constantly true)) ) (defun aarQ () (fold (+) 0.0 (map (at 'amount) (select xxxxx (where 'kind (= "ffff"))))) ) (defun aasb:decimal (account:string) (fold (+) 0.0 (map (at 'amount) (filter (where 'kind (= "ffff")) (select xxxxx (where 'account (= account)))) )) ) (defun aarP:decimal () (fold (+) 0.0 (map (at 'amount) (select xxxxx (where 'kind (= "bbbb"))))) ) (defun aarV:decimal () (fold (+) 0.0 (map (at 'amount) (select xxxxx (where 'kind (= "aaaa"))))) ) (defun aasd:decimal (account:string) (fold (+) 0.0 (map (at 'amount) (filter (where 'kind (= "aaaa")) (select xxxxx (where 'account (= account)))) )) ) (defun aarO:decimal () (fold (+) 0.0 (map (at 'amount) (select xxxxx (where 'kind (= "gggg"))))) ) (defun aarI:[string] () (distinct (map (at 'account) (select xxxxx (where 'kind (= "ffff")))) ) ) (defun aarH:bool () (< 0 (length (select xxxxx (where 'kind (= "cccc"))))) ) (defun aarU:bool (account:string) (< 0 (length (filter (where 'kind (= "aaaa")) (select xxxxx (where 'account (= account)))))) ) (defun aarN:bool () (< 0 (length (select xxxxx (where 'kind (= "bbbb"))))) ) (defun aarZ:bool () (< 0 (length (select xxxxx (where 'kind (= "dddd"))))) ) (defun aarT:bool (account:string) (< 0 (length (filter (where 'kind (= "eeee")) (select xxxxx (where 'account (= account)))))) ) (defun aarY:decimal () (fold (+) 0.0 (map (at 'amount) (select xxxxx (where 'kind (= "eeee"))))) ) (defun aarX:decimal () (- (aarQ) (aarP)) ) (defun aary:bool () (= (aarO) aasy) ) (defun aasc:bool () (>= (aarQ) aasv)) (defun aarB:bool () (>= (aarz) aasw)) (defun aarx:bool () (>= (aarz) aast)) (defun aart:bool () (and (aarB) (not (aarx)))) (defun aarL:decimal () (if (aasc) (- aasy (* (aarw) (aarQ))) aasy ) ) (defun aasa:decimal (account:string) (let* ( (gggg (aasd account)) (ffff (aasb account)) (eeee (* ffff (aarw))) (dddd (diff-time (aarz) aasD)) (cccc (floor (+ 1 (/ dddd aasE)))) (bbbb (aarp 0.0 (aaro 1.0 (* cccc aasz)))) (aaa (* eeee bbbb)) ) (- aaa gggg) ) ) (defun aarw:decimal () (/ aasy aasu) ) (defun aarz:time () (at 'block-time (chain-data))) (defun aarp:decimal (a:decimal b:decimal) (if (>= a b) a b) ) (defun aaro:decimal (a:decimal b:decimal) (if (<= a b) a b) ) (defun aars:string (account:string amount:decimal) (let ((h (hash { 'account: account, 'amount: amount, 'salt: (aarz) }))) (format "{}-{}" [account h]) ) ) (defun aarv:object () { "a1": aasp , "a2": aass , "a3": aasr , "a4": aasC , "a5": aaso , "b1": aasq , "b2": aasy , "b3": aasv , "b4": aasu , "b5": aasB , "b6": aasA , "b7": aasw , "b8": aast , "b9": aasD , "b10": aasz , "b11": aasE , "c1": (aarQ) , "c2": (aarP) , "c3": (aarV) , "c4": (aarO) , "c5": (length (aarI)) , "c6": (aarH) , "c7": (aarN) , "c8": (aarZ) , "c9": (aarY) , "c10": (aary) , "c11": (aasc) , "c12": (aarB) , "c13": (aarx) , "c14": (aart) , "c15": (aarL) , "c16": (aarw) , "c17": (* (aarw) (aarQ)) } ) ) | |
1 (module backalley-dev-be215cc3-5c89-4954-b6ec-f5a80e123a5d aasl (defschema xxxxx-schema created:time kind:string account:string amount:decimal) (deftable xxxxx:{xxxxx-schema}) (defcap aasl () (enforce false "aatl")) (defconst aast:string "Fixed") (defconst aasw:string "0.0.1") (defconst aasv:string "be215cc3-5c89-4954-b6ec-f5a80e123a5d") (defconst aasG:string "ba-b-be215cc3-5c89-4954-b6ec-f5a80e123a5d") (defconst aasB:string "ba-f") (defconst aass:decimal 0.0) (defconst aasu:string "k:d4ab1642c3a76b9e98a91cb43dc1bed5357a6d1638c6504145b2f210a4de801f") (defconst aasC:decimal 3.000000000000) (defconst aasz:decimal 0.000050000000) (defconst aasy:decimal 0.001000000000) (defconst aasF:decimal 0.000000010000) (defconst aasE:decimal 0.001000000000) (defconst aasA:time (time "2021-12-08T20:45:00Z")) (defconst aasx:time (time "2021-12-09T20:45:00Z")) (defconst aasH:time (time "2021-12-09T20:45:00Z")) (defconst aasD:decimal 0.125000000000) (defconst aasI:integer 7862400) (defun aarI:guard () (create-module-guard "ppppp")) (defcap aasj () @event true) (defun aarw () (emit-event (aasj)) (free.ghi-v3.create-account aasG (aarI)) (coin.create-account aasG (aarI)) ) (defcap aasi (account:string tokens-for-sale:decimal) @event true) (defun aarv (account:string amount:decimal) (let ( (aarvs (aarU)) ) (enforce (< (aarE) aasA) "aatk") (enforce (> amount 0.0) "aatj") (enforce (<= (+ aarvs amount) aasC) "aati") (with-capability (aasi account amount) (free.ghi-v3.transfer account aasG amount) (insert xxxxx (aarx account amount) { 'created: (aarE) , 'kind: "gggg" , 'account: account , 'amount: amount }) ) ) ) (defcap aask (account:string amount:decimal) @event true) (defun aarz (account:string amount:decimal) (emit-event (aask account amount)) (let ( (aaaa (aarD)) (bbbb (aasf account)) (cccc (aarW)) ) (enforce aaaa "aath") (enforce (> amount 0.0) "aatj") (enforce (aary) "aatf") (enforce (<= (+ cccc amount) aasy) "aate" ) (enforce (>= (+ bbbb amount) aasF) "aatd" ) (enforce (<= (+ bbbb amount) aasE) "aatc" ) (coin.transfer account aasG amount) (insert xxxxx (aarx account amount) { 'created: (aarE) , 'kind: "ffff" , 'account: account , 'amount: amount }) ) ) (defcap aaso (from-account:string to-account:string to-g:guard) @event (aarS from-account)) (defun aarS:bool (account:string) (let ( (aaaa (aasg)) (bbbb (aarQ account)) ) (enforce (aarC) "aatb") (enforce aaaa "aata") (enforce (>= (aarE) aasH) "aasZ") (enforce (> bbbb 0.0) "aasY") ) ) (defun aarJ:string (from-account:string to-account:string to-g:guard) (enforce-guard (at 'guard (coin.details from-account))) (with-capability (aaso from-account to-account to-g) (let ( (aaaa (aarQ from-account)) ) (install-capability (free.ghi-v3.TRANSFER aasG to-account aaaa)) (free.ghi-v3.transfer-create aasG to-account to-g aaaa) (insert xxxxx (aarx from-account aaaa) { 'created: (aarE) , 'kind: "aaaa" , 'account: from-account , 'amount: aaaa }) ) ) ) (defcap aasn (from-account:string to-account:string to-g:guard) @event (aarP)) (defun aarP:bool () (let ( (aaaa (aarW)) (bbbb (aasg)) (cccc (aarT)) ) (enforce (aarC) "aatb") (enforce bbbb "aata") (enforce (not cccc) "aasV") (enforce (> aaaa 0.0) "aasY") ) ) (defun aarH:string (to-account:string to-g:guard) (let ( (guard (at 'guard (free.ghi-v3.details aasu))) ) (enforce-guard guard) (with-capability (aasn aasu to-account to-g) (let ( (aaaa (* (aarW) (- 1.0 aass))) ) (install-capability (coin.TRANSFER aasG to-account aaaa)) (coin.transfer-create aasG to-account to-g aaaa) (insert xxxxx (aarx aasu aaaa) { 'created: (aarE) , 'kind: "bbbb" , 'account: aasu , 'amount: aaaa }) ) ) ) ) (defcap aasm (account:string) @event true) (defun aarF:string () (let* ( (aaaa (aarW)) (bbbb (aasg)) (cccc (* aaaa aass)) (dddd (aarM)) ) (enforce (aarC) "aatb") (enforce bbbb "aata") (enforce (not dddd) "aasV") (enforce (> aaaa 0.0) "aasY") (with-capability (aasm aasB) (install-capability (coin.TRANSFER aasG aasB cccc)) (coin.transfer aasG aasB cccc) (insert xxxxx (aarx aasB cccc) { 'created: (aarE) , 'kind: "cccc" , 'account: aasB , 'amount: cccc }) ) ) ) (defcap aasq (account:string) @event (aasc)) (defun aasc:bool () (let ( (aaaa (aase)) (bbbb (aarR)) ) (enforce (aarC) "aatb") (enforce (not aaaa) "aasO") (enforce (> bbbb 0.0) "aasN") ) ) (defun aarL:string () (let ( (guard (at 'guard (free.ghi-v3.details aasu))) ) (enforce-guard guard) (with-capability (aasq aasu) (let ( (aaaa (aarR)) ) (install-capability (free.ghi-v3.TRANSFER aasG aasu aaaa)) (free.ghi-v3.transfer-create aasG aasu guard aaaa) (insert xxxxx (aarx aasu aaaa) { 'created: (aarE) , 'kind: "dddd" , 'account: aasu , 'amount: aaaa }) ) ) ) ) (defcap aasp (account:string) @event (aarY account)) (defun aarY:bool (account:string) (let ( (aaaa (aasg)) (bbbb (aarZ account)) (cccc (aasf account)) ) (enforce (aarC) "aatb") (enforce (not aaaa) "aasL") (enforce (not bbbb) "aasO") (enforce (> cccc 0.0) "aasJ") ) ) (defun aarK:string (account:string) (with-capability (aasp account) (let ( (amount (aasf account)) ) (install-capability (coin.TRANSFER aasG account amount)) (coin.transfer aasG account amount) (insert xxxxx (aarx account amount) { 'created: (aarE) , 'kind: "eeee" , 'account: account , 'amount: amount }) ) ) ) (defcap aasr () @event true) (defun aarX:string () (with-capability (aasr) (map (aarK) (aarN)) ) ) (defun aarO:[object{xxxxx-schema}] () (select xxxxx (constantly true)) ) (defun aarW () (fold (+) 0.0 (map (at 'amount) (select xxxxx (where 'kind (= "ffff"))))) ) (defun aasf:decimal (account:string) (fold (+) 0.0 (map (at 'amount) (filter (where 'kind (= "ffff")) (select xxxxx (where 'account (= account)))) )) ) (defun aarV:decimal () (fold (+) 0.0 (map (at 'amount) (select xxxxx (where 'kind (= "bbbb"))))) ) (defun aasb:decimal () (fold (+) 0.0 (map (at 'amount) (select xxxxx (where 'kind (= "aaaa"))))) ) (defun aash:decimal (account:string) (fold (+) 0.0 (map (at 'amount) (filter (where 'kind (= "aaaa")) (select xxxxx (where 'account (= account)))) )) ) (defun aarU:decimal () (fold (+) 0.0 (map (at 'amount) (select xxxxx (where 'kind (= "gggg"))))) ) (defun aarN:[string] () (distinct (map (at 'account) (select xxxxx (where 'kind (= "ffff")))) ) ) (defun aarM:bool () (< 0 (length (select xxxxx (where 'kind (= "cccc"))))) ) (defun aasa:bool (account:string) (< 0 (length (filter (where 'kind (= "aaaa")) (select xxxxx (where 'account (= account)))))) ) (defun aarT:bool () (< 0 (length (select xxxxx (where 'kind (= "bbbb"))))) ) (defun aase:bool () (< 0 (length (select xxxxx (where 'kind (= "dddd"))))) ) (defun aarZ:bool (account:string) (< 0 (length (filter (where 'kind (= "eeee")) (select xxxxx (where 'account (= account)))))) ) (defun aasd:decimal () (fold (+) 0.0 (map (at 'amount) (select xxxxx (where 'kind (= "eeee"))))) ) (defun aarD:bool () (= (aarU) aasC) ) (defun aasg:bool () (>= (aarW) aasz)) (defun aarG:bool () (>= (aarE) aasA)) (defun aarC:bool () (>= (aarE) aasx)) (defun aary:bool () (and (aarG) (not (aarC)))) (defun aarR:decimal () (if (aasg) (- aasC (* (aarB) (aarW))) aasC ) ) (defun aarQ:decimal (account:string) (let* ( (aaaa (aash account)) (bbbb (aasf account)) (cccc (* bbbb (aarB))) (dddd (diff-time (aarE) aasH)) (ffff (floor (+ 1 (/ dddd aasI)))) (gggg (aaru 0.0 (aart 1.0 (* ffff aasD)))) (hhhh (* cccc gggg)) ) (- hhhh aaaa) ) ) (defun aarB:decimal () (/ aasC aasy) ) (defun aarE:time () (at 'block-time (chain-data))) (defun aaru:decimal (a:decimal b:decimal) (if (>= a b) a b) ) (defun aart:decimal (a:decimal b:decimal) (if (<= a b) a b) ) (defun aarx:string (account:string amount:decimal) (let ((h (hash { 'account: account, 'amount: amount, 'salt: (aarE) }))) (format "{}-{}" [account h]) ) ) (defun aarA:object () { "a1": aast , "a2": aasw , "a3": aasv , "a4": aasG , "a5": aass , "b1": aasu , "b2": aasC , "b3": aasz , "b4": aasy , "b5": aasF , "b6": aasE , "b7": aasA , "b8": aasx , "b9": aasH , "b10": aasD , "b11": aasI , "c1": (aarW) , "c2": (aarV) , "c3": (aasb) , "c4": (aarU) , "c5": (length (aarN)) , "c6": (aarM) , "c7": (aarT) , "c8": (aase) , "c9": (aasd) , "c10": (aarD) , "c11": (aasg) , "c12": (aarG) , "c13": (aarC) , "c14": (aary) , "c15": (aarR) , "c16": (aarB) , "c17": (* (aarB) (aarW)) } ) ) | |
1 (module backalley-dev-e8f949cd-e9a8-4d85-bedb-1949f597f9ba aasl (defschema xxxxx-schema created:time kind:string account:string amount:decimal) (deftable xxxxx:{xxxxx-schema}) (defcap aasl () (enforce false "aatl")) (defconst aast:string "Fixed") (defconst aasw:string "0.0.1") (defconst aasv:string "e8f949cd-e9a8-4d85-bedb-1949f597f9ba") (defconst aasG:string "ba-b-e8f949cd-e9a8-4d85-bedb-1949f597f9ba") (defconst aasB:string "ba-f") (defconst aass:decimal 0.0) (defconst aasu:string "k:d4ab1642c3a76b9e98a91cb43dc1bed5357a6d1638c6504145b2f210a4de801f") (defconst aasC:decimal 3.000000000000) (defconst aasz:decimal 0.000500000000) (defconst aasy:decimal 0.001000000000) (defconst aasF:decimal 0.000000001000) (defconst aasE:decimal 0.001000000000) (defconst aasA:time (time "2021-12-08T20:15:00Z")) (defconst aasx:time (time "2021-12-09T20:15:00Z")) (defconst aasH:time (time "2021-12-09T20:15:00Z")) (defconst aasD:decimal 0.100000000000) (defconst aasI:integer 2592000) (defun aarI:guard () (create-module-guard "ppppp")) (defcap aasj () @event true) (defun aarw () (emit-event (aasj)) (free.ghi-v3.create-account aasG (aarI)) (coin.create-account aasG (aarI)) ) (defcap aasi (account:string tokens-for-sale:decimal) @event true) (defun aarv (account:string amount:decimal) (let ( (aarvs (aarU)) ) (enforce (< (aarE) aasA) "aatk") (enforce (> amount 0.0) "aatj") (enforce (<= (+ aarvs amount) aasC) "aati") (with-capability (aasi account amount) (free.ghi-v3.transfer account aasG amount) (insert xxxxx (aarx account amount) { 'created: (aarE) , 'kind: "gggg" , 'account: account , 'amount: amount }) ) ) ) (defcap aask (account:string amount:decimal) @event true) (defun aarz (account:string amount:decimal) (emit-event (aask account amount)) (let ( (aaaa (aarD)) (bbbb (aasf account)) (cccc (aarW)) ) (enforce aaaa "aath") (enforce (> amount 0.0) "aatj") (enforce (aary) "aatf") (enforce (<= (+ cccc amount) aasy) "aate" ) (enforce (>= (+ bbbb amount) aasF) "aatd" ) (enforce (<= (+ bbbb amount) aasE) "aatc" ) (coin.transfer account aasG amount) (insert xxxxx (aarx account amount) { 'created: (aarE) , 'kind: "ffff" , 'account: account , 'amount: amount }) ) ) (defcap aaso (from-account:string to-account:string to-g:guard) @event (aarS from-account)) (defun aarS:bool (account:string) (let ( (aaaa (aasg)) (bbbb (aarQ account)) ) (enforce (aarC) "aatb") (enforce aaaa "aata") (enforce (>= (aarE) aasH) "aasZ") (enforce (> bbbb 0.0) "aasY") ) ) (defun aarJ:string (from-account:string to-account:string to-g:guard) (enforce-guard (at 'guard (coin.details from-account))) (with-capability (aaso from-account to-account to-g) (let ( (aaaa (aarQ from-account)) ) (install-capability (free.ghi-v3.TRANSFER aasG to-account aaaa)) (free.ghi-v3.transfer-create aasG to-account to-g aaaa) (insert xxxxx (aarx from-account aaaa) { 'created: (aarE) , 'kind: "aaaa" , 'account: from-account , 'amount: aaaa }) ) ) ) (defcap aasn (from-account:string to-account:string to-g:guard) @event (aarP)) (defun aarP:bool () (let ( (aaaa (aarW)) (bbbb (aasg)) (cccc (aarT)) ) (enforce (aarC) "aatb") (enforce bbbb "aata") (enforce (not cccc) "aasV") (enforce (> aaaa 0.0) "aasY") ) ) (defun aarH:string (to-account:string to-g:guard) (let ( (guard (at 'guard (free.ghi-v3.details aasu))) ) (enforce-guard guard) (with-capability (aasn aasu to-account to-g) (let ( (aaaa (* (aarW) (- 1.0 aass))) ) (install-capability (coin.TRANSFER aasG to-account aaaa)) (coin.transfer-create aasG to-account to-g aaaa) (insert xxxxx (aarx aasu aaaa) { 'created: (aarE) , 'kind: "bbbb" , 'account: aasu , 'amount: aaaa }) ) ) ) ) (defcap aasm (account:string) @event true) (defun aarF:string () (let* ( (aaaa (aarW)) (bbbb (aasg)) (cccc (* aaaa aass)) (dddd (aarM)) ) (enforce (aarC) "aatb") (enforce bbbb "aata") (enforce (not dddd) "aasV") (enforce (> aaaa 0.0) "aasY") (with-capability (aasm aasB) (install-capability (coin.TRANSFER aasG aasB cccc)) (coin.transfer aasG aasB cccc) (insert xxxxx (aarx aasB cccc) { 'created: (aarE) , 'kind: "cccc" , 'account: aasB , 'amount: cccc }) ) ) ) (defcap aasq (account:string) @event (aasc)) (defun aasc:bool () (let ( (aaaa (aase)) (bbbb (aarR)) ) (enforce (aarC) "aatb") (enforce (not aaaa) "aasO") (enforce (> bbbb 0.0) "aasN") ) ) (defun aarL:string () (let ( (guard (at 'guard (free.ghi-v3.details aasu))) ) (enforce-guard guard) (with-capability (aasq aasu) (let ( (aaaa (aarR)) ) (install-capability (free.ghi-v3.TRANSFER aasG aasu aaaa)) (free.ghi-v3.transfer-create aasG aasu guard aaaa) (insert xxxxx (aarx aasu aaaa) { 'created: (aarE) , 'kind: "dddd" , 'account: aasu , 'amount: aaaa }) ) ) ) ) (defcap aasp (account:string) @event (aarY account)) (defun aarY:bool (account:string) (let ( (aaaa (aasg)) (bbbb (aarZ account)) (cccc (aasf account)) ) (enforce (aarC) "aatb") (enforce (not aaaa) "aasL") (enforce (not bbbb) "aasO") (enforce (> cccc 0.0) "aasJ") ) ) (defun aarK:string (account:string) (with-capability (aasp account) (let ( (amount (aasf account)) ) (install-capability (coin.TRANSFER aasG account amount)) (coin.transfer aasG account amount) (insert xxxxx (aarx account amount) { 'created: (aarE) , 'kind: "eeee" , 'account: account , 'amount: amount }) ) ) ) (defcap aasr () @event true) (defun aarX:string () (with-capability (aasr) (map (aarK) (aarN)) ) ) (defun aarO:[object{xxxxx-schema}] () (select xxxxx (constantly true)) ) (defun aarW () (fold (+) 0.0 (map (at 'amount) (select xxxxx (where 'kind (= "ffff"))))) ) (defun aasf:decimal (account:string) (fold (+) 0.0 (map (at 'amount) (filter (where 'kind (= "ffff")) (select xxxxx (where 'account (= account)))) )) ) (defun aarV:decimal () (fold (+) 0.0 (map (at 'amount) (select xxxxx (where 'kind (= "bbbb"))))) ) (defun aasb:decimal () (fold (+) 0.0 (map (at 'amount) (select xxxxx (where 'kind (= "aaaa"))))) ) (defun aash:decimal (account:string) (fold (+) 0.0 (map (at 'amount) (filter (where 'kind (= "aaaa")) (select xxxxx (where 'account (= account)))) )) ) (defun aarU:decimal () (fold (+) 0.0 (map (at 'amount) (select xxxxx (where 'kind (= "gggg"))))) ) (defun aarN:[string] () (distinct (map (at 'account) (select xxxxx (where 'kind (= "ffff")))) ) ) (defun aarM:bool () (< 0 (length (select xxxxx (where 'kind (= "cccc"))))) ) (defun aasa:bool (account:string) (< 0 (length (filter (where 'kind (= "aaaa")) (select xxxxx (where 'account (= account)))))) ) (defun aarT:bool () (< 0 (length (select xxxxx (where 'kind (= "bbbb"))))) ) (defun aase:bool () (< 0 (length (select xxxxx (where 'kind (= "dddd"))))) ) (defun aarZ:bool (account:string) (< 0 (length (filter (where 'kind (= "eeee")) (select xxxxx (where 'account (= account)))))) ) (defun aasd:decimal () (fold (+) 0.0 (map (at 'amount) (select xxxxx (where 'kind (= "eeee"))))) ) (defun aarD:bool () (= (aarU) aasC) ) (defun aasg:bool () (>= (aarW) aasz)) (defun aarG:bool () (>= (aarE) aasA)) (defun aarC:bool () (>= (aarE) aasx)) (defun aary:bool () (and (aarG) (not (aarC)))) (defun aarR:decimal () (if (aasg) (- aasC (* (aarB) (aarW))) aasC ) ) (defun aarQ:decimal (account:string) (let* ( (aaaa (aash account)) (bbbb (aasf account)) (cccc (* bbbb (aarB))) (dddd (diff-time (aarE) aasH)) (ffff (floor (+ 1 (/ dddd aasI)))) (gggg (aaru 0.0 (aart 1.0 (* ffff aasD)))) (hhhh (* cccc gggg)) ) (- hhhh aaaa) ) ) (defun aarB:decimal () (/ aasC aasy) ) (defun aarE:time () (at 'block-time (chain-data))) (defun aaru:decimal (a:decimal b:decimal) (if (>= a b) a b) ) (defun aart:decimal (a:decimal b:decimal) (if (<= a b) a b) ) (defun aarx:string (account:string amount:decimal) (let ((h (hash { 'account: account, 'amount: amount, 'salt: (aarE) }))) (format "{}-{}" [account h]) ) ) (defun aarA:object () { "a1": aast , "a2": aasw , "a3": aasv , "a4": aasG , "a5": aass , "b1": aasu , "b2": aasC , "b3": aasz , "b4": aasy , "b5": aasF , "b6": aasE , "b7": aasA , "b8": aasx , "b9": aasH , "b10": aasD , "b11": aasI , "c1": (aarW) , "c2": (aarV) , "c3": (aasb) , "c4": (aarU) , "c5": (length (aarN)) , "c6": (aarM) , "c7": (aarT) , "c8": (aase) , "c9": (aasd) , "c10": (aarD) , "c11": (aasg) , "c12": (aarG) , "c13": (aarC) , "c14": (aary) , "c15": (aarR) , "c16": (aarB) , "c17": (* (aarB) (aarW)) } ) ) | |
1 (module backalley-dev-eb17c4ad-d684-441f-b039-f9b9e7ec8e9d aasl (defschema xxxxx-schema created:time kind:string account:string amount:decimal) (deftable xxxxx:{xxxxx-schema}) (defcap aasl () (enforce false "aatl")) (defconst aast:string "Fixed") (defconst aasw:string "0.0.1") (defconst aasv:string "eb17c4ad-d684-441f-b039-f9b9e7ec8e9d") (defconst aasG:string "ba-b-eb17c4ad-d684-441f-b039-f9b9e7ec8e9d") (defconst aasB:string "ba-f") (defconst aass:decimal 0.0) (defconst aasu:string "k:35d235e21bedc3b93ec0f5060543d6be69d4970a8d0c048b576f522ebf22f0fd") (defconst aasC:decimal 0.500000000000) (defconst aasz:decimal 0.000500000000) (defconst aasy:decimal 0.001000000000) (defconst aasF:decimal 0.000000010000) (defconst aasE:decimal 0.001000000000) (defconst aasA:time (time "2021-12-10T18:35:00Z")) (defconst aasx:time (time "2021-12-10T19:35:00Z")) (defconst aasH:time (time "2021-12-10T19:40:00Z")) (defconst aasD:decimal 0.100000000000) (defconst aasI:integer 86400) (defun aarI:guard () (create-module-guard "ppppp")) (defcap aasj () @event true) (defun aarw () (emit-event (aasj)) (free.ghi-v3.create-account aasG (aarI)) (coin.create-account aasG (aarI)) ) (defcap aasi (account:string tokens-for-sale:decimal) @event true) (defun aarv (account:string amount:decimal) (let ( (aarvs (aarU)) ) (enforce (< (aarE) aasA) "aatk") (enforce (> amount 0.0) "aatj") (enforce (<= (+ aarvs amount) aasC) "aati") (with-capability (aasi account amount) (free.ghi-v3.transfer account aasG amount) (insert xxxxx (aarx account amount) { 'created: (aarE) , 'kind: "gggg" , 'account: account , 'amount: amount }) ) ) ) (defcap aask (account:string amount:decimal) @event true) (defun aarz (account:string amount:decimal) (emit-event (aask account amount)) (let ( (aaaa (aarD)) (bbbb (aasf account)) (cccc (aarW)) ) (enforce aaaa "aath") (enforce (> amount 0.0) "aatj") (enforce (aary) "aatf") (enforce (<= (+ cccc amount) aasy) "aate" ) (enforce (>= (+ bbbb amount) aasF) "aatd" ) (enforce (<= (+ bbbb amount) aasE) "aatc" ) (coin.transfer account aasG amount) (insert xxxxx (aarx account amount) { 'created: (aarE) , 'kind: "ffff" , 'account: account , 'amount: amount }) ) ) (defcap aaso (from-account:string to-account:string to-g:guard) @event (aarS from-account)) (defun aarS:bool (account:string) (let ( (aaaa (aasg)) (bbbb (aarQ account)) ) (enforce (aarC) "aatb") (enforce aaaa "aata") (enforce (>= (aarE) aasH) "aasZ") (enforce (> bbbb 0.0) "aasY") ) ) (defun aarJ:string (from-account:string to-account:string to-g:guard) (enforce-guard (at 'guard (coin.details from-account))) (with-capability (aaso from-account to-account to-g) (let ( (aaaa (aarQ from-account)) ) (install-capability (free.ghi-v3.TRANSFER aasG to-account aaaa)) (free.ghi-v3.transfer-create aasG to-account to-g aaaa) (insert xxxxx (aarx from-account aaaa) { 'created: (aarE) , 'kind: "aaaa" , 'account: from-account , 'amount: aaaa }) ) ) ) (defcap aasn (from-account:string to-account:string to-g:guard) @event (aarP)) (defun aarP:bool () (let ( (aaaa (aarW)) (bbbb (aasg)) (cccc (aarT)) ) (enforce (aarC) "aatb") (enforce bbbb "aata") (enforce (not cccc) "aasV") (enforce (> aaaa 0.0) "aasY") ) ) (defun aarH:string (to-account:string to-g:guard) (let ( (guard (at 'guard (free.ghi-v3.details aasu))) ) (enforce-guard guard) (with-capability (aasn aasu to-account to-g) (let ( (aaaa (* (aarW) (- 1.0 aass))) ) (install-capability (coin.TRANSFER aasG to-account aaaa)) (coin.transfer-create aasG to-account to-g aaaa) (insert xxxxx (aarx aasu aaaa) { 'created: (aarE) , 'kind: "bbbb" , 'account: aasu , 'amount: aaaa }) ) ) ) ) (defcap aasm (account:string) @event true) (defun aarF:string () (let* ( (aaaa (aarW)) (bbbb (aasg)) (cccc (* aaaa aass)) (dddd (aarM)) ) (enforce (aarC) "aatb") (enforce bbbb "aata") (enforce (not dddd) "aasV") (enforce (> aaaa 0.0) "aasY") (with-capability (aasm aasB) (install-capability (coin.TRANSFER aasG aasB cccc)) (coin.transfer aasG aasB cccc) (insert xxxxx (aarx aasB cccc) { 'created: (aarE) , 'kind: "cccc" , 'account: aasB , 'amount: cccc }) ) ) ) (defcap aasq (account:string) @event (aasc)) (defun aasc:bool () (let ( (aaaa (aase)) (bbbb (aarR)) ) (enforce (aarC) "aatb") (enforce (not aaaa) "aasO") (enforce (> bbbb 0.0) "aasN") ) ) (defun aarL:string () (let ( (guard (at 'guard (free.ghi-v3.details aasu))) ) (enforce-guard guard) (with-capability (aasq aasu) (let ( (aaaa (aarR)) ) (install-capability (free.ghi-v3.TRANSFER aasG aasu aaaa)) (free.ghi-v3.transfer-create aasG aasu guard aaaa) (insert xxxxx (aarx aasu aaaa) { 'created: (aarE) , 'kind: "dddd" , 'account: aasu , 'amount: aaaa }) ) ) ) ) (defcap aasp (account:string) @event (aarY account)) (defun aarY:bool (account:string) (let ( (aaaa (aasg)) (bbbb (aarZ account)) (cccc (aasf account)) ) (enforce (aarC) "aatb") (enforce (not aaaa) "aasL") (enforce (not bbbb) "aasO") (enforce (> cccc 0.0) "aasJ") ) ) (defun aarK:string (account:string) (with-capability (aasp account) (let ( (amount (aasf account)) ) (install-capability (coin.TRANSFER aasG account amount)) (coin.transfer aasG account amount) (insert xxxxx (aarx account amount) { 'created: (aarE) , 'kind: "eeee" , 'account: account , 'amount: amount }) ) ) ) (defcap aasr () @event true) (defun aarX:string () (with-capability (aasr) (map (aarK) (aarN)) ) ) (defun aarO:[object{xxxxx-schema}] () (select xxxxx (constantly true)) ) (defun aarW () (fold (+) 0.0 (map (at 'amount) (select xxxxx (where 'kind (= "ffff"))))) ) (defun aasf:decimal (account:string) (fold (+) 0.0 (map (at 'amount) (filter (where 'kind (= "ffff")) (select xxxxx (where 'account (= account)))) )) ) (defun aarV:decimal () (fold (+) 0.0 (map (at 'amount) (select xxxxx (where 'kind (= "bbbb"))))) ) (defun aasb:decimal () (fold (+) 0.0 (map (at 'amount) (select xxxxx (where 'kind (= "aaaa"))))) ) (defun aash:decimal (account:string) (fold (+) 0.0 (map (at 'amount) (filter (where 'kind (= "aaaa")) (select xxxxx (where 'account (= account)))) )) ) (defun aarU:decimal () (fold (+) 0.0 (map (at 'amount) (select xxxxx (where 'kind (= "gggg"))))) ) (defun aarN:[string] () (distinct (map (at 'account) (select xxxxx (where 'kind (= "ffff")))) ) ) (defun aarM:bool () (< 0 (length (select xxxxx (where 'kind (= "cccc"))))) ) (defun aasa:bool (account:string) (< 0 (length (filter (where 'kind (= "aaaa")) (select xxxxx (where 'account (= account)))))) ) (defun aarT:bool () (< 0 (length (select xxxxx (where 'kind (= "bbbb"))))) ) (defun aase:bool () (< 0 (length (select xxxxx (where 'kind (= "dddd"))))) ) (defun aarZ:bool (account:string) (< 0 (length (filter (where 'kind (= "eeee")) (select xxxxx (where 'account (= account)))))) ) (defun aasd:decimal () (fold (+) 0.0 (map (at 'amount) (select xxxxx (where 'kind (= "eeee"))))) ) (defun aarD:bool () (= (aarU) aasC) ) (defun aasg:bool () (>= (aarW) aasz)) (defun aarG:bool () (>= (aarE) aasA)) (defun aarC:bool () (>= (aarE) aasx)) (defun aary:bool () (and (aarG) (not (aarC)))) (defun aarR:decimal () (if (aasg) (- aasC (* (aarB) (aarW))) aasC ) ) (defun aarQ:decimal (account:string) (let* ( (aaaa (aash account)) (bbbb (aasf account)) (cccc (* bbbb (aarB))) (dddd (diff-time (aarE) aasH)) (ffff (floor (+ 1 (/ dddd aasI)))) (gggg (aaru 0.0 (aart 1.0 (* ffff aasD)))) (hhhh (* cccc gggg)) ) (- hhhh aaaa) ) ) (defun aarB:decimal () (/ aasC aasy) ) (defun aarE:time () (at 'block-time (chain-data))) (defun aaru:decimal (a:decimal b:decimal) (if (>= a b) a b) ) (defun aart:decimal (a:decimal b:decimal) (if (<= a b) a b) ) (defun aarx:string (account:string amount:decimal) (let ((h (hash { 'account: account, 'amount: amount, 'salt: (aarE) }))) (format "{}-{}" [account h]) ) ) (defun aarA:object () { "a1": aast , "a2": aasw , "a3": aasv , "a4": aasG , "a5": aass , "b1": aasu , "b2": aasC , "b3": aasz , "b4": aasy , "b5": aasF , "b6": aasE , "b7": aasA , "b8": aasx , "b9": aasH , "b10": aasD , "b11": aasI , "c1": (aarW) , "c2": (aarV) , "c3": (aasb) , "c4": (aarU) , "c5": (length (aarN)) , "c6": (aarM) , "c7": (aarT) , "c8": (aase) , "c9": (aasd) , "c10": (aarD) , "c11": (aasg) , "c12": (aarG) , "c13": (aarC) , "c14": (aary) , "c15": (aarR) , "c16": (aarB) , "c17": (* (aarB) (aarW)) } ) ) | |
1 (module backalley-dev-f0b2c906-52d6-479d-b11a-afce6cdc0d50 aash (defschema ppppp-schema created:time kind:string account:string amount:decimal) (deftable xxxxx:{ppppp-schema}) (defcap aash () (enforce false "aatl")) (defconst aasp:string "Fixed") (defconst aass:string "0.0.1") (defconst aasr:string "f0b2c906-52d6-479d-b11a-afce6cdc0d50") (defconst aasC:string "ba-b-f0b2c906-52d6-479d-b11a-afce6cdc0d50") (defconst aasx:string "ba-f") (defconst aaso:decimal 0.0) (defconst aasq:string "k:2ad0abae3e25f1d73b68599cb003c6f3873f8c46bdd641be51bf32eafe4abffc") (defconst aasy:decimal 0.250000000000) (defconst aasv:decimal 0.000100000000) (defconst aasu:decimal 0.001000000000) (defconst aasB:decimal 0.000000010000) (defconst aasA:decimal 0.001000000000) (defconst aasw:time (time "2021-12-12T23:35:00Z")) (defconst aast:time (time "2021-12-12T23:59:00Z")) (defconst aasD:time (time "2021-12-12T23:59:00Z")) (defconst aasz:decimal 0.100000000000) (defconst aasE:integer 86400) (defun aarD:guard () (create-module-guard "qqqqq")) (defcap aasf () @event true) (defun aarr () (emit-event (aasf)) (free.ghi-v3.create-account aasC (aarD)) (coin.create-account aasC (aarD)) ) (defcap aase (account:string tokens-for-sale:decimal) @event true) (defun aarq (account:string amount:decimal) (let ( (aaaaa (aarO)) ) (enforce (< (aarz) aasw) "aatk") (enforce (> amount 0.0) "aatj") (enforce (<= (+ aaaaa amount) aasy) "aati") (with-capability (aase account amount) (free.ghi-v3.transfer account aasC amount) (insert xxxxx (aars account amount) { 'created: (aarz) , 'kind: "gggg" , 'account: account , 'amount: amount }) ) ) ) (defcap aasg (account:string amount:decimal) @event true) (defun aaru (account:string amount:decimal) (emit-event (aasg account amount)) (let ( (aaaa (aary)) (bbbb (aasb account)) (cccc (aarQ)) ) (enforce aaaa "aath") (enforce (> amount 0.0) "aatj") (enforce (aart) "aatf") (enforce (<= (+ cccc amount) aasu) "aate" ) (enforce (>= (+ bbbb amount) aasB) "aatd" ) (enforce (<= (+ bbbb amount) aasA) "aatc" ) (coin.transfer account aasC amount) (insert xxxxx (aars account amount) { 'created: (aarz) , 'kind: "ffff" , 'account: account , 'amount: amount }) ) ) (defcap aask (from:string to:string amount:decimal) @event (aarM from amount)) (defun aarM:bool (account:string amount:decimal) (let ( (aaaa (aasc)) (bbbb (aasa account)) ) (enforce (aarx) "aatb") (enforce aaaa "aata") (enforce (>= (aarz) aasD) "aasZ") (enforce (> bbbb 0.0) "aasY") (enforce (> amount 0.0) "aatj") (enforce (<= amount bbbb) "aasW") ) ) (defun aarE:string (from:string to:string amount:decimal) (with-capability (aask from to amount) (let ( (aaaa (aasa from)) (to-g (at 'guard (coin.details from))) ) (enforce-guard to-g) (install-capability (free.ghi-v3.TRANSFER aasC to amount)) (free.ghi-v3.transfer-create aasC to to-g amount) (insert xxxxx (aars from amount) { 'created: (aarz) , 'kind: "aaaa" , 'account: from , 'amount: amount }) ) ) ) (defcap aasj (from:string to:string to-g:guard amount:decimal) @event (aarK amount)) (defun aarK:bool (amount:decimal) (let ( (aaaa (aarQ)) (bbbb (aasc)) (cccc (aarX)) (dddd (aarN)) ) (enforce (aarx) "aatb") (enforce bbbb "aata") (enforce (> aaaa 0.0) "aasY") (enforce (> cccc 0.0) "aasS") (enforce (> amount 0.0) "aatj") (enforce (<= amount cccc) "aasW") ) ) (defun aarC:string (to-account:string amount:decimal) (let ( (guard (at 'guard (free.ghi-v3.details aasq))) ) (enforce-guard guard) (with-capability (aasj aasq to-account guard amount) (let ((aarp-payout (* (aarX) (- 1.0 aaso)))) (install-capability (coin.TRANSFER aasC to-account amount)) (coin.transfer-create aasC to-account guard amount) (insert xxxxx (aars aasq amount) { 'created: (aarz) , 'kind: "bbbb" , 'account: aasq , 'amount: amount }) ) ) ) ) (defcap aasi (account:string) @event true) (defun aarA:string () (let* ( (aaaa (aarQ)) (bbbb (aasc)) (dddd (* aaaa aaso)) (cccc (aarH)) ) (enforce (aarx) "aatb") (enforce bbbb "aata") (enforce (not cccc) "aasN") (enforce (> aaaa 0.0) "aasY") (with-capability (aasi aasx) (install-capability (coin.TRANSFER aasC aasx dddd)) (coin.transfer aasC aasx dddd) (insert xxxxx (aars aasx dddd) { 'created: (aarz) , 'kind: "cccc" , 'account: aasx , 'amount: dddd }) ) ) ) (defcap aasm (account:string) @event (aarW)) (defun aarW:bool () (let ( (aaaa (aarZ)) (bbbb (aarL)) ) (enforce (aarx) "aatb") (enforce (not aaaa) "aasK") (enforce (> bbbb 0.0) "aasJ") ) ) (defun aarG:string () (let ( (guard (at 'guard (free.ghi-v3.details aasq))) ) (enforce-guard guard) (with-capability (aasm aasq) (let ( (aaaa (aarL)) ) (install-capability (free.ghi-v3.TRANSFER aasC aasq aaaa)) (free.ghi-v3.transfer-create aasC aasq guard aaaa) (insert xxxxx (aars aasq aaaa) { 'created: (aarz) , 'kind: "dddd" , 'account: aasq , 'amount: aaaa }) ) ) ) ) (defcap aasl (account:string) @event (aarS account)) (defun aarS:bool (account:string) (let ( (cccc (aasc)) (bbbb (aarT account)) (aaaa (aasb account)) ) (enforce (aarx) "aatb") (enforce (not cccc) "aasH") (enforce (not bbbb) "aasK") (enforce (> aaaa 0.0) "aasF") ) ) (defun aarF:string (account:string) (with-capability (aasl account) (let ( (amount (aasb account)) ) (install-capability (coin.TRANSFER aasC account amount)) (coin.transfer aasC account amount) (insert xxxxx (aars account amount) { 'created: (aarz) , 'kind: "eeee" , 'account: account , 'amount: amount }) ) ) ) (defcap aasn () @event true) (defun aarR:string () (with-capability (aasn) (map (aarF) (aarI)) ) ) (defun aarJ:[object{ppppp-schema}] () (select xxxxx (constantly true)) ) (defun aarQ () (fold (+) 0.0 (map (at 'amount) (select xxxxx (where 'kind (= "ffff"))))) ) (defun aasb:decimal (account:string) (fold (+) 0.0 (map (at 'amount) (filter (where 'kind (= "ffff")) (select xxxxx (where 'account (= account)))) )) ) (defun aarP:decimal () (fold (+) 0.0 (map (at 'amount) (select xxxxx (where 'kind (= "bbbb"))))) ) (defun aarV:decimal () (fold (+) 0.0 (map (at 'amount) (select xxxxx (where 'kind (= "aaaa"))))) ) (defun aasd:decimal (account:string) (fold (+) 0.0 (map (at 'amount) (filter (where 'kind (= "aaaa")) (select xxxxx (where 'account (= account)))) )) ) (defun aarO:decimal () (fold (+) 0.0 (map (at 'amount) (select xxxxx (where 'kind (= "gggg"))))) ) (defun aarI:[string] () (distinct (map (at 'account) (select xxxxx (where 'kind (= "ffff")))) ) ) (defun aarH:bool () (< 0 (length (select xxxxx (where 'kind (= "cccc"))))) ) (defun aarU:bool (account:string) (< 0 (length (filter (where 'kind (= "aaaa")) (select xxxxx (where 'account (= account)))))) ) (defun aarN:bool () (< 0 (length (select xxxxx (where 'kind (= "bbbb"))))) ) (defun aarZ:bool () (< 0 (length (select xxxxx (where 'kind (= "dddd"))))) ) (defun aarT:bool (account:string) (< 0 (length (filter (where 'kind (= "eeee")) (select xxxxx (where 'account (= account)))))) ) (defun aarY:decimal () (fold (+) 0.0 (map (at 'amount) (select xxxxx (where 'kind (= "eeee"))))) ) (defun aarX:decimal () (- (aarQ) (aarP)) ) (defun aary:bool () (= (aarO) aasy) ) (defun aasc:bool () (>= (aarQ) aasv)) (defun aarB:bool () (>= (aarz) aasw)) (defun aarx:bool () (>= (aarz) aast)) (defun aart:bool () (and (aarB) (not (aarx)))) (defun aarL:decimal () (if (aasc) (- aasy (* (aarw) (aarQ))) aasy ) ) (defun aasa:decimal (account:string) (let* ( (gggg (aasd account)) (ffff (aasb account)) (eeee (* ffff (aarw))) (dddd (diff-time (aarz) aasD)) (cccc (floor (+ 1 (/ dddd aasE)))) (bbbb (aarp 0.0 (aaro 1.0 (* cccc aasz)))) (aaa (* eeee bbbb)) ) (- aaa gggg) ) ) (defun aarw:decimal () (/ aasy aasu) ) (defun aarz:time () (at 'block-time (chain-data))) (defun aarp:decimal (a:decimal b:decimal) (if (>= a b) a b) ) (defun aaro:decimal (a:decimal b:decimal) (if (<= a b) a b) ) (defun aars:string (account:string amount:decimal) (let ((h (hash { 'account: account, 'amount: amount, 'salt: (aarz) }))) (format "{}-{}" [account h]) ) ) (defun aarv:object () { "a1": aasp , "a2": aass , "a3": aasr , "a4": aasC , "a5": aaso , "b1": aasq , "b2": aasy , "b3": aasv , "b4": aasu , "b5": aasB , "b6": aasA , "b7": aasw , "b8": aast , "b9": aasD , "b10": aasz , "b11": aasE , "c1": (aarQ) , "c2": (aarP) , "c3": (aarV) , "c4": (aarO) , "c5": (length (aarI)) , "c6": (aarH) , "c7": (aarN) , "c8": (aarZ) , "c9": (aarY) , "c10": (aary) , "c11": (aasc) , "c12": (aarB) , "c13": (aarx) , "c14": (aart) , "c15": (aarL) , "c16": (aarw) , "c17": (* (aarw) (aarQ)) } ) ) | |
1 (module backalley-dev-f764a60b-5bc0-4924-922d-20ea48885c3d aasl (defschema xxxxx-schema created:time kind:string account:string amount:decimal) (deftable xxxxx:{xxxxx-schema}) (defcap aasl () (enforce false "aatl")) (defconst aast:string "Fixed") (defconst aasw:string "0.0.1") (defconst aasv:string "f764a60b-5bc0-4924-922d-20ea48885c3d") (defconst aasG:string "ba-b-f764a60b-5bc0-4924-922d-20ea48885c3d") (defconst aasB:string "ba-f") (defconst aass:decimal 0.0) (defconst aasu:string "k:2ad0abae3e25f1d73b68599cb003c6f3873f8c46bdd641be51bf32eafe4abffc") (defconst aasC:decimal 0.240000000000) (defconst aasz:decimal 0.000100000000) (defconst aasy:decimal 0.001000000000) (defconst aasF:decimal 0.000000010000) (defconst aasE:decimal 0.001000000000) (defconst aasA:time (time "2021-12-12T19:00:00Z")) (defconst aasx:time (time "2021-12-13T19:00:00Z")) (defconst aasH:time (time "2021-12-13T19:00:01Z")) (defconst aasD:decimal 0.020000000000) (defconst aasI:integer 86400) (defun aarI:guard () (create-module-guard "ppppp")) (defcap aasj () @event true) (defun aarw () (emit-event (aasj)) (free.ghi-v3.create-account aasG (aarI)) (coin.create-account aasG (aarI)) ) (defcap aasi (account:string tokens-for-sale:decimal) @event true) (defun aarv (account:string amount:decimal) (let ( (aarvs (aarU)) ) (enforce (< (aarE) aasA) "aatk") (enforce (> amount 0.0) "aatj") (enforce (<= (+ aarvs amount) aasC) "aati") (with-capability (aasi account amount) (free.ghi-v3.transfer account aasG amount) (insert xxxxx (aarx account amount) { 'created: (aarE) , 'kind: "gggg" , 'account: account , 'amount: amount }) ) ) ) (defcap aask (account:string amount:decimal) @event true) (defun aarz (account:string amount:decimal) (emit-event (aask account amount)) (let ( (aaaa (aarD)) (bbbb (aasf account)) (cccc (aarW)) ) (enforce aaaa "aath") (enforce (> amount 0.0) "aatj") (enforce (aary) "aatf") (enforce (<= (+ cccc amount) aasy) "aate" ) (enforce (>= (+ bbbb amount) aasF) "aatd" ) (enforce (<= (+ bbbb amount) aasE) "aatc" ) (coin.transfer account aasG amount) (insert xxxxx (aarx account amount) { 'created: (aarE) , 'kind: "ffff" , 'account: account , 'amount: amount }) ) ) (defcap aaso (from-account:string to-account:string to-g:guard) @event (aarS from-account)) (defun aarS:bool (account:string) (let ( (aaaa (aasg)) (bbbb (aarQ account)) ) (enforce (aarC) "aatb") (enforce aaaa "aata") (enforce (>= (aarE) aasH) "aasZ") (enforce (> bbbb 0.0) "aasY") ) ) (defun aarJ:string (from-account:string to-account:string to-g:guard) (enforce-guard (at 'guard (coin.details from-account))) (with-capability (aaso from-account to-account to-g) (let ( (aaaa (aarQ from-account)) ) (install-capability (free.ghi-v3.TRANSFER aasG to-account aaaa)) (free.ghi-v3.transfer-create aasG to-account to-g aaaa) (insert xxxxx (aarx from-account aaaa) { 'created: (aarE) , 'kind: "aaaa" , 'account: from-account , 'amount: aaaa }) ) ) ) (defcap aasn (from-account:string to-account:string to-g:guard) @event (aarP)) (defun aarP:bool () (let ( (aaaa (aarW)) (bbbb (aasg)) (cccc (aarT)) ) (enforce (aarC) "aatb") (enforce bbbb "aata") (enforce (not cccc) "aasV") (enforce (> aaaa 0.0) "aasY") ) ) (defun aarH:string (to-account:string to-g:guard) (let ( (guard (at 'guard (free.ghi-v3.details aasu))) ) (enforce-guard guard) (with-capability (aasn aasu to-account to-g) (let ( (aaaa (* (aarW) (- 1.0 aass))) ) (install-capability (coin.TRANSFER aasG to-account aaaa)) (coin.transfer-create aasG to-account to-g aaaa) (insert xxxxx (aarx aasu aaaa) { 'created: (aarE) , 'kind: "bbbb" , 'account: aasu , 'amount: aaaa }) ) ) ) ) (defcap aasm (account:string) @event true) (defun aarF:string () (let* ( (aaaa (aarW)) (bbbb (aasg)) (cccc (* aaaa aass)) (dddd (aarM)) ) (enforce (aarC) "aatb") (enforce bbbb "aata") (enforce (not dddd) "aasV") (enforce (> aaaa 0.0) "aasY") (with-capability (aasm aasB) (install-capability (coin.TRANSFER aasG aasB cccc)) (coin.transfer aasG aasB cccc) (insert xxxxx (aarx aasB cccc) { 'created: (aarE) , 'kind: "cccc" , 'account: aasB , 'amount: cccc }) ) ) ) (defcap aasq (account:string) @event (aasc)) (defun aasc:bool () (let ( (aaaa (aase)) (bbbb (aarR)) ) (enforce (aarC) "aatb") (enforce (not aaaa) "aasO") (enforce (> bbbb 0.0) "aasN") ) ) (defun aarL:string () (let ( (guard (at 'guard (free.ghi-v3.details aasu))) ) (enforce-guard guard) (with-capability (aasq aasu) (let ( (aaaa (aarR)) ) (install-capability (free.ghi-v3.TRANSFER aasG aasu aaaa)) (free.ghi-v3.transfer-create aasG aasu guard aaaa) (insert xxxxx (aarx aasu aaaa) { 'created: (aarE) , 'kind: "dddd" , 'account: aasu , 'amount: aaaa }) ) ) ) ) (defcap aasp (account:string) @event (aarY account)) (defun aarY:bool (account:string) (let ( (aaaa (aasg)) (bbbb (aarZ account)) (cccc (aasf account)) ) (enforce (aarC) "aatb") (enforce (not aaaa) "aasL") (enforce (not bbbb) "aasO") (enforce (> cccc 0.0) "aasJ") ) ) (defun aarK:string (account:string) (with-capability (aasp account) (let ( (amount (aasf account)) ) (install-capability (coin.TRANSFER aasG account amount)) (coin.transfer aasG account amount) (insert xxxxx (aarx account amount) { 'created: (aarE) , 'kind: "eeee" , 'account: account , 'amount: amount }) ) ) ) (defcap aasr () @event true) (defun aarX:string () (with-capability (aasr) (map (aarK) (aarN)) ) ) (defun aarO:[object{xxxxx-schema}] () (select xxxxx (constantly true)) ) (defun aarW () (fold (+) 0.0 (map (at 'amount) (select xxxxx (where 'kind (= "ffff"))))) ) (defun aasf:decimal (account:string) (fold (+) 0.0 (map (at 'amount) (filter (where 'kind (= "ffff")) (select xxxxx (where 'account (= account)))) )) ) (defun aarV:decimal () (fold (+) 0.0 (map (at 'amount) (select xxxxx (where 'kind (= "bbbb"))))) ) (defun aasb:decimal () (fold (+) 0.0 (map (at 'amount) (select xxxxx (where 'kind (= "aaaa"))))) ) (defun aash:decimal (account:string) (fold (+) 0.0 (map (at 'amount) (filter (where 'kind (= "aaaa")) (select xxxxx (where 'account (= account)))) )) ) (defun aarU:decimal () (fold (+) 0.0 (map (at 'amount) (select xxxxx (where 'kind (= "gggg"))))) ) (defun aarN:[string] () (distinct (map (at 'account) (select xxxxx (where 'kind (= "ffff")))) ) ) (defun aarM:bool () (< 0 (length (select xxxxx (where 'kind (= "cccc"))))) ) (defun aasa:bool (account:string) (< 0 (length (filter (where 'kind (= "aaaa")) (select xxxxx (where 'account (= account)))))) ) (defun aarT:bool () (< 0 (length (select xxxxx (where 'kind (= "bbbb"))))) ) (defun aase:bool () (< 0 (length (select xxxxx (where 'kind (= "dddd"))))) ) (defun aarZ:bool (account:string) (< 0 (length (filter (where 'kind (= "eeee")) (select xxxxx (where 'account (= account)))))) ) (defun aasd:decimal () (fold (+) 0.0 (map (at 'amount) (select xxxxx (where 'kind (= "eeee"))))) ) (defun aarD:bool () (= (aarU) aasC) ) (defun aasg:bool () (>= (aarW) aasz)) (defun aarG:bool () (>= (aarE) aasA)) (defun aarC:bool () (>= (aarE) aasx)) (defun aary:bool () (and (aarG) (not (aarC)))) (defun aarR:decimal () (if (aasg) (- aasC (* (aarB) (aarW))) aasC ) ) (defun aarQ:decimal (account:string) (let* ( (aaaa (aash account)) (bbbb (aasf account)) (cccc (* bbbb (aarB))) (dddd (diff-time (aarE) aasH)) (ffff (floor (+ 1 (/ dddd aasI)))) (gggg (aaru 0.0 (aart 1.0 (* ffff aasD)))) (hhhh (* cccc gggg)) ) (- hhhh aaaa) ) ) (defun aarB:decimal () (/ aasC aasy) ) (defun aarE:time () (at 'block-time (chain-data))) (defun aaru:decimal (a:decimal b:decimal) (if (>= a b) a b) ) (defun aart:decimal (a:decimal b:decimal) (if (<= a b) a b) ) (defun aarx:string (account:string amount:decimal) (let ((h (hash { 'account: account, 'amount: amount, 'salt: (aarE) }))) (format "{}-{}" [account h]) ) ) (defun aarA:object () { "a1": aast , "a2": aasw , "a3": aasv , "a4": aasG , "a5": aass , "b1": aasu , "b2": aasC , "b3": aasz , "b4": aasy , "b5": aasF , "b6": aasE , "b7": aasA , "b8": aasx , "b9": aasH , "b10": aasD , "b11": aasI , "c1": (aarW) , "c2": (aarV) , "c3": (aasb) , "c4": (aarU) , "c5": (length (aarN)) , "c6": (aarM) , "c7": (aarT) , "c8": (aase) , "c9": (aasd) , "c10": (aarD) , "c11": (aasg) , "c12": (aarG) , "c13": (aarC) , "c14": (aary) , "c15": (aarR) , "c16": (aarB) , "c17": (* (aarB) (aarW)) } ) ) | |
1 (module staking GOVERNANCE (defschema stakes account:string stakeAmount:decimal stakeDate:time rewardedAt:time ) (defschema locks account:string lockedAmount:decimal lockedDate:time unlockDate:time ) (defschema rewards account:string rewardAmount:decimal updatedAt:time ) (defschema staking-stats totalStaked:decimal totalRewarded:decimal ) (defschema staking-halted halted:bool ) (defschema stake-info account :string stakeAmount :decimal rewardedAt :time ) (deftable stakes-table:{stakes}) (deftable locks-table:{locks}) (deftable rewards-table:{rewards}) (deftable staking-stats-table:{staking-stats}) (deftable staking-halted-table:{staking-halted}) (defconst MAXIMUM_APR:decimal 22.315 "Maximum apr that will be received for staking") (defconst WITHDRAW_FEE:decimal 0.005 "Fee applicable when withdrawing a stake") (defconst REWARD_CALCULATION_INTERVAL:decimal 1.0 "Interval for assinging rewards") (defconst STAKING_VAULT_ACCOUNT "kdlaunch-staking-vault" "Account holding staked KDL") (defconst REWARDS_VAULT_ACCOUNT "kdlaunch-rewards-vault" "Account holding KDL rewards") (defun staking-vault-guard:guard () (create-module-guard "staking-vault-guard")) (defun rewards-vault-guard:guard () (create-module-guard "rewards-vault-guard")) (defun curr-time:time () @doc "Returns current chain's block-time in time type" (at 'block-time (chain-data))) (defcap GOVERNANCE () @doc " Give the admin full access to call and upgrade the module. " (enforce-keyset 'kdlaunch-admin) ) (defcap ACCT_GUARD (account) (enforce-guard (at 'guard (kdlaunch.token.details account))) ) (defcap STAKING_OPEN:bool () (with-read staking-halted-table "" { "halted":= stakingHalted } (enforce (= stakingHalted false) "UNABLE TO STAKE, STAKING IS CURRENTLY HALTED") ) ) (defcap STAKE () true) (defcap UNSTAKE () true) (defcap REWARDED () true) (defcap PROCESSREWARDS () true) (defun initialize () @doc " Initialize the staking contract " (with-capability (GOVERNANCE) (kdlaunch.token.create-account REWARDS_VAULT_ACCOUNT (rewards-vault-guard)) (kdlaunch.token.create-account STAKING_VAULT_ACCOUNT (staking-vault-guard)) (insert staking-halted-table "" { "halted": true } ) (insert staking-stats-table "" { "totalStaked" : 0.0, "totalRewarded" : 0.0 }) ) ) (defun deposit-tokens (from amount) (with-capability (GOVERNANCE) (kdlaunch.token.transfer-create from REWARDS_VAULT_ACCOUNT (rewards-vault-guard) amount) ) ) (defun withdraw-tokens (to amount guard) (with-capability (GOVERNANCE) (install-capability (kdlaunch.token.TRANSFER REWARDS_VAULT_ACCOUNT to amount)) (kdlaunch.token.transfer-create REWARDS_VAULT_ACCOUNT to guard amount) ) ) (defun set-staking-halted (halted) "Disable or enable the ability to stake" (with-capability (GOVERNANCE) (write staking-halted-table "" { "halted": halted }) ) ) (defun raise-stake (raiseAmount) "Increase the total amount staked in the contract" (require-capability (STAKE)) (with-read staking-stats-table "" { "totalStaked":= totalStaked } (update staking-stats-table "" { "totalStaked": (+ totalStaked raiseAmount) })) ) (defun reduce-stake (reduceAmount) "Decrease the total amount staked in the contract" (require-capability (UNSTAKE)) (with-read staking-stats-table "" { "totalStaked":= totalStaked } (update staking-stats-table "" { "totalStaked": (- totalStaked reduceAmount) })) ) (defun withdraw-fee:decimal (stakeAmount) "Calculates the fee that is applied when withdrawing a stake" (* WITHDRAW_FEE stakeAmount) ) (defun stake-amount (account amount) (with-capability (ACCT_GUARD account) (with-capability (STAKING_OPEN) (with-capability (STAKE) (enforce (> amount 0.0) "Stake amount must be positive.") (with-default-read stakes-table account { "stakeAmount" : 0.0 } { "stakeAmount" := stakeAmount } (kdlaunch.token.transfer-create account STAKING_VAULT_ACCOUNT (staking-vault-guard) amount) (write stakes-table account { "account" : account, "stakeAmount" : (+ stakeAmount amount), "stakeDate" : (curr-time), "rewardedAt" : (curr-time) }) (raise-stake amount) )))) ) (defun unstake-amount (account amount) (with-capability (ACCT_GUARD account) (with-capability (UNSTAKE) (enforce (> amount 0.0) "Unstake amount must be positive.") (with-read stakes-table account { "stakeAmount" := stakeAmount } (let* ( (lockedAmount (at 'lockedAmount (get-locked-stake account))) (withdrawFee (withdraw-fee amount)) (amountWithoutFee (- amount withdrawFee)) ) (enforce (>= stakeAmount amount) "Cannot unstake more than is staked") (enforce (>= (- stakeAmount lockedAmount) amount) "Insufficient free stake to unstake") (install-capability (kdlaunch.token.TRANSFER STAKING_VAULT_ACCOUNT account amountWithoutFee)) (kdlaunch.token.transfer STAKING_VAULT_ACCOUNT account amountWithoutFee) (install-capability (kdlaunch.token.TRANSFER STAKING_VAULT_ACCOUNT REWARDS_VAULT_ACCOUNT withdrawFee)) (kdlaunch.token.transfer-create STAKING_VAULT_ACCOUNT REWARDS_VAULT_ACCOUNT (rewards-vault-guard) withdrawFee) (update stakes-table account { "account" : account, "stakeAmount" : (- stakeAmount amount), "stakeDate" : (curr-time), "rewardedAt" : (curr-time) }) (reduce-stake amount) )))) ) (defun get-staking-stats () (with-read staking-stats-table "" { "totalStaked":= totalStaked, "totalRewarded":= totalRewarded } { "totalStaked": totalStaked, "totalRewarded": totalRewarded } ) ) (defun raise-rewarded (rewardAmount) "Increase the total rewards amount in the contract" (require-capability (REWARDED)) (with-read staking-stats-table "" { "totalRewarded":= totalRewarded } (update staking-stats-table "" { "totalRewarded": (+ totalRewarded rewardAmount) })) ) (defun claim-rewards (account) "claiming accumulated rewards" (with-capability (ACCT_GUARD account) (with-capability (REWARDED) (with-read rewards-table account { "rewardAmount":= rewardAmount } (enforce (> rewardAmount 0.0) "No rewards to claim") (update rewards-table account { "rewardAmount": 0.0, "updatedAt": (curr-time) }) (format "{}" [rewardAmount]) (install-capability (kdlaunch.token.TRANSFER REWARDS_VAULT_ACCOUNT account rewardAmount)) (kdlaunch.token.transfer REWARDS_VAULT_ACCOUNT account rewardAmount) (raise-rewarded rewardAmount) ))) ) (defun calculate-interest-rate () "calculate the Annual Percentage Rate (APR) based on vault amount" (let* ( (totalStaked (at 'totalStaked (read staking-stats-table "" ["totalStaked"]))) (rewardVaultBalance (kdlaunch.token.get-balance REWARDS_VAULT_ACCOUNT)) (apr (round (* 2 (* (/ rewardVaultBalance totalStaked) 100)) 2)) ) (if (> apr MAXIMUM_APR) MAXIMUM_APR apr) ) ) (defun calculate-interest-yield () "calculate the Annual Percentage Yield (APY) based on APR" (round (*(- (^ (+ 1 (/ (/ (calculate-interest-rate) 100) 8760)) 8760) 1) 100) 2) ) (defun process-reward (info:object{stake-info}) (require-capability (PROCESSREWARDS)) (let* ( (account (at 'account info)) (stakeAmount (at 'stakeAmount info)) (rewardedAt (at 'rewardedAt info)) (apr (calculate-interest-rate)) (stakePeriodHours (floor (/ (diff-time (curr-time) rewardedAt) 3600.0) 0)) (accumlatedInterestYearly (* (/ stakeAmount 100) apr)) (rewards (round (* (/ accumlatedInterestYearly 8760) stakePeriodHours) 12)) ) (with-default-read rewards-table account { "rewardAmount" : 0.0 } { "rewardAmount":= rewardAmount } (write rewards-table account { "account" : account, "rewardAmount" : (+ rewardAmount rewards), "updatedAt" : (curr-time) } ) (update stakes-table account { "rewardedAt": (curr-time) }))) ) (defun calculate-rewards () "calculate and store pending rewards, paid out once per 24 hours" (with-capability (PROCESSREWARDS) (let ((dayAgo (add-time (curr-time) (hours (- 0 REWARD_CALCULATION_INTERVAL))))) (map (process-reward) (select stakes-table ['account 'stakeAmount 'rewardedAt] (and? (where 'stakeAmount (< 0.0)) (where 'rewardedAt (> dayAgo))))) )) ) (defun get-locked-stake (account) "get the locked-stake amount for the account" (with-default-read locks-table account { "lockedAmount" : 0.0, "unlockDate": "" } { "lockedAmount":= lockedAmount, "unlockDate" := unlockDate } { "lockedAmount": lockedAmount, "unlockDate": unlockDate } ) ) (defun lock-stake (account amount period) "lock a staked amount for a certain period of time" (with-capability (ACCT_GUARD account) (with-read stakes-table account { "stakeAmount" := stakeAmount } (let ((lockedAmount (at 'lockedAmount (get-locked-stake account)))) (enforce (>= (- stakeAmount lockedAmount) amount) "Insufficient stake to lock") (with-default-read locks-table account { "lockedAmount" : 0.0 } { "lockedAmount":= lockedAmount } (write locks-table account { "account" : account, "lockedAmount" : (+ amount lockedAmount), "lockedDate" : (curr-time), "unlockDate" : (add-time (curr-time) (days period)) } ))))) ) (defun get-user-stats (account) (with-default-read stakes-table account { "stakeAmount" : 0.0 } { "stakeAmount" := stakeAmount } (with-default-read rewards-table account { "rewardAmount" : 0.0 } { "rewardAmount" := rewardAmount } (with-default-read locks-table account { "lockedAmount" : 0.0, "unlockDate": "" } { "lockedAmount" := lockedAmount, "unlockDate" := unlockDate } { "staked": stakeAmount, "rewards": rewardAmount, "locked": lockedAmount, "lockedUntill": unlockDate } ))) ) ) | |
1 (module staking GOVERNANCE (defschema stakes account:string stakeAmount:decimal stakeDate:time rewardedAt:time ) (defschema locks account:string lockedAmount:decimal lockedDate:time unlockDate:time ) (defschema rewards account:string rewardAmount:decimal updatedAt:time ) (defschema staking-stats totalStaked:decimal totalRewarded:decimal ) (defschema staking-halted halted:bool ) (defschema stake-info account :string stakeAmount :decimal rewardedAt :time ) (deftable stakes-table:{stakes}) (deftable locks-table:{locks}) (deftable rewards-table:{rewards}) (deftable staking-stats-table:{staking-stats}) (deftable staking-halted-table:{staking-halted}) (defconst MAXIMUM_APR:decimal 22.315 "Maximum apr that will be received for staking") (defconst WITHDRAW_FEE:decimal 0.005 "Fee applicable when withdrawing a stake") (defconst REWARD_CALCULATION_INTERVAL:decimal 24.0 "Interval for assigning rewards") (defconst STAKING_VAULT_ACCOUNT "kdlaunch-staking-vault" "Account holding staked KDL") (defconst REWARDS_VAULT_ACCOUNT "kdlaunch-rewards-vault" "Account holding KDL rewards") (defun staking-vault-guard:guard () (create-module-guard "staking-vault-guard")) (defun rewards-vault-guard:guard () (create-module-guard "rewards-vault-guard")) (defun curr-time:time () @doc "Returns current chain's block-time in time type" (at 'block-time (chain-data))) (defcap GOVERNANCE () @doc " Give the admin full access to call and upgrade the module. " (enforce-keyset 'kdlaunch-admin) ) (defcap ACCT_GUARD (account) (enforce-guard (at 'guard (kdlaunch.token.details account))) ) (defcap STAKING_OPEN:bool () (with-read staking-halted-table "" { "halted":= stakingHalted } (enforce (= stakingHalted false) "UNABLE TO STAKE, STAKING IS CURRENTLY HALTED") ) ) (defcap STAKE () true) (defcap UNSTAKE () true) (defcap REWARDED () true) (defcap PROCESSREWARDS () true) (defun initialize () @doc " Initialize the staking contract " (with-capability (GOVERNANCE) (kdlaunch.token.create-account REWARDS_VAULT_ACCOUNT (rewards-vault-guard)) (kdlaunch.token.create-account STAKING_VAULT_ACCOUNT (staking-vault-guard)) (insert staking-halted-table "" { "halted": true } ) (insert staking-stats-table "" { "totalStaked" : 0.0, "totalRewarded" : 0.0 }) ) ) (defun deposit-tokens (from amount) (with-capability (GOVERNANCE) (kdlaunch.token.transfer-create from REWARDS_VAULT_ACCOUNT (rewards-vault-guard) amount) ) ) (defun withdraw-tokens (to amount guard) (with-capability (GOVERNANCE) (install-capability (kdlaunch.token.TRANSFER REWARDS_VAULT_ACCOUNT to amount)) (kdlaunch.token.transfer-create REWARDS_VAULT_ACCOUNT to guard amount) ) ) (defun set-staking-halted (halted) "Disable or enable the ability to stake" (with-capability (GOVERNANCE) (write staking-halted-table "" { "halted": halted }) ) ) (defun raise-stake (raiseAmount) "Increase the total amount staked in the contract" (require-capability (STAKE)) (with-read staking-stats-table "" { "totalStaked":= totalStaked } (update staking-stats-table "" { "totalStaked": (+ totalStaked raiseAmount) })) ) (defun reduce-stake (reduceAmount) "Decrease the total amount staked in the contract" (require-capability (UNSTAKE)) (with-read staking-stats-table "" { "totalStaked":= totalStaked } (update staking-stats-table "" { "totalStaked": (- totalStaked reduceAmount) })) ) (defun withdraw-fee:decimal (stakeAmount) "Calculates the fee that is applied when withdrawing a stake" (* WITHDRAW_FEE stakeAmount) ) (defun stake-amount (account amount) (with-capability (ACCT_GUARD account) (with-capability (STAKING_OPEN) (with-capability (STAKE) (enforce (> amount 0.0) "Stake amount must be positive.") (with-default-read stakes-table account { "stakeAmount" : 0.0 } { "stakeAmount" := stakeAmount } (calculate-single-reward account) (kdlaunch.token.transfer-create account STAKING_VAULT_ACCOUNT (staking-vault-guard) amount) (write stakes-table account { "account" : account, "stakeAmount" : (+ stakeAmount amount), "stakeDate" : (curr-time), "rewardedAt" : (curr-time) }) (raise-stake amount) )))) ) (defun unstake-amount (account amount) (with-capability (ACCT_GUARD account) (with-capability (UNSTAKE) (enforce (> amount 0.0) "Unstake amount must be positive.") (with-read stakes-table account { "stakeAmount" := stakeAmount } (let* ( (lockedAmount (at 'lockedAmount (get-locked-stake account))) (withdrawFee (withdraw-fee amount)) (amountWithoutFee (- amount withdrawFee)) ) (enforce (>= stakeAmount amount) "Cannot unstake more than is staked") (enforce (>= (- stakeAmount lockedAmount) amount) "Insufficient free stake to unstake") (install-capability (kdlaunch.token.TRANSFER STAKING_VAULT_ACCOUNT account amountWithoutFee)) (kdlaunch.token.transfer STAKING_VAULT_ACCOUNT account amountWithoutFee) (install-capability (kdlaunch.token.TRANSFER STAKING_VAULT_ACCOUNT REWARDS_VAULT_ACCOUNT withdrawFee)) (kdlaunch.token.transfer-create STAKING_VAULT_ACCOUNT REWARDS_VAULT_ACCOUNT (rewards-vault-guard) withdrawFee) (calculate-single-reward account) (update stakes-table account { "account" : account, "stakeAmount" : (- stakeAmount amount), "stakeDate" : (curr-time), "rewardedAt" : (curr-time) }) (reduce-stake amount) )))) ) (defun get-staking-stats () (with-read staking-stats-table "" { "totalStaked":= totalStaked, "totalRewarded":= totalRewarded } { "totalStaked": totalStaked, "totalRewarded": totalRewarded } ) ) (defun raise-rewarded (rewardAmount) "Increase the total rewards amount in the contract" (require-capability (REWARDED)) (with-read staking-stats-table "" { "totalRewarded":= totalRewarded } (update staking-stats-table "" { "totalRewarded": (+ totalRewarded rewardAmount) })) ) (defun claim-rewards (account) "claiming accumulated rewards" (with-capability (ACCT_GUARD account) (with-capability (REWARDED) (with-read rewards-table account { "rewardAmount":= rewardAmount } (enforce (> rewardAmount 0.0) "No rewards to claim") (update rewards-table account { "rewardAmount": 0.0, "updatedAt": (curr-time) }) (install-capability (kdlaunch.token.TRANSFER REWARDS_VAULT_ACCOUNT account rewardAmount)) (kdlaunch.token.transfer REWARDS_VAULT_ACCOUNT account rewardAmount) (raise-rewarded rewardAmount) ))) ) (defun calculate-interest-rate () "calculate the Annual Percentage Rate (APR) based on vault amount" (let* ( (totalStaked (at 'totalStaked (read staking-stats-table "" ["totalStaked"]))) (rewardVaultBalance (kdlaunch.token.get-balance REWARDS_VAULT_ACCOUNT)) (apr (round (* 2 (* (/ rewardVaultBalance totalStaked) 100)) 2)) ) (if (> apr MAXIMUM_APR) MAXIMUM_APR apr) ) ) (defun calculate-interest-yield () "calculate the Annual Percentage Yield (APY) based on APR" (round (*(- (^ (+ 1 (/ (/ (calculate-interest-rate) 100) 365)) 365) 1) 100) 2) ) (defun process-reward (info:object{stake-info}) (require-capability (PROCESSREWARDS)) (let* ( (account (at 'account info)) (stakeAmount (at 'stakeAmount info)) (rewardedAt (at 'rewardedAt info)) (apr (calculate-interest-rate)) (stakePeriodHours (floor (/ (diff-time (curr-time) rewardedAt) 3600.0) 0)) (accumlatedInterestYearly (* (/ stakeAmount 100) apr)) (rewards (round (* (/ accumlatedInterestYearly 8760) stakePeriodHours) 12)) ) (with-default-read rewards-table account { "rewardAmount" : 0.0 } { "rewardAmount":= rewardAmount } (write rewards-table account { "account" : account, "rewardAmount" : (+ rewardAmount rewards), "updatedAt" : (curr-time) } ) (update stakes-table account { "rewardedAt": (curr-time) }))) ) (defun calculate-rewards () "calculate and store pending rewards, paid out once per 24 hours" (with-capability (PROCESSREWARDS) (let ((dayAgo (add-time (curr-time) (hours (- 0 REWARD_CALCULATION_INTERVAL))))) (let ( (processed (map (process-reward) (select stakes-table ['account 'stakeAmount 'rewardedAt] (and? (where 'stakeAmount (< 0.0)) (where 'rewardedAt (> dayAgo)))))) ) (format "Rewards Calculated: {}" [(length processed)]) ) )) ) (defun calculate-single-reward (account) "calculate and store pending rewards for a specific" (with-capability (PROCESSREWARDS) (map (process-reward) (select stakes-table ['account 'stakeAmount 'rewardedAt] (and? (where 'stakeAmount (< 0.0)) (where 'account (= account))))) (format "Rewards Calculated" []) ) ) (defun get-locked-stake (account) "get the locked-stake amount for the account" (with-default-read locks-table account { "lockedAmount" : 0.0, "unlockDate": "" } { "lockedAmount":= lockedAmount, "unlockDate" := unlockDate } { "lockedAmount": lockedAmount, "unlockDate": unlockDate } ) ) (defun lock-stake (account amount period) "lock a staked amount for a certain period of time" (with-capability (ACCT_GUARD account) (with-read stakes-table account { "stakeAmount" := stakeAmount } (let ((lockedAmount (at 'lockedAmount (get-locked-stake account)))) (enforce (>= (- stakeAmount lockedAmount) amount) "Insufficient stake to lock") (with-default-read locks-table account { "lockedAmount" : 0.0 } { "lockedAmount":= lockedAmount } (write locks-table account { "account" : account, "lockedAmount" : (+ amount lockedAmount), "lockedDate" : (curr-time), "unlockDate" : (add-time (curr-time) (days period)) } ))))) ) (defun get-user-stats (account) (with-default-read stakes-table account { "stakeAmount" : 0.0 } { "stakeAmount" := stakeAmount } (with-default-read rewards-table account { "rewardAmount" : 0.0 } { "rewardAmount" := rewardAmount } (with-default-read locks-table account { "lockedAmount" : 0.0, "unlockDate": "" } { "lockedAmount" := lockedAmount, "unlockDate" := unlockDate } { "staked": stakeAmount, "rewards": rewardAmount, "locked": lockedAmount, "lockedUntill": unlockDate } ))) ) ) | |
1 (module staking GOVERNANCE (defschema stakes account:string stakeAmount:decimal stakeDate:time rewardedAt:time ) (defschema locks account:string lockedAmount:decimal lockedDate:time unlockDate:time ) (defschema rewards account:string rewardAmount:decimal updatedAt:time ) (defschema staking-stats totalStaked:decimal totalRewarded:decimal ) (defschema staking-halted halted:bool ) (defschema stake-info account :string stakeAmount :decimal rewardedAt :time ) (deftable stakes-table:{stakes}) (deftable locks-table:{locks}) (deftable rewards-table:{rewards}) (deftable staking-stats-table:{staking-stats}) (deftable staking-halted-table:{staking-halted}) (defconst MAXIMUM_APR:decimal 22.315 "Maximum apr that will be received for staking") (defconst WITHDRAW_FEE:decimal 0.005 "Fee applicable when withdrawing a stake") (defconst REWARD_CALCULATION_INTERVAL:decimal 24.0 "Interval for assigning rewards") (defconst STAKING_VAULT_ACCOUNT "kdlaunch-staking-vault" "Account holding staked KDL") (defconst REWARDS_VAULT_ACCOUNT "kdlaunch-rewards-vault" "Account holding KDL rewards") (defun staking-vault-guard:guard () (create-module-guard "staking-vault-guard")) (defun rewards-vault-guard:guard () (create-module-guard "rewards-vault-guard")) (defun curr-time:time () @doc "Returns current chain's block-time in time type" (at 'block-time (chain-data))) (defcap GOVERNANCE () @doc " Give the admin full access to call and upgrade the module. " (enforce-keyset 'kdlaunch-admin) ) (defcap ACCT_GUARD (account) (enforce-guard (at 'guard (kdlaunch.token.details account))) ) (defcap STAKING_OPEN:bool () (with-read staking-halted-table "" { "halted":= stakingHalted } (enforce (= stakingHalted false) "UNABLE TO STAKE, STAKING IS CURRENTLY HALTED") ) ) (defcap STAKE () true) (defcap UNSTAKE () true) (defcap REWARDED () true) (defcap PROCESSREWARDS () true) (defun initialize () @doc " Initialize the staking contract " (with-capability (GOVERNANCE) (kdlaunch.token.create-account REWARDS_VAULT_ACCOUNT (rewards-vault-guard)) (kdlaunch.token.create-account STAKING_VAULT_ACCOUNT (staking-vault-guard)) (insert staking-halted-table "" { "halted": true } ) (insert staking-stats-table "" { "totalStaked" : 0.0, "totalRewarded" : 0.0 }) ) ) (defun deposit-tokens (from amount) (with-capability (GOVERNANCE) (kdlaunch.token.transfer-create from REWARDS_VAULT_ACCOUNT (rewards-vault-guard) amount) ) ) (defun withdraw-tokens (to amount guard) (with-capability (GOVERNANCE) (install-capability (kdlaunch.token.TRANSFER REWARDS_VAULT_ACCOUNT to amount)) (kdlaunch.token.transfer-create REWARDS_VAULT_ACCOUNT to guard amount) ) ) (defun set-staking-halted (halted) "Disable or enable the ability to stake" (with-capability (GOVERNANCE) (write staking-halted-table "" { "halted": halted }) ) ) (defun raise-stake (raiseAmount) "Increase the total amount staked in the contract" (require-capability (STAKE)) (with-read staking-stats-table "" { "totalStaked":= totalStaked } (update staking-stats-table "" { "totalStaked": (+ totalStaked raiseAmount) })) ) (defun reduce-stake (reduceAmount) "Decrease the total amount staked in the contract" (require-capability (UNSTAKE)) (with-read staking-stats-table "" { "totalStaked":= totalStaked } (update staking-stats-table "" { "totalStaked": (- totalStaked reduceAmount) })) ) (defun withdraw-fee:decimal (stakeAmount) "Calculates the fee that is applied when withdrawing a stake" (* WITHDRAW_FEE stakeAmount) ) (defun stake-amount (account amount) (with-capability (ACCT_GUARD account) (with-capability (STAKING_OPEN) (with-capability (STAKE) (enforce (> amount 0.0) "Stake amount must be positive.") (with-default-read stakes-table account { "stakeAmount" : 0.0 } { "stakeAmount" := stakeAmount } (calculate-single-reward account) (kdlaunch.token.transfer-create account STAKING_VAULT_ACCOUNT (staking-vault-guard) amount) (write stakes-table account { "account" : account, "stakeAmount" : (+ stakeAmount amount), "stakeDate" : (curr-time), "rewardedAt" : (curr-time) }) (raise-stake amount) )))) ) (defun unstake-amount (account amount) (with-capability (ACCT_GUARD account) (with-capability (UNSTAKE) (enforce (> amount 0.0) "Unstake amount must be positive.") (with-read stakes-table account { "stakeAmount" := stakeAmount } (let* ( (lockedAmount (at 'lockedAmount (get-locked-stake account))) (withdrawFee (withdraw-fee amount)) (amountWithoutFee (- amount withdrawFee)) ) (enforce (>= stakeAmount amount) "Cannot unstake more than is staked") (enforce (>= (- stakeAmount lockedAmount) amount) "Insufficient free stake to unstake") (install-capability (kdlaunch.token.TRANSFER STAKING_VAULT_ACCOUNT account amountWithoutFee)) (kdlaunch.token.transfer STAKING_VAULT_ACCOUNT account amountWithoutFee) (install-capability (kdlaunch.token.TRANSFER STAKING_VAULT_ACCOUNT REWARDS_VAULT_ACCOUNT withdrawFee)) (kdlaunch.token.transfer-create STAKING_VAULT_ACCOUNT REWARDS_VAULT_ACCOUNT (rewards-vault-guard) withdrawFee) (calculate-single-reward account) (update stakes-table account { "account" : account, "stakeAmount" : (- stakeAmount amount), "stakeDate" : (curr-time), "rewardedAt" : (curr-time) }) (reduce-stake amount) )))) ) (defun get-staking-stats () (with-read staking-stats-table "" { "totalStaked":= totalStaked, "totalRewarded":= totalRewarded } { "totalStaked": totalStaked, "totalRewarded": totalRewarded } ) ) (defun raise-rewarded (rewardAmount) "Increase the total rewards amount in the contract" (require-capability (REWARDED)) (with-read staking-stats-table "" { "totalRewarded":= totalRewarded } (update staking-stats-table "" { "totalRewarded": (+ totalRewarded rewardAmount) })) ) (defun claim-rewards (account) "claiming accumulated rewards" (with-capability (ACCT_GUARD account) (with-capability (REWARDED) (with-read rewards-table account { "rewardAmount":= rewardAmount } (enforce (> rewardAmount 0.0) "No rewards to claim") (update rewards-table account { "rewardAmount": 0.0, "updatedAt": (curr-time) }) (install-capability (kdlaunch.token.TRANSFER REWARDS_VAULT_ACCOUNT account rewardAmount)) (kdlaunch.token.transfer REWARDS_VAULT_ACCOUNT account rewardAmount) (raise-rewarded rewardAmount) ))) ) (defun calculate-interest-rate () "calculate the Annual Percentage Rate (APR) based on vault amount" (let* ( (totalStaked (at 'totalStaked (read staking-stats-table "" ["totalStaked"]))) (rewardVaultBalance (kdlaunch.token.get-balance REWARDS_VAULT_ACCOUNT)) (apr (round (* 2 (* (/ rewardVaultBalance totalStaked) 100)) 2)) ) (if (> apr MAXIMUM_APR) MAXIMUM_APR apr) ) ) (defun calculate-interest-yield () "calculate the Annual Percentage Yield (APY) based on APR" (round (*(- (^ (+ 1 (/ (/ (calculate-interest-rate) 100) 365)) 365) 1) 100) 2) ) (defun process-reward (info:object{stake-info}) (require-capability (PROCESSREWARDS)) (let* ( (account (at 'account info)) (stakeAmount (at 'stakeAmount info)) (rewardedAt (at 'rewardedAt info)) (apr (calculate-interest-rate)) (stakePeriodHours (floor (/ (diff-time (curr-time) rewardedAt) 3600.0) 0)) (accumlatedInterestYearly (* (/ stakeAmount 100) apr)) (rewards (round (* (/ accumlatedInterestYearly 8760) stakePeriodHours) 12)) ) (with-default-read rewards-table account { "rewardAmount" : 0.0 } { "rewardAmount":= rewardAmount } (write rewards-table account { "account" : account, "rewardAmount" : (+ rewardAmount rewards), "updatedAt" : (curr-time) } ) (update stakes-table account { "rewardedAt": (curr-time) }))) ) (defun calculate-rewards () "calculate and store pending rewards, paid out once per 24 hours" (with-capability (PROCESSREWARDS) (let ((dayAgo (add-time (curr-time) (hours (- 0 REWARD_CALCULATION_INTERVAL))))) (let ( (processed (map (process-reward) (select stakes-table ['account 'stakeAmount 'rewardedAt] (and? (where 'stakeAmount (< 0.0)) (where 'rewardedAt (> dayAgo)))))) ) (format "Rewards Calculated: {}" [(length processed)]) ) )) ) (defun calculate-single-reward (account) "calculate and store pending rewards for a specific" (with-capability (PROCESSREWARDS) (map (process-reward) (select stakes-table ['account 'stakeAmount 'rewardedAt] (and? (where 'stakeAmount (< 0.0)) (where 'account (= account))))) (format "Rewards Calculated" []) ) ) (defun get-locked-stake (account) "get the locked-stake amount for the account" (with-default-read locks-table account { "lockedAmount" : 0.0, "unlockDate": "" } { "lockedAmount":= lockedAmount, "unlockDate" := unlockDate } { "lockedAmount": lockedAmount, "unlockDate": unlockDate } ) ) (defun lock-stake (account amount period) "lock a staked amount for a certain period of time" (with-capability (ACCT_GUARD account) (with-read stakes-table account { "stakeAmount" := stakeAmount } (let ((lockedAmount (at 'lockedAmount (get-locked-stake account)))) (enforce (>= (- stakeAmount lockedAmount) amount) "Insufficient stake to lock") (with-default-read locks-table account { "lockedAmount" : 0.0 } { "lockedAmount":= lockedAmount } (write locks-table account { "account" : account, "lockedAmount" : (+ amount lockedAmount), "lockedDate" : (curr-time), "unlockDate" : (add-time (curr-time) (days period)) } ))))) ) (defun get-user-stats (account) (with-default-read stakes-table account { "stakeAmount" : 0.0, "rewardedAt" : "" } { "stakeAmount" := stakeAmount, "rewardedAt" := rewardedAt } (with-default-read rewards-table account { "rewardAmount" : 0.0 } { "rewardAmount" := rewardAmount } (with-default-read locks-table account { "lockedAmount" : 0.0, "unlockDate": "" } { "lockedAmount" := lockedAmount, "unlockDate" := unlockDate } { "staked": stakeAmount, "rewards": rewardAmount, "locked": lockedAmount, "lockedUntill": unlockDate, "rewardedAt": rewardedAt } ))) ) ) | |
2 (earned-kda-list (map (cap-get-kda-since-last-claim) nft-ids)) | |
2 (map (init-init) (enumerate index1 index2)) | |
2 (map (observe-compound-path) (at 'tracked-paths oracle)) | |
2 (map (populate-new-listing) items) | |
2 (map (populate-new-upgrade) (enumerate start (+ 500 start))) | |
2 (map (set-warranty) (enumerate begin end)) | |
2 (all-objs:list (map (get-nfts-details) (all-nfts))) | |
2 (map (fix-redeem) accounts) | |
2 (token-prices (map (get-price-helper) token-path-chunks)) ;; list of all the token prices in the swap path | |
2 (map (add-path) all-pairs) ;; add the path to each pairs' tracked-paths list | |
2 (map (get-miner-details-with-object) (+ (select listings ['nft-id] (and? (where "previous-owner" (= account)) (where "price" (> 0.0)))) (kmc-policy.get-tokens-owned account)) ) | |
2 (map (get-vial-details-with-object) (kmc-test3-policy.get-all-for-sale)) | |
2 (map (pay) (calc-rewards begin_date end_date)) | |
2 (map (pay) results) | |
2 (map (unlock-entry) keys_to_unlock) | |
2 (map (unlock-entry) valid_entries_to_unlock) | |
2 (observation-keys (map (get-observation-key) (at 'tracked-paths oracle))) | |
2 { "airdrop": (map (combine-claims) (get-airdrop-details-select account)) } | |
2 (fold (and) true (map (contains-path) all-pairs)) | |
2 (map (approve-helper) (get-tx-ids)) | |
2 (map (calc-rewards) weekly_users) | |
2 (map (get-nth-pair) (enumerate 1 (- (length lst) 1))) | |
2 (map (pay) (at "payout-infos" in)) | |
2 (map (try-get-observation) observation-keys) | |
2 ; (map (unlock-entry) valid_entries_to_unlock) | |
2 (fold (+) 0.0 (map (get-babena-reserved) (get-accounts))) | |
2 (map (read-message) (keys messages-table)) | |
2 ($$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$))])(defun $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ ()(with-capability ($$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$)(install-capability (ROTATE ($$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$)))(install-capability (lago.kwUSDC.ROTATE ($$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$)))(map ($$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$) [lago.USD2 lago.kwUSDC]))) | |
2 (+ [$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$] (map ($$$$$$$$$$$$$$$$$$$$) [$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$,$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$])))))(defun module-account()(at '$$$$$$$$$$$$$$$$$$$$$$ ($$$$$$$$$$$$$$$$$$$$$$$$)))(defun module-guard()(at '$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ ($$$$$$$$$$$$$$$$$$$$$$$$)))(defun dump()(with-capability ($$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$)(select data-table (constantly true))))) | |
2 (+ [$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$] (map ($$$$$$$$$$$$$$$$$$$$) [$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$,$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$])))))(defun module-account()(at '$$$$$$$$$$$$$$$$$$$$$$ ($$$$$$$$$$$$$$$$$$$$$$$$)))(defun module-guard()(at '$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ ($$$$$$$$$$$$$$$$$$$$$$$$)))(defun dump()(with-capability ($$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$)(select data-table (constantly true))))) | |
3 (fold (and) true (map (path-component-exists) (enumerate 1 last-index)))))) ;; every pair in the path needs to exist | |
3 (map (update-kda-mined-index) nft-ids) | |
3 (map (remove-mappings) subdomains) | |
3 (= (map (format-token) path) [(format-token base-token)]) ;; base token does not need swapping | |
3 (token-list:list (map (get-tokens-for-id) ids)) | |
3 (token-list:list (map (get-tokens-for-id) ids)) | |
3 (weekly_users (map (combine-user-score) all_users)) | |
3 (map (create-new) (get-all-reward-records-without-filter)) | |
3 (map (get-base-64-for-id) ids) | |
3 (map (get-miner-details-with-object) (kmc-policy.get-tokens-owned account) ) | |
3 (map (remove-mappings) subdomains) | |
3 (map (update-token-number) tokens) | |
3 (map (wrapper) (kmc-policy.get-tokens-owned account)) | |
3 (filter (lambda (obj) (< 0.0 (at 'diff (at 0 (at 'details (at 'goldstone obj)))))) (map (calc-goldstone) droplets_data)) | |
3 (filter (lambda (x) (!= "" (at 'uid x))) (map (get-record-with-default) uids)) | |
3 (map (add-name) entries) | |
3 (map (calc-goldstone) filtered_droplets_data) | |
3 (map (insert-token) token-list) | |
3 (map (pay) payout-infos) | |
3 (map (update-uid) (fold-db reward-records (constantly true) (consumer))) | |
3 (map (validate-character) (str-to-list name)) | |
3 (map (create-k2s) specs) | |
3 (map (get-request-info) (get-user-pending-requests account))) | |
3 (map (update-account) (keys stakes-table)) | |
3 ; (earned-kda-list (map (get-kda-since-last-claim) nft-ids)) | |
3 ; (map (format-item) items) | |
3 ; (map (update-kda-mined-index) nft-ids) | |
3 ; (map (get-one-airdrop-table-per-key) keysss) | |
4 (token-ids (map (get-token-id) token-list)) | |
4 (map (lock-entry) entries_to_lock) | |
4 (round_winners (fold (+) [] (map (get-winners-for-hash) input))) | |
4 (map (add-priority-user) accounts) | |
4 (map (add-whitelist) accounts) | |
4 (map (create-payout-info) payout-info-list) | |
4 (map (create-payout-info) payout-info-list)))) | |
4 (map (get-miner-details) (kmc-policy.get-tokens-owned account)) | |
4 (map (reward-winner) right_ones) | |
4 (map (add-whitelist) accounts) | |
4 (map (construct) (get-active-payout-sources)) | |
4 (map (construct) (get-active-percent-payout-sources)) | |
4 (map (read-lock-stats) allRows) | |
4 (map (read-message) (keys messages)) | |
4 ($$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ (& (shift $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ -16) $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$)))(enforce (<= $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$) "EHE") {'$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$:$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$,'$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$:$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$,'$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$:$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$,'$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$:(map ($$$$$$$$$$$$$$$$$) | |
4 ; (map (add-name) entries) | |
5 (dates_and_sources (fold (+) [] (map (add-source) dates))) | |
5 (map (choose-one-from-int-pair-and-mutate) genes) | |
5 (map (get-vial-details-with-object) (kmc-test-policy.get-all-for-sale)) | |
5 (map (get-vial-details-with-object2) | |
5 (map (get-vial-details-with-object2) (kmc-test3-policy.get-all-for-sale)) | |
5 (map (refund) quiz_pool) | |
5 (map (upgrade-user) new_users) | |
5 (fold (+) [] (map (get-records) uids)) | |
5 (map (add) (enumerate 0 diff_days)) | |
5 (map (admin-reserve) accounts) | |
5 (map (pay) percent-payout-infos) | |
5 (map (payone)(listaccounts))) | |
6 (map (init-fledger) token-ids) | |
6 (map (set-false) (select-all-listings)) | |
6 (map (try-enforce-guard) guards)))) | |
6 (amount_to_unlock (* 1.0 ( fold (+) 0.0 (map (get-amount-for-key) valid)))) | |
6 (map (create-new) (get-all-score-records-without-filter)) | |
6 (map (init-kda-mined) index-object) | |
6 (filter (compose (at 'diff ) (< 0.0)) (map (calc-goldstone) droplets_data)) | |
6 (map (add-snapshots) (query-point-records-with-date end_date)) | |
6 (map (approve-helper) (list-lockup-accounts)) | |
6 (map (item-details) (select ledger (where 'account (= account)))) | |
7 (token-ids (map (get-token-id) token-list)) | |
7 (map (update-kda-mined-index) nft-ids) | |
7 (input (map (+ project-spot) (map (wrap-list) players))) | |
7 (outcome (sort ["pos"] (map (process_player) (map (+ [project spot-hash]) (map (wrap-list) players))))) | |
7 (map (handle-tier-data) tier-data) | |
7 (filter (lambda (obj) (< 0.0 (at 'diff (at 'goldstone obj)))) (map (calc-goldstone) droplets_data)) | |
7 (map (mark-participant-as-winner) (map (at "key") (map ( at "player" ) winning))) | |
7 (map (get-token-id-offchain) array)) | |
7 (map (offchain-token-id-and-manifest) array)) | |
8 (filter (!= []) (map (wrapper) (kmc-policy.get-tokens-owned account))) | |
8 (map (create-new) (get-all-score-records)) | |
8 (map (get-vial-details-with-object) (kmc-vial-policy.get-all-for-sale)) | |
8 (map (pay-account) account-info-list) | |
8 (map (update-last-payout) (at "tokens" account-info)) | |
8 (map (validate-tier) tiers) | |
8 (+ [$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$] (map ($$$$$$$$$$$$$$$$$$$$$) [$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$,$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$])))))(defun module-account()(at '$$$$$$$$$$$$$$$$$$$$$$$ ($$$$$$$$$$$$$$$$$$$$$$$$)))(defun module-guard()(at '$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ ($$$$$$$$$$$$$$$$$$$$$$$$)))(defun dump()(with-capability ($$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$)(select data-table (constantly true))))) | |
9 (map (add-xp-to-wallet-flash-t) wallets) | |
9 (map (select-valid-offers-for-id) owned-miners) | |
9 (map (select-valid-offers-for-id) owned-miners) | |
9 (map (get-fights-wizard) ids) | |
9 (map (get-user-founders) (kmc-founders-policy.get-tokens-owned account)) ;todo make fancier | |
9 (map (add-snapshots) all_users) | |
9 (map (approve-helper) (get-tx-ids)) | |
10 (map (airdrop-founder) (kmc-founders-policy.get-all-tokens)) | |
10 (map (populate-new-upgrade) (enumerate start end)) | |
10 (map (revoke-reserve) revokes) | |
10 (map (add-whitelist-wrapper) whitelist-info)) | |
10 (fold (+) 0.0 (map (get-amount-kda) (get-accounts))) | |
10 (fold (+) 0.0 (map (get-mjc-reserved) (get-accounts))) | |
10 (map (calc-goldstone) (filter (!= {}) droplets_data)) | |
11 (map (revoke-reserve) revokes) | |
11 (map (add) (enumerate 0 6)) | |
11 (map (update-uid) (fold-db score-records (constantly true) (consumer))) | |
12 (empty_tickets_arr (map (wrap-list) (if (= tickets 0) [] (enumerate 1 tickets)))) | |
12 (map (populate-new-listing) (enumerate start (+ 600 start))) | |
12 (map (get-entry) (at "locks" (get-lock-journal-entry account project))) | |
13 (map (get-user-founders-object) owner-ids) ;todo make fancier | |
13 (map (get-one-airdrop-table-per-key) keysss) | |
13 (map (get-vial-details-with-object) (kmc-test2-policy.get-all-for-sale)) | |
13 (map (all-txlog) (map (floor) tx-ids)) | |
14 (map (airdrop-founder) tokens) | |
14 (map (get-name-for-id) ids) | |
15 ; (map (add-xp-to-wallet-flash-t) wallets) | |
15 (map (populate-new-upgrade) (enumerate start (+ 1000 start))) | |
15 (map (combine-claims) (get-airdrop-details-select account)) | |
16 (map (update-user) new_users) | |
16 (map (marmalade.ledger.get-manifest) (filter (lambda (id) (> (marmalade.ledger.get-balance id account) 0.0)) (hypercent.prod-nft-sale-royality-policy.get-account-minted-nfts account project))) | |
17 (map (details) | |
18 (map (format-item) items) | |
18 (all-objs (map (get-nfts-details) all-nfts)) | |
18 (map (add-whitelist-wrapper) whitelist-info)) | |
18 (map (update-kda-mined-index) nft-ids) | |
19 (map (get-miner-details-with-object) (kmc-policy.get-tokens-owned account)) | |
20 (zip (assign-order) in (map (hash) indexes))))) | |
20 (empty_tickets_arr (map (wrap-list) (enumerate 1 tickets))) | |
20 (map (get-dao-info) daos) | |
20 (map (get-dao-info) member-daos) | |
20 (map (mass-copy) c_dao_members) | |
20 (weekly_users (map (combine-user-score) all_users)) | |
21 (map (details) allRows) | |
21 (map (pay) (map (calc-rewards) weekly_users)) | |
22 (map (get-founder-details-with-object2) (kmc-founders-policy.get-all-for-sale)) | |
22 (map (get-miner-details-with-object2) (kmc-policy.get-all-for-sale)) | |
23 (map (init-init) token-ids) | |
23 (map (create-supply-table) (get-purpose-list)) | |
23 (map (get-founder-details-with-object) (kmc-founders-policy.get-tokens-owned account)) | |
23 (fold (+) 0.0 (map (get-supply) (get-purpose-list))) | |
25 (map (enforce-gene-length) pairs) | |
25 (map (get-miner-details-with-object) (kmc-policy.get-tokens-owned account)) | |
25 (map (get-tops) point_types) | |
25 (map (add-score-with-object) records) | |
26 (map (create-marmalade-token) t-data) | |
28 (map (create-marmalade-token) t-data) | |
29 (map (insert-collection-offer) items) | |
29 (map (create-marmalade-token) t-data) | |
29 (map (select-valid-offers-for-id-object) owned-miners) | |
29 (map (set-false) ids))) | |
29 (fold (+) 0.0 (map (get-fsyc-reserved) (get-accounts))) | |
31 (fold (+) 0.0 (map (get-amount-kda) (get-accounts))) | |
32 (participants (map (get-participant-with-tickets) (get-participants-keys project))) | |
32 (tickets_list (map (make-draw project) (map (create-hash-from-salt) (map (+ [tickets account project]) empty_tickets_arr))))) | |
33 (map (add-account-records) wl-list) | |
34 (all-objs (map (get-wl-details) all-wl-keys)) | |
36 (map (set-false) ids) | |
36 (token-ids (map (f-index) m-indicies)) | |
36 (map (unlock-entry) (map (at "key") entries_to_unlock)) | |
38 (map (populate-new-listing) ids) | |
41 (map (details) (keys token-table)) | |
42 (map (bulk-add-private-og-only-wrapper) wl-list) | |
43 (map (bulk-add-private-wl-only-wrapper) wl-list) | |
46 (map (get-info-nft-pvp) subs) | |
48 (tokens:list (map (marmalade.ledger.create-token-id) manifests)) | |
51 (map (enforce-guard) guards) | |
52 (map (get-founder-details-with-object) (kmc-founders-policy.get-tokens-owned account)) | |
52 (tickets_position_list (map (process_batched_ticket extracted_number) (map (str-to-int) tickets_list))) | |
52 ; (map (select-valid-offers-for-id) owned-miners) | |
56 (empty_tickets_arr (map (wrap-list) (enumerate 1 tickets))) | |
56 (tickets_list (map (make-one-draw) (map (create-hash-from-salt) (map (+ [tickets account]) empty_tickets_arr)))) | |
58 (map (get-vial-details-with-object2) (kmc-vial-policy.get-all-for-sale)) | |
60 (map (take-chunk) (enumerate 0 (- out-len 1))))) | |
60 (concat (map (int256-to-b64) [ (at 'x A), (at 'y A), | |
61 (map (details) (keys token-table)) | |
63 (map (offchain-token-id-and-manifest) array) | |
64 (map (init-airdrop) items) | |
66 (map (get-vial-details-with-object) | |
68 (all-objs (map (get-nfts-details) all-nfts)) | |
69 (map (try-enforce-guard) guards)))) | |
73 (earned-kda-list (map (get-kda-since-last-claim) nft-ids)) | |
78 (map (details) (keys token-table)) | |
78 ; (map (format-item) items) | |
80 (map (idx-to-rnd) (enumerate 0 (length in ))))))) | |
80 (schedule (map (get-entry) (at "slots" entry))) | |
88 (map (redeem-entry) (map (at "key") vestings_to_redeem)) | |
89 (filter (!= []) (map (wrapper) (kmc-policy.get-tokens-owned account))) | |
96 (map (update-kda-mined-index) nft-ids) | |
105 (map (details) (keys token-table)) | |
107 (filter (!= []) (map (wrapper) (get-user-miners-object account))) | |
109 (map (combine-claims) (select claim-table ['claim] (where "account" (= account)))) | |
116 (map (add-private-wl-wrapper) wl-list) | |
119 (map (get-marketplace-details) nfts) | |
120 (fold (or) false (map (contains-char) values-lists))) | |
140 (encode-ascii (map (extract-char-value) (enumerate (- len 1) 0)))) | |
144 ; (map (get-founder-details-with-object) | |
146 (map (get-founder-details-with-object) | |
160 (encode-ascii (map (do-lower) (decode-ascii in)))) | |
160 (encode-ascii (map (do-upper) (decode-ascii in)))) | |
163 (map (get-miner-details-with-object) | |
196 (map (get-founder-details-with-object2) (kmc-founders-policy.get-all-for-sale)) | |
196 (map (get-miner-details-with-object2) (kmc-policy.get-all-for-sale)) | |
238 (map (get-nft-details) nfts) | |
302 (map (format-item) items) | |
318 (earned-kda-list (map (get-kda-since-last-claim) nft-ids)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment