tx · AZt6vvMZmHsNEyMMYzWiVYbURRfQA6CAfaBZmearKsan 3MuwmoHDxZZP9bGwExfL3L8JpMU5r95oBr8: -0.01400000 Waves 2021.12.20 22:16 [1842991] smart account 3MuwmoHDxZZP9bGwExfL3L8JpMU5r95oBr8 > SELF 0.00000000 Waves
{ "type": 13, "id": "AZt6vvMZmHsNEyMMYzWiVYbURRfQA6CAfaBZmearKsan", "fee": 1400000, "feeAssetId": null, "timestamp": 1640027786365, "version": 2, "chainId": 84, "sender": "3MuwmoHDxZZP9bGwExfL3L8JpMU5r95oBr8", "senderPublicKey": "B8mXne2bErXPSLJvpntKVoudEBjypi3Ag6RfxqTr5pEg", "proofs": [ "44KtjX9JNX8cfhszxUX1FXLxFGdihzKzosv2DYVcE5XZNfC3EU3PWcaxWhwkEnVxEpaiLXo5GVfFES2YAVDnhoTb" ], "script": "base64:AAIFAAAAAAAAAU0IAhIGCgQICAgIEgMKAQgSAwoBCBIDCgEIGgwKAWESB25hbWVLZXkaDAoBYhIHbmFtZVVybBoTCgFjEg5kZXNjcmlwdGlvbktleRoQCgFkEgtpcGZzSGFzaEtleRoPCgFlEgphZGRyZXNzS2V5Gg4KAWYSCXN0YXR1c0tleRoMCgFnEgd2b3RlS2V5Gg4KAWgSCWNoZWNrVm90ZRoPCgFpEgpudW1iZXJWb3RlGgsKAWoSBnZvaWNlcxoICgFrEgNpbnYaCQoBbBIEbmFtZRoQCgFtEgtkZXNjcmlwdGlvbhoJCgFuEgRoYXNoGg8KAW8SCmxpc3RWb3RpbmcaDAoBcBIHYWRkcmVzcxoJCgFxEgRsaXN0GgoKAXISBWluZGV4GgwKAXMSByRtYXRjaDAaBgoBdBIBdBoHCgF1EgJ0eBoLCgF2EgZ2ZXJpZnkAAAAHAQAAAAFhAAAAAQAAAAFiCQABLAAAAAIFAAAAAWICAAAABV9uYW1lAQAAAAFjAAAAAQAAAAFiCQABLAAAAAIFAAAAAWICAAAADF9kZXNjcmlwdGlvbgEAAAABZAAAAAEA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AAAACCQACWAAAAAEICAUAAAABawAAAAZjYWxsZXIAAAAFYnl0ZXMJAAJYAAAAAQgFAAAABHRoaXMAAAAFYnl0ZXMJAAACAAAAAQIAAAAPWW91IGRvbid0IG93bmVyAwkBAAAAASEAAAABCQEAAAAPY29udGFpbnNFbGVtZW50AAAAAgUAAAABbwUAAAABcAkAAAIAAAABAgAAABlUaGlzIGFkZHJlc3Mgd2Fzbid0IGFkZGVkBAAAAAFyBAAAAAFzCQAETwAAAAIFAAAAAW8FAAAAAXADCQAAAQAAAAIFAAAAAXMCAAAAA0ludAQAAAABdAUAAAABcwUAAAABdAAAAAAAAAAAAAQAAAABcQkABFEAAAACBQAAAAFvBQAAAAFyCQAETAAAAAIJAQAAAAtTdHJpbmdFbnRyeQAAAAICAAAADXZvdGluZ19tZW1iZXIJAAS5AAAAAgUAAAABcQIAAAABLAUAAAADbmlsAAAAAQAAAAF1AQAAAAF2AAAAAAkAAfQAAAADCAUAAAABdQAAAAlib2R5Qnl0ZXMJAAGRAAAAAggFAAAAAXUAAAAGcHJvb2ZzAAAAAAAAAAAACAUAAAABdQAAAA9zZW5kZXJQdWJsaWNLZXmH9B/5", "height": 1842991, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 7gMyjDVw22JVZcbqKEcZikht2mtgvtkPJ9hZmL2QPJ9M Next: DwJhDwmc65yYUnVdkMX4WroSiBhY8DdUnG4EE8cATU6t Diff:
Old | New | Differences | |
---|---|---|---|
25 | 25 | ||
26 | 26 | ||
27 | 27 | @Callable(inv) | |
28 | - | func verifyCollection (nameUrl,name,description,hash) = if ( | |
28 | + | func verifyCollection (nameUrl,name,description,hash) = if (false) | |
29 | 29 | then throw("This collection was create") | |
30 | 30 | else [StringEntry(nameKey(nameUrl), name), StringEntry(descriptionKey(nameUrl), description), StringEntry(addressKey(nameUrl), toBase58String(inv.caller.bytes)), StringEntry(ipfsHashKey(nameUrl), hash), StringEntry(statusKey(nameUrl), "VOTING"), IntegerEntry(voteKey(nameUrl), 0)] | |
31 | 31 |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 5 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | func nameKey (nameUrl) = (nameUrl + "_name") | |
5 | 5 | ||
6 | 6 | ||
7 | 7 | func descriptionKey (nameUrl) = (nameUrl + "_description") | |
8 | 8 | ||
9 | 9 | ||
10 | 10 | func ipfsHashKey (nameUrl) = (nameUrl + "_hash") | |
11 | 11 | ||
12 | 12 | ||
13 | 13 | func addressKey (nameUrl) = (nameUrl + "_address") | |
14 | 14 | ||
15 | 15 | ||
16 | 16 | func statusKey (nameUrl) = (nameUrl + "_status") | |
17 | 17 | ||
18 | 18 | ||
19 | 19 | func voteKey (nameUrl) = (nameUrl + "_vote") | |
20 | 20 | ||
21 | 21 | ||
22 | 22 | func checkVote (numberVote,voices) = if ((voices > (numberVote / 2))) | |
23 | 23 | then "VERIFY" | |
24 | 24 | else "VOTING" | |
25 | 25 | ||
26 | 26 | ||
27 | 27 | @Callable(inv) | |
28 | - | func verifyCollection (nameUrl,name,description,hash) = if ( | |
28 | + | func verifyCollection (nameUrl,name,description,hash) = if (false) | |
29 | 29 | then throw("This collection was create") | |
30 | 30 | else [StringEntry(nameKey(nameUrl), name), StringEntry(descriptionKey(nameUrl), description), StringEntry(addressKey(nameUrl), toBase58String(inv.caller.bytes)), StringEntry(ipfsHashKey(nameUrl), hash), StringEntry(statusKey(nameUrl), "VOTING"), IntegerEntry(voteKey(nameUrl), 0)] | |
31 | 31 | ||
32 | 32 | ||
33 | 33 | ||
34 | 34 | @Callable(inv) | |
35 | 35 | func vote (nameUrl) = { | |
36 | 36 | let listVoting = split(getStringValue("voting_member"), ",") | |
37 | 37 | if (!(containsElement(listVoting, toBase58String(inv.caller.bytes)))) | |
38 | 38 | then throw("You can't vote") | |
39 | 39 | else if ((statusKey(nameUrl) == "VERIFY")) | |
40 | 40 | then throw("Voting was ended") | |
41 | 41 | else { | |
42 | 42 | let voices = (getIntegerValue(voteKey(nameUrl)) + 1) | |
43 | 43 | [IntegerEntry(voteKey(nameUrl), voices), StringEntry(statusKey(nameUrl), checkVote(size(listVoting), voices))] | |
44 | 44 | } | |
45 | 45 | } | |
46 | 46 | ||
47 | 47 | ||
48 | 48 | ||
49 | 49 | @Callable(inv) | |
50 | 50 | func addVoting (address) = { | |
51 | 51 | let listVoting = split(getStringValue("voting_member"), ",") | |
52 | 52 | if ((toBase58String(inv.caller.bytes) != toBase58String(this.bytes))) | |
53 | 53 | then throw("You don't owner") | |
54 | 54 | else if (containsElement(listVoting, address)) | |
55 | 55 | then throw("This address was added") | |
56 | 56 | else { | |
57 | 57 | let list = address :: listVoting | |
58 | 58 | [StringEntry("voting_member", makeString(list, ","))] | |
59 | 59 | } | |
60 | 60 | } | |
61 | 61 | ||
62 | 62 | ||
63 | 63 | ||
64 | 64 | @Callable(inv) | |
65 | 65 | func removeVoting (address) = { | |
66 | 66 | let listVoting = split(getStringValue("voting_member"), ",") | |
67 | 67 | if ((toBase58String(inv.caller.bytes) != toBase58String(this.bytes))) | |
68 | 68 | then throw("You don't owner") | |
69 | 69 | else if (!(containsElement(listVoting, address))) | |
70 | 70 | then throw("This address wasn't added") | |
71 | 71 | else { | |
72 | 72 | let index = match indexOf(listVoting, address) { | |
73 | 73 | case t: Int => | |
74 | 74 | t | |
75 | 75 | case _ => | |
76 | 76 | 0 | |
77 | 77 | } | |
78 | 78 | let list = removeByIndex(listVoting, index) | |
79 | 79 | [StringEntry("voting_member", makeString(list, ","))] | |
80 | 80 | } | |
81 | 81 | } | |
82 | 82 | ||
83 | 83 | ||
84 | 84 | @Verifier(tx) | |
85 | 85 | func verify () = sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey) | |
86 | 86 |
github/deemru/w8io/026f985 38.56 ms ◑