tx · HR6G9oMDfJtMSmWCghPZBR54E2DkwneAFyuLD4W3aSvU
3N5yhZaotBLUGJ1EeegT2KC3iTdhAamcHJ9: -0.01400000 Waves
2019.07.04 00:38 [569790] smart account 3N5yhZaotBLUGJ1EeegT2KC3iTdhAamcHJ9 > SELF 0.00000000 Waves
{
"type": 13,
"id": "HR6G9oMDfJtMSmWCghPZBR54E2DkwneAFyuLD4W3aSvU",
"fee": 1400000,
"feeAssetId": null,
"timestamp": 1562189933073,
"version": 1,
"sender": "3N5yhZaotBLUGJ1EeegT2KC3iTdhAamcHJ9",
"senderPublicKey": "2kKaoCcJJ7XyWXm1bKS64QdpwGQpmaEcrToYuPd1k2nB",
"proofs": [
"3Qdu1SLhJBWjd1abwKiCx6uoPXnZhw57WvxBv3Re2zuSHG8whcHyU5g2qQC7xkmpg6v6g5BNCVspJXnQgM9GDD9"
],
"script": "base64:AAIDAAAAAAAAAAAAAAAOAAAAAAtCTEFDS0xJU1RFRAIAAAAJYmxhY2tsaXN0AAAAAAROT05FAgAAAARub25lAAAAAAh2ZXJpZmllcgIAAAAjM041eWhaYW90QkxVR0oxRWVlZ1QyS0MzaVRkaEFhbWNISjkAAAAACFZFUklGSUVEAgAAAAh2ZXJpZmllZAEAAAAPZ2V0S2V5SXRlbVByaWNlAAAAAQAAAARpdGVtCQABLAAAAAIFAAAABGl0ZW0CAAAABl9wcmljZQEAAAAOZ2V0S2V5SXRlbURhdGEAAAABAAAABGl0ZW0JAAEsAAAAAgUAAAAEaXRlbQIAAAAFX2RhdGEBAAAAEmdldEtleUl0ZW1TdXBwbGllcgAAAAEAAAAEaXRlbQkAASwAAAACBQAAAARpdGVtAgAAAAZfb3duZXIBAAAAC2dldFN0ckJ5S2V5AAAAAQAAAANrZXkEAAAAA3N0cgQAAAAHJG1hdGNoMAkABB0AAAACBQAAAAR0aGlzBQAAAANrZXkDCQAAAQAAAAIFAAAAByRtYXRjaDACAAAABlN0cmluZwQAAAABYQUAAAAHJG1hdGNoMAUAA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RzAwkAAAAAAAACBQAAABFzdXBwbGllcldoaXRlTGlzdAUAAAALQkxBQ0tMSVNURUQJAAACAAAAAQIAAAAnc3VwcGxpZXIncyBhY2NvdW50IGhhcyBiZWVuIGJsYWNrbGlzdGVkCQEAAAAIV3JpdGVTZXQAAAABCQAETAAAAAIJAQAAAAlEYXRhRW50cnkAAAACCQEAAAASZ2V0S2V5SXRlbVN1cHBsaWVyAAAAAQUAAAAEaXRlbQUAAAAPc3VwcGxpZXJBZGRyZXNzCQAETAAAAAIJAQAAAAlEYXRhRW50cnkAAAACCQEAAAAPZ2V0S2V5SXRlbVByaWNlAAAAAQUAAAAEaXRlbQUAAAAFcHJpY2UJAARMAAAAAgkBAAAACURhdGFFbnRyeQAAAAIJAQAAAA5nZXRLZXlJdGVtRGF0YQAAAAEFAAAABGl0ZW0FAAAABGRhdGEJAARMAAAAAgkBAAAACURhdGFFbnRyeQAAAAIJAQAAABxnZXRFeHRLZXlJdGVtV2hpdGVMaXN0U3RhdHVzAAAAAQUAAAAPc3VwcGxpZXJBZGRyZXNzBQAAABFzdXBwbGllcldoaXRlTGlzdAUAAAADbmlsAAAAABsgoNc=",
"chainId": 84,
"height": 569790,
"spentComplexity": 0
}
View: original | compacted
Prev: BC8QvNBEjfnmSJZxmbbb8qpBYCwY19GEnTgaoUCxKv9m
Next: none
Diff:
Old | New | | Differences |
---|
5 | 5 | | |
---|
6 | 6 | | let b = "none" |
---|
7 | 7 | | |
---|
8 | | - | func c (d) = (d + "_price") |
---|
| 8 | + | let c = "3N5yhZaotBLUGJ1EeegT2KC3iTdhAamcHJ9" |
---|
| 9 | + | |
---|
| 10 | + | let d = "verified" |
---|
| 11 | + | |
---|
| 12 | + | func e (f) = (f + "_price") |
---|
9 | 13 | | |
---|
10 | 14 | | |
---|
11 | | - | func e (d) = (d + "_data") |
---|
| 15 | + | func g (f) = (f + "_data") |
---|
12 | 16 | | |
---|
13 | 17 | | |
---|
14 | | - | func f (d) = (d + "_owner") |
---|
| 18 | + | func h (f) = (f + "_owner") |
---|
15 | 19 | | |
---|
16 | 20 | | |
---|
17 | | - | func g (h) = { |
---|
18 | | - | let i = { |
---|
19 | | - | let j = getString(this, h) |
---|
20 | | - | if ($isInstanceOf(j, "String")) |
---|
| 21 | + | func i (j) = { |
---|
| 22 | + | let k = { |
---|
| 23 | + | let l = getString(this, j) |
---|
| 24 | + | if ($isInstanceOf(l, "String")) |
---|
21 | 25 | | then { |
---|
22 | | - | let k = j |
---|
23 | | - | k |
---|
| 26 | + | let m = l |
---|
| 27 | + | m |
---|
24 | 28 | | } |
---|
25 | 29 | | else b |
---|
26 | 30 | | } |
---|
27 | | - | i |
---|
| 31 | + | k |
---|
28 | 32 | | } |
---|
29 | 33 | | |
---|
30 | 34 | | |
---|
31 | | - | func l (d) = g(f(d)) |
---|
| 35 | + | func n (f) = i(h(f)) |
---|
32 | 36 | | |
---|
33 | 37 | | |
---|
34 | | - | func m (n,o) = ("item_" + toBase58String(sha256(toBytes((n + o))))) |
---|
| 38 | + | func o (p,q) = ("item_" + toBase58String(sha256(toBytes((p + q))))) |
---|
35 | 39 | | |
---|
36 | 40 | | |
---|
37 | | - | func p () = extract(addressFromString("3N5yhZaotBLUGJ1EeegT2KC3iTdhAamcHJ9")) |
---|
| 41 | + | func r () = extract(addressFromString("3N5yhZaotBLUGJ1EeegT2KC3iTdhAamcHJ9")) |
---|
38 | 42 | | |
---|
39 | 43 | | |
---|
40 | | - | func q (r) = (r + "_verifier_status") |
---|
| 44 | + | func s (t) = (t + "_verifier_status") |
---|
41 | 45 | | |
---|
42 | 46 | | |
---|
43 | | - | func s (t,r) = { |
---|
44 | | - | let i = { |
---|
45 | | - | let j = getString(t, q(r)) |
---|
46 | | - | if ($isInstanceOf(j, "String")) |
---|
| 47 | + | func u (v,t) = { |
---|
| 48 | + | let k = { |
---|
| 49 | + | let l = getString(v, s(t)) |
---|
| 50 | + | if ($isInstanceOf(l, "String")) |
---|
47 | 51 | | then { |
---|
48 | | - | let k = j |
---|
49 | | - | k |
---|
| 52 | + | let m = l |
---|
| 53 | + | m |
---|
50 | 54 | | } |
---|
51 | 55 | | else b |
---|
52 | 56 | | } |
---|
53 | | - | i |
---|
| 57 | + | k |
---|
54 | 58 | | } |
---|
55 | 59 | | |
---|
56 | 60 | | |
---|
57 | | - | @Callable(u) |
---|
58 | | - | func addItem (o,v,w) = { |
---|
59 | | - | let x = toBase58String(u.caller.bytes) |
---|
60 | | - | let d = m(x, o) |
---|
61 | | - | let y = s(p(), x) |
---|
62 | | - | if ((0 >= v)) |
---|
| 61 | + | func w (f) = (f + "_verifier_status") |
---|
| 62 | + | |
---|
| 63 | + | |
---|
| 64 | + | @Callable(x) |
---|
| 65 | + | func setstatus (p,y) = { |
---|
| 66 | + | let t = toBase58String(x.caller.bytes) |
---|
| 67 | + | if ((t != c)) |
---|
| 68 | + | then throw("only oracle verifier are able to manage whitelist") |
---|
| 69 | + | else if (if ((y != d)) |
---|
| 70 | + | then (y != a) |
---|
| 71 | + | else false) |
---|
| 72 | + | then throw("wrong status") |
---|
| 73 | + | else WriteSet([DataEntry(w(p), y)]) |
---|
| 74 | + | } |
---|
| 75 | + | |
---|
| 76 | + | |
---|
| 77 | + | |
---|
| 78 | + | @Callable(x) |
---|
| 79 | + | func addItem (q,z,A) = { |
---|
| 80 | + | let B = toBase58String(x.caller.bytes) |
---|
| 81 | + | let f = o(B, q) |
---|
| 82 | + | let C = u(r(), B) |
---|
| 83 | + | if ((0 >= z)) |
---|
63 | 84 | | then throw("purchase amount cannot be less than item price") |
---|
64 | | - | else if ((l(d) != b)) |
---|
| 85 | + | else if ((n(f) != b)) |
---|
65 | 86 | | then throw("an item already exists") |
---|
66 | | - | else if ((y == a)) |
---|
| 87 | + | else if ((C == a)) |
---|
67 | 88 | | then throw("supplier's account has been blacklisted") |
---|
68 | | - | else WriteSet([DataEntry(f(d), x), DataEntry(c(d), v), DataEntry(e(d), w), DataEntry(q(x), y)]) |
---|
| 89 | + | else WriteSet([DataEntry(h(f), B), DataEntry(e(f), z), DataEntry(g(f), A), DataEntry(s(B), C)]) |
---|
69 | 90 | | } |
---|
70 | 91 | | |
---|
71 | 92 | | |
---|
Full:
Old | New | | Differences |
---|
1 | 1 | | {-# STDLIB_VERSION 3 #-} |
---|
2 | 2 | | {-# SCRIPT_TYPE ACCOUNT #-} |
---|
3 | 3 | | {-# CONTENT_TYPE DAPP #-} |
---|
4 | 4 | | let a = "blacklist" |
---|
5 | 5 | | |
---|
6 | 6 | | let b = "none" |
---|
7 | 7 | | |
---|
8 | | - | func c (d) = (d + "_price") |
---|
| 8 | + | let c = "3N5yhZaotBLUGJ1EeegT2KC3iTdhAamcHJ9" |
---|
| 9 | + | |
---|
| 10 | + | let d = "verified" |
---|
| 11 | + | |
---|
| 12 | + | func e (f) = (f + "_price") |
---|
9 | 13 | | |
---|
10 | 14 | | |
---|
11 | | - | func e (d) = (d + "_data") |
---|
| 15 | + | func g (f) = (f + "_data") |
---|
12 | 16 | | |
---|
13 | 17 | | |
---|
14 | | - | func f (d) = (d + "_owner") |
---|
| 18 | + | func h (f) = (f + "_owner") |
---|
15 | 19 | | |
---|
16 | 20 | | |
---|
17 | | - | func g (h) = { |
---|
18 | | - | let i = { |
---|
19 | | - | let j = getString(this, h) |
---|
20 | | - | if ($isInstanceOf(j, "String")) |
---|
| 21 | + | func i (j) = { |
---|
| 22 | + | let k = { |
---|
| 23 | + | let l = getString(this, j) |
---|
| 24 | + | if ($isInstanceOf(l, "String")) |
---|
21 | 25 | | then { |
---|
22 | | - | let k = j |
---|
23 | | - | k |
---|
| 26 | + | let m = l |
---|
| 27 | + | m |
---|
24 | 28 | | } |
---|
25 | 29 | | else b |
---|
26 | 30 | | } |
---|
27 | | - | i |
---|
| 31 | + | k |
---|
28 | 32 | | } |
---|
29 | 33 | | |
---|
30 | 34 | | |
---|
31 | | - | func l (d) = g(f(d)) |
---|
| 35 | + | func n (f) = i(h(f)) |
---|
32 | 36 | | |
---|
33 | 37 | | |
---|
34 | | - | func m (n,o) = ("item_" + toBase58String(sha256(toBytes((n + o))))) |
---|
| 38 | + | func o (p,q) = ("item_" + toBase58String(sha256(toBytes((p + q))))) |
---|
35 | 39 | | |
---|
36 | 40 | | |
---|
37 | | - | func p () = extract(addressFromString("3N5yhZaotBLUGJ1EeegT2KC3iTdhAamcHJ9")) |
---|
| 41 | + | func r () = extract(addressFromString("3N5yhZaotBLUGJ1EeegT2KC3iTdhAamcHJ9")) |
---|
38 | 42 | | |
---|
39 | 43 | | |
---|
40 | | - | func q (r) = (r + "_verifier_status") |
---|
| 44 | + | func s (t) = (t + "_verifier_status") |
---|
41 | 45 | | |
---|
42 | 46 | | |
---|
43 | | - | func s (t,r) = { |
---|
44 | | - | let i = { |
---|
45 | | - | let j = getString(t, q(r)) |
---|
46 | | - | if ($isInstanceOf(j, "String")) |
---|
| 47 | + | func u (v,t) = { |
---|
| 48 | + | let k = { |
---|
| 49 | + | let l = getString(v, s(t)) |
---|
| 50 | + | if ($isInstanceOf(l, "String")) |
---|
47 | 51 | | then { |
---|
48 | | - | let k = j |
---|
49 | | - | k |
---|
| 52 | + | let m = l |
---|
| 53 | + | m |
---|
50 | 54 | | } |
---|
51 | 55 | | else b |
---|
52 | 56 | | } |
---|
53 | | - | i |
---|
| 57 | + | k |
---|
54 | 58 | | } |
---|
55 | 59 | | |
---|
56 | 60 | | |
---|
57 | | - | @Callable(u) |
---|
58 | | - | func addItem (o,v,w) = { |
---|
59 | | - | let x = toBase58String(u.caller.bytes) |
---|
60 | | - | let d = m(x, o) |
---|
61 | | - | let y = s(p(), x) |
---|
62 | | - | if ((0 >= v)) |
---|
| 61 | + | func w (f) = (f + "_verifier_status") |
---|
| 62 | + | |
---|
| 63 | + | |
---|
| 64 | + | @Callable(x) |
---|
| 65 | + | func setstatus (p,y) = { |
---|
| 66 | + | let t = toBase58String(x.caller.bytes) |
---|
| 67 | + | if ((t != c)) |
---|
| 68 | + | then throw("only oracle verifier are able to manage whitelist") |
---|
| 69 | + | else if (if ((y != d)) |
---|
| 70 | + | then (y != a) |
---|
| 71 | + | else false) |
---|
| 72 | + | then throw("wrong status") |
---|
| 73 | + | else WriteSet([DataEntry(w(p), y)]) |
---|
| 74 | + | } |
---|
| 75 | + | |
---|
| 76 | + | |
---|
| 77 | + | |
---|
| 78 | + | @Callable(x) |
---|
| 79 | + | func addItem (q,z,A) = { |
---|
| 80 | + | let B = toBase58String(x.caller.bytes) |
---|
| 81 | + | let f = o(B, q) |
---|
| 82 | + | let C = u(r(), B) |
---|
| 83 | + | if ((0 >= z)) |
---|
63 | 84 | | then throw("purchase amount cannot be less than item price") |
---|
64 | | - | else if ((l(d) != b)) |
---|
| 85 | + | else if ((n(f) != b)) |
---|
65 | 86 | | then throw("an item already exists") |
---|
66 | | - | else if ((y == a)) |
---|
| 87 | + | else if ((C == a)) |
---|
67 | 88 | | then throw("supplier's account has been blacklisted") |
---|
68 | | - | else WriteSet([DataEntry(f(d), x), DataEntry(c(d), v), DataEntry(e(d), w), DataEntry(q(x), y)]) |
---|
| 89 | + | else WriteSet([DataEntry(h(f), B), DataEntry(e(f), z), DataEntry(g(f), A), DataEntry(s(B), C)]) |
---|
69 | 90 | | } |
---|
70 | 91 | | |
---|
71 | 92 | | |
---|