tx · 5a1d92LuVrxUERLnykqnzdY7nV1B6zgtUUBEkRHoj6zA

3MuVEuhXaTvF3ELakZksUP77a4bT8gPJtm6:  -0.01000000 Waves

2021.12.04 18:30 [1819716] smart account 3MuVEuhXaTvF3ELakZksUP77a4bT8gPJtm6 > SELF 0.00000000 Waves

{ "type": 13, "id": "5a1d92LuVrxUERLnykqnzdY7nV1B6zgtUUBEkRHoj6zA", "fee": 1000000, "feeAssetId": null, "timestamp": 1638631845136, "version": 2, "chainId": 84, "sender": "3MuVEuhXaTvF3ELakZksUP77a4bT8gPJtm6", "senderPublicKey": "2LizaCNygFYwGFKe34vvFHgJc4ckK7MpzRzziRNn56Cu", "proofs": [ "2hPQEDU31gwctcAZBHKXDyYbsWWT3TNcQmJvcnLeB4ZYDwMHtdrX7yyahfkXt17LS2YSyygtc76mdJGrMjr4qLn" ], "script": "base64:AAIFAAAAAAAAAAcIAhIDCgEIAAAABAAAAAAGbWFzdGVyCQEAAAAHQWRkcmVzcwAAAAEBAAAAGgFUPUYGSQjhSwi99Mcha5hyYJjHFzCelkk9AAAAAAVzZXBhcgIAAAAFfHx8fHwAAAAACWluaXRwcmljZQIAAAAGMTAwMDAwAQAAAAd0b3dhdmVzAAAAAQAAAAFhAwkAAGYAAAACAAAAAAAAAAAJCQABMQAAAAEFAAAAAWEJAAEsAAAAAgkAASwAAAACAgAAAAEwAgAAAAEuBQAAAAFhCQABLAAAAAIJAAEsAAAAAgkAAS8AAAACBQAAAAFhCQAAZQAAAAIJAAExAAAAAQUAAAABYQAAAAAAAAAACAIAAAABLgkBAAAACXRha2VSaWdodAAAAAIFAAAAAWEAAAAAAAAAAAgAAAABAAAAAWkBAAAABXBhaW50AAAAAQAAAAVpZGF0YQQAAAAMY2FsbGVyQWRyZXNzCQACWAAAAAEICAUAAAABaQAAAAZjYWxsZXIAAAAFYnl0ZXMEAAAABXBpeHh5CQAEtQAAAAIFAAAABWlkYXRhBQAAAAVzZXBhcgQAAAAGbnVtYmVyCQABlwA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AAAAAAAAAAkAAZEAAAACCQABkQAAAAIFAAAAA2FsbAAAAAAAAAAAAwAAAAAAAAAAAQkABEwAAAACCQEAAAAOU2NyaXB0VHJhbnNmZXIAAAADBQAAAAZtYXN0ZXIJAQAAAA1wYXJzZUludFZhbHVlAAAAAQkAAZEAAAACCQABkQAAAAIFAAAAA2FsbAAAAAAAAAAAAwAAAAAAAAAAAwUAAAAEdW5pdAkABEwAAAACCQEAAAALU3RyaW5nRW50cnkAAAACCQABkQAAAAIJAAGRAAAAAgUAAAADYWxsAAAAAAAAAAAEAAAAAAAAAAAACQABkQAAAAIJAAGRAAAAAgUAAAADYWxsAAAAAAAAAAAEAAAAAAAAAAABCQAETAAAAAIJAQAAAA5TY3JpcHRUcmFuc2ZlcgAAAAMFAAAABm1hc3RlcgkBAAAADXBhcnNlSW50VmFsdWUAAAABCQABkQAAAAIJAAGRAAAAAgUAAAADYWxsAAAAAAAAAAAEAAAAAAAAAAADBQAAAAR1bml0BQAAAANuaWwFAAAABHVuaXQAAAAA9h3Lyw==", "height": 1819716, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 4ncEewfzv1YQiJ3Et4WJ1JtjeqPCE6sVbdY3hud2Y5NR Next: 4xCcxGjaYtWg3EmAqk3nwAauWjoGEEK9i5rG4XE4uPNC Diff:
OldNewDifferences
66 let separ = "|||||"
77
88 let initprice = "100000"
9+
10+func towaves (a) = if ((9 > size(a)))
11+ then (("0" + ".") + a)
12+ else ((take(a, (size(a) - 8)) + ".") + takeRight(a, 8))
13+
914
1015 @Callable(i)
1116 func paint (idata) = {
5661 let payment = ((((paymentforpix(0) + paymentforpix(1)) + paymentforpix(2)) + paymentforpix(3)) + paymentforpix(4))
5762 let pmt = if ((size(i.payments) == 1))
5863 then i.payments[0]
59- else throw(("Attached payment is required: " + toString(payment)))
64+ else throw(("Attached payment is required: " + towaves(toString(payment))))
6065 if (isDefined(pmt.assetId))
6166 then throw("works with waves only")
6267 else if ((payment > pmt.amount))
63- then throw(((("you give: " + toString(pmt.amount)) + ", but deal needs: ") + toString(payment)))
68+ then throw(((("you give: " + toString(pmt.amount)) + ", but deal needs: ") + towaves(toString(payment))))
6469 else {
6570 let all = [makerecord(0), makerecord(1), makerecord(2), makerecord(3), makerecord(4)]
6671 $Tuple2([StringEntry(all[0][0], all[0][1]), ScriptTransfer(master, parseIntValue(all[0][3]), unit), StringEntry(all[1][0], all[1][1]), ScriptTransfer(master, parseIntValue(all[1][3]), unit), StringEntry(all[2][0], all[2][1]), ScriptTransfer(master, parseIntValue(all[2][3]), unit), StringEntry(all[3][0], all[3][1]), ScriptTransfer(master, parseIntValue(all[3][3]), unit), StringEntry(all[4][0], all[4][1]), ScriptTransfer(master, parseIntValue(all[4][3]), unit)], unit)
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 5 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let master = Address(base58'3MuW4t1jCXHt8WRsHVLUar32EnvJxZaQWAx')
55
66 let separ = "|||||"
77
88 let initprice = "100000"
9+
10+func towaves (a) = if ((9 > size(a)))
11+ then (("0" + ".") + a)
12+ else ((take(a, (size(a) - 8)) + ".") + takeRight(a, 8))
13+
914
1015 @Callable(i)
1116 func paint (idata) = {
1217 let callerAdress = toBase58String(i.caller.bytes)
1318 let pixxy = split(idata, separ)
1419 let number = min([5, size(pixxy)])
1520 let records = nil
1621 func validxy (x) = match parseInt(pixxy[x]) {
1722 case a: Int =>
1823 if (if ((parseIntValue(pixxy[x]) > -1))
1924 then (1000 > parseIntValue(pixxy[x]))
2025 else false)
2126 then parseInt(pixxy[x])
2227 else false
2328 case _ =>
2429 false
2530 }
2631
2732 func getrecord (x) = match getString(pixxy[x]) {
2833 case a: String =>
2934 a
3035 case _ =>
3136 false
3237 }
3338
3439 func makerecord (x) = if ((x > (number - 1)))
3540 then ["--", "--", "--", "0"]
3641 else if ((validxy(x) == false))
3742 then ["--", "--", "--", "0"]
3843 else if ((getrecord(x) == false))
3944 then [pixxy[x], makeString([callerAdress, initprice, "color", "url"], separ), "", initprice]
4045 else {
4146 let price = parseIntValue(split(getStringValue(pixxy[x]), separ)[1])
4247 [pixxy[x], makeString([callerAdress, toString((price + parseIntValue(initprice))), "color", "url"], separ), "", toString(price)]
4348 }
4449
4550 func paymentforpix (x) = if (if ((number > x))
4651 then (getrecord(x) != false)
4752 else false)
4853 then match parseInt(split(getStringValue(pixxy[x]), separ)[1]) {
4954 case a: Int =>
5055 parseIntValue(split(getStringValue(pixxy[x]), separ)[1])
5156 case _ =>
5257 0
5358 }
5459 else 0
5560
5661 let payment = ((((paymentforpix(0) + paymentforpix(1)) + paymentforpix(2)) + paymentforpix(3)) + paymentforpix(4))
5762 let pmt = if ((size(i.payments) == 1))
5863 then i.payments[0]
59- else throw(("Attached payment is required: " + toString(payment)))
64+ else throw(("Attached payment is required: " + towaves(toString(payment))))
6065 if (isDefined(pmt.assetId))
6166 then throw("works with waves only")
6267 else if ((payment > pmt.amount))
63- then throw(((("you give: " + toString(pmt.amount)) + ", but deal needs: ") + toString(payment)))
68+ then throw(((("you give: " + toString(pmt.amount)) + ", but deal needs: ") + towaves(toString(payment))))
6469 else {
6570 let all = [makerecord(0), makerecord(1), makerecord(2), makerecord(3), makerecord(4)]
6671 $Tuple2([StringEntry(all[0][0], all[0][1]), ScriptTransfer(master, parseIntValue(all[0][3]), unit), StringEntry(all[1][0], all[1][1]), ScriptTransfer(master, parseIntValue(all[1][3]), unit), StringEntry(all[2][0], all[2][1]), ScriptTransfer(master, parseIntValue(all[2][3]), unit), StringEntry(all[3][0], all[3][1]), ScriptTransfer(master, parseIntValue(all[3][3]), unit), StringEntry(all[4][0], all[4][1]), ScriptTransfer(master, parseIntValue(all[4][3]), unit)], unit)
6772 }
6873 }
6974
7075

github/deemru/w8io/169f3d6 
32.02 ms