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