tx · BLqg4XdSr1MqZirMZDmj61NdjdWAnnZGMWV3hynpTyZL

3NADYuG3G91PrmsrRqQfyeDCf2Pi53UV5id:  -0.01000000 Waves

2021.07.20 14:23 [1621878] smart account 3NADYuG3G91PrmsrRqQfyeDCf2Pi53UV5id > SELF 0.00000000 Waves

{ "type": 13, "id": "BLqg4XdSr1MqZirMZDmj61NdjdWAnnZGMWV3hynpTyZL", "fee": 1000000, "feeAssetId": null, "timestamp": 1626780217208, "version": 2, "chainId": 84, "sender": "3NADYuG3G91PrmsrRqQfyeDCf2Pi53UV5id", "senderPublicKey": "8agr5kfwDL7NLuMetvciXCcd9TcDKZhRwYZPPTAShaCC", "proofs": [ "9hUjzGffxucE6DNovt5oUUbLdud1STgvLTLduBqjgS8usQDhJg5peFfHP4gy9Tqm9DJ4EkQRKnJYrBjtx8bNF9y" ], "script": "base64:AAIEAAAAAAAAABcIAhIFCgMICAgSABIAEgASABIECgIICAAAAAoAAAAADmtleUJ1eVVMVVNSYXRlAgAAAA1idXlfVUxVU19yYXRlAAAAABxrZXlCdXlVTFVTUmF0ZVNjYWxlRGVsaW1pdGVyAgAAAB1idXlfVUxVU19yYXRlX3NjYWxlX2RlbGltaXRlcgAAAAAPa2V5U2VsbFVMVVNSYXRlAgAAAA5zZWxsX1VMVVNfcmF0ZQAAAAAda2V5U2VsbFVMVVNSYXRlU2NhbGVEZWxpbWl0ZXICAAAAHnNlbGxfVUxVU19yYXRlX3NjYWxlX2RlbGltaXRlcgAAAAANa2V5TWFrZU5GVEZlZQIAAAAQa2V5X21ha2VfTkZUX2ZlZQAAAAANa2V5Q29tbWlzc2lvbgIAAAAKY29tbWlzc2lvbgAAAAAba2V5Q29tbWlzc2lvblNjYWxlRGVsaW1pdGVyAgAAABpjb21taXNzaW9uX3NjYWxlX2RlbGltaXRlcgAAAAAEVVNETgEAAAAg5LByxBo7/vD2CTbZYw1hbFGAKngtLEbXylJXPrq5VKEAAAAABFVMVVMBAAAAIP4jz4BuqYV1tlXQ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AAAJcG10QW1vdW50BQAAAApjb21taXNzaW9uBQAAABhjb21taXNzaW9uU2NhbGVEZWxpbWl0ZXIEAAAAF2Ftb3VudFdpdGhvdXRDb21taXNzaW9uCQAAZQAAAAIFAAAACXBtdEFtb3VudAUAAAAQYW1vdW50Q29tbWlzc2lvbgQAAAAOYW1vdW50Q2FzaGJhY2sJAABrAAAAAwUAAAAJcG10QW1vdW50AAAAAAAAAABkAAAAAAAAD0JAAwkBAAAACWlzRGVmaW5lZAAAAAEJAAQdAAAAAgUAAAAEdGhpcwUAAAAJcHJvZHVjdElkBAAAAApORlRhc3NldElkCQACWQAAAAEJAQAAABFAZXh0ck5hdGl2ZSgxMDUzKQAAAAIFAAAABHRoaXMFAAAACXByb2R1Y3RJZAkABEwAAAACCQEAAAAOU2NyaXB0VHJhbnNmZXIAAAADBQAAABByZWNpcGllbnRBZGRyZXNzBQAAABdhbW91bnRXaXRob3V0Q29tbWlzc2lvbgUAAAAHYXNzZXRJZAkABEwAAAACCQEAAAAOU2NyaXB0VHJhbnNmZXIAAAADCAUAAAABaQAAAAZjYWxsZXIFAAAADmFtb3VudENhc2hiYWNrBQAAAARVTFVTCQAETAAAAAIJAQAAAA5TY3JpcHRUcmFuc2ZlcgAAAAMIBQAAAAFpAAAABmNhbGxlcgAAAAAAAAAAAQUAAAAKTkZUYXNzZXRJZAUAAAADbmlsCQAETAAAAAIJAQAAAA5TY3JpcHRUcmFuc2ZlcgAAAAMFAAAAEHJlY2lwaWVudEFkZHJlc3MFAAAAF2Ftb3VudFdpdGhvdXRDb21taXNzaW9uBQAAAAdhc3NldElkCQAETAAAAAIJAQAAAA5TY3JpcHRUcmFuc2ZlcgAAAAMIBQAAAAFpAAAABmNhbGxlcgUAAAAOYW1vdW50Q2FzaGJhY2sFAAAABFVMVVMFAAAAA25pbAAAAAC7hfW9", "height": 1621878, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 2GAS8qHCS21MCFuvVwgaLDZUKbyZgJViYmonVrwNM1LG Next: EBCjkdcdvxCWGWfusJiMxMVR1KbwPDU5eQ2FMvEdyfjg Diff:
OldNewDifferences
5050
5151
5252 @Callable(k)
53+func clearOldParams () = if ((k.caller != this))
54+ then throw("Only the DApp itself can call this function")
55+ 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)]
61+ }
62+
63+
64+
65+@Callable(k)
5366 func buyULUS () = {
54- let u = $Tuple2(k.payments[0].amount, k.payments[0].assetId)
55- let p = u._1
56- let q = u._2
67+ let y = $Tuple2(k.payments[0].amount, k.payments[0].assetId)
68+ let p = y._1
69+ let q = y._2
5770 if ((q != j))
5871 then throw("Asset must be USDN only")
5972 else {
60- let v = getIntegerValue(this, a)
61- let w = getIntegerValue(this, b)
62- let x = fraction(p, w, v)
63- let y = x
64-[ScriptTransfer(k.caller, y, i)]
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)]
6578 }
6679 }
6780
6982
7083 @Callable(k)
7184 func sellULUS () = {
72- let z = $Tuple2(k.payments[0].amount, k.payments[0].assetId)
73- let p = z._1
74- let q = z._2
85+ let D = $Tuple2(k.payments[0].amount, k.payments[0].assetId)
86+ let p = D._1
87+ let q = D._2
7588 if ((q != i))
7689 then throw("Asset must be ULUS only")
7790 else {
78- let v = getIntegerValue(this, c)
79- let w = getIntegerValue(this, d)
80- let x = fraction(p, v, w)
81- let y = x
82-[ScriptTransfer(k.caller, y, h)]
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)]
8396 }
8497 }
8598
8699
87100
88101 @Callable(k)
89-func makePayment (A,n) = {
90- let B = addressFromStringValue(A)
91- let C = $Tuple2(k.payments[0].amount, k.payments[0].assetId)
92- let p = C._1
93- let q = C._2
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
94107 if ((q != j))
95108 then throw("Asset must be USDN only")
96109 else {
97- let D = getIntegerValue(this, f)
98- let E = getIntegerValue(this, g)
99- let F = fraction(p, D, E)
100- let y = (p - F)
101- let G = fraction(p, 100, 1000000)
110+ let H = getIntegerValue(this, f)
111+ let I = getIntegerValue(this, g)
112+ let J = fraction(p, H, I)
113+ let C = (p - J)
114+ let K = fraction(p, 100, 1000000)
102115 if (isDefined(getString(this, n)))
103116 then {
104- let H = fromBase58String(getStringValue(this, n))
105-[ScriptTransfer(B, y, j), ScriptTransfer(k.caller, G, i), ScriptTransfer(k.caller, 1, H)]
117+ let L = fromBase58String(getStringValue(this, n))
118+[ScriptTransfer(F, C, j), ScriptTransfer(k.caller, K, i), ScriptTransfer(k.caller, 1, L)]
106119 }
107- else [ScriptTransfer(B, y, j), ScriptTransfer(k.caller, G, i)]
120+ else [ScriptTransfer(F, C, j), ScriptTransfer(k.caller, K, i)]
108121 }
109122 }
110123
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 4 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let a = "buy_ULUS_rate"
55
66 let b = "buy_ULUS_rate_scale_delimiter"
77
88 let c = "sell_ULUS_rate"
99
1010 let d = "sell_ULUS_rate_scale_delimiter"
1111
1212 let e = "key_make_NFT_fee"
1313
1414 let f = "commission"
1515
1616 let g = "commission_scale_delimiter"
1717
1818 let h = base58'GPi1Q6QVgUmuomtThbim81hBYBEUWyf5BVmE4Tnd3sNg'
1919
2020 let i = base58'J74E8AHdZobVSkA3YboiRrxFUs4odMVxK8tGMg6QXA1n'
2121
2222 let j = h
2323
2424 @Callable(k)
2525 func makeNFT (l,m,n) = {
2626 let o = $Tuple2(k.payments[0].amount, k.payments[0].assetId)
2727 let p = o._1
2828 let q = o._2
2929 let r = getIntegerValue(this, e)
3030 if ((q != j))
3131 then throw("Asset must be USDN only")
3232 else if ((r > p))
3333 then throw(("Fee for make NFT token is " + toString(r)))
3434 else if (isDefined(getString(this, n)))
3535 then throw("NFT for this productId is already issued.")
3636 else {
3737 let s = Issue(l, (((m + "[") + n) + "]"), 1, 0, false, unit, 0)
3838 let t = calculateAssetId(s)
3939 [s, StringEntry(n, toBase58String(t))]
4040 }
4141 }
4242
4343
4444
4545 @Callable(k)
4646 func setParams () = if ((k.caller != this))
4747 then throw("Only the DApp itself can call this function")
4848 else [IntegerEntry(a, 150000), IntegerEntry(b, 1000), IntegerEntry(c, 100000), IntegerEntry(d, 1000), IntegerEntry(f, 30000), IntegerEntry(g, 1000000), IntegerEntry(e, 1000000)]
4949
5050
5151
5252 @Callable(k)
53+func clearOldParams () = if ((k.caller != this))
54+ then throw("Only the DApp itself can call this function")
55+ 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)]
61+ }
62+
63+
64+
65+@Callable(k)
5366 func buyULUS () = {
54- let u = $Tuple2(k.payments[0].amount, k.payments[0].assetId)
55- let p = u._1
56- let q = u._2
67+ let y = $Tuple2(k.payments[0].amount, k.payments[0].assetId)
68+ let p = y._1
69+ let q = y._2
5770 if ((q != j))
5871 then throw("Asset must be USDN only")
5972 else {
60- let v = getIntegerValue(this, a)
61- let w = getIntegerValue(this, b)
62- let x = fraction(p, w, v)
63- let y = x
64-[ScriptTransfer(k.caller, y, i)]
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)]
6578 }
6679 }
6780
6881
6982
7083 @Callable(k)
7184 func sellULUS () = {
72- let z = $Tuple2(k.payments[0].amount, k.payments[0].assetId)
73- let p = z._1
74- let q = z._2
85+ let D = $Tuple2(k.payments[0].amount, k.payments[0].assetId)
86+ let p = D._1
87+ let q = D._2
7588 if ((q != i))
7689 then throw("Asset must be ULUS only")
7790 else {
78- let v = getIntegerValue(this, c)
79- let w = getIntegerValue(this, d)
80- let x = fraction(p, v, w)
81- let y = x
82-[ScriptTransfer(k.caller, y, h)]
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)]
8396 }
8497 }
8598
8699
87100
88101 @Callable(k)
89-func makePayment (A,n) = {
90- let B = addressFromStringValue(A)
91- let C = $Tuple2(k.payments[0].amount, k.payments[0].assetId)
92- let p = C._1
93- let q = C._2
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
94107 if ((q != j))
95108 then throw("Asset must be USDN only")
96109 else {
97- let D = getIntegerValue(this, f)
98- let E = getIntegerValue(this, g)
99- let F = fraction(p, D, E)
100- let y = (p - F)
101- let G = fraction(p, 100, 1000000)
110+ let H = getIntegerValue(this, f)
111+ let I = getIntegerValue(this, g)
112+ let J = fraction(p, H, I)
113+ let C = (p - J)
114+ let K = fraction(p, 100, 1000000)
102115 if (isDefined(getString(this, n)))
103116 then {
104- let H = fromBase58String(getStringValue(this, n))
105-[ScriptTransfer(B, y, j), ScriptTransfer(k.caller, G, i), ScriptTransfer(k.caller, 1, H)]
117+ let L = fromBase58String(getStringValue(this, n))
118+[ScriptTransfer(F, C, j), ScriptTransfer(k.caller, K, i), ScriptTransfer(k.caller, 1, L)]
106119 }
107- else [ScriptTransfer(B, y, j), ScriptTransfer(k.caller, G, i)]
120+ else [ScriptTransfer(F, C, j), ScriptTransfer(k.caller, K, i)]
108121 }
109122 }
110123
111124

github/deemru/w8io/169f3d6 
50.93 ms