tx · 6ZZGDGFNQLjXvU6jGVaZjyYx1cWQNoYvkLuftQqZ1awE 3N9b7vExDf2qqZt2xG9FUsca7iwLVuih1Ta: -0.01000000 Waves 2023.12.01 23:58 [2868089] smart account 3N9b7vExDf2qqZt2xG9FUsca7iwLVuih1Ta > SELF 0.00000000 Waves
{ "type": 13, "id": "6ZZGDGFNQLjXvU6jGVaZjyYx1cWQNoYvkLuftQqZ1awE", "fee": 1000000, "feeAssetId": null, "timestamp": 1701464322692, "version": 2, "chainId": 84, "sender": "3N9b7vExDf2qqZt2xG9FUsca7iwLVuih1Ta", "senderPublicKey": "4rSYGN3SSXzknh6jLyLqqGdGor584DXdjdP2BAbz7kgt", "proofs": [ "4EMnapbG3yo1ZgxqQ1uA1VRvjDv3oe4CtxMPZRPJWYmPKTWP5gWTKn6EAyAwtrJSbKer9KHt46LTBDdWCM4CDLq6" ], "script": "base64:AAIFAAAAAAAAABcIAhIGCgQIAQgBEgYKBAgIAQESAwoBCAAAAAwAAAAACWRldmVsb3BlcgkBAAAAEUBleHRyTmF0aXZlKDEwNjIpAAAAAQIAAAAjM01wNlRUaHZiYjh6OW5wcXo0QUszQnlxQWJ2czdkWVM4dVIBAAAACmtleVBhcnRuZXIAAAABAAAAB2FkZHJlc3MJAAEsAAAAAgIAAAAPJXMlc19fcGFydG5lcl9fBQAAAAdhZGRyZXNzAQAAABBrZXlXYW50ZWRBc3NldElkAAAAAQAAAAdhZGRyZXNzCQABLAAAAAICAAAAFSVzJXNfX3dhbnRlZEFzc2V0SWRfXwUAAAAHYWRkcmVzcwEAAAAPa2V5V2FudGVkQW1vdW50AAAAAQAAAAdhZGRyZXNzCQABLAAAAAICAAAAFCVzJXNfX3dhbnRlZEFtb3VudF9fBQAAAAdhZGRyZXNzAQAAAAprZXlBc3NldElkAAAAAQAAAAdvcmRlcklkCQABLAAAAAICAAAADyVzJXNfX2Fzc2V0SWRfXwUAAAAHb3JkZXJJZAEAAAAJa2V5QW1vdW50AAAAAQAAAAdvc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c2V0SWRTdHIJAARMAAAAAgkBAAAADlNjcmlwdFRyYW5zZmVyAAAAAwUAAAAJZGV2ZWxvcGVyCQEAAAARQGV4dHJOYXRpdmUoMTA1NSkAAAABCQEAAAANa2V5U2VydmljZUZlZQAAAAEFAAAAB29yZGVySWQJAQAAAAdmcm9tU3RyAAAAAQUAAAAKYXNzZXRJZFN0cgkABEwAAAACCQEAAAALRGVsZXRlRW50cnkAAAABCQEAAAANa2V5U2VydmljZUZlZQAAAAEFAAAAB29yZGVySWQJAARMAAAAAgkBAAAAC0RlbGV0ZUVudHJ5AAAAAQkBAAAACWtleUFtb3VudAAAAAEFAAAAB29yZGVySWQJAARMAAAAAgkBAAAAC0RlbGV0ZUVudHJ5AAAAAQkBAAAACmtleU9yZGVySWQAAAABBQAAAAdvcmRlcklkCQAETAAAAAIJAQAAAAtEZWxldGVFbnRyeQAAAAEJAQAAAAprZXlBc3NldElkAAAAAQUAAAAHb3JkZXJJZAUAAAADbmlsAAAAAGWGY3A=", "height": 2868089, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 5DaEjy3hJRafU133FQC5mc8sXmvUqBQuZ2oqJHX6Hc8b Next: J8up4RiDgz5Xik3tYrNmev5JGyhkPZ2FvRDgxsEVjrzV Diff:
Old | New | Differences | |
---|---|---|---|
60 | 60 | ||
61 | 61 | ||
62 | 62 | @Callable(s) | |
63 | - | func | |
63 | + | func deal (g,c,l,v) = if (!(isDefined(i(g)))) | |
64 | 64 | then throw(("You don't have an order with this id: " + g)) | |
65 | - | else { | |
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, getIntegerValue(j(g)), o(p)), DeleteEntry(j(g)), DeleteEntry(h(g)), DeleteEntry(i(g)), DeleteEntry(f(g))] | |
71 | - | } | |
65 | + | else if ((l > getIntegerValue(h(g)))) | |
66 | + | then throw("The transaction cannot be executed because the seller does not have enough funds") | |
67 | + | else { | |
68 | + | let w = (getIntegerValue(h(g)) - l) | |
69 | + | let x = f(g) | |
70 | + | let y = getString(this, x) | |
71 | + | let p = value(y) | |
72 | + | if ((v > w)) | |
73 | + | then [ScriptTransfer(addressFromStringValue(c), l, o(p)), ScriptTransfer(s.caller, w, o(p)), ScriptTransfer(a, getIntegerValue(j(g)), o(p)), DeleteEntry(j(g)), DeleteEntry(h(g)), DeleteEntry(i(g)), DeleteEntry(f(g))] | |
74 | + | else [ScriptTransfer(addressFromStringValue(c), l, o(p)), DeleteEntry(h(g)), IntegerEntry(h(g), w)] | |
75 | + | } | |
72 | 76 | ||
73 | 77 | ||
74 | 78 | ||
75 | 79 | @Callable(s) | |
76 | - | func | |
80 | + | func cancel (g) = if (!(isDefined(i(g)))) | |
77 | 81 | then throw(("You don't have an order with this id: " + g)) | |
78 | - | else if ((l > toInt(toBytes(value(h(g)))))) | |
79 | - | then throw("The transaction cannot be executed because the seller does not have enough funds") | |
80 | - | else { | |
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)] | |
88 | - | } | |
82 | + | else { | |
83 | + | let w = getIntegerValue(h(g)) | |
84 | + | let x = f(g) | |
85 | + | let y = getString(this, x) | |
86 | + | let p = value(y) | |
87 | + | [ScriptTransfer(s.caller, w, o(p)), ScriptTransfer(a, getIntegerValue(j(g)), o(p)), DeleteEntry(j(g)), DeleteEntry(h(g)), DeleteEntry(i(g)), DeleteEntry(f(g))] | |
88 | + | } | |
89 | 89 | ||
90 | 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 | 27 | func k (l) = l | |
28 | 28 | ||
29 | 29 | ||
30 | 30 | func m (n) = if ((n == unit)) | |
31 | 31 | then "WAVES" | |
32 | 32 | else toBase58String(value(n)) | |
33 | 33 | ||
34 | 34 | ||
35 | 35 | func o (p) = if ((p == "WAVES")) | |
36 | 36 | then unit | |
37 | 37 | else fromBase58String(p) | |
38 | 38 | ||
39 | 39 | ||
40 | 40 | func q (n) = { | |
41 | 41 | let r = o(n) | |
42 | 42 | if (if ((r != unit)) | |
43 | 43 | then (assetInfo(value(r)) == unit) | |
44 | 44 | else false) | |
45 | 45 | then throw("Invalid assetId: assetInfo missing") | |
46 | 46 | else m(r) | |
47 | 47 | } | |
48 | 48 | ||
49 | 49 | ||
50 | 50 | @Callable(s) | |
51 | 51 | func escrow (g,l,n,t) = if (isDefined(getString(this, i(g)))) | |
52 | 52 | then throw(("You already have an order with this id: " + g)) | |
53 | 53 | else if ((0 >= l)) | |
54 | 54 | then throw("Non-positive order amount") | |
55 | 55 | else { | |
56 | 56 | let u = (l - t) | |
57 | 57 | [IntegerEntry(j(g), t), IntegerEntry(h(g), u), StringEntry(i(g), g), StringEntry(f(g), n)] | |
58 | 58 | } | |
59 | 59 | ||
60 | 60 | ||
61 | 61 | ||
62 | 62 | @Callable(s) | |
63 | - | func | |
63 | + | func deal (g,c,l,v) = if (!(isDefined(i(g)))) | |
64 | 64 | then throw(("You don't have an order with this id: " + g)) | |
65 | - | else { | |
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, getIntegerValue(j(g)), o(p)), DeleteEntry(j(g)), DeleteEntry(h(g)), DeleteEntry(i(g)), DeleteEntry(f(g))] | |
71 | - | } | |
65 | + | else if ((l > getIntegerValue(h(g)))) | |
66 | + | then throw("The transaction cannot be executed because the seller does not have enough funds") | |
67 | + | else { | |
68 | + | let w = (getIntegerValue(h(g)) - l) | |
69 | + | let x = f(g) | |
70 | + | let y = getString(this, x) | |
71 | + | let p = value(y) | |
72 | + | if ((v > w)) | |
73 | + | then [ScriptTransfer(addressFromStringValue(c), l, o(p)), ScriptTransfer(s.caller, w, o(p)), ScriptTransfer(a, getIntegerValue(j(g)), o(p)), DeleteEntry(j(g)), DeleteEntry(h(g)), DeleteEntry(i(g)), DeleteEntry(f(g))] | |
74 | + | else [ScriptTransfer(addressFromStringValue(c), l, o(p)), DeleteEntry(h(g)), IntegerEntry(h(g), w)] | |
75 | + | } | |
72 | 76 | ||
73 | 77 | ||
74 | 78 | ||
75 | 79 | @Callable(s) | |
76 | - | func | |
80 | + | func cancel (g) = if (!(isDefined(i(g)))) | |
77 | 81 | then throw(("You don't have an order with this id: " + g)) | |
78 | - | else if ((l > toInt(toBytes(value(h(g)))))) | |
79 | - | then throw("The transaction cannot be executed because the seller does not have enough funds") | |
80 | - | else { | |
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)] | |
88 | - | } | |
82 | + | else { | |
83 | + | let w = getIntegerValue(h(g)) | |
84 | + | let x = f(g) | |
85 | + | let y = getString(this, x) | |
86 | + | let p = value(y) | |
87 | + | [ScriptTransfer(s.caller, w, o(p)), ScriptTransfer(a, getIntegerValue(j(g)), o(p)), DeleteEntry(j(g)), DeleteEntry(h(g)), DeleteEntry(i(g)), DeleteEntry(f(g))] | |
88 | + | } | |
89 | 89 | ||
90 | 90 |
github/deemru/w8io/026f985 40.75 ms ◑