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