tx · HVQkHsLULXyUXPMTB6KDw2uL6VToLhF6wpD6LoyVcVB5 3NADYuG3G91PrmsrRqQfyeDCf2Pi53UV5id: -0.01400000 Waves 2021.05.19 20:45 [1532862] smart account 3NADYuG3G91PrmsrRqQfyeDCf2Pi53UV5id > SELF 0.00000000 Waves
{ "type": 13, "id": "HVQkHsLULXyUXPMTB6KDw2uL6VToLhF6wpD6LoyVcVB5", "fee": 1400000, "feeAssetId": null, "timestamp": 1621446372695, "version": 2, "chainId": 84, "sender": "3NADYuG3G91PrmsrRqQfyeDCf2Pi53UV5id", "senderPublicKey": "8agr5kfwDL7NLuMetvciXCcd9TcDKZhRwYZPPTAShaCC", "proofs": [ "5PLHSrVWR8Kt2troJR8Nz66SZZoTA2Z16QCm2wwJMkaPRuAVoRyW3QLYbmMXqALhZiJbQDQvpyEjcXvgs7S2Mdoz" ], "script": "base64:AAIEAAAAAAAAABkIAhIFCgMICAgSBAoCAQESABIAEgQKAggIAAAACgAAAAAPa2V5RXhjaGFuZ2VSYXRlAgAAAA1leGNoYW5nZV9yYXRlAAAAAB1rZXlFeGNoYW5nZVJhdGVTY2FsZURlbGltaXRlcgIAAAAdZXhjaGFuZ2VfcmF0ZV9zY2FsZV9kZWxpbWl0ZXIAAAAADWtleUNvbW1pc3Npb24CAAAACmNvbW1pc3Npb24AAAAAG2tleUNvbW1pc3Npb25TY2FsZURlbGltaXRlcgIAAAAaY29tbWlzc2lvbl9zY2FsZV9kZWxpbWl0ZXIAAAAABFVTRE4BAAAAIOSwcsQaO/7w9gk22WMNYWxRgCp4LSxG18pSVz66uVShAAAAAAZVV09STEQBAAAAIFw5P18I1L4GAMZe978MAfIh+BM42SxhQKId1T0PstxdAAAAAAdhc3NldElkBQAAAARVU0ROAAAAAApjb21taXNzaW9uAAAAAAAAAHUwAAAAABhjb21taXNzaW9uU2NhbGVEZWxpbWl0ZXIAAAAAAAAPQkAAAAAACm1ha2VORlRmZWUAAAAAAAAPQkAAAAAFAAAAAWkBAAAAB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", "height": 1532862, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: BK7R1AQkZxZy2wzVvBz2hJhT5pJHheV5SNfJ7pcV5Jv9 Next: 7mCQXQpfg9qRiQFn37vmeynCp4PdaGoRT47G3GbkxW91 Diff:
Old | New | Differences | |
---|---|---|---|
101 | 101 | if (isDefined(getString(this, n))) | |
102 | 102 | then { | |
103 | 103 | let E = fromBase58String(getStringValue(this, n)) | |
104 | - | [ScriptTransfer(B, y, g | |
104 | + | [ScriptTransfer(B, y, g), ScriptTransfer(k.caller, D, f), ScriptTransfer(k.caller, 1, E)] | |
105 | 105 | } | |
106 | - | else [ScriptTransfer(B, y, g), ScriptTransfer( | |
106 | + | else [ScriptTransfer(B, y, g), ScriptTransfer(k.caller, D, f)] | |
107 | 107 | } | |
108 | 108 | } | |
109 | 109 |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 4 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let a = "exchange_rate" | |
5 | 5 | ||
6 | 6 | let b = "exchange_rate_scale_delimiter" | |
7 | 7 | ||
8 | 8 | let c = "commission" | |
9 | 9 | ||
10 | 10 | let d = "commission_scale_delimiter" | |
11 | 11 | ||
12 | 12 | let e = base58'GPi1Q6QVgUmuomtThbim81hBYBEUWyf5BVmE4Tnd3sNg' | |
13 | 13 | ||
14 | 14 | let f = base58'7D191wpwpSs4WanizHWgiRhAYhCGkmpop4h3NzUQreig' | |
15 | 15 | ||
16 | 16 | let g = e | |
17 | 17 | ||
18 | 18 | let h = 30000 | |
19 | 19 | ||
20 | 20 | let i = 1000000 | |
21 | 21 | ||
22 | 22 | let j = 1000000 | |
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 | if ((q != g)) | |
30 | 30 | then throw("Asset must be USDN only") | |
31 | 31 | else if ((j > p)) | |
32 | 32 | then throw(("Fee for make NFT token is " + toString(j))) | |
33 | 33 | else if (isDefined(getString(this, n))) | |
34 | 34 | then throw("NFT for this productId is already issued.") | |
35 | 35 | else { | |
36 | 36 | let r = Issue(l, (((m + "[") + n) + "]"), 1, 0, false, unit, 0) | |
37 | 37 | let s = calculateAssetId(r) | |
38 | 38 | [r, StringEntry(n, toBase58String(s))] | |
39 | 39 | } | |
40 | 40 | } | |
41 | 41 | ||
42 | 42 | ||
43 | 43 | ||
44 | 44 | @Callable(k) | |
45 | 45 | func setParams (t,u) = if ((k.caller != this)) | |
46 | 46 | then throw("Only the DApp itself can call this function") | |
47 | 47 | else [IntegerEntry(a, t), IntegerEntry(b, u), IntegerEntry(c, h), IntegerEntry(d, i)] | |
48 | 48 | ||
49 | 49 | ||
50 | 50 | ||
51 | 51 | @Callable(k) | |
52 | 52 | func buyUWORLD () = { | |
53 | 53 | let v = $Tuple2(k.payments[0].amount, k.payments[0].assetId) | |
54 | 54 | let p = v._1 | |
55 | 55 | let q = v._2 | |
56 | 56 | if ((q != g)) | |
57 | 57 | then throw("Asset must be USDN only") | |
58 | 58 | else { | |
59 | 59 | let t = getIntegerValue(this, a) | |
60 | 60 | let u = getIntegerValue(this, b) | |
61 | 61 | let w = fraction(p, u, t) | |
62 | 62 | let x = fraction(w, h, i) | |
63 | 63 | let y = (w - x) | |
64 | 64 | [ScriptTransfer(k.caller, y, f)] | |
65 | 65 | } | |
66 | 66 | } | |
67 | 67 | ||
68 | 68 | ||
69 | 69 | ||
70 | 70 | @Callable(k) | |
71 | 71 | func sellUWORLD () = { | |
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 != f)) | |
76 | 76 | then throw("Asset must be UWORLD only") | |
77 | 77 | else { | |
78 | 78 | let t = getIntegerValue(this, a) | |
79 | 79 | let u = getIntegerValue(this, b) | |
80 | 80 | let w = fraction(p, t, u) | |
81 | 81 | let x = fraction(w, h, i) | |
82 | 82 | let y = (w - x) | |
83 | 83 | [ScriptTransfer(k.caller, y, e)] | |
84 | 84 | } | |
85 | 85 | } | |
86 | 86 | ||
87 | 87 | ||
88 | 88 | ||
89 | 89 | @Callable(k) | |
90 | 90 | func makePayment (A,n) = { | |
91 | 91 | let B = addressFromStringValue(A) | |
92 | 92 | let C = $Tuple2(k.payments[0].amount, k.payments[0].assetId) | |
93 | 93 | let p = C._1 | |
94 | 94 | let q = C._2 | |
95 | 95 | if ((q != g)) | |
96 | 96 | then throw("Asset must be USDN only") | |
97 | 97 | else { | |
98 | 98 | let x = fraction(p, h, i) | |
99 | 99 | let y = (p - x) | |
100 | 100 | let D = fraction(p, 10, 100) | |
101 | 101 | if (isDefined(getString(this, n))) | |
102 | 102 | then { | |
103 | 103 | let E = fromBase58String(getStringValue(this, n)) | |
104 | - | [ScriptTransfer(B, y, g | |
104 | + | [ScriptTransfer(B, y, g), ScriptTransfer(k.caller, D, f), ScriptTransfer(k.caller, 1, E)] | |
105 | 105 | } | |
106 | - | else [ScriptTransfer(B, y, g), ScriptTransfer( | |
106 | + | else [ScriptTransfer(B, y, g), ScriptTransfer(k.caller, D, f)] | |
107 | 107 | } | |
108 | 108 | } | |
109 | 109 | ||
110 | 110 |
github/deemru/w8io/169f3d6 34.26 ms ◑