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