tx · 4Dq4fBioe36gQpFXnXcmmy2mgFjx4XXfDDfPf51w8r7J 3NADYuG3G91PrmsrRqQfyeDCf2Pi53UV5id: -0.01000000 Waves 2022.01.07 14:44 [1868438] smart account 3NADYuG3G91PrmsrRqQfyeDCf2Pi53UV5id > SELF 0.00000000 Waves
{ "type": 13, "id": "4Dq4fBioe36gQpFXnXcmmy2mgFjx4XXfDDfPf51w8r7J", "fee": 1000000, "feeAssetId": null, "timestamp": 1641555898444, "version": 2, "chainId": 84, "sender": "3NADYuG3G91PrmsrRqQfyeDCf2Pi53UV5id", "senderPublicKey": "8agr5kfwDL7NLuMetvciXCcd9TcDKZhRwYZPPTAShaCC", "proofs": [ "GxPaicC8oYLUBHghbvssfVtc1PTm2gycCfCg34XWTZhiM3VMgiMJ8CqFXw4GB99vuEihamW6cud21L96dX69HJb" ], "script": "base64:AAIFAAAAAAAAABkIAhIFCgMICAgSABIAEgASABIGCgQICAgIAAAACwAAAAAOa2V5QnV5VUxVU1JhdGUCAAAADWJ1eV9VTFVTX3JhdGUAAAAAHGtleUJ1eVVMVVNSYXRlU2NhbGVEZWxpbWl0ZXICAAAAHWJ1eV9VTFVTX3JhdGVfc2NhbGVfZGVsaW1pdGVyAAAAAA9rZXlTZWxsVUxVU1JhdGUCAAAADnNlbGxfVUxVU19yYXRlAAAAAB1rZXlTZWxsVUxVU1JhdGVTY2FsZURlbGltaXRlcgIAAAAec2VsbF9VTFVTX3JhdGVfc2NhbGVfZGVsaW1pdGVyAAAAAA1rZXlNYWtlTkZURmVlAgAAABBrZXlfbWFrZV9ORlRfZmVlAAAAAA1rZXlDb21taXNzaW9uAgAAAApjb21taXNzaW9uAAAAABtrZXlDb21taXNzaW9uU2NhbGVEZWxpbWl0ZXICAAAAGmNvbW1pc3Npb25fc2NhbGVfZGVsaW1pdGVyAAAAAARVU0ROAQAAACDksHLEGjv+8PYJNtljDWFsUYAqeC0sRtfKUlc+urlUoQAAAAAEVUxVUwEAAAAg/iPPgG6phXW2Vd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2ZlcgAAAAMFAAAAEHJlY2lwaWVudEFkZHJlc3MFAAAAF2Ftb3VudFdpdGhvdXRDb21taXNzaW9uBQAAAApwbXRBc3NldElkCQAETAAAAAIJAQAAAA5TY3JpcHRUcmFuc2ZlcgAAAAMFAAAAEWNvbW1pc3Npb25BZGRyZXNzBQAAABBhbW91bnRDb21taXNzaW9uBQAAAApwbXRBc3NldElkCQAETAAAAAIJAQAAAA5TY3JpcHRUcmFuc2ZlcgAAAAMIBQAAAAFpAAAABmNhbGxlcgUAAAAOYW1vdW50Q2FzaGJhY2sFAAAABFVMVVMFAAAAA25pbAAAAAD0gni0", "height": 1868438, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: F82qcz1fP73zsJyM8Hi8BSPJV3WPknjmQrnrRUDxaEnM Next: 29uojWUsLLkNEvyoz1uS22s4A9avS5FNwyopDWNSe3T4 Diff:
Old | New | Differences | |
---|---|---|---|
112 | 112 | if (!(sigVerify_8Kb(toBytes(K), fromBase58String(G), L))) | |
113 | 113 | then throw("Invalid proof from backend.") | |
114 | 114 | else if ((toInt(toBytes(H)) != M)) | |
115 | - | then throw(((((("Date cannot be in the past " + toString(M)) + " ") + H) + " ") + toString((toInt(toBytes(H)) | |
115 | + | then throw(((((("Date cannot be in the past " + toString(M)) + " ") + H) + " ") + toString((M - toInt(toBytes(H)))))) | |
116 | 116 | else if (if ((r != h)) | |
117 | 117 | then (r != i) | |
118 | 118 | 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'J74E8AHdZobVSkA3YboiRrxFUs4odMVxK8tGMg6QXA1n' | |
21 | 21 | ||
22 | 22 | let j = h | |
23 | 23 | ||
24 | 24 | let k = Address(base58'3N1yGG2mA3gTLxReAh84njeRvCBzvUbCccg') | |
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,H) = { | |
105 | 105 | let I = addressFromStringValue(F) | |
106 | 106 | let J = $Tuple2(l.payments[0].amount, l.payments[0].assetId) | |
107 | 107 | let q = J._1 | |
108 | 108 | let r = J._2 | |
109 | 109 | let K = (makeString([toString(this), H, toString(q)], ";") + ";") | |
110 | 110 | let L = base58'5fJ73uaebbc12bwCegVoRZgNKfn4BqpH8NB8Rs2NpBmg' | |
111 | 111 | let M = lastBlock.timestamp | |
112 | 112 | if (!(sigVerify_8Kb(toBytes(K), fromBase58String(G), L))) | |
113 | 113 | then throw("Invalid proof from backend.") | |
114 | 114 | else if ((toInt(toBytes(H)) != M)) | |
115 | - | then throw(((((("Date cannot be in the past " + toString(M)) + " ") + H) + " ") + toString((toInt(toBytes(H)) | |
115 | + | then throw(((((("Date cannot be in the past " + toString(M)) + " ") + H) + " ") + toString((M - toInt(toBytes(H)))))) | |
116 | 116 | else if (if ((r != h)) | |
117 | 117 | then (r != i) | |
118 | 118 | else false) | |
119 | 119 | then throw("Asset must be only USDN or ULUS") | |
120 | 120 | else { | |
121 | 121 | let N = getIntegerValue(this, f) | |
122 | 122 | let O = getIntegerValue(this, g) | |
123 | 123 | let P = fraction(q, N, O) | |
124 | 124 | let D = (q - P) | |
125 | 125 | let Q = if ((r == h)) | |
126 | 126 | then 1000000 | |
127 | 127 | else 1000 | |
128 | 128 | let R = fraction(q, 100, Q) | |
129 | 129 | if (isDefined(getString(this, o))) | |
130 | 130 | then { | |
131 | 131 | let S = fromBase58String(getStringValue(this, o)) | |
132 | 132 | [ScriptTransfer(I, D, r), ScriptTransfer(k, P, r), ScriptTransfer(l.caller, R, i), ScriptTransfer(l.caller, 1, S)] | |
133 | 133 | } | |
134 | 134 | else [ScriptTransfer(I, D, r), ScriptTransfer(k, P, r), ScriptTransfer(l.caller, R, i)] | |
135 | 135 | } | |
136 | 136 | } | |
137 | 137 | ||
138 | 138 |
github/deemru/w8io/026f985 27.90 ms ◑