tx · G9nnZstxnBaQrLNUTu4vn9vrYQYDX8WxPtAqqjTpUUoB 3MuVEuhXaTvF3ELakZksUP77a4bT8gPJtm6: -0.01000000 Waves 2021.12.05 15:43 [1820976] smart account 3MuVEuhXaTvF3ELakZksUP77a4bT8gPJtm6 > SELF 0.00000000 Waves
{ "type": 13, "id": "G9nnZstxnBaQrLNUTu4vn9vrYQYDX8WxPtAqqjTpUUoB", "fee": 1000000, "feeAssetId": null, "timestamp": 1638708252942, "version": 2, "chainId": 84, "sender": "3MuVEuhXaTvF3ELakZksUP77a4bT8gPJtm6", "senderPublicKey": "2LizaCNygFYwGFKe34vvFHgJc4ckK7MpzRzziRNn56Cu", "proofs": [ "5xT8rJCNVeyzn5pUTiywAjoqRbgVVvnHaBNGW2cEii2UzofKimMtTNA3P71pwz5FTZ8xVjY2rDZWrPBvPV5dbKXd" ], "script": "base64:AAIFAAAAAAAAAAcIAhIDCgEIAAAABgAAAAAJbWFzdGVyYWRyAgAAACMzTXVXNHQxakNYSHQ4V1JzSFZMVWFyMzJFbnZKeFphUVdBeAAAAAAGbWFzdGVyCQEAAAAHQWRkcmVzcwAAAAEBAAAAGgFUPUYGSQjhSwi99Mcha5hyYJjHFzCelkk9AAAAAAVzZXBhcgIAAAAFfHx8fHwAAAAACWluY3JwcmljZQAAAAAAAAAAMgAAAAAJaW5pdHByaWNlAgAAAAYxMDAwMDAAAAAACG1hc3JlZmVlAAAAAAAAAAABAAAAAQAAAAFpAQAAAAVwYWludAAAAAEAAAAFaWRhdGEEAAAADGNhbGxlckFkcmVzcwkAAlgAAAABCAgFAAAAAWkAAAAGY2FsbGVyAAAABWJ5dGVzBAAAAAdyZXFkYXRhCQAEtQAAAAIFAAAABWlkYXRhAgAAAAMtfC0EAAAABWNvbG9yCQABkQAAAAIFAAAAB3JlcWRhdGEAAAAAAAAAAAEEAAAAA3VybAkAAZEAAAACBQAAAAdyZXFkYXRhAAAAAAAAAAACBAAAAAVwaXh4eQkABLUAAAACCQABkQAAA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JAAAAAAAAAAABCQAETAAAAAIJAQAAAA5TY3JpcHRUcmFuc2ZlcgAAAAMJAQAAAAdBZGRyZXNzAAAAAQkAAlkAAAABCQABkQAAAAIJAAGRAAAAAgUAAAADYWxsAAAAAAAAAAAJAAAAAAAAAAACCQEAAAANcGFyc2VJbnRWYWx1ZQAAAAEJAAGRAAAAAgkAAZEAAAACBQAAAANhbGwAAAAAAAAAAAkAAAAAAAAAAAMFAAAABHVuaXQJAARMAAAAAgkBAAAADlNjcmlwdFRyYW5zZmVyAAAAAwgFAAAAAWkAAAAGY2FsbGVyCQAAZQAAAAIIBQAAAANwbXQAAAAGYW1vdW50CQEAAAANcGFyc2VJbnRWYWx1ZQAAAAEFAAAAB3BheW1lbnQFAAAABHVuaXQFAAAAA25pbAUAAAAEdW5pdAAAAABPoR6P", "height": 1820976, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: Dnf3HqbAWY2NLQeaDBrqmv7yyukfBVBgxD5zJwJMNMMc Next: 2jiC7iH2GE417b6UTEQMGidsfiRzJeQMYXMXxFAVm6fe Diff:
Old | New | Differences | |
---|---|---|---|
16 | 16 | @Callable(g) | |
17 | 17 | func paint (h) = { | |
18 | 18 | let i = toBase58String(g.caller.bytes) | |
19 | - | let j = split(h, c) | |
20 | - | let k = min([10, size(j)]) | |
21 | - | let l = ["--", "--", a, "0"] | |
22 | - | let m = [i, e, "color", "url"] | |
23 | - | func n (o) = { | |
24 | - | let p = parseInt(j[o]) | |
25 | - | if ($isInstanceOf(p, "Int")) | |
19 | + | let j = split(h, "-|-") | |
20 | + | let k = j[1] | |
21 | + | let l = j[2] | |
22 | + | let m = split(j[0], c) | |
23 | + | let n = min([10, size(m)]) | |
24 | + | let o = ["--", "--", a, "0"] | |
25 | + | let p = [i, e, k, l] | |
26 | + | func q (r) = { | |
27 | + | let s = parseInt(m[r]) | |
28 | + | if ($isInstanceOf(s, "Int")) | |
26 | 29 | then { | |
27 | - | let | |
28 | - | if (if ((parseIntValue( | |
29 | - | then (1000 > parseIntValue( | |
30 | + | let t = s | |
31 | + | if (if ((parseIntValue(m[r]) > -1)) | |
32 | + | then (1000 > parseIntValue(m[r])) | |
30 | 33 | else false) | |
31 | - | then parseIntValue( | |
34 | + | then parseIntValue(m[r]) | |
32 | 35 | else -1 | |
33 | 36 | } | |
34 | 37 | else -1 | |
35 | 38 | } | |
36 | 39 | ||
37 | - | func | |
38 | - | let | |
39 | - | if ($isInstanceOf( | |
40 | + | func u (r) = { | |
41 | + | let s = getString(m[r]) | |
42 | + | if ($isInstanceOf(s, "String")) | |
40 | 43 | then { | |
41 | - | let | |
42 | - | getStringValue( | |
44 | + | let t = s | |
45 | + | getStringValue(m[r]) | |
43 | 46 | } | |
44 | 47 | else "" | |
45 | 48 | } | |
46 | 49 | ||
47 | - | func | |
50 | + | func v (r) = if (if ((r > (n - 1))) | |
48 | 51 | then true | |
49 | - | else (0 > | |
50 | - | then | |
51 | - | else if ((r | |
52 | - | then [ | |
52 | + | else (0 > q(r))) | |
53 | + | then o | |
54 | + | else if ((u(r) == "")) | |
55 | + | then [m[r], makeString(p, c), a, e] | |
53 | 56 | else { | |
54 | - | let | |
55 | - | let | |
56 | - | let | |
57 | - | [ | |
57 | + | let w = split(getStringValue(m[r]), c) | |
58 | + | let x = parseIntValue(w[1]) | |
59 | + | let y = w[0] | |
60 | + | [m[r], makeString([i, toString(fraction(x, (100 + d), 100)), k, l], c), y, toString(x)] | |
58 | 61 | } | |
59 | 62 | ||
60 | - | let | |
61 | - | let | |
62 | - | let | |
63 | + | let z = [v(0), v(1), v(2), v(3), v(4), v(5), v(6), v(7), v(8), v(9)] | |
64 | + | let A = toString((((((((((parseIntValue(z[0][3]) + parseIntValue(z[1][3])) + parseIntValue(z[2][3])) + parseIntValue(z[3][3])) + parseIntValue(z[4][3])) + parseIntValue(z[5][3])) + parseIntValue(z[6][3])) + parseIntValue(z[7][3])) + parseIntValue(z[8][3])) + parseIntValue(z[9][3]))) | |
65 | + | let B = if ((size(g.payments) == 1)) | |
63 | 66 | then g.payments[0] | |
64 | - | else throw | |
65 | - | if (isDefined( | |
67 | + | else throw(("Attached payment is required: " + A)) | |
68 | + | if (isDefined(B.assetId)) | |
66 | 69 | then throw("works with waves only") | |
67 | - | else if ((parseIntValue( | |
68 | - | then throw(((("you give: " + toString( | |
69 | - | else $Tuple2([StringEntry( | |
70 | + | else if ((parseIntValue(A) > B.amount)) | |
71 | + | then throw(((("you give: " + toString(B.amount)) + ", but deal needs: ") + A)) | |
72 | + | else $Tuple2([StringEntry(z[0][0], z[0][1]), ScriptTransfer(Address(fromBase58String(z[0][2])), parseIntValue(z[0][3]), unit), StringEntry(z[1][0], z[1][1]), ScriptTransfer(Address(fromBase58String(z[1][2])), parseIntValue(z[1][3]), unit), StringEntry(z[2][0], z[2][1]), ScriptTransfer(Address(fromBase58String(z[2][2])), parseIntValue(z[2][3]), unit), StringEntry(z[3][0], z[3][1]), ScriptTransfer(Address(fromBase58String(z[3][2])), parseIntValue(z[3][3]), unit), StringEntry(z[4][0], z[4][1]), ScriptTransfer(Address(fromBase58String(z[4][2])), parseIntValue(z[4][3]), unit), StringEntry(z[5][0], z[5][1]), ScriptTransfer(Address(fromBase58String(z[5][2])), parseIntValue(z[5][3]), unit), StringEntry(z[6][0], z[6][1]), ScriptTransfer(Address(fromBase58String(z[6][2])), parseIntValue(z[6][3]), unit), StringEntry(z[7][0], z[7][1]), ScriptTransfer(Address(fromBase58String(z[7][2])), parseIntValue(z[7][3]), unit), StringEntry(z[8][0], z[8][1]), ScriptTransfer(Address(fromBase58String(z[8][2])), parseIntValue(z[8][3]), unit), StringEntry(z[9][0], z[9][1]), ScriptTransfer(Address(fromBase58String(z[9][2])), parseIntValue(z[9][3]), unit), ScriptTransfer(g.caller, (B.amount - parseIntValue(A)), unit)], unit) | |
70 | 73 | } | |
71 | 74 | ||
72 | 75 |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 5 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let a = "3MuW4t1jCXHt8WRsHVLUar32EnvJxZaQWAx" | |
5 | 5 | ||
6 | 6 | let b = Address(base58'3MuW4t1jCXHt8WRsHVLUar32EnvJxZaQWAx') | |
7 | 7 | ||
8 | 8 | let c = "|||||" | |
9 | 9 | ||
10 | 10 | let d = 50 | |
11 | 11 | ||
12 | 12 | let e = "100000" | |
13 | 13 | ||
14 | 14 | let f = 1 | |
15 | 15 | ||
16 | 16 | @Callable(g) | |
17 | 17 | func paint (h) = { | |
18 | 18 | let i = toBase58String(g.caller.bytes) | |
19 | - | let j = split(h, c) | |
20 | - | let k = min([10, size(j)]) | |
21 | - | let l = ["--", "--", a, "0"] | |
22 | - | let m = [i, e, "color", "url"] | |
23 | - | func n (o) = { | |
24 | - | let p = parseInt(j[o]) | |
25 | - | if ($isInstanceOf(p, "Int")) | |
19 | + | let j = split(h, "-|-") | |
20 | + | let k = j[1] | |
21 | + | let l = j[2] | |
22 | + | let m = split(j[0], c) | |
23 | + | let n = min([10, size(m)]) | |
24 | + | let o = ["--", "--", a, "0"] | |
25 | + | let p = [i, e, k, l] | |
26 | + | func q (r) = { | |
27 | + | let s = parseInt(m[r]) | |
28 | + | if ($isInstanceOf(s, "Int")) | |
26 | 29 | then { | |
27 | - | let | |
28 | - | if (if ((parseIntValue( | |
29 | - | then (1000 > parseIntValue( | |
30 | + | let t = s | |
31 | + | if (if ((parseIntValue(m[r]) > -1)) | |
32 | + | then (1000 > parseIntValue(m[r])) | |
30 | 33 | else false) | |
31 | - | then parseIntValue( | |
34 | + | then parseIntValue(m[r]) | |
32 | 35 | else -1 | |
33 | 36 | } | |
34 | 37 | else -1 | |
35 | 38 | } | |
36 | 39 | ||
37 | - | func | |
38 | - | let | |
39 | - | if ($isInstanceOf( | |
40 | + | func u (r) = { | |
41 | + | let s = getString(m[r]) | |
42 | + | if ($isInstanceOf(s, "String")) | |
40 | 43 | then { | |
41 | - | let | |
42 | - | getStringValue( | |
44 | + | let t = s | |
45 | + | getStringValue(m[r]) | |
43 | 46 | } | |
44 | 47 | else "" | |
45 | 48 | } | |
46 | 49 | ||
47 | - | func | |
50 | + | func v (r) = if (if ((r > (n - 1))) | |
48 | 51 | then true | |
49 | - | else (0 > | |
50 | - | then | |
51 | - | else if ((r | |
52 | - | then [ | |
52 | + | else (0 > q(r))) | |
53 | + | then o | |
54 | + | else if ((u(r) == "")) | |
55 | + | then [m[r], makeString(p, c), a, e] | |
53 | 56 | else { | |
54 | - | let | |
55 | - | let | |
56 | - | let | |
57 | - | [ | |
57 | + | let w = split(getStringValue(m[r]), c) | |
58 | + | let x = parseIntValue(w[1]) | |
59 | + | let y = w[0] | |
60 | + | [m[r], makeString([i, toString(fraction(x, (100 + d), 100)), k, l], c), y, toString(x)] | |
58 | 61 | } | |
59 | 62 | ||
60 | - | let | |
61 | - | let | |
62 | - | let | |
63 | + | let z = [v(0), v(1), v(2), v(3), v(4), v(5), v(6), v(7), v(8), v(9)] | |
64 | + | let A = toString((((((((((parseIntValue(z[0][3]) + parseIntValue(z[1][3])) + parseIntValue(z[2][3])) + parseIntValue(z[3][3])) + parseIntValue(z[4][3])) + parseIntValue(z[5][3])) + parseIntValue(z[6][3])) + parseIntValue(z[7][3])) + parseIntValue(z[8][3])) + parseIntValue(z[9][3]))) | |
65 | + | let B = if ((size(g.payments) == 1)) | |
63 | 66 | then g.payments[0] | |
64 | - | else throw | |
65 | - | if (isDefined( | |
67 | + | else throw(("Attached payment is required: " + A)) | |
68 | + | if (isDefined(B.assetId)) | |
66 | 69 | then throw("works with waves only") | |
67 | - | else if ((parseIntValue( | |
68 | - | then throw(((("you give: " + toString( | |
69 | - | else $Tuple2([StringEntry( | |
70 | + | else if ((parseIntValue(A) > B.amount)) | |
71 | + | then throw(((("you give: " + toString(B.amount)) + ", but deal needs: ") + A)) | |
72 | + | else $Tuple2([StringEntry(z[0][0], z[0][1]), ScriptTransfer(Address(fromBase58String(z[0][2])), parseIntValue(z[0][3]), unit), StringEntry(z[1][0], z[1][1]), ScriptTransfer(Address(fromBase58String(z[1][2])), parseIntValue(z[1][3]), unit), StringEntry(z[2][0], z[2][1]), ScriptTransfer(Address(fromBase58String(z[2][2])), parseIntValue(z[2][3]), unit), StringEntry(z[3][0], z[3][1]), ScriptTransfer(Address(fromBase58String(z[3][2])), parseIntValue(z[3][3]), unit), StringEntry(z[4][0], z[4][1]), ScriptTransfer(Address(fromBase58String(z[4][2])), parseIntValue(z[4][3]), unit), StringEntry(z[5][0], z[5][1]), ScriptTransfer(Address(fromBase58String(z[5][2])), parseIntValue(z[5][3]), unit), StringEntry(z[6][0], z[6][1]), ScriptTransfer(Address(fromBase58String(z[6][2])), parseIntValue(z[6][3]), unit), StringEntry(z[7][0], z[7][1]), ScriptTransfer(Address(fromBase58String(z[7][2])), parseIntValue(z[7][3]), unit), StringEntry(z[8][0], z[8][1]), ScriptTransfer(Address(fromBase58String(z[8][2])), parseIntValue(z[8][3]), unit), StringEntry(z[9][0], z[9][1]), ScriptTransfer(Address(fromBase58String(z[9][2])), parseIntValue(z[9][3]), unit), ScriptTransfer(g.caller, (B.amount - parseIntValue(A)), unit)], unit) | |
70 | 73 | } | |
71 | 74 | ||
72 | 75 |
github/deemru/w8io/169f3d6 130.25 ms ◑