tx · G5FFk98FbhFESYMRsep2bHHcep4haMvDN1rh19wdm1Pk 3NADYuG3G91PrmsrRqQfyeDCf2Pi53UV5id: -0.01000000 Waves 2022.01.06 19:49 [1867299] smart account 3NADYuG3G91PrmsrRqQfyeDCf2Pi53UV5id > SELF 0.00000000 Waves
{ "type": 13, "id": "G5FFk98FbhFESYMRsep2bHHcep4haMvDN1rh19wdm1Pk", "fee": 1000000, "feeAssetId": null, "timestamp": 1641487752253, "version": 2, "chainId": 84, "sender": "3NADYuG3G91PrmsrRqQfyeDCf2Pi53UV5id", "senderPublicKey": "8agr5kfwDL7NLuMetvciXCcd9TcDKZhRwYZPPTAShaCC", "proofs": [ "7hMoCVYxWo7W6SfSLp47FdSEnuLebDkK1hpNfTHFnYeXC3xMgc3sBuDgEcfUXHRuML2nVbNwRSSDrYMixSCLRU8" ], "script": "base64:AAIFAAAAAAAAABgIAhIFCgMICAgSABIAEgASABIFCgMICAgAAAALAAAAAA5rZXlCdXlVTFVTUmF0ZQIAAAANYnV5X1VMVVNfcmF0ZQAAAAAca2V5QnV5VUxVU1JhdGVTY2FsZURlbGltaXRlcgIAAAAdYnV5X1VMVVNfcmF0ZV9zY2FsZV9kZWxpbWl0ZXIAAAAAD2tleVNlbGxVTFVTUmF0ZQIAAAAOc2VsbF9VTFVTX3JhdGUAAAAAHWtleVNlbGxVTFVTUmF0ZVNjYWxlRGVsaW1pdGVyAgAAAB5zZWxsX1VMVVNfcmF0ZV9zY2FsZV9kZWxpbWl0ZXIAAAAADWtleU1ha2VORlRGZWUCAAAAEGtleV9tYWtlX05GVF9mZWUAAAAADWtleUNvbW1pc3Npb24CAAAACmNvbW1pc3Npb24AAAAAG2tleUNvbW1pc3Npb25TY2FsZURlbGltaXRlcgIAAAAaY29tbWlzc2lvbl9zY2FsZV9kZWxpbWl0ZXIAAAAABFVTRE4BAAAAIOSwcsQaO/7w9gk22WMNYWxRgCp4LSxG18pSVz66uVShAAAAAARVTFVTAQAAACBcOT9fCNS+BgDG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0RGl2aWRlcgMJAQAAAAlpc0RlZmluZWQAAAABCQAEHQAAAAIFAAAABHRoaXMFAAAACXByb2R1Y3RJZAQAAAAKTkZUYXNzZXRJZAkAAlkAAAABCQEAAAARQGV4dHJOYXRpdmUoMTA1MykAAAACBQAAAAR0aGlzBQAAAAlwcm9kdWN0SWQJAARMAAAAAgkBAAAADlNjcmlwdFRyYW5zZmVyAAAAAwUAAAAQcmVjaXBpZW50QWRkcmVzcwUAAAAXYW1vdW50V2l0aG91dENvbW1pc3Npb24FAAAACnBtdEFzc2V0SWQJAARMAAAAAgkBAAAADlNjcmlwdFRyYW5zZmVyAAAAAwUAAAARY29tbWlzc2lvbkFkZHJlc3MFAAAAEGFtb3VudENvbW1pc3Npb24FAAAACnBtdEFzc2V0SWQJAARMAAAAAgkBAAAADlNjcmlwdFRyYW5zZmVyAAAAAwgFAAAAAWkAAAAGY2FsbGVyBQAAAA5hbW91bnRDYXNoYmFjawUAAAAEVUxVUwkABEwAAAACCQEAAAAOU2NyaXB0VHJhbnNmZXIAAAADCAUAAAABaQAAAAZjYWxsZXIAAAAAAAAAAAEFAAAACk5GVGFzc2V0SWQFAAAAA25pbAkABEwAAAACCQEAAAAOU2NyaXB0VHJhbnNmZXIAAAADBQAAABByZWNpcGllbnRBZGRyZXNzBQAAABdhbW91bnRXaXRob3V0Q29tbWlzc2lvbgUAAAAKcG10QXNzZXRJZAkABEwAAAACCQEAAAAOU2NyaXB0VHJhbnNmZXIAAAADBQAAABFjb21taXNzaW9uQWRkcmVzcwUAAAAQYW1vdW50Q29tbWlzc2lvbgUAAAAKcG10QXNzZXRJZAkABEwAAAACCQEAAAAOU2NyaXB0VHJhbnNmZXIAAAADCAUAAAABaQAAAAZjYWxsZXIFAAAADmFtb3VudENhc2hiYWNrBQAAAARVTFVTBQAAAANuaWwAAAAAd6UP0Q==", "height": 1867299, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: GBvnad2bWptyAFhbg6mMVY95Jp5bDL8NrxMtXHnC2FaL Next: AUTY9L34NSEYxib2XsQU8MUVCbXQFqxox69FGz27rCDA Diff:
Old | New | Differences | |
---|---|---|---|
109 | 109 | let J = makeString([toString(this), toString(q)], ";") | |
110 | 110 | let K = base58'5fJ73uaebbc12bwCegVoRZgNKfn4BqpH8NB8Rs2NpBmg' | |
111 | 111 | if (!(sigVerify_8Kb(toBytes(J), fromBase58String(G), K))) | |
112 | - | then throw(((("Invalid proof from backend =" + J) + " ") + | |
112 | + | then throw(((("Invalid proof from backend =" + toBase58String(toBytes(J))) + " ") + J)) | |
113 | 113 | else if (if ((r != h)) | |
114 | 114 | then (r != i) | |
115 | 115 | else false) |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 5 #-} | |
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'7D191wpwpSs4WanizHWgiRhAYhCGkmpop4h3NzUQreig' | |
21 | 21 | ||
22 | 22 | let j = h | |
23 | 23 | ||
24 | 24 | let k = Address(base58'3P9pCG7EBbhAkTxJQkwp6oTyc12zghXGUBW') | |
25 | 25 | ||
26 | 26 | @Callable(l) | |
27 | 27 | func makeNFT (m,n,o) = { | |
28 | 28 | let p = $Tuple2(l.payments[0].amount, l.payments[0].assetId) | |
29 | 29 | let q = p._1 | |
30 | 30 | let r = p._2 | |
31 | 31 | let s = getIntegerValue(this, e) | |
32 | 32 | if ((r != j)) | |
33 | 33 | then throw("Asset must be USDN only") | |
34 | 34 | else if ((s > q)) | |
35 | 35 | then throw(("Fee for make NFT token is " + toString(s))) | |
36 | 36 | else if (isDefined(getString(this, o))) | |
37 | 37 | then throw("NFT for this productId is already issued.") | |
38 | 38 | else { | |
39 | 39 | let t = Issue(m, (((n + "[") + o) + "]"), 1, 0, false, unit, 0) | |
40 | 40 | let u = calculateAssetId(t) | |
41 | 41 | [t, StringEntry(o, toBase58String(u)), ScriptTransfer(k, q, r)] | |
42 | 42 | } | |
43 | 43 | } | |
44 | 44 | ||
45 | 45 | ||
46 | 46 | ||
47 | 47 | @Callable(l) | |
48 | 48 | func setParams () = if ((l.caller != this)) | |
49 | 49 | then throw("Only the DApp itself can call this function") | |
50 | 50 | else [IntegerEntry(a, 150000), IntegerEntry(b, 1000), IntegerEntry(c, 100000), IntegerEntry(d, 1000), IntegerEntry(f, 30000), IntegerEntry(g, 1000000), IntegerEntry(e, 1000000)] | |
51 | 51 | ||
52 | 52 | ||
53 | 53 | ||
54 | 54 | @Callable(l) | |
55 | 55 | func clearOldParams () = if ((l.caller != this)) | |
56 | 56 | then throw("Only the DApp itself can call this function") | |
57 | 57 | else { | |
58 | 58 | let v = "buy_UWORLD_rate" | |
59 | 59 | let w = "buy_UWORLD_rate_scale_delimiter" | |
60 | 60 | let x = "sell_UWORLD_rate" | |
61 | 61 | let y = "sell_UWORLD_rate_scale_delimiter" | |
62 | 62 | [DeleteEntry(v), DeleteEntry(w), DeleteEntry(x), DeleteEntry(y)] | |
63 | 63 | } | |
64 | 64 | ||
65 | 65 | ||
66 | 66 | ||
67 | 67 | @Callable(l) | |
68 | 68 | func buyULUS () = { | |
69 | 69 | let z = $Tuple2(l.payments[0].amount, l.payments[0].assetId) | |
70 | 70 | let q = z._1 | |
71 | 71 | let r = z._2 | |
72 | 72 | if ((r != j)) | |
73 | 73 | then throw("Asset must be USDN only") | |
74 | 74 | else { | |
75 | 75 | let A = getIntegerValue(this, a) | |
76 | 76 | let B = getIntegerValue(this, b) | |
77 | 77 | let C = fraction(q, B, A) | |
78 | 78 | let D = C | |
79 | 79 | [ScriptTransfer(l.caller, D, i)] | |
80 | 80 | } | |
81 | 81 | } | |
82 | 82 | ||
83 | 83 | ||
84 | 84 | ||
85 | 85 | @Callable(l) | |
86 | 86 | func sellULUS () = { | |
87 | 87 | let E = $Tuple2(l.payments[0].amount, l.payments[0].assetId) | |
88 | 88 | let q = E._1 | |
89 | 89 | let r = E._2 | |
90 | 90 | if ((r != i)) | |
91 | 91 | then throw("Asset must be ULUS only") | |
92 | 92 | else { | |
93 | 93 | let A = getIntegerValue(this, c) | |
94 | 94 | let B = getIntegerValue(this, d) | |
95 | 95 | let C = fraction(q, A, B) | |
96 | 96 | let D = C | |
97 | 97 | [ScriptTransfer(l.caller, D, h)] | |
98 | 98 | } | |
99 | 99 | } | |
100 | 100 | ||
101 | 101 | ||
102 | 102 | ||
103 | 103 | @Callable(l) | |
104 | 104 | func makePayment (F,o,G) = { | |
105 | 105 | let H = addressFromStringValue(F) | |
106 | 106 | let I = $Tuple2(l.payments[0].amount, l.payments[0].assetId) | |
107 | 107 | let q = I._1 | |
108 | 108 | let r = I._2 | |
109 | 109 | let J = makeString([toString(this), toString(q)], ";") | |
110 | 110 | let K = base58'5fJ73uaebbc12bwCegVoRZgNKfn4BqpH8NB8Rs2NpBmg' | |
111 | 111 | if (!(sigVerify_8Kb(toBytes(J), fromBase58String(G), K))) | |
112 | - | then throw(((("Invalid proof from backend =" + J) + " ") + | |
112 | + | then throw(((("Invalid proof from backend =" + toBase58String(toBytes(J))) + " ") + J)) | |
113 | 113 | else if (if ((r != h)) | |
114 | 114 | then (r != i) | |
115 | 115 | else false) | |
116 | 116 | then throw("Asset must be only USDN or ULUS") | |
117 | 117 | else { | |
118 | 118 | let L = getIntegerValue(this, f) | |
119 | 119 | let M = getIntegerValue(this, g) | |
120 | 120 | let N = fraction(q, L, M) | |
121 | 121 | let D = (q - N) | |
122 | 122 | let O = if ((r == h)) | |
123 | 123 | then 1000000 | |
124 | 124 | else 1000 | |
125 | 125 | let P = fraction(q, 100, O) | |
126 | 126 | if (isDefined(getString(this, o))) | |
127 | 127 | then { | |
128 | 128 | let Q = fromBase58String(getStringValue(this, o)) | |
129 | 129 | [ScriptTransfer(H, D, r), ScriptTransfer(k, N, r), ScriptTransfer(l.caller, P, i), ScriptTransfer(l.caller, 1, Q)] | |
130 | 130 | } | |
131 | 131 | else [ScriptTransfer(H, D, r), ScriptTransfer(k, N, r), ScriptTransfer(l.caller, P, i)] | |
132 | 132 | } | |
133 | 133 | } | |
134 | 134 | ||
135 | 135 |
github/deemru/w8io/026f985 31.18 ms ◑