tx · AZ6DRvv61cr4gX6bGoz94d6JYY7mrvsbWnuFd7QQFm8B

3NADYuG3G91PrmsrRqQfyeDCf2Pi53UV5id:  -0.01000000 Waves

2022.01.07 02:13 [1867690] smart account 3NADYuG3G91PrmsrRqQfyeDCf2Pi53UV5id > SELF 0.00000000 Waves

{ "type": 13, "id": "AZ6DRvv61cr4gX6bGoz94d6JYY7mrvsbWnuFd7QQFm8B", "fee": 1000000, "feeAssetId": null, "timestamp": 1641510848945, "version": 2, "chainId": 84, "sender": "3NADYuG3G91PrmsrRqQfyeDCf2Pi53UV5id", "senderPublicKey": "8agr5kfwDL7NLuMetvciXCcd9TcDKZhRwYZPPTAShaCC", "proofs": [ "5orzMjbXwsHpEd7nMjS7qf9miHYgvs3fftDrWeocEjv8MLfFhFHgK78ky4v1BFqxGKagKydFiJYvd7k3zaSTH2nx" ], "script": "base64:AAIFAAAAAAAAABkIAhIFCgMICAgSABIAEgASABIGCgQICAgBAAAACwAAAAAOa2V5QnV5VUxVU1JhdGUCAAAADWJ1eV9VTFVTX3JhdGUAAAAAHGtleUJ1eVVMVVNSYXRlU2NhbGVEZWxpbWl0ZXICAAAAHWJ1eV9VTFVTX3JhdGVfc2NhbGVfZGVsaW1pdGVyAAAAAA9rZXlTZWxsVUxVU1JhdGUCAAAADnNlbGxfVUxVU19yYXRlAAAAAB1rZXlTZWxsVUxVU1JhdGVTY2FsZURlbGltaXRlcgIAAAAec2VsbF9VTFVTX3JhdGVfc2NhbGVfZGVsaW1pdGVyAAAAAA1rZXlNYWtlTkZURmVlAgAAABBrZXlfbWFrZV9ORlRfZmVlAAAAAA1rZXlDb21taXNzaW9uAgAAAApjb21taXNzaW9uAAAAABtrZXlDb21taXNzaW9uU2NhbGVEZWxpbWl0ZXICAAAAGmNvbW1pc3Npb25fc2NhbGVfZGVsaW1pdGVyAAAAAARVU0ROAQAAACDksHLEGjv+8PYJNtljDWFsUYAqeC0sRtfKUlc+urlUoQAAAAAEVUxVUwEAAAAg/iPPgG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FRyYW5zZmVyAAAAAwUAAAAQcmVjaXBpZW50QWRkcmVzcwUAAAAXYW1vdW50V2l0aG91dENvbW1pc3Npb24FAAAACnBtdEFzc2V0SWQJAARMAAAAAgkBAAAADlNjcmlwdFRyYW5zZmVyAAAAAwUAAAARY29tbWlzc2lvbkFkZHJlc3MFAAAAEGFtb3VudENvbW1pc3Npb24FAAAACnBtdEFzc2V0SWQJAARMAAAAAgkBAAAADlNjcmlwdFRyYW5zZmVyAAAAAwgFAAAAAWkAAAAGY2FsbGVyBQAAAA5hbW91bnRDYXNoYmFjawUAAAAEVUxVUwUAAAADbmlsAAAAAKsstn4=", "height": 1867690, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: fYqJru5g2BhKbqXYqqaaFpWCqYiCNagqTnZ37VXrTHW Next: DWYfGEg7zXxA6UzuBcL47cfJLoebSfzraRbC7vSq64cN Diff:
OldNewDifferences
101101
102102
103103 @Callable(l)
104-func makePayment (F,o,G) = {
105- let H = addressFromStringValue(F)
106- let I = $Tuple2(l.payments[0].amount, l.payments[0].assetId)
107- let q = I._1
108- let r = I._2
109- let J = (makeString([toString(this), toString(q)], ";") + ";")
110- let K = base58'5fJ73uaebbc12bwCegVoRZgNKfn4BqpH8NB8Rs2NpBmg'
111- if (!(sigVerify_8Kb(toBytes(J), fromBase58String(G), K)))
112- then throw(((("Invalid proof from backend =" + toBase58String(toBytes(J))) + " ") + J))
113- else if (if ((r != h))
114- then (r != i)
115- else false)
116- then throw("Asset must be only USDN or ULUS")
117- else {
118- let L = getIntegerValue(this, f)
119- let M = getIntegerValue(this, g)
120- let N = fraction(q, L, M)
121- let D = (q - N)
122- let O = if ((r == h))
123- then 1000000
124- else 1000
125- let P = fraction(q, 100, O)
126- if (isDefined(getString(this, o)))
127- then {
128- let Q = fromBase58String(getStringValue(this, o))
129-[ScriptTransfer(H, D, r), ScriptTransfer(k, N, r), ScriptTransfer(l.caller, P, i), ScriptTransfer(l.caller, 1, Q)]
130- }
131- else [ScriptTransfer(H, D, r), ScriptTransfer(k, N, r), ScriptTransfer(l.caller, P, i)]
132- }
104+func makePayment (F,o,G,H) = {
105+ let I = addressFromStringValue(F)
106+ let J = $Tuple2(l.payments[0].amount, l.payments[0].assetId)
107+ let q = J._1
108+ let r = J._2
109+ let K = (makeString([toString(this), toString(q)], ";") + ";")
110+ let L = base58'5fJ73uaebbc12bwCegVoRZgNKfn4BqpH8NB8Rs2NpBmg'
111+ let M = lastBlock.timestamp
112+ if (!(sigVerify_8Kb(toBytes(K), fromBase58String(G), L)))
113+ then throw(((("Invalid proof from backend =" + toBase58String(toBytes(K))) + " ") + K))
114+ else if ((H != lastBlock.timestamp))
115+ then throw(((("Date cannot be in the past " + toString(lastBlock.timestamp)) + " ") + toString(H)))
116+ else if (if ((r != h))
117+ then (r != i)
118+ else false)
119+ then throw("Asset must be only USDN or ULUS")
120+ else {
121+ let N = getIntegerValue(this, f)
122+ let O = getIntegerValue(this, g)
123+ let P = fraction(q, N, O)
124+ let D = (q - P)
125+ let Q = if ((r == h))
126+ then 1000000
127+ else 1000
128+ let R = fraction(q, 100, Q)
129+ if (isDefined(getString(this, o)))
130+ then {
131+ let S = fromBase58String(getStringValue(this, o))
132+[ScriptTransfer(I, D, r), ScriptTransfer(k, P, r), ScriptTransfer(l.caller, R, i), ScriptTransfer(l.caller, 1, S)]
133+ }
134+ else [ScriptTransfer(I, D, r), ScriptTransfer(k, P, r), ScriptTransfer(l.caller, R, i)]
135+ }
133136 }
134137
135138
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 5 #-}
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 let k = Address(base58'3N1yGG2mA3gTLxReAh84njeRvCBzvUbCccg')
2525
2626 @Callable(l)
2727 func makeNFT (m,n,o) = {
2828 let p = $Tuple2(l.payments[0].amount, l.payments[0].assetId)
2929 let q = p._1
3030 let r = p._2
3131 let s = getIntegerValue(this, e)
3232 if ((r != j))
3333 then throw("Asset must be USDN only")
3434 else if ((s > q))
3535 then throw(("Fee for make NFT token is " + toString(s)))
3636 else if (isDefined(getString(this, o)))
3737 then throw("NFT for this productId is already issued.")
3838 else {
3939 let t = Issue(m, (((n + "[") + o) + "]"), 1, 0, false, unit, 0)
4040 let u = calculateAssetId(t)
4141 [t, StringEntry(o, toBase58String(u)), ScriptTransfer(k, q, r)]
4242 }
4343 }
4444
4545
4646
4747 @Callable(l)
4848 func setParams () = if ((l.caller != this))
4949 then throw("Only the DApp itself can call this function")
5050 else [IntegerEntry(a, 150000), IntegerEntry(b, 1000), IntegerEntry(c, 100000), IntegerEntry(d, 1000), IntegerEntry(f, 30000), IntegerEntry(g, 1000000), IntegerEntry(e, 1000000)]
5151
5252
5353
5454 @Callable(l)
5555 func clearOldParams () = if ((l.caller != this))
5656 then throw("Only the DApp itself can call this function")
5757 else {
5858 let v = "buy_UWORLD_rate"
5959 let w = "buy_UWORLD_rate_scale_delimiter"
6060 let x = "sell_UWORLD_rate"
6161 let y = "sell_UWORLD_rate_scale_delimiter"
6262 [DeleteEntry(v), DeleteEntry(w), DeleteEntry(x), DeleteEntry(y)]
6363 }
6464
6565
6666
6767 @Callable(l)
6868 func buyULUS () = {
6969 let z = $Tuple2(l.payments[0].amount, l.payments[0].assetId)
7070 let q = z._1
7171 let r = z._2
7272 if ((r != j))
7373 then throw("Asset must be USDN only")
7474 else {
7575 let A = getIntegerValue(this, a)
7676 let B = getIntegerValue(this, b)
7777 let C = fraction(q, B, A)
7878 let D = C
7979 [ScriptTransfer(l.caller, D, i)]
8080 }
8181 }
8282
8383
8484
8585 @Callable(l)
8686 func sellULUS () = {
8787 let E = $Tuple2(l.payments[0].amount, l.payments[0].assetId)
8888 let q = E._1
8989 let r = E._2
9090 if ((r != i))
9191 then throw("Asset must be ULUS only")
9292 else {
9393 let A = getIntegerValue(this, c)
9494 let B = getIntegerValue(this, d)
9595 let C = fraction(q, A, B)
9696 let D = C
9797 [ScriptTransfer(l.caller, D, h)]
9898 }
9999 }
100100
101101
102102
103103 @Callable(l)
104-func makePayment (F,o,G) = {
105- let H = addressFromStringValue(F)
106- let I = $Tuple2(l.payments[0].amount, l.payments[0].assetId)
107- let q = I._1
108- let r = I._2
109- let J = (makeString([toString(this), toString(q)], ";") + ";")
110- let K = base58'5fJ73uaebbc12bwCegVoRZgNKfn4BqpH8NB8Rs2NpBmg'
111- if (!(sigVerify_8Kb(toBytes(J), fromBase58String(G), K)))
112- then throw(((("Invalid proof from backend =" + toBase58String(toBytes(J))) + " ") + J))
113- else if (if ((r != h))
114- then (r != i)
115- else false)
116- then throw("Asset must be only USDN or ULUS")
117- else {
118- let L = getIntegerValue(this, f)
119- let M = getIntegerValue(this, g)
120- let N = fraction(q, L, M)
121- let D = (q - N)
122- let O = if ((r == h))
123- then 1000000
124- else 1000
125- let P = fraction(q, 100, O)
126- if (isDefined(getString(this, o)))
127- then {
128- let Q = fromBase58String(getStringValue(this, o))
129-[ScriptTransfer(H, D, r), ScriptTransfer(k, N, r), ScriptTransfer(l.caller, P, i), ScriptTransfer(l.caller, 1, Q)]
130- }
131- else [ScriptTransfer(H, D, r), ScriptTransfer(k, N, r), ScriptTransfer(l.caller, P, i)]
132- }
104+func makePayment (F,o,G,H) = {
105+ let I = addressFromStringValue(F)
106+ let J = $Tuple2(l.payments[0].amount, l.payments[0].assetId)
107+ let q = J._1
108+ let r = J._2
109+ let K = (makeString([toString(this), toString(q)], ";") + ";")
110+ let L = base58'5fJ73uaebbc12bwCegVoRZgNKfn4BqpH8NB8Rs2NpBmg'
111+ let M = lastBlock.timestamp
112+ if (!(sigVerify_8Kb(toBytes(K), fromBase58String(G), L)))
113+ then throw(((("Invalid proof from backend =" + toBase58String(toBytes(K))) + " ") + K))
114+ else if ((H != lastBlock.timestamp))
115+ then throw(((("Date cannot be in the past " + toString(lastBlock.timestamp)) + " ") + toString(H)))
116+ else if (if ((r != h))
117+ then (r != i)
118+ else false)
119+ then throw("Asset must be only USDN or ULUS")
120+ else {
121+ let N = getIntegerValue(this, f)
122+ let O = getIntegerValue(this, g)
123+ let P = fraction(q, N, O)
124+ let D = (q - P)
125+ let Q = if ((r == h))
126+ then 1000000
127+ else 1000
128+ let R = fraction(q, 100, Q)
129+ if (isDefined(getString(this, o)))
130+ then {
131+ let S = fromBase58String(getStringValue(this, o))
132+[ScriptTransfer(I, D, r), ScriptTransfer(k, P, r), ScriptTransfer(l.caller, R, i), ScriptTransfer(l.caller, 1, S)]
133+ }
134+ else [ScriptTransfer(I, D, r), ScriptTransfer(k, P, r), ScriptTransfer(l.caller, R, i)]
135+ }
133136 }
134137
135138

github/deemru/w8io/026f985 
34.66 ms