tx · 2GAS8qHCS21MCFuvVwgaLDZUKbyZgJViYmonVrwNM1LG 3NADYuG3G91PrmsrRqQfyeDCf2Pi53UV5id: -0.01000000 Waves 2021.07.13 02:19 [1611032] smart account 3NADYuG3G91PrmsrRqQfyeDCf2Pi53UV5id > SELF 0.00000000 Waves
{ "type": 13, "id": "2GAS8qHCS21MCFuvVwgaLDZUKbyZgJViYmonVrwNM1LG", "fee": 1000000, "feeAssetId": null, "timestamp": 1626131957340, "version": 2, "chainId": 84, "sender": "3NADYuG3G91PrmsrRqQfyeDCf2Pi53UV5id", "senderPublicKey": "8agr5kfwDL7NLuMetvciXCcd9TcDKZhRwYZPPTAShaCC", "proofs": [ "2APDDS1D5xh64AaKXRdmg586C4k6qvLe3HWXxT4AkkRngeGVkwkru3C8iUpRMqgZ2LdccuF6gAXbLcmAPctryp12" ], "script": "base64:AAIEAAAAAAAAABUIAhIFCgMICAgSABIAEgASBAoCCAgAAAAKAAAAAA5rZXlCdXlVTFVTUmF0ZQIAAAANYnV5X1VMVVNfcmF0ZQAAAAAca2V5QnV5VUxVU1JhdGVTY2FsZURlbGltaXRlcgIAAAAdYnV5X1VMVVNfcmF0ZV9zY2FsZV9kZWxpbWl0ZXIAAAAAD2tleVNlbGxVTFVTUmF0ZQIAAAAOc2VsbF9VTFVTX3JhdGUAAAAAHWtleVNlbGxVTFVTUmF0ZVNjYWxlRGVsaW1pdGVyAgAAAB5zZWxsX1VMVVNfcmF0ZV9zY2FsZV9kZWxpbWl0ZXIAAAAADWtleU1ha2VORlRGZWUCAAAAEGtleV9tYWtlX05GVF9mZWUAAAAADWtleUNvbW1pc3Npb24CAAAACmNvbW1pc3Npb24AAAAAG2tleUNvbW1pc3Npb25TY2FsZURlbGltaXRlcgIAAAAaY29tbWlzc2lvbl9zY2FsZV9kZWxpbWl0ZXIAAAAABFVTRE4BAAAAIOSwcsQaO/7w9gk22WMNYWxRgCp4LSxG18pSVz66uVShAAAAAARVTFVTAQAAACD+I8+AbqmFdbZV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c2ZlcgAAAAMFAAAAEHJlY2lwaWVudEFkZHJlc3MFAAAAF2Ftb3VudFdpdGhvdXRDb21taXNzaW9uBQAAAAdhc3NldElkCQAETAAAAAIJAQAAAA5TY3JpcHRUcmFuc2ZlcgAAAAMIBQAAAAFpAAAABmNhbGxlcgUAAAAOYW1vdW50Q2FzaGJhY2sFAAAABFVMVVMFAAAAA25pbAAAAAAWL5sg", "height": 1611032, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: smYedfZSApFd3DSZSYdY6MjHjZimL9qJfpeac59cPW7 Next: BLqg4XdSr1MqZirMZDmj61NdjdWAnnZGMWV3hynpTyZL Full:
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 4 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let a = "buy_ULUS_rate" | |
5 | 5 | ||
6 | 6 | let b = "buy_ULUS_rate_scale_delimiter" | |
7 | 7 | ||
8 | 8 | let c = "sell_ULUS_rate" | |
9 | 9 | ||
10 | 10 | let d = "sell_ULUS_rate_scale_delimiter" | |
11 | 11 | ||
12 | 12 | let e = "key_make_NFT_fee" | |
13 | 13 | ||
14 | 14 | let f = "commission" | |
15 | 15 | ||
16 | 16 | let g = "commission_scale_delimiter" | |
17 | 17 | ||
18 | 18 | let h = base58'GPi1Q6QVgUmuomtThbim81hBYBEUWyf5BVmE4Tnd3sNg' | |
19 | 19 | ||
20 | 20 | let i = base58'J74E8AHdZobVSkA3YboiRrxFUs4odMVxK8tGMg6QXA1n' | |
21 | 21 | ||
22 | 22 | let j = h | |
23 | 23 | ||
24 | 24 | @Callable(k) | |
25 | 25 | func makeNFT (l,m,n) = { | |
26 | 26 | let o = $Tuple2(k.payments[0].amount, k.payments[0].assetId) | |
27 | 27 | let p = o._1 | |
28 | 28 | let q = o._2 | |
29 | 29 | let r = getIntegerValue(this, e) | |
30 | 30 | if ((q != j)) | |
31 | 31 | then throw("Asset must be USDN only") | |
32 | 32 | else if ((r > p)) | |
33 | 33 | then throw(("Fee for make NFT token is " + toString(r))) | |
34 | 34 | else if (isDefined(getString(this, n))) | |
35 | 35 | then throw("NFT for this productId is already issued.") | |
36 | 36 | else { | |
37 | 37 | let s = Issue(l, (((m + "[") + n) + "]"), 1, 0, false, unit, 0) | |
38 | 38 | let t = calculateAssetId(s) | |
39 | 39 | [s, StringEntry(n, toBase58String(t))] | |
40 | 40 | } | |
41 | 41 | } | |
42 | 42 | ||
43 | 43 | ||
44 | 44 | ||
45 | 45 | @Callable(k) | |
46 | 46 | func setParams () = if ((k.caller != this)) | |
47 | 47 | then throw("Only the DApp itself can call this function") | |
48 | 48 | else [IntegerEntry(a, 150000), IntegerEntry(b, 1000), IntegerEntry(c, 100000), IntegerEntry(d, 1000), IntegerEntry(f, 30000), IntegerEntry(g, 1000000), IntegerEntry(e, 1000000)] | |
49 | 49 | ||
50 | 50 | ||
51 | 51 | ||
52 | 52 | @Callable(k) | |
53 | 53 | func buyULUS () = { | |
54 | 54 | let u = $Tuple2(k.payments[0].amount, k.payments[0].assetId) | |
55 | 55 | let p = u._1 | |
56 | 56 | let q = u._2 | |
57 | 57 | if ((q != j)) | |
58 | 58 | then throw("Asset must be USDN only") | |
59 | 59 | else { | |
60 | 60 | let v = getIntegerValue(this, a) | |
61 | 61 | let w = getIntegerValue(this, b) | |
62 | 62 | let x = fraction(p, w, v) | |
63 | 63 | let y = x | |
64 | 64 | [ScriptTransfer(k.caller, y, i)] | |
65 | 65 | } | |
66 | 66 | } | |
67 | 67 | ||
68 | 68 | ||
69 | 69 | ||
70 | 70 | @Callable(k) | |
71 | 71 | func sellULUS () = { | |
72 | 72 | let z = $Tuple2(k.payments[0].amount, k.payments[0].assetId) | |
73 | 73 | let p = z._1 | |
74 | 74 | let q = z._2 | |
75 | 75 | if ((q != i)) | |
76 | 76 | then throw("Asset must be ULUS only") | |
77 | 77 | else { | |
78 | 78 | let v = getIntegerValue(this, c) | |
79 | 79 | let w = getIntegerValue(this, d) | |
80 | 80 | let x = fraction(p, v, w) | |
81 | 81 | let y = x | |
82 | 82 | [ScriptTransfer(k.caller, y, h)] | |
83 | 83 | } | |
84 | 84 | } | |
85 | 85 | ||
86 | 86 | ||
87 | 87 | ||
88 | 88 | @Callable(k) | |
89 | 89 | func makePayment (A,n) = { | |
90 | 90 | let B = addressFromStringValue(A) | |
91 | 91 | let C = $Tuple2(k.payments[0].amount, k.payments[0].assetId) | |
92 | 92 | let p = C._1 | |
93 | 93 | let q = C._2 | |
94 | 94 | if ((q != j)) | |
95 | 95 | then throw("Asset must be USDN only") | |
96 | 96 | else { | |
97 | 97 | let D = getIntegerValue(this, f) | |
98 | 98 | let E = getIntegerValue(this, g) | |
99 | 99 | let F = fraction(p, D, E) | |
100 | 100 | let y = (p - F) | |
101 | 101 | let G = fraction(p, 100, 1000000) | |
102 | 102 | if (isDefined(getString(this, n))) | |
103 | 103 | then { | |
104 | 104 | let H = fromBase58String(getStringValue(this, n)) | |
105 | 105 | [ScriptTransfer(B, y, j), ScriptTransfer(k.caller, G, i), ScriptTransfer(k.caller, 1, H)] | |
106 | 106 | } | |
107 | 107 | else [ScriptTransfer(B, y, j), ScriptTransfer(k.caller, G, i)] | |
108 | 108 | } | |
109 | 109 | } | |
110 | 110 | ||
111 | 111 |
github/deemru/w8io/026f985 30.33 ms ◑