tx · C1AZcjvKCf1xw3vAhKY7KyP48cjTTcyd6utuYEFxna6v
3N9R7u449Z1b76QpJp9u3gzPjMYQYnp3V7r: -0.04000000 Waves
2022.01.13 17:27 [1877300] smart account 3N9R7u449Z1b76QpJp9u3gzPjMYQYnp3V7r > SELF 0.00000000 Waves
{
"type": 13,
"id": "C1AZcjvKCf1xw3vAhKY7KyP48cjTTcyd6utuYEFxna6v",
"fee": 4000000,
"feeAssetId": null,
"timestamp": 1642084136285,
"version": 2,
"chainId": 84,
"sender": "3N9R7u449Z1b76QpJp9u3gzPjMYQYnp3V7r",
"senderPublicKey": "GUHw1jkstNWTs9SX1KM3pMtq9HXjupvxiTd1urNhNoyY",
"proofs": [
"5S9Mt8sCJ7NaS5cSzg9SGe6nDKCDXQKpdHEA4PrSsaiEMR64b7XTiZNoFhTzuSZFaAfs87TrjAQtssFjx4JUbtBy"
],
"script": "base64:AAIFAAAAAAAAARMIAhIFCgMICAgSAwoBCBoWCgFhEhFob2xkaW5nc1B1YmxpY0tleRoUCgFiEg9ob2xkaW5nc0FkZHJlc3MaFAoBYxIPdHJhbnNmZXJDb3N0UGN0GgYKAWQSAWkaDAoBZRIHb3duZXJJZBoMCgFmEgdhc3NldElkGgsKAWcSBmFtb3VudBoMCgFoEgckbWF0Y2gwGgYKAWkSAXgaEgoBahINcGF5bWVudEFtb3VudBodCgFrEhhhbW91bnRUb1JlbWFpbkluSG9sZGluZ3MaHAoBbBIXYW1vdW50VG9UcmFuc2ZlclRvT3duZXIaEQoBbRIMb3duZXJBZGRyZXNzGgcKAW4SAnR4GgsKAW8SBnZlcmlmeQAAAAMAAAAAAWEBAAAAIOXdIUWzo+xH6Wo3eUXXdqXp3i8rCPbDs0z4AYmX0NtvAAAAAAFiCQEAAAAUYWRkcmVzc0Zyb21QdWJsaWNLZXkAAAABBQAAAAFhAAAAAAFjAAAAAAAAAAAZAAAAAgAAAAFkAQAAABFhZGRPd25lckFuZEFtb3VudAAAAAMAAAABZQAAAAFmAAA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AZgAAAAIFAAAAAWcFAAAAAWoJAAACAAAAAQkAASwAAAACCQABLAAAAAIJAAEsAAAAAgIAAAAzUGF5bWVudCBhbmQgYW1vdW50IGRvIG5vdCBtYXRjaC4gVGhpcyBhc3NldHMgY29zdHMgCQABpAAAAAEFAAAAAWcCAAAADWJ1dCB5b3Ugc2VudCAJAAGkAAAAAQUAAAABagQAAAABawkAAGgAAAACBQAAAAFqCQAAaQAAAAIFAAAAAWMAAAAAAAAAA+gEAAAAAWwJAABlAAAAAgUAAAABagUAAAABawQAAAABbQkBAAAAB0FkZHJlc3MAAAABCQABmwAAAAEFAAAAAWUJAARMAAAAAgkBAAAADlNjcmlwdFRyYW5zZmVyAAAAAwgFAAAAAWQAAAAGY2FsbGVyAAAAAAAAAAABCQACWQAAAAEFAAAAAWYJAARMAAAAAgkBAAAADlNjcmlwdFRyYW5zZmVyAAAAAwUAAAABbQUAAAABbAUAAAAEdW5pdAUAAAADbmlsAAAAAQAAAAFuAQAAAAFvAAAAAAkAAfQAAAADCAUAAAABbgAAAAlib2R5Qnl0ZXMJAAGRAAAAAggFAAAAAW4AAAAGcHJvb2ZzAAAAAAAAAAAACAUAAAABbgAAAA9zZW5kZXJQdWJsaWNLZXlf/A2d",
"height": 1877300,
"applicationStatus": "succeeded",
"spentComplexity": 0
}
View: original | compacted
Prev: CrRaeNfF6h2xFQubBKjKttb6NqBVfGwUpBLEKLb6CKxL
Next: 5cnrbEwjRJSpQFMjXT8psszopyha9XTBYdCXKStfb1AY
Diff:
Old | New | | Differences |
---|
21 | 21 | | else if ($isInstanceOf(h, "String")) |
---|
22 | 22 | | then { |
---|
23 | 23 | | let i = h |
---|
24 | | - | i |
---|
| 24 | + | "unset" |
---|
25 | 25 | | } |
---|
26 | 26 | | else throw("Match error") |
---|
27 | 27 | | } |
---|
|
38 | 38 | | else throw("Match error") |
---|
39 | 39 | | } |
---|
40 | 40 | | if ((e == "unset")) |
---|
41 | | - | then throw("Original owner not found") |
---|
| 41 | + | then throw(("Original owner not found " + e)) |
---|
42 | 42 | | else if (if ((g == 0)) |
---|
43 | 43 | | then true |
---|
44 | 44 | | else (g > j)) |
---|
Full:
Old | New | | Differences |
---|
1 | 1 | | {-# STDLIB_VERSION 5 #-} |
---|
2 | 2 | | {-# SCRIPT_TYPE ACCOUNT #-} |
---|
3 | 3 | | {-# CONTENT_TYPE DAPP #-} |
---|
4 | 4 | | let a = base58'GUHw1jkstNWTs9SX1KM3pMtq9HXjupvxiTd1urNhNoyY' |
---|
5 | 5 | | |
---|
6 | 6 | | let b = addressFromPublicKey(a) |
---|
7 | 7 | | |
---|
8 | 8 | | let c = 25 |
---|
9 | 9 | | |
---|
10 | 10 | | @Callable(d) |
---|
11 | 11 | | func addOwnerAndAmount (e,f,g) = [StringEntry((("sale_" + f) + "_originalOwner"), e), StringEntry((("sale_" + f) + "_amount"), g)] |
---|
12 | 12 | | |
---|
13 | 13 | | |
---|
14 | 14 | | |
---|
15 | 15 | | @Callable(d) |
---|
16 | 16 | | func buyFromHoldings (f) = { |
---|
17 | 17 | | let e = { |
---|
18 | 18 | | let h = getString(this, (("sale_" + f) + "_originalOwner")) |
---|
19 | 19 | | if ($isInstanceOf(h, "Unit")) |
---|
20 | 20 | | then "unset" |
---|
21 | 21 | | else if ($isInstanceOf(h, "String")) |
---|
22 | 22 | | then { |
---|
23 | 23 | | let i = h |
---|
24 | | - | i |
---|
| 24 | + | "unset" |
---|
25 | 25 | | } |
---|
26 | 26 | | else throw("Match error") |
---|
27 | 27 | | } |
---|
28 | 28 | | let j = valueOrElse(d.payments[0].amount, 0) |
---|
29 | 29 | | let g = { |
---|
30 | 30 | | let h = getString(this, (("sale_" + f) + "_amount")) |
---|
31 | 31 | | if ($isInstanceOf(h, "Unit")) |
---|
32 | 32 | | then 0 |
---|
33 | 33 | | else if ($isInstanceOf(h, "String")) |
---|
34 | 34 | | then { |
---|
35 | 35 | | let i = h |
---|
36 | 36 | | (valueOrElse(parseInt(i), 0) * 100000000) |
---|
37 | 37 | | } |
---|
38 | 38 | | else throw("Match error") |
---|
39 | 39 | | } |
---|
40 | 40 | | if ((e == "unset")) |
---|
41 | | - | then throw("Original owner not found") |
---|
| 41 | + | then throw(("Original owner not found " + e)) |
---|
42 | 42 | | else if (if ((g == 0)) |
---|
43 | 43 | | then true |
---|
44 | 44 | | else (g > j)) |
---|
45 | 45 | | then throw(((("Payment and amount do not match. This assets costs " + toString(g)) + "but you sent ") + toString(j))) |
---|
46 | 46 | | else { |
---|
47 | 47 | | let k = (j * (c / 1000)) |
---|
48 | 48 | | let l = (j - k) |
---|
49 | 49 | | let m = Address(toBytes(e)) |
---|
50 | 50 | | [ScriptTransfer(d.caller, 1, fromBase58String(f)), ScriptTransfer(m, l, unit)] |
---|
51 | 51 | | } |
---|
52 | 52 | | } |
---|
53 | 53 | | |
---|
54 | 54 | | |
---|
55 | 55 | | @Verifier(n) |
---|
56 | 56 | | func o () = sigVerify(n.bodyBytes, n.proofs[0], n.senderPublicKey) |
---|
57 | 57 | | |
---|