tx · CnnFS95brwB4C8T4Eo9gTJzUYd99oMkpu1wBs49ipfiG 3N9b7vExDf2qqZt2xG9FUsca7iwLVuih1Ta: -0.01000000 Waves 2023.12.01 23:11 [2868045] smart account 3N9b7vExDf2qqZt2xG9FUsca7iwLVuih1Ta > SELF 0.00000000 Waves
{ "type": 13, "id": "CnnFS95brwB4C8T4Eo9gTJzUYd99oMkpu1wBs49ipfiG", "fee": 1000000, "feeAssetId": null, "timestamp": 1701461574886, "version": 2, "chainId": 84, "sender": "3N9b7vExDf2qqZt2xG9FUsca7iwLVuih1Ta", "senderPublicKey": "4rSYGN3SSXzknh6jLyLqqGdGor584DXdjdP2BAbz7kgt", "proofs": [ "4ayqBN3F4bCMtLjAuBVbKqgBNkjQhpu2o6XYhXfz6MJnuUjx4dV6qKe11XKCiBRXxUM7BsBqf4wZ82nMXtaXHrDf" ], "script": "base64:AAIFAAAAAAAAABcIAhIGCgQIAQgBEgMKAQgSBgoECAgBAQAAAAwAAAAACWRldmVsb3BlcgkBAAAAEUBleHRyTmF0aXZlKDEwNjIpAAAAAQIAAAAjM01wNlRUaHZiYjh6OW5wcXo0QUszQnlxQWJ2czdkWVM4dVIBAAAACmtleVBhcnRuZXIAAAABAAAAB2FkZHJlc3MJAAEsAAAAAgIAAAAPJXMlc19fcGFydG5lcl9fBQAAAAdhZGRyZXNzAQAAABBrZXlXYW50ZWRBc3NldElkAAAAAQAAAAdhZGRyZXNzCQABLAAAAAICAAAAFSVzJXNfX3dhbnRlZEFzc2V0SWRfXwUAAAAHYWRkcmVzcwEAAAAPa2V5V2FudGVkQW1vdW50AAAAAQAAAAdhZGRyZXNzCQABLAAAAAICAAAAFCVzJXNfX3dhbnRlZEFtb3VudF9fBQAAAAdhZGRyZXNzAQAAAAprZXlBc3NldElkAAAAAQAAAAdvcmRlcklkCQABLAAAAAICAAAADyVzJXNfX2Fzc2V0SWRfXwUAAAAHb3JkZXJJZAEAAAAJa2V5QW1vdW50AAAAAQAAAAdvcmRlcklkC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lrZXlBbW91bnQAAAABBQAAAAdvcmRlcklkCQAETAAAAAIJAQAAAAtEZWxldGVFbnRyeQAAAAEJAQAAAAprZXlPcmRlcklkAAAAAQUAAAAHb3JkZXJJZAkABEwAAAACCQEAAAALRGVsZXRlRW50cnkAAAABCQEAAAAKa2V5QXNzZXRJZAAAAAEFAAAAB29yZGVySWQFAAAAA25pbAkABEwAAAACCQEAAAAOU2NyaXB0VHJhbnNmZXIAAAADCQEAAAARQGV4dHJOYXRpdmUoMTA2MikAAAABBQAAAAdhZGRyZXNzBQAAAAZhbW91bnQJAQAAAAdmcm9tU3RyAAAAAQUAAAAKYXNzZXRJZFN0cgkABEwAAAACCQEAAAALRGVsZXRlRW50cnkAAAABCQEAAAAJa2V5QW1vdW50AAAAAQUAAAAHb3JkZXJJZAkABEwAAAACCQEAAAAMSW50ZWdlckVudHJ5AAAAAgkBAAAACWtleUFtb3VudAAAAAEFAAAAB29yZGVySWQFAAAACnJlc3RBbW91bnQFAAAAA25pbAAAAAAL5/dZ", "height": 2868045, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 8WBzB2Bc7YQqu9F7FEuX4Hrgxzq68tq9WJ1PCdmdrRjL Next: 9uyGipg739uoFwLUX6oxCfZNj85RqASz53qrKpSit3e5 Diff:
Old | New | Differences | |
---|---|---|---|
24 | 24 | func j (g) = ("%s%s__serviceFee__" + g) | |
25 | 25 | ||
26 | 26 | ||
27 | - | func k (l) = if ((l == unit)) | |
28 | - | then "WAVES" | |
29 | - | else toBase58String(value(l)) | |
27 | + | func k (l) = l | |
30 | 28 | ||
31 | 29 | ||
32 | - | func m (n) = if ((n == | |
33 | - | then | |
34 | - | else | |
30 | + | func m (n) = if ((n == unit)) | |
31 | + | then "WAVES" | |
32 | + | else toBase58String(value(n)) | |
35 | 33 | ||
36 | 34 | ||
37 | - | func o (l) = { | |
38 | - | let p = m(l) | |
39 | - | if (if ((p != unit)) | |
40 | - | then (assetInfo(value(p)) == unit) | |
35 | + | func o (p) = if ((p == "WAVES")) | |
36 | + | then unit | |
37 | + | else fromBase58String(p) | |
38 | + | ||
39 | + | ||
40 | + | func q (n) = { | |
41 | + | let r = o(n) | |
42 | + | if (if ((r != unit)) | |
43 | + | then (assetInfo(value(r)) == unit) | |
41 | 44 | else false) | |
42 | 45 | then throw("Invalid assetId: assetInfo missing") | |
43 | - | else | |
46 | + | else m(r) | |
44 | 47 | } | |
45 | 48 | ||
46 | 49 | ||
47 | - | @Callable( | |
48 | - | func escrow (g, | |
50 | + | @Callable(s) | |
51 | + | func escrow (g,l,n,t) = if (isDefined(getString(this, i(g)))) | |
49 | 52 | then throw(("You already have an order with this id: " + g)) | |
50 | - | else if ((0 >= | |
53 | + | else if ((0 >= l)) | |
51 | 54 | then throw("Non-positive order amount") | |
52 | 55 | else { | |
53 | - | let | |
54 | - | [IntegerEntry(j(g), | |
56 | + | let u = (l - t) | |
57 | + | [IntegerEntry(j(g), t), IntegerEntry(h(g), u), StringEntry(i(g), g), StringEntry(f(g), n)] | |
55 | 58 | } | |
56 | 59 | ||
57 | 60 | ||
58 | 61 | ||
59 | - | @Callable( | |
62 | + | @Callable(s) | |
60 | 63 | func cancel (g) = if (!(isDefined(i(g)))) | |
61 | 64 | then throw(("You don't have an order with this id: " + g)) | |
62 | 65 | else { | |
63 | - | let | |
64 | - | let | |
65 | - | let | |
66 | - | let | |
67 | - | [ScriptTransfer( | |
66 | + | let v = getIntegerValue(h(g)) | |
67 | + | let w = f(g) | |
68 | + | let x = getString(this, w) | |
69 | + | let p = value(x) | |
70 | + | [ScriptTransfer(s.caller, v, o(p)), ScriptTransfer(a, toInt(toBytes(value(j(g)))), o(p)), DeleteEntry(j(g)), DeleteEntry(h(g)), DeleteEntry(i(g)), DeleteEntry(f(g))] | |
68 | 71 | } | |
69 | 72 | ||
70 | 73 | ||
71 | 74 | ||
72 | - | @Callable( | |
73 | - | func deal (g,c, | |
75 | + | @Callable(s) | |
76 | + | func deal (g,c,l,y) = if (!(isDefined(i(g)))) | |
74 | 77 | then throw(("You don't have an order with this id: " + g)) | |
75 | - | else if (( | |
78 | + | else if ((l > toInt(toBytes(value(h(g)))))) | |
76 | 79 | then throw("The transaction cannot be executed because the seller does not have enough funds") | |
77 | 80 | else { | |
78 | - | let | |
79 | - | let | |
80 | - | let | |
81 | - | let | |
82 | - | if (( | |
83 | - | then [ScriptTransfer(addressFromStringValue(c), | |
84 | - | else [ScriptTransfer(addressFromStringValue(c), | |
81 | + | let v = (toInt(toBytes(value(h(g)))) - l) | |
82 | + | let w = f(g) | |
83 | + | let x = getString(this, w) | |
84 | + | let p = value(x) | |
85 | + | if ((y > v)) | |
86 | + | then [ScriptTransfer(addressFromStringValue(c), l, o(p)), ScriptTransfer(s.caller, v, o(p)), ScriptTransfer(a, toInt(toBytes(value(j(g)))), o(p)), DeleteEntry(j(g)), DeleteEntry(h(g)), DeleteEntry(i(g)), DeleteEntry(f(g))] | |
87 | + | else [ScriptTransfer(addressFromStringValue(c), l, o(p)), DeleteEntry(h(g)), IntegerEntry(h(g), v)] | |
85 | 88 | } | |
86 | 89 | ||
87 | 90 |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 5 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let a = addressFromStringValue("3Mp6TThvbb8z9npqz4AK3ByqAbvs7dYS8uR") | |
5 | 5 | ||
6 | 6 | func b (c) = ("%s%s__partner__" + c) | |
7 | 7 | ||
8 | 8 | ||
9 | 9 | func d (c) = ("%s%s__wantedAssetId__" + c) | |
10 | 10 | ||
11 | 11 | ||
12 | 12 | func e (c) = ("%s%s__wantedAmount__" + c) | |
13 | 13 | ||
14 | 14 | ||
15 | 15 | func f (g) = ("%s%s__assetId__" + g) | |
16 | 16 | ||
17 | 17 | ||
18 | 18 | func h (g) = ("%s%s__amount__" + g) | |
19 | 19 | ||
20 | 20 | ||
21 | 21 | func i (g) = ("%s%s__orderId__" + g) | |
22 | 22 | ||
23 | 23 | ||
24 | 24 | func j (g) = ("%s%s__serviceFee__" + g) | |
25 | 25 | ||
26 | 26 | ||
27 | - | func k (l) = if ((l == unit)) | |
28 | - | then "WAVES" | |
29 | - | else toBase58String(value(l)) | |
27 | + | func k (l) = l | |
30 | 28 | ||
31 | 29 | ||
32 | - | func m (n) = if ((n == | |
33 | - | then | |
34 | - | else | |
30 | + | func m (n) = if ((n == unit)) | |
31 | + | then "WAVES" | |
32 | + | else toBase58String(value(n)) | |
35 | 33 | ||
36 | 34 | ||
37 | - | func o (l) = { | |
38 | - | let p = m(l) | |
39 | - | if (if ((p != unit)) | |
40 | - | then (assetInfo(value(p)) == unit) | |
35 | + | func o (p) = if ((p == "WAVES")) | |
36 | + | then unit | |
37 | + | else fromBase58String(p) | |
38 | + | ||
39 | + | ||
40 | + | func q (n) = { | |
41 | + | let r = o(n) | |
42 | + | if (if ((r != unit)) | |
43 | + | then (assetInfo(value(r)) == unit) | |
41 | 44 | else false) | |
42 | 45 | then throw("Invalid assetId: assetInfo missing") | |
43 | - | else | |
46 | + | else m(r) | |
44 | 47 | } | |
45 | 48 | ||
46 | 49 | ||
47 | - | @Callable( | |
48 | - | func escrow (g, | |
50 | + | @Callable(s) | |
51 | + | func escrow (g,l,n,t) = if (isDefined(getString(this, i(g)))) | |
49 | 52 | then throw(("You already have an order with this id: " + g)) | |
50 | - | else if ((0 >= | |
53 | + | else if ((0 >= l)) | |
51 | 54 | then throw("Non-positive order amount") | |
52 | 55 | else { | |
53 | - | let | |
54 | - | [IntegerEntry(j(g), | |
56 | + | let u = (l - t) | |
57 | + | [IntegerEntry(j(g), t), IntegerEntry(h(g), u), StringEntry(i(g), g), StringEntry(f(g), n)] | |
55 | 58 | } | |
56 | 59 | ||
57 | 60 | ||
58 | 61 | ||
59 | - | @Callable( | |
62 | + | @Callable(s) | |
60 | 63 | func cancel (g) = if (!(isDefined(i(g)))) | |
61 | 64 | then throw(("You don't have an order with this id: " + g)) | |
62 | 65 | else { | |
63 | - | let | |
64 | - | let | |
65 | - | let | |
66 | - | let | |
67 | - | [ScriptTransfer( | |
66 | + | let v = getIntegerValue(h(g)) | |
67 | + | let w = f(g) | |
68 | + | let x = getString(this, w) | |
69 | + | let p = value(x) | |
70 | + | [ScriptTransfer(s.caller, v, o(p)), ScriptTransfer(a, toInt(toBytes(value(j(g)))), o(p)), DeleteEntry(j(g)), DeleteEntry(h(g)), DeleteEntry(i(g)), DeleteEntry(f(g))] | |
68 | 71 | } | |
69 | 72 | ||
70 | 73 | ||
71 | 74 | ||
72 | - | @Callable( | |
73 | - | func deal (g,c, | |
75 | + | @Callable(s) | |
76 | + | func deal (g,c,l,y) = if (!(isDefined(i(g)))) | |
74 | 77 | then throw(("You don't have an order with this id: " + g)) | |
75 | - | else if (( | |
78 | + | else if ((l > toInt(toBytes(value(h(g)))))) | |
76 | 79 | then throw("The transaction cannot be executed because the seller does not have enough funds") | |
77 | 80 | else { | |
78 | - | let | |
79 | - | let | |
80 | - | let | |
81 | - | let | |
82 | - | if (( | |
83 | - | then [ScriptTransfer(addressFromStringValue(c), | |
84 | - | else [ScriptTransfer(addressFromStringValue(c), | |
81 | + | let v = (toInt(toBytes(value(h(g)))) - l) | |
82 | + | let w = f(g) | |
83 | + | let x = getString(this, w) | |
84 | + | let p = value(x) | |
85 | + | if ((y > v)) | |
86 | + | then [ScriptTransfer(addressFromStringValue(c), l, o(p)), ScriptTransfer(s.caller, v, o(p)), ScriptTransfer(a, toInt(toBytes(value(j(g)))), o(p)), DeleteEntry(j(g)), DeleteEntry(h(g)), DeleteEntry(i(g)), DeleteEntry(f(g))] | |
87 | + | else [ScriptTransfer(addressFromStringValue(c), l, o(p)), DeleteEntry(h(g)), IntegerEntry(h(g), v)] | |
85 | 88 | } | |
86 | 89 | ||
87 | 90 |
github/deemru/w8io/026f985 54.97 ms ◑